odori_providers/lib.rs
1//! Model providers — subscription-first, harness-driven.
2//!
3//! This crate owns the implementations of Odori's provider trait. The
4//! primary tier drives the vendors' own harnesses as supervised subprocesses,
5//! because that is where subscription auth, session state, and vendor tooling
6//! already live:
7//!
8//! - **Claude** — headless Claude Code: `claude -p --output-format
9//! stream-json`, one process per turn, sessions resumed by id on retry,
10//! streaming events surfaced as activity heartbeats, exit codes mapped to a
11//! retry taxonomy.
12//! - **Codex** — `codex app-server` JSON-RPC, one supervised process per
13//! turn, with persisted threads resumed by id.
14//!
15//! Harness CLIs are versioned runtime dependencies. Each provider states its
16//! minimum version and conformance baseline; newer version drift is detected
17//! and warned about, never a silent behaviour change.
18//!
19//! The secondary tier — raw-API providers (Anthropic Messages, OpenAI
20//! Responses) — lives behind the `api-anthropic` / `api-openai` features:
21//! minimal internal loops for users without a subscription seat.
22//!
23//! The seam this crate implements is `odori_agents::provider::Provider` —
24//! defined crate-side with the primitives (both ends of the seam need the
25//! agents crate's types, so defining it there keeps the graph acyclic) and
26//! frozen so every backend and the runner share one stable turn contract.
27
28#[cfg(any(feature = "api-anthropic", feature = "api-openai"))]
29pub mod api;
30pub mod claude;
31pub mod claude_flags;
32pub mod codex;
33
34#[cfg(feature = "api-anthropic")]
35pub use api::anthropic::{AnthropicConfig, AnthropicProvider};
36#[cfg(feature = "api-openai")]
37pub use api::openai::{OpenAiConfig, OpenAiProvider};
38pub use claude::{ClaudeConfig, ClaudeProvider, PINNED_VERSION};
39pub use codex::{CodexProvider, EXPECTED_CODEX_CLI_VERSION};