@apralabs/apra-fleet 0.4.4 → 0.4.5

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 (268) hide show
  1. package/README.md +49 -4
  2. package/dist/agents/backlog-groomer.md +5 -0
  3. package/dist/agents/ci-watcher.md +5 -0
  4. package/dist/agents/deployer.md +20 -2
  5. package/dist/agents/doer.md +38 -2
  6. package/dist/agents/harvester.md +12 -9
  7. package/dist/agents/integ-test-runner.md +5 -0
  8. package/dist/agents/kb-reconciler.md +6 -0
  9. package/dist/agents/plan-reviewer.md +5 -0
  10. package/dist/agents/planner.md +5 -0
  11. package/dist/agents/regression-test-runner.md +5 -0
  12. package/dist/agents/reviewer.md +67 -15
  13. package/dist/agents/schemas/deployer-output.json +5 -0
  14. package/dist/agents/schemas/doer-output.json +78 -2
  15. package/dist/agents/schemas/reviewer-output.json +104 -2
  16. package/dist/cli/auth.js +5 -1
  17. package/dist/cli/beads-pin.js +6 -7
  18. package/dist/cli/claude-mod.d.ts +75 -0
  19. package/dist/cli/claude-mod.js +288 -0
  20. package/dist/cli/dolt-install.d.ts +1 -1
  21. package/dist/cli/dolt-install.js +5 -1
  22. package/dist/cli/fleet-se-guard.d.ts +8 -0
  23. package/dist/cli/fleet-se-guard.js +19 -3
  24. package/dist/cli/install-guard.d.ts +9 -0
  25. package/dist/cli/install-guard.js +24 -0
  26. package/dist/cli/install.d.ts +12 -0
  27. package/dist/cli/install.js +180 -20
  28. package/dist/cli/kb-profile.d.ts +16 -0
  29. package/dist/cli/kb-profile.js +81 -0
  30. package/dist/cli/start.js +3 -0
  31. package/dist/cli/uninstall.js +13 -3
  32. package/dist/cli/update.d.ts +4 -0
  33. package/dist/cli/update.js +19 -3
  34. package/dist/commands/kb-server.d.ts +10 -1
  35. package/dist/commands/kb-server.js +285 -11
  36. package/dist/index.js +22 -1
  37. package/dist/os/git-executable.d.ts +57 -0
  38. package/dist/os/git-executable.js +85 -0
  39. package/dist/os/go-concurrency.d.ts +44 -0
  40. package/dist/os/go-concurrency.js +53 -0
  41. package/dist/os/index.d.ts +1 -0
  42. package/dist/os/index.js +1 -0
  43. package/dist/os/linux.d.ts +2 -0
  44. package/dist/os/linux.js +10 -1
  45. package/dist/os/os-commands.d.ts +25 -0
  46. package/dist/os/os-commands.js +2 -0
  47. package/dist/os/windows-executable.d.ts +53 -0
  48. package/dist/os/windows-executable.js +185 -0
  49. package/dist/os/windows-gitbash.d.ts +23 -14
  50. package/dist/os/windows-gitbash.js +40 -16
  51. package/dist/os/windows.d.ts +2 -0
  52. package/dist/os/windows.js +37 -6
  53. package/dist/paths.d.ts +10 -1
  54. package/dist/paths.js +19 -2
  55. package/dist/services/agy-project.d.ts +7 -1
  56. package/dist/services/agy-project.js +7 -2
  57. package/dist/services/auth-socket.d.ts +18 -0
  58. package/dist/services/auth-socket.js +30 -4
  59. package/dist/services/credential-store.d.ts +33 -0
  60. package/dist/services/credential-store.js +79 -2
  61. package/dist/services/http-transport.d.ts +29 -0
  62. package/dist/services/http-transport.js +166 -37
  63. package/dist/services/kb-tool-profile.d.ts +36 -0
  64. package/dist/services/kb-tool-profile.js +88 -0
  65. package/dist/services/knowledge/bible-blob-id.js +10 -1
  66. package/dist/services/knowledge/bible-import.d.ts +108 -0
  67. package/dist/services/knowledge/bible-import.js +137 -4
  68. package/dist/services/knowledge/file-hash.js +6 -5
  69. package/dist/services/knowledge/http-provider.d.ts +303 -20
  70. package/dist/services/knowledge/http-provider.js +795 -125
  71. package/dist/services/knowledge/kb-config.d.ts +65 -1
  72. package/dist/services/knowledge/kb-config.js +143 -3
  73. package/dist/services/knowledge/kb-http-auth-state.d.ts +26 -0
  74. package/dist/services/knowledge/kb-http-auth-state.js +40 -0
  75. package/dist/services/knowledge/kb-providers.d.ts +9 -2
  76. package/dist/services/knowledge/kb-providers.js +67 -37
  77. package/dist/services/knowledge/kb-removed-scope-keys.js +1 -1
  78. package/dist/services/knowledge/kb-self.d.ts +122 -9
  79. package/dist/services/knowledge/kb-self.js +196 -36
  80. package/dist/services/knowledge/member-bible-view.js +16 -3
  81. package/dist/services/knowledge/path-validation.d.ts +7 -0
  82. package/dist/services/knowledge/path-validation.js +11 -0
  83. package/dist/services/knowledge/project-slug.js +3 -2
  84. package/dist/services/knowledge/repository-header.d.ts +77 -0
  85. package/dist/services/knowledge/repository-header.js +233 -0
  86. package/dist/services/knowledge/require-sqlite-project.d.ts +1 -1
  87. package/dist/services/knowledge/require-sqlite-project.js +1 -1
  88. package/dist/services/knowledge/sqlite-provider.d.ts +169 -0
  89. package/dist/services/knowledge/sqlite-provider.js +416 -4
  90. package/dist/services/knowledge/types.d.ts +15 -2
  91. package/dist/services/member-busy.d.ts +12 -0
  92. package/dist/services/member-busy.js +20 -0
  93. package/dist/services/member-config-io.d.ts +3 -2
  94. package/dist/services/member-config-io.js +7 -4
  95. package/dist/services/member-fleet-install.js +1 -0
  96. package/dist/services/member-tool-allowlist.d.ts +1 -1
  97. package/dist/services/member-tool-allowlist.js +8 -4
  98. package/dist/services/port-holder.js +2 -1
  99. package/dist/services/service-manager/types.d.ts +17 -1
  100. package/dist/services/service-manager/windows.d.ts +7 -2
  101. package/dist/services/service-manager/windows.js +28 -11
  102. package/dist/services/service-notice.d.ts +7 -0
  103. package/dist/services/service-notice.js +19 -0
  104. package/dist/services/session-registry.d.ts +13 -0
  105. package/dist/services/session-registry.js +13 -0
  106. package/dist/services/session-roots.d.ts +67 -0
  107. package/dist/services/session-roots.js +126 -0
  108. package/dist/services/statusline.d.ts +21 -0
  109. package/dist/services/statusline.js +97 -1
  110. package/dist/services/supervisor-service-cleanup.js +2 -1
  111. package/dist/services/tool-registry.js +108 -20
  112. package/dist/services/tool-scope.d.ts +34 -1
  113. package/dist/services/tool-scope.js +27 -2
  114. package/dist/services/vcs/azure-devops.js +10 -0
  115. package/dist/services/vcs/bitbucket.d.ts +22 -1
  116. package/dist/services/vcs/bitbucket.js +163 -17
  117. package/dist/services/vcs/types.d.ts +25 -2
  118. package/dist/services/watch/project-resolver.js +2 -1
  119. package/dist/skills/pm/cost.md +5 -1
  120. package/dist/skills/pm/index.md +9 -9
  121. package/dist/skills/pm/sprint.md +2 -1
  122. package/dist/tools/check-status.d.ts +51 -0
  123. package/dist/tools/check-status.js +124 -12
  124. package/dist/tools/code-intelligence-freshness.js +1 -1
  125. package/dist/tools/code-intelligence-gitnexus.d.ts +19 -0
  126. package/dist/tools/code-intelligence-gitnexus.js +166 -9
  127. package/dist/tools/code-intelligence-readiness.d.ts +58 -1
  128. package/dist/tools/code-intelligence-readiness.js +93 -8
  129. package/dist/tools/code-intelligence-reindex.d.ts +25 -1
  130. package/dist/tools/code-intelligence-reindex.js +76 -4
  131. package/dist/tools/code-intelligence.d.ts +1 -1
  132. package/dist/tools/code-intelligence.js +1 -1
  133. package/dist/tools/execute-command.js +14 -8
  134. package/dist/tools/execute-prompt.js +6 -2
  135. package/dist/tools/fleet-snapshot.d.ts +21 -0
  136. package/dist/tools/fleet-snapshot.js +78 -0
  137. package/dist/tools/kb-bible-commit.d.ts +25 -11
  138. package/dist/tools/kb-bible-commit.js +142 -33
  139. package/dist/tools/kb-capture.d.ts +2 -2
  140. package/dist/tools/kb-context.js +47 -27
  141. package/dist/tools/kb-demote.d.ts +27 -0
  142. package/dist/tools/kb-demote.js +37 -0
  143. package/dist/tools/kb-export.d.ts +35 -3
  144. package/dist/tools/kb-export.js +56 -13
  145. package/dist/tools/kb-feedback.d.ts +2 -0
  146. package/dist/tools/kb-feedback.js +17 -7
  147. package/dist/tools/kb-harvest.js +28 -9
  148. package/dist/tools/kb-import.d.ts +18 -2
  149. package/dist/tools/kb-import.js +24 -9
  150. package/dist/tools/kb-invalidate.d.ts +11 -3
  151. package/dist/tools/kb-invalidate.js +80 -7
  152. package/dist/tools/kb-list.js +38 -10
  153. package/dist/tools/kb-promote.js +6 -4
  154. package/dist/tools/kb-query.d.ts +3 -0
  155. package/dist/tools/kb-query.js +181 -37
  156. package/dist/tools/kb-session-prime.d.ts +4 -4
  157. package/dist/tools/kb-session-prime.js +89 -9
  158. package/dist/tools/kb-setup.d.ts +20 -0
  159. package/dist/tools/kb-setup.js +149 -11
  160. package/dist/tools/list-members.js +1 -1
  161. package/dist/tools/member-detail.js +7 -3
  162. package/dist/tools/provision-vcs-auth.d.ts +28 -3
  163. package/dist/tools/provision-vcs-auth.js +53 -7
  164. package/dist/tools/receive-files.js +7 -4
  165. package/dist/tools/send-files.js +5 -4
  166. package/dist/tools/send-message.d.ts +3 -0
  167. package/dist/tools/send-message.js +15 -2
  168. package/dist/tools/stop-prompt.js +3 -1
  169. package/dist/tools/vcs-credential-exec.d.ts +45 -3
  170. package/dist/tools/vcs-credential-exec.js +90 -11
  171. package/dist/utils/process-utils.js +5 -1
  172. package/dist/utils/redact-known-secrets.d.ts +17 -0
  173. package/dist/utils/redact-known-secrets.js +70 -0
  174. package/dist/utils/skill-matrix.js +1 -1
  175. package/dist/utils/vcs-provider-detect.js +2 -2
  176. package/dist/workflows/auto-sprint.js +245 -9
  177. package/package.json +10 -7
  178. package/packages/apra-fleet-client/package.json +1 -1
  179. package/packages/apra-fleet-client/src/client/api.mjs +172 -19
  180. package/packages/apra-fleet-client/src/client/reconnecting-transport.mjs +35 -2
  181. package/packages/apra-fleet-client/src/client/transport.mjs +6 -0
  182. package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +5 -0
  183. package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +5 -0
  184. package/packages/apra-fleet-se/apra-pm/agents/deployer.md +20 -2
  185. package/packages/apra-fleet-se/apra-pm/agents/doer.md +38 -2
  186. package/packages/apra-fleet-se/apra-pm/agents/harvester.md +12 -9
  187. package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +5 -0
  188. package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +6 -0
  189. package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +5 -0
  190. package/packages/apra-fleet-se/apra-pm/agents/planner.md +5 -0
  191. package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +5 -0
  192. package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +67 -15
  193. package/packages/apra-fleet-se/apra-pm/agents/schemas/deployer-output.json +5 -0
  194. package/packages/apra-fleet-se/apra-pm/agents/schemas/doer-output.json +78 -2
  195. package/packages/apra-fleet-se/apra-pm/agents/schemas/reviewer-output.json +104 -2
  196. package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +5 -1
  197. package/packages/apra-fleet-se/apra-pm/skills/pm/index.md +9 -9
  198. package/packages/apra-fleet-se/apra-pm/skills/pm/sprint.md +2 -1
  199. package/packages/apra-fleet-se/bin/cli.mjs +104 -31
  200. package/packages/apra-fleet-se/bin/serve.mjs +46 -8
  201. package/packages/apra-fleet-se/fleet-sprint/abort.mjs +184 -32
  202. package/packages/apra-fleet-se/fleet-sprint/bd-sync-command.mjs +69 -0
  203. package/packages/apra-fleet-se/fleet-sprint/beads-children.mjs +21 -0
  204. package/packages/apra-fleet-se/fleet-sprint/beads-lock-probe.mjs +176 -0
  205. package/packages/apra-fleet-se/fleet-sprint/beads-reachability.mjs +126 -0
  206. package/packages/apra-fleet-se/fleet-sprint/beads-scope.mjs +158 -1
  207. package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +82 -2
  208. package/packages/apra-fleet-se/fleet-sprint/coordination.mjs +23 -6
  209. package/packages/apra-fleet-se/fleet-sprint/decision-notify.mjs +338 -0
  210. package/packages/apra-fleet-se/fleet-sprint/decision-wait.mjs +731 -0
  211. package/packages/apra-fleet-se/fleet-sprint/decisions.mjs +372 -0
  212. package/packages/apra-fleet-se/fleet-sprint/dispatch-role.mjs +44 -11
  213. package/packages/apra-fleet-se/fleet-sprint/docs/README.md +4 -1
  214. package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +9 -3
  215. package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +314 -19
  216. package/packages/apra-fleet-se/fleet-sprint/errors.mjs +72 -4
  217. package/packages/apra-fleet-se/fleet-sprint/git-sync.mjs +7 -1
  218. package/packages/apra-fleet-se/fleet-sprint/git-topology.mjs +112 -1
  219. package/packages/apra-fleet-se/fleet-sprint/guarded-modules.mjs +36 -2
  220. package/packages/apra-fleet-se/fleet-sprint/kb.mjs +736 -101
  221. package/packages/apra-fleet-se/fleet-sprint/member-init-probe.mjs +1 -1
  222. package/packages/apra-fleet-se/fleet-sprint/member-provisioning.mjs +7 -1
  223. package/packages/apra-fleet-se/fleet-sprint/phases/deploy.mjs +49 -2
  224. package/packages/apra-fleet-se/fleet-sprint/phases/develop.mjs +206 -3
  225. package/packages/apra-fleet-se/fleet-sprint/phases/final-review.mjs +61 -3
  226. package/packages/apra-fleet-se/fleet-sprint/phases/harvest.mjs +81 -31
  227. package/packages/apra-fleet-se/fleet-sprint/phases/plan.mjs +7 -3
  228. package/packages/apra-fleet-se/fleet-sprint/phases/publish-pr.mjs +39 -14
  229. package/packages/apra-fleet-se/fleet-sprint/phases/re-review.mjs +17 -1
  230. package/packages/apra-fleet-se/fleet-sprint/phases/review.mjs +18 -3
  231. package/packages/apra-fleet-se/fleet-sprint/pr-body.mjs +14 -1
  232. package/packages/apra-fleet-se/fleet-sprint/prompts.mjs +32 -5
  233. package/packages/apra-fleet-se/fleet-sprint/runner.js +824 -98
  234. package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +4 -2
  235. package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +54 -1
  236. package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +29 -2
  237. package/packages/apra-fleet-se/fleet-sprint/set-aside.mjs +288 -0
  238. package/packages/apra-fleet-se/fleet-sprint/skills/fleet-supervisor/SKILL.md +3 -2
  239. package/packages/apra-fleet-se/fleet-sprint/sprint-args.mjs +20 -0
  240. package/packages/apra-fleet-se/fleet-sprint/sprint-report.mjs +21 -0
  241. package/packages/apra-fleet-se/fleet-sprint/sprint-state.mjs +9 -0
  242. package/packages/apra-fleet-se/fleet-sprint/vcs-auth.mjs +605 -32
  243. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/bitbucket.mjs +811 -17
  244. package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +89 -1
  245. package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +225 -2
  246. package/packages/apra-fleet-se/fleet-sprint/worklists.mjs +59 -3
  247. package/packages/apra-fleet-se/src/supervisor/api.mjs +148 -8
  248. package/packages/apra-fleet-se/src/supervisor/dashboard.mjs +6 -3
  249. package/packages/apra-fleet-se/src/supervisor/dolt-mutex.mjs +30 -10
  250. package/packages/apra-fleet-se/src/supervisor/fleet-members.mjs +17 -4
  251. package/packages/apra-fleet-se/src/supervisor/history.mjs +8 -1
  252. package/packages/apra-fleet-se/src/supervisor/id-allocator.mjs +92 -2
  253. package/packages/apra-fleet-se/src/supervisor/proxy.mjs +26 -1
  254. package/packages/apra-fleet-se/src/supervisor/server.mjs +151 -8
  255. package/packages/apra-fleet-se/src/supervisor/spawner.mjs +11 -9
  256. package/packages/apra-fleet-se/src/supervisor/watchdog.mjs +7 -1
  257. package/packages/apra-fleet-workflow/package.json +2 -1
  258. package/packages/apra-fleet-workflow/src/viewer/index.mjs +86 -5
  259. package/packages/apra-fleet-workflow/src/viewer/request-guard.mjs +222 -0
  260. package/packages/apra-fleet-workflow/src/workflow/index.mjs +34 -2
  261. package/plugins/claude-code/fleet-status/.claude-plugin/plugin.json +7 -0
  262. package/plugins/claude-code/fleet-status/hooks/hooks.json +1 -0
  263. package/plugins/claude-code/fleet-status/hooks/register.tsx +906 -0
  264. package/plugins/claude-code/fleet-status/types/index.d.ts +88 -0
  265. package/skills/fleet/auth-bitbucket.md +47 -20
  266. package/skills/fleet/onboarding.md +1 -1
  267. package/skills/fleet/skill-matrix.md +3 -3
  268. package/version.json +1 -1
