Skip to main content

Module client

Module client 

Source
Expand description

Client-side helpers for talking to the shared-world daemon: building a spawn request from local inputs and exchanging it over the control socket. Shared by lev run (and reusable by other clients). The socket-path resolution + connect live in the binary; these cores are unit-testable against a fake socket server.

Structs§

AgentSource
Everything a spawn request needs from the agent’s own files.
LaunchRequest
What lev run was asked for, before any of it is resolved.
SpawnedRun
What lev run --json prints on a successful spawn.

Functions§

batch_report
Render a batch spawn outcome: a JSON array when json, else one spawned <id> sentence per line. The single-run report keeps its own object/sentence shape via spawn_report, so existing --json callers parse exactly what they always did.
load_agent_source
Find the agent’s manifest and parse it, once.
never_interactive
The stdin probe for callers that build a spawn request from inside the daemon: fan-out workers and sub-agents. There is no terminal there, and an editor launched from a background process would block it forever with nobody to close the window.
resolve_spawn_args
Resolve the local inputs of a spawn request: find and parse the manifest, resolve the --<region> flags, resolve the task, and mint a run id from the agent’s directory name.
send_spawn
Send a resolved spawn request to the daemon and report the outcome, printing the new run id on success.
send_spawn_batch
Send count copies of a resolved spawn request - the same agent, task, and flags, each under its own fresh run id - and print one combined report.
spawn_report
Render a spawn outcome for printing: JSON when json, else the sentence.