@andorra-labs/code 0.1.16 → 0.1.18

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 (236) hide show
  1. package/dist/src/acp-agent.d.ts +6 -0
  2. package/dist/src/acp-agent.js +15 -4
  3. package/dist/src/agent-execution.js +108 -19
  4. package/dist/src/agent-mcp-catalog.js +1 -0
  5. package/dist/src/agent-mcp.d.ts +3 -0
  6. package/dist/src/agent-mcp.js +33 -1
  7. package/dist/src/andorra/entry.d.ts +10 -0
  8. package/dist/src/andorra/entry.js +18 -4
  9. package/dist/src/andorra/errors.js +3 -0
  10. package/dist/src/andorra/hosted.d.ts +2 -1
  11. package/dist/src/andorra/hosted.js +2 -1
  12. package/dist/src/andorra/notices.d.ts +5 -0
  13. package/dist/src/andorra/notices.js +7 -0
  14. package/dist/src/andorra/state.d.ts +3 -2
  15. package/dist/src/andorra/state.js +4 -4
  16. package/dist/src/andorra/terminal.js +7 -2
  17. package/dist/src/anthropic-credentials.js +2 -0
  18. package/dist/src/app-server/error.d.ts +5 -0
  19. package/dist/src/app-server/error.js +7 -0
  20. package/dist/src/app-server/protocol.d.ts +30 -44
  21. package/dist/src/app-server/protocol.js +5 -1
  22. package/dist/src/app-server/workspace.d.ts +108 -0
  23. package/dist/src/app-server/workspace.js +608 -11
  24. package/dist/src/app-server.d.ts +390 -33
  25. package/dist/src/app-server.js +3033 -565
  26. package/dist/src/attachments.d.ts +10 -0
  27. package/dist/src/attachments.js +102 -7
  28. package/dist/src/automation-tool.js +2 -1
  29. package/dist/src/bridge/cloud.d.ts +27 -0
  30. package/dist/src/bridge/cloud.js +187 -0
  31. package/dist/src/bridge/command.d.ts +30 -0
  32. package/dist/src/bridge/command.js +359 -0
  33. package/dist/src/bridge/control.d.ts +70 -0
  34. package/dist/src/bridge/control.js +238 -0
  35. package/dist/src/bridge/engines.d.ts +90 -0
  36. package/dist/src/bridge/engines.js +601 -0
  37. package/dist/src/bridge/github.d.ts +108 -0
  38. package/dist/src/bridge/github.js +378 -0
  39. package/dist/src/bridge/host-ops.d.ts +9 -0
  40. package/dist/src/bridge/host-ops.js +139 -0
  41. package/dist/src/bridge/host.d.ts +47 -0
  42. package/dist/src/bridge/host.js +543 -0
  43. package/dist/src/bridge/link.d.ts +38 -0
  44. package/dist/src/bridge/link.js +508 -0
  45. package/dist/src/bridge/login-link.d.ts +29 -0
  46. package/dist/src/bridge/login-link.js +54 -0
  47. package/dist/src/bridge/protocol.d.ts +136 -0
  48. package/dist/src/bridge/protocol.js +11 -0
  49. package/dist/src/bridge/store.d.ts +12 -0
  50. package/dist/src/bridge/store.js +61 -0
  51. package/dist/src/bridge/wording.d.ts +6 -0
  52. package/dist/src/bridge/wording.js +10 -0
  53. package/dist/src/browser-server.js +7 -1
  54. package/dist/src/browser-ui/tokens.css +1 -1
  55. package/dist/src/bug-report-attachments.d.ts +48 -0
  56. package/dist/src/bug-report-attachments.js +327 -0
  57. package/dist/src/bug-report.d.ts +23 -3
  58. package/dist/src/bug-report.js +72 -9
  59. package/dist/src/change-authors.d.ts +41 -0
  60. package/dist/src/change-authors.js +146 -0
  61. package/dist/src/cli.d.ts +1 -3
  62. package/dist/src/cli.js +191 -35
  63. package/dist/src/codex-provider.js +1 -1
  64. package/dist/src/coding-tools.js +24 -17
  65. package/dist/src/command-screens.d.ts +6 -0
  66. package/dist/src/command-screens.js +14 -11
  67. package/dist/src/commands.d.ts +15 -3
  68. package/dist/src/commands.js +2 -1
  69. package/dist/src/compaction-phrases.js +1 -1
  70. package/dist/src/completion.js +89 -8
  71. package/dist/src/config.d.ts +71 -3
  72. package/dist/src/config.js +205 -78
  73. package/dist/src/context-budget.js +15 -2
  74. package/dist/src/deadline.js +13 -1
  75. package/dist/src/decision/DecisionEngine.d.ts +2 -0
  76. package/dist/src/decision/DecisionManager.d.ts +11 -0
  77. package/dist/src/decision/DecisionManager.js +36 -0
  78. package/dist/src/decision/applyTaskKind.d.ts +8 -0
  79. package/dist/src/decision/applyTaskKind.js +53 -0
  80. package/dist/src/decision/checks.js +1 -1
  81. package/dist/src/decision/hostedPolicy.js +2 -1
  82. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +2 -0
  83. package/dist/src/decision/providers/AndorraDecisionProvider.js +12 -0
  84. package/dist/src/decision/requestPhrases.js +0 -1
  85. package/dist/src/decision/taskKind.d.ts +52 -0
  86. package/dist/src/decision/taskKind.js +76 -0
  87. package/dist/src/decision/types.d.ts +1 -1
  88. package/dist/src/default-graph.js +1 -1
  89. package/dist/src/efficiency.d.ts +5 -0
  90. package/dist/src/efficiency.js +5 -1
  91. package/dist/src/effort-routing.d.ts +27 -0
  92. package/dist/src/effort-routing.js +34 -0
  93. package/dist/src/evidence.d.ts +110 -0
  94. package/dist/src/evidence.js +195 -0
  95. package/dist/src/file-diff.d.ts +4 -0
  96. package/dist/src/file-diff.js +2 -1
  97. package/dist/src/github-app/agent-writes.d.ts +102 -0
  98. package/dist/src/github-app/agent-writes.js +320 -0
  99. package/dist/src/github-app/client.d.ts +368 -0
  100. package/dist/src/github-app/client.js +830 -0
  101. package/dist/src/github-app/event-source.d.ts +208 -0
  102. package/dist/src/github-app/event-source.js +684 -0
  103. package/dist/src/github-app/metrics.d.ts +32 -0
  104. package/dist/src/github-app/metrics.js +49 -0
  105. package/dist/src/github-app/review-loop.d.ts +274 -0
  106. package/dist/src/github-app/review-loop.js +1177 -0
  107. package/dist/src/github-app/review-node.d.ts +81 -0
  108. package/dist/src/github-app/review-node.js +205 -0
  109. package/dist/src/github-app/review-post.d.ts +73 -0
  110. package/dist/src/github-app/review-post.js +139 -0
  111. package/dist/src/github-app/review-text.d.ts +107 -0
  112. package/dist/src/github-app/review-text.js +1133 -0
  113. package/dist/src/github-app/review-threads.d.ts +47 -0
  114. package/dist/src/github-app/review-threads.js +107 -0
  115. package/dist/src/github-app/reviewer.d.ts +121 -0
  116. package/dist/src/github-app/reviewer.js +598 -0
  117. package/dist/src/github-app/store.d.ts +59 -0
  118. package/dist/src/github-app/store.js +148 -0
  119. package/dist/src/github-app/triggers.d.ts +141 -0
  120. package/dist/src/github-app/triggers.js +441 -0
  121. package/dist/src/github-names.d.ts +15 -0
  122. package/dist/src/github-names.js +15 -0
  123. package/dist/src/glob-search.d.ts +61 -0
  124. package/dist/src/glob-search.js +180 -0
  125. package/dist/src/graph-health.js +6 -1
  126. package/dist/src/graph-manager-chat.js +1 -1
  127. package/dist/src/graph-preview.d.ts +48 -0
  128. package/dist/src/graph-preview.js +56 -0
  129. package/dist/src/graph-provider-portability.js +2 -1
  130. package/dist/src/graph-runner.js +65 -4
  131. package/dist/src/graph-server.js +7 -5
  132. package/dist/src/graph-sync.js +3 -3
  133. package/dist/src/graph-ui/app.js +121 -7
  134. package/dist/src/graph-ui/icons.js +2 -1
  135. package/dist/src/graph-ui/studio.js +15 -1
  136. package/dist/src/graph-ui/tokens.css +1 -1
  137. package/dist/src/graphs.d.ts +40 -1
  138. package/dist/src/graphs.js +164 -15
  139. package/dist/src/hardened-runtime.js +32 -21
  140. package/dist/src/image-input.d.ts +16 -0
  141. package/dist/src/image-input.js +41 -0
  142. package/dist/src/membership.d.ts +10 -0
  143. package/dist/src/membership.js +19 -4
  144. package/dist/src/model-health-cache.js +1 -1
  145. package/dist/src/model-metadata.d.ts +6 -0
  146. package/dist/src/model-metadata.js +35 -15
  147. package/dist/src/model-override.d.ts +2 -1
  148. package/dist/src/model-override.js +9 -0
  149. package/dist/src/model-relay/local.d.ts +116 -0
  150. package/dist/src/model-relay/local.js +468 -0
  151. package/dist/src/model-relay/remote.d.ts +129 -0
  152. package/dist/src/model-relay/remote.js +252 -0
  153. package/dist/src/model-relay/runs.d.ts +34 -0
  154. package/dist/src/model-relay/runs.js +146 -0
  155. package/dist/src/model-relay/wire.d.ts +5 -0
  156. package/dist/src/model-relay/wire.js +5 -0
  157. package/dist/src/model-tiers.d.ts +3 -0
  158. package/dist/src/model-tiers.js +3 -3
  159. package/dist/src/project-registry.d.ts +21 -0
  160. package/dist/src/project-registry.js +74 -0
  161. package/dist/src/provider-engine.d.ts +13 -1
  162. package/dist/src/provider-engine.js +74 -0
  163. package/dist/src/provider-import.d.ts +0 -12
  164. package/dist/src/provider-import.js +7 -195
  165. package/dist/src/providers.d.ts +28 -2
  166. package/dist/src/providers.js +59 -12
  167. package/dist/src/pull-request-logs.d.ts +12 -1
  168. package/dist/src/pull-request-logs.js +14 -3
  169. package/dist/src/pull-requests.d.ts +338 -8
  170. package/dist/src/pull-requests.js +482 -53
  171. package/dist/src/react-runtime.js +99 -16
  172. package/dist/src/remote/engine-pool.d.ts +88 -4
  173. package/dist/src/remote/engine-pool.js +367 -90
  174. package/dist/src/remote/roots.d.ts +19 -0
  175. package/dist/src/remote/roots.js +45 -7
  176. package/dist/src/remote/types.d.ts +0 -44
  177. package/dist/src/run-control.d.ts +7 -0
  178. package/dist/src/run-control.js +23 -0
  179. package/dist/src/run-records.d.ts +7 -2
  180. package/dist/src/run-records.js +71 -6
  181. package/dist/src/runtime.d.ts +34 -2
  182. package/dist/src/runtime.js +18 -2
  183. package/dist/src/session-changes.d.ts +35 -0
  184. package/dist/src/session-changes.js +194 -6
  185. package/dist/src/session-monitor.js +2 -1
  186. package/dist/src/session-reaper.d.ts +1 -1
  187. package/dist/src/session-reaper.js +6 -1
  188. package/dist/src/session-summary.d.ts +2 -1
  189. package/dist/src/session-summary.js +2 -1
  190. package/dist/src/sessions.d.ts +35 -1
  191. package/dist/src/sessions.js +70 -4
  192. package/dist/src/skills/bundled/bug-report/SKILL.md +51 -7
  193. package/dist/src/skills/bundled/diagram/SKILL.md +5 -3
  194. package/dist/src/skills/bundled/graph-manager/SKILL.md +7 -4
  195. package/dist/src/skills/bundled/provenance.json +3 -3
  196. package/dist/src/skills/runtime-skills.js +1 -1
  197. package/dist/src/task-checkout.d.ts +141 -0
  198. package/dist/src/task-checkout.js +558 -0
  199. package/dist/src/telemetry/emitter.d.ts +15 -0
  200. package/dist/src/telemetry/emitter.js +35 -1
  201. package/dist/src/telemetry/schema.d.ts +25 -2
  202. package/dist/src/telemetry/schema.js +52 -4
  203. package/dist/src/telemetry/surface.d.ts +2 -1
  204. package/dist/src/telemetry/surface.js +4 -1
  205. package/dist/src/terminal-ui.d.ts +1 -0
  206. package/dist/src/terminal-ui.js +10 -3
  207. package/dist/src/test-edit-guard.d.ts +37 -0
  208. package/dist/src/test-edit-guard.js +216 -3
  209. package/dist/src/thinking-level-detect.d.ts +11 -0
  210. package/dist/src/thinking-level-detect.js +47 -0
  211. package/dist/src/thinking-levels.d.ts +30 -0
  212. package/dist/src/thinking-levels.js +124 -0
  213. package/dist/src/timers.d.ts +3 -0
  214. package/dist/src/tool-catalog.js +1 -1
  215. package/dist/src/tools.js +59 -9
  216. package/dist/src/transcript.js +1 -1
  217. package/dist/src/types.d.ts +34 -0
  218. package/package.json +6 -1
  219. package/dist/src/remote/cert.d.ts +0 -11
  220. package/dist/src/remote/cert.js +0 -87
  221. package/dist/src/remote/client.d.ts +0 -119
  222. package/dist/src/remote/client.js +0 -544
  223. package/dist/src/remote/command.d.ts +0 -4
  224. package/dist/src/remote/command.js +0 -194
  225. package/dist/src/remote/errors.d.ts +0 -11
  226. package/dist/src/remote/errors.js +0 -14
  227. package/dist/src/remote/network.d.ts +0 -22
  228. package/dist/src/remote/network.js +0 -102
  229. package/dist/src/remote/pairing.d.ts +0 -63
  230. package/dist/src/remote/pairing.js +0 -299
  231. package/dist/src/remote/pem.d.ts +0 -2
  232. package/dist/src/remote/pem.js +0 -7
  233. package/dist/src/remote/serve.d.ts +0 -68
  234. package/dist/src/remote/serve.js +0 -244
  235. package/dist/src/remote/server.d.ts +0 -21
  236. package/dist/src/remote/server.js +0 -406
