Skip to content

crewmaster ¤

MODULE DESCRIPTION
agents

Agent models for CrewMaster v2.0.0.

api

Public API for CrewMaster v2.0.0.

api_integration_test

Integration tests for CrewMaster v2.0.0 — full tracer bullet verification.

api_test

Tests for the public API: crewmaster.execute() and execute_stream().

cli

CrewMaster CLI — top-level command group.

collaboration

Collaboration protocol models for CrewMaster v2.0.0.

conversation

Conversation module for CrewMaster v2.0.0.

core
evaluation
execution

Execution runtime models for CrewMaster v2.0.0.

init_test
operations

Operations models for CrewMaster v2.0.0.

sandbox

CrewMaster v2.0.0 Sandbox — FastAPI demo application.

tools

Tool registry models for CrewMaster v2.0.0.

CLASS DESCRIPTION
ExecutionError

Raised when execution of an ExecutionPlan fails.

FUNCTION DESCRIPTION
execute

Execute an Operation (single-node or multi-node) and return the final output.

execute_stream

Execute an Operation with streaming output.

__all__ module-attribute ¤

__all__ = ['core', 'execute', 'execute_stream', 'ExecutionError']

ExecutionError ¤

Raised when execution of an ExecutionPlan fails.

execute async ¤

execute(operation: Operation, context_store: ContextStore, default_runtime: RuntimeDriver, block_store: BlockStore | None = None, tool_registry: ToolRegistry | None = None, plan: ExecutionPlan | None = None, prompt_engine: PromptEngine | None = None, observer: ExecutionObserver | None = None, context_overrides: dict[str, Any] | None = None) -> Any

Execute an Operation (single-node or multi-node) and return the final output.

If no plan is provided, one is built from operation via :func:resolve_plan. The plan is then executed node by node in topological order. Each node is dispatched to its assigned runtime driver with :func:secure_retry_execution wrapping the call. The output of each node is passed as deps context to downstream nodes.

When a node has max_retrieval_rounds > 0, the request_capability system tool is injected into the toolset. If the agent invokes it, execution is paused, the ToolRegistry is queried via :meth:ToolRegistry.retrieve_by_description, matching capabilities are added to the toolset, and the agent is re-dispatched with the expanded toolset.

PARAMETER DESCRIPTION

operation ¤

The root Operation to execute.

TYPE: Operation

context_store ¤

ContextStore with domain instances for resolution.

TYPE: ContextStore

default_runtime ¤

Fallback RuntimeDriver when an AgentConfig does not specify its own.

TYPE: RuntimeDriver

block_store ¤

BlockStore for resolving block URIs. Required if plan is not pre-built.

TYPE: BlockStore | None DEFAULT: None

tool_registry ¤

Optional ToolRegistry for tool retrieval.

TYPE: ToolRegistry | None DEFAULT: None

plan ¤

An optional pre-built ExecutionPlan. If omitted, one is built from operation.

TYPE: ExecutionPlan | None DEFAULT: None

prompt_engine ¤

Optional PromptEngine for rendering prompts at execution time. When provided, each node's prompt is rendered via prompt_engine.compose() using the current per-node context. If None, falls back to disclosure.rendered_prompt.

TYPE: PromptEngine | None DEFAULT: None

observer ¤

Optional ExecutionObserver for hooking into the execution lifecycle (on_plan_start, on_node_start, etc.).

TYPE: ExecutionObserver | None DEFAULT: None

RETURNS DESCRIPTION
Any

The structured output of the final node in the plan (matches

Any

operation.produces).

RAISES DESCRIPTION
PlanBuildError

If the plan cannot be built due to unresolved dependencies.

ExecutionError

If a node fails after exhausting retry attempts.

execute_stream async ¤

execute_stream(operation: Operation, context_store: ContextStore, default_runtime: RuntimeDriver, block_store: BlockStore | None = None, tool_registry: ToolRegistry | None = None, plan: ExecutionPlan | None = None, prompt_engine: PromptEngine | None = None, observer: ExecutionObserver | None = None, context_overrides: dict[str, Any] | None = None) -> AsyncIterator[RuntimeStreamChunk]

Execute an Operation with streaming output.

Like :func:execute, but yields :class:RuntimeStreamChunk events as the plan progresses. Each node yields text_delta, tool_call, and tool_result events during its execution, followed by a node_complete chunk carrying the node's artifact. The final final chunk carries the last node's output.

When a node has max_retrieval_rounds > 0, the request_capability system tool is injected. If a tool_call chunk targets request_capability, it is intercepted and handled exactly as in :func:execute.

PARAMETER DESCRIPTION

operation ¤

The root Operation to execute.

TYPE: Operation

context_store ¤

ContextStore with domain instances for resolution.

TYPE: ContextStore

default_runtime ¤

Fallback RuntimeDriver.

TYPE: RuntimeDriver

block_store ¤

BlockStore for resolving block URIs.

TYPE: BlockStore | None DEFAULT: None

tool_registry ¤

Optional ToolRegistry for tool retrieval.

TYPE: ToolRegistry | None DEFAULT: None

plan ¤

Optional pre-built ExecutionPlan.

TYPE: ExecutionPlan | None DEFAULT: None

prompt_engine ¤

Optional PromptEngine for rendering prompts at execution time. Falls back to disclosure.rendered_prompt.

TYPE: PromptEngine | None DEFAULT: None

observer ¤

Optional ExecutionObserver for hooking into the execution lifecycle.

TYPE: ExecutionObserver | None DEFAULT: None

YIELDS DESCRIPTION
AsyncIterator[RuntimeStreamChunk]

RuntimeStreamChunk events during plan execution.