@andorra-labs/code 0.1.9 → 0.1.11

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 (212) hide show
  1. package/README.md +28 -208
  2. package/THIRD_PARTY_NOTICES.md +15 -0
  3. package/dist/src/agent-execution.js +56 -0
  4. package/dist/src/app-server/protocol.d.ts +109 -1
  5. package/dist/src/app-server/protocol.js +8 -1
  6. package/dist/src/app-server.d.ts +59 -1
  7. package/dist/src/app-server.js +418 -63
  8. package/dist/src/auth/index.d.ts +1 -1
  9. package/dist/src/auth/index.js +1 -1
  10. package/dist/src/auth/store.d.ts +17 -1
  11. package/dist/src/auth/store.js +25 -2
  12. package/dist/src/automation-service.js +1 -1
  13. package/dist/src/browser-session.d.ts +8 -0
  14. package/dist/src/browser-session.js +27 -1
  15. package/dist/src/browser-ui/app.js +255 -33
  16. package/dist/src/browser-ui/index.html +9 -9
  17. package/dist/src/browser-ui/style.css +110 -65
  18. package/dist/src/browser-ui/tokens.css +27 -26
  19. package/dist/src/cli.js +10 -5
  20. package/dist/src/coding-tools.d.ts +24 -0
  21. package/dist/src/coding-tools.js +71 -8
  22. package/dist/src/command-screens.js +1 -1
  23. package/dist/src/commands.d.ts +1 -1
  24. package/dist/src/commands.js +2 -2
  25. package/dist/src/completion-gates.d.ts +42 -7
  26. package/dist/src/completion-gates.js +55 -9
  27. package/dist/src/completion.d.ts +9 -1
  28. package/dist/src/completion.js +20 -2
  29. package/dist/src/dashboard-view.js +2 -2
  30. package/dist/src/deadline.js +4 -0
  31. package/dist/src/decision/checks.js +1 -1
  32. package/dist/src/file-diff.d.ts +105 -0
  33. package/dist/src/file-diff.js +244 -0
  34. package/dist/src/graph-manager-chat.js +4 -4
  35. package/dist/src/graph-runner.js +39 -2
  36. package/dist/src/graph-sync.d.ts +8 -0
  37. package/dist/src/graph-sync.js +54 -3
  38. package/dist/src/graph-tool.js +1 -1
  39. package/dist/src/graph-ui/app.js +303 -129
  40. package/dist/src/graph-ui/controls.css +43 -22
  41. package/dist/src/graph-ui/controls.js +31 -1
  42. package/dist/src/graph-ui/embed.js +56 -7
  43. package/dist/src/graph-ui/icons.js +5 -0
  44. package/dist/src/graph-ui/index.html +3 -3
  45. package/dist/src/graph-ui/manager-state.js +2 -2
  46. package/dist/src/graph-ui/manager.css +19 -18
  47. package/dist/src/graph-ui/manager.js +5 -5
  48. package/dist/src/graph-ui/skill-picker.js +5 -5
  49. package/dist/src/graph-ui/studio-canvas.js +16 -16
  50. package/dist/src/graph-ui/studio.css +18 -15
  51. package/dist/src/graph-ui/studio.js +99 -42
  52. package/dist/src/graph-ui/style.css +125 -80
  53. package/dist/src/graph-ui/theme.js +2 -2
  54. package/dist/src/graph-ui/tokens.css +33 -29
  55. package/dist/src/graphs.d.ts +10 -3
  56. package/dist/src/graphs.js +15 -4
  57. package/dist/src/mcp.d.ts +75 -0
  58. package/dist/src/mcp.js +240 -8
  59. package/dist/src/membership-errors.d.ts +7 -1
  60. package/dist/src/membership-errors.js +9 -3
  61. package/dist/src/provider-keys.d.ts +5 -1
  62. package/dist/src/provider-keys.js +7 -3
  63. package/dist/src/provider-settings.d.ts +4 -1
  64. package/dist/src/provider-settings.js +46 -5
  65. package/dist/src/pull-requests.d.ts +42 -6
  66. package/dist/src/pull-requests.js +11 -3
  67. package/dist/src/qa/guidance.js +6 -19
  68. package/dist/src/qa/index.d.ts +0 -2
  69. package/dist/src/qa/index.js +0 -2
  70. package/dist/src/qa/profile/QaProfile.d.ts +5 -1
  71. package/dist/src/qa/profile/QaProfile.js +6 -2
  72. package/dist/src/qa/tools.d.ts +19 -1
  73. package/dist/src/qa/tools.js +20 -145
  74. package/dist/src/react-runtime.js +134 -16
  75. package/dist/src/read-document-doc.d.ts +20 -0
  76. package/dist/src/read-document-doc.js +524 -0
  77. package/dist/src/read-document-docx.d.ts +21 -0
  78. package/dist/src/read-document-docx.js +584 -0
  79. package/dist/src/read-document-text.d.ts +29 -0
  80. package/dist/src/read-document-text.js +67 -0
  81. package/dist/src/read-document-tool.d.ts +48 -0
  82. package/dist/src/read-document-tool.js +162 -0
  83. package/dist/src/read-document.d.ts +78 -0
  84. package/dist/src/read-document.js +353 -0
  85. package/dist/src/read-image.d.ts +29 -2
  86. package/dist/src/read-image.js +42 -17
  87. package/dist/src/remote/engine-pool.js +18 -6
  88. package/dist/src/runtime.d.ts +19 -0
  89. package/dist/src/runtime.js +10 -1
  90. package/dist/src/screen-selection.d.ts +38 -0
  91. package/dist/src/screen-selection.js +103 -0
  92. package/dist/src/session-changes.d.ts +122 -0
  93. package/dist/src/session-changes.js +804 -0
  94. package/dist/src/side-panel.d.ts +6 -1
  95. package/dist/src/side-panel.js +12 -10
  96. package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
  97. package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
  98. package/dist/src/skills/bundled/graph-manager/SKILL.md +37 -3
  99. package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
  100. package/dist/src/skills/bundled/provenance.json +4 -4
  101. package/dist/src/skills/runtime-skills.js +3 -3
  102. package/dist/src/stall-recovery.d.ts +15 -0
  103. package/dist/src/stall-recovery.js +17 -0
  104. package/dist/src/telemetry/schema.d.ts +1 -1
  105. package/dist/src/telemetry/schema.js +1 -2
  106. package/dist/src/terminal-ui.d.ts +64 -20
  107. package/dist/src/terminal-ui.js +312 -82
  108. package/dist/src/time-limit.d.ts +53 -0
  109. package/dist/src/time-limit.js +79 -0
  110. package/dist/src/tool-diff-stats.d.ts +9 -0
  111. package/dist/src/tool-diff-stats.js +20 -0
  112. package/dist/src/tool-names.d.ts +1 -1
  113. package/dist/src/tool-result-filter.js +1 -1
  114. package/dist/src/tools.js +118 -9
  115. package/dist/src/transcript.d.ts +11 -0
  116. package/dist/src/transcript.js +15 -3
  117. package/dist/src/types.d.ts +12 -0
  118. package/dist/src/usage-analytics.d.ts +3 -1
  119. package/dist/src/usage-analytics.js +16 -2
  120. package/package.json +6 -26
  121. package/dist/src/qa/api/http-runner.d.ts +0 -3
  122. package/dist/src/qa/api/http-runner.js +0 -47
  123. package/dist/src/qa/git/ChangeDetector.d.ts +0 -26
  124. package/dist/src/qa/git/ChangeDetector.js +0 -177
  125. package/dist/src/qa/git/DiffReviewer.d.ts +0 -28
  126. package/dist/src/qa/git/DiffReviewer.js +0 -115
  127. package/dist/src/qa/orchestrator/ChangeClassifier.d.ts +0 -14
  128. package/dist/src/qa/orchestrator/ChangeClassifier.js +0 -28
  129. package/dist/src/qa/orchestrator/MergeGate.d.ts +0 -14
  130. package/dist/src/qa/orchestrator/MergeGate.js +0 -40
  131. package/dist/src/qa/orchestrator/QaOrchestrator.d.ts +0 -79
  132. package/dist/src/qa/orchestrator/QaOrchestrator.js +0 -373
  133. package/dist/src/qa/runners/CommandRunner.d.ts +0 -22
  134. package/dist/src/qa/runners/CommandRunner.js +0 -96
  135. package/dist/src/qa/runners/TestRunner.d.ts +0 -21
  136. package/dist/src/qa/runners/TestRunner.js +0 -66
  137. package/dist/src/qa/runtime/RuntimeSmoke.d.ts +0 -11
  138. package/dist/src/qa/runtime/RuntimeSmoke.js +0 -78
  139. package/dist/src/qa/runtime-detect.d.ts +0 -10
  140. package/dist/src/qa/runtime-detect.js +0 -72
  141. package/dist/src/qa/security/DependencyScanner.d.ts +0 -19
  142. package/dist/src/qa/security/DependencyScanner.js +0 -167
  143. package/dist/src/qa/security/SecretScanner.d.ts +0 -3
  144. package/dist/src/qa/security/SecretScanner.js +0 -55
  145. package/docs/README.md +0 -36
  146. package/docs/agents/README.md +0 -62
  147. package/docs/agents/install-for-agents.md +0 -56
  148. package/docs/agents/mcp-server.md +0 -212
  149. package/docs/agents/subagent-mode.md +0 -149
  150. package/docs/concepts/README.md +0 -47
  151. package/docs/concepts/jev-actionable-routing.md +0 -113
  152. package/docs/concepts/jev-decision-thresholds.md +0 -412
  153. package/docs/concepts/jev-efficiency.md +0 -217
  154. package/docs/concepts/jev-eval-2026-11-01.md +0 -78
  155. package/docs/concepts/limits.md +0 -52
  156. package/docs/concepts/memory.md +0 -10
  157. package/docs/concepts/security.md +0 -50
  158. package/docs/concepts/workspace-instructions.md +0 -29
  159. package/docs/getting-started/README.md +0 -82
  160. package/docs/getting-started/accounts.md +0 -78
  161. package/docs/getting-started/configure-providers.md +0 -132
  162. package/docs/guides/README.md +0 -13
  163. package/docs/guides/browser.md +0 -39
  164. package/docs/guides/desktop-app.md +0 -414
  165. package/docs/guides/extensions.md +0 -102
  166. package/docs/guides/graph-builder.md +0 -116
  167. package/docs/guides/headless.md +0 -46
  168. package/docs/guides/tui.md +0 -75
  169. package/docs/guides/update.md +0 -70
  170. package/docs/guides/web-search.md +0 -51
  171. package/docs/guides/windows-code-signing.md +0 -319
  172. package/docs/llms.txt +0 -45
  173. package/docs/reference/README.md +0 -7
  174. package/docs/reference/cli.md +0 -76
  175. package/docs/reference/config.md +0 -91
  176. package/docs/reference/slash-commands.md +0 -59
  177. package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
  178. package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
  179. package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
  180. package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
  181. package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
  182. package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
  183. package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
  184. package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
  185. package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
  186. package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
  187. package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
  188. package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
  189. package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
  190. package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
  191. package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
  192. package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
  193. package/scripts/jev-efficiency-eval.mjs +0 -187
  194. package/scripts/jev-efficiency-live.mjs +0 -193
  195. package/scripts/zcode-engine-replay.mjs +0 -223
  196. package/tests/agent-centric-mcp-test-plan.md +0 -208
  197. package/tests/analytics-settings-test-plan.md +0 -165
  198. package/tests/browser-cli-smoke.mjs +0 -276
  199. package/tests/browser-test-plan.md +0 -280
  200. package/tests/chat-side-panel-test-plan.md +0 -309
  201. package/tests/decision-engine-test-plan.md +0 -163
  202. package/tests/default-active-jev-test-plan.md +0 -85
  203. package/tests/harness-extensions-test-plan.md +0 -113
  204. package/tests/jev-all-decisions-test-plan.md +0 -156
  205. package/tests/jev-efficiency/criteria.json +0 -158
  206. package/tests/jev-efficiency/workloads.mjs +0 -242
  207. package/tests/jev-efficiency-test-plan.md +0 -198
  208. package/tests/permissions-sandbox-probe.mjs +0 -74
  209. package/tests/permissions-test-plan.md +0 -191
  210. package/tests/product-telemetry-test-plan.md +0 -536
  211. package/tests/thinking-stream-preview-test-plan.md +0 -136
  212. package/tests/zcode-react-engine-test-plan.md +0 -396