@@ -9,7 +9,7 @@ This sends a bug report about **Andorra Code itself** (the terminal app, the des
9
9
  models, tools) to the Andorra team. It is not for bugs in the user's own project: if that is what they
10
10
  describe, say so and help with the project instead.
11
11
 
12
- You send the report with the `submit_bug_report` tool. The tool shows the user the exact text and sends it
12
+ You send the report with the `submit_bug_report` tool. The tool shows the user the exact report and sends it
13
13
  only when they choose **Send report**, so you never send anything they have not read.
14
14
 
15
15
  ## Before you ask anything
@@ -23,6 +23,29 @@ only when they choose **Send report**, so you never send anything they have not
23
23
  - Use what the user already told you, in this message and earlier in the conversation. Do not ask again
24
24
  for something they have said.
25
25
 
26
+ ## Which session has the problem
27
+
28
+ A report about something that went wrong in a session carries that session's graph and a compressed
29
+ trajectory, so the team can see what ran. Find out which session it is before you write anything:
30
+
31
+ 1. Call `list_bug_report_sessions`. It returns the session this conversation is in (`current`, with its
32
+ name) and the most recent other sessions, each with an id, a name and a date. It only reads this
33
+ machine; nothing is sent.
34
+ 2. Ask the user one question, with these three answers:
35
+ - **This session**, named by the name the tool gave ("This session: Fix the login redirect").
36
+ - **Another session**. Then ask which one, offering the names from `others`. If theirs is not listed,
37
+ ask for something to recognise it by and pick the match; if none matches, say so and ask whether to
38
+ send without a session.
39
+ - **Not a session problem**: a bug in the program itself, such as the app not starting, sign-in,
40
+ settings, an update or a window that will not open.
41
+ 3. Remember the answer as the `session` you pass to `submit_bug_report`: `current`, the other session's
42
+ `id`, or `none`.
43
+
44
+ Ask even when the answer looks obvious: the user may be reporting from a fresh conversation about a
45
+ session that broke earlier. Skip the question only when they have already said which session it is. If
46
+ `current` is `null`, this conversation is not saved as a session yet, so offer only another session or
47
+ "not a session problem".
48
+
26
49
  ## The interview
