Skip to main content

supercode_runtime/
lib.rs

1//! Optional native model and tool runtime for Supercode.
2//!
3//! This package owns provider request/event/usage contracts, the
4//! OpenAI-compatible streaming transport, cache planning, request budgeting,
5//! and bounded background state. The complete Agent and tool composition lives
6//! in `supercode-harness`; foreign session codecs live in
7//! `supercode-interchange`; reversible reduction is optional.
8
9#![warn(missing_docs)]
10
11pub mod background;
12mod cache_plan;
13mod error;
14mod event;
15mod model_limits;
16mod policy;
17mod provider;
18mod request;
19mod tokens;
20mod usage;
21
22pub use cache_plan::CachePlan;
23pub use error::{Result, RuntimeError};
24pub use event::{AgentEvent, EventSink};
25pub use model_limits::{model_context_limit, UNKNOWN_MODEL_CONTEXT_FLOOR};
26pub use policy::glob_match;
27pub use provider::{
28    apply_cache_plan, cache_cold_reason, is_anthropic_family_model, tier_change_is_cache_bust,
29    CacheColdReason, HttpOptions, OpenAiProvider, Provider, RetryLog, RetryNotice,
30    SERVED_MODEL_KEY,
31};
32pub use request::{ChatRequest, ToolSchema};
33pub use tokens::{
34    context_guard, estimate_deferred_schema_tokens, estimate_request_tokens, estimate_tokens,
35    estimate_view_tokens, fmt_approx_tokens, with_guard_margin, CONTEXT_RESPONSE_RESERVE_TOKENS,
36};
37pub use usage::{PromptTokensDetails, Usage};