odori_agents/lib.rs
1//! Agent primitives — the surface a user of Odori programs against.
2//!
3//! The primitive set is borrowed deliberately from the OpenAI Agents SDK so
4//! the shape is already familiar; the substrate underneath is what Odori
5//! adds. One run is one workflow ([`run::AgentRun`]); each harness turn the
6//! loop takes is one activity ([`run::TurnActivities`]); the loop itself is
7//! therefore replayable history, and a crashed run resumes from its last
8//! completed turn.
9//!
10//! - [`agent::Agent`] — a named configuration: instructions, provider
11//! binding, tools, guardrails, output shape.
12//! - [`runner::Runner`] — the client surface: start runs, follow
13//! conversations, fetch typed outputs.
14//! - [`tool::Tool`] — a typed, framework-owned capability executed durably
15//! through the mcp-bridge.
16//! - [`handoff::Handoff`] — a model-visible delegation to another agent's
17//! child workflow.
18//! - [`guardrail::Guardrail`] — deterministic input/output validation, plus
19//! [`guardrail::RunBudget`] turn/token/cost caps enforced by the run loop.
20//! - [`output::AgentOutput`] — typed outputs: a run produces a value, not a
21//! string.
22//! - [`provider::Provider`] — the frozen seam to model backends; the unit
23//! is one harness turn.
24//!
25//! Nothing here talks to a model vendor directly: providers live in
26//! `odori-providers`, and the embedded engine plus worker bootstrap live in
27//! `odori-engine`.
28
29pub mod agent;
30pub mod guardrail;
31pub mod handoff;
32pub mod invocation;
33pub mod output;
34pub mod provider;
35pub mod run;
36pub mod runner;
37pub(crate) mod telemetry;
38pub mod tool;
39
40pub use agent::{Agent, AgentRegistry};
41pub use guardrail::{Guardrail, GuardrailVerdict, RunBudget};
42pub use handoff::{Handoff, HandoffContext};
43pub use invocation::{InvocationId, InvocationRegistry, ToolCallResult};
44pub use output::{AgentOutput, Json};
45pub use provider::{
46 Effort, Provider, ProviderLimitStatus, TurnError, TurnEventSink, TurnOutcome, TurnRequest,
47};
48pub use run::{
49 AgentRun, BudgetCap, Providers, RunConfig, RunEnd, RunOutput, RunUsage, TurnActivities,
50 TurnRecord,
51};
52pub use runner::{Conversation, Runner, RunnerError, register_odori};
53pub use tool::{Tool, ToolFailure, ToolPolicy};