@@ -39,7 +39,7 @@
39
39
  Object.assign(box.style, { left: x + 'px', top: y + 'px', width: w + 'px', height: h + 'px' });
40
40
  const title = make('button', group.name, 'studio-group-title');
41
41
  title.type = 'button';
42
- title.title = 'Select the nodes in this layout group';
42
+ title.title = 'Select the steps in this layout group';
43
43
  title.onclick = event => {
44
44
  event.stopPropagation();
45
45
  clearSelection(); state.selectedIds = nodes.map(node => node.id); state.selected = state.selectedIds.at(-1);
@@ -47,7 +47,7 @@
47
47
  };
48
48
  const remove = make('button', '×', 'studio-group-remove');
49
49
  remove.type = 'button';
50
- remove.title = 'Remove group, keeping its nodes';
50
+ remove.title = 'Remove group, keeping its steps';
51
51
  remove.onclick = event => {
52
52
  event.stopPropagation();
53
53
  mutate(() => { state.graph.metadata.studioLayoutGroupsV1 = state.graph.metadata.studioLayoutGroupsV1.filter(item => item.id !== group.id); }, true);
@@ -116,7 +116,7 @@
116
116
  path.setAttribute('fill', 'none');
117
117
  // The accent is a token, and an SVG attribute cannot name one: its value is read from the
118
118
  // page instead. A harness that loads this file on its own falls back to the register's value.
119
- path.setAttribute('stroke', typeof themeColor === 'function' ? themeColor('--accent', '#dedee3') : '#dedee3');
119
+ path.setAttribute('stroke', typeof themeColor === 'function' ? themeColor('--accent', '#ececec') : '#ececec');
120
120
  path.setAttribute('stroke-width', '2.5');
121
121
  path.setAttribute('stroke-dasharray', '6 4');
122
122
  layer.append(path); canvas.append(layer);
@@ -175,11 +175,11 @@
175
175
  const targetNode = document.elementFromPoint(e.clientX, e.clientY)?.closest('.node');
176
176
  const targetId = targetNode?.getAttribute('data-node-id');
177
177
  if (!targetId || targetId === sourceId || state.graph?.nodes[targetId]?.agentRole === 'orchestrator') {
178
- status('Drop a connection on a different destination node (not the Orchestrator).', true); return;
178
+ status('Drop a connection on a different destination step (not the Orchestrator).', true); return;
179
179
  }
180
180
  if (!state.graph?.nodes[sourceId] || !outcomes(state.graph.nodes[sourceId]).includes(outcome)) return;
181
181
  if (state.graph.edges.some(edge => edge.source === sourceId && edge.target === targetId && (edge.outcome || 'completed') === outcome)) {
182
- status('This connection already exists. Click its line to configure the handoff.'); return;
182
+ status('This connection already exists. Click its line to edit it.'); return;
183
183
  }
184
184
  mutate(() => {
185
185
  const edge = { id: 'edge-' + crypto.randomUUID().slice(0, 8), source: sourceId, target: targetId, outcome };
@@ -187,7 +187,7 @@
187
187
  clearSelection(); state.selectedEdge = edge;
188
188
  }, true);
189
189
  showInspector();
190
- status('Connection added. Configure its input handoff and save the graph.');
190
+ status('Connection added. Set its inputs and save the graph.');
191
191
  };
