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