@andorra-labs/code 0.1.10 → 0.1.12

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 (238) hide show
  1. package/README.md +31 -205
  2. package/THIRD_PARTY_NOTICES.md +30 -0
  3. package/dist/src/agent-execution.js +50 -2
  4. package/dist/src/agent-mcp.js +5 -0
  5. package/dist/src/app-server/protocol.d.ts +9 -1
  6. package/dist/src/app-server/protocol.js +1 -1
  7. package/dist/src/app-server.d.ts +49 -1
  8. package/dist/src/app-server.js +353 -64
  9. package/dist/src/automation-service.js +1 -1
  10. package/dist/src/browser-panel-tool.d.ts +24 -3
  11. package/dist/src/browser-panel-tool.js +80 -6
  12. package/dist/src/browser-runner.js +3 -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 +237 -15
  16. package/dist/src/browser-ui/index.html +5 -5
  17. package/dist/src/browser-ui/style.css +110 -65
  18. package/dist/src/browser-ui/tokens.css +27 -26
  19. package/dist/src/browser-view.d.ts +16 -0
  20. package/dist/src/browser-view.js +38 -2
  21. package/dist/src/claude-provider.js +15 -2
  22. package/dist/src/cli.d.ts +2 -1
  23. package/dist/src/cli.js +175 -43
  24. package/dist/src/code-intelligence/CodeIntelligenceManager.js +1 -1
  25. package/dist/src/codex-provider.js +6 -3
  26. package/dist/src/coding-tools.d.ts +26 -1
  27. package/dist/src/coding-tools.js +104 -33
  28. package/dist/src/command-screens.js +1 -1
  29. package/dist/src/commands.js +1 -1
  30. package/dist/src/completion-gates.d.ts +42 -7
  31. package/dist/src/completion-gates.js +55 -9
  32. package/dist/src/completion.d.ts +51 -1
  33. package/dist/src/completion.js +164 -5
  34. package/dist/src/config.d.ts +1 -0
  35. package/dist/src/config.js +2 -0
  36. package/dist/src/dashboard-view.js +2 -2
  37. package/dist/src/deadline.js +4 -0
  38. package/dist/src/decision/PreparedSteps.js +1 -1
  39. package/dist/src/delegation-changes.js +19 -2
  40. package/dist/src/diff-preview.d.ts +1 -0
  41. package/dist/src/diff-preview.js +12 -3
  42. package/dist/src/engine-streams.d.ts +22 -0
  43. package/dist/src/engine-streams.js +16 -0
  44. package/dist/src/extensions.js +17 -6
  45. package/dist/src/file-read-key.d.ts +8 -0
  46. package/dist/src/file-read-key.js +12 -0
  47. package/dist/src/graph-editor-session.js +2 -1
  48. package/dist/src/graph-health.d.ts +21 -0
  49. package/dist/src/graph-health.js +46 -0
  50. package/dist/src/graph-manager-chat.d.ts +52 -3
  51. package/dist/src/graph-manager-chat.js +62 -17
  52. package/dist/src/graph-runner.js +62 -5
  53. package/dist/src/graph-server.d.ts +1 -1
  54. package/dist/src/graph-server.js +48 -27
  55. package/dist/src/graph-sync.d.ts +8 -0
  56. package/dist/src/graph-sync.js +54 -3
  57. package/dist/src/graph-tool.js +1 -1
  58. package/dist/src/graph-ui/app.js +362 -123
  59. package/dist/src/graph-ui/controls.css +95 -22
  60. package/dist/src/graph-ui/controls.js +31 -1
  61. package/dist/src/graph-ui/embed.js +62 -13
  62. package/dist/src/graph-ui/icons.js +7 -0
  63. package/dist/src/graph-ui/index.html +4 -4
  64. package/dist/src/graph-ui/manager-state.js +143 -5
  65. package/dist/src/graph-ui/manager.css +21 -20
  66. package/dist/src/graph-ui/manager.js +337 -75
  67. package/dist/src/graph-ui/model-picker.js +279 -0
  68. package/dist/src/graph-ui/provider-glyphs/alibaba-cloud.png +0 -0
  69. package/dist/src/graph-ui/provider-glyphs/anthropic.png +0 -0
  70. package/dist/src/graph-ui/provider-glyphs/aws-bedrock.png +0 -0
  71. package/dist/src/graph-ui/provider-glyphs/claude.png +0 -0
  72. package/dist/src/graph-ui/provider-glyphs/deepseek.png +0 -0
  73. package/dist/src/graph-ui/provider-glyphs/fireworks.png +0 -0
  74. package/dist/src/graph-ui/provider-glyphs/kimi.png +0 -0
  75. package/dist/src/graph-ui/provider-glyphs/minimax.png +0 -0
  76. package/dist/src/graph-ui/provider-glyphs/openai.png +0 -0
  77. package/dist/src/graph-ui/provider-glyphs/opencode.png +0 -0
  78. package/dist/src/graph-ui/provider-glyphs/openrouter.png +0 -0
  79. package/dist/src/graph-ui/provider-glyphs/xai.png +0 -0
  80. package/dist/src/graph-ui/provider-glyphs/xiaomi-mimo.png +0 -0
  81. package/dist/src/graph-ui/provider-glyphs/zai.png +0 -0
  82. package/dist/src/graph-ui/skill-picker.js +1 -1
  83. package/dist/src/graph-ui/studio-canvas.js +8 -8
  84. package/dist/src/graph-ui/studio.css +18 -15
  85. package/dist/src/graph-ui/studio.js +92 -35
  86. package/dist/src/graph-ui/style.css +122 -79
  87. package/dist/src/graph-ui/theme.js +2 -2
  88. package/dist/src/graph-ui/tokens.css +33 -29
  89. package/dist/src/graphs.d.ts +5 -2
  90. package/dist/src/graphs.js +10 -9
  91. package/dist/src/mcp.d.ts +52 -14
  92. package/dist/src/mcp.js +285 -128
  93. package/dist/src/membership-errors.d.ts +7 -1
  94. package/dist/src/membership-errors.js +9 -3
  95. package/dist/src/memory/ProjectMemory.d.ts +77 -0
  96. package/dist/src/memory/ProjectMemory.js +310 -0
  97. package/dist/src/memory/index.d.ts +1 -0
  98. package/dist/src/memory/index.js +1 -0
  99. package/dist/src/opencode-provider.js +5 -6
  100. package/dist/src/package-name.d.ts +3 -0
  101. package/dist/src/package-name.js +3 -0
  102. package/dist/src/provider-engine.js +2 -2
  103. package/dist/src/pull-requests.d.ts +42 -6
  104. package/dist/src/pull-requests.js +11 -3
  105. package/dist/src/qa/runtime/PtyManager.js +2 -1
  106. package/dist/src/react-runtime.js +137 -22
  107. package/dist/src/read-document-doc.d.ts +20 -0
  108. package/dist/src/read-document-doc.js +524 -0
  109. package/dist/src/read-document-docx.d.ts +21 -0
  110. package/dist/src/read-document-docx.js +584 -0
  111. package/dist/src/read-document-text.d.ts +29 -0
  112. package/dist/src/read-document-text.js +67 -0
  113. package/dist/src/read-document-tool.d.ts +48 -0
  114. package/dist/src/read-document-tool.js +162 -0
  115. package/dist/src/read-document.d.ts +78 -0
  116. package/dist/src/read-document.js +353 -0
  117. package/dist/src/read-image.d.ts +29 -2
  118. package/dist/src/read-image.js +42 -17
  119. package/dist/src/remote/cert.d.ts +1 -1
  120. package/dist/src/remote/cert.js +2 -7
  121. package/dist/src/remote/client.js +1 -1
  122. package/dist/src/remote/pem.d.ts +6 -0
  123. package/dist/src/remote/pem.js +11 -0
  124. package/dist/src/run-records.js +49 -10
  125. package/dist/src/runtime.d.ts +21 -0
  126. package/dist/src/runtime.js +10 -1
  127. package/dist/src/session-changes.d.ts +6 -1
  128. package/dist/src/session-changes.js +13 -5
  129. package/dist/src/sessions.d.ts +3 -1
  130. package/dist/src/sessions.js +5 -3
  131. package/dist/src/side-panel.d.ts +6 -1
  132. package/dist/src/side-panel.js +12 -10
  133. package/dist/src/sign-in-detection.d.ts +82 -0
  134. package/dist/src/sign-in-detection.js +197 -0
  135. package/dist/src/sign-in-offer.d.ts +35 -0
  136. package/dist/src/sign-in-offer.js +116 -0
  137. package/dist/src/skills/bundled/create-skill/SKILL.md +1 -1
  138. package/dist/src/skills/bundled/diagram/SKILL.md +1 -1
  139. package/dist/src/skills/bundled/graph-manager/SKILL.md +59 -7
  140. package/dist/src/skills/bundled/graph-manager/patterns.md +27 -0
  141. package/dist/src/skills/bundled/provenance.json +4 -4
  142. package/dist/src/skills/runtime-skills.d.ts +6 -0
  143. package/dist/src/skills/runtime-skills.js +16 -3
  144. package/dist/src/stall-recovery.d.ts +6 -2
  145. package/dist/src/stall-recovery.js +7 -2
  146. package/dist/src/stray-files.d.ts +14 -0
  147. package/dist/src/stray-files.js +81 -0
  148. package/dist/src/subagent-run.js +6 -1
  149. package/dist/src/terminal-ui.d.ts +1 -1
  150. package/dist/src/terminal-ui.js +11 -5
  151. package/dist/src/time-limit.d.ts +53 -0
  152. package/dist/src/time-limit.js +79 -0
  153. package/dist/src/tool-activity.js +1 -1
  154. package/dist/src/tool-schema-compatibility.d.ts +7 -2
  155. package/dist/src/tool-schema-compatibility.js +8 -4
  156. package/dist/src/tools.js +92 -7
  157. package/dist/src/transcript.d.ts +5 -0
  158. package/dist/src/transcript.js +12 -4
  159. package/dist/src/types.d.ts +8 -0
  160. package/dist/src/untracked-file-removal.d.ts +3 -0
  161. package/dist/src/untracked-file-removal.js +125 -0
  162. package/dist/src/update-check.js +1 -1
  163. package/dist/src/update.d.ts +11 -1
  164. package/dist/src/update.js +27 -5
  165. package/dist/src/usage-analytics.d.ts +3 -1
  166. package/dist/src/usage-analytics.js +16 -2
  167. package/dist/src/workspace-git-metadata.d.ts +15 -0
  168. package/dist/src/workspace-git-metadata.js +50 -1
  169. package/dist/src/workspace-instructions.js +1 -1
  170. package/package.json +6 -26
  171. package/docs/README.md +0 -36
  172. package/docs/agents/README.md +0 -62
  173. package/docs/agents/install-for-agents.md +0 -56
  174. package/docs/agents/mcp-server.md +0 -212
  175. package/docs/agents/subagent-mode.md +0 -149
  176. package/docs/concepts/README.md +0 -47
  177. package/docs/concepts/jev-actionable-routing.md +0 -113
  178. package/docs/concepts/jev-decision-thresholds.md +0 -412
  179. package/docs/concepts/jev-efficiency.md +0 -217
  180. package/docs/concepts/jev-eval-2026-11-01.md +0 -78
  181. package/docs/concepts/limits.md +0 -52
  182. package/docs/concepts/memory.md +0 -10
  183. package/docs/concepts/security.md +0 -50
  184. package/docs/concepts/workspace-instructions.md +0 -29
  185. package/docs/getting-started/README.md +0 -82
  186. package/docs/getting-started/accounts.md +0 -78
  187. package/docs/getting-started/configure-providers.md +0 -132
  188. package/docs/guides/README.md +0 -13
  189. package/docs/guides/browser.md +0 -39
  190. package/docs/guides/desktop-app.md +0 -414
  191. package/docs/guides/extensions.md +0 -102
  192. package/docs/guides/graph-builder.md +0 -116
  193. package/docs/guides/headless.md +0 -46
  194. package/docs/guides/tui.md +0 -75
  195. package/docs/guides/update.md +0 -70
  196. package/docs/guides/web-search.md +0 -51
  197. package/docs/guides/windows-code-signing.md +0 -319
  198. package/docs/llms.txt +0 -45
  199. package/docs/reference/README.md +0 -7
  200. package/docs/reference/cli.md +0 -76
  201. package/docs/reference/config.md +0 -91
  202. package/docs/reference/slash-commands.md +0 -59
  203. package/docs/superpowers/plans/2026-11-01-claude-console-sign-in.md +0 -111
  204. package/docs/superpowers/plans/2026-11-01-jev-node-opt-in.md +0 -910
  205. package/docs/superpowers/plans/2026-11-02-workflow-pane.md +0 -398
  206. package/docs/superpowers/plans/2026-11-06-graph-soft-delete.md +0 -125
  207. package/docs/superpowers/plans/2026-11-09-orchestrator-delegation.md +0 -295
  208. package/docs/superpowers/plans/2026-11-13-graph-manager-chat.md +0 -203
  209. package/docs/superpowers/plans/2026-11-14-jev-fair-use-pricing.md +0 -79
  210. package/docs/superpowers/specs/2026-10-31-work-line-summary-design.md +0 -50
  211. package/docs/superpowers/specs/2026-11-01-claude-console-sign-in-design.md +0 -176
  212. package/docs/superpowers/specs/2026-11-01-jev-node-opt-in-design.md +0 -164
  213. package/docs/superpowers/specs/2026-11-01-pr-section-design.md +0 -111
  214. package/docs/superpowers/specs/2026-11-02-workflow-pane-design.md +0 -130
  215. package/docs/superpowers/specs/2026-11-06-bundled-skills-design.md +0 -206
  216. package/docs/superpowers/specs/2026-11-09-orchestrator-delegation-design.md +0 -291
  217. package/docs/superpowers/specs/2026-11-13-graph-manager-chat-design.md +0 -182
  218. package/docs/superpowers/specs/2026-11-14-jev-fair-use-pricing-design.md +0 -156
  219. package/scripts/jev-efficiency-eval.mjs +0 -187
  220. package/scripts/jev-efficiency-live.mjs +0 -193
  221. package/scripts/zcode-engine-replay.mjs +0 -223
  222. package/tests/agent-centric-mcp-test-plan.md +0 -208
  223. package/tests/analytics-settings-test-plan.md +0 -165
  224. package/tests/browser-cli-smoke.mjs +0 -276
  225. package/tests/browser-test-plan.md +0 -280
  226. package/tests/chat-side-panel-test-plan.md +0 -309
  227. package/tests/decision-engine-test-plan.md +0 -163
  228. package/tests/default-active-jev-test-plan.md +0 -85
  229. package/tests/harness-extensions-test-plan.md +0 -113
  230. package/tests/jev-all-decisions-test-plan.md +0 -156
  231. package/tests/jev-efficiency/criteria.json +0 -158
  232. package/tests/jev-efficiency/workloads.mjs +0 -242
  233. package/tests/jev-efficiency-test-plan.md +0 -198
  234. package/tests/permissions-sandbox-probe.mjs +0 -74
  235. package/tests/permissions-test-plan.md +0 -191
  236. package/tests/product-telemetry-test-plan.md +0 -536
  237. package/tests/thinking-stream-preview-test-plan.md +0 -136
  238. package/tests/zcode-react-engine-test-plan.md +0 -396
