Expand description
locode-engine — the sample→dispatch→append loop and the Session driving API
(ADR-0005, ADR-0004, ADR-0014).
A Session drives one run to a terminal locode_protocol::Status against any
locode_provider::Provider, dispatching tool calls through a
locode_tools::Registry, emitting stream-json events to an EventSink, and
returning one locode_protocol::Report. Proven end-to-end against
MockProvider with zero network.
Structs§
- Allow
All - The default approver: allows everything, instantly — headless consumers
(
locode-exec, evals) are byte-for-byte unchanged in behavior. - Approval
Request - The pre-dispatch view of one tool call — what the studied UIs render their permission prompts from (request args, not host-resolved detail).
- Cancellation
Token - A token which can be used to signal a cancellation request to one or more tasks.
- Engine
Config - Everything the loop needs that isn’t the provider, registry, preamble, or sink.
- FnSink
- Forwards each event to a closure — e.g. a JSONL stdout writer for
stream-json, or aVec-pushing closure in tests. - Input
Queue - A clonable handle to one session’s pending mid-run input.
- Null
Sink - Drops every event — for the
json/textoutput modes that only want the report. - Session
- One driven agent session. Owns the conversation history across runs: a
second
Session::runon the same session continues the same conversation (ADR-0016) — the exact call shape an interactive frontend needs for follow-up turns.
Enums§
- Decision
- The approval vocabulary — deliberately minimal (ADR-0017 Option V1): stickiness and richer choices live in approver implementations.
Constants§
- MID_
RUN_ PREAMBLE - The preamble that marks text as having arrived mid-run.