Skip to main content

spool/bootstrap/
mod.rs

1//! Bootstrap module — first-run setup for the Spool desktop app.
2//!
3//! Responsible for the "install once, AI tools just work" experience:
4//!
5//! 1. Release embedded binaries to `~/.spool/bin/`
6//! 2. Create standard data directory layout under `~/.spool/`
7//! 3. Add `~/.spool/bin` to user's shell PATH
8//! 4. Register MCP integration for detected AI tools (Claude Code, Cursor, etc.)
9//! 5. Install Claude Code hooks (Stop, SessionStart, etc.)
10//! 6. Mark first-run complete via `~/.spool/version.json`
11//!
12//! The Tauri desktop app calls `run_bootstrap_if_needed` on startup.
13//! Subsequent launches detect the version marker and skip the heavy work.
14//!
15//! ## Directory layout
16//!
17//! ```text
18//! ~/.spool/
19//! ├── bin/                  ← Released binaries (added to PATH)
20//! │   ├── spool
21//! │   ├── spool-mcp
22//! │   └── spool-daemon
23//! ├── data/                 ← Ledger, projection cache, config
24//! │   ├── memory-ledger.jsonl
25//! │   ├── memory-ledger.latest-state.json
26//! │   └── config.toml
27//! ├── plugins/              ← Future: Pro plugins (.dylib/.so/.dll)
28//! ├── version.json          ← Bootstrap state + service version
29//! └── license.json          ← Future: Pro license (absent in OSS)
30//! ```
31
32pub mod auto_configure;
33pub mod layout;
34pub mod orchestrator;
35pub mod path_config;
36pub mod release;
37pub mod state;
38pub mod updater;
39
40pub use auto_configure::{AutoConfigureReport, ClientConfigReport, auto_configure_clients};
41pub use layout::SpoolLayout;
42pub use orchestrator::{BootstrapReport, is_first_run, run_bootstrap, run_bootstrap_with_layout};
43pub use path_config::{PathConfigReport, configure_path};
44pub use state::{BootstrapState, ServiceVersion};
45pub use updater::{UpdateApplyReport, UpdateCheckReport, apply_update, check_for_update};