Expand description
Async handlers for every cli leaf command (except api,
schemas, the internal instance subprocess runner, and
clap’s external plugin dispatch). Stubs today; typed Args
pub async fn handle(...)signatures land in follow-up commits.
Re-exports§
pub use command_executor::*;
Modules§
- agents
- api
- channels
channels— duplex, capability-gated channels between a publisher (a trusted/executecaller) and an owner (a/channelsSSE client). Leaves:- command_
executor - daemon
- db
db— direct database access at the CLI level.- development
development— commands that exist for building ObjectiveAI things, not for running them.- functions
- laboratories
laboratories— top-level group for laboratory containers (podman containers the conduit dials as client-side MCP servers), sibling toagents/swarms.createcreates + starts a laboratory container;liststreams the laboratory containers created in this state;attach/detachrecord/remove a laboratory id on an agent target (a tag, or an instance hierarchy). Read attachments back viaagents instances get(thelaboratoriesfield). The machine’s resident laboratory HOST process is spawned EXPLICITLY viaspawnand gracefully shut down viakill(no more auto-spawn);configholds the addresses it connects to (+ thelocaltoggle).- python
python— run a Python snippet and return its output as JSON.- swarms
- tasks
tasks— durable scheduled commands. A task is an ObjectiveAI command plus a schedule; the daemon’s resident scheduler fires it with the identity it was CREATED with (agent arguments + plugin trio) and marks the run with the daemon-authoredtaskidentity flag. Leaves:- update
update— async handler stub.- viewer
Structs§
- Command
- Top-level CLI parser: a command path, OR
--request <json>to execute a JSONCliCommandRequestdirectly. The two are mutually exclusive (args_conflicts_with_subcommands, enforced natively by clap); a bare invocation prints help (arg_required_else_help).--requestis a legitimate but unadvertised programmatic entry point. - From
Args Error - Request
Base - Request
Base Args - Clap mirror of
RequestBase,#[command(flatten)]-ed into every transform-capable leaf’sArgs. - Response
Schema - Stream
Once
Enums§
- From
Args Error Source - Listener
Execution /listenmirror ofRequest— the root of the distributedListenerExecutiontree (crate::daemon::command_listener’s stream item): one variant per child wrapping itsListenerExecution. The broadcast always carries the typed PRE-transform items (the producer tee sits below the CLI’s jq/python transform), so every execution lands on its typed variant. Executions whosepath_typethis build’s types predate are skipped by the listener, so there is no unknown fallback.- McpResponse
Item - MCP-side projection of one CLI response item.
- Ok
- Success-only response shape. Wire form is the bare string
"Ok"— a single-variant enum gives us a typed sentinel that serializes and deserializes through serde as the static string. Used asResponseon every cli leaf whose only success signal is “it worked.” - Parse
Error - Error from
parse_request. Either clap rejected the argv (ParseError::Clap—--help, unknown subcommand, missing required arg, etc.) or the typedCommandcouldn’t be lowered into aRequest(ParseError::FromArgs— inline body JSON failed to parse, etc.). - Remote
- Wire-level source enum: which remote backend a path references.
Same shape as
crate::Remotebut lives undercli::commandso it can beclap::ValueEnumwithout dragging clap into the SDK’s non-cli surface. - Request
- Response
Item - Subcommand
- Transform
- Exactly one output transform. Extends by VARIANT without
changing any leaf’s
execute_transformsignature. (A hand-constructedRequestBasecan carry both fields at once — there, python overrides jq.)
Traits§
- Command
Request - Common accessors shared by the per-leaf typed CLI request shapes in the
surrounding tree (e.g.
agents::spawn::Request): the flattenedRequestBaseenvelope every leaf embeds. - Command
Response - Convert a typed CLI response item into its MCP-shaped projection —
either a media [
ContentBlock] for MCP tool results or a JSONLserde_json::Valuefor the line-oriented stream wire format. Implementors are the per-leaf response shapes in the surrounding tree (agents::spawn::ResponseItem,tools::run::ResponseItem, …) — not yet wired up; the trait exists to anchor the contract.
Functions§
- execute
- execute_
transform - parse_
request - Parse an argv slice into a typed
Request. Accepts either shape: - remote_
path_ to_ arg_ string - Serialize a
RemotePathCommitOptionalback into its docker-stylekey=value,...form for round-tripping through argv.