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
//! context-bar-core — the cross-platform engine.
//!
//! Everything reusable across the surfaces lives here: transcript reading,
//! the cost/token model, session/window bucketing, the agent-context
//! assembler, and the HUD/HTML renderers. The crate is platform-free at the
//! type/parse/assemble layer; the host-coupled bits (process spawning, the
//! macOS keychain, the on-disk snapshot cache, and the wasm32 `Worktree`
//! collectors) sit behind `cfg(target_arch)` gates inside their modules.
//!
//! Consumers:
//! - the `context-bar` CLI/menubar engine (native) calls
//! [`usage_signal::collect_native`], [`context_engine::assemble`],
//! [`state_writer::write`], [`hud::render`], [`detail_html::render`];
//! - the Zed extension (wasm32) reuses the same types and calls the
//! `Worktree`-backed collectors (`git_signal::collect`,
//! `usage_signal::collect`, `context_engine::ContextEngine::generate`).
//!
//! The seam that keeps the engine decoupled from any host is
//! [`context_engine::assemble`], which takes pre-collected signals.
// CLI-only: reads Claude Code's statusline payload from stdin. Not built for
// the wasm Zed extension, which has no statusline hook.
// Native-only pure-Rust transcript collector (reads ~/.claude, ~/.codex).
// Native-only other-AI-tool probes (~/.gemini, ~/.aider, ~/.zsh_history).
// Native-only online/host enrichments (statusline, usage API, rate limits).