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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
//! Bamboo - A fully self-contained AI agent backend framework
//!
//! Bamboo provides a complete backend system for AI agents, including:
//! - Built-in HTTP/HTTPS server (Actix-web)
//! - Agent execution loop with tool support
//! - LLM provider integrations (OpenAI, Anthropic, Google Gemini, GitHub Copilot)
//! - Session management and persistence
//! - Workflow and slash command systems
//! - Process management for external tools
//!
//! # Features
//!
//! - **Dual mode**: Binary (standalone server) or library (embedded)
//! - **Unified directory**: All data in the Bamboo data directory (default `${HOME}/.bamboo`)
//! - **Production-ready**: Built-in CORS, rate limiting, security headers
//!
//! # Quick Start
//!
//! ## Binary Mode
// Allow some clippy lints that are pre-existing
//!
//! ```bash
//! bamboo serve --port 9562 --data-dir "$HOME/.bamboo"
//! ```
//!
//! ## Library Mode
//!
//! ```rust,ignore
//! use bamboo_agent::{BambooServer, Config};
//!
//! #[tokio::main]
//! async fn main() {
//! let config = Config::new();
//! let server = BambooServer::new(config);
//! server.start().await.unwrap();
//! }
//! ```
use PathBuf;
/// The `bamboo subagent-worker` actor worker (provision via stdin, serve over WS).
/// `ClaudeCodeExecutor`: drives the official Claude Code CLI as a
/// `ChildExecutor` (`ExecutorSpec::ClaudeCode`), sibling of `subagent_worker`.
/// The `bamboo broker-agent serve` worker: connect to a central broker and
/// answer Ask/Task (query/steer) for its mailbox; deployable local/Docker/remote.
/// The `bamboo actor run` CLI: drive an actor from the terminal.
/// The `bamboo health|status|sessions|session|stop|respond|schedules` admin
/// CLI: a thin HTTP client over a running `bamboo serve` for operators (health
/// probe, session list/inspect/stop/respond, schedule management).
/// The `bamboo -p` headless server mode: full AppState, one-shot, resumable.
/// The `bamboo init` / `doctor` / `config set` onboarding CLI: configure a
/// provider + API key and self-diagnose without the web UI (server-less).
/// The `bamboo skills list` / `mcp list` read CLI: inspect the configured skill
/// and MCP surfaces offline (straight from `<data_dir>`), no running server.
/// The `bamboo plugin install|list|remove|update` CLI: a thin HTTP client over
/// a running `bamboo serve` instance's `/api/v1/plugins` routes.
// Server module is now a separate workspace crate
pub use bamboo_server as server;
// Ergonomic re-export: `bamboo_agent::tools` → `bamboo_tools` for backward compatibility.
pub use bamboo_tools as tools;
// Compatibility surface matching the PUBLISHED crate API (`bamboo_agent::core::...`).
// `core` mirrors the infrastructure crate, plus a back-compat re-export of `paths`
// and `ProxyAuth` — which moved out of `bamboo_infrastructure` into `bamboo_config`
// in the 2026.6 reorg. Downstream consumers (e.g. bodhi) build against the published
// bamboo-agent where these still live under `core::`; re-exporting them here keeps a
// single `core::` import compiling against this local checkout too. The explicit
// names take precedence over the glob, so there is no conflict.
// See memory: bodhi-ci-builds-against-published-bamboo.
// Re-export infrastructure crate so consumers can access config, paths, encryption, etc.
// via `bamboo_agent::infrastructure::...`
//
// `Agent` / `AgentBuilder` come from the ergonomic `agent` wrappers (the single
// source of truth; resolves TD-2 — no more duplicate re-export through
// `bamboo_engine`). The facade now lives in the leaf `bamboo-sdk` crate
// (depends only on engine/infra/tools/agent-core/domain, never on
// bamboo-server), and is re-exported here to keep existing public paths
// (`bamboo_agent::agent::...`, `bamboo_agent::Agent`, ...) stable.
pub use bamboo_infrastructure as infrastructure;
pub use agent;
pub use ;
// Re-export the runtime config crate so consumers can reach config, paths,
// proxy auth, encryption, etc. via `bamboo_agent::config::...`. These moved out
// of `bamboo_infrastructure` into the dedicated `bamboo-config` crate.
pub use bamboo_config as config;
// Re-export core Config as the primary configuration type
pub use ServerConfig;
pub use Config;
pub use ;
/// Main Bamboo server instance
/// Builder pattern for creating BambooServer
///
/// Provides a fluent API for configuring and instantiating a BambooServer.
///
/// # Example
///
/// ```rust,ignore
/// use bamboo_agent::{BambooBuilder, BambooServer};
/// use std::path::PathBuf;
///
/// let server = BambooBuilder::new()
/// .port(9562)
/// .bind("127.0.0.1")
/// .data_dir(PathBuf::from("/path/to/bamboo-data-dir"))
/// .build()
/// .unwrap();
/// ```