192
192
  const cancel = e => {
193
193
  if (!active || !matchesPointer(e)) return;
@@ -246,7 +246,7 @@
246
246
  clearSelection();
247
247
  state.selectedIds = picked.map(node => node.id); state.selected = state.selectedIds.at(-1) || null;
248
248
  renderCanvas(); renderInspector(); if (picked.length) showInspector();
249
- status('Selected ' + picked.length + ' nodes.');
249
+ status(studio.selectedStepsText(picked.length));
250
250
  };
251
251
  const cancel = e => {
252
252
  if (matchesPointer(e)) cleanup(); // Aborted gestures never alter the selection.
@@ -278,7 +278,7 @@
278
278
  copied = { graphId: state.graph.id, nodes: snapshots, edges: copy(state.graph.edges.filter(edge => ids.has(edge.source) && ids.has(edge.target))),
279
279
  pendingProviderIds: selected.filter(node => state.pendingProviderNodes?.has(node.id)).map(node => node.id) };
280
280
  pasteOffset = 0;
281
- status('Copied ' + selected.length + ' nodes. Ctrl/Cmd+V pastes them.');
281
+ status('Copied ' + selected.length + ' steps. Ctrl/Cmd+V pastes them.');
282
282
  return true;
283
283
  }
284
284
  function pasteNodes() {
@@ -292,14 +292,14 @@
292
292
  // the same ID), or if the source was removed in the current graph.
293
293
  if (externalSources.length && (copied.graphId !== state.graph.id ||
294
294
  externalSources.some(source => !Object.hasOwn(state.graph.nodes, source)))) {
295
- status('Copy Condition nodes with their source nodes before pasting into another graph.', true);
295
+ status('Copy Condition steps with their source steps before pasting into another graph.', true);
296
296
  return;
297
297
  }
298
298
  // The free-tier rules live in app.js; a page or harness without them has no allowance to apply.
299
299
  const freeRefusal = typeof freeNodeRefusal === 'function' ? freeNodeRefusal(copied.nodes) : undefined;
300
300
  if (freeRefusal) { status(freeRefusal, true); return; }
301
301
  if (Object.keys(state.graph.nodes).length + copied.nodes.length > nodeLimit(state.graph)) {
302
- status('Graph node limit reached. Remove nodes before pasting.', true); return;
302
+ status('Graph step limit reached. Remove steps before pasting.', true); return;
303
303
  }
304
304
  pasteOffset += 40;
305
305
  const positions = copied.nodes.map(node => node.position || { x: 120, y: 120 });
@@ -315,7 +315,7 @@
315
315
  };
316
316
  const dx = shift('x'), dy = shift('y');
317
317
  if (dx === null || dy === null) {
318
- status('The selected node positions are outside the supported canvas bounds.', true); return;
318
+ status('The selected step positions are outside the supported canvas bounds.', true); return;
319
319
  }
320
320
  mutate(() => {
321
321
  const ids = new Map();
@@ -348,7 +348,7 @@
348
348
  clearSelection();
349
349
  state.selectedIds = [...ids.values()]; state.selected = state.selectedIds.at(-1);
350
350
  }, true);
351
- showInspector(); status('Pasted ' + copied.nodes.length + ' nodes and their internal connections.');
351
+ showInspector(); status('Pasted ' + copied.nodes.length + ' steps and their internal connections.');
352
352
  }
