Something went wrong. Try again.
minimal agent cli memoria.tools
Something went wrong. Try again.
12345678910111213141516171819202122232425package input
// The input prompt state (RENDERING.md).//// Editing procs (insert, delete, move — edit.odin) are not implemented yet:// typing is not wired, so the prompt renders whatever bytes are in the// buffer. The invariants below are what edit will establish; render defends// against violations anyway.
State :: struct { bytes: [dynamic]u8, // prompt content, always valid UTF-8 position: int, // byte offset of the edit cursor, on a rune boundary}
// Caller owns the returned state and must destroy it with state_destroy.state_make :: proc(allocator := context.allocator) -> State { return State{bytes = make([dynamic]u8, 0, 64, allocator)}}
// Frees the prompt buffer and resets the state.state_destroy :: proc(state: ^State) { delete(state.bytes) state^ = State{}}