Skip to main content

Crate opi_agent

Crate opi_agent 

Source
Expand description

General-purpose agent runtime with tool calling and session management.

Provides the foundation for building specialized agents with pluggable tool systems, hooks, queues, and session persistence.

Re-exports§

pub use agent::Agent;
pub use event::AgentEvent;
pub use event::AgentEventSink;
pub use extension::Extension;
pub use extension::ExtensionCommand;
pub use extension::ExtensionError;
pub use extension::ExtensionHookResult;
pub use extension::ExtensionRegistry;
pub use hooks::AgentHooks;
pub use loop_types::AgentError;
pub use loop_types::AgentLoopConfig;
pub use loop_types::AgentLoopContext;
pub use message::AgentMessage;
pub use sdk::SDK_SCHEMA_VERSION;
pub use sdk::SdkCommand;
pub use sdk::SdkResponse;
pub use session_event::AgentSessionEvent;
pub use state::AgentState;
pub use streaming_proxy::ProxyConfig;
pub use streaming_proxy::ProxyEvent;
pub use streaming_proxy::ProxyHandler;
pub use streaming_proxy::SecretRedactor;
pub use streaming_proxy::StreamingProxy;
pub use streaming_proxy::StreamingProxyError;
pub use tool::ExecutionMode;
pub use tool::Tool;
pub use tool::ToolError;
pub use tool::ToolResult;

Modules§

agent
Stateful Agent wrapper around the agent loop (S8.2).
compaction
Compaction engine for managing conversation context size (S9.5).
event
Agent event protocol (S7.4).
extension
Extension system for agent customization.
hooks
Hook trait for agent loop customization (S8.2).
loop_types
Types for the agent loop (S6.1, S8.2).
message
Agent-level message types (S7.2).
sdk
SDK embedding surface for programmatic agent control.
session
Session v1 JSONL storage (S9.3).
session_branch
Session branch reconstruction (task 4.9).
session_event
Session-level event protocol (S7.5).
state
Agent state management.
streaming_proxy
Streaming proxy for forwarding command/event JSONL streams (task 4.10).
tool
Tool calling abstraction (S8.2).
validation
JSON Schema validation for tool arguments.

Structs§

ToolDef

Functions§

agent_loop
Run the agent loop until completion or cancellation.