27
50
 
28
51
  Ask one question at a time, in plain words, and wait for each answer. Use `ask_user` when you have it;
@@ -35,12 +58,12 @@ otherwise ask in your reply and continue when they answer. Skip a question whose
35
58
  3. **What they expected** to happen instead.
36
59
  4. **How often and since when**, if it is not already clear: every time or sometimes, and whether it
37
60
  worked before (an update, a new setting, a different model).
38
- 5. **Anything else that helps**: which model or graph, the terminal app or the desktop app, a screenshot
61
+ 5. **Anything else that helps**: which model, the terminal app or the desktop app, a screenshot
39
62
  described in words.
40
63
 
41
64
  Stop asking once you can write a report someone else could act on. Three or four questions is usual; do
42
- not go through the list for its own sake, and do not ask for the app version or operating system (the
43
- tool attaches those).
65
+ not go through the list for its own sake, and do not ask for the app version, the operating system or
66
+ which graph ran (the tool attaches those).
44
67
 
45
68
  ## Write the report
46
69
 
@@ -50,6 +73,19 @@ tool attaches those).
50
73
  "Happened once", and what changed recently if they said.
51
74
  - `steps`: numbered steps. Leave it out if the user does not know them.
52
75
  - `expected` and `actual`: one or two sentences each.
