Skip to main content

microclaw_engine/
lib.rs

1//! Concrete, channel-independent MicroClaw Agent Engine services.
2//!
3//! This crate is the physical extraction boundary for the provider-neutral loop and its default
4//! services. Product crates translate input/output at their edge and consume this library.
5
6// Some public helpers are consumed only by product crates, so they are intentionally not all
7// reachable from this crate's own entry points.
8#![allow(dead_code)]
9
10mod internal;
11
12pub mod channel {
13    pub use crate::internal::channels::channel::*;
14}
15
16pub mod channel_adapter {
17    pub use crate::internal::channels::channel_adapter::*;
18}
19
20pub mod observability {
21    pub use crate::internal::observability::*;
22}
23
24pub mod storage {
25    pub use crate::internal::storage::*;
26}
27
28pub mod tool_runtime {
29    pub use crate::internal::tool_runtime::*;
30}
31
32pub mod worker {
33    pub use crate::internal::worker::*;
34}
35
36pub mod a2a;
37pub mod acp_subagent;
38pub mod agent_engine;
39pub mod alerts;
40pub mod approval_broker;
41pub mod chat_commands;
42pub mod chat_turn_queue;
43pub mod checkpoint;
44pub mod clawhub;
45pub mod codex_auth;
46pub mod completion_contract;
47pub mod config;
48pub mod config_persistence;
49pub mod context_references;
50pub mod embedding;
51pub mod headless;
52pub mod hooks;
53pub mod http_client;
54pub mod learning_foundry;
55pub mod llm;
56pub mod mcp;
57pub mod memory_backend;
58pub mod memory_service;
59pub mod messages;
60pub mod mood;
61pub mod plugins;
62pub mod prompt_cache;
63pub mod relationship;
64pub mod run_control;
65pub mod schedule_lifecycle;
66pub mod setup;
67pub mod setup_def;
68pub mod skill_audit;
69pub mod skill_management;
70pub mod skill_review;
71pub mod skills;
72pub mod subdirectory_hints;
73pub mod supervision;
74pub mod title_generator;
75pub mod tool_executor;
76pub mod tool_guardrails;
77pub mod tools;
78pub mod trust_report;
79pub mod turn_recovery;
80pub mod voice;
81
82pub mod channels;
83pub mod runtime;
84
85pub use internal::app::builtin_skills;
86pub use internal::app::logging;
87pub use internal::app::transcribe;
88pub use internal::runtime::{
89    AgentHandle, ControlRequest, ExecutionContext, ExecutionResult, LocalWorker, RemoteWorker,
90    RemoteWorkerOptions, RunController, RunExecutor, RunHandle, Runtime, RuntimeBuildError,
91    RuntimeBuilder, RuntimeStats, Worker, WorkerConnection, WorkerTransport,
92};
93pub use internal::storage::memory;
94pub use internal::worker::{WebSocketWorkerTransport, WorkerHost};
95pub use microclaw_core::error;
96pub use microclaw_core::llm_types;
97
98#[cfg(test)]
99pub mod test_support {
100    use std::sync::{Mutex, MutexGuard, OnceLock};
101
102    pub fn env_lock() -> MutexGuard<'static, ()> {
103        static ENV_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
104        ENV_LOCK
105            .get_or_init(|| Mutex::new(()))
106            .lock()
107            .expect("env lock poisoned")
108    }
109}