@@ -88,6 +88,143 @@ globalThis.AndorraManagerState = (() => {
88
88
  return deleted;
89
89
  }
90
90
 
91
+ const plainObject = value => !!value && typeof value === 'object' && !Array.isArray(value);
92
+ const text = value => typeof value === 'string';
93
+ const optional = (value, check) => value === undefined || check(value);
94
+ const point = value => plainObject(value) && Number.isFinite(value.x) && Number.isFinite(value.y);
95
+ const GRAPH_FIELDS = { name: text, entry: text, limits: plainObject, metadata: plainObject, widgets: Array.isArray, inputSchema: plainObject, stateSchema: plainObject };
96
+
97
+ /**
98
+ * Whether a draft change has the shape the canvas draws. The backend checks a draft's fields only
99
+ * when it validates or publishes, so a malformed change (a graph patch naming `name: null`, say)
100
+ * can still reach the panel; drawn, it would break every redraw and save until undone.
101
+ */
102
+ const UNSAFE_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
103
+ /** Whether a parsed value carries a key that would reach an object's prototype when assigned. */
104
+ function unsafeKeys(value, depth = 0) {
105
+ if (depth > 64) return true;
106
+ if (Array.isArray(value)) return value.some(item => unsafeKeys(item, depth + 1));
107
+ if (!value || typeof value !== 'object') return false;
108
+ return Object.keys(value).some(key => UNSAFE_KEYS.has(key) || unsafeKeys(value[key], depth + 1));
109
+ }
110
+
111
+ function soundEdit(edit) {
112
+ if (!edit || typeof edit.kind !== 'string' || unsafeKeys(edit)) return false;
113
+ if (edit.kind === 'node') {
114
+ const node = edit.node;
115
+ return plainObject(node) && text(node.id) && !!node.id && text(node.name) && text(node.type)
116
+ && optional(node.model, text) && optional(node.provider, text) && optional(node.instruction, text)
117
+ && optional(node.position, point) && ['completion', 'capabilities', 'subagents', 'limits', 'contextPolicy'].every(key => optional(node[key], plainObject));
118
+ }
119
+ if (edit.kind === 'edge') {
120
+ const edge = edit.edge;
121
+ return plainObject(edge) && text(edge.id) && text(edge.source) && text(edge.target) && optional(edge.outcome, text);
122
+ }
123
+ if (edit.kind === 'node.remove') return text(edit.nodeId) && !!edit.nodeId;
124
+ if (edit.kind === 'edge.remove') return text(edit.edgeId) && !!edit.edgeId;
125
+ if (edit.kind === 'graph') {
126
+ if (!plainObject(edit.patch)) return false;
127
+ const keys = Object.keys(edit.patch);
128
+ return keys.length > 0 && keys.every(key => Object.hasOwn(GRAPH_FIELDS, key) && GRAPH_FIELDS[key](edit.patch[key]));
129
+ }
130
+ return false;
131
+ }
132
+
133
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
134
+ /**
135
+ * The agent's version of an object (a node, or the graph's fields) merged into the canvas's, field
136
+ * by field, against `base`: the version both last shared. A field the user changed since keeps the
137
+ * user's value; a field only the agent changed takes the agent's; with no base, the agent's version
138
+ * is taken whole. `kept` lists the fields where the user's value won over a different one of the
139
+ * agent's, so the caller knows the canvas no longer follows the agent.
140
+ */
141
+ function mergeFields(base, current, incoming, keys) {
142
+ if (!plainObject(current) || !plainObject(base)) return { merged: incoming, kept: [] };
143
+ const merged = {}, kept = [];
144
+ const fields = keys || [...new Set([...Object.keys(base), ...Object.keys(current), ...Object.keys(incoming)])];
145
+ for (const key of fields) {
146
+ const userChanged = !same(current[key], base[key]);
147
+ const value = userChanged ? current[key] : incoming[key];
148
+ if (userChanged && !same(current[key], incoming[key])) kept.push(key);
149
+ if (value !== undefined) merged[key] = value;
150
+ }
151
+ return { merged, kept };
152
+ }
153
+
154
+ /**
155
+ * Makes `target` hold what `next` holds while keeping every nested object and array that both have,
156
+ * so a reference held elsewhere (an inspector control) still points into the live value.
157
+ */
158
+ function assignInPlace(target, next) {
159
+ if (Array.isArray(target)) {
160
+ target.length = Math.min(target.length, next.length);
161
+ next.forEach((value, index) => {
162
+ const current = target[index];
163
+ if ((plainObject(current) && plainObject(value)) || (Array.isArray(current) && Array.isArray(value))) assignInPlace(current, value);
164
+ else target[index] = value;
165
+ });
166
+ return target;
167
+ }
168
+ for (const key of Object.keys(target)) if (!Object.hasOwn(next, key)) delete target[key];
169
+ for (const [key, value] of Object.entries(next)) {
170
+ if (UNSAFE_KEYS.has(key)) continue;
171
+ // Only the object's own value is kept and descended into; an inherited one is never written through.
172
+ const current = Object.hasOwn(target, key) ? target[key] : undefined;
173
+ if ((plainObject(current) && plainObject(value)) || (Array.isArray(current) && Array.isArray(value))) assignInPlace(current, value);
174
+ else Object.defineProperty(target, key, { value, writable: true, enumerable: true, configurable: true });
175
+ }
176
+ return target;
177
+ }
178
+
179
+ /**
180
+ * Applies one change the agent made to its draft (`graph.edit`'s `edit`) to `graph` in place, the
181
+ * way the draft applied it: a node is set (keeping the object the editor's inspector is bound to),
182
+ * a connection is set whole, a removed node takes its connections with it, a graph patch replaces
183
+ * the fields it names. False when it changed nothing or the change is malformed.
184
+ */
185
+ function applyEdit(graph, edit) {
186
+ if (!graph || !soundEdit(edit)) return false;
187
+ graph.nodes = plainObject(graph.nodes) ? graph.nodes : {};
188
+ graph.edges = Array.isArray(graph.edges) ? graph.edges : [];
189
+ if (edit.kind === 'node') {
190
+ const next = JSON.parse(JSON.stringify(edit.node));
191
+ const target = graph.nodes[next.id];
192
+ if (!plainObject(target)) { graph.nodes[next.id] = next; return true; }
193
+ // The inspector's fields write into the objects they were drawn for (the node, its completion,
194
+ // its subagent roles), so those objects stay and their contents change: a field being typed in
195
+ // still commits into the graph.
196
+ assignInPlace(target, next);
197
+ return true;
198
+ }
199
+ if (edit.kind === 'node.remove') {
200
+ if (!Object.hasOwn(graph.nodes, edit.nodeId)) return false;
201
+ delete graph.nodes[edit.nodeId];
202
+ graph.edges = graph.edges.filter(edge => edge.source !== edit.nodeId && edge.target !== edit.nodeId);
203
+ return true;
204
+ }
205
+ if (edit.kind === 'edge') {
206
+ // A connection is drawn only between cards the canvas has.
207
+ if (!Object.hasOwn(graph.nodes, edit.edge.source) || !Object.hasOwn(graph.nodes, edit.edge.target)) return false;
208
+ const edge = JSON.parse(JSON.stringify(edit.edge));
209
+ const index = graph.edges.findIndex(item => item.id === edge.id);
210
+ // An existing connection keeps the object its inspector's mapping fields write into.
211
+ if (index < 0) graph.edges.push(edge); else if (plainObject(graph.edges[index])) assignInPlace(graph.edges[index], edge); else graph.edges[index] = edge;
212
+ return true;
213
+ }
214
+ if (edit.kind === 'edge.remove') {
215
+ const before = graph.edges.length;
216
+ graph.edges = graph.edges.filter(edge => edge.id !== edit.edgeId);
217
+ return graph.edges.length !== before;
218
+ }
219
+ for (const key of Object.keys(edit.patch)) {
220
+ const value = JSON.parse(JSON.stringify(edit.patch[key]));
221
+ // The graph inspector's fields hold its settings objects (limits, schemas) the same way.
222
+ if ((plainObject(graph[key]) && plainObject(value)) || (Array.isArray(graph[key]) && Array.isArray(value))) assignInPlace(graph[key], value);
223
+ else graph[key] = value;
224
+ }
225
+ return true;
226
+ }
227
+
91
228
  /**
92
229
  * The transcript after one server event, as a new array. A `snapshot` replaces it, folded like live
93
230
  * events; `resolved` marks its approval or question `answered` on a copy and adds no row.
@@ -96,8 +233,9 @@ globalThis.AndorraManagerState = (() => {
96
233
  const current = Array.isArray(transcript) ? transcript : [];
97
234
  if (!event || typeof event.type !== 'string') return [...current];
98
235
  if (event.type === 'snapshot') return (event.events || []).reduce(reduce, []);
99
- // A `state` event is not a transcript row: the panel tracks the run state on its own.
100
- if (event.type === 'state') return [...current];
236
+ // A `state` event is not a transcript row: the panel tracks the run state on its own, and a
237
+ // `graph.edit` is applied to the canvas, not listed.
238
+ if (event.type === 'state' || event.type === 'graph.edit') return [...current];
101
239
  if (event.type === 'resolved') {
102
240
  return current.map(entry => (entry.type === 'approval' || entry.type === 'question') && entry.id === event.id ? { ...entry, answered: true } : entry);
103
241
  }
@@ -156,7 +294,7 @@ globalThis.AndorraManagerState = (() => {
156
294
  }
157
295
 
158
296
  /** Graph actions that change the draft; the summary counts them as edits. */
159
- const EDITS = new Set(['Set step', 'Edit step', 'Remove step', 'Connect', 'Remove connection', 'Edit workflow']);
297
+ const EDITS = new Set(['Set step', 'Edit step', 'Remove step', 'Connect', 'Remove connection', 'Edit graph']);
160
298
  const plural = (count, one, many) => `${count} ${count === 1 ? one : many}`;
161
299
  /**
162
300
  * What a settled stretch did, in one sentence: `Thought for 12s, made 5 edits, ran 3 other steps`.
@@ -171,7 +309,7 @@ globalThis.AndorraManagerState = (() => {
171
309
  // A save that failed or was denied is a step like any other, not a save.
172
310
  const other = tools.length - edits - saves;
173
311
  if (edits) parts.push(`made ${plural(edits, 'edit', 'edits')}`);
174
- if (saves) parts.push('saved the workflow');
312
+ if (saves) parts.push('saved the graph');
175
313
  if (other) parts.push(`ran ${plural(other, edits || saves ? 'other step' : 'step', edits || saves ? 'other steps' : 'steps')}`);
176
314
  if (!parts.length) return 'Worked';
177
315
  const sentence = parts.join(', ');
@@ -187,5 +325,5 @@ globalThis.AndorraManagerState = (() => {
187
325
  return Math.max(...ends) - Math.min(...starts);
188
326
  }
189
327
 
190
- return { shouldShowTip, dismissTip, initialModel, rememberModel, applyDecision, createdGraph, deletedGraphs, reduce, blocks, seconds, thoughtLabel, workLabel, workDuration };
328
+ return { shouldShowTip, dismissTip, initialModel, rememberModel, applyDecision, createdGraph, deletedGraphs, soundEdit, mergeFields, applyEdit, reduce, blocks, seconds, thoughtLabel, workLabel, workDuration };
191
329
  })();
@@ -6,11 +6,11 @@
6
6
  /* The button's first-run tip hangs under it, over the toolbar's edge and clear of the canvas tips
7
7
  (those sit at the canvas's top left). */
8
8
  .manager-anchor { position: relative; display: flex; }
9
- #graph-manager[aria-expanded="true"] { background: var(--selected, var(--accent-soft)); }
9
+ #graph-manager[aria-expanded="true"] { background: var(--selected); }
10
10
  .manager-tip {
11
- position: absolute; z-index: 20; top: calc(100% + var(--space-2)); right: 0; width: max-content; max-width: 280px;
11
+ position: absolute; z-index: var(--z-menu); top: calc(100% + var(--space-2)); right: 0; width: max-content; max-width: 280px;
12
12
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
13
- color: var(--text); font-size: var(--type-xs); line-height: 1.45; white-space: normal;
13
+ color: var(--text); font-size: var(--type-xs); line-height: var(--leading-xs); white-space: normal;
14
14
  background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-menu);
15
15
  }
