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
//! ContextBar — Zed extension entry point + engine re-exports.
//!
//! The reusable engine now lives in the `context-bar-core` crate. This crate
//! is the thin host layer: it re-exports the engine modules under their
//! historical paths (so `context_bar::usage_signal`, `crate::context_engine`,
//! … keep resolving for the CLI binary, the example, and the wasm glue below)
//! and adds the Zed extension surface.
//!
//! ## Verified
//! - Extension loads in Zed Preview.
//! - `process:exec` can shell out to `git` inside the worktree.
//! - Engine writes `.context-bar/{state.json,brief-*.md,AGENT.md}` artifacts.
//! - `run_slash_command` receives a `Worktree` and is the strongest verified
//! hook to wire automatic refresh into.
//!
//! ## Unverified / explicitly isolated behind seams
//! - Zed has no public always-on HUD primitive yet. The HUD layer is expected
//! to consume `state.json` directly when a hook exists.
//! - `zed_extension_api` 0.7 exposes no load-time or worktree-open hook, so
//! the first refresh fires on the first agent interaction that reaches the
//! extension (any slash command). After that, [`auto_refresh::refresh`]
//! keeps the surface fresh idempotently. Once a real load hook ships, the
//! call site moves; the function does not.
//! - Codex ACP threads in Zed Preview do not currently invoke extension slash
//! commands. Agents are therefore expected to read `.context-bar/AGENT.md`
//! from the filesystem (Codex/Claude conventions) until a richer
//! automatic-context hook is verified.
//! - The seam for both cases is [`context_engine::assemble`], which takes
//! pre-collected signals and is decoupled from `zed::Worktree`.
// Engine, re-exported under the historical module paths so existing consumers
// (`context_bar::<mod>` in the bin/example, `crate::<mod>` in the wasm glue)
// need no import changes after the workspace split.
pub use ;
// CLI-only engine module (see context-bar-core); excluded from the wasm extension.
pub use claude_statusline;