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
10pub mod internal;
11
12pub mod a2a;
13pub mod acp_subagent;
14pub mod agent_engine;
15pub mod alerts;
16pub mod chat_commands;
17pub mod chat_turn_queue;
18pub mod checkpoint;
19pub mod clawhub;
20pub mod codex_auth;
21pub mod completion_contract;
22pub mod config;
23pub mod config_persistence;
24pub mod context_references;
25pub mod embedding;
26pub mod headless;
27pub mod hooks;
28pub mod http_client;
29pub mod learning_foundry;
30pub mod llm;
31pub mod mcp;
32pub mod memory_backend;
33pub mod memory_service;
34pub mod messages;
35pub mod mood;
36pub mod plugins;
37pub mod prompt_cache;
38pub mod relationship;
39pub mod run_control;
40pub mod schedule_lifecycle;
41pub mod setup;
42pub mod setup_def;
43pub mod skill_audit;
44pub mod skill_review;
45pub mod skills;
46pub mod subdirectory_hints;
47pub mod supervision;
48pub mod title_generator;
49pub mod tool_executor;
50pub mod tool_guardrails;
51pub mod tools;
52pub mod trust_report;
53pub mod turn_recovery;
54pub mod voice;
55
56pub mod channels;
57pub mod runtime;
58
59pub use internal::app::builtin_skills;
60pub use internal::app::logging;
61pub use internal::app::transcribe;
62pub use internal::runtime::{
63    AgentHandle, ControlRequest, ExecutionContext, ExecutionResult, LocalWorker, RemoteWorker,
64    RunController, RunExecutor, RunHandle, Runtime, RuntimeBuildError, RuntimeBuilder,
65    RuntimeStats, Worker, WorkerConnection, WorkerTransport,
66};
67pub use internal::storage::memory;
68pub use internal::worker::{WebSocketWorkerTransport, WorkerHost};
69pub use microclaw_core::error;
70pub use microclaw_core::llm_types;
71
72#[cfg(test)]
73pub mod test_support {
74    use std::sync::{Mutex, MutexGuard, OnceLock};
75
76    pub fn env_lock() -> MutexGuard<'static, ()> {
77        static ENV_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
78        ENV_LOCK
79            .get_or_init(|| Mutex::new(()))
80            .lock()
81            .expect("env lock poisoned")
82    }
83}