Something went wrong. Try again.
minimal agent cli memoria.tools
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364package main
import "./skills"import "./session"import "./ui/input"import "./ui/picker"import "core:time"
LOADING_INTERVAL :: 100 * time.MillisecondRequest_State :: enum { Idle, Prefix, // Ctrl-X prefix pending. Editor, // External editor request. New_Session, Compact, // Pending request; compacting tracks the in-flight lifecycle. Models, Sessions, Variants,}
Model :: struct { input_state: input.State, input_history_before: int, // Message index + 1; zero starts a fresh history search. skill_registry: ^skills.Registry, // Borrowed; owned by main. running: bool, request_state: Request_State, prompt_top_row: int, prompt_bottom_row: int, prompt_rows: int, stream: Stream, queued_prompt: string, agent: Agent_Run, compact_session: session.Session, session: session.Session, compacting: bool, // In-flight compaction, separate from its pending request. picker_event: picker.Event, model_choices: [dynamic]Model_Choice, session_choices: [dynamic]Session_Choice, variant_choices: [dynamic]Variant_Choice, catalog_request_id: u64, catalog_loading: bool,}
Render_State :: struct { input_rows: int, cursor_row: int, below_input_rows: int, has_rendered: bool,}
init :: proc() -> Model { model := Model { running = true, request_state = .Idle, } return model}
take_request_state :: proc(model: ^Model, request: Request_State) -> bool { if request == .Idle || model.request_state != request do return false model.request_state = .Idle return true}