16
16
  .manager-tip .icon-button { flex: none; min-width: 24px; width: 24px; min-height: 24px; height: 24px; border-radius: var(--radius-sm); }
@@ -18,13 +18,13 @@
18
18
  /* The panel is a flex sibling of the canvas and the inspector: opening it narrows the canvas. */
19
19
  #manager-panel {
20
20
  width: var(--manager-panel, 380px); max-width: 60%; flex-shrink: 0; min-height: 0; border-left: 1px solid var(--border);
21
- background: var(--bg-surface); display: flex; flex-direction: column; position: relative; z-index: 3;
21
+ background: var(--bg-surface); display: flex; flex-direction: column; position: relative; z-index: var(--z-raised);
22
22
  }
23
23
  #manager-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 7px; cursor: col-resize; }
24
24
  #manager-resize:focus-visible { outline: none; background: var(--accent-ring); }
25
25
  .manager-header-actions { display: flex; align-items: center; gap: var(--space-1); }
26
26
  .manager-models {
27
- display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2);
27
+ display: flex; gap: var(--space-2);
28
28
  padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border);
29
29
  }
30
30
 
@@ -32,7 +32,7 @@
32
32
  .manager-notice {
33
33
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
34
34
  padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--border);
35
- background: var(--bg-card); color: var(--text); font-size: var(--type-xs); line-height: 1.45;
35
+ background: var(--bg-card); color: var(--text); font-size: var(--type-xs); line-height: var(--leading-xs);
36
36
  }
