Expand description
Operator abstraction.
§Roles
- Spawners (
SpawnerAdapter) do not know aboutOperatorkinds. Ordinary dispatches are handled byProcessSpawner/InProcSpawner/ etc. OperatorSpawneris theSpawnerAdapterthat routes dispatches through an operator. It holds anArc<dyn Operator>and does one thing: hand every spawn request to that operator’sexecute. It still does not know the operator’skind(MainAi/Human/Automate/Composite).- The
Operatortrait itself returns aWorkerResult, as a synchronous backend. Implementations are free per kind — aMainAioperator might round-trip through Claude via an HTTP callback, aHumanoperator might prompt on a CLI, anAutomateoperator might delegate to a different spawner, and so on.
Which dispatches go through the OperatorSpawner is decided at the
flow.ir layer (designer + hints + Swarm compiler). The algocline
strategy side never says “hand this to the operator” — a firm
separation of concerns.
Re-exports§
pub use render::render_system;pub use render::slots_from_prompt;pub use render::RenderError;
Modules§
- render
system_prompttemplate rendering for the Operator path.
Structs§
- Operator
Spawner - A
SpawnerAdapterimplementation that hands the dispatch off to anArc<dyn Operator>. - Operator
Worker - Concrete Worker type for the Operator kind — wraps the async
Operator::executecall. This represents the handle for a task backed by an operator (SDK, WebSocket bridge, direct LLM call, etc.) and embeds aWorkerJoinHandlerthat carries the async signal.
Traits§
- Operator
- The
Operatortrait: takes a spawn request and returns aWorkerResult. The backend forOperatorSpawner. Implementations are free to differ per kind; the spawner just callsexecuteand stays out of the internals.