Skip to main content

oxios_kernel/
lib.rs

1//! Oxios kernel: supervisor, event bus, state store.
2//!
3//! The kernel is the core of the Oxios Agent OS. Everything passes
4//! through here: agent lifecycle, inter-agent communication, and
5//! persistent state management.
6
7#![warn(missing_docs)]
8
9// ─── Lifecycle ──────────────────────────────────────────────────────
10// Agent 생성, 실행, 종료. OS의 init + process management.
11pub mod agent_group;
12pub mod agent_lifecycle;
13pub mod agent_runtime;
14pub mod a2a_circuit_breaker;
15pub mod daemon;
16pub mod supervisor;
17
18// ─── Orchestration ──────────────────────────────────────────────────
19// 작업 조율, 스케줄링, 예산 관리.
20pub mod orchestrator;
21pub mod scheduler;
22pub mod cron;
23pub mod budget;
24pub mod circuit_breaker;
25
26// ─── Security ───────────────────────────────────────────────────────
27// 접근 제어, 인증, 권한, 감사.
28pub mod access_manager;
29pub mod auth;
30pub mod capability;
31pub mod credential;
32pub mod audit_trail;
33
34// ─── Communication ──────────────────────────────────────────────────
35// 이벤트, 메시징, 외부 프로토콜.
36pub mod event_bus;
37pub mod a2a;
38pub mod mcp;
39
40// ─── Intelligence ───────────────────────────────────────────────────
41// 메모리, 임베딩, 페르소나, 온보딩.
42pub mod memory;
43pub mod embedding;
44pub mod persona;
45pub mod persona_manager;
46pub mod persona_store;
47pub mod onboarding;
48
49// ─── Tools & Programs ──────────────────────────────────────────────
50// 에이전트가 사용하는 도구, 프로그램, 스킬.
51pub mod tools;
52pub mod host_tools;
53pub mod program;
54pub mod skill;
55#[cfg(feature = "wasm-sandbox")]
56pub mod wasm_sandbox;
57
58// ─── State & Config ─────────────────────────────────────────────────
59// 영속 상태, 설정, 백업, 리소스 모니터링.
60pub mod state_store;
61pub mod config;
62pub mod backup;
63pub mod git_layer;
64pub mod resource_monitor;
65pub mod space;
66
67// ─── Infrastructure ─────────────────────────────────────────────────
68// 엔진, 에러, 타입, 메트릭, 텔레메트리.
69pub mod engine;
70pub mod error;
71pub mod types;
72pub mod metrics;
73#[cfg(feature = "otel")]
74pub mod telemetry_otel;
75#[cfg(feature = "otel")]
76pub use telemetry_otel as telemetry;
77#[cfg(not(feature = "otel"))]
78pub mod telemetry_stub;
79#[cfg(not(feature = "otel"))]
80pub use telemetry_stub as telemetry;
81
82// ─── API Surface ────────────────────────────────────────────────────
83// 외부에 노출하는 typed facade.
84pub mod kernel_handle;
85
86// ─────────────────────────────────────────────────────────────────────
87// Re-exports (같은 섹션 순서)
88// ─────────────────────────────────────────────────────────────────────
89
90// ─── Lifecycle ──────────────────────────────────────────────────────
91pub use agent_group::{OxiosAgentGroup, OxiosAgentGroupStatus, OxiosGroupAgent};
92pub use agent_lifecycle::AgentLifecycleManager;
93pub use agent_runtime::AgentRuntime;
94pub use daemon::{DaemonManager, DaemonStatus};
95pub use supervisor::{BasicSupervisor, Supervisor};
96
97// ─── Orchestration ──────────────────────────────────────────────────
98pub use orchestrator::{AgentRole, OrchestrationResult, Orchestrator, SubTask};
99pub use scheduler::{AgentScheduler, Priority, ScheduledTask, SchedulerStats, TaskStatus};
100pub use cron::{CronJob, CronJobResult, CronJobUpdate, CronScheduler, JobSource};
101pub use budget::{BudgetExceeded, BudgetInfo, BudgetKind, BudgetLimit, BudgetManager};
102pub use circuit_breaker::CircuitBreaker;
103
104// ─── Security ───────────────────────────────────────────────────────
105pub use access_manager::{
106    AccessManager, Action, AgentPermissions, ApprovalStatus, PendingApproval, RbacAuditEntry,
107    RbacManager, RbacPolicy, Role, Subject,
108};
109pub use auth::{AuthManager, KeyMeta};
110pub use capability::template::CapabilityTemplate;
111pub use capability::{CSpace, Capability, CapabilityId, Issuer, ResourceRef, Rights};
112pub use credential::CredentialStore;
113pub use audit_trail::{
114    AgentId as AuditAgentId, AuditAction, AuditEntry, AuditError, AuditTrail, HashDigest,
115};
116
117// ─── Communication ──────────────────────────────────────────────────
118pub use event_bus::{EventBus, KernelEvent};
119pub use a2a::{
120    A2AMessage, A2AProtocol, A2ARequest, A2AResponse, AgentCard, AgentCardRegistry,
121    DelegationHandler, TaskPriority, TaskSpec,
122};
123pub use mcp::{
124    McpBridge, McpCapabilities, McpServer, McpTool, McpToolCallResult as CallToolResult,
125};
126
127// ─── Intelligence ───────────────────────────────────────────────────
128pub use memory::auto_memory_bridge::{
129    AutoMemoryBridge, ExportResult, GuidancePattern, ImportResult, InsightCategory, MemoryInsight,
130    SyncDirection, SyncResult,
131};
132pub use memory::flash_attention::{
133    BenchmarkResult as AttentionBenchmarkResult, FlashAttention, FlashAttentionConfig,
134    MemoryEstimate,
135};
136pub use memory::hyperbolic::{
137    batch_euclidean_to_poincare, euclidean_to_poincare, hyperbolic_distance, mobius_add,
138    mobius_scalar_mul, HyperbolicConfig, HyperbolicEmbedding,
139};
140pub use memory::{
141    chunk_fixed, chunk_paragraphs, content_hash, cosine_similarity_f32, l2_normalize_f32,
142    l2_normalize_f64, ChunkConfig, CurationCandidate, CurationReport, HnswIndex, HnswMemoryIndex,
143    MemoryBudget, MemoryEntry, MemoryGraph, MemoryManager, MemoryType, SemanticHit, TextChunk,
144    TextVector,
145};
146pub use embedding::{EmbeddingProvider, EmbeddingVector, TfIdfEmbeddingProvider};
147pub use persona::{default_personas, Persona};
148pub use persona_manager::PersonaManager;
149pub use persona_store::PersonaStore;
150
151// ─── Tools & Programs ──────────────────────────────────────────────
152#[cfg(feature = "browser")]
153pub use tools::BrowserTool;
154pub use tools::{ExecTool, ProgramTool};
155pub use host_tools::{common as host_tools_common, HostToolStatus, HostToolValidator};
156pub use program::{
157    ArgumentDef, HostRequirementsCheck, InstallSource, Program, ProgramManager, ProgramMeta,
158    ToolDef,
159};
160pub use skill::{Skill, SkillMeta, SkillStore};
161#[cfg(feature = "wasm-sandbox")]
162pub use wasm_sandbox::{ResourceKind, WasmConfig, WasmError, WasmSandbox};
163
164// ─── State & Config ─────────────────────────────────────────────────
165pub use state_store::{AgentResponse, Session, SessionId, SessionSummary, StateStore};
166pub use config::{
167    BrowserConfig, ChannelsConfig, CronConfig, DaemonConfig, EngineConfig, ExecConfig, ExecMode, GitConfig,
168    InlineCronJob, McpConfig, McpServerDef, MemoryConfig, OrchestratorConfig, OxiosConfig, PersonaConfig,
169    TelegramChannelConfig,
170};
171pub use backup::{BackupManifest, BackupSection};
172pub use git_layer::{CommitInfo, GitLayer, LogEntry};
173pub use resource_monitor::{OverloadThreshold, ResourceMonitor, ResourceSnapshot};
174pub use space::{
175    extract_filesystem_path, match_keywords, ConversationBuffer, ConversationTurn, CrossRefEntry,
176    KnowledgeBridge, KnowledgeFlow, PathMatcher, Space, SpaceId, SpaceManager, SpaceManagerError,
177    SpaceSource,
178};
179
180// ─── Infrastructure ─────────────────────────────────────────────────
181pub use engine::{EngineProvider, OxiEngineProvider, OxiosEngine};
182pub use error::{HttpStatus, KernelError, KernelResult};
183pub use types::{AgentId, AgentInfo, AgentStatus};
184pub use metrics::{get_metrics, register_builtin_metrics, registry};
185
186// ─── API Surface ────────────────────────────────────────────────────
187pub use kernel_handle::KernelHandle;
188pub use kernel_handle::{
189    A2aApi, AgentApi, BrowserApi, ExecApi, ExtensionApi, InfraApi, McpApi, PersonaApi, SecurityApi,
190    SpaceApi, StateApi,
191};
192
193// ─── oxi-sdk re-exports ─────────────────────────────────────────────
194//
195// Only types that are actually USED by kernel modules are re-exported.
196// Dead re-exports were removed (see audit 2026-05-16).
197//
198// When oxi-sdk adds full re-exports of oxi-ai/oxi-agent types,
199// we can drop direct oxi-ai/oxi-agent dependencies entirely.
200// See ../oxi/docs/proposals/sdk-consumer-requirements.md
201pub use oxi_sdk::{
202    AgentEvent,
203    AgentLoop,
204    InterAgentMessage,
205    KernelToolContext,
206    KernelToolProvider,
207    MessageBus,
208    Model,
209    Oxi,
210    OxiBuilder,
211    Provider,
212    StreamOptions,
213};