Module orchestration

Module orchestration 

Expand description

Agent orchestration — invoke an agent in a Mode.

An agent is a value (TextAgent — a local agent, a composed pipeline, or a remote A2A agent). Orchestration is the single question of how you invoke it; the result always lands in governed State under {name}:result (or {name}:error), so coordination is reactive and uniform regardless of the invoker (the model, a Flow, an Extract, or a watcher).

ModeSync?Lowers to
Mode::Callsync — caller awaitscall (agent-as-tool, awaited inline)
Mode::Dispatchasync, fire-and-forgetBackgroundAgentDispatcher::dispatch
Mode::Backgroundasync, model-awarean agent-tool marked ToolExecutionMode::Background

All three write {name}:result, so a Flow step can complete on a resolved result via Guard::resolved, and any consumer reads the value the same way.

Structs§

Resolver
A named async value source whose inputs come from State and whose result lands back in State under {name}:result (or {name}:error).

Enums§

Mode
How an agent is invoked.

Functions§

call
Invoke agent synchronously: run it to completion, write its result to {name}:result (or its error to {name}:error), and return the result.
error_key
State key an agent’s error is written to.
provenance
The provenance source of a value at key (e.g. "agent", "fetch", "llm", or "extraction"), if one was recorded under state_meta:{key}.
result_key
State key an agent’s successful result is written to.