37
37
  .manager-notice > span:first-child { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
38
38
  .manager-notice-actions { display: flex; gap: var(--space-1); flex: none; }
@@ -41,7 +41,7 @@
41
41
 
42
42
  #manager-transcript {
43
43
  flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--space-3);
44
- padding: var(--space-4); font-size: var(--type-sm); line-height: 1.55;
44
+ padding: var(--space-4); font-size: var(--type-sm); line-height: var(--leading-sm);
45
45
  }
46
46
  #manager-transcript:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-ring); }
47
47
  .manager-empty { margin: 0; }
@@ -52,28 +52,28 @@
52
52
  reply as prose, and its work as flat gray lines between them. */
53
53
  .manager-user-body {
54
54
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--card-radius);
55
- padding: var(--space-2) var(--space-3); white-space: pre-wrap; color: var(--text); line-height: 1.55;
55
+ padding: var(--space-2) var(--space-3); white-space: pre-wrap; color: var(--text); line-height: var(--leading-sm);
56
56
  }
57
57
  .manager-assistant { color: var(--text); }
58
58
 
59
59
  /* Markdown in the reply, after the app's `.md` rules. */
60
- .markdown { white-space: normal; line-height: 1.65; }
60
+ .markdown { white-space: normal; line-height: var(--leading-prose); }
61
61
  .markdown > * + * { margin-top: 10px; }
