Skip to main content

Crate starweaver_runtime

Crate starweaver_runtime 

Source
Expand description

Agent-loop graph and runtime executor primitives.

Re-exports§

pub use agent::Agent;
pub use agent::AgentEndStrategy;
pub use agent::AgentError;
pub use agent::AgentInput;
pub use agent::AgentOverride;
pub use agent::AgentResult;
pub use agent::AgentRuntimePolicy;
pub use agent::AgentToolExecutionMode;
pub use capability::AgentCapability;
pub use capability::CapabilityBundle;
pub use capability::CapabilityError;
pub use capability::CapabilityId;
pub use capability::CapabilityOrderError;
pub use capability::CapabilityOrdering;
pub use capability::CapabilityResult;
pub use capability::CapabilitySpec;
pub use capability::RUNTIME_CONTEXT_CAPABILITY_ID;
pub use capability::RetryEventKind;
pub use capability::StaticCapabilityBundle;
pub use capability::resolve_capability_order;
pub use dependency_assembly::ToolDependencyAssembly;
pub use dependency_assembly::assemble_tool_dependencies_for_name;
pub use direct::DirectModelRequest;
pub use direct::model_request;
pub use direct::model_request_stream;
pub use direct::tool_call;
pub use executor::DirectAgentExecutor;
pub use executor::DynAgentExecutor;
pub use goal::GOAL_CAPABILITY_ID;
pub use goal::GOAL_COMPLETE_EVENT_KIND;
pub use goal::GOAL_COMPLETE_MARKER;
pub use goal::GOAL_ITERATION_EVENT_KIND;
pub use goal::GoalCapability;
pub use goal::GoalCompleteReason;
pub use goal::GoalRunOptions;
pub use goal::build_goal_check_prompt;
pub use goal::build_post_restore_goal_audit_prompt;
pub use goal::has_completion_marker;
pub use graph::AgentGraphStep;
pub use graph::AgentGraphTrace;
pub use graph::AgentNode;
pub use graph::GraphDecision;
pub use graph::GraphError;
pub use graph::inspect_graph;
pub use graph::inspect_next_node;
pub use graph::next_node;
pub use instructions::DynDynamicInstruction;
pub use instructions::DynamicInstruction;
pub use instructions::DynamicInstructionError;
pub use instructions::DynamicInstructionResult;
pub use instructions::FunctionDynamicInstruction;
pub use iteration::AgentIterResult;
pub use iteration::AgentIterationKind;
pub use iteration::AgentIterationStep;
pub use iteration::AgentIterationTrace;
pub use output::DynOutputFunction;
pub use output::FunctionOutputFunction;
pub use output::FunctionOutputValidator;
pub use output::OutputFunction;
pub use output::OutputFunctionContext;
pub use output::OutputFunctionDefinition;
pub use output::OutputMedia;
pub use output::OutputPolicy;
pub use output::OutputSchema;
pub use output::OutputValidationError;
pub use output::OutputValidationResult;
pub use output::OutputValidator;
pub use output::OutputValue;
pub use output::SchemaOutputFunction;
pub use output::parse_output;
pub use retry_recovery::DEFAULT_MODEL_ERROR_RESUME_PROMPT;
pub use retry_recovery::RetryRecoveryResult;
pub use retry_recovery::heal_context_overflow_history;
pub use retry_recovery::heal_openai_item_reference_history;
pub use retry_recovery::recover_retry_message_history;
pub use run::AgentRunResult;
pub use stream::AgentStreamResult;
pub use trace::AdapterTraceRecorder;
pub use trace::DynTraceRecorder;
pub use trace::InMemoryTraceRecorder;
pub use trace::NoopTraceRecorder;
pub use trace::OtelGenAiSpan;
pub use trace::PolicyTraceRecorder;
pub use trace::RecordedSpan;
pub use trace::SpanEvent;
pub use trace::SpanHandle;
pub use trace::SpanKind;
pub use trace::SpanSpec;
pub use trace::SpanStatus;
pub use trace::TraceDebugPolicy;
pub use trace::TraceLevel;
pub use trace::TraceRecorder;
pub use trace::TraceRecorderHandle;
pub use trace::TraceRedactionPolicy;
pub use trace::export_otel_gen_ai_spans;

Modules§

agent
Bare agent runtime.
capability
Capability hooks and bundles for the bare agent runtime.
dependency_assembly
Shared least-authority tool dependency assembly.
direct
Direct model and tool execution helpers.
executor
Runtime checkpoint emission helpers and compatibility exports.
goal
Runtime goal-mode output validator capability.
graph
Deterministic agent-loop graph transitions.
instructions
Dynamic instructions for agent runs.
iteration
Run iteration inspection records derived from typed stream events.
output
Structured output schemas and validators for agent runs.
retry_recovery
Error-aware retry recovery for model request retries.
run
Runtime run result types and compatibility exports for checkpointable state.
stream
Runtime stream-result type and compatibility exports for raw stream protocol records.
trace
Runtime trace recording contract and deterministic in-memory recorder.

Structs§

AgentCheckpoint
Serializable checkpoint emitted at a durable execution boundary.
AgentResumeCursor
Compact cursor values durable stores use to resume and audit a run.
AgentResumeEvidence
Stable resume evidence for durable service runtimes and external session stores.
AgentRunState
Checkpointable state shared with durability layers. Checkpointable state owned by the agent graph loop.
AgentSidebandEvent
Typed view of an application sideband event carried by AgentStreamEvent::Custom.
AgentStreamRecord
Sequenced stream event record.
AgentStreamSink
In-memory sink used by tools that need to merge child stream records into the parent stream.
AgentStreamSource
Source attribution for records merged from nested agent runs.
PartDelta
Part delta event.
PartEnd
Part end event.
PartStart
Part start event.

Enums§

AgentExecutionDecision
Decision returned by an execution checkpoint handler.
AgentExecutionNode
Named execution boundary in the agent loop and durable stream protocol.
AgentExecutorError
Executor failure.
AgentSidebandEventCategory
Stable category for context sideband events that are bridged into the runtime stream.
AgentStreamEvent
Typed event emitted by the agent runtime while a run progresses.
AgentStreamSourceKind
Origin type for a stream record emitted by a nested runtime component.
ModelResponseStreamEvent
Stream event emitted by model adapters.
RunStatus
Shared lifecycle status for an admitted runtime execution. Lifecycle of an admitted runtime execution.

Traits§

AgentExecutor
Callback contract for persistence, interruption, and durable scheduling.