@ironbee-ai/cli 0.11.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +14 -1
  3. package/dist/clients/claude/hooks/session-start.d.ts.map +1 -1
  4. package/dist/clients/claude/hooks/session-start.js +7 -0
  5. package/dist/clients/claude/hooks/session-start.js.map +1 -1
  6. package/dist/clients/claude/hooks/session-status.d.ts +129 -0
  7. package/dist/clients/claude/hooks/session-status.d.ts.map +1 -0
  8. package/dist/clients/claude/hooks/session-status.js +444 -0
  9. package/dist/clients/claude/hooks/session-status.js.map +1 -0
  10. package/dist/clients/claude/index.d.ts +26 -0
  11. package/dist/clients/claude/index.d.ts.map +1 -1
  12. package/dist/clients/claude/index.js +146 -0
  13. package/dist/clients/claude/index.js.map +1 -1
  14. package/dist/clients/claude/util.d.ts +18 -5
  15. package/dist/clients/claude/util.d.ts.map +1 -1
  16. package/dist/clients/claude/util.js +23 -6
  17. package/dist/clients/claude/util.js.map +1 -1
  18. package/dist/commands/config.d.ts +5 -4
  19. package/dist/commands/config.d.ts.map +1 -1
  20. package/dist/commands/config.js +10 -4
  21. package/dist/commands/config.js.map +1 -1
  22. package/dist/commands/hook.js +44 -0
  23. package/dist/commands/hook.js.map +1 -1
  24. package/dist/commands/statusline-toggle.d.ts +29 -0
  25. package/dist/commands/statusline-toggle.d.ts.map +1 -0
  26. package/dist/commands/statusline-toggle.js +114 -0
  27. package/dist/commands/statusline-toggle.js.map +1 -0
  28. package/dist/commands/statusline.d.ts +24 -0
  29. package/dist/commands/statusline.d.ts.map +1 -0
  30. package/dist/commands/statusline.js +79 -0
  31. package/dist/commands/statusline.js.map +1 -0
  32. package/dist/hooks/core/session-state.d.ts +25 -0
  33. package/dist/hooks/core/session-state.d.ts.map +1 -1
  34. package/dist/hooks/core/session-state.js +49 -1
  35. package/dist/hooks/core/session-state.js.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/lib/config.d.ts +64 -0
  39. package/dist/lib/config.d.ts.map +1 -1
  40. package/dist/lib/config.js +48 -0
  41. package/dist/lib/config.js.map +1 -1
  42. package/dist/lib/event.d.ts +60 -0
  43. package/dist/lib/event.d.ts.map +1 -1
  44. package/dist/lib/event.js +1 -0
  45. package/dist/lib/event.js.map +1 -1
  46. package/dist/lib/gitignore.d.ts.map +1 -1
  47. package/dist/lib/gitignore.js +11 -0
  48. package/dist/lib/gitignore.js.map +1 -1
  49. package/dist/lib/install-snapshots.d.ts +70 -0
  50. package/dist/lib/install-snapshots.d.ts.map +1 -0
  51. package/dist/lib/install-snapshots.js +168 -0
  52. package/dist/lib/install-snapshots.js.map +1 -0
  53. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0 (2026-05-23)