62
62
  .markdown > :first-child { margin-top: 0; }
63
63
  .markdown p, .markdown ul, .markdown ol, .markdown pre, .markdown blockquote { margin-bottom: 0; }
64
64
  .markdown p { margin: 0; }
65
- .markdown :is(h3, h4, h5, h6, h7, h8) { margin: 16px 0 4px; font-size: var(--type-sm); font-weight: var(--weight-strong); line-height: 1.3; }
66
- .markdown h3 { font-size: var(--type-md); }
65
+ .markdown :is(h3, h4, h5, h6, h7, h8) { margin: 16px 0 4px; font-size: var(--type-sm); font-weight: var(--weight-strong); line-height: var(--leading-sm); }
66
+ .markdown h3 { font-size: var(--type-md); line-height: var(--leading-md); }
67
67
  .markdown > :is(h3, h4, h5, h6, h7, h8):first-child { margin-top: 0; }
68
68
  .markdown ul, .markdown ol { padding-left: 1.4em; margin-top: 6px; }
69
69
  .markdown li + li { margin-top: 2px; }
70
70
  .markdown li > :is(ul, ol) { margin-top: 2px; }
71
- .markdown code { font-family: var(--font-mono); font-size: 0.92em; padding: 1px 4px; border-radius: var(--radius-xs); background: var(--bg-input); border: 1px solid var(--border); }
71
+ .markdown code { font-family: var(--font-mono); font-size: var(--type-xs); padding: 1px 4px; border-radius: var(--radius-xs); background: var(--bg-input); border: 1px solid var(--border); }
72
72
  .markdown pre { margin: 10px 0 0; padding: var(--space-2) var(--space-3); background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; max-height: 360px; }
