Skip to main content

Crate oxicode_sdk

Crate oxicode_sdk 

Source
Expand description

oxicode SDK - Programmatic API for building AI agents

§Example

use oxicode_sdk::{OxicodeBuilder, AgentConfig};

let oxicode = OxicodeBuilder::new().with_builtins().build();
let agent = oxicode.agent(AgentConfig {
    model_id: "anthropic/claude-sonnet-4-20250514".into(),
    ..Default::default()
}).build().unwrap();

Re-exports§

pub use agent_builder::AgentBuilder;
pub use agent_group::AgentGroup;
pub use agent_group::AgentGroupOutput;
pub use agent_group::GroupResult;
pub use agent_group::GroupStrategy;
pub use builder::Oxicode;
pub use builder::OxicodeBuilder;
pub use delegation::SdkSubagentRunner;
pub use url_resolver::SdkUrlResolver;
pub use workflow_engine::StepOutput;
pub use workflow_engine::WorkflowEngine;
pub use workflow_engine::WorkflowResult;
pub use closure_tool::ClosureTool;
pub use message_bus::InterAgentMessage;
pub use message_bus::LagAwareReceiver;
pub use message_bus::MessageBus;
pub use message_bus::PublishResult;
pub use metrics::AgentMetrics;
pub use metrics::MetricsSnapshot;
pub use ports::AccessGate as AccessGatePort;
pub use ports::EventBus as EventBusPort;
pub use ports::MemoryEntry as MemoryEntryPort;
pub use ports::AccessDecision;
pub use ports::AuthMethod;
pub use ports::AuthProvider;
pub use ports::CapabilityResolver;
pub use ports::ConfigStore;
pub use ports::CronJob;
pub use ports::CronScheduler;
pub use ports::EventPayload;
pub use ports::EventTopic;
pub use ports::InMemoryEventBus;
pub use ports::MemoryStore;
pub use ports::NoopAuthProvider;
pub use ports::NoopConfigStore;
pub use ports::NoopCronScheduler;
pub use ports::NoopEventBus;
pub use ports::NoopMemoryStore;
pub use ports::NoopPersonaProvider;
pub use ports::NoopResourceMonitor;
pub use ports::NoopSkillLoader;
pub use ports::NoopStateStore;
pub use ports::OAuthToken;
pub use ports::Persona;
pub use ports::PersonaProvider;
pub use ports::PortId;
pub use ports::PortRegistry;
pub use ports::PortValue;
pub use ports::ResourceMonitor;
pub use ports::ResourceUsage;
pub use ports::Skill;
pub use ports::SkillLoader;
pub use ports::SkillMeta;
pub use ports::StateStore;
pub use ports::SubscriptionHandle;
pub use ports::ToolCallRequest;
pub use ports::hooks::HookContext;
pub use ports::hooks::HookEvent;
pub use ports::hooks::HookOutcome;
pub use ports::hooks::HookRunner;
pub use ports::hooks::HookSpec;
pub use ports::hooks::NoopHookRunner;
pub use ports::catalog::CatalogEvent;
pub use ports::catalog::CatalogModelEntry;
pub use ports::catalog::CatalogProtocol;
pub use ports::catalog::CatalogProviderEntry;
pub use ports::catalog::CatalogSource;
pub use ports::catalog::ModelCatalog;
pub use ports::catalog::NoopModelCatalog;
pub use ports::catalog::RefreshOutcome;
pub use event_bus::EventBus;
pub use error::SdkError;
pub use error::SdkResult;
pub use lifecycle::AgentHandle;
pub use lifecycle::AgentLifecycleEvent;
pub use lifecycle::AgentPool;
pub use lifecycle::AgentSnapshot;
pub use lifecycle::AgentStatus;
pub use lifecycle::AgentSupervisor;
pub use lifecycle::FileSnapshotStore;
pub use lifecycle::HubKind;
pub use lifecycle::HubStatus;
pub use lifecycle::RestartBackoff;
pub use lifecycle::SnapshotStore;
pub use lifecycle::SupervisorPolicy;
pub use lifecycle::ToolManifest;
pub use middleware::Middleware;
pub use middleware::MiddlewareContext;
pub use middleware::MiddlewareData;
pub use middleware::MiddlewarePhase;
pub use middleware::MiddlewarePipeline;
pub use middleware::MiddlewareResult;
pub use middleware::build_hooks;
pub use observability::AuditAction;
pub use observability::AuditEntry;
pub use observability::AuditError;
pub use observability::AuditFilter;
pub use observability::AuditLog;
pub use observability::AuditPersistence;
pub use observability::AuditTrail;
pub use observability::CostBreakdown;
pub use observability::CostSnapshot;
pub use observability::CostTracker;
pub use observability::CostTrackerConfig;
pub use observability::EventQuery;
pub use observability::EventStore;
pub use observability::EventStoreConfig;
pub use observability::GlobalCostSnapshot;
pub use observability::HashDigest;
pub use observability::Span;
pub use observability::SpanContext;
pub use observability::SpanGuard;
pub use observability::SpanId;
pub use observability::SpanKind;
pub use observability::SpanStatus;
pub use observability::StoredEvent;
pub use observability::TokenUsage;
pub use observability::TraceId;
pub use observability::Tracer;
pub use observability::TrailEntry;
pub use security::AccessDenied;
pub use security::AccessGate;
pub use security::Action;
pub use security::AgentContext;
pub use security::AgentPermissions;
pub use security::AllowlistMode;
pub use security::ApprovalStatus;
pub use security::AuditEvent;
pub use security::AuditSink;
pub use security::Authorizer;
pub use security::Capability;
pub use security::CapabilitySet;
pub use security::CapabilitySubject;
pub use security::CheckRequest;
pub use security::DefaultPolicy;
pub use security::DenyLayer;
pub use security::ExecPolicy;
pub use security::PathMode;
pub use security::PendingApproval;
pub use security::PermAuditEntry;
pub use security::PermissionUpdate;
pub use security::RbacAuditEntry;
pub use security::RbacManager;
pub use security::RbacPolicy;
pub use security::Role;
pub use security::SecurityMiddleware;
pub use security::StringPattern;
pub use security::Subject;
pub use security::TracingAuditSink;
pub use security::TrailAuditSink;
pub use coordination::Consensus;
pub use coordination::CoordinatedGroup;
pub use coordination::CoordinatedGroupBuilder;
pub use coordination::MemoryEntry;
pub use coordination::MemoryEvent;
pub use coordination::MemoryKey;
pub use coordination::SharedMemory;
pub use coordination::VoteResult;
pub use coordination::WorkEvent;
pub use coordination::WorkItem;
pub use coordination::WorkQueue;
pub use coordination::WorkQueueConfig;
pub use coordination::WorkQueueStats;
pub use coordination::WorkResult;
pub use coordination::WorkStatus;
pub use routing::RoutingControl;
pub use crate::port_memory_backend::PortMemoryBackend;