76
+ - `session`: `current`, another session's id, or `none`, from the answer above.
77
+
78
+ The graph and the trajectory are not yours to write. When `session` names a session, the tool reads them
79
+ from that session's own record and attaches:
80
+
81
+ - **The affected graph**: the graph the session last ran, as its nodes, settings, tools and routes. The
82
+ text of each instruction and prompt is replaced by its length.
83
+ - **A compressed trajectory**: each run as a short list of steps (which node ran, which tools, how long,
84
+ retries, refused completions, how the run stopped) with the first 200 characters of each error. It
85
+ holds no prompt, no model reply, no tool arguments and no output of a tool that succeeded.
86
+
87
+ Do not paste a graph, a trajectory, a log or a transcript into `description` yourself: the attachments
88
+ are bounded and cleaned, and what you paste is not.
53
89
 
54
90
  Rules for the text:
55
91
 
@@ -65,16 +101,24 @@ Rules for the text:
65
101
 
66
102
  ## Send it
67
103
 
68
- Call `submit_bug_report` once with the fields above. Then:
104
+ Call `submit_bug_report` once with the fields above. The tool then asks the user the final question
105
+ itself: it shows the whole report, the graph and the trajectory in full when a session is attached, and
106
+ closes with how the report is used: only to debug the problem, kept in the Andorra team's private bug
107
+ tracker, and never used to train models. That confirmation is the user's decision to send or not. Do not
108
+ ask "shall I send it?" yourself before calling the tool, and do not restate or reword the assurance: the
109
+ tool's wording is the one the team stands behind. If the user asks about it, tell them exactly that and
110
+ no more; do not promise that the report is deleted, or anything else the confirmation does not say.
111
+
112
+ Then:
69
113
 
