@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
@@ -1,206 +0,0 @@
1
- # Bundled skills, skill commands and graph soft delete
2
-
3
- Status: draft for review, 2026-11-06.
4
-
5
- ## Goal
6
-
7
- Andorra ships its own skills: instructions written for the agent, which the agent loads when a request
8
- matches a skill's description, and which a person can also start by typing `/name`. A skill picked in the
9
- composer shows as a bold, accent-coloured chip that Backspace removes in one keystroke, in the desktop app and
10
- in the terminal. A `graph-manager` skill adds, edits and removes graphs through the existing graph MCP server,
11
- which gains a soft delete and a restore.
12
-
13
- ## Delivery
14
-
15
- Three pull requests, each with its own QA plan under `tests/`:
16
-
17
- | PR | Scope | Depends on |
18
- | --- | --- | --- |
19
- | 1 | Graph soft delete: two MCP tools, deleted graphs hidden everywhere | — |
20
- | 2 | Skill commands: one invocable-skill list, built-in skills typeable as `/name`, desktop and terminal chips | — |
21
- | 3 | Seven bundled skills | 1 (graph-manager removes graphs), 2 (typing `/name`) |
22
-
23
- PRs 1 and 2 touch different files and can be built in parallel. PR 3 starts once both have merged.
24
-
25
- ## Part 1 — Graph soft delete (PR 1)
26
-
27
- ### Why soft
28
-
29
- Cloud sync uploads local graphs and restores everything the account holds (`src/graph-account.ts`), and the
30
- hosted service has only `GET /v1/graphs`, `PUT /v1/graphs/{snapshot}` and `GET /v1/graphs/{snapshot}`
31
- (`infra/andorra-auth/graph_storage.py`). Removing a graph's files would be undone by the next sync pass, and
32
- another machine would upload its copy again. A free account's allowance is pinned permanently to the first
33
- graph it stores. A deletion is therefore a new revision that carries a marker; the existing sync carries it to
34
- every machine and the hosted service needs no change.
35
-
36
- ### Data
37
-
38
- - A deleted graph's latest revision has `metadata.deletedAt` set to an ISO 8601 timestamp and is otherwise
39
- identical to the revision before it. Graph validation already preserves unknown metadata keys
40
- (`src/graphs.ts`), and the hosted service stores snapshot content as given.
41
- - Restoring publishes the next revision with `metadata.deletedAt` removed.
42
- - No file is removed. Every earlier revision stays on disk and in the cloud.
43
- - `isDeletedGraph(graph)` in `src/graphs.ts` is the single test every caller uses.
44
-
45
- ### MCP tools (`src/agent-mcp.ts`)
46
-
47
- `andorra_graph_delete { id, expectedRevision, confirm }`
48
-
49
- - Refuses `default` and the Andorra preset.
50
- - `expectedRevision` must equal the latest revision, so the caller deletes the version it looked at; a newer
51
- revision is the existing conflict error.
52
- - `confirm` must equal `id`. The skill has the agent ask the person in chat before it calls the tool; the
53
- argument makes a deletion a deliberate call rather than a slip of an argument.
54
- - Refuses while any automation's `execution.graph` names the graph, and lists those automations by name.
55
- - Refuses a graph that is already deleted.
56
- - Discards any open MCP draft of the graph.
57
- - Publishes through the same path as `andorra_graph_publish`, so free-tier and membership rules apply
58
- unchanged, and returns `{ id, revision, deletedAt }`.
59
-
60
- `andorra_graph_restore { id, expectedRevision }`
61
-
62
- - Refuses a graph that is not deleted; otherwise the same revision check and save path as delete.
63
- - Returns `{ id, revision }`.
64
-
65
- `andorra_graphs_list` gains `includeDeleted` (default `false`); listed deleted graphs carry `deleted: true` and
66
- `deletedAt`. `andorra_graph_get` keeps reading any graph and reports `deletedAt` when set.
67
- `andorra_graph_begin` with `mode=edit` refuses a deleted graph and names the restore tool.
68
-
69
- Each refusal uses a named error code in the server's existing style: `DEFAULT_GRAPH`, `CONFIRMATION_MISMATCH`,
70
- `GRAPH_IN_USE`, `GRAPH_DELETED`, `GRAPH_NOT_DELETED`. The architecture guide the server returns
71
- (`andorra_graph_guide`) describes both tools and the codes.
72
-
73
- ### Where a deleted graph disappears
74
-
75
- - Each listing surface shows `withoutDeletedGraphs(saved)`: the desktop (`graphs.list` in the app server),
76
- `/graph` in the terminal, the graph editor's list and the MCP listing. `listGraphs` itself still returns
77
- every graph, because the quota is computed from its full result.
78
- - Graph quota counts deleted graphs, matching the hosted service's permanent free-graph pin. A free account
79
- that deletes its one graph can restore it but cannot create a different one; that limit is stated in the
80
- delete tool's success message.
81
- - New runs: `loadAccessibleGraph` refuses a deleted graph with "Graph <name> was deleted. Restore it before
82
- running it." This is the gate for `andorra --graph`, the terminal, the desktop and automations.
83
- - A saved selection (`config.graphSelections`) that names a deleted graph falls back to the default graph with
84
- a one-line notice. The saved selection is left unchanged, so restoring the graph brings it back.
85
- - A session that already ran the graph must keep resuming. The deleted check applies to starting a new run,
86
- not to resuming one, and every revision the session may name is still on disk.
87
- - The graph editor (`andorra graph`) hides deleted graphs. It has no restore control in this change; restoring
88
- is done through the MCP tool, which `graph-manager` drives.
89
-
90
- ### Out of scope
91
-
92
- A true delete: a hosted delete route, a tombstone that sync honours in both directions, freeing a free
93
- account's pin, and the service deployment.
94
-
95
- ## Part 2 — Skill commands (PR 2)
96
-
97
- ### One invocable-skill list
98
-
99
- `listInvocableSkills(config, signal, directory)` returns every skill a person can type, each with `id`, `name`,
100
- `command` (`/<directory name>`), `description`, `source` (`installed` or `built-in`) and an `unavailable`
101
- reason when the skill cannot run here (for example a browser skill with the browser disabled).
102
-
103
- - Installed skills: the enabled ones `listBundles('skills')` returns today.
104
- - Built-in skills: the `andorra:*` entries registered in `src/skills/runtime-skills.ts`.
105
- - Built-in commands keep their meaning (`BUILTIN_COMMANDS` in `src/skill-commands.ts`); a skill whose name
106
- matches one stays reachable by its full id. Two skills with the same short name keep today's ambiguity
107
- error, which names both full ids.
108
-
109
- Three places use the list:
110
-
111
- 1. `resolveSkillInvocation` (`src/extensions.ts`), so `/manage-mcp` resolves to `andorra:manage-mcp`; the task
112
- text it builds is unchanged.
113
- 2. The desktop slash menu, where built-in skills show with the source "Built-in". Settings → Skills is
114
- unchanged: built-in skills are not listed there and cannot be turned off.
115
- 3. The terminal's `/` list.
116
-
117
- ### Desktop chip
118
-
119
- Both composers (`NewTaskView`, `SessionView`) keep their `<textarea>`; `useSlashSkillSuggestions` adds the chip
120
- so both get it.
121
-
122
- - A layer behind the textarea draws the same text with the same font, padding, width and wrapping; the
123
- textarea's text is transparent and its caret visible. The layer follows the textarea's scroll position.
124
- - The chip is the leading `/command` when it exactly matches an available skill and is followed by whitespace
125
- or the end of the draft, whether it was picked from the menu or typed in full. `skillChipRange(value,
126
- commands)` in `desktop/src/engine/slashSuggestions.ts` finds it.
127
- - Look: accent colour, a tinted pill drawn without horizontal padding, and bold drawn with
128
- `-webkit-text-stroke` so every glyph keeps its width and the caret stays aligned. Light and dark themes use
129
- the existing tokens.
130
- - Backspace with the caret at the chip's end, or right after its trailing space, deletes the chip and that
131
- space. Delete with the caret at the chip's start deletes the chip and its trailing space.
132
- - A selection that partly covers the chip grows to cover all of it before it is deleted or replaced.
133
- - A click or arrow key that would put the caret inside the chip moves it to the nearer edge.
134
- - Deletions go through the browser's editing commands so Ctrl+Z restores the chip; where those are unavailable
135
- the edit falls back to `setRangeText`.
136
- - Editing the text so it no longer names a skill turns it back into plain text.
137
- - Screen readers read the textarea's plain text (`/manage-mcp …`) as before.
138
-
139
- ### Terminal chip (`src/terminal-ui.ts`)
140
-
141
- - The `/` popup lists available skills after the built-in commands, each with its description. The list is
142
- read at startup and again after `/skills` or `/plugins` changes something.
143
- - Accepting a skill with Enter or Tab replaces the typed query with one skill token and a space. The token is
144
- one code point in the composer's private-use range, in a sub-range separate from attachment tokens; input
145
- cleanup already strips that range from typed and pasted text, so only the composer can create one.
146
- - The token renders as `/name` in bold with the Andorra accent (`accentPaint`).
147
- - Backspace, Delete, the arrow keys and selections treat the token as one unit, as they already treat
148
- attachment tokens.
149
- - Typing an exact skill command followed by a space converts it to a token. Recalling a sent message from
150
- history converts its leading skill command to a token.
151
- - On send the token expands to `/name`, so the existing submit path (`src/cli.ts`) resolves it unchanged.
152
-
153
- ## Part 3 — Bundled skills (PR 3)
154
-
155
- Seven skills under `src/skills/bundled/<name>/`, registered in `src/skills/runtime-skills.ts` as
156
- `andorra:<name>`. Each `SKILL.md` is written for the agent: frontmatter with a description that says when the
157
- skill applies, the steps, the rules, and what to report back. Skills that change Andorra's configuration edit
158
- `config.json` in the Andorra home, which is outside the workspace and goes through the normal approval rules,
159
- and they validate the result before reporting success. The exact commands each skill uses are settled in PR 3's
160
- plan against the code at that time.
161
-
162
- 1. **manage-mcp** — add, edit, test, turn off or remove an MCP server in `mcpServers`: validate the entry,
163
- connect and list its tools, keep secrets as environment references and never echo them.
164
- 2. **create-skill** — scaffold `.andorra/skills/<name>/SKILL.md` or an installed skill: a description that
165
- triggers correctly, within the 300-character description, 16 KB file and 16-skill limits, then confirm
166
- discovery lists it.
167
- 3. **manage-skills** — list, install, turn on or off and remove skills and plugins.
168
- 4. **create-agent** — write a saved agent definition (schema 2) and validate it.
169
- 5. **doctor** — check version and update readiness, sign-in, providers, MCP servers and free disk space, and
170
- list fixes in dependency order.
171
- 6. **write-instructions** — create or tighten `ANDORRA.md` or `AGENTS.md` within the workspace-instructions
172
- size limit.
173
- 7. **graph-manager** — add, edit and remove graphs through the graph MCP tools:
174
- 1. Check that the `andorra_graph_*` tools are available; if not, offer to connect `andorra mcp-server
175
- --stdio` through manage-mcp, with the person's consent.
176
- 2. Read `andorra_graph_guide` first; the skill points to it rather than copying it.
177
- 3. Gather requirements, draw a text sketch of nodes and routes, and get the person's approval before
178
- building.
179
- 4. Use provider ids from `andorra_providers_list`; check free-tier limits (one custom graph, up to three
180
- nodes, no Orchestrator) before starting.
181
- 5. Create or edit through a draft; never edit `default` (copy it first); loops need a visit or time limit.
182
- 6. Validate until clean, show a summary of the change, then publish; on a conflict, reopen the latest
183
- revision and reapply.
184
- 7. Remove with `andorra_graph_delete` only after the person confirms in chat; restore with
185
- `andorra_graph_restore`.
186
- 8. Report the id, revision, what changed, how to run it, and that cloud sync is not yet confirmed; discard
187
- the draft when the person stops partway.
188
-
189
- Two resources load on demand: `patterns.md` (plan → build → review loop; frontend, backend and DevOps
190
- routing; parallel read-only reviewers; a QA retry loop) and `errors.md` (each validation and refusal code
191
- and its fix).
192
-
193
- A test checks that every `andorra_graph_*` name the graph-manager files mention exists in the MCP server's tool
194
- list, so a renamed tool fails a test instead of leaving the skill stale.
195
-
196
- ## Testing
197
-
198
- - PR 1: unit tests for delete and restore (refusals, revision check, automation check, draft discard),
199
- `listGraphs` filtering, quota counting, `loadAccessibleGraph` refusal, selection fallback and resume of a
200
- session on a deleted graph. Run verification drives `andorra mcp-server --stdio` against a throwaway
201
- `ANDORRACODE_HOME`.
202
- - PR 2: unit tests for `listInvocableSkills`, built-in resolution and name clashes, `skillChipRange`, and the
203
- chip's Backspace, Delete, selection and caret rules in both composers. Run verification drives the terminal
204
- through node-pty and the desktop renderer headless.
205
- - PR 3: each skill registers, loads and passes the tool-name check; one real run loads a skill both ways, by
206
- `/name` and by a matching request.
@@ -1,291 +0,0 @@
1
- # Orchestrator delegation: write-capable subagents, review and landing
2
-
3
- Date: 2026-11-09
4
- Status: design for review, pending user approval
5
-
6
- ## Intent
7
-
8
- The user wants to run the Orchestrator on an expensive, strong model (for example Fable 5.5) as a
9
- lead that plans, delegates and reviews but never writes code itself. The implementation work goes to
10
- subagents running on other (typically cheaper) models, several at a time. When subagent work comes
11
- back wrong or incomplete, the Orchestrator spawns more subagents to fix it, and finishes only when it
12
- is satisfied.
13
-
14
- This is optional. The Orchestrator's current job (intake: research, clarify, hand a task instruction
15
- to the next node) stays the default and keeps working unchanged.
16
-
17
- ## Current state
18
-
19
- - An Orchestrator is an Agent node with `agentRole: 'orchestrator'`, built by `createOrchestratorNode`
20
- (`src/graphs.ts`). A version 3 graph allows at most one, and it must be the entry with no incoming
21
- edges.
22
- - At runtime its capabilities are clamped to `intakeCapabilities` (`src/graphs.ts`): read-only
23
- filesystem and Git, no shell, no GitHub, no deployment (`src/agent-execution.ts`, start of
24
- `runWithinDeadline`). Its tool list is filtered to research tools plus `ask_user`, `update_todos`,
25
- artifacts, skills and the browser.
26
- - It can already spawn subagents through `spawn_subagent` (`src/agent-execution.ts`), using the
27
- node's `subagents` policy: `maxConcurrent` (≤16), `maxTotal`, `maxDepth`, `modelPolicy`
28
- (`inherit` / `specific` / `per-role`), `workspace` (`shared-read-only` / `shared-write` /
29
- `worktree`), `toolInheritance`, `context`, `roles`. The graph builder exposes all of these
30
- (`renderSubagents` in `src/graph-ui/app.js`).
31
- - A child's capabilities must be a subset of its parent's. For the Orchestrator the parent ceiling is
32
- the intake ceiling, so graph validation rejects any writing role ("role … capability exceeds parent
33
- intake read-only ceiling", `src/graphs.ts`) and the runtime rejects it again at spawn time.
34
- - `spawn_subagent` blocks until the child finishes and returns `{status, outcome, output, artifacts}`
35
- as a tool observation. Several spawn calls in one model turn run concurrently up to `maxConcurrent`.
36
- - With `workspace: 'worktree'`, a writing child gets a detached worktree created from `HEAD` in a
37
- temp directory. Creation requires a clean parent working tree and parent Git write. The worktree is
38
- recorded as a `git-worktree` artifact and is never merged back.
39
- - Subagents never get a shell: `canRunCommands` in `src/graphs.ts` returns false for every child,
40
- including in worktrees, and the QA tools follow the same rule.
41
- - The preset Orchestrator completes with a single outcome, `completed`, but nothing enforces that: the
42
- graph builder lets an author switch it to `completion.mode: 'outcomes'` with their own outcome
43
- names (`src/graph-ui/app.js`). Its output is validated against one `outputSchema` whatever the
44
- outcome (`src/graph-runner.ts`); the preset schema is closed and requires the handoff fields
45
- (`validateOrchestratorContracts`, `src/graphs.ts`).
46
- - Before completing, the Orchestrator must have clarified with the user (`ask_user`), published a
47
- plan (`update_todos`) and observed research (`orchestratorCompletionGuard`). Headless runs stop with
48
- `needs_clarification`.
49
- - The intake ceiling is checked against roles only while spawning is enabled (`subagents.enabled`
50
- and `maxSubagents !== 0`). A saved Orchestrator with spawning off can already carry writing roles.
51
- - `DEFAULT_HARNESS_REVISION_5` and the current default harness are built from
52
- `createOrchestratorNode()` at load time; only revisions 1–4 are literal snapshots.
53
- - The Orchestrator is a Premium feature (`src/graph-quota.ts`).
54
-
55
- ## Goals
56
-
57
- 1. **A no-code lead.** The Orchestrator never edits files, runs a shell or commits, whatever model it
58
- runs on. It reads, decides and delegates.
59
- 2. **Writing subagents.** An Orchestrator can be configured with roles that write code. Each role's
60
- model is set in the graph builder through the existing Model policy (one model for all subagents,
61
- or one per role).
62
- 3. **Parallel writers.** Several writing subagents run at once, bounded by the existing
63
- "Max concurrent" setting on the Orchestrator.
64
- 4. **Review.** When a writing subagent finishes, the Orchestrator sees what it changed (the diff), the
65
- commands and tests it ran with their results, and can read the changed files before deciding.
66
- 5. **Landing.** Changes the Orchestrator accepts land in the user's working folder automatically, as
67
- uncommitted edits. Changes it rejects are discarded.
68
- 6. **Fix loop.** When work is wrong or incomplete, the Orchestrator spawns subagents to fix it, with
69
- its review findings in their task, and reviews again. The loop is bounded by "Max total per node
70
- run".
71
- 7. **Routing.** The Orchestrator reports which path it took, and the graph author routes each path in
72
- the graph builder.
73
-
74
- ## Non-goals
75
-
76
- - Live management of a running child: no status polling, mid-task messages or per-child cancel. The
77
- existing call-and-return `spawn_subagent` (with concurrent batches) is enough.
78
- - The Orchestrator choosing models at run time. Models come from the graph.
79
- - Committing, pushing or opening pull requests from the Orchestrator.
80
- - Changing ordinary (non-Orchestrator) Agent nodes' subagent behavior.
81
- - Changing the bundled default harness or any frozen revision (`DEFAULT_HARNESS_REVISION_*`).
82
-
83
- ## Anti-goals (a failure even if it technically works)
84
-
85
- - The Orchestrator writing code itself through a back door (for example by passing file contents to
86
- a "land" tool, or by running `git apply` with text it composed).
87
- - An existing graph changing behavior, failing to load, or failing validation after this ships.
88
- - Parallel writers overwriting each other's work in the working folder.
89
- - A failed or rejected subagent leaving partial edits in the working folder.
90
- - Asking the user to review every change before it lands.
91
-
92
- ## Design
93
-
94
- ### 1. Turning it on
95
-
96
- Delegation is on for an Orchestrator when spawning is enabled (`subagents.enabled` and
97
- `maxSubagents !== 0`) and its subagent policy has at least one **writing role** (a role whose
98
- capabilities include filesystem `read-write` or Git `write`). An Orchestrator with no writing roles,
99
- or with spawning off, behaves exactly as today. No existing graph has writing roles with spawning on,
100
- because validation rejects that combination today.
101
-
102
- *Designer's call:* delegation requires the Orchestrator's completion to be in `single` mode.
103
- Combining it with author-declared outcomes (`completion.mode: 'outcomes'`) is refused at
104
- validation with a message that names the conflict. This can be relaxed later.
105
-
106
- The Orchestrator then gets two completion outcomes:
107
-
108
- - `completed` keeps today's meaning: intake finished and the requirements are handed onward. The
109
- name is unchanged so existing edges keep routing.
110
- - `delivered` (new): the work was done by subagents, reviewed, and landed.
111
-
112
- The graph author draws a route for each outcome in the graph builder. If the graph has no route for
113
- `delivered`, the Orchestrator is not offered the delivery path at run time: writing roles are refused
114
- at spawn exactly as they are today, and it cannot complete as `delivered`. A graph that has writing
115
- roles but no `delivered` route still behaves like intake. The `delivered` outcome should not be
116
- required to have a route (`requireRoutes: false` semantics for that outcome only, or equivalent).
117
-
118
- ### 2. Choosing a path per prompt
119
-
120
- The Orchestrator decides from the prompt whether to hand off or deliver. Clarification is unchanged
121
- in both paths: it researches, asks the user its questions with `ask_user`, and publishes its plan
122
- with `update_todos` before any writing subagent starts. Headless runs still stop with
123
- `needs_clarification`.
124
-
125
- - Completing as `completed` requires today's handoff output (`taskInstruction`, `requirements`, …).
126
- - Completing as `delivered` requires: no child still running, at least one accepted change landed,
127
- and no reviewed change left undecided.
128
-
129
- *Designer's call:* `delivered` uses the same `outputSchema` as `completed`. There are no
130
- per-outcome schemas. The handoff fields keep their meaning (`requirements`, `acceptanceCriteria`,
131
- `designConsiderations`, `codebaseFindings`), and `taskInstruction` says what landed and what is left
132
- to verify, so a downstream Agent fed by `ORCHESTRATOR_HANDOFF` works unchanged. The full delivery
133
- record (each change: role, model, files, accepted or discarded, conflicts) is written as an artifact
134
- and referenced from the completion.
135
-
136
- ### 3. Two ceilings instead of one
137
-
138
- Split what the Orchestrator may do from what its children may do:
139
-
140
- - **Orchestrator's own capabilities:** always `intakeCapabilities`, as today. No Write/Edit, no
141
- shell, no commits.
142
- - **Delegation ceiling:** the node's configured `capabilities`. Writing roles are validated against
143
- this ceiling instead of the intake ceiling, in both graph validation (`src/graphs.ts`) and the
144
- spawn-time check (`src/agent-execution.ts`). Read-only roles keep working as today.
145
-
146
- Writing roles on an Orchestrator require `workspace: 'worktree'`. `shared-write` is refused for an
147
- Orchestrator, even with `maxConcurrent: 1`, because only worktrees give the review-then-land step a
148
- clean diff and keep rejected work out of the working folder.
149
-
150
- The Orchestrator's node needs Git `write` in its configured capabilities to create worktrees. That
151
- grant applies to the delegation ceiling only; the Orchestrator itself still has no Git write tool.
152
-
153
- ### 4. Worktrees start from the working folder as it stands
154
-
155
- Today a worktree starts from `HEAD` and requires a clean working tree. That breaks delegation: after
156
- the first change lands, the folder has uncommitted edits, and later subagents must build on them.
157
-
158
- For Orchestrator delegation, each writing child's worktree starts from a snapshot of the working
159
- folder at spawn time, including uncommitted and untracked (non-ignored) files, without modifying the
160
- working folder, the index, refs or stash. The clean-tree requirement is dropped for this path only.
161
- The snapshot mechanism is the builder's call (for example a temporary index plus `git write-tree`
162
- and `git commit-tree`, kept under a private ref until cleanup).
163
-
164
- The worktree approval prompt (`spawn_subagent.worktree`) still applies under the user's permission
165
- mode.
166
-
167
- ### 5. Review
168
-
169
- When a writing child finishes, its `spawn_subagent` result also carries a change record: an id, the
170
- list of changed files, and the diff against the child's snapshot (truncated past a size limit, with
171
- the full diff available through `read_artifact`). The Orchestrator can read files inside the child's
172
- worktree with its normal read tools, scoped read-only to that worktree, to inspect the result in
173
- context.
174
-
175
- A child that failed, was cancelled, or produced no changes yields no change to land, and its
176
- worktree is discarded.
177
-
178
- ### 6. Landing
179
-
180
- Two new Orchestrator-only tools act on a change record by id:
181
-
182
- - `accept_change(id)`: Andorra applies the child's diff to the working folder with a three-way
183
- merge against the child's snapshot. On success the files land as uncommitted edits. On conflict,
184
- nothing is written to the working folder, and the tool returns the conflicting files and hunks so
185
- the Orchestrator can spawn a subagent to redo or reconcile the work on top of the current folder.
186
- - `discard_change(id)`: the change is dropped and its worktree removed.
187
-
188
- The Orchestrator passes only an id. It never supplies file contents, patches or commands, so it
189
- cannot use these tools to write code itself.
190
-
191
- *Designer's call on approvals.* The user asked for accepted changes to land automatically, so landing
192
- must not prompt per change in any permission mode that already auto-approves in-workspace file
193
- writes (`workspace-policy`, `src/tools.ts`). It follows that same rule: no prompt where an Edit
194
- inside the workspace would not prompt, and a prompt where it would. Worktree setup is a host
195
- operation and still goes through `approveOperation`, but outside Full Access it asks once per
196
- Orchestrator node visit, not once per spawn: the first writing spawn's grant covers that visit's
197
- worktrees. The Orchestrator's reads inside its children's worktrees are treated as reads inside a
198
- trusted root, so they do not prompt as "outside the workspace."
199
-
200
- Accepting changes from two children that touched the same files is allowed; the second accept
201
- merges against the current folder and either lands or reports a conflict.
202
-
203
- ### 7. The fix loop
204
-
205
- After review, the Orchestrator either accepts, discards, or spawns a fix subagent. A fix subagent
206
- gets a normal task that includes the Orchestrator's findings. It starts from the current folder
207
- snapshot, so a fix can build on an accepted change, or redo a discarded one. Every spawn counts
208
- toward "Max total per node run"; when it is used up, the Orchestrator must finish with what it has
209
- or report that it could not complete.
210
-
211
- ### 8. Checking that the work runs
212
-
213
- **Decided by the user: writing subagents get a shell inside their own worktree.**
214
-
215
- - A writing role on a delegating Orchestrator, running in `workspace: 'worktree'`, may have
216
- `shell: 'allowed'` when the Orchestrator's delegation ceiling allows it. That role then gets the
217
- command tools (`Bash` / `PowerShell` and the related process tools) and the QA tools, with the
218
- working directory set to its own worktree.
219
- - `canRunCommands` (`src/graphs.ts`) stops refusing every child. It permits these children
220
- specifically, and keeps refusing every other child: read-only roles, shared-workspace children,
221
- and children of ordinary Agent nodes. Graph validation and the spawn-time check use the same rule.
222
- - The shell is not sandboxed. Starting in the worktree is a working directory, not a boundary.
223
- Commands go through the same approval rules as the main agent's shell under the user's permission
224
- mode, and the approval prompt names the subagent and its worktree. Several parallel subagents in an
225
- asking mode can each prompt; that is accepted.
226
- - A subagent reports the commands it ran and their results in its completion (for example tests run,
227
- pass/fail). The Orchestrator sees that report next to the diff and uses it in its review. A failure
228
- report is grounds to spawn a fix.
229
- - The Orchestrator itself still has no shell.
230
- - The graph builder's subagent help text, which today says "Subagents never receive the unsandboxed
231
- host shell, including in worktrees" (`src/graph-ui/app.js`), changes to describe the exception
232
- accurately.
233
- - A child with Git `write` may commit inside its worktree. Landing uses the worktree's final file
234
- state against its snapshot, so commits made there do not change what lands, and nothing it
235
- commits reaches the user's branches.
236
-
237
- ### 9. Models
238
-
239
- No new setting. The Orchestrator's existing subagent Model policy covers it: "Use specific model"
240
- for one model across all subagents, or "Per-role model" to give coding and other roles different
241
- models. The Orchestrator's own model is its node model.
242
-
243
- ### 10. Graph builder
244
-
245
- - Writing roles become allowed on the Orchestrator's role editor when the Orchestrator's
246
- capabilities grant them; the help text explains that the Orchestrator itself still cannot write.
247
- - Selecting a writing role on an Orchestrator forces or requires "Separate Git worktree".
248
- - The Orchestrator node shows a `delivered` output port next to `completed` once it has a writing
249
- role.
250
- - Validation messages name the fix (for example "writing roles on an Orchestrator require separate
251
- worktrees").
252
-
253
- ### 11. Desktop
254
-
255
- Subagents already appear nested under the Orchestrator's node visit. Each writing child's entry also
256
- shows its change state (pending review, landed, discarded, conflict). Visual treatment is the
257
- builder's call.
258
-
259
- ### 12. Cleanup and failure
260
-
261
- - Every worktree and snapshot ref created for a child is removed when its change is accepted or
262
- discarded, and when the Orchestrator's node ends for any reason (completion, failure, cancel,
263
- wall-time). Undecided changes at node end are discarded, and the run reports that.
264
- - A cancelled run leaves the working folder with only the changes already accepted.
265
-
266
- ## Constraints
267
-
268
- - Existing graphs, including the bundled default harness and frozen revisions, load, validate and run
269
- exactly as before.
270
- - `createOrchestratorNode()` must not change what it returns, because revision 5 and the current
271
- default harness are built from it at load time. Delegation is configured by the graph author on top
272
- of the preset. If the builder has to change the preset, it first freezes revisions 5 and 6 as
273
- literal snapshots, the way revisions 1–4 are.
274
- - The Orchestrator remains Premium (`src/graph-quota.ts`).
275
- - Per `AGENTS.md`, the feature ships with a QA plan at `tests/orchestrator-delegation-test-plan.md`.
276
- - Works on Windows (the primary dev machine) and POSIX; Git operations go through the same hardened
277
- options the worktree path uses today (`core.hooksPath=`, `core.fsmonitor=false`).
278
-
279
- ## Left to the builder
280
-
281
- - The exact schema of the `delivered` output and of the change record.
282
- - The snapshot mechanism for worktree bases, and the diff size limit.
283
- - How `delivered` is excluded when it has no route (tool enum, completion guard, or both).
284
- - How resume behaves when a run is resumed with children mid-flight or changes undecided (the safe
285
- default is to discard undecided changes and tell the Orchestrator).
286
- - Whether the Jev decision layer needs to know about the new tools.
287
- - Desktop presentation of change states.
288
-
289
- ## Open questions
290
-
291
- None. The user chose a worktree-scoped shell for writing subagents (section 8).