@@ -15,7 +15,8 @@
15
15
  "type": "string",
16
16
  "enum": [
17
17
  "VERIFY",
18
- "BLOCKED"
18
+ "BLOCKED",
19
+ "NEEDS-DECISION"
19
20
  ]
20
21
  },
21
22
  "closedIds": {
@@ -27,6 +28,62 @@
27
28
  "notes": {
28
29
  "type": "string"
29
30
  },
31
+ "decision": {
32
+ "type": "object",
33
+ "description": "REQUIRED when status is \"NEEDS-DECISION\", otherwise omit. The decision only a human operator can make before the named bead can go on. The orchestrator files it for an operator verbatim (never truncated), sets the bead aside for the rest of the run without re-dispatching it, and keeps working other ready beads. Use it only for a real choice between alternatives you cannot settle from the bead, its parent or the code -- not for a missing secret or an unmet prerequisite (BLOCKED), and not for an ordinary failure.",
34
+ "required": [
35
+ "beadId",
36
+ "question",
37
+ "options",
38
+ "recommendation"
39
+ ],
40
+ "properties": {
41
+ "beadId": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "description": "The one open bead id that cannot go on until the decision is made."
45
+ },
46
+ "question": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "description": "The full question, self-contained: what was found, why it blocks the bead, and what must be decided. An operator reads only this and the options."
50
+ },
51
+ "options": {
52
+ "type": "array",
53
+ "minItems": 2,
54
+ "description": "At least two concrete alternatives, each with a short stable id (for example \"a\", \"b\") and its full text: what it means and what it costs.",
55
+ "items": {
56
+ "type": "object",
57
+ "required": [
58
+ "id",
59
+ "text"
60
+ ],
61
+ "properties": {
62
+ "id": {
63
+ "type": "string",
64
+ "minLength": 1
65
+ },
66
+ "text": {
67
+ "type": "string",
68
+ "minLength": 1
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "recommendation": {
74
+ "type": "string",
75
+ "minLength": 1,
76
+ "description": "The option id you recommend, followed by why."
77
+ }
78
+ }
79
+ },
80
+ "blockedIds": {
81
+ "type": "array",
82
+ "description": "With status BLOCKED: the assigned bead ids you left open BECAUSE of the block -- not ids you merely did not reach (e.g. same-lane stop rule). The engine sets these beads, and every open bead depending on them, aside for the rest of the run. Optional -- omitted on a single-bead assignment it means that bead; omit or send [] with status VERIFY.",
83
+ "items": {
84
+ "type": "string"
85
+ }
86
+ },
30
87
  "kb_captures": {
31
88
  "type": "array",
32
89
  "description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
@@ -110,5 +167,24 @@
110
167
  }
111
168
  }
112
169
  }
113
- }
170
+ },
171
+ "allOf": [
172
+ {
173
+ "if": {
174
+ "properties": {
175
+ "status": {
176
+ "const": "NEEDS-DECISION"
177
+ }
178
+ },
179
+ "required": [
180
+ "status"
181
+ ]
182
+ },
183
+ "then": {
184
+ "required": [
185
+ "decision"
186
+ ]
187
+ }
188
+ }
189
+ ]
114
190
  }
