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