73
- .markdown pre code { padding: 0; border: 0; background: none; font-size: var(--type-xs); line-height: 1.55; white-space: pre; }
73
+ .markdown pre code { padding: 0; border: 0; background: none; font-size: var(--type-xs); line-height: var(--leading-code); white-space: pre; }
74
74
  .markdown blockquote { margin: 10px 0 0; padding-left: var(--space-3); border-left: 2px solid var(--border-strong); color: var(--text-2); }
75
75
  .markdown hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
76
- .markdown a { color: var(--accent-text, var(--accent)); text-decoration: underline; text-underline-offset: 2px; }
76
+ .markdown a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
77
77
  .markdown-table { overflow: auto; }
78
78
  .markdown table { border-collapse: collapse; font-size: var(--type-xs); }
79
79
  .markdown :is(th, td) { border: 1px solid var(--border); padding: 3px 8px; text-align: left; vertical-align: top; }
@@ -86,7 +86,7 @@
86
86
  .manager-fold-head {
87
87
  display: flex; align-items: baseline; justify-content: flex-start; gap: 8px; width: 100%; min-width: 0; padding: 1px 2px;
88
88
  background: transparent; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none;
89
- min-height: 0; height: auto; text-align: left; font: inherit; font-size: var(--type-xs); font-weight: var(--weight-regular); line-height: 1.6;
89
+ min-height: 0; height: auto; text-align: left; font: inherit; font-size: var(--type-xs); font-weight: var(--weight-regular); line-height: var(--leading-xs);
90
90
  color: var(--text-2); box-shadow: none;
91
91
  }
