pub async fn rpc(
harness: &AgentHarness,
agent_events: Option<Receiver<AgentEvent>>,
model_catalog: Vec<Model>,
) -> i32Expand description
rpc mode: a headless JSONL command loop (the server-side agent).
Reads one JSON command per line from stdin ({id?, type, ...}), drives the
main lane, and writes one JSON object per line to stdout:
- fine-grained
AgentEvents via [agent_event_json] (each carriestype), - a
{"type":"response","id":<id>,"status":"ok"|"error",...}per command.
Commands: prompt (streams the run), abort, get_state, set_model,
set_thinking_level, set_active_tools, ping, stop. stop (or stdin
EOF) ends the loop. This is the process rpi-server spawns and that
rpi --connect talks to. Mirrors TS runRpcMode / modes/rpc.