Skip to main content

starweaver_runtime/
lib.rs

1//! Agent-loop graph and runtime executor primitives.
2
3pub mod agent;
4pub mod capability;
5pub mod direct;
6pub mod executor;
7pub mod graph;
8pub mod instructions;
9pub mod iteration;
10pub mod output;
11pub mod retry_recovery;
12pub mod run;
13pub mod stream;
14pub mod trace;
15
16pub use agent::{
17    Agent, AgentEndStrategy, AgentError, AgentInput, AgentOverride, AgentResult, AgentRuntimePolicy,
18};
19pub use capability::{
20    resolve_capability_order, AgentCapability, CapabilityBundle, CapabilityError, CapabilityId,
21    CapabilityOrderError, CapabilityOrdering, CapabilityResult, CapabilitySpec, RetryEventKind,
22    StaticCapabilityBundle, RUNTIME_CONTEXT_CAPABILITY_ID,
23};
24pub use direct::{model_request, model_request_stream, tool_call, DirectModelRequest};
25pub use executor::{
26    AgentCheckpoint, AgentExecutionDecision, AgentExecutionNode, AgentExecutor, AgentExecutorError,
27    AgentResumeCursor, AgentResumeEvidence, DirectAgentExecutor, DynAgentExecutor,
28};
29pub use graph::{
30    inspect_graph, inspect_next_node, next_node, AgentGraphStep, AgentGraphTrace, AgentNode,
31    GraphDecision, GraphError,
32};
33pub use instructions::{
34    DynDynamicInstruction, DynamicInstruction, DynamicInstructionError, DynamicInstructionResult,
35    FunctionDynamicInstruction,
36};
37pub use iteration::{AgentIterResult, AgentIterationKind, AgentIterationStep, AgentIterationTrace};
38pub use output::{
39    parse_output, DynOutputFunction, FunctionOutputFunction, FunctionOutputValidator,
40    OutputFunction, OutputFunctionContext, OutputFunctionDefinition, OutputMedia, OutputPolicy,
41    OutputSchema, OutputValidationError, OutputValidationResult, OutputValidator, OutputValue,
42    SchemaOutputFunction,
43};
44pub use retry_recovery::{
45    heal_context_overflow_history, heal_openai_item_reference_history,
46    recover_retry_message_history, RetryRecoveryResult, DEFAULT_MODEL_ERROR_RESUME_PROMPT,
47};
48pub use run::{AgentRunResult, AgentRunState, RunStatus};
49pub use starweaver_model::{ModelResponseStreamEvent, PartDelta, PartEnd, PartStart};
50pub use stream::{
51    AgentSidebandEvent, AgentSidebandEventCategory, AgentStreamEvent, AgentStreamRecord,
52    AgentStreamResult, AgentStreamSink, AgentStreamSource, AgentStreamSourceKind,
53};
54pub use trace::{
55    export_otel_gen_ai_spans, AdapterTraceRecorder, DynTraceRecorder, InMemoryTraceRecorder,
56    NoopTraceRecorder, OtelGenAiSpan, PolicyTraceRecorder, RecordedSpan, SpanEvent, SpanHandle,
57    SpanKind, SpanSpec, SpanStatus, TraceDebugPolicy, TraceLevel, TraceRecorder,
58    TraceRecorderHandle, TraceRedactionPolicy,
59};