92
92
  button.manager-fold-head { cursor: pointer; }
@@ -114,21 +114,22 @@ button.manager-fold-head::after {
114
114
  .manager-preview-tail > span { direction: ltr; unicode-bidi: isolate; }
115
115
  .manager-row-duration { margin-left: auto; order: 2; flex-shrink: 0; min-width: 6ch; text-align: right; color: var(--text-3); font-family: var(--font-mono); font-size: var(--type-xs); }
116
116
  .manager-status-glyph { order: 1; flex: none; font-family: var(--font-mono); color: var(--text-3); }
117
- .manager-fold:is([data-status="running"], [data-status="thinking"]) > .manager-fold-head .manager-status-glyph { color: var(--accent); animation: manager-pulse 1.4s var(--ease-standard) infinite; }
117
+ .manager-fold:is([data-status="running"], [data-status="thinking"]) > .manager-fold-head .manager-status-glyph { color: var(--accent); animation: manager-pulse var(--loop-breathe) var(--ease-in-out) infinite; }
118
118
  .manager-fold[data-status="failed"] > .manager-fold-head .manager-status-glyph { color: var(--err-text); }
119
119
  .manager-fold:is([data-status="running"], [data-status="thinking"]) > .manager-fold-head :is(.manager-activity-name, .manager-activity-verb) { color: var(--text); }
120
120
  @keyframes manager-pulse { 50% { opacity: 0.35; } }
121
121
  @media (prefers-reduced-motion: reduce) { .manager-status-glyph { animation: none !important; } }
122
122
  .manager-activity-text {
123
- white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: var(--type-xs); line-height: 1.6;
124
- max-height: calc(10 * 1.6em); overflow: auto; padding-left: 2px; user-select: text; -webkit-user-select: text;
123
+ white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: var(--type-xs); line-height: var(--leading-xs);
124
+ max-height: calc(10 * var(--leading-xs)); overflow: auto; padding-left: 2px; user-select: text; -webkit-user-select: text;
125
125
  }
126
126
  .manager-activity-text:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-ring); border-radius: var(--radius-xs); }
