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 context_window;
51pub mod embedding;
52pub mod headless;
53pub mod hooks;
54pub mod http_client;
55pub mod learning_foundry;
56pub mod llm;
57pub mod mcp;
58pub mod memory_backend;
59pub mod memory_service;
60pub mod messages;
61pub mod mood;
62pub mod plugins;
63pub mod prompt_cache;
64pub mod relationship;
65pub mod run_control;
66pub mod schedule_lifecycle;
67pub mod setup;
68pub mod setup_def;
69pub mod skill_audit;
70pub mod skill_management;
71pub mod skill_review;
72pub mod skills;
73pub mod subdirectory_hints;
74pub mod supervision;
75pub mod title_generator;
76pub mod tool_executor;
77pub mod tool_gate;
78pub mod tool_guardrails;
79pub mod tools;
80pub mod trust_report;
81pub mod turn_recovery;
82pub mod voice;
83
84pub mod channels;
85pub mod runtime;
86
87pub use internal::app::builtin_skills;
88pub use internal::app::logging;
89pub use internal::app::transcribe;
90pub use internal::runtime::{
91    AgentHandle, ControlRequest, ExecutionContext, ExecutionResult, LocalWorker, RemoteWorker,
92    RemoteWorkerOptions, RunController, RunExecutor, RunHandle, Runtime, RuntimeBuildError,
93    RuntimeBuilder, RuntimeStats, Worker, WorkerConnection, WorkerTransport,
94};
95pub use internal::storage::memory;
96pub use internal::worker::{WebSocketWorkerTransport, WorkerHost};
97pub use microclaw_core::error;
98pub use microclaw_core::llm_types;
99
100#[cfg(test)]
101pub mod test_support {
102    use std::sync::{Mutex, MutexGuard, OnceLock};
103
104    pub fn env_lock() -> MutexGuard<'static, ()> {
105        static ENV_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
106        ENV_LOCK
107            .get_or_init(|| Mutex::new(()))
108            .lock()
109            .expect("env lock poisoned")
110    }
111}