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