@azure-id/orc 1.2.1 → 1.4.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.
@@ -837,6 +837,26 @@ const CONTRACTS = [
837
837
  "skills/_shared/phases/preflight.md",
838
838
  ],
839
839
  },
840
+ {
841
+ // v1.3.0 W1 — the CLI Hook Interface. The compiled program is the ONE thing
842
+ // that crosses the wall between the CLI and the hook, so both halves have
843
+ // to name the same file. The AUTHORED layout is deliberately NOT registered
844
+ // here: the hook must never name it, because it must never read it.
845
+ name: "the compiled status-line program (the CLI compiles, the hook renders)",
846
+ token: "statusline-compiled.json",
847
+ binFiles: ["bin/cli.js"],
848
+ files: ["hooks/orc-statusline.js", "hooks/orc-statusline-render.js", "hooks/README.md"],
849
+ },
850
+ {
851
+ // The board rule, stated ONCE so the CLI, the hook and the panel all cite
852
+ // the same sentence. It is the thing a user most needs to understand about
853
+ // the board and the thing most likely to be paraphrased into three
854
+ // different half-truths.
855
+ name: "the dense-prefix invariant (the status-line board)",
856
+ token: "A line may hold a component only if every line above it holds at least one.",
857
+ binFiles: ["bin/cli.js"],
858
+ files: ["hooks/README.md", "hooks/orc-statusline.js"],
859
+ },
840
860
  {
841
861
  name: "behavior-trace run pointer (every ORC entry point writes .current)",
842
862
  token: ".current",
@@ -1371,7 +1391,11 @@ const CONTRACTS = [
1371
1391
  // wiki-meta.json lives under.
1372
1392
  name: "the challenge ledger (v0.47.0 — CLI-only writer)",
1373
1393
  token: "challenge.json",
1374
- files: ["skills/orc-challenge/references/cycle-state.md"],
1394
+ files: [
1395
+ "skills/orc-challenge/references/cycle-state.md",
1396
+ // the `challenge` component reads it (v1.3.0)
1397
+ "hooks/orc-statusline.js",
1398
+ ],
1375
1399
  binFiles: ["bin/cli.js"],
1376
1400
  },
1377
1401
  {
@@ -1474,6 +1498,8 @@ const CONTRACTS = [
1474
1498
  token: "RESUME.md",
1475
1499
  binFiles: ["bin/cli.js"],
1476
1500
  files: [
1501
+ // the `resume` / `open-runs` components read its one byte-stable line (v1.3.0)
1502
+ "hooks/orc-statusline.js",
1477
1503
  // v1.0.0 W5 — the demotion's run-scoped record lives BESIDE it, in
1478
1504
  // {run_dir}/{slug}/, and is deleted with the run. A move of one is a move
1479
1505
  // of the other.
@@ -1966,6 +1992,8 @@ const CONTRACTS = [
1966
1992
  token: "orc-crosslink.config.yaml",
1967
1993
  binFiles: ["bin/cli.js"],
1968
1994
  files: [
1995
+ // the `crosslink` component counts its peers (v1.3.0)
1996
+ "hooks/orc-statusline.js",
1969
1997
  "skills/orc-poly/SKILL.md",
1970
1998
  "skills/orc-wiki/README.md",
1971
1999
  "skills/orc-wiki/SKILL.md",
@@ -3642,6 +3670,12 @@ for (const b of BUDGETS) {
3642
3670
  // spine reads `extra_timeout_s`. An empty lanes[] here is an ANSWER.
3643
3671
  "wait_hop_minutes",
3644
3672
  "wait_max_hops",
3673
+ // v1.3.0 — an operating key of the STATUSLINE HOOK. A hook has no lane and
3674
+ // cannot resolve config, so no spine reads this; the hook reads the raw key
3675
+ // off the file, exactly as it already does for `log_dir` and
3676
+ // `extra_enabled`. An empty lanes[] here is an ANSWER.
3677
+ "statusline_custom",
3678
+ "subagent_line_custom",
3645
3679
  ]);
3646
3680
  for (const e of metaEntries) {
3647
3681
  if (!e.lanes) {
@@ -47,6 +47,7 @@ const required = [
47
47
  "bin/webui/css/panels/pact.css",
48
48
  "bin/webui/css/panels/boundary.css",
49
49
  "bin/webui/css/panels/wait.css",
50
+ "bin/webui/css/panels/hookui.css",
50
51
  "bin/webui/css/panels/handoff.css",
51
52
  "bin/webui/css/panels/challenge.css",
52
53
  "bin/webui/css/panels/docs.css",
@@ -76,6 +77,7 @@ const required = [
76
77
  "bin/webui/js/panels/pact.js",
77
78
  "bin/webui/js/panels/boundary.js",
78
79
  "bin/webui/js/panels/wait.js",
80
+ "bin/webui/js/panels/hookui.js",
79
81
  "bin/webui/js/panels/handoff.js",
80
82
  "bin/webui/js/panels/challenge.js",
81
83
  "bin/webui/js/panels/docs.js",
@@ -95,6 +97,7 @@ const required = [
95
97
  "bin/webui/fixtures/pact.js",
96
98
  "bin/webui/fixtures/boundary.js",
97
99
  "bin/webui/fixtures/wait.js",
100
+ "bin/webui/fixtures/hookui.js",
98
101
  "bin/webui/fixtures/handoff.js",
99
102
  "bin/webui/fixtures/maintenance.js",
100
103
  "bin/webui/fixtures/challenge.js",
@@ -127,6 +130,7 @@ const required = [
127
130
  "bin/webui/i18n/en/pact.json",
128
131
  "bin/webui/i18n/en/boundary.json",
129
132
  "bin/webui/i18n/en/wait.json",
133
+ "bin/webui/i18n/en/hookui.json",
130
134
  "bin/webui/i18n/en/handoff.json",
131
135
  "bin/webui/i18n/en/challenge.json",
132
136
  "bin/webui/i18n/en/docs.json",
@@ -150,6 +154,7 @@ const required = [
150
154
  "bin/webui/i18n/id/pact.json",
151
155
  "bin/webui/i18n/id/boundary.json",
152
156
  "bin/webui/i18n/id/wait.json",
157
+ "bin/webui/i18n/id/hookui.json",
153
158
  "bin/webui/i18n/id/handoff.json",
154
159
  "bin/webui/i18n/id/challenge.json",
155
160
  "bin/webui/i18n/id/docs.json",
@@ -451,6 +456,16 @@ const required = [
451
456
  "templates/hooks/README.md",
452
457
  "templates/hooks/orc-effort-guard.js",
453
458
  "templates/hooks/orc-statusline.js",
459
+ // v1.3.0 — THE RENDER ENGINE, and it is required by BOTH halves: the hook
460
+ // requires it as a sibling out of .claude/hooks/, and bin/cli.js requires it
461
+ // out of templates/hooks/ for `orc statusline preview`. That is what makes
462
+ // the panel's preview and the bar's real output byte-identical BY
463
+ // CONSTRUCTION. A missing file here breaks the status line AND the panel.
464
+ "templates/hooks/orc-statusline-render.js",
465
+ // v1.4.0 — the SECOND board, and the per-agent token record that rides with
466
+ // it. Wired even with the board off, because the measurement is handed over
467
+ // either way.
468
+ "templates/hooks/orc-subagent-line.js",
454
469
  "templates/hooks/orc-trace.js",
455
470
  ];
456
471
 
package/bin/webui/api.js CHANGED
@@ -45,6 +45,14 @@ function clearCache() {
45
45
  cache.clear();
46
46
  }
47
47
 
48
+ // v1.4.0 — the board a statusline request is about. A value this server does
49
+ // not recognise is DROPPED rather than forwarded: the CLI would refuse it, and
50
+ // a query string is user input like any other.
51
+ function slBoard(q) {
52
+ const b = q && q.board ? String(q.board) : "";
53
+ return b === "subagent" ? ["--board", "subagent"] : [];
54
+ }
55
+
48
56
  // ── running the CLI ─────────────────────────────────────────────────────────
49
57
 
50
58
  // Several commands use a NON-ZERO exit as a normal answer, not a failure:
@@ -243,6 +251,27 @@ const READS = {
243
251
  // a wait — a wait lives in a Claude Code session, and `orc ui` never runs a
244
252
  // lane. It configures the defaults, shows a wait, and cancels one.
245
253
  "/api/usage": () => ["usage", "check"],
254
+ // v1.3.0 — the CLI Hook Interface. THE PANEL DRAWS THE CATALOGUE AND DERIVES
255
+ // NONE OF IT: the groups, the renderers, their option sets and the rendered
256
+ // sample per renderer all come from `statusline components --json`, and a
257
+ // test greps the panel for component ids, renderer names, glyph-set names,
258
+ // ramp names, colour tokens and state words. It must name none of them.
259
+ //
260
+ // `preview` is the one that earns the panel its place: it renders through the
261
+ // SAME engine the hook does, so what you see is what the bar will print.
262
+ // v1.4.0 — TWO BOARDS through one set of routes. `--board` is passed
263
+ // through verbatim; the CLI owns which boards exist and which components
264
+ // each may hold, and the panel — as everywhere else — decides none of it.
265
+ "/api/statusline/components": (q) => ["statusline", "components", ...slBoard(q)],
266
+ "/api/statusline/show": (q) => ["statusline", "show", ...slBoard(q)],
267
+ "/api/statusline/presets": (q) => ["statusline", "presets", ...slBoard(q)],
268
+ "/api/statusline/preview": (q) => {
269
+ const argv = ["statusline", "preview", ...slBoard(q)];
270
+ if (q.width) argv.push("--width", String(q.width));
271
+ if (q.state) argv.push("--state", String(q.state));
272
+ return argv;
273
+ },
274
+ "/api/statusline/explain": (q) => ["statusline", "explain", String(q.at || "1:1"), ...slBoard(q)],
246
275
  "/api/wait/lanes": () => ["wait", "lanes"],
247
276
  "/api/wait/status": (q) => (q.slug ? ["wait", "status", String(q.slug)] : ["wait", "status"]),
248
277
  "/api/pact": () => ["pact", "status"],
@@ -421,6 +450,48 @@ const WRITES = {
421
450
  // already running. A BLOCK cannot be created here on purpose: it needs a
422
451
  // reason typed in the moment, and a reason typed into a settings page days
423
452
  // later is not the record that makes the risk demonstrably the user's.
453
+ // v1.3.0 — the layout's writers. Every one shells the same validator the CLI
454
+ // uses, so an illegal placement is refused BY NAME here exactly as it is
455
+ // there. The board makes the illegal drop impossible; this is the guarantee.
456
+ "/api/statusline/set": (b) => {
457
+ const argv = ["statusline", "set", String(b.line), String(b.pos)];
458
+ if (b.type) argv.push(String(b.type));
459
+ for (const [k, f] of [
460
+ ["render", "--render"], ["label", "--label"], ["color", "--color"],
461
+ ["label_color", "--label-color"], ["value_color", "--value-color"],
462
+ ["bg", "--bg"], ["ramp", "--ramp"], ["glyphs", "--glyphs"],
463
+ ["format", "--format"], ["case", "--case"], ["truncate", "--truncate"],
464
+ ["compact", "--compact"], ["prefix", "--prefix"], ["suffix", "--suffix"],
465
+ ["emphasis", "--emphasis"], ["hide_when", "--hide-when"],
466
+ ["width", "--width"], ["precision", "--precision"],
467
+ ["min_width", "--min-width"], ["min_cols", "--min-cols"],
468
+ ["max_cols", "--max-cols"], ["priority", "--priority"],
469
+ ]) {
470
+ if (b[k] !== undefined && b[k] !== null && b[k] !== "") argv.push(f, String(b[k]));
471
+ }
472
+ if (b.draw_empty) argv.push("--draw-empty");
473
+ return argv.concat(slBoard(b));
474
+ },
475
+ "/api/statusline/move": (b) => ["statusline", "move", String(b.from), String(b.to), ...slBoard(b)],
476
+ "/api/statusline/remove": (b) => ["statusline", "remove", String(b.at), ...slBoard(b)],
477
+ "/api/statusline/line": (b) => {
478
+ const argv = ["statusline", "line", String(b.line)];
479
+ if (b.separator !== undefined) argv.push("--separator", String(b.separator));
480
+ if (b.theme) argv.push("--theme", String(b.theme));
481
+ if (b.max_width !== undefined) argv.push("--max-width", String(b.max_width));
482
+ return argv.concat(slBoard(b));
483
+ },
484
+ // A preset REPLACES the layout, so the panel always confirms it and names
485
+ // the loss — the `orc diy init --force` rule.
486
+ "/api/statusline/apply": (b) => ["statusline", "apply", String(b.name), ...slBoard(b)],
487
+ // v1.3.0 W5. `group` wraps 2-4 as one object, `expand` is its inverse and is
488
+ // also how a composite becomes editable, `clone` is for two `config` chips on
489
+ // different keys — a normal thing to want.
490
+ "/api/statusline/group": (b) => ["statusline", "group", ...(b.refs || []).map(String), ...slBoard(b)],
491
+ "/api/statusline/expand": (b) => ["statusline", "expand", String(b.at), ...slBoard(b)],
492
+ "/api/statusline/clone": (b) => ["statusline", "clone", String(b.at), ...slBoard(b)],
493
+ "/api/statusline/reset": (b) => ["statusline", "reset", ...slBoard(b)],
494
+ "/api/statusline/compile": (b) => ["statusline", "compile", ...slBoard(b)],
424
495
  "/api/wait/unblock": (b) => (b.slug ? ["wait", "unblock", String(b.slug)] : ["wait", "unblock"]),
425
496
  "/api/wait/cancel": (b) => (b.slug ? ["wait", "cancel", String(b.slug)] : ["wait", "cancel"]),
426
497
  "/api/wiki/sync": () => ["wiki", "sync"],