4
+
5
+ ### Features
6
+
7
+ * **statusline:** add session_status events via a chained statusline wrapper ([#16](https://github.com/ironbee-ai/ironbee-cli/issues/16)) ([a0a5a10](https://github.com/ironbee-ai/ironbee-cli/commit/a0a5a109d9691531711ec1d20ecc5d176aafcc15))
8
+
9
+ ## 0.11.4 (2026-05-21)
10
+
11
+ ### Features
12
+
13
+ * **user-email:** fall back to <github-actions:${GITHUB_ACTOR}> in CI runs ([c590e1f](https://github.com/ironbee-ai/ironbee-cli/commit/c590e1f2877125826edf17e9ce2f5eac935cd990))
14
+
3
15
  ## 0.11.3 (2026-05-21)
4
16
 
5
17
  ### Features
package/README.md CHANGED
@@ -159,6 +159,18 @@ Turns off enforcement but keeps the telemetry path intact. Session lifecycle and
159
159
 
160
160
  The toggle re-renders all client artifacts (hooks, skill, rule, MCP servers, permissions) atomically. The change takes effect on the next agent session — restart your editor / agent after toggling.
161
161
 
162
+ ### Optional: statusline `session_status` events (Claude)
163
+
164
+ ```bash
165
+ ironbee statusline enable
166
+ ```
167
+
168
+ Wraps your Claude Code statusline so that, on every statusline tick, IronBee emits a `session_status` event carrying live **context-window size**, **cost**, and **subscription rate-limit utilization** — signals that are unavailable to hooks or the transcript and can only be read from the statusline. Your existing statusline keeps rendering exactly as before: IronBee installs its wrapper into `.claude/settings.local.json` (the highest-priority, gitignored settings layer) and **chains** to whatever statusline you already had (committed project, global, or local), so the display is unchanged — we just piggyback the telemetry.
169
+
170
+ Auto-enabled when a collector is configured (same as analytics); otherwise opt in with `ironbee statusline enable` or `statusLine.enable: true`. `ironbee statusline disable` restores your original statusline and stops the events. If you change your upstream statusline mid-session, `ironbee statusline sync` re-resolves it for active sessions (otherwise it's picked up on the next session). The change takes effect on the next agent session — restart your editor after toggling.
171
+
172
+ > Claude-only — Cursor has no equivalent statusline mechanism. The events ship through the same queue + collector pipeline as everything else; nothing is written when no collector is configured.
173
+
162
174
  ### Cursor: additional setup
163
175
 
164
176
  Cursor requires manual activation of MCP servers after install:
@@ -187,6 +199,7 @@ ironbee browser <enable|disable> [-g|--local] [--client <name>] Manage the b
187
199
  ironbee backend <enable|disable> [-g|--local] [--client <name>] Manage the runtime-agnostic backend protocol cycle (HTTP/gRPC/GraphQL/WS via backend-devtools)
188
200
  ironbee node <enable|disable> [-g|--local] [--client <name>] Manage the Node.js runtime debug cycle (V8 inspector probes via node-devtools)
189
201
  ironbee verification <enable|disable> [-g|--local] [--client <name>] Master verification toggle (enable = enforce; disable = monitoring-only, no enforcement but sessions/tools still ship to collector)
202
+ ironbee statusline <enable|disable|sync> [-g|--local] [--client <name>] Manage the Claude statusline integration (emits session_status events — context-window size, cost, subscription rate-limits — and chains your existing statusline). sync re-resolves the chained statusline for active sessions
190
203
  ironbee config get <key> [-g|--project|--local] Read a config value (default: merged effective value; flags narrow to one of the three layers)
191
204
  ironbee config set <key> <value> [-g|--local] [--client <name>] [--no-rerender] [--json] [--apply-all|--no-apply-all] Write a config value; auto re-renders client artifacts on artifact-affecting keys; -g writes global, --local writes project-local (gitignored)
192
205
  ironbee config unset <key> [-g|--local] [--client <name>] [--no-rerender] [--apply-all|--no-apply-all] Remove a config value (idempotent); same target / rerender rules as set
@@ -320,7 +333,7 @@ Target flags are mutually exclusive: pass at most one of `-g/--global`, `--proje
320
333
 
321
334
  **Type coercion** — `set` parses the value as JSON when it can (`true`/`42`/`[…]`/`{…}`) and falls back to a raw string when JSON parse fails. URLs and paths pass through unquoted; pass `--json` to force strict JSON parsing (e.g. when you want the literal string `"42"` instead of the number `42`).
322
335
 
323
- **Smart artifact re-render** — when a top-level key affects installed client artifacts (`verification`, `collector`, `browser`, `backend`, `node`, `browserDevTools`, `backendDevTools`, `nodeDevTools`), `set` and `unset` re-render the client files (hooks, MCP entries, skill, rule, permissions) automatically — same code path `verification enable` / `backend enable` / `node enable` use. Other keys (`maxRetries`, `recording`, `jobQueue`, `analytics`, `import`, `ignoredVerifyPatterns`) are pure config flips that the next agent session picks up — no rerender needed.
336
+ **Smart artifact re-render** — when a top-level key affects installed client artifacts (`verification`, `telemetry`, `statusLine`, `collector`, `browser`, `backend`, `node`, `browserDevTools`, `backendDevTools`, `nodeDevTools`), `set` and `unset` re-render the client files (hooks, MCP entries, skill, rule, permissions, statusline) automatically — same code path `verification enable` / `backend enable` / `node enable` use. Other keys (`maxRetries`, `recording`, `jobQueue`, `analytics`, `import`, `ignoredVerifyPatterns`) are pure config flips that the next agent session picks up — no rerender needed.
324
337
 
325
338
  Pass `--no-rerender` to skip the rerender on artifact-affecting keys (handy for scripted bulk edits — follow up with `ironbee install` to resync). If a rerender fails midway, the config file is rolled back to its prior bytes so disk state never diverges from installed artifacts.
326
339
 
@@ -1 +1 @@
1
- {"version":3,"file":"session-start.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0F3D"}
1
+ {"version":3,"file":"session-start.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiBH,wBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiG3D"}
@@ -13,6 +13,7 @@ const actions_1 = require("../../../hooks/core/actions");
13
13
  const session_state_1 = require("../../../hooks/core/session-state");
14
14
  const util_1 = require("../util");
15
15
  const config_1 = require("../../../lib/config");
16
+ const session_status_1 = require("./session-status");
16
17
  const logger_1 = require("../../../lib/logger");
17
18
  const output_1 = require("../../../lib/output");
18
19
  const stdin_1 = require("../../../lib/stdin");
@@ -38,6 +39,12 @@ async function run(projectDir) {
38
39
  // them on next start.
39
40
  (0, session_state_1.setUserEmail)(sessionDir, (0, util_1.getClaudeUserEmail)());
40
41
  (0, session_state_1.setUsage)(sessionDir, (0, util_1.resolveClaudeUsage)());
42
+ // Resolve + cache the chained statusline command once per session so the
43
+ // statusline wrapper reads a single state.json field per tick instead of
44
+ // walking the settings cascade. Gated on the feature; harmless when off.
45
+ if ((0, config_1.isSessionStatusEnabled)((0, config_1.loadConfig)(projectDir))) {
46
+ (0, session_state_1.setChainedStatusLine)(sessionDir, (0, session_status_1.resolveChainTarget)(projectDir) ?? null);
47
+ }
41
48
  const entry = {
42
49
  ...(0, actions_1.baseFields)(actionsFile),
43
50
  type: "session_start",
@@ -1 +1 @@
1
- {"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAgBH,kBA0FC;AAxGD,yDAA2F;AAC3F,qEAAuH;AACvH,kCAAiE;AACjE,gDAAyE;AACzE,gDAAyD;AACzD,gDAAmD;AACnD,8CAA+C;AAC/C,sDAA2D;AAOpD,KAAK,UAAU,GAAG,CAAC,UAAkB;IACxC,IAAI,KAA8B,CAAC;IACnC,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAS,GAAE,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AE,WAAW,EAAE,sBAAY,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,mBAAmB,GAAY,IAAA,+BAAsB,EAAC,IAAA,mBAAU,EAAC,UAAU,CAAC,CAAC,CAAC;IACpF,MAAM,IAAA,6BAAiB,EAAC,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;IAC9E,eAAM,CAAC,KAAK,CAAC,kBAAkB,SAAS,KAAK,KAAK,CAAC,MAAM,IAAI,SAAS,GAAG,CAAC,CAAC;IAE3E,oEAAoE;IACpE,oEAAoE;IACpE,6CAA6C;IAC7C,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACvB,IAAA,qBAAY,EAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACpB,OAAO;IACX,CAAC;IAED,MAAM,WAAW,GAAW,IAAI,CAAC,SAAS,CAAC;QACvC,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,CAAC,2BAA2B,EAAE,0BAA0B,CAAC;KACpE,CAAC,CAAC;IACH,MAAM,WAAW,GAAW,IAAI,CAAC,SAAS,CAAC;QACvC,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,CAAC,cAAc,EAAE,4BAA4B,CAAC;QACtD,MAAM,EAAE,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;KACtE,CAAC,CAAC;IAEH,IAAA,qBAAY,EAAC;;;;cAIH,SAAS;;;;;;;;UAQb,WAAW;;;UAGX,WAAW;;;;;;CAMpB,EAAE,CAAC,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAiBH,kBAiGC;AAhHD,yDAA2F;AAC3F,qEAA6I;AAC7I,kCAAiE;AACjE,gDAAiG;AACjG,qDAAsD;AACtD,gDAAyD;AACzD,gDAAmD;AACnD,8CAA+C;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B,CAAC;KACtE,CAAC,CAAC;IAEH,IAAA,qBAAY,EAAC;;;;cAIH,SAAS;;;;;;;;UAQb,WAAW;;;UAGX,WAAW;;;;;;CAMpB,EAAE,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Claude Code — statusline wrapper (`ironbee hook session-status`)
3
+ *
4
+ * Installed as the project's `statusLine.command`. On every statusline tick
5
+ * it does two independent things:
6
+ * 1. Submits a `session_status` event (context-window size, cost,
7
+ * subscription rate-limits) to the queue — signals unavailable to hooks
8
+ * or the transcript.
9
+ * 2. Chains to the user's ORIGINAL statusline command so their statusline
10
+ * keeps rendering exactly as before (we wrap, never replace).
11
+ *
12
+ * The event submit is fire-and-forget and must NEVER block or break the
13
+ * statusline render. The chain target is resolved once at SessionStart and
14
+ * cached in state.json; this wrapper falls back to live cascade resolution
15
+ * if the cache is missing/unreadable, so a cache miss can never make the
16
+ * user's statusline vanish.
17
+ */
18
+ import { SessionStatusEvent } from "../../../lib/event";
19
+ /** Subset of the statusline stdin JSON this wrapper consumes. */
20
+ interface StatusLinePayload {
21
+ session_id?: string;
22
+ model?: {
23
+ id?: string;
24
+ };
25
+ workspace?: {
26
+ project_dir?: string;
27
+ };
28
+ cost?: {
29
+ total_cost_usd?: number;
30
+ total_duration_ms?: number;
31
+ total_api_duration_ms?: number;
32
+ total_lines_added?: number;
33
+ total_lines_removed?: number;
34
+ };
35
+ context_window?: {
36
+ total_input_tokens?: number;
37
+ total_output_tokens?: number;
38
+ context_window_size?: number;
39
+ used_percentage?: number;
40
+ remaining_percentage?: number;
41
+ current_usage?: {
42
+ input_tokens?: number;
43
+ output_tokens?: number;
44
+ cache_creation_input_tokens?: number;
45
+ cache_read_input_tokens?: number;
46
+ } | null;
47
+ };
48
+ rate_limits?: {
49
+ five_hour?: {
50
+ used_percentage?: number;
51
+ resets_at?: number;
52
+ };
53
+ seven_day?: {
54
+ used_percentage?: number;
55
+ resets_at?: number;
56
+ };
57
+ };
58
+ }
59
+ /**
60
+ * True only when the command is EXACTLY our bare wrapper invocation. A tight
61
+ * match so a user who wraps us themselves (`tee >(ironbee hook session-status)
62
+ * | real-cmd`) is NOT mis-identified as "ours" — that compound is their own
63
+ * statusline and must be chained, not skipped.
64
+ */
65
+ export declare function isIronbeeStatusLine(command: string | undefined): boolean;
66
+ /**
67
+ * Resolve the project dir anchor. Prefers `CLAUDE_PROJECT_DIR` to stay
68
+ * consistent with every other hook and with SessionStart (session runtime
69
+ * files — state.json, queue — live under exactly this path), falling back to
70
+ * the statusline's `workspace.project_dir` and finally cwd. NOT canonicalized
71
+ * — the snapshot store canonicalizes internally on lookup, and the session
72
+ * dir must match the raw path SessionStart wrote under.
73
+ */
74
+ export declare function resolveProjectDir(input: StatusLinePayload): string;
75
+ /**
76
+ * Resolve the chain target = the statusline command Claude Code WOULD run
77
+ * without us = the highest-priority non-ours `statusLine.command` across the
78
+ * settings layers, walking high → low:
79
+ * 1. localSettings layer — our wrapper overwrote it, so the original lives
80
+ * in the install snapshot.
81
+ * 2. projectSettings (`.claude/settings.json`) — untouched, read live.
82
+ * 3. userSettings (`~/.claude/settings.json`) — untouched, read live.
83
+ * First non-ours wins. `undefined` = nothing to chain.
84
+ */
85
+ export declare function resolveChainTarget(projectDir: string): string | undefined;
86
+ /**
87
+ * Strip the bracketed runtime suffix from the model id
88
+ * (`claude-opus-4-7[1m]` → `claude-opus-4-7`). The `[1m]` extended-context
89
+ * marker is redundant on the event — `context_window.context_window_size`
90
+ * already carries the effective window — so we keep the model field a clean
91
+ * canonical id.
92
+ */
93
+ export declare function normalizeModelId(id: string | undefined): string;
94
+ /**
95
+ * Build the wire event. Maps fields EXPLICITLY from the statusline JSON (R12)
96
+ * so our wire contract is independent of host JSON drift. `model` is the flat
97
+ * id string. `actionsFile` is only the derivation anchor for `baseFields`
98
+ * (id/session_id/project_name + user/usage) — we never write to it.
99
+ */
100
+ export declare function buildSessionStatusEvent(input: StatusLinePayload, projectDir: string, sessionId: string): SessionStatusEvent;
101
+ /**
102
+ * Deterministic per-tick id. `total_duration_ms` is monotonic within a
103
+ * session (`Date.now() - startTime`), so each tick gets a distinct id and the
104
+ * backend keeps every tick; a cancelled-then-refired identical tick collides
105
+ * on the same id (dedup). UUID-shaped via the same hashing convention as the
106
+ * analytics deterministic ids.
107
+ */
108
+ export declare function deriveSessionStatusEventId(sessionId: string, totalDurationMs: number): string;
109
+ /**
110
+ * Signature over the RESOURCE-METRIC fields of the event — the fields that
111
+ * only change on an API response. Deliberately EXCLUDES:
112
+ * - `cost.total_duration` / `total_api_duration` — wall-clock durations that
113
+ * tick up on every statusline fire (including them would make the
114
+ * signature differ every tick, defeating the dedup).
115
+ * - `id` / `timestamp` — per-emit, not metrics.
116
+ * - `activity_id` — correlation metadata, not a resource metric (a new turn
117
+ * with frozen metrics shouldn't re-emit; the next real metric change
118
+ * captures the new activity_id).
119
+ * Used by skip-if-unchanged: two ticks with the same signature carry the same
120
+ * resource snapshot, so the later one is a redundant emit and is skipped.
121
+ */
122
+ export declare function computeSessionStatusSignature(e: SessionStatusEvent): string;
123
+ /**
124
+ * Statusline entry point. Reads stdin, submits the event (gated, fire-and-
125
+ * forget), then chains the user's original statusline.
126
+ */
127
+ export declare function runSessionStatus(): Promise<void>;
128
+ export {};
129
+ //# sourceMappingURL=session-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-status.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH,OAAO,EAAuC,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAO7F,iEAAiE;AACjE,UAAU,iBAAiB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,SAAS,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;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