353
353
  function installKeyboard() {
354
354
  window.addEventListener('keydown', event => {
@@ -386,18 +386,18 @@
386
386
  * Keys are drawn as keycaps; a pointer gesture is said in words beside them.
387
387
  */
388
388
  const SHORTCUTS = [
389
- { keys: ['Ctrl/Cmd', 'C'], action: 'Copy nodes' }, { keys: ['Ctrl/Cmd', 'V'], action: 'Paste nodes' },
389
+ { keys: ['Ctrl/Cmd', 'C'], action: 'Copy steps' }, { keys: ['Ctrl/Cmd', 'V'], action: 'Paste steps' },
390
390
  { keys: ['Ctrl/Cmd', 'D'], action: 'Duplicate' }, { keys: ['Ctrl/Cmd', 'A'], action: 'Select all' },
391
391
  { keys: ['Ctrl/Cmd', 'G'], action: 'Group' }, { keys: ['Ctrl/Cmd', 'Z'], action: 'Undo' }, { keys: ['Ctrl/Cmd', 'Y'], action: 'Redo' },
392
392
  { keys: ['Shift'], gesture: 'drag the background', action: 'Marquee select' },
393
- { keys: [], gesture: 'Drag an output port to a node', action: 'Connect' },
393
+ { keys: [], gesture: 'Drag an output port to a step', action: 'Connect' },
394
394
  { keys: ['Delete'], action: 'Remove selection' },
395
395
  ];
396
396
  const shortcutText = item => [item.keys.join('+'), item.gesture].filter(Boolean).join(item.keys.length ? ' + ' : '');
397
397
  function showShortcuts() {
398
398
  const controls = globalThis.AndorraControls;
399
399
  if (typeof controls?.alert !== 'function') {
400
- alert('Graph Studio shortcuts:\n' + SHORTCUTS.map(item => shortcutText(item) + ': ' + item.action).join('\n'));
400
+ alert('Graph Editor shortcuts:\n' + SHORTCUTS.map(item => shortcutText(item) + ': ' + item.action).join('\n'));
401
401
  return;
402
402
  }
403
403
  const list = document.createElement('dl');
@@ -415,7 +415,7 @@
415
415
  description.textContent = item.action;
416
416
  list.append(term, description);
417
417
  }
418
- void controls.alert({ title: 'Graph Studio shortcuts', content: list });
418
+ void controls.alert({ title: 'Graph Editor shortcuts', content: list });
419
419
  }
420
420
 
421
421
  function installToolbar() {
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  /* Test and Runs: the two secondary actions that stay in the toolbar. */
8
- .studio-secondary[aria-pressed="true"] { background: var(--selected, var(--accent-soft)); }
8
+ .studio-secondary[aria-pressed="true"] { background: var(--selected); }
9
9
 
10
10
  .studio-dialog {
11
11
  width: min(620px, calc(100vw - 40px)); max-height: min(84dvh, 860px);
@@ -16,25 +16,24 @@
16
16
  .studio-dialog::backdrop { background: var(--overlay); }
17
17
  .studio-dialog-head {
18
18
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
19
- padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); font-size: var(--type-section); font-weight: var(--weight-strong);
19
+ padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); font-size: var(--type-section); line-height: var(--leading-md); font-weight: var(--weight-strong);
20
20
  }
21
21
  .studio-dialog-body { padding: var(--space-5); max-height: calc(min(84dvh, 860px) - 65px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
22
- .studio-dialog-body > .help { margin: 0 0 8px; line-height: 1.5; }
23
- .studio-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
22
+ .studio-dialog-body > .help { margin: 0 0 8px; line-height: var(--leading-xs); }
24
23
 
25
24
  .studio-code {
26
25
  margin: 8px 0 0; width: 100%; padding: 12px; border: 1px solid var(--border);
27
26
  background: var(--bg-card); border-radius: var(--radius-md); color: var(--text);
28
- font-size: var(--type-xs); line-height: 1.5; font-family: var(--font-mono); white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; max-height: 380px;
27
+ font-size: var(--type-xs); line-height: var(--leading-code); font-family: var(--font-mono); white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; max-height: 380px;
29
28
  }
30
29
 
31
30
  .studio-template { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
32
31
  .studio-template > button { min-width: 132px; text-align: left; }
33
- .studio-template p { margin: 0; color: var(--text-2); line-height: 1.45; }
32
+ .studio-template p { margin: 0; color: var(--text-2); line-height: var(--leading-sm); }
34
33
  .studio-history-row { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); }
35
34
  .studio-history-row > strong { display: block; margin-bottom: 4px; }
36
35
  .studio-history-row .help { margin: 4px 0 10px; }
37
- .studio-history-row > button { margin-right: 8px; }
36
+ .studio-history-row > button { margin-right: var(--space-2); }
38
37
  .studio-test-row { display: grid; gap: 5px; margin: 4px 0; }
39
38
  .studio-test-row > span { font-weight: var(--weight-strong); font-size: var(--type-xs); }
40
39
 
@@ -49,11 +48,14 @@
49
48
  .studio-run-head button { padding: 0 var(--space-2); font-size: var(--type-xs); }
50
49
  .studio-run-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
51
50
  .studio-run-log { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: stretch; padding: 5px 14px 12px; }
51
+ /* A log row is a button (it selects the step), so it undoes the button's centring: a log reads from
52
+ its left edge. */
52
53
  .studio-run-event {
54
+ justify-content: flex-start;
53
55
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; text-align: left; padding: 6px 8px;
54
- font-family: var(--font-mono); font-size: var(--type-xs); font-weight: var(--weight-regular); line-height: 1.4; white-space: normal; background: transparent; color: var(--text-2);
56
+ font-family: var(--font-mono); font-size: var(--type-xs); font-weight: var(--weight-regular); line-height: var(--leading-code); white-space: normal; background: transparent; color: var(--text-2);
55
57
  }
56
- .studio-run-event:hover:not(:disabled) { background: var(--hover, var(--bg-card)); }
58
+ .studio-run-event:hover:not(:disabled) { background: var(--hover); }
57
59
 
58
60
  #canvas .studio-group-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 0; }
59
61
  #canvas .studio-group {
@@ -68,13 +70,13 @@
68
70
  position: absolute; top: 5px; right: 8px; border: 0; background: var(--bg-input);
69
71
  color: var(--text-2); padding: 1px var(--space-2); min-height: 0; border-radius: var(--radius-xs); pointer-events: auto;
70
72
  }
71
- #canvas .studio-wire-preview { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 7; }
72
- #canvas .studio-marquee { position: absolute; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-xs); pointer-events: none; z-index: 7; }
73
+ #canvas .studio-wire-preview { position: absolute; top: 0; left: 0; pointer-events: none; z-index: var(--z-raised); }
74
+ #canvas .studio-marquee { position: absolute; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-xs); pointer-events: none; z-index: var(--z-raised); }
73
75
 
74
76
  #studio-minimap {
75
77
  position: absolute; bottom: var(--space-4); right: var(--space-4); width: 160px; height: 100px;
76
78
  border: 1px solid var(--border); background: var(--bg-input); border-radius: var(--card-radius);
77
- box-shadow: var(--shadow-menu); z-index: 4; cursor: crosshair; overflow: hidden;
79
+ box-shadow: var(--shadow-menu); z-index: var(--z-raised); cursor: crosshair; overflow: hidden;
78
80
  }
79
81
  /* The map is a sketch of the canvas: nodes are quiet blocks in the card's own outline colour, so
80
82
  the viewport's frame is the brightest thing on it. Like the cards, an end carries no hue. */
@@ -84,11 +86,12 @@
84
86
  the rectangle unfilled rather than drawing it as a solid block. */
85
87
  #studio-minimap .studio-minimap-viewport { fill: transparent; fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--border-strong); stroke-width: 1; rx: 3px; vector-effect: non-scaling-stroke; pointer-events: none; }
86
88
 
87
- /* Node run states: a steady 2px ring, with no glow and nothing that loops. The live state is the
88
- ink accent; the settled states are the two colours the chrome allows, done and error. */
89
+ /* Node run states: a steady ring, with no glow and nothing that loops. The live state is the ink
90
+ accent; a finished step is settled and ordinary, so it takes a quiet 1px ring of the muted ink
91
+ rather than a colour (no green in the chrome, ADR 0022); a failure is the one red. */
89
92
  .node.studio-node-preview { box-shadow: var(--lift-2), 0 0 0 2px var(--warn); }
90
93
  .node.studio-node-running { box-shadow: var(--lift-2), 0 0 0 2px var(--accent); }
91
- .node.studio-node-complete { box-shadow: var(--lift-2), 0 0 0 2px var(--ok); }
94
+ .node.studio-node-complete { box-shadow: var(--lift-2), 0 0 0 1px var(--text-3); }
92
95
  .node.studio-node-failed { box-shadow: var(--lift-2), 0 0 0 2px var(--err); }
93
96
  .node.studio-node-cancelled { box-shadow: var(--lift-2), 0 0 0 2px var(--text-3); }
94
97
 
@@ -87,6 +87,61 @@
87
87
  }
88
88
  let inspectorContextId = '';
89
89
 
90
+ // The run log in words (D13): the journal's event types, a run's status, a duration and a count
91
+ // as a person reads them, never the engine's identifiers ("graph.node.completed", "failed",
92
+ // "90000ms"). An event this table does not know yet is named from its last words, without the
93
+ // engine's prefixes.
94
+ const EVENT_WORDS = {
95
+ 'graph.started': 'Run started', 'graph.completed': 'Run finished', 'graph.stopped': 'Run stopped',
96
+ 'graph.paused': 'Run paused', 'graph.resumed': 'Run resumed', 'graph.finalization.resumed': 'Finishing resumed',
97
+ 'graph.node.started': 'Step started', 'graph.node.completed': 'Step finished', 'graph.edge.activated': 'Route taken',
98
+ 'graph.approval': 'Approval requested', 'approval.requested': 'Approval requested',
99
+ 'approval.approved': 'Approved', 'approval.denied': 'Denied',
100
+ 'graph.todos.updated': 'To-dos updated', 'graph.widgets.updated': 'Widgets updated',
101
+ 'graph.skill.activated': 'Skill used', 'graph.skill.missing': 'Skill missing',
102
+ 'node.tool.started': 'Tool started', 'node.tool.completed': 'Tool finished', 'node.tool.failed': 'Tool failed',
103
+ 'node.model.response': 'Model response', 'agent.model.completed': 'Model response',
104
+ };
105
+ function eventWords(type) {
106
+ if (Object.hasOwn(EVENT_WORDS, type)) return EVENT_WORDS[type];
107
+ const words = String(type || '').split('.').filter(part => !['graph', 'node', 'agent'].includes(part))
108
+ .join(' ').replace(/[_-]+/g, ' ').trim();
109
+ return words ? words.charAt(0).toUpperCase() + words.slice(1) : 'Event';
110
+ }
111
+ /** How a run ended or stands, the desktop's words (RunsView runStatusLabel): one word per state, so a
112
+ * stop the person asked for is Stopped, a run that ended on a question needs your input, and every
113
+ * failure is Failed (P-ATN-07). `test/graph-studio-review-regressions.test.ts` holds the two lists to
114
+ * each other. */
115
+ function runStatusWords(status) {
116
+ return {
117
+ succeeded: 'Succeeded', running: 'Running', interrupted: 'Interrupted', cancelled: 'Stopped',
118
+ needs_clarification: 'Needs your input', infrastructure_error: 'Failed',
119
+ unknown: 'Unknown',
120
+ }[status] || 'Failed';
121
+ }
122
+ /** A duration the way the desktop's metrics read it: tenths under a minute, then "1m 30s". */
123
+ function durationWords(ms) {
124
+ if (!Number.isFinite(ms) || ms < 0) return '';
125
+ const tenths = Math.round(ms / 100) / 10;
126
+ if (tenths < 60) return tenths + 's';
127
+ const total = Math.round(ms / 1000), hours = Math.floor(total / 3600), minutes = Math.floor((total % 3600) / 60), seconds = total % 60;
128
+ return hours ? hours + 'h ' + minutes + 'm ' + seconds + 's' : minutes + 'm ' + seconds + 's';
129
+ }
130
+ const countWords = value => (Number.isFinite(value) ? value : 0).toLocaleString('en-US');
131
+ /** What a marquee selected, with the noun agreeing: "Selected 1 step." / "Selected 7 steps." */
132
+ const selectedStepsText = count => 'Selected ' + count + (count === 1 ? ' step.' : ' steps.');
133
+ /** One line of the run log: when, which step, what happened, how long, what it used. */
134
+ function runEventLine(event, name) {
135
+ const parts = [];
136
+ if (event.time) parts.push(new Date(event.time).toLocaleTimeString());
137
+ parts.push(name, eventWords(event.type) + (event.outcome ? ' (' + event.outcome + ')' : ''));
138
+ // How a stopped run ended, unless the event's own words already say it ("Run stopped" for a stop).
139
+ if (event.type === 'graph.stopped' && event.status && !['succeeded', 'cancelled'].includes(event.status)) parts.push(runStatusWords(event.status));
140
+ if (event.durationMs !== null && event.durationMs !== undefined) { const took = durationWords(event.durationMs); if (took) parts.push(took); }
141
+ if (event.usage) parts.push(countWords(event.usage.inputTokens) + ' in / ' + countWords(event.usage.outputTokens) + ' out');
142
+ return parts.join(' · ');
143
+ }
144
+
90
145
  function diffGraph(before, after) {
91
146
  const a = before.nodes || {}, b = after.nodes || {};
92
147
  const add = Object.keys(b).filter(id => !Object.hasOwn(a, id));
@@ -106,9 +161,9 @@
106
161
  }
107
162
  function describeDiff(before, after) {
108
163
  const delta = diffGraph(before, after);
109
- return 'Added nodes: ' + (delta.added.join(', ') || 'none') +
110
- '\nRemoved nodes: ' + (delta.removed.join(', ') || 'none') +
111
- '\nChanged nodes: ' + (delta.changed.join(', ') || 'none') +
164
+ return 'Added steps: ' + (delta.added.join(', ') || 'none') +
165
+ '\nRemoved steps: ' + (delta.removed.join(', ') || 'none') +
166
+ '\nChanged steps: ' + (delta.changed.join(', ') || 'none') +
112
167
  '\nConnections added: ' + delta.edgesAdded +
113
168
  '\nConnections removed: ' + delta.edgesRemoved +
114
169
  '\nGraph settings changed: ' + (JSON.stringify({
@@ -123,6 +178,8 @@
123
178
  if (state.dirty && !await askConfirm({ title: 'Replace your unsaved edits?', message: 'Recoverable drafts are saved separately.', confirmLabel: 'Replace', tone: 'danger' })) return false;
124
179
  clearSelection();
125
180
  state.graph = dropLegacyTokenFields(copy(next));
181
+ // A replacement has no saved form on the canvas to return to, so it stays unsaved until saved.
182
+ state.savedKey = null;
126
183
  state.dirty = true;
127
184
  state.undo = [];
128
185
  state.redo = [];
@@ -133,7 +190,7 @@
133
190
  state.pendingProviderNodes = null;
134
191
  install?.();
135
192
  render(); fit();
136
- status(message || 'Draft loaded. Save a revision to publish it.');
193
+ status(message || 'Draft loaded. Save it to publish it.');
137
194
  return true;
138
195
  }
139
196
 
@@ -158,8 +215,8 @@
158
215
  const pending = Object.values(validated.graph.nodes)
159
216
  .filter(node => node.type === 'agent' && !node.provider).map(node => node.id);
160
217
  if (await applyDraft(validated.graph, pending.length
161
- ? 'Imported graph. Assign a model profile to every outlined node, then save.'
162
- : 'Imported graph validated. Save its first revision.',
218
+ ? 'Imported graph. Assign a model profile to every outlined step, then save.'
219
+ : 'Imported graph validated. Save it to keep it.',
163
220
  // The install runs after applyDraft's marker-stripping copy, so the requirements are
164
221
  // mirrored onto the live draft here — that mirror is what an autosave persists and a
165
222
  // later draft recovery restores.
@@ -192,7 +249,7 @@
192
249
  const feedback = element('p', '', 'help');
193
250
  feedback.setAttribute('role', 'status');
194
251
  body.append(picker.element, feedback);
195
- body.append(action('Import as new graph', async () => {
252
+ body.append(action('Import as New Graph', async () => {
196
253
  const chosen = picker.file();
197
254
  if (!chosen) throw new Error('Choose a JSON file first.');
198
255
  if (await importGraphFile(chosen)) {
@@ -248,19 +305,21 @@
248
305
  } else base.name = 'QA Gate';
249
306
  }
250
307
  const validated = await api('/api/validate', { graph: base });
251
- await applyDraft(validated.graph, 'Template created. Review permissions and save a revision.');
308
+ await applyDraft(validated.graph, 'Template created. Review permissions and save.');
252
309
  }
253
310
 
254
311
  function openTemplates() {
255
- modal('Start from a workflow template', body => {
312
+ modal('Start from a graph template', body => {
256
313
  paragraph(body, 'Templates are editable local drafts. They never run or save automatically.');
257
314
  for (const [id, name, desc] of [
258
315
  ['fast', 'Fast Fix', 'Direct coding-agent flow without an intake Orchestrator'],
259
316
  ['review', 'Review and Repair', 'Implement, review, then retry defects for as long as the run clock allows'],
260
317
  ['qa', 'QA Gate', 'Research, implement, and pass through an independent read-only QA Agent'],
261
318
  ]) {
319
+ // Every row is one choice among equals, so none takes the blue fill: that marks a screen's
320
+ // one action (A1), and three of them stacked named none.
262
321
  const row = element('div', undefined, 'studio-template');
263
- row.append(action(name, () => newTemplate(id), 'primary'));
322
+ row.append(action(name, () => newTemplate(id), 'btn-small'));
264
323
  paragraph(row, desc);
265
324
  body.append(row);
266
325
  }
@@ -276,39 +335,40 @@
276
335
  const rows = await api('/api/graphs/' + encodeURIComponent(graphId) + '/revisions');
277
336
  // A different graph may have been opened before the revision list loaded.
278
337
  if (state.graph !== graphAtOpen || graphFingerprint() !== fingerprint) return;
279
- modal('Saved revision history', (body, dialog) => {
338
+ modal('Version history', (body, dialog) => {
280
339
  const controller = new AbortController();
281
340
  dialog.addEventListener('close', () => controller.abort(), { once: true });
282
341
  const current = () => !controller.signal.aborted && dialog.open &&
283
342
  state.graph === graphAtOpen && graphFingerprint() === fingerprint;
284
- paragraph(body, 'Snapshots are immutable. Restoring a past revision opens a draft; saving creates a new revision.');
285
- if (!rows.length) { paragraph(body, 'No saved revisions. Save this graph first.'); return; }
343
+ paragraph(body, 'Snapshots are immutable. Restoring a past version opens a draft; saving creates a new version.');
344
+ if (!rows.length) { paragraph(body, 'No saved versions. Save this graph first.'); return; }
286
345
  for (const row of rows) {
287
346
  const item = element('section', undefined, 'studio-history-row');
288
- item.append(element('strong', 'Revision ' + row.revision + ' · ' + row.name));
289
- paragraph(item, row.nodeCount + ' nodes · ' + row.edgeCount + ' connections' +
347
+ item.append(element('strong', 'Version ' + row.revision + ' · ' + row.name));
348
+ paragraph(item, row.nodeCount + ' steps · ' + row.edgeCount + ' connections' +
290
349
  (row.updatedAt ? ' · ' + new Date(row.updatedAt).toLocaleString() : ''));
291
350
  const detail = element('pre', '', 'studio-code');
292
351
  const fetchRevision = async () => {
293
352
  try { return await api('/api/graphs/' + encodeURIComponent(graphId) + '/revisions/' + row.revision, undefined, { signal: controller.signal }); }
294
353
  catch (error) { if (controller.signal.aborted || !current()) return null; throw error; }
295
354
  };
355
+ // Each version offers the same two actions, so neither is the screen's primary (A1).
296
356
  item.append(action('Compare', async () => {
297
357
  if (!current()) return;
298
358
  const snapshot = await fetchRevision();
299
359
  if (!snapshot || !current()) return;
300
360
  detail.textContent = describeDiff(snapshot, graphAtOpen);
301
- }));
302
- item.append(action('Restore as draft', async () => {
361
+ }, 'btn-small'));
362
+ item.append(action('Restore as Draft', async () => {
303
363
  if (!current()) return;
304
364
  const snapshot = await fetchRevision();
305
365
  if (!snapshot || !current()) return;
306
366
  const next = { ...snapshot, id: graphId === 'default' ? newId() : graphId,
307
367
  revision: graphId === 'default' ? 0 : baseRevision };
308
- if (await applyDraft(next, 'Restored revision ' + row.revision + ' into a draft. Save to publish it.')) {
368
+ if (await applyDraft(next, 'Restored version ' + row.revision + ' into a draft. Save to publish it.')) {
309
369
  shut(dialog);
310
370
  }
311
- }, 'primary'));
371
+ }, 'btn-small'));
312
372
  item.append(detail);
313
373
  body.append(item);
314
374
  }
@@ -342,7 +402,7 @@
342
402
  body.append(row);
343
403
  }
344
404
  const results = element('pre', '', 'studio-code');
345
- body.append(action('Preview routing', async () => {
405
+ body.append(action('Preview Routing', async () => {
346
406
  const choices = {};
347
407
  for (const [id, select] of inputs) choices[id] = select.value ? { outcome: select.value } : {};
348
408
  for (const [id, input] of mockOutputs) {
@@ -369,7 +429,7 @@
369
429
  renderCanvas();
370
430
  }, 'primary'));
371
431
  body.append(results);
372
- body.append(action('How to run live', () => {
432
+ body.append(action('How to Run Live', () => {
373
433
  paragraph(body, 'Open Andorra Code in your project, select the saved graph using /graph, then enter your task. The CLI retains its normal permission and approval gates. Save the draft first.');
374
434
  }));
375
435
  }, true);
@@ -399,16 +459,16 @@
399
459
  if (node?.type === 'agent') {
400
460
  const region = section(parent, 'Context preview');
401
461
  paragraph(region, 'Inspect configured instructions, context sharing, permissions, and approximate prompt size. Runtime messages may differ.');
402
- region.append(action('Preview effective settings', () => {
462
+ region.append(action('Preview Effective Settings', () => {
403
463
  const pre = element('pre', contextPreview(node), 'studio-code');
404
464
  region.replaceChildren(pre);
405
- region.prepend(action('Refresh preview', () => { pre.textContent = contextPreview(node); }));
465
+ region.prepend(action('Refresh Preview', () => { pre.textContent = contextPreview(node); }));
406
466
  }));
407
467
  }
408
468
  if (node && liveEvents.length && runMatchesCanvas()) {
409
469
  const events = liveEvents.filter(event => event.nodeId === node.id);
410
470
  if (events.length) {
411
- const region = section(parent, 'Selected run — node activity');
471
+ const region = section(parent, 'Selected run — step activity');
412
472
  const totals = nodeActivityTotals(events);
413
473
  const completion = events.filter(event => event.type === 'graph.node.completed').at(-1);
414
474
  paragraph(region, 'Latest outcome: ' + (completion?.outcome || 'pending') +
@@ -432,7 +492,7 @@
432
492
  for (const key of targets) { const opt = element('option', key); opt.value = key; dest.append(opt); }
433
493
  for (const key of sources) { const opt = element('option', key); opt.value = key; source.append(opt); }
434
494
  region.append(element('span', 'Destination field'), dest, element('span', 'Source output field'), source);
435
- region.append(action('Create mapping', () => {
495
+ region.append(action('Create Mapping', () => {
436
496
  mutate(() => { edge.inputMapping ||= {}; edge.inputMapping[dest.value] = '$source.output.' + source.value; }, true);
437
497
  renderInspector();
438
498
  }, 'primary'));
@@ -440,7 +500,7 @@
440
500
  }
441
501
  if (selectedNodes().length > 1) {
442
502
  const region = section(parent, 'Layout group');
443
- region.append(action('Group selected nodes (Ctrl/Cmd+G)', createGroup));
503
+ region.append(action('Group Selected Steps (Ctrl/Cmd+G)', createGroup));
444
504
  }
445
505
  }
446
506
 
@@ -452,13 +512,13 @@
452
512
 
453
513
  async function createGroup() {
454
514
  const nodes = selectedNodes().filter(node => node.agentRole !== 'orchestrator');
455
- if (nodes.length < 2) { status('Select at least two nodes to group.', true); return; }
515
+ if (nodes.length < 2) { status('Select at least two steps to group.', true); return; }
456
516
  const ids = new Set(nodes.map(node => node.id));
457
517
  if (!canCreateLayoutGroup(state.graph?.metadata?.studioLayoutGroupsV1 || [], ids)) {
458
518
  status('A graph supports at most 50 layout groups. Remove or merge a group before creating another.', true);
459
519
  return;
460
520
  }
461
- const name = await askText({ title: 'Name this layout group', label: 'Layout group name', value: 'New group', confirmLabel: 'Create group', maxLength: 80 });
521
+ const name = await askText({ title: 'Name this layout group', label: 'Layout group name', value: 'New group', confirmLabel: 'Create Group', maxLength: 80 });
462
522
  if (!name) return;
463
523
  if (!name.trim() || name.length > 80) { status('Group names must contain 1–80 characters.', true); return; }
464
524
  mutate(() => {
@@ -479,21 +539,17 @@
479
539
  const log = $studio('studio-run-log');
480
540
  if (!debuggerOpen || !log) return;
481
541
  log.replaceChildren();
482
- if (!selectedRun) { paragraph(log, 'Select a saved run to inspect its node transitions.'); return; }
542
+ if (!selectedRun) { paragraph(log, 'Select a saved run to inspect its step transitions.'); return; }
483
543
  const matchesCanvas = runMatchesCanvas();
484
544
  if (!matchesCanvas && liveEvents.length) {
485
- paragraph(log, 'Historical run differs from the current graph revision or unsaved draft. Canvas overlays and node navigation are disabled.');
545
+ paragraph(log, 'Historical run differs from the current graph version or unsaved draft. Canvas overlays and step navigation are disabled.');
486
546
  }
487
547
  for (const event of liveEvents.slice(-100).reverse()) {
488
548
  const item = element('button', undefined, 'studio-run-event');
489
549
  const focusId = event.nodeId || event.source;
490
550
  const name = (matchesCanvas ? state.graph?.nodes[focusId]?.name : undefined)
491
551
  || focusId || 'Graph';
492
- item.textContent = (event.time ? new Date(event.time).toLocaleTimeString() + ' · ' : '') +
493
- name + ' · ' + event.type +
494
- (event.outcome ? ' (' + event.outcome + ')' : '') +
495
- (event.durationMs !== null ? ' · ' + event.durationMs + 'ms' : '') +
496
- (event.usage ? ' · ' + event.usage.inputTokens + ' in / ' + event.usage.outputTokens + ' out' : '');
552
+ item.textContent = runEventLine(event, name);
497
553
  item.disabled = !matchesCanvas || !state.graph?.nodes[focusId];
498
554
  item.onclick = () => {
499
555
  if (runMatchesCanvas() && focusId && state.graph?.nodes[focusId]) {
@@ -518,8 +574,9 @@
518
574
  if (!select) return;
519
575
  select.replaceChildren(new Option('Choose a run…', ''));
520
576
  for (const run of runs) {
577
+ // A version is "v3" in a picker and "Version 3" in prose (D13).
521
578
  const option = new Option((run.startedAt ? new Date(run.startedAt).toLocaleString() + ' · ' : '') +
522
- run.status + (run.graphRevision !== null ? ' · r' + run.graphRevision : ''), run.id);
579
+ runStatusWords(run.status) + (Number.isInteger(run.graphRevision) ? ' · v' + run.graphRevision : ''), run.id);
523
580
  select.append(option);
524
581
  }
525
582
  if (!runs.some(run => run.id === selectedRun)) selectedRun = runs[0]?.id || '';
@@ -538,7 +595,7 @@
538
595
  event.type === 'graph.started' && Number.isInteger(event.graphRevision))?.graphRevision;
539
596
  inspectedRevision = Number.isInteger(summary?.graphRevision) ? summary.graphRevision
540
597
  : (Number.isInteger(startedRevision) ? startedRevision : null);
541
- if (note) note.textContent = 'Status: ' + response.status +
598
+ if (note) note.textContent = runStatusWords(response.status) +
542
599
  (response.truncated ? ' · Showing recent events only' : '');
543
600
  } else {
544
601
  liveEvents = [];
@@ -574,8 +631,9 @@
574
631
  let runsButton, hostMenuGroup;
575
632
 
576
633
  // The toolbar's overflow menu: the actions used now and then, behind one "More actions" button.
577
- // It follows the menu-button pattern: arrows move between items, Escape and Tab close it, and
578
- // a click outside dismisses it.
634
+ // It follows the menu-button pattern: arrows move between items, Escape and Tab close it and hand
635
+ // focus back to the button (the menu is hiding, so the browser's own Tab would drop focus to the
636
+ // page), and a click outside dismisses it.
579
637
  function installMenu() {
580
638
  const more = $studio('more'), menu = $studio('more-menu'), wrap = $studio('more-wrap');
581
639
  if (!more || !menu) return;
@@ -606,8 +664,7 @@
606
664
  list[(index + (event.key === 'ArrowDown' ? 1 : -1) + list.length) % list.length]?.focus();
607
665
  } else if (event.key === 'Home') { event.preventDefault(); list[0]?.focus(); }
608
666
  else if (event.key === 'End') { event.preventDefault(); list.at(-1)?.focus(); }
609
- else if (event.key === 'Escape') { event.preventDefault(); close(true); }
610
- else if (event.key === 'Tab') close();
667
+ else if (event.key === 'Escape' || event.key === 'Tab') { event.preventDefault(); close(true); }
611
668
  });
612
669
  // Choosing an item closes the menu before the item's own work begins.
613
670
  menu.addEventListener('click', event => { if (event.target.closest?.('[role="menuitem"]')) close(); });
@@ -736,6 +793,6 @@
736
793
  }
737
794
  }
738
795
 
739
- window.AndorraStudio = { heading, canvas, inspector: enhanceInspector, createGroup, canCreateLayoutGroup, describeDiff, nodeStatuses, nodeActivityTotals, representableSourceField, refreshRunList, toggleDebugger, runMatchesCanvas, setHostMenu, previewMatchesDraft, acceptPreviewIfCurrent, openHistory, openImport, importGraphJson, importGraphFile };
796
+ window.AndorraStudio = { selectedStepsText, eventWords, runStatusWords, durationWords, runEventLine, heading, canvas, inspector: enhanceInspector, createGroup, canCreateLayoutGroup, describeDiff, nodeStatuses, nodeActivityTotals, representableSourceField, refreshRunList, toggleDebugger, runMatchesCanvas, setHostMenu, previewMatchesDraft, acceptPreviewIfCurrent, openHistory, openImport, importGraphJson, importGraphFile };
740
797
  initialize();
741
798
  })();