Skip to main content

tmai_core/api/
mod.rs

1//! Public API layer (Facade) for tmai-core.
2//!
3//! This module provides [`TmaiCore`] — a high-level entry-point that
4//! encapsulates all core services and exposes typed query/action methods.
5//! Consumers (TUI, Web, MCP, IDE extensions) should use this API instead
6//! of directly operating on `SharedState`.
7//!
8//! # Quick Start
9//!
10//! ```ignore
11//! use tmai_core::api::{TmaiCore, TmaiCoreBuilder};
12//!
13//! let core = TmaiCoreBuilder::new(settings).build();
14//!
15//! // Query agents (lock-free for the caller)
16//! let agents = core.list_agents();
17//! let count = core.attention_count();
18//!
19//! // Subscribe to events (Phase 4)
20//! let mut rx = core.subscribe();
21//! ```
22
23pub mod actions;
24mod auto_approve;
25mod builder;
26mod core;
27pub mod events;
28mod queries;
29pub mod types;
30
31pub use builder::TmaiCoreBuilder;
32pub use core::TmaiCore;
33pub use events::CoreEvent;
34pub use types::{AgentSnapshot, ApiError, TeamSummary, TeamTaskInfo, WorktreeSnapshot};
35
36// Re-export for web/api.rs usage
37pub use actions::has_checkbox_format;