@@ -16,12 +16,62 @@
16
16
  "type": "string",
17
17
  "enum": [
18
18
  "APPROVED",
19
- "CHANGES_NEEDED"
19
+ "CHANGES_NEEDED",
20
+ "NEEDS-DECISION"
20
21
  ]
21
22
  },
22
23
  "notes": {
23
24
  "type": "string"
24
25
  },
26
+ "decision": {
27
+ "type": "object",
28
+ "description": "REQUIRED when verdict is \"NEEDS-DECISION\", otherwise omit. The decision only a human operator can make before the named bead can go on. The orchestrator files it for an operator verbatim (never truncated), sets the bead aside for the rest of the run without re-dispatching it, and keeps working other ready beads. Use it only for a real choice between alternatives you cannot settle from the bead, its parent or the code -- not for a missing secret or an unmet prerequisite (BLOCKED), and not for an ordinary failure.",
29
+ "required": [
30
+ "beadId",
31
+ "question",
32
+ "options",
33
+ "recommendation"
34
+ ],
35
+ "properties": {
36
+ "beadId": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "description": "The one bead under review that cannot be approved or sent back for rework until the decision is made. The orchestrator reopens it if it is closed and sets it aside."
40
+ },
41
+ "question": {
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "description": "The full question, self-contained: what was found, why it blocks the bead, and what must be decided. An operator reads only this and the options."
45
+ },
46
+ "options": {
47
+ "type": "array",
48
+ "minItems": 2,
49
+ "description": "At least two concrete alternatives, each with a short stable id (for example \"a\", \"b\") and its full text: what it means and what it costs.",
50
+ "items": {
51
+ "type": "object",
52
+ "required": [
53
+ "id",
54
+ "text"
55
+ ],
56
+ "properties": {
57
+ "id": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "text": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ }
65
+ }
66
+ }
67
+ },
68
+ "recommendation": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "description": "The option id you recommend, followed by why."
72
+ }
73
+ }
74
+ },
25
75
  "reopenIds": {
26
76
  "type": "array",
27
77
  "items": {
@@ -107,6 +157,39 @@
107
157
  }
108
158
  }