127
127
  .manager-activity-command { font-family: var(--font-mono); font-size: var(--type-xs); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 2px; user-select: text; -webkit-user-select: text; }
128
128
  .manager-activity-reason { font-size: var(--type-xs); color: var(--err-text); white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 2px; }
129
129
  .manager-activity-note { font-size: var(--type-xs); color: var(--text-3); padding-left: 2px; }
130
130
 
131
- .manager-saved { color: var(--ok-text); font-size: var(--type-xs); }
131
+ /* A saved or deleted graph is a step done, not a check passed: the muted ink, never green (P-LNT-06). */
132
+ .manager-saved { color: var(--text-2); font-size: var(--type-xs); }
132
133
  .manager-row.manager-error { color: var(--err-text); font-size: var(--type-xs); white-space: pre-wrap; }
133
134
  .manager-card {
134
135
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
@@ -156,6 +157,6 @@ button.manager-fold-head::after {
156
157
  @media (max-width: 760px) {
157
158
  #manager-panel { max-width: 78%; width: min(var(--manager-panel, 380px), 78%); }
158
159
  .workspace.manager-open #inspector { display: none; }
159
- .manager-models { grid-template-columns: minmax(0, 1fr); padding: var(--space-2) var(--space-3); }
160
+ .manager-models { padding: var(--space-2) var(--space-3); }
160
161
  #manager-transcript, .manager-composer { padding: var(--space-3); }
161
162
  }