70
114
  - `sent: true`: give the user the `reference` (for example `BR-1234`) and thank them. There is no page to
71
115
  open: the tracker is private, so do not offer a link or promise a reply.
72
116
  - `sent: false` with a `userReply`: they want a change. Make it and call the tool again so they confirm
73
- the new text.
117
+ the new text. If they do not want the graph or trajectory sent, call again with `session` set to `none`.
74
118
  - `sent: false` without one: they chose not to send. Say nothing was sent and stop.
75
119
  - An error: tell the user what it said in plain words. Signed out: they sign in and run `/bug-report`
76
120
  again. Daily limit reached: say when they can send it. Service unavailable: say so; do not retry in a
77
- loop.
121
+ loop. No such session: call `list_bug_report_sessions` again and ask which one they meant.
78
122
 
79
123
  Send one report per problem. If the user describes two separate bugs, finish the first, then ask whether
80
124
  to report the second.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: diagram
3
- description: "Draw a UML-style diagram in a reply instead of hand-typed arrows. Use when about to describe or explain a graph, process, routing, state machine, call sequence, data model or code structure to the user, including when reviewing an Andorra graph."
3
+ description: "Draw a UML-style diagram in a reply instead of hand-typed arrows. Use when about to describe or explain a graph, process, routing, state machine, call sequence, data model or code structure to the user. An Andorra graph is shown with the graphs tool's andorra_graph_show action instead."
4
4
  ---
5
5
 
6
6
  # Explain with a diagram
@@ -67,8 +67,10 @@ and the rest) do not.
67
67
  ### A workflow graph (state machine)
68
68
 
69
69
  Nodes are states, outcome routes are transitions, `[*]` is where a run starts and ends. Declare a readable
70
- name once with `state "..." as id`. This is the form for describing an Andorra graph: read it with the graph
71
- tools first (see the `graph-manager` skill), then draw each node and each route once.
70
+ name once with `state "..." as id`. An Andorra graph saved in the account is not drawn this way: the `graphs`
71
+ tool's `andorra_graph_show` action draws it as the Graph Editor does (see the `graph-manager` skill). Use a
72
+ state diagram for any other workflow, or for an Andorra graph only where that tool is not available, drawing
73
+ each node and each route once.
72
74
 