109
159
  },
160
+ "kb_demotions": {
161
+ "type": "array",
162
+ "description": "CONFIRMED entries a re-check during this review shows do not hold -- whether you are now less certain of the claim or have shown it wrong -- demoted back to INFERRED. Not for a drifted or removed basis. Reviewer-only, with the same evidence bar as kb_promotions and kb_discards. An id may appear in only one of kb_promotions, kb_discards and kb_demotions -- the engine refuses it in all lists it appears in. The engine makes the demotion calls.",
163
+ "items": {
164
+ "type": "object",
165
+ "required": [
166
+ "id",
167
+ "reason",
168
+ "evidence_files"
169
+ ],
170
+ "properties": {
171
+ "id": {
172
+ "type": "string",
173
+ "description": "The entry id, copied verbatim from the 'KNOWLEDGE BANK -- demotion candidates' block in your dispatch prompt. That block is the ONLY source of demotable ids -- do not call a kb_* tool to find one, and never invent one.",
174
+ "minLength": 1
175
+ },
176
+ "reason": {
177
+ "type": "string",
178
+ "description": "What you re-checked this review that the claim does not hold up against.",
179
+ "minLength": 20
180
+ },
181
+ "evidence_files": {
182
+ "type": "array",
183
+ "description": "The repo-relative files you re-checked -- at least one, each a real file in the repo.",
184
+ "minItems": 1,
185
+ "items": {
186
+ "type": "string",
187
+ "minLength": 1
188
+ }
189
+ }
190
+ }
191
+ }
192
+ },
110
193
  "kb_captures": {
111
194
  "type": "array",
112
195
  "description": "Durable knowledge this role verified during its run. The engine makes the kb_capture calls; the role only decides. Optional -- omit or send [] to capture nothing.",
@@ -190,5 +273,24 @@
190
273
  }
191
274
  }
192
275
  }