Modules§

agent_builder
AgentBuilder — Fluent API for creating agents
agent_definition
Agent definition file parsing and validation.
agent_group
Agent group — multi-agent orchestration primitives.
bridge
Bridge layer: convert catalog port entries into oxicode_ai types.
builder
OxicodeBuilder and Oxicode — SDK entry point
closure_tool
ClosureTool — ergonomic custom tool from a closure
coordination
Inter-agent coordination primitives.
delegation
Library-native sub-agent delegation (issue #28 gap 3).
error
oxicode-sdk error types
event_bus
Generic event bus for pub/sub communication.
kernel_bridge
Kernel tool bridge — allows oxios kernel tools to be plugged into the SDK.
lifecycle
Lifecycle module — agent lifecycle management.
message_bus
Inter-agent message bus for multi-agent communication.
metrics
Agent execution metrics.
middleware
Middleware module — Hook chain management
observability
Observability layer — tracing, audit, cost tracking, and event sourcing.
port_memory_backend
SDK-provided MemoryBackend adapter bridging the SDK’s MemoryStore + optional EmbeddingProvider ports into the agent’s memory_* tools.
ports
Port traits for product-specific adapters.
prelude
Convenience re-exports: oxicode_sdk::fs::*, oxicode_sdk::inmem::*. Commonly used types
router
Unstable (feature: router) — may change or be removed
Model auto-routing for oxicode.
routing
Runtime routing control — dynamic model routing and fallback management.
security
Capability-based security module.
snapcompact_compactor
SnapcompactCompactoroxicode-ai::Compactor implementation backed by the snapcompact PNG renderer in oxicode-snapcompact.
tool_factory
Tool factories for common tool sets
url_resolver
Adapter bridging the SDK’s InternalUrlRouter port to oxicode-agent’s UrlResolver capability.
workflow_dsl
Declarative workflow DSL — YAML definitions that map to existing coordination APIs.
workflow_engine
Workflow execution engine.

Structs§

AdviseTool
Unstable (feature: advisor) — may change or be removed
The `advise` agent tool.
AdvisorEmissionGuard
Unstable (feature: advisor) — may change or be removed
Decides whether an advisor `advise()` call should reach the primary agent. omp `AdvisorEmissionGuard`.
AdvisorNote
Unstable (feature: advisor) — may change or be removed
One queued advice note. omp `AdvisorNote`.
AdvisorRuntime
Unstable (feature: advisor) — may change or be removed
Drives the advisor agent. Construct via [`AdvisorRuntime::new`], wrap in `Arc`, then call [`AdvisorRuntime::install_self`] so it can self-spawn its drain task.
Agent
Stable since 0.63.0
Agent runtime.
AgentAdvisor
Unstable (feature: advisor) — may change or be removed
An [`AdvisorAgent`] backed by a concrete [`Agent`].
AgentConfig
Stable since 0.63.0
Agent runtime configuration
AgentHooks
Stable since 0.63.0
Callback hooks for the agent loop.
AgentInfo
Unstable (feature: agent-hub) — may change or be removed
Agent-pool source for Hub display + todo sub-agent matching. Read-only agent info for Hub display.
AgentLoop
Stable since 0.63.0
AgentLoop.
AgentLoopConfig
Stable since 0.63.0
Configuration for an [`crate::AgentLoop`] instance.
AgentState
Stable since 0.63.0
Agent execution state
AgentToolResult
Stable since 0.63.0
Result of tool execution
AuthStore
Stable since 0.63.0
The on-disk auth file structure: a map from provider name to token bundle.
BashTool
Stable since 0.63.0
`BashTool` (read/write/edit/grep/find/ls are already re-exported above and bundled by `coding_tools()`). BashTool.
BuiltinModelEntry
Stable since 0.63.0
A single built-in model entry.
BuiltinProvider
Stable since 0.63.0
Metadata for a built-in provider.
BuiltinProviderEntry
Stable since 0.63.0
A single built-in provider entry, deserialized from `data/catalog/providers.toml`.
CompactedContext
Stable since 0.63.0
CompactedContext.
ConsentManager
Stable since 0.63.0
In-memory + on-disk consent manager.
Context
Stable since 0.63.0
Conversation context for LLM interactions.
Cost
Stable since 0.63.0
Cost structure – prices per million tokens.
DefaultCircuitBreaker
Unstable (feature: circuit-breaker) — may change or be removed
SDK reference implementation: threshold-based with half-open state machine.
DeliveryOpts
Unstable (feature: advisor) — may change or be removed
Inputs to [`crate::advisor::channels::resolve_delivery_channel`]. omp `resolveAdvisorDeliveryChannel` opts.
DirectToolDef
Stable since 0.63.0
Definition for a tool to be registered as a direct `AgentTool` (Phase 3).
EditTool
Stable since 0.63.0
EditTool.
FindTool
Stable since 0.63.0
FindTool.
GetSearchResultsTool
Stable since 0.63.0
Tool for retrieving cached search results by ID.
GrepTool
Stable since 0.63.0
GrepTool.
LsTool
Stable since 0.63.0
LsTool.
McpCallResult
Stable since 0.63.0
Result of an MCP tool call.
McpConfig
Stable since 0.63.0
Root MCP configuration.
McpDashboardData
Stable since 0.63.0
The full structured snapshot consumed by the TUI dashboard (Phase 2).
McpDirectTool
Stable since 0.63.0
An individual MCP tool registered as a first-class `AgentTool`.
McpManager
Stable since 0.63.0
Central manager for all MCP server connections.
McpSamplingRequest
Stable since 0.63.0
MCP sampling request — server asks oxicode to make an LLM call.
McpServerInfo
Stable since 0.63.0
One server's information for the TUI dashboard (Phase 2).
McpSettings
Stable since 0.63.0
Global MCP settings.
McpSettingsView
Stable since 0.63.0
Settings summary for the dashboard header.
McpTool
Stable since 0.63.0
The unified MCP gateway tool.
McpToolDef
Stable since 0.63.0
Tool definition discovered from an MCP server.
McpToolInfo
Stable since 0.63.0
One tool's information for the TUI dashboard (Phase 2).
MemoryEditTool
Unstable (feature: memory) — may change or be removed
The `memory_*` + `subagent` tool structs (register directly if desired). Tool that updates an existing memory item or deletes it when no new content is supplied.
MemoryItem
Unstable (feature: memory) — may change or be removed
Memory backend trait + item — implement to back the `memory_*` tools, or use [`PortMemoryBackend`] to bridge the SDK's `MemoryStore` port. A single memory item returned by [`MemoryBackend`].
MemoryRecallTool
Unstable (feature: memory) — may change or be removed
The `memory_*` + `subagent` tool structs (register directly if desired). Tool that searches the configured `MemoryBackend` for memories matching a query and returns the matches in a compact, model-friendly format.
MemoryReflectTool
Unstable (feature: memory) — may change or be removed
The `memory_*` + `subagent` tool structs (register directly if desired). Tool that stores a session reflection/summary to the configured `MemoryBackend`.
MemoryRetainTool
Unstable (feature: memory) — may change or be removed
The `memory_*` + `subagent` tool structs (register directly if desired). Tool that persists a memory item (content, kind, importance) to the configured `MemoryBackend`.
MetadataCache
Stable since 0.63.0
In-memory + on-disk metadata cache.
Model
Stable since 0.63.0
LLM model definition.
ModelRegistry
Stable since 0.63.0
Lightweight model registry for SDK/engine usage.
NoopSpawnValidator
Unstable (feature: mcp-spawn-validator) — may change or be removed
Default no-op validator — preserves current behavior (no validation, no env scrubbing). Use this when no consumer-supplied policy is registered.
OpenAiProvider
Stable since 0.63.0
OpenAI-compatible provider
OpenAiResponsesProvider
Stable since 0.63.0
OpenAI Responses API provider
OverrideFile
Stable since 0.63.0
User override container.
ProviderOptions
Stable since 0.63.0
Per-provider options for fine-grained control.
ProviderRegistry
Stable since 0.63.0
Runtime registry for providers (custom + built-in resolution).
ReadTool
Stable since 0.63.0
ReadTool.
ResolvedContent
Stable since 0.63.0
URL resolver trait + resolved content — implement for internal-URL dispatch. Content resolved from an internal protocol URL (e.g. `skill://`, `issue://`).
RoleRegistry
Unstable (feature: role-routing) — may change or be removed
Role registry: maps role names to configured model patterns, with `pi/` alias expansion and cycle detection.
RoleRoutingProvider
Unstable (feature: role-routing) — may change or be removed
A [`Provider`] wrapper that routes each request to the model selected by the role-switching layer.
RoleSignals
Unstable (feature: role-switching) — may change or be removed
Observable signals for a turn, used to decide the active role.
SearchCache
Stable since 0.63.0
In-memory cache for search results, keyed by search ID.
ServerEntry
Stable since 0.63.0
MCP server configuration entry.
SharedState
Stable since 0.63.0
Thread-safe agent state wrapper.
StdioTransport
Unstable (feature: mcp-transport) — may change or be removed
Stdio transport for a spawned MCP server process.
StreamOptions
Stable since 0.63.0
Options for streaming requests
StreamableHttpTransport
Unstable (feature: mcp-transport) — may change or be removed
Streamable HTTP transport.
StructuredOutput
Stable since 0.63.0
Structured output extractor.
SubagentTool
Unstable (feature: memory) — may change or be removed
The `memory_*` + `subagent` tool structs (register directly if desired). Subagent tool for delegating tasks to specialized agents.
TodoItem
Stable since 0.63.0
A single task within a phase.
TodoPhase
Stable since 0.63.0
A named group of related tasks within a todo list.
TodoTool
Stable since 0.63.0
`todo` agent tool. 상태 비저장 (상태는 `TodoStateProvider`가 보유).
TodoUpdateResult
Stable since 0.63.0
Result of applying a batch of todo ops.
TokenBundle
Stable since 0.63.0
An OAuth token bundle as stored on disk.
Tool
Stable since 0.63.0
Tool definition with JSON Schema parameters
ToolCall
Stable since 0.63.0
Tool call content block emitted by the model.
ToolContext
Stable since 0.63.0
Context passed to tools at execution time.
ToolMetadata
Stable since 0.63.0
Cached tool metadata with server association and naming.
ToolRegistry
Stable since 0.63.0
Tool registry for managing available tools
ToolResult
Stable since 0.63.0
Tool result returned by agent tool execution.
UserMessage
Stable since 0.63.0
User message sent to the model.
WebSearchTool
Stable since 0.63.0
Multi-engine web search tool using oxibrowser's search module.
WriteTool
Stable since 0.63.0
WriteTool.

Enums§

AdvisorDeliveryChannel
Unstable (feature: advisor) — may change or be removed
How an advisor note reaches the primary agent. omp `AdvisorDeliveryChannel`.
AdvisorSeverity
Unstable (feature: advisor) — may change or be removed
Advisor note severity. omp `AdvisorSeverity`. Omitting it (in the tool schema) is treated as a plain `nit`.
AgentError
Stable since 0.63.0
Agent-specific errors
AgentEvent
Stable since 0.63.0
Events emitted during agent execution.
AgentHubStatus
Unstable (feature: agent-hub) — may change or be removed
Agent-pool source for Hub display + todo sub-agent matching. Hub display status.
AgentKind
Unstable (feature: agent-hub) — may change or be removed
Agent-pool source for Hub display + todo sub-agent matching. Agent kind for Hub display.
Api
Stable since 0.63.0
Provider API identifier.
BreakerError
Unstable (feature: circuit-breaker) — may change or be removed
Error returned when the circuit is open.
BreakerState
Unstable (feature: circuit-breaker) — may change or be removed
Observable breaker state. Returned by [`DefaultCircuitBreaker::state`].
BrowseProgress
Stable since 0.63.0
Structured progress event for browser tool execution.
CompactionEvent
Stable since 0.63.0
CompactionEvent.
CompactionStrategy
Stable since 0.63.0
Compaction strategy determining when to compact
ConsentState
Stable since 0.63.0
MCP consent state.
ContentBlock
Stable since 0.63.0
Content block union (untagged for flexibility).
DirectToolsConfig
Stable since 0.63.0
Configuration for direct tool registration (Phase 3).
InputModality
Stable since 0.63.0
Input modalities
LifecycleMode
Stable since 0.63.0
Server lifecycle modes.
LspAction
Unstable (feature: lsp) — may change or be removed
LSP capability — implement to back the `lsp` tool. LSP action enum — the operations the `lsp` tool supports.
McpConnectionStatus
Stable since 0.63.0
Connection status of an MCP server (Phase 2).
McpContent
Stable since 0.63.0
Content types returned by MCP tool calls.
Message
Stable since 0.63.0
Message union tagged by role.
MessageContent
Stable since 0.63.0
Message content – either a plain text string or a list of structured blocks.
Mode
Stable since 0.63.0
Agent autonomy mode.
ModelRole
Unstable (feature: role-routing) — may change or be removed
The 10 built-in model roles, ported verbatim from omp's `ModelRole`.
OAuthError
Stable since 0.63.0
Errors produced by the OAuth subsystem.
OutputMode
Stable since 0.63.0
Output mode for agent responses.
ProviderError
Stable since 0.63.0
Provider-specific errors. `#[non_exhaustive]` — consumers MUST add a catch-all `_ =>` arm in their `match` expressions. Existing named variants are frozen; their meaning does not change between releases (see `docs/release-process.md`).
ProviderEvent
Stable since 0.63.0
Streaming events emitted by providers
StreamDelta
Stable since 0.63.0
Typed incremental delta for [`AgentEvent::MessageUpdate`].
StructuredOutputError
Stable since 0.63.0
Errors during structured output extraction.
ThinkingLevel
Stable since 0.63.0
Model thinking/reasoning level
TodoOp
Stable since 0.63.0
Operations that can be applied to a todo list.
TodoStatus
Stable since 0.63.0
Status of a single todo task.
ToolCallContext
Stable since 0.63.0
Semantic context for a tool execution event.
ToolCallType
Stable since 0.63.0
ToolCallType.
ToolExecutionMode
Stable since 0.63.0
How tool calls are executed within a single assistant turn.
ToolPrefix
Stable since 0.63.0
Tool name prefix strategy.
ToolValidationError
Stable since 0.63.0
Validation error
VisitReason
Stable since 0.63.0
Reason for visiting a page.

Constants§

ADVISOR_GUIDANCE
Unstable (feature: advisor) — may change or be removed
omp `ADVISOR_GUIDANCE` — behavioral framing carried as a tag attribute on every rendered `` block. The primary agent's system prompt never mentions advisories, so this is its only cue for how to treat them.
ADVISOR_READONLY_TOOL_NAMES
Unstable (feature: advisor) — may change or be removed
Tool names handed to the advisor agent — side-effect-free investigation only. omp `ADVISOR_READONLY_TOOL_NAMES` is `read`/`grep`/`glob`; oxicode's glob equivalent is `find`.
ADVISOR_SYSTEM_PROMPT
Unstable (feature: advisor) — may change or be removed
The advisor agent's system prompt (omp `prompts/advisor/system.md`). The host assembles the full advisor system prompt from this + optional context-files/watchdog blocks.

Traits§

AdvisorAgent
Unstable (feature: advisor) — may change or be removed
Minimal slice of an agent the runtime drives. omp `AdvisorAgent`. Satisfied by `oxicode_agent::Agent` via a host adapter; tests hand-roll a fake.
AdvisorRuntimeHost
Unstable (feature: advisor) — may change or be removed
Host callbacks the runtime needs. omp `AdvisorRuntimeHost`.
AgentPoolProvider
Unstable (feature: agent-hub) — may change or be removed
Agent-pool source for Hub display + todo sub-agent matching. Agent pool access capability. Implemented by the composition root to expose live sub-agent info to the Hub overlay and todo matching.
AgentTool
Stable since 0.63.0
Core trait for all agent tools
CircuitBreaker
Unstable (feature: circuit-breaker) — may change or be removed
Behavior contract for circuit-breaking resilience.
LspProvider
Unstable (feature: lsp) — may change or be removed
LSP capability — implement to back the `lsp` tool. LSP access capability. Implemented by an `oxicode-lsp` crate (feature-gated) or stubbed with `None` when LSP is disabled.
McpTransport
Unstable (feature: mcp-transport) — may change or be removed
MCP transport layer.
MemoryBackend
Unstable (feature: memory) — may change or be removed
Memory backend trait + item — implement to back the `memory_*` tools, or use [`PortMemoryBackend`] to bridge the SDK's `MemoryStore` port. Memory backend for the `memory_*` tools. The composition root implements this, bridging to `oxicode_sdk::ports::MemoryStore` + `EmbeddingProvider`.
Provider
Stable since 0.63.0
LLM provider trait
ProviderResolver
Stable since 0.63.0
Trait for resolving providers and models within an Agent.
SpawnValidator
Unstable (feature: mcp-spawn-validator) — may change or be removed
Validates MCP server spawn commands and environment.
SubagentRunner
Unstable (feature: subagent) — may change or be removed
In-process subagent runner trait (see [`crate::delegation::SdkSubagentRunner`]). In-process sub-agent runner — the library-native delegation backend.
TodoStateProvider
Stable since 0.63.0
Todo state access capability. Implemented by the composition root (oxicode-cli) bridging to the session-scoped todo state. Used by the `todo` agent tool and the TUI sticky panel.
UrlResolver
Stable since 0.63.0
URL resolver trait + resolved content — implement for internal-URL dispatch. URL resolver for internal protocol schemes. The composition root implements this, bridging to `oxicode_sdk::ports::InternalUrlRouter`.

Functions§

apply_model_overrides
Stable since 0.63.0
Apply user overrides to a model map in-place.
apply_provider_overrides
Stable since 0.63.0
Apply user overrides to a provider list in-place.
builtin_model_count
Stable since 0.63.0
Always returns 0 — models are loaded from the materialize pipeline. Retained for SDK backwards compatibility.
builtin_providers_count
Stable since 0.63.0
Number of built-in providers.
create_builtin_provider
Stable since 0.63.0
Create a built-in provider by name.
create_builtin_provider_with_options
Stable since 0.63.0
Create a built-in provider with optional credential and base URL overrides.
custom_provider_names
Stable since 0.63.0
Return the set of currently registered custom provider names (global registry).
decide_role
Unstable (feature: role-switching) — may change or be removed
Decide the active role from signals, in priority order.
default_auth_path
Stable since 0.63.0
Returns the default path for the auth store.
discover_all
Stable since 0.63.0
Discover all Layer 3 sources: local servers + authenticated cloud.
discover_all_authenticated
Stable since 0.63.0
Discover models from authenticated cloud providers whose API key is in the environment.
discover_all_local
Stable since 0.63.0
Discover models from all known local-runtime providers in parallel.
discover_models
Stable since 0.63.0
Discover models from a single OpenAI-compatible endpoint.
dynamic_models
Stable since 0.63.0
Get all dynamically registered models.
fetch_models_async
Stable since 0.63.0
Fetch the model list from an OpenAI-compatible `/v1/models` endpoint asynchronously.
fetch_models_blocking
Stable since 0.63.0
Fetch the model list from an OpenAI-compatible `/v1/models` endpoint using the shared `reqwest::blocking` client.
find_env_keys
Stable since 0.63.0
Get environment variables that can provide an API key for a provider
find_override_files
Stable since 0.63.0
Find all override files in priority order (lowest to highest).
format_advisory_batch
Unstable (feature: advisor) — may change or be removed
Render a batch of advisor notes as the agent-facing message body: one `` element per note, `severity` as an attribute (omitted for a plain nit), `guidance` always present. omp `formatAdvisorBatchContent`.
get_all_env_keys
Stable since 0.63.0
Get all providers with environment variable credentials
get_all_provider_aliases
Stable since 0.63.0
Get all provider names including aliases.
get_all_provider_names
Stable since 0.63.0
Get all provider names (primary names only).
get_api_mappings
Stable since 0.63.0
Get all API-to-provider mappings.
get_builtin_provider
Stable since 0.63.0
Look up a built-in provider by name or alias.
get_builtin_providers
Stable since 0.63.0
Get all built-in providers, built lazily from the catalog TOML.
get_env_api_key
Stable since 0.63.0
Get API key from environment variables for a provider
get_model
Stable since 0.63.0
Convenience function to get a model (static registry only – use [`lookup_model`] for dynamic too)
get_models
Stable since 0.63.0
Get all models from a provider
get_provider
Stable since 0.63.0
Get a provider by name
get_provider_api
Stable since 0.63.0
Get the API type for a provider by name or alias.
get_provider_arc
Stable since 0.63.0
Get a provider by name, returning Arc (for router delegation).
get_provider_base_url
Stable since 0.63.0
Get the default base URL for a provider.
get_provider_env_key
Stable since 0.63.0
Get the environment variable name for a provider.
get_provider_env_keys
Stable since 0.63.0
Get all environment variable names for a provider (primary + extras).
has_env_key
Stable since 0.63.0
Check if any environment variable is set for a provider
is_builtin_provider
Stable since 0.63.0
Check if a provider name or alias is a known built-in.
is_immune_turn_active
Unstable (feature: advisor) — may change or be removed
Half-open turn-count fence `[start, start + turns)` for the post-interrupt cooldown. omp `isAdvisorInterruptImmuneTurnActive`.
is_interrupting_severity
Unstable (feature: advisor) — may change or be removed
Whether advice at this severity should interrupt the running agent (delivered via the steering channel) rather than ride the non-interrupting aside queue. `concern` and `blocker` interrupt; a plain `nit` queues. omp `isInterruptingSeverity`.
live_role_registry
Unstable (feature: role-routing) — may change or be removed
Access the live role registry, if installed.
load_auth_store
Stable since 0.63.0
Load the auth store from disk.
load_builtin_providers
Stable since 0.63.0
Load all built-in providers from the materialized models.dev snapshot.
load_overrides
Stable since 0.63.0
Apply a list of override files to a catalog snapshot.
load_token
Stable since 0.63.0
Convenience: load a token for a provider key (e.g. "anthropic").
lookup_model
Stable since 0.63.0
Look up a model by provider and model ID, checking both dynamic and static registries.
normalize_advisor_note
Unstable (feature: advisor) — may change or be removed
Case-insensitive, punctuation-folded normalization. Lowercases, applies NFKC, collapses every run of non-letter / non-digit characters into a single space, and trims — so `"Stop."`, `"*Stop*"`, and `" stop "` all key to `stop`, while `"No issue; continue."` keys to `no issue continue`. omp `normalizeAdvisorNote`.
register_model
Stable since 0.63.0
Register a model at runtime.
register_provider
Stable since 0.63.0
Register a custom provider at runtime (global registry).
remove_token
Stable since 0.63.0
Remove a stored token.
resolve_delivery_channel
Unstable (feature: advisor) — may change or be removed
Decide how one advisor note reaches the primary agent. omp `resolveAdvisorDeliveryChannel`.
resolve_provider_name
Stable since 0.63.0
Resolve a provider name/alias to its canonical name.
resolve_role_to_model
Unstable (feature: role-switching) — may change or be removed
Resolve a role to a concrete [`Model`] via the registry + model registry.
role_for_tool
Unstable (feature: role-switching) — may change or be removed
Map a tool name to the role it should run under, if it declares one.
save_auth_store
Stable since 0.63.0
Persist the auth store to disk with mode 0o600 where possible.
save_token
Stable since 0.63.0
Convenience: save a token for a provider key.
set_live_role_registry
Unstable (feature: role-routing) — may change or be removed
Install the live role registry. Called once at bootstrap; subsequent calls are no-ops (the first installation wins).
unregister_provider
Stable since 0.63.0
Unregister a previously registered custom provider (global registry).
validate_args
Stable since 0.63.0
Validate tool arguments against a JSON Schema

Type Aliases§

BrowseProgressCallback
Stable since 0.63.0
Callback type for structured browse progress events.
CompactionHook
Stable since 0.63.0
Async hook invoked after context compaction completes.
EnqueueAdviceFn
Unstable (feature: advisor) — may change or be removed
Host callback invoked for each *dedupe-passing* note. The host's [`crate::advisor::emission_guard::AdvisorEmissionGuard`] (not this tool) is the final accept/reject authority; this callback only fires when this tool's own severity-rank gate admits the note.
ProgressCallback
Stable since 0.63.0
Callback type for progress updates
SharedBreaker
Unstable (feature: circuit-breaker) — may change or be removed
Shared ownership helper for `AgentLoopConfig.circuit_breaker`.
ToolError
Stable since 0.63.0
Result type for tool execution