73
75
  ```mermaid
74
76
  stateDiagram-v2
@@ -58,9 +58,12 @@ What you need to know:
58
58
  Build it with the "Pull request with review fixes" pattern in `patterns.md`: that agent switches Auto-fix on
59
59
  itself and loops on the reviews, and the graph's entry stays where it is.
60
60
 
61
- Then sketch the nodes and routes. When the `diagram` skill is in your catalog, load it and draw the sketch
62
- as a state diagram instead; do the same whenever you describe or review an existing graph for the user.
63
- The plain-text form, for a host that has no such skill:
61
+ Then sketch the nodes and routes. To show the user a graph, call the `andorra_graph_show` action: with
62
+ `draftId` for a draft you are building, or with `id` (and `revision`, if not the latest) for a published graph.
63
+ The Andorra desktop app draws it in the chat the way the Graph Editor does, so do not also draw it as a
64
+ diagram or retype it as arrows. Do the same whenever you describe or review an existing graph for the user.
65
+ The reply's `note` says whether the host draws it. Where nothing does (a terminal, another MCP client), put
66
+ the reply's plain-text `sketch` in your message; it reads like this:
64
67
 
65
68
  ```
66
69
  plan (agent) --completed--> build (agent) --completed--> review (agent)
@@ -135,7 +138,7 @@ and the upsert reply's `placed` says where it went.
135
138
  - each route added or removed, and any change to the entry or the limits;
136
139
  - what a run of the graph will now do that it did not before, including anything the user did not ask for
137
140
  that the change brings with it;
138
- - the updated diagram, when the `diagram` skill is available.
141
+ - the updated graph, shown with `andorra_graph_show` and the draft's `draftId` (see section 3).
139
142
  3. `andorra_graph_publish`. A `REVISION_CONFLICT` means someone saved a newer revision: begin a new edit draft
140
143
  from the latest, reapply your changes, validate and publish again.
141
144
  4. If the user stops partway, `andorra_graph_discard` the draft.
@@ -714,7 +714,7 @@
714
714
  {
715
715
  "source": "src/skills/bundled/graph-manager/SKILL.md",
716
716
  "asset": "graph-manager/SKILL.md",
717
- "sha256": "fcb0b27d6db360f402b2f6cb4a4bbecbfe7f670eec6b91ccb74aedaf21bfcb91"
717
+ "sha256": "cedffd79e4e632d62426758d8b50b6f0e8b2f5e30cc764efd1ff20fa40f3d6db"
718
718
  },
719
719
  {
720
720
  "source": "src/skills/bundled/graph-manager/errors.md",
@@ -729,12 +729,12 @@
729
729
  {
730
730
  "source": "src/skills/bundled/bug-report/SKILL.md",
731
731
  "asset": "bug-report/SKILL.md",
732
- "sha256": "20777e7df3e9a93e2062f681069d09a090b487268cf12a2f5359f989ab809e2d"
732
+ "sha256": "f5899f2bcb3e4c2f809673e4f2f40a138da3de4d3e7fa20cf33638003d521e01"
733
733
  },
734
734
  {
735
735
  "source": "src/skills/bundled/diagram/SKILL.md",
736
736
  "asset": "diagram/SKILL.md",
737
- "sha256": "2840d736a0001ca82dc002056648ac2b73bdc3f6ce3f710a3d1832a548bbd4dc"
737
+ "sha256": "17fbc15678e4163538adb5c4e4f234bfe9a90f3f6ce35b6c87b8a7773c4fd731"
738
738
  }
739
739
  ],