193
- }
276
+ },
277
+ "allOf": [
278
+ {
279
+ "if": {
280
+ "properties": {
281
+ "verdict": {
282
+ "const": "NEEDS-DECISION"
283
+ }
284
+ },
285
+ "required": [
286
+ "verdict"
287
+ ]
288
+ },
289
+ "then": {
290
+ "required": [
291
+ "decision"
292
+ ]
293
+ }
294
+ }
295
+ ]
194
296
  }
package/dist/cli/auth.js CHANGED
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import os from 'node:os';
4
4
  import { execFileSync } from 'node:child_process';
5
5
  import { escapePowerShellArg } from '../utils/shell-escape.js';
6
+ import { windowsExecutable } from '../os/windows-executable.js';
6
7
  /** Provider -> auth env var name */
7
8
  const PROVIDER_AUTH_ENV = {
8
9
  claude: 'ANTHROPIC_API_KEY',
@@ -376,8 +377,11 @@ function setApiKeyInProfiles(envVarName, value) {
376
377
  // single-quoted literal.
377
378
  const script = `[Environment]::SetEnvironmentVariable(${escapePowerShellArg(envVarName)}, ${escapePowerShellArg(value)}, 'User')`;
378
379
  const encoded = Buffer.from(script, 'utf16le').toString('base64');
380
+ // Resolve outside the try: the resolver error carries no secret and a
381
+ // missing PowerShell must not be masked by the generic status message.
382
+ const powershellExe = windowsExecutable('powershell.exe');
379
383
  try {
380
- execFileSync('powershell', ['-NoProfile', '-NonInteractive', '-EncodedCommand', encoded], { stdio: 'pipe', windowsHide: true });
384
+ execFileSync(powershellExe, ['-NoProfile', '-NonInteractive', '-EncodedCommand', encoded], { stdio: 'pipe', windowsHide: true });
381
385
  }
382
386
  catch (err) {
383
387
  // Node's error message embeds the full command line (and PowerShell's
@@ -13,13 +13,12 @@
13
13
  // no side effects) so anything may import it -- the installer, tests, and any
14
14
  // future status/health reporter -- without dragging in the installer itself.
15
15
  //
16
- // The ONE unavoidable duplicate is packages/apra-fleet-se/apra-pm/install.mjs:
17
- // that installer is deliberately plain, build-free Node (node: builtins only)
18
- // and so cannot import from this TypeScript module. Its copy is held equal to
19
- // this one by tests/apra-pm-beads-pin.test.ts, which fails the moment the two
20
- // disagree. .github/workflows/ci.yml states the pin a third time for the same
21
- // reason (a shell step cannot import TypeScript either); that file is owned by
22
- // another track, so it is deliberately not edited from here.
16
+ // The unavoidable duplicates are sites that cannot import this TypeScript module:
17
+ // packages/apra-fleet-se/apra-pm/install.mjs (plain, build-free Node: node:
18
+ // builtins only), .github/e2e/fleet-setup.mjs, and the shell steps and env of
19
+ // .github/workflows/ci.yml and pm-e2e.yml. tests/apra-pm-beads-pin.test.ts reads
20
+ // every tracked script, source, workflow and markdown file and fails the moment a
21
+ // pin there disagrees with this one.
23
22
  /** The exact @beads/bd version this product installs and supports. */
24
23
  export const BEADS_VERSION = '1.3.0';
25
24
  /** The npm package specifier to install -- always built from BEADS_VERSION. */
@@ -0,0 +1,75 @@
1
+ import { type ProviderInstallConfig } from './config.js';
2
+ export declare const CLAUDE_MOD_MARKETPLACE = "apra-fleet-local";
3
+ export declare const CLAUDE_MOD_PLUGIN = "fleet-status";
4
+ export declare const CLAUDE_MOD_ID = "fleet-status@apra-fleet-local";
5
+ /** Repo-relative source folder of the mod (packaged as the claudePlugins manifest section). */
6
+ export declare const CLAUDE_MOD_SOURCE_DIR = "plugins/claude-code/fleet-status";
7
+ export declare function isClaudeModRuntimeFile(relPath: string): boolean;
8
+ /** <apra-fleet home>/claude-plugins -- the local marketplace root. */
9
+ export declare function claudePluginsDir(): string;
10
+ /** The marketplace manifest written next to the plugin folder. */
11
+ export declare function claudeModMarketplaceJson(): string;
12
+ /**
13
+ * True when `statusLine` is the entry apra-fleet install wrote: its command
14
+ * runs apra-fleet's fleet-statusline script. Anything else is the user's own
15
+ * and is never overwritten or removed.
16
+ */
17
+ export declare function isApraFleetStatusLine(statusLine: unknown): boolean;
18
+ /** Remove the statusLine from `paths`' settings only if apra-fleet wrote it. Returns true when removed. */
19
+ export declare function removeApraFleetStatusLine(paths: ProviderInstallConfig): boolean;
20
+ export interface ClaudeModDeps {
21
+ /** Absolute path of the claude executable, or null when it is not on PATH. */
22
+ resolveClaude: () => string | null;
23
+ /** Run `file args...`; resolves on exit 0, throws (with stderr/stdout attached) otherwise. */
24
+ exec: (file: string, args: string[], timeoutMs: number) => void;
25
+ }
26
+ /**
27
+ * The spawn for `file args...` without a shell. Node refuses to spawn a
28
+ * .cmd/.bat (npm's claude.cmd) without a shell (CVE-2024-27980), and
29
+ * shell:true would join argv unquoted -- so for those the cmd.exe line is
30
+ * built here with every argument quoted and passed verbatim. Exported for tests.
31
+ */
32
+ export declare function claudeSpawnSpec(file: string, args: string[], platform?: NodeJS.Platform, comSpec?: string | undefined): {
33
+ cmd: string;
34
+ argv: string[];
35
+ verbatim: boolean;
36
+ };
37
+ /** Test-only: inject fakes for the claude CLI calls. */
38
+ export declare function _setClaudeModDeps(overrides: Partial<ClaudeModDeps>): void;
39
+ /** Test-only: restore the real claude CLI deps. */
40
+ export declare function _resetClaudeModDeps(): void;
41
+ export declare function claudeModStepEnabled(): boolean;
42
+ export type ClaudeModResult = {
43
+ status: 'installed';
44
+ dir: string;
45
+ note?: string;
46
+ } | {
47
+ status: 'skipped';
48
+ reason: string;
49
+ };
50
+ /** True when Claude's settings already have the mod enabled (an earlier install registered it). */
51
+ export declare function claudeModRegistered(paths: ProviderInstallConfig): boolean;
52
+ /**
53
+ * Install (or upgrade) the fleet-status mod for Claude Code. `files` are the
54
+ * mod's runtime files relative to the mod folder. Never throws: any failure is
55
+ * returned as `skipped` with a one-line reason, and the caller keeps the
56
+ * statusLine fallback. `installed` only when BOTH
57
+ * claude plugin marketplace add <dir> --scope user
58
+ * claude plugin install fleet-status@apra-fleet-local --scope user
59
+ * exited 0 (both are idempotent: re-running them on an existing install exits 0).
60
+ */
61
+ export declare function installClaudeMod(files: Array<{
62
+ relPath: string;
63
+ content: Buffer | string;
64
+ }>, opts?: {
65
+ alreadyRegistered?: boolean;
66
+ }): ClaudeModResult;
67
+ /**
68
+ * Remove the fleet-status mod: best-effort `claude plugin uninstall` and
69
+ * `claude plugin marketplace remove` (non-zero exits mean "already gone"),
70
+ * then the claude-plugins folder, and finally any leftover plugin/marketplace
71
+ * keys in Claude's settings (for when the claude CLI is unavailable). Prints
72
+ * one plan line (also under --dry-run). Returns true when anything was found.
73
+ */
74
+ export declare function uninstallClaudeMod(paths: ProviderInstallConfig, dryRun: boolean): boolean;
75
+ //# sourceMappingURL=claude-mod.d.ts.map
@@ -0,0 +1,288 @@
1
+ /**
2
+ * The fleet-status Claude Code mod (plugins/claude-code/fleet-status/): a
3
+ * plugin with function hooks that shows apra-fleet member status in Claude
4
+ * Code's status line and a /fleet-status pane, reading the fleet_snapshot MCP
5
+ * tool. `apra-fleet install --llm claude` installs it in place of the
6
+ * statusLine script; uninstall removes it.
7
+ *
8
+ * Layout on disk -- a local folder marketplace under the apra-fleet home:
9
+ * <FLEET_BASE>/claude-plugins/.claude-plugin/marketplace.json (apra-fleet-local)
10
+ * <FLEET_BASE>/claude-plugins/fleet-status/... (the plugin)
11
+ * A plugin installed from a folder marketplace whose entry is a relative path
12
+ * is read from that folder, so an upgrade only re-copies the files.
13
+ *
14
+ * Every `claude` call is argv-based (no shell, no variable expansion), with
15
+ * windowsHide and an explicit timeout. This module must not import install.ts:
16
+ * uninstall.ts uses it and its tests mock install.ts wholesale.
17
+ */
18
+ import fs from 'node:fs';
19
+ import path from 'node:path';
20
+ import { spawnSync } from 'node:child_process';
21
+ import { FLEET_BASE, readConfig, writeConfig } from './config.js';
22
+ import { findExecutableOnPath, splitPath } from '../utils/find-on-path.js';
23
+ export const CLAUDE_MOD_MARKETPLACE = 'apra-fleet-local';
24
+ export const CLAUDE_MOD_PLUGIN = 'fleet-status';
25
+ export const CLAUDE_MOD_ID = `${CLAUDE_MOD_PLUGIN}@${CLAUDE_MOD_MARKETPLACE}`;
26
+ /** Repo-relative source folder of the mod (packaged as the claudePlugins manifest section). */
27
+ export const CLAUDE_MOD_SOURCE_DIR = 'plugins/claude-code/fleet-status';
28
+ /**
29
+ * Paths (relative to the mod folder, forward slashes) that are authoring-time
30
+ * only and never shipped: generated type stubs (gitignored, ~1MB), tests, and
31
+ * the tsconfig that extends those stubs. Mirrored EXACTLY by
32
+ * scripts/gen-sea-config.mjs (claudeModRuntimeFile) so the SEA binary and a
33
+ * dev/npm install ship the same tree.
34
+ */
35
+ const CLAUDE_MOD_EXCLUDED_DIRS = new Set(['tests', 'test', 'node_modules']);
36
+ export function isClaudeModRuntimeFile(relPath) {
37
+ const p = relPath.replace(/\\/g, '/');
38
+ if (p === 'tsconfig.json')
39
+ return false;
40
+ if (p.startsWith('.claude-plugin/types/'))
41
+ return false;
42
+ const parts = p.split('/');
43
+ if (parts.slice(0, -1).some((d) => CLAUDE_MOD_EXCLUDED_DIRS.has(d)))
44
+ return false;
45
+ if (parts[parts.length - 1] === '.gitignore')
46
+ return false;
47
+ return true;
48
+ }
49
+ /** <apra-fleet home>/claude-plugins -- the local marketplace root. */
50
+ export function claudePluginsDir() {
51
+ return path.join(FLEET_BASE, 'claude-plugins');
52
+ }
53
+ /** The marketplace manifest written next to the plugin folder. */
54
+ export function claudeModMarketplaceJson() {
55
+ return JSON.stringify({
56
+ name: CLAUDE_MOD_MARKETPLACE,
57
+ owner: { name: 'Apra Labs' },
58
+ description: 'Claude Code plugins installed locally by apra-fleet.',
59
+ plugins: [
60
+ {
61
+ name: CLAUDE_MOD_PLUGIN,
62
+ source: `./${CLAUDE_MOD_PLUGIN}`,
63
+ description: 'apra-fleet member status in the status line and a /fleet-status pane.',
64
+ },
65
+ ],
66
+ }, null, 2) + '\n';
67
+ }
68
+ // --- statusLine ownership (all providers) ---
69
+ /**
70
+ * True when `statusLine` is the entry apra-fleet install wrote: its command
71
+ * runs apra-fleet's fleet-statusline script. Anything else is the user's own
72
+ * and is never overwritten or removed.
73
+ */
74
+ export function isApraFleetStatusLine(statusLine) {
75
+ const cmd = statusLine?.command;
76
+ return typeof cmd === 'string' && cmd.includes('fleet-statusline');
77
+ }
78
+ /** Remove the statusLine from `paths`' settings only if apra-fleet wrote it. Returns true when removed. */
79
+ export function removeApraFleetStatusLine(paths) {
80
+ const settings = readConfig(paths);
81
+ if (!settings.statusLine || !isApraFleetStatusLine(settings.statusLine))
82
+ return false;
83
+ delete settings.statusLine;
84
+ writeConfig(paths, settings);
85
+ return true;
86
+ }
87
+ /** Quote one argument for a cmd.exe command line (Windows paths never contain `"`). */
88
+ function cmdQuote(arg) {
89
+ return /[\s"&|<>^()%!,;=]/.test(arg) ? `"${arg}"` : arg;
90
+ }
91
+ /**
92
+ * The spawn for `file args...` without a shell. Node refuses to spawn a
93
+ * .cmd/.bat (npm's claude.cmd) without a shell (CVE-2024-27980), and
94
+ * shell:true would join argv unquoted -- so for those the cmd.exe line is
95
+ * built here with every argument quoted and passed verbatim. Exported for tests.
96
+ */
97
+ export function claudeSpawnSpec(file, args, platform = process.platform, comSpec = process.env.ComSpec) {
98
+ if (platform === 'win32' && /\.(cmd|bat)$/i.test(file)) {
99
+ return { cmd: comSpec || 'cmd.exe', argv: ['/d', '/s', '/c', `"${[file, ...args].map(cmdQuote).join(' ')}"`], verbatim: true };
100
+ }
101
+ return { cmd: file, argv: args, verbatim: false };
102
+ }
103
+ function realExec(file, args, timeoutMs) {
104
+ const spec = claudeSpawnSpec(file, args);
105
+ const r = spawnSync(spec.cmd, spec.argv, {
106
+ stdio: ['ignore', 'pipe', 'pipe'], timeout: timeoutMs, windowsHide: true, encoding: 'utf-8', windowsVerbatimArguments: spec.verbatim,
107
+ });
108
+ if (r.error)
109
+ throw Object.assign(r.error, { stdout: r.stdout, stderr: r.stderr });
110
+ if (r.status !== 0) {
111
+ throw Object.assign(new Error(`exited ${r.status ?? r.signal}`), { status: r.status, signal: r.signal, stdout: r.stdout, stderr: r.stderr });
112
+ }
113
+ }
114
+ /**
115
+ * The claude executable on PATH, without a shell. On Windows only real
116
+ * launchers count (claude.exe from the native installer, claude.cmd/.bat from
117
+ * npm): npm also drops an extensionless POSIX `claude` shim next to the .cmd,
118
+ * which a plain PATHEXT walk ('' first) would pick and which cannot be spawned.
119
+ */
120
+ function resolveClaudeOnPath() {
121
+ if (process.platform !== 'win32')
122
+ return findExecutableOnPath('claude');
123
+ for (const dir of splitPath(process.env.PATH ?? '', 'win32')) {
124
+ for (const ext of ['.exe', '.cmd', '.bat']) {
125
+ const candidate = path.win32.join(dir, `claude${ext}`);
126
+ try {
127
+ if (fs.statSync(candidate).isFile())
128
+ return candidate;
129
+ }
130
+ catch { /* not here */ }
131
+ }
132
+ }
133
+ return null;
134
+ }
135
+ const realClaudeModDeps = {
136
+ resolveClaude: resolveClaudeOnPath,
137
+ exec: realExec,
138
+ };
139
+ let claudeModDeps = realClaudeModDeps;
140
+ /** Test-only: inject fakes for the claude CLI calls. */
141
+ export function _setClaudeModDeps(overrides) {
142
+ claudeModDeps = { ...realClaudeModDeps, ...overrides };
143
+ }
144
+ /** Test-only: restore the real claude CLI deps. */
145
+ export function _resetClaudeModDeps() {
146
+ claudeModDeps = realClaudeModDeps;
147
+ }
148
+ export function claudeModStepEnabled() {
149
+ if (process.env.NODE_ENV !== 'test')
150
+ return true;
151
+ return process.env.APRA_FLEET_ENABLE_CLAUDE_MOD_STEP === '1';
152
+ }
153
+ /** Per-call timeout for each `claude plugin ...` command. */
154
+ const CLAUDE_CLI_TIMEOUT_MS = 60_000;
155
+ /** One printable ASCII line describing why a claude call failed. */
156
+ function failureText(err) {
157
+ const e = err;
158
+ if (e?.code === 'ETIMEDOUT' || e?.signal === 'SIGTERM')
159
+ return `timed out after ${CLAUDE_CLI_TIMEOUT_MS / 1000}s`;
160
+ if (e?.code === 'ENOENT')
161
+ return 'claude executable could not be started (ENOENT)';
162
+ const pick = (v) => String(v ?? '').split(/\r?\n/).map((l) => l.replace(/[^\x20-\x7e]/g, '').trim()).find(Boolean);
163
+ const detail = pick(e?.stderr) ?? pick(e?.stdout) ?? pick(e?.message) ?? 'unknown error';
164
+ return typeof e?.status === 'number' ? `exit ${e.status}: ${detail}` : detail;
165
+ }
166
+ /** True when Claude's settings already have the mod enabled (an earlier install registered it). */
167
+ export function claudeModRegistered(paths) {
168
+ return hasKey(readConfig(paths).enabledPlugins, CLAUDE_MOD_ID);
169
+ }
170
+ /**
171
+ * Install (or upgrade) the fleet-status mod for Claude Code. `files` are the
172
+ * mod's runtime files relative to the mod folder. Never throws: any failure is
173
+ * returned as `skipped` with a one-line reason, and the caller keeps the
174
+ * statusLine fallback. `installed` only when BOTH
175
+ * claude plugin marketplace add <dir> --scope user
176
+ * claude plugin install fleet-status@apra-fleet-local --scope user
177
+ * exited 0 (both are idempotent: re-running them on an existing install exits 0).
178
+ */
179
+ export function installClaudeMod(files, opts = {}) {
180
+ const runtime = files.filter((f) => isClaudeModRuntimeFile(f.relPath));
181
+ if (!runtime.some((f) => f.relPath.replace(/\\/g, '/') === '.claude-plugin/plugin.json')) {
182
+ return { status: 'skipped', reason: 'the mod files are not packaged in this apra-fleet build' };
183
+ }
184
+ const deps = claudeModDeps;
185
+ let claude;
186
+ try {
187
+ claude = deps.resolveClaude();
188
+ }
189
+ catch {
190
+ claude = null;
191
+ }
192
+ const dir = claudePluginsDir();
193
+ // An earlier install already registered the mod, which Claude reads in place
194
+ // from `dir`: refresh the files even without the CLI (e.g. an update run with
195
+ // a narrow PATH), rather than falling back to the statusLine script and
196
+ // showing fleet status twice.
197
+ const refreshOnly = !claude && opts.alreadyRegistered === true && fs.existsSync(dir);
198
+ if (!claude && !refreshOnly)
199
+ return { status: 'skipped', reason: "the 'claude' CLI was not found on PATH" };
200
+ try {
201
+ const pluginDir = path.join(dir, CLAUDE_MOD_PLUGIN);
202
+ // Clear first so files dropped by a newer mod version do not linger.
203
+ fs.rmSync(pluginDir, { recursive: true, force: true });
204
+ for (const f of runtime) {
205
+ const dest = path.join(pluginDir, ...f.relPath.replace(/\\/g, '/').split('/'));
206
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
207
+ fs.writeFileSync(dest, f.content);
208
+ }
209
+ fs.mkdirSync(path.join(dir, '.claude-plugin'), { recursive: true });
210
+ fs.writeFileSync(path.join(dir, '.claude-plugin', 'marketplace.json'), claudeModMarketplaceJson());
211
+ }
212
+ catch (err) {
213
+ return { status: 'skipped', reason: `could not write ${dir}: ${err.message}` };
214
+ }
215
+ if (!claude) {
216
+ return { status: 'installed', dir, note: "already registered; files refreshed (the 'claude' CLI was not found on PATH)" };
217
+ }
218
+ const steps = [
219
+ ['plugin', 'marketplace', 'add', dir, '--scope', 'user'],
220
+ ['plugin', 'install', CLAUDE_MOD_ID, '--scope', 'user'],
221
+ ];
222
+ for (const args of steps) {
223
+ try {
224
+ deps.exec(claude, args, CLAUDE_CLI_TIMEOUT_MS);
225
+ }
226
+ catch (err) {
227
+ // An old claude without the `plugin` subcommand lands here too (non-zero exit).
228
+ return { status: 'skipped', reason: `'claude ${args.slice(0, 3).join(' ')}' failed (${failureText(err)})` };
229
+ }
230
+ }
231
+ return { status: 'installed', dir };
232
+ }
233
+ function hasKey(obj, key) {
234
+ return !!obj && typeof obj === 'object' && Object.prototype.hasOwnProperty.call(obj, key);
235
+ }
236
+ /**
237
+ * Remove the fleet-status mod: best-effort `claude plugin uninstall` and
238
+ * `claude plugin marketplace remove` (non-zero exits mean "already gone"),
239
+ * then the claude-plugins folder, and finally any leftover plugin/marketplace
240
+ * keys in Claude's settings (for when the claude CLI is unavailable). Prints
241
+ * one plan line (also under --dry-run). Returns true when anything was found.
242
+ */
243
+ export function uninstallClaudeMod(paths, dryRun) {
244
+ const dir = claudePluginsDir();
245
+ const settings = readConfig(paths);
246
+ const inSettings = hasKey(settings.enabledPlugins, CLAUDE_MOD_ID) || hasKey(settings.extraKnownMarketplaces, CLAUDE_MOD_MARKETPLACE);
247
+ const onDisk = fs.existsSync(dir);
248
+ if (!onDisk && !inSettings)
249
+ return false;
250
+ console.log(` - Removing fleet-status Claude Code mod (${CLAUDE_MOD_ID}): ${dir}`);
251
+ if (dryRun)
252
+ return true;
253
+ if (claudeModStepEnabled()) {
254
+ let claude = null;
255
+ try {
256
+ claude = claudeModDeps.resolveClaude();
257
+ }
258
+ catch { /* not on PATH */ }
259
+ if (claude) {
260
+ for (const args of [
261
+ ['plugin', 'uninstall', CLAUDE_MOD_ID, '--scope', 'user'],
262
+ ['plugin', 'marketplace', 'remove', CLAUDE_MOD_MARKETPLACE],
263
+ ]) {
264
+ try {
265
+ claudeModDeps.exec(claude, args, CLAUDE_CLI_TIMEOUT_MS);
266
+ }
267
+ catch { /* already removed */ }
268
+ }
269
+ }
270
+ }
271
+ if (onDisk)
272
+ fs.rmSync(dir, { recursive: true, force: true });
273
+ // Re-read: the claude CLI above edits the same settings file.
274
+ const after = readConfig(paths);
275
+ let changed = false;
276
+ if (hasKey(after.enabledPlugins, CLAUDE_MOD_ID)) {
277
+ delete after.enabledPlugins[CLAUDE_MOD_ID];
278
+ changed = true;
279
+ }
280
+ if (hasKey(after.extraKnownMarketplaces, CLAUDE_MOD_MARKETPLACE)) {
281
+ delete after.extraKnownMarketplaces[CLAUDE_MOD_MARKETPLACE];
282
+ changed = true;
283
+ }
284
+ if (changed)
285
+ writeConfig(paths, after);
286
+ return true;
287
+ }
288
+ //# sourceMappingURL=claude-mod.js.map
@@ -14,7 +14,7 @@ export declare class UnsupportedDoltPlatformError extends Error {
14
14
  /**
15
15
  * Resolves the dolthub/dolt v2.2.0 release asset for the given platform/arch.
16
16
  * Throws UnsupportedDoltPlatformError rather than silently no-op'ing on an
17
- * unsupported combo (e.g. win32/arm64, linux/arm64 -- not published upstream
17
+ * unsupported combo (e.g. win32/arm64 -- not published upstream
18
18
  * for this pinned version).
19
19
  */
20
20
  export declare function resolveDoltAsset(platform: string, arch: string): DoltAsset;
@@ -30,7 +30,7 @@ export class UnsupportedDoltPlatformError extends Error {
30
30
  /**
31
31
  * Resolves the dolthub/dolt v2.2.0 release asset for the given platform/arch.
32
32
  * Throws UnsupportedDoltPlatformError rather than silently no-op'ing on an
33
- * unsupported combo (e.g. win32/arm64, linux/arm64 -- not published upstream
33
+ * unsupported combo (e.g. win32/arm64 -- not published upstream
34
34
  * for this pinned version).
35
35
  */
36
36
  export function resolveDoltAsset(platform, arch) {
@@ -45,6 +45,10 @@ export function resolveDoltAsset(platform, arch) {
45
45
  assetName = 'dolt-linux-amd64.tar.gz';
46
46
  archiveType = 'tar.gz';
47
47
  }
48
+ else if (platform === 'linux' && arch === 'arm64') {
49
+ assetName = 'dolt-linux-arm64.tar.gz';
50
+ archiveType = 'tar.gz';
51
+ }
48
52
  else if (platform === 'darwin' && arch === 'x64') {
49
53
  assetName = 'dolt-darwin-amd64.tar.gz';
50
54
  archiveType = 'tar.gz';