Explicit local attachment ingestion. No URL fetches or implicit path expansion
in prompts. Bytes are captured once and retained in private session history;
archive/memory projections deliberately omit image/document source payloads.
Re-export truncate_str + BoundedText from agent-core.
A byte-bounded, char-boundary-safe view of a string, with exact
accounting of what was kept and what was cut.
Registry of available tools. Maintains a name→tool map and a cached JSON schema
array that gets sent to the API. Thread-safe via Arc<RwLock<ToolRegistry>>.
Budget dimension placeholder (spec §5.2). The full turn-budget system is
later work (spec §8.1); only the typed surface lands here so
TurnOutcome::BudgetExceeded is representable without re-plumbing.
Typed terminal outcome of a model turn (spec §5.2). Produced ONCE by the
engine; every frontend (chat, TUI, RPC, server, watcher, subagents)
receives the same value and must never re-derive it from message text.
Re-export epoch_millis from agent-core (moved there for the leaf crate split).
Current time as Unix epoch milliseconds. Panics only if system clock is before 1970.
Find a session by its assigned name (not partial ID).
Iterates session headers one file at a time and returns on first match,
avoiding a full directory scan when the named session appears early.
The limit most-recently-modified sessions (by file mtime), most-recent
first. Sorts the directory entries by mtime WITHOUT parsing, then reads only
the top limit headers — so /sessions is O(limit) reads instead of
O(#sessions). mtime is an exact proxy for updated_at (the file is rewritten
on every save).
Reference-counted shared message payload. Introduced at the runtime’s
inner boundary (T128 Slice 2) to enable clone-free fan-out of message
history through the stream loop and SessionEvent::MessageHistory.
Outer state (App/Session/ConversationState) remains Vec<Value> and
shims at the boundary — see Slice 5 for full conversion.