740
740
  "additionalCopyright": [
@@ -22,7 +22,7 @@ const bundled = [
22
22
  { id: 'andorra:bug-report', path: 'bug-report/SKILL.md', description: "Report a bug in Andorra Code to the Andorra team: ask the user what went wrong, write it up, and send it once they approve. Use when the user types /bug-report or says something in Andorra Code itself is broken and wants it reported.", source: 'bundled' },
23
23
  { id: 'andorra:write-instructions', path: 'write-instructions/SKILL.md', description: "Create or improve a repository's agent instructions (ANDORRA.md or AGENTS.md): build and test commands, conventions, and rules agents must follow. Use when the user wants agents to work the way their team does, or asks to set up or tighten project instructions.", source: 'bundled' },
24
24
  { id: 'andorra:graph-manager', path: 'graph-manager/SKILL.md', description: "Design, create, edit, delete or restore Andorra Code graphs (multi-agent pipelines) from the user's requirements, through Andorra's graph tools. Use when the user wants a new graph, wants to change how an existing graph routes work, or wants a graph removed or brought back.", source: 'bundled' },
25
- { id: 'andorra:diagram', path: 'diagram/SKILL.md', description: "Draw a UML-style diagram in a reply instead of hand-typed arrows. Use when about to describe or explain a graph, process, routing, state machine, call sequence, data model or code structure to the user, including when reviewing an Andorra graph.", source: 'bundled', loadWhen: 'before describing or explaining a graph, workflow, state machine, call sequence or code structure to the user' },
25
+ { id: 'andorra:diagram', path: 'diagram/SKILL.md', description: "Draw a UML-style diagram in a reply instead of hand-typed arrows. Use when about to describe or explain a graph, process, routing, state machine, call sequence, data model or code structure to the user. An Andorra graph is shown with the graphs tool's andorra_graph_show action instead.", source: 'bundled', loadWhen: 'before describing or explaining a graph, workflow, state machine, call sequence or code structure to the user' },
26
26
  ];
27
27
  export function bundledSkillCatalog() {
28
28
  return bundled.map(({ id, description, path, requiredTools }) => ({ id, description, path, ...(requiredTools ? { requiredTools: [...requiredTools] } : {}) }));
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Where a task works, recorded on its session. A writing task in a Git repository gets its own worktree on a task
3
+ * branch, started from a commit resolved when it began; an explicit choice, a Read Only task or a folder outside Git
4
+ * works in the project's own folder. The session stays filed under its project (`workspace`); this says where its
5
+ * agent, terminal, files, changes and checks run.
6
+ */
7
+ export interface SessionCheckout {
8
+ kind: 'worktree' | 'checkout' | 'folder';
9
+ /** The folder the task works in: the worktree (plus the project's place inside the repository), or the project folder. */
10
+ path: string;
11
+ /** The machine that holds the folder. */
12
+ host: string;
13
+ /** The task's branch: the worktree's own, or the branch checked out when an in-place task began. */
14
+ branch?: string;
15
+ /** What the task started from, as chosen: `main`, `feature/billing`. */
16
+ baseBranch?: string;
17
+ /** The ref that was resolved: `origin/main`, or the local branch. */
18
+ baseRef?: string;
19
+ baseCommit?: string;
20
+ /** The worktree's top, when the project sits below the repository's top. Defaults to `path`. */
21
+ worktree?: string;
22
+ createdAt: string;
23
+ /** Set once the lead removed the worktree; the branch may still hold its commits. */
24
+ removedAt?: string;
25
+ }
26
+ export interface TaskStartPoints {
27
+ repository: boolean;
28
+ current?: string;
29
+ /** Uncommitted files (tracked and untracked) in the project's checkout. */
30
+ dirty: number;
31
+ /** The repository's default branch, when one can be found. */
32
+ defaultBranch?: string;
33
+ /** The ref a worktree from the default branch starts at: `origin/main`, or `main` with no remote. */
34
+ defaultRef?: string;
35
+ /** When the remote was last fetched. */
36
+ fetchedAt?: string;
37
+ /** Local branches other than the default and the current one. */
38
+ branches: string[];
39
+ truncated?: boolean;
40
+ }
41
+ export interface PreparedTaskCheckout {
42
+ checkout: SessionCheckout;
43
+ /** The default branch was refreshed from its remote before the commit was resolved. */
44
+ refreshed?: boolean;
45
+ /** Why it could not be. */
46
+ refreshError?: string;
47
+ /** A retry found this start's worktree already made. */
48
+ reused?: boolean;
49
+ }
50
+ export declare class TaskCheckoutError extends Error {
51
+ }
52
+ /** The repository's top and where the project folder sits in it; undefined outside a repository. */
53
+ export declare function repositoryOf(root: string): Promise<{
54
+ top: string;
55
+ prefix: string;
56
+ commonDir: string;
57
+ } | undefined>;
58
+ /** What New Task offers to start from in `root`'s repository. */
59
+ export declare function taskStartPoints(root: string): Promise<TaskStartPoints>;
60
+ /** A task branch's name from the prompt: lower case, hyphens, at most 40 characters. */
61
+ export declare function taskSlug(text: string): string;
62
+ /**
63
+ * Where task worktrees go: `~/worktrees/<project>/<slug>`, outside Andorra's home, whose files the permission rules
64
+ * protect from the agent.
65
+ */
66
+ export declare function worktreesRoot(): string;
67
+ /** The folder a project's task worktrees go in. */
68
+ export declare function worktreesFolder(root: string, under?: string): string;
69
+ /** Forgets a start's preparation, once its task has begun or it was given up. */
70
+ export declare function forgetPrepared(home: string, key: string): Promise<void>;
71
+ /** The prepared checkout a run.start names, checked to belong to `root`'s repository. */
72
+ export declare function takePrepared(home: string, root: string, key: string): Promise<SessionCheckout>;
73
+ /**
74
+ * Makes a writing task's worktree: resolves `base` to a commit (refreshing the default branch from its remote first),
75
+ * then adds a worktree on a new `task/<slug>` branch in `~/worktrees/<project>`. Names stay distinct across simultaneous
76
+ * starts. The same `key` returns the same worktree while it still stands, so a retried start reuses its preparation.
77
+ */
78
+ export declare function prepareTaskWorktree(options: {
79
+ home: string;
80
+ root: string;
81
+ base: string;
82
+ slug: string;
83
+ key: string;
84
+ worktrees?: string;
85
+ }): Promise<PreparedTaskCheckout>;
86
+ /** What an in-place task records: the project folder, and the branch and commit it began on. */
87
+ export declare function inPlaceCheckout(root: string): Promise<SessionCheckout>;
88
+ export declare function checkoutTop(checkout: SessionCheckout): string;
89
+ export type CheckoutState = {
90
+ state: 'ok';
91
+ } | {
92
+ state: 'missing' | 'moved' | 'removed' | 'other-host';
93
+ reason: string;
94
+ };
95
+ /** Whether a task's recorded worktree is still where it was, a worktree of `root`'s repository. */
96
+ export declare function checkoutState(checkout: SessionCheckout, root: string): Promise<CheckoutState>;
97
+ /** Adds the worktree back at its recorded place from the task branch, which keeps every commit the task made. */
98
+ export declare function recreateTaskWorktree(checkout: SessionCheckout, root: string): Promise<SessionCheckout>;
99
+ /** Takes a folder the lead picked as the task's moved worktree, once it is on the task branch in the same repository. */
100
+ export declare function locateTaskWorktree(checkout: SessionCheckout, root: string, picked: string): Promise<SessionCheckout>;
101
+ export interface WorktreeRemovalCheck {
102
+ /** Uncommitted and untracked files, which removing deletes. */
103
+ dirty: {
104
+ count: number;
105
+ files: string[];
106
+ };
107
+ /** Files Git ignores (node_modules, .env, build output), which removing deletes too. */
108
+ ignored: {
109
+ count: number;
110
+ files: string[];
111
+ };
112
+ /** Commits on the task branch that no remote branch and not the default branch holds. */
113
+ unmerged: {
114
+ count: number;
115
+ commits: string[];
116
+ };
117
+ /** Processes whose working folder is inside the worktree; undefined where they cannot be listed. */
118
+ processes?: {
119
+ count: number;
120
+ names: string[];
121
+ };
122
+ }
123
+ /** What removing a task's worktree would lose, and what holds it. */
124
+ export declare function inspectWorktreeRemoval(checkout: SessionCheckout, root: string): Promise<WorktreeRemovalCheck>;
125
+ export interface WorktreeRemoval {
126
+ checkout: SessionCheckout;
127
+ branchDeleted: boolean;
128
+ }
129
+ /**
130
+ * Removes a task's worktree. Refused while a process works in it, or when it holds uncommitted files the lead was not
131
+ * shown (`expectDirty` is the count they saw). The branch is deleted only when no commit would be lost; otherwise it
132
+ * stays, holding the task's commits.
133
+ */
134
+ export declare function removeTaskWorktree(checkout: SessionCheckout, root: string, options: {
135
+ expectDirty: number;
136
+ }): Promise<WorktreeRemoval>;
137
+ /** Removes a worktree a start made and never used: only while it is clean and its branch has no commit of its own. */
138
+ export declare function discardPreparedWorktree(home: string, root: string, key: string): Promise<boolean>;
139
+ export declare function validCheckout(value: unknown): value is SessionCheckout;
140
+ /** What the agent is told about a task worktree. */
141
+ export declare function worktreeInstructions(checkout: SessionCheckout | undefined): string;