1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Crate is under active development — many types/functions are defined ahead
// of use across modules.
//! # Selfware — Your Personal AI Workshop
//!
//! An agentic coding harness for local LLMs. 70+ tools, multi-agent swarm,
//! evolution engine, hooks, MCP, LSP, and a fox mascot — all local-first,
//! no cloud required.
//!
//! ## Core Features
//!
//! - **70+ Tools**: File, git, cargo, search, shell, PTY, browser automation,
//! computer control, LSP, MCP, knowledge graph, vision, FIM editing
//! - **Multi-Agent Swarm**: Up to 16 concurrent agents with consensus voting
//! - **Safety**: Multi-layer validation, path protection, command filtering,
//! JSONL audit logging, permission grants with expiry
//! - **Hooks**: Event-driven automation (PreToolUse, PostToolUse, Stop)
//! - **MCP**: Both client (connect to external tools) and server (expose selfware
//! tools to other AI systems)
//! - **LSP**: Semantic code intelligence via rust-analyzer, pyright, tsserver, gopls
//! - **Doctor**: System dependency checker (30+ tools) and LLM backend diagnostics
//! - **Templates**: Project scaffolding for Rust, Python, Node.js with QA profiles
//! - **Cognition**: PDVR cycle (Plan-Do-Verify-Reflect), working memory
//! - **Persistence**: Checkpoint system for long-running tasks with session resume
//! - **Self-Healing**: Error classification, recovery strategies, exponential backoff
//! - **Evolution Engine**: Recursive self-improvement with SAB-based fitness
//! - **Local-First**: Runs entirely on your hardware, zero data egress
//!
//! ## Quick Start
//!
//! ```ignore
//! use selfware::{Agent, Config};
//!
//! let config = Config::load(None)?;
//! let mut agent = Agent::new(config).await?;
//! agent.run_task("Add unit tests for the auth module").await?;
//! ```
//!
//! ## CLI
//!
//! ```bash
//! selfware chat # Interactive mode
//! selfware run "add unit tests" # One-shot task
//! selfware doctor # Check system dependencies
//! selfware init # Project scaffold wizard
//! selfware multi-chat -n 4 # Multi-agent swarm
//! selfware mcp-server # Run as MCP server
//! ```
//!
//! See [selfware.design](https://selfware.design) for full documentation.
// ============================================================================
// Core modules (public API)
// ============================================================================
// ============================================================================
// Domain modules
// ============================================================================
// Public for external tests and downstream use. Submodule items are selectively
// re-exported below for convenience; the full paths remain available.
// ============================================================================
pub
pub
pub
pub
pub
// Evolution engine — recursive self-improvement via evolutionary mutation
// VLM benchmark suite for visual understanding evaluation
// Backward-compatible re-exports for safety module
pub use redact;
// Re-export shutdown_tracing for main.rs
pub use shutdown_tracing;
pub use sandbox;
pub use threat_modeling;
// Backward-compatible re-exports for analysis module
pub use analyzer;
pub use bm25;
pub use vector_store;
// Backward-compatible re-exports for session module
pub use checkpoint;
// Backward-compatible re-exports for observability module
pub use telemetry;
// Backward-compatible re-exports for orchestration module
pub use multiagent;
pub use planning;
pub use swarm;
pub use workflows;
// Backward-compatible re-exports for devops module
pub use container;
pub use process_manager;
// Backward-compatible re-exports for testing module
pub use verification;
// ============================================================================
// Utility modules
// ============================================================================
// ============================================================================
// Global shutdown coordination
// ============================================================================
use ;
static SHUTDOWN_FLAG: AtomicBool = new;
/// Signal that a graceful shutdown has been requested.
/// Check whether a graceful shutdown has been requested.
// ============================================================================
// Backward-compatible re-exports for UI submodules
// ============================================================================
pub use demo;
pub use tui;