Skip to main content

Crate context_bar

Crate context_bar 

Source
Expand description

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.

Modules§

agent_context
Combined, agent-readable brief.
claude_statusline
context_engine
detail_html
Detail page renderer.
git_signal
hud
HUD rendering.
i18n
Bilingual (EN/TR) text selection, shared by every Rust surface.
live
5h-block burn status — the engine half of the live dashboard (ROADMAP B2) and the native popover gauge (C1). Pure: derives burn rate, % of limit, ETA-to-limit, and a projected block total from a snapshot + a clock.
report
Tabular usage/cost reports built from a UsageSnapshot.
state_writer
time_windows
usage_signal
Cross-project agent usage signals.