arco-workbench 0.2.4 → 0.2.6

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 (254) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/THIRD_PARTY_NOTICES +2 -2
  3. package/client/dist/assets/{PhosphorBackdrop-CHXVFLGT.js → PhosphorBackdrop-YsHTmZJh.js} +1 -1
  4. package/client/dist/assets/{ThemedBackgroundShaderImpl-Bhs4I9jA.js → ThemedBackgroundShaderImpl-BEjpgoBW.js} +1 -1
  5. package/client/dist/assets/{XtermView-CdfurwFx.js → XtermView-wh7jNKvk.js} +1 -1
  6. package/client/dist/assets/{galleryEditor-DYjZZ4cf.js → galleryEditor-CaOS2mmM.js} +1 -1
  7. package/client/dist/assets/{index-BjDmFvqG.js → index-j68SfA-l.js} +271 -271
  8. package/client/dist/index.html +1 -1
  9. package/client/src/App.tsx +2 -2
  10. package/client/src/components/AuthReloginNotice.tsx +7 -6
  11. package/client/src/components/ChatMessage.tsx +41 -29
  12. package/client/src/components/ChatPanel.tsx +17 -4
  13. package/client/src/components/ClaudeNativeAccountPicker.tsx +32 -0
  14. package/client/src/components/ClaudeNativeAuthRow.tsx +71 -19
  15. package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +11 -281
  16. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +1 -1
  17. package/client/src/components/ClusterRightPanel/FreshMemberForm.tsx +315 -0
  18. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +17 -7
  19. package/client/src/components/ClusterRightPanel/index.tsx +1 -1
  20. package/client/src/components/ClusterRightPanel/useFreshMemberPicker.ts +6 -4
  21. package/client/src/components/ClusterTab.tsx +2 -2
  22. package/client/src/components/Connections/Connections.tsx +5 -9
  23. package/client/src/components/Connections/model.ts +3 -1
  24. package/client/src/components/FileViewerModal.tsx +54 -17
  25. package/client/src/components/GitHubPanel/index.tsx +9 -5
  26. package/client/src/components/HandoffDialog.tsx +5 -3
  27. package/client/src/components/MobileShell.tsx +1 -33
  28. package/client/src/components/OperatorQuestionNotice.tsx +5 -4
  29. package/client/src/components/ProvidersPopover.tsx +6 -2
  30. package/client/src/components/RightPanel/ActivityTab.tsx +2 -1
  31. package/client/src/components/RightPanel/ConfigTab.tsx +23 -5
  32. package/client/src/components/RightPanel/OutputsPanel.tsx +21 -9
  33. package/client/src/components/RightPanel/outputsReconcile.ts +31 -0
  34. package/client/src/components/SettingsPanel.tsx +7 -10
  35. package/client/src/components/SpawnDialog.tsx +14 -3
  36. package/client/src/components/TabBar.tsx +2 -2
  37. package/client/src/components/TabContextMenu.tsx +73 -133
  38. package/client/src/components/TerminalInput.tsx +4 -3
  39. package/client/src/components/TranscriptWorkerDialog.tsx +14 -4
  40. package/client/src/components/UpdateAction.tsx +30 -7
  41. package/client/src/components/UsageBar.tsx +37 -18
  42. package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +29 -3
  43. package/client/src/components/WorkflowCreator/index.tsx +29 -15
  44. package/client/src/components/WorkflowView.tsx +1 -1
  45. package/client/src/components/providerIndicator.ts +7 -3
  46. package/client/src/components/settings/GitHubAuthRow.tsx +34 -0
  47. package/client/src/explorer/ArtifactsLens.tsx +17 -8
  48. package/client/src/explorer/ExplorerApp.tsx +3 -3
  49. package/client/src/explorer/types.ts +3 -1
  50. package/client/src/help/content/cluster.tsx +10 -4
  51. package/client/src/help/content/composer.tsx +3 -2
  52. package/client/src/help/content/header.tsx +11 -4
  53. package/client/src/help/content/misc.tsx +7 -5
  54. package/client/src/help/content/rightPanel.tsx +8 -4
  55. package/client/src/help/content/settings.tsx +15 -4
  56. package/client/src/help/content/tabbar.tsx +1 -1
  57. package/client/src/help/manualSections/actions.tsx +5 -1
  58. package/client/src/help/manualSections/clusters.tsx +20 -14
  59. package/client/src/help/manualSections/configuration.tsx +6 -4
  60. package/client/src/help/manualSections/gettingStarted.tsx +4 -2
  61. package/client/src/help/manualSections/maintenance.tsx +31 -0
  62. package/client/src/help/manualSections/powerFeatures.tsx +1 -0
  63. package/client/src/help/manualSections/providers.tsx +11 -4
  64. package/client/src/help/manualSections/workspace.tsx +3 -3
  65. package/client/src/hooks/useClaudeNativeCatalog.ts +26 -0
  66. package/client/src/hooks/useClaudeNativeLogin.ts +16 -11
  67. package/client/src/hooks/useWebSocket.ts +4 -2
  68. package/client/src/layout/layoutRange.ts +4 -5
  69. package/client/src/questions/waitingQuestion.ts +2 -0
  70. package/client/src/stores/appStore.ts +5 -1
  71. package/client/src/stores/appStore.types.ts +2 -0
  72. package/client/src/stores/replayContext.ts +20 -0
  73. package/client/src/utils/chatFileLinks.ts +34 -3
  74. package/client/src/utils/claudeAuth.ts +9 -1
  75. package/client/src/ws/handleServerMessage.ts +11 -3
  76. package/docs/ARCHITECTURE.md +3 -3
  77. package/docs/BACKUP.md +1 -1
  78. package/docs/CLIENT.md +10 -5
  79. package/docs/EXTENDING.md +1 -1
  80. package/docs/FEATURES.md +3 -3
  81. package/docs/GETTING_STARTED.md +5 -4
  82. package/docs/GIT_WORKBENCH.md +8 -0
  83. package/docs/GLOSSARY.md +2 -2
  84. package/docs/GOTCHAS.md +4 -4
  85. package/docs/HTTP_API.md +54 -23
  86. package/docs/OPERATIONS.md +17 -1
  87. package/docs/OPERATOR_ACTIONS.md +2 -2
  88. package/docs/OUTPUTS.md +48 -6
  89. package/docs/PERSISTENCE.md +1 -1
  90. package/docs/PRIMITIVES.md +4 -2
  91. package/docs/PROTOCOL_CLUSTER.md +12 -6
  92. package/docs/PROTOCOL_PRIMITIVES.md +1 -1
  93. package/docs/PROVIDERS.md +46 -9
  94. package/docs/RESEARCH.md +1 -1
  95. package/docs/SETTINGS.md +9 -4
  96. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +15 -3
  97. package/node_modules/@arco/shared/dist/protocol/clusters.js +1 -1
  98. package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
  99. package/node_modules/@arco/shared/dist/protocol/operatorQuestions.d.ts +2 -1
  100. package/node_modules/@arco/shared/dist/protocol/settings.d.ts +3 -0
  101. package/node_modules/@arco/shared/dist/protocol/settings.js +5 -0
  102. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
  103. package/node_modules/@arco/shared/dist/protocol/workflows.js +0 -2
  104. package/node_modules/@arco/shared/package.json +1 -1
  105. package/package.json +2 -2
  106. package/scripts/packaging/services.mjs +20 -1
  107. package/scripts/packaging/update.mjs +37 -2
  108. package/server/dist/attention.d.ts +6 -0
  109. package/server/dist/attention.js +6 -0
  110. package/server/dist/auth.d.ts +5 -0
  111. package/server/dist/auth.js +31 -20
  112. package/server/dist/clusterAutoTurn.d.ts +5 -1
  113. package/server/dist/clusterAutoTurn.js +31 -9
  114. package/server/dist/clusterPresets.js +3 -3
  115. package/server/dist/effortValidation.d.ts +2 -2
  116. package/server/dist/effortValidation.js +4 -4
  117. package/server/dist/explorerArtifacts.d.ts +1 -0
  118. package/server/dist/explorerArtifacts.js +12 -1
  119. package/server/dist/geminiMembers.d.ts +7 -1
  120. package/server/dist/geminiMembers.js +28 -14
  121. package/server/dist/http/conversationFiles.d.ts +36 -0
  122. package/server/dist/http/conversationFiles.js +222 -0
  123. package/server/dist/http/fileBytes.d.ts +3 -0
  124. package/server/dist/http/fileBytes.js +33 -0
  125. package/server/dist/http/fileContentRoute.d.ts +2 -0
  126. package/server/dist/http/fileContentRoute.js +139 -0
  127. package/server/dist/http/fileRead.d.ts +54 -2
  128. package/server/dist/http/fileRead.js +31 -24
  129. package/server/dist/http/outputRoutes.js +14 -21
  130. package/server/dist/http/readConfinement.d.ts +0 -11
  131. package/server/dist/http/readConfinement.js +4 -30
  132. package/server/dist/http/router.js +40 -66
  133. package/server/dist/index.js +26 -12
  134. package/server/dist/management/initHubLink.js +1 -1
  135. package/server/dist/outputs.js +8 -0
  136. package/server/dist/primitives/exportContext.d.ts +2 -0
  137. package/server/dist/primitives/exportContext.js +13 -2
  138. package/server/dist/primitives/runCompare.d.ts +7 -1
  139. package/server/dist/primitives/runCompare.js +44 -20
  140. package/server/dist/project/taskLedger.js +46 -34
  141. package/server/dist/providerAccounts.d.ts +4 -0
  142. package/server/dist/providerAccounts.js +20 -1
  143. package/server/dist/providers/antigravity/artifacts.d.ts +23 -0
  144. package/server/dist/providers/antigravity/artifacts.js +140 -0
  145. package/server/dist/providers/antigravity/index.js +85 -7
  146. package/server/dist/providers/antigravity/questions.d.ts +2 -0
  147. package/server/dist/providers/antigravity/questions.js +58 -0
  148. package/server/dist/providers/claude-native/auth.d.ts +9 -8
  149. package/server/dist/providers/claude-native/auth.js +50 -58
  150. package/server/dist/providers/claude-native/authStatus.d.ts +2 -2
  151. package/server/dist/providers/claude-native/authStatus.js +9 -7
  152. package/server/dist/providers/claude-native/catalog.d.ts +6 -5
  153. package/server/dist/providers/claude-native/catalog.js +50 -39
  154. package/server/dist/providers/claude-native/oauth.d.ts +10 -9
  155. package/server/dist/providers/claude-native/oauth.js +120 -96
  156. package/server/dist/providers/claude-native/worker.d.ts +1 -0
  157. package/server/dist/providers/claude-native/worker.js +38 -23
  158. package/server/dist/providers/codex-appserver/operatorQuestions.d.ts +5 -3
  159. package/server/dist/providers/codex-appserver/operatorQuestions.js +27 -13
  160. package/server/dist/server/broadcast.js +6 -0
  161. package/server/dist/settings.d.ts +1 -0
  162. package/server/dist/settings.js +39 -7
  163. package/server/dist/skills.js +1 -1
  164. package/server/dist/smartPickupAdapters.d.ts +1 -0
  165. package/server/dist/smartPickupAdapters.js +2 -2
  166. package/server/dist/smartPickupObserver.js +8 -5
  167. package/server/dist/thirdPartySkills.js +11 -5
  168. package/server/dist/usage.d.ts +1 -1
  169. package/server/dist/usage.js +39 -27
  170. package/server/dist/workers/WorkerManager.d.ts +1 -0
  171. package/server/dist/workers/WorkerManager.js +1 -0
  172. package/server/dist/workers/processKill.js +37 -24
  173. package/server/dist/workflowMeta.js +2 -2
  174. package/server/dist/ws/clusterHandlers.d.ts +2 -2
  175. package/server/dist/ws/clusterHandlers.js +127 -113
  176. package/server/dist/ws/clusterMembers.d.ts +1 -1
  177. package/server/dist/ws/clusterMembers.js +34 -4
  178. package/server/dist/ws/compactHandlers.js +30 -14
  179. package/server/dist/ws/compareHandlers.js +53 -21
  180. package/server/dist/ws/gateHandlers.js +2 -0
  181. package/server/dist/ws/genesisHandlers.js +5 -3
  182. package/server/dist/ws/handoffHandlers.d.ts +1 -1
  183. package/server/dist/ws/handoffHandlers.js +115 -39
  184. package/server/dist/ws/transcriptWorkerHandlers.js +7 -2
  185. package/server/dist/ws/turnEngine.js +33 -18
  186. package/server/dist/ws/updatePrimaryConfig.d.ts +3 -2
  187. package/server/dist/ws/updatePrimaryConfig.js +236 -133
  188. package/server/dist/ws/workflowHandlers.js +21 -4
  189. package/server/package.json +1 -1
  190. package/server/src/attention.ts +7 -0
  191. package/server/src/auth.ts +33 -20
  192. package/server/src/clusterAutoTurn.ts +31 -11
  193. package/server/src/clusterPresets.ts +2 -2
  194. package/server/src/effortValidation.ts +4 -4
  195. package/server/src/explorerArtifacts.ts +12 -1
  196. package/server/src/geminiMembers.ts +26 -15
  197. package/server/src/http/conversationFiles.ts +231 -0
  198. package/server/src/http/fileBytes.ts +34 -0
  199. package/server/src/http/fileContentRoute.ts +123 -0
  200. package/server/src/http/fileRead.ts +30 -25
  201. package/server/src/http/outputRoutes.ts +13 -13
  202. package/server/src/http/readConfinement.ts +3 -30
  203. package/server/src/http/router.ts +38 -62
  204. package/server/src/index.ts +27 -18
  205. package/server/src/management/initHubLink.ts +1 -1
  206. package/server/src/outputs.ts +8 -0
  207. package/server/src/primitives/exportContext.ts +14 -2
  208. package/server/src/primitives/runCompare.ts +73 -46
  209. package/server/src/project/taskLedger.ts +47 -30
  210. package/server/src/providerAccounts.ts +20 -1
  211. package/server/src/providers/antigravity/artifacts.ts +121 -0
  212. package/server/src/providers/antigravity/index.ts +64 -6
  213. package/server/src/providers/antigravity/questions.ts +52 -0
  214. package/server/src/providers/claude-native/auth.ts +45 -60
  215. package/server/src/providers/claude-native/authStatus.ts +9 -8
  216. package/server/src/providers/claude-native/catalog.ts +52 -35
  217. package/server/src/providers/claude-native/oauth.ts +101 -77
  218. package/server/src/providers/claude-native/worker.ts +38 -22
  219. package/server/src/providers/codex-appserver/operatorQuestions.ts +26 -12
  220. package/server/src/server/broadcast.ts +4 -0
  221. package/server/src/settings.ts +36 -8
  222. package/server/src/skills.ts +1 -1
  223. package/server/src/smartPickupAdapters.ts +3 -2
  224. package/server/src/smartPickupObserver.ts +8 -5
  225. package/server/src/thirdPartySkills.ts +11 -5
  226. package/server/src/usage.ts +30 -22
  227. package/server/src/workers/WorkerManager.ts +2 -0
  228. package/server/src/workers/processKill.ts +37 -23
  229. package/server/src/workflowMeta.ts +2 -2
  230. package/server/src/ws/clusterHandlers.ts +107 -104
  231. package/server/src/ws/clusterMembers.ts +25 -6
  232. package/server/src/ws/compactHandlers.ts +29 -15
  233. package/server/src/ws/compareHandlers.ts +59 -25
  234. package/server/src/ws/gateHandlers.ts +2 -0
  235. package/server/src/ws/genesisHandlers.ts +5 -4
  236. package/server/src/ws/handoffHandlers.ts +105 -37
  237. package/server/src/ws/transcriptWorkerHandlers.ts +6 -2
  238. package/server/src/ws/turnEngine.ts +32 -17
  239. package/server/src/ws/updatePrimaryConfig.ts +230 -132
  240. package/server/src/ws/workflowHandlers.ts +20 -4
  241. package/shared/dist/protocol/clusters.d.ts +15 -3
  242. package/shared/dist/protocol/clusters.js +1 -1
  243. package/shared/dist/protocol/models.d.ts +6 -1
  244. package/shared/dist/protocol/operatorQuestions.d.ts +2 -1
  245. package/shared/dist/protocol/settings.d.ts +3 -0
  246. package/shared/dist/protocol/settings.js +5 -0
  247. package/shared/dist/protocol/workflows.d.ts +1 -0
  248. package/shared/dist/protocol/workflows.js +0 -2
  249. package/shared/src/protocol/clusters.ts +23 -5
  250. package/shared/src/protocol/compare.ts +2 -2
  251. package/shared/src/protocol/models.ts +8 -4
  252. package/shared/src/protocol/operatorQuestions.ts +2 -1
  253. package/shared/src/protocol/settings.ts +8 -1
  254. package/shared/src/protocol/workflows.ts +1 -1
@@ -1,4 +1,4 @@
1
- // Source: https://github.com/mattpocock/skills at 4ae2317ddb22b046e26455e4f9c9b3aaaf62212d. MIT; see THIRD_PARTY_NOTICES.
1
+ // Source: https://github.com/mattpocock/skills at fe3b143d813e0d9f0b22531e4e4c5f239745d643. MIT; see THIRD_PARTY_NOTICES.
2
2
  export const THIRD_PARTY_SKILL_FILES = [
3
3
  {
4
4
  "slug": "grill-me",
@@ -24,6 +24,12 @@ export const THIRD_PARTY_SKILL_FILES = [
24
24
  "SKILL.md": "---\nname: retro\ndescription: \"Conduct a retrospective on a coding session.\"\ndisable-model-invocation: true\n---\n\nThe user has asked for a **retrospective**. You are suggesting improvements to the coding agent's **environment** to improve future runs.\n\n## Steps\n\n1. Read the `writing-for-agents` skill listed in the skill manifest for the writing style guide.\n\n2. Read the primary sources for the session the user specifies. This may mean searching through session logs on this machine. If the user doesn't specify a session, default to the current one.\n\n3. Look for candidates for improvement in these categories.\n\n- **Navigation**: how easy was it for the agent to find the right files? Are there hidden dependencies between files? Would a **navigation pointer** make it easier? _Use when_ the session took a long time to find a piece of information.\n- **Automated checks**: are there automated checks that could catch errors the agent made? Linting, typing, tests, filesystem linters? Read the repo's own check command first (its `package.json`/build-tool `lint`/`check` scripts, its CI workflow), so a check that already exists but sits unwired or silently broken is the finding, not a reinvention. A repo with no **guardrail** (no pre-commit hook and no CI job running its lint/typecheck/test command) is itself a finding: an un-linted repo is a standing missed opportunity, not a neutral default. _Use when_ the agent made a mistake an automated check could have caught, or the repo has no guardrail at all.\n- **Coding standards**: should the **reviewer agent** be given a new rule to enforce? Should an existing rule be removed or clarified? Classify the violation first: a **mechanical** one (a fixed syntactic pattern, a banned API, an import shape, a file-location rule) gets a deterministic check, full stop: a custom rule in the repo's own linter, a new pre-commit hook, or a new CI job, whichever the repo's language and existing guardrail make cheapest. Default to building the check over writing the rule. Reserve `CODING_STANDARDS.md` for genuine **judgement calls** (cross-file consistency, \"matches the surrounding style,\" anything no guardrail could ever substitute for). _Use when_ the reviewer agent failed to catch a mistake.\n- **Global AGENTS.md**: are there any steering instructions that should be moved to coding standards (or automated checks) instead? _Use when_ the AGENTS.md file is particularly large - in the repo OR the user's global scope.\n- **Tool economy**: did the agent make expensive tool calls that could be streamlined? Is there any custom tooling (CLI's, MCP's) that is particularly token-inefficient? _Use when_ the agent made an expensive tool call.\n- **No-ops**: look for instructions in steering files that don't modify the agent's behavior. _Use when_ the steering files are large and unwieldy.\n- **Information access**: look for opportunities to increase the agent's access to information. Teeing dev server logs, readonly access to third-party services. _Use when_ a crucial piece of information was not available to the agent.\n\n4. Present these candidates to the user, in order of severity.\n\n## Reference\n\n### Implementation vs Review\n\nRemember that all work goes through two stages: implementation and review. The implementation agent has the most **context pressure**. They are responsible for exploration, writing code, and debugging failures.\n\nThe review agent has the least context pressure - it receives a diff, so no exploration needed. It often does not need to write code or debug.\n\nThis means that the review agent should be responsible for imposing coding standards, not the implementation agent.\n\n### Files\n\nYou have access to several files in the repo:\n\n- `CLAUDE.md`/`AGENTS.md`: these files are pushed to the context window of any agent working in this repo. They should be used incredibly sparingly, usually only for **navigation pointers** to other files.\n- `CODING_STANDARDS.md`: this file is read during review, not implementation. Add **navigation pointers** to docs folders if the standards file gets more than 1,000 lines long.\n- Docs: use docs as references files, pointed to by other files. Look for existing docs before writing new ones.\n- Skills: use skills for docs (since their description goes into the agent's context window), or for user-invoked commands. Follow the advice in the `writing-for-agents` skill.\n\n\nSource: mattpocock/skills (MIT); see THIRD_PARTY_NOTICES.\n"
25
25
  }
26
26
  },
27
+ {
28
+ "slug": "code-review",
29
+ "files": {
30
+ "SKILL.md": "---\nname: code-review\ndescription: Review a specific change against its spec and project standards.\ndisable-model-invocation: true\n---\n\n# Code review\n\nReview the requested change on two axes: standards and spec. This review is read-only: inspect files and history and report findings. Do not modify files, commit, land, publish, or create issues or pull requests. Follow the project's role and delegation rules; the Director retains landing. A single reviewer can perform both axes.\n\n1. Establish the change. Use the supplied or established Git base and diff, including uncommitted changes if requested. Resolve the base and inspect the complete diff and relevant surrounding code. If the base is ambiguous, ask for it. Report an empty or unavailable diff instead of inventing a review.\n2. Establish the spec. Read the relevant Arco board task and linked plan references when available. Otherwise use the supplied spec and project instructions. If no spec is available, say so and report the spec review as incomplete.\n3. Establish the standards. Read applicable project instructions and contribution or coding standards. Consider design smells as judgement calls, not automatic defects; project rules take precedence.\n4. Review the full change against both axes. Trace affected behavior and checks far enough to identify concrete faults, missing requirements and relevant project-rule violations. Do not claim an unrun check or an inferred behavior was observed.\n5. Report actionable findings with severity, file and line, supporting rule or requirement, and the user impact. Separate Standards and Spec findings. State missing evidence and unverified claims; if an axis has no findings, say so and note its coverage limits. Keep architecture-review for broader structural exploration.\n\nSource: mattpocock/skills (MIT), adapted for Arco; see THIRD_PARTY_NOTICES.\n"
31
+ }
32
+ },
27
33
  {
28
34
  "slug": "grilling",
29
35
  "files": {
@@ -33,9 +39,9 @@ export const THIRD_PARTY_SKILL_FILES = [
33
39
  {
34
40
  "slug": "domain-modeling",
35
41
  "files": {
36
- "SKILL.md": "---\nname: domain-modeling\ndescription: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.\n---\n\n# Domain Modeling\n\nActively build and sharpen the project's domain model as you design. This is the *active* discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `GLOSSARY.md` for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)\n\n## File structure\n\nMost repos have a single context:\n\n```\n/\n\u251c\u2500\u2500 GLOSSARY.md\n\u251c\u2500\u2500 docs/\n\u2502 \u2514\u2500\u2500 adr/\n\u2502 \u251c\u2500\u2500 0001-event-sourced-orders.md\n\u2502 \u2514\u2500\u2500 0002-postgres-for-write-model.md\n\u2514\u2500\u2500 src/\n```\n\nIf a `GLOSSARY-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:\n\n```\n/\n\u251c\u2500\u2500 GLOSSARY-MAP.md\n\u251c\u2500\u2500 docs/\n\u2502 \u2514\u2500\u2500 adr/ <- system-wide decisions\n\u251c\u2500\u2500 src/\n\u2502 \u251c\u2500\u2500 ordering/\n\u2502 \u2502 \u251c\u2500\u2500 GLOSSARY.md\n\u2502 \u2502 \u2514\u2500\u2500 docs/adr/ <- context-specific decisions\n\u2502 \u2514\u2500\u2500 billing/\n\u2502 \u251c\u2500\u2500 GLOSSARY.md\n\u2502 \u2514\u2500\u2500 docs/adr/\n```\n\nCreate files lazily: only when you have something to write. If no `GLOSSARY.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.\n\n## During the session\n\n### Challenge against the glossary\n\nWhen the user uses a term that conflicts with the existing language in `GLOSSARY.md`, call it out immediately. \"Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?\"\n\n### Sharpen fuzzy language\n\nWhen the user uses vague or overloaded terms, propose a precise canonical term. \"You're saying 'account': do you mean the Customer or the User? Those are different things.\"\n\n### Discuss concrete scenarios\n\nWhen domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.\n\n### Cross-reference with code\n\nWhen the user states how something works, check whether the code agrees. If you find a contradiction, surface it: \"Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?\"\n\n### Update GLOSSARY.md inline\n\nWhen a term is resolved, update `GLOSSARY.md` right there. Don't batch these up: capture them as they happen. Use the format in [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md).\n\n`GLOSSARY.md` should be totally devoid of implementation details. Do not treat `GLOSSARY.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.\n\n### Offer ADRs sparingly\n\nOnly offer to create an ADR when all three are true:\n\n1. **Hard to reverse**: the cost of changing your mind later is meaningful\n2. **Surprising without context**: a future reader will wonder \"why did they do it this way?\"\n3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons\n\nIf any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).\n\n\nSource: mattpocock/skills (MIT); see THIRD_PARTY_NOTICES.\n\nFor public projects, exclude private material from project files. Do not stage or commit changes.\n",
37
- "GLOSSARY-FORMAT.md": "# GLOSSARY.md Format\n\n## Structure\n\n```md\n# {Context Name}\n\n{One or two sentence description of what this context is and why it exists.}\n\n## Language\n\n**Order**:\n{A one or two sentence description of the term}\n_Avoid_: Purchase, transaction\n\n**Invoice**:\nA request for payment sent to a customer after delivery.\n_Avoid_: Bill, payment request\n\n**Customer**:\nA person or organization that places orders.\n_Avoid_: Client, buyer, account\n```\n\n## Rules\n\n- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.\n- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.\n- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.\n- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.\n\n## Single vs multi-context repos\n\n**Single context (most repos):** One `GLOSSARY.md` at the repo root.\n\n**Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:\n\n```md\n# Glossary Map\n\n## Contexts\n\n- [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders\n- [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments\n- [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping\n\n## Relationships\n\n- **Ordering -> Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking\n- **Fulfillment -> Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices\n- **Ordering \u2194 Billing**: Shared types for `CustomerId` and `Money`\n```\n\nThe skill infers which structure applies:\n\n- If `GLOSSARY-MAP.md` exists, read it to find contexts\n- If only a root `GLOSSARY.md` exists, single context\n- If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved\n\nWhen multiple contexts exist, infer which one the current topic relates to. If unclear, ask.\n",
38
- "ADR-FORMAT.md": "# ADR Format\n\nADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.\n\nCreate the `docs/adr/` directory lazily: only when the first ADR is needed.\n\n## Template\n\n```md\n# {Short title of the decision}\n\n{1-3 sentences: what's the context, what did we decide, and why.}\n```\n\nThat's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why*, not in filling out sections.\n\n## Optional sections\n\nOnly include these when they add genuine value. Most ADRs won't need them.\n\n- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`): useful when decisions are revisited\n- **Considered Options**: only when the rejected alternatives are worth remembering\n- **Consequences**: only when non-obvious downstream effects need to be called out\n\n## Numbering\n\nScan `docs/adr/` for the highest existing number and increment by one.\n\n## When to offer an ADR\n\nAll three of these must be true:\n\n1. **Hard to reverse**: the cost of changing your mind later is meaningful\n2. **Surprising without context**: a future reader will look at the code and wonder \"why on earth did they do it this way?\"\n3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons\n\nIf a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond \"we did the obvious thing.\"\n\n### What qualifies\n\n- **Architectural shape.** \"We're using a monorepo.\" \"The write model is event-sourced, the read model is projected into Postgres.\"\n- **Integration patterns between contexts.** \"Ordering and Billing communicate via domain events, not synchronous HTTP.\"\n- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.\n- **Boundary and scope decisions.** \"Customer data is owned by the Customer context; other contexts reference it by ID only.\" The explicit no-s are as valuable as the yes-s.\n- **Deliberate deviations from the obvious path.** \"We're using manual SQL instead of an ORM because X.\" Anything where a reasonable reader would assume the opposite. These stop the next engineer from \"fixing\" something that was deliberate.\n- **Constraints not visible in the code.** \"We can't use AWS because of compliance requirements.\" \"Response times must be under 200ms because of the partner API contract.\"\n- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.\n"
42
+ "SKILL.md": "---\nname: domain-modeling\ndescription: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.\n---\n\n# Domain Modeling\n\nActively build and sharpen the project's domain model as you design. This is the *active* discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely *reading* `GLOSSARY.md` for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)\n\n## File structure\n\nMost repos have a single context:\n\n```\n/\n├── GLOSSARY.md\n├── docs/\n│ └── adr/\n│ ├── 0001-event-sourced-orders.md\n│ └── 0002-postgres-for-write-model.md\n└── src/\n```\n\nIf a `GLOSSARY-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:\n\n```\n/\n├── GLOSSARY-MAP.md\n├── docs/\n│ └── adr/ <- system-wide decisions\n├── src/\n│ ├── ordering/\n│ │ ├── GLOSSARY.md\n│ │ └── docs/adr/ <- context-specific decisions\n│ └── billing/\n│ ├── GLOSSARY.md\n│ └── docs/adr/\n```\n\nCreate files lazily: only when you have something to write. If no `GLOSSARY.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.\n\n## During the session\n\n### Challenge against the glossary\n\nWhen the user uses a term that conflicts with the existing language in `GLOSSARY.md`, call it out immediately. \"Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?\"\n\n### Sharpen fuzzy language\n\nWhen the user uses vague or overloaded terms, propose a precise canonical term. \"You're saying 'account': do you mean the Customer or the User? Those are different things.\"\n\n### Discuss concrete scenarios\n\nWhen domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.\n\n### Cross-reference with code\n\nWhen the user states how something works, check whether the code agrees. If you find a contradiction, surface it: \"Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?\"\n\n### Update GLOSSARY.md inline\n\nWhen a term is resolved, update `GLOSSARY.md` right there. Don't batch these up: capture them as they happen. Use the format in [GLOSSARY-FORMAT.md](./GLOSSARY-FORMAT.md).\n\n`GLOSSARY.md` should be totally devoid of implementation details. Do not treat `GLOSSARY.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.\n\n### Offer ADRs sparingly\n\nOnly offer to create an ADR when all three are true:\n\n1. **Hard to reverse**: the cost of changing your mind later is meaningful\n2. **Surprising without context**: a future reader will wonder \"why did they do it this way?\"\n3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons\n\nIf any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).\n\n\nSource: mattpocock/skills (MIT); see THIRD_PARTY_NOTICES.\n\nFor public projects, exclude private material from project files. Do not stage or commit changes.\n",
43
+ "GLOSSARY-FORMAT.md": "# GLOSSARY.md Format\n\n## Structure\n\n```md\n# {Context Name}\n\n{One or two sentence description of what this context is and why it exists.}\n\n## Language\n\n**Order**:\n{A one or two sentence description of the term}\n_Avoid_: Purchase, transaction\n\n**Invoice**:\nA request for payment for an **Order**, sent to its **Customer** after delivery.\n_Avoid_: Bill, payment request\n\n**Customer**:\nA person or organization that places an **Order**.\n_Avoid_: Client, buyer, account\n```\n\n## Rules\n\n- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.\n- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.\n- **Bold other glossary terms inside a definition.** Write related terms as `**Order**` and describe how the terms relate.\n- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.\n- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.\n\n## Single vs multi-context repos\n\n**Single context (most repos):** One `GLOSSARY.md` at the repo root.\n\n**Multiple contexts:** A `GLOSSARY-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:\n\n```md\n# Glossary Map\n\n## Contexts\n\n- [Ordering](./src/ordering/GLOSSARY.md): receives and tracks customer orders\n- [Billing](./src/billing/GLOSSARY.md): generates invoices and processes payments\n- [Fulfillment](./src/fulfillment/GLOSSARY.md): manages warehouse picking and shipping\n\n## Relationships\n\n- **Ordering -> Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking\n- **Fulfillment -> Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices\n- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`\n```\n\nThe skill infers which structure applies:\n\n- If `GLOSSARY-MAP.md` exists, read it to find contexts\n- If only a root `GLOSSARY.md` exists, single context\n- If neither exists, create a root `GLOSSARY.md` lazily when the first term is resolved\n\nWhen multiple contexts exist, infer which one the current topic relates to. If unclear, ask.\n",
44
+ "ADR-FORMAT.md": "# ADR Format\n\nADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.\n\nCreate the `docs/adr/` directory lazily: only when the first ADR is needed.\n\n## Template\n\n```md\n# {Short title of the decision}\n\n{1-3 sentences: what's the context, what did we decide, and why.}\n```\n\nThat's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why*, not in filling out sections.\n\n## Optional sections\n\nOnly include these when they add genuine value. Most ADRs won't need them.\n\n- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`): useful when decisions are revisited\n- **Considered Options**: only when the rejected alternatives are worth remembering\n- **Consequences**: only when non-obvious downstream effects need to be called out\n\n## When a decision changes\n\nWrite a new ADR explaining the new decision and why the old approach was replaced. Follow the project's convention for retaining, marking or linking superseded records.\n\n## Numbering\n\nScan `docs/adr/` for the highest existing number and increment by one.\n\n## When to offer an ADR\n\nAll three of these must be true:\n\n1. **Hard to reverse**: the cost of changing your mind later is meaningful\n2. **Surprising without context**: a future reader will look at the code and wonder \"why on earth did they do it this way?\"\n3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons\n\nIf a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond \"we did the obvious thing.\"\n\n### What qualifies\n\n- **Architectural shape.** \"We're using a monorepo.\" \"The write model is event-sourced, the read model is projected into Postgres.\"\n- **Integration patterns between contexts.** \"Ordering and Billing communicate via domain events, not synchronous HTTP.\"\n- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.\n- **Boundary and scope decisions.** \"Customer data is owned by the Customer context; other contexts reference it by ID only.\" The explicit no-s are as valuable as the yes-s.\n- **Deliberate deviations from the obvious path.** \"We're using manual SQL instead of an ORM because X.\" Anything where a reasonable reader would assume the opposite. These stop the next engineer from \"fixing\" something that was deliberate.\n- **Constraints not visible in the code.** \"We can't use AWS because of compliance requirements.\" \"Response times must be under 200ms because of the partner API contract.\"\n- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.\n"
39
45
  }
40
46
  },
41
47
  {
@@ -56,7 +62,7 @@ export const THIRD_PARTY_SKILL_FILES = [
56
62
  {
57
63
  "slug": "codebase-design",
58
64
  "files": {
59
- "SKILL.md": "---\nname: codebase-design\ndescription: Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.\n---\n\n# Codebase Design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse these terms exactly: don't substitute \"component,\" \"service,\" \"API,\" or \"boundary.\" Consistent language is the whole point.\n\n**Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.\n\n**Interface**: everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow, they refer only to the type-level surface).\n\n**Implementation**: what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for \"adapter\" when the seam is the topic; \"implementation\" otherwise.\n\n**Depth**: leverage at the interface. The amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.\n\n**Seam** _(Michael Feathers)_: a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).\n\n**Adapter**: a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).\n\n**Leverage**: what callers get from depth. More capability per unit of interface they learn. One implementation pays back across N call sites and M tests.\n\n**Locality**: what maintainers get from depth. Change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.\n\n## Deep vs shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Small Interface \u2502 <- Few methods, simple params\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 \u2502\n\u2502 Deep Implementation\u2502 <- Complex logic hidden\n\u2502 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n**Shallow module** = large interface + little implementation (avoid):\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Large Interface \u2502 <- Many methods, complex params\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 Thin Implementation \u2502 <- Just passes through\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nWhen designing an interface, ask:\n\n- Can I reduce the number of methods?\n- Can I simplify the parameters?\n- Can I hide more complexity inside?\n\n## Principles\n\n- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts; they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.\n- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.\n\n## Designing for testability\n\nGood interfaces make testing natural:\n\n1. **Accept dependencies, don't create them.**\n\n ```typescript\n // Testable\n function processOrder(order, paymentGateway) {}\n\n // Hard to test\n function processOrder(order) {\n const gateway = new StripeGateway();\n }\n ```\n\n2. **Return results, don't produce side effects.**\n\n ```typescript\n // Testable\n function calculateDiscount(cart): Discount {}\n\n // Hard to test\n function applyDiscount(cart): void {\n cart.total -= discount;\n }\n ```\n\n3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.\n\n## Relationships\n\n- A **Module** has exactly one **Interface** (the surface it presents to callers and tests).\n- **Depth** is a property of a **Module**, measured against its **Interface**.\n- A **Seam** is where a **Module**'s **Interface** lives.\n- An **Adapter** sits at a **Seam** and satisfies the **Interface**.\n- **Depth** produces **Leverage** for callers and **Locality** for maintainers.\n\n## Rejected framings\n\n- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.\n- **\"Interface\" as the TypeScript `interface` keyword or a class's public methods**: too narrow: interface here includes every fact a caller must know.\n- **\"Boundary\"**: overloaded with DDD's bounded context. Say **seam** or **interface**.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies**, see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.\n- **Exploring alternative interfaces**, see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.\n\n\nSource: mattpocock/skills (MIT); see THIRD_PARTY_NOTICES.\n",
65
+ "SKILL.md": "---\nname: codebase-design\ndescription: Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.\n---\n\n# Codebase Design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse these terms exactly: don't substitute \"component,\" \"service,\" \"API,\" or \"boundary.\" Consistent language is the whole point.\n\n**Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.\n\n**Interface**: everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow, they refer only to the type-level surface).\n\n**Implementation**: what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for \"adapter\" when the seam is the topic; \"implementation\" otherwise.\n\n**Depth**: leverage at the interface. The amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.\n\n**Seam** _(Michael Feathers)_: a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).\n\n**Adapter**: a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).\n\n**Leverage**: what callers get from depth. More capability per unit of interface they learn. One implementation pays back across N call sites and M tests.\n\n**Locality**: what maintainers get from depth. Change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.\n\n## Deep vs shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```\n┌─────────────────────┐\n│ Small Interface │ <- Few methods, simple params\n├─────────────────────┤\n│ │\n│ Deep Implementation│ <- Complex logic hidden\n│ │\n└─────────────────────┘\n```\n\n**Shallow module** = large interface + little implementation (avoid):\n\n```\n┌─────────────────────────────────┐\n│ Large Interface │ <- Many methods, complex params\n├─────────────────────────────────┤\n│ Thin Implementation │ <- Just passes through\n└─────────────────────────────────┘\n```\n\nWhen designing an interface, ask:\n\n- Can I reduce the number of methods?\n- Can I simplify the parameters?\n- Can I hide more complexity inside?\n\n## Principles\n\n- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts; they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.\n- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.\n\n## Designing for testability\n\nGood interfaces make testing natural:\n\n1. **Accept dependencies, don't create them.**\n\n ```typescript\n // Testable\n function processOrder(order, paymentGateway) {}\n\n // Hard to test\n function processOrder(order) {\n const gateway = new StripeGateway();\n }\n ```\n\n2. **Return results, don't produce side effects.**\n\n ```typescript\n // Testable\n function calculateDiscount(cart): Discount {}\n\n // Hard to test\n function applyDiscount(cart): void {\n cart.total -= discount;\n }\n ```\n\n3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.\n\n## Relationships\n\n- A **Module** has exactly one **Interface** (the surface it presents to callers and tests).\n- **Depth** is a property of a **Module**, measured against its **Interface**.\n- A **Seam** is where a **Module**'s **Interface** lives.\n- An **Adapter** sits at a **Seam** and satisfies the **Interface**.\n- **Depth** produces **Leverage** for callers and **Locality** for maintainers.\n\n## Rejected framings\n\n- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.\n- **\"Interface\" as the TypeScript `interface` keyword or a class's public methods**: too narrow: interface here includes every fact a caller must know.\n- **\"Boundary\"**: overloaded with DDD's bounded context. Say **seam** or **interface**.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies**, see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.\n- **Exploring alternative interfaces**, see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.\n\n\nSource: mattpocock/skills (MIT); see THIRD_PARTY_NOTICES.\n",
60
66
  "DESIGN-IT-TWICE.md": "# Design It Twice\n\nWhen the user wants to explore alternative interfaces for a chosen deepening candidate, use this parallel sub-agent pattern. Based on \"Design It Twice\" (Ousterhout): your first idea is unlikely to be the best.\n\nUses the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**, **seam**, **adapter**, **leverage**.\n\n## Process\n\n### 1. Frame the problem space\n\nBefore spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:\n\n- The constraints any new interface would need to satisfy\n- The dependencies it would rely on, and which category they fall into (see [DEEPENING.md](DEEPENING.md))\n- A rough illustrative code sketch to ground the constraints, not a proposal, just a way to make the constraints concrete\n\nShow this to the user, then immediately proceed to Step 2. The user reads and thinks while the sub-agents work in parallel.\n\n### 2. Spawn sub-agents\n\nSpawn 3+ sub-agents in parallel, each with a fresh context window. Each must produce a **radically different** interface for the deepened module.\n\nPrompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:\n\n- Agent 1: \"Minimize the interface: aim for 1-3 entry points max. Maximise leverage per entry point.\"\n- Agent 2: \"Maximise flexibility: support many use cases and extension.\"\n- Agent 3: \"Optimise for the most common caller: make the default case trivial.\"\n- Agent 4 (if applicable): \"Design around ports & adapters for cross-seam dependencies.\"\n\nInclude both [SKILL.md](SKILL.md) vocabulary and GLOSSARY.md vocabulary in the brief so each sub-agent names things consistently with the architecture language and the project's domain language.\n\nEach sub-agent outputs:\n\n1. Interface (types, methods, params, plus invariants, ordering, error modes)\n2. Usage example showing how callers use it\n3. What the implementation hides behind the seam\n4. Dependency strategy and adapters (see [DEEPENING.md](DEEPENING.md))\n5. Trade-offs: where leverage is high, where it's thin\n\n### 3. Present and compare\n\nPresent designs sequentially so the user can absorb each one, then compare them in prose. Contrast by **depth** (leverage at the interface), **locality** (where change concentrates), and **seam placement**.\n\nAfter comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated: the user wants a strong read, not a menu.\n",
61
67
  "DEEPENING.md": "# Deepening\n\nHow to deepen a cluster of shallow modules safely, given its dependencies. Assumes the vocabulary in [SKILL.md](SKILL.md): **module**, **interface**, **seam**, **adapter**.\n\n## Dependency categories\n\nWhen assessing a candidate for deepening, classify its dependencies. The category determines how the deepened module is tested across its seam.\n\n### 1. In-process\n\nPure computation, in-memory state, no I/O. Always deepenable: merge the modules and test through the new interface directly. No adapter needed.\n\n### 2. Local-substitutable\n\nDependencies that have local test stand-ins (PGLite for Postgres, in-memory filesystem). Deepenable if the stand-in exists. The deepened module is tested with the stand-in running in the test suite. The seam is internal; no port at the module's external interface.\n\n### 3. Remote but owned (Ports & Adapters)\n\nYour own services across a network boundary (microservices, internal APIs). Define a **port** (interface) at the seam. The deep module owns the logic; the transport is injected as an **adapter**. Tests use an in-memory adapter. Production uses an HTTP/gRPC/queue adapter.\n\nRecommendation shape: *\"Define a port at the seam, implement an HTTP adapter for production and an in-memory adapter for testing, so the logic sits in one deep module even though it's deployed across a network.\"*\n\n### 4. True external (Mock)\n\nThird-party services (Stripe, Twilio, etc.) you don't control. The deepened module takes the external dependency as an injected port; tests provide a mock adapter.\n\n## Seam discipline\n\n- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a port unless at least two adapters are justified (typically production + test). A single-adapter seam is just indirection.\n- **Internal seams vs external seams.** A deep module can have internal seams (private to its implementation, used by its own tests) as well as the external seam at its interface. Don't expose internal seams through the interface just because tests use them.\n\n## Testing strategy: replace, don't layer\n\n- Old unit tests on shallow modules become waste once tests at the deepened module's interface exist; delete them.\n- Write new tests at the deepened module's interface. The **interface is the test surface**.\n- Tests assert on observable outcomes through the interface, not internal state.\n- Tests should survive internal refactors, since they describe behaviour, not implementation. If a test has to change when the implementation changes, it's testing past the interface.\n"
62
68
  }
@@ -1,3 +1,3 @@
1
1
  import type { ClaudeCredentialBinding, UsageInfo } from '@arco/shared';
2
2
  export declare function getCliUsageBinding(): Promise<ClaudeCredentialBinding>;
3
- export declare function getUsage(force?: boolean): Promise<UsageInfo>;
3
+ export declare function getUsage(force?: boolean, requestedAccount?: string): Promise<UsageInfo>;
@@ -2,6 +2,7 @@ import { readFile } from 'fs/promises';
2
2
  import { join } from 'path';
3
3
  import { homedir } from 'os';
4
4
  import { createHash } from 'node:crypto';
5
+ import { requireClaudeNativeAccount } from './providerAccounts.js';
5
6
  import { loadTokens, nativeCredentialBinding } from './providers/claude-native/auth.js';
6
7
  import { ensureLiveTokens as ensureClaudeNativeTokens, REFRESH_LEAD_MS_EXPORT } from './providers/claude-native/oauth.js';
7
8
  const CREDENTIALS_PATH = join(process.env.CLAUDE_CONFIG_DIR || join(homedir(), '.claude'), '.credentials.json');
@@ -13,13 +14,13 @@ const inFlight = new Map();
13
14
  let checkSequence = 0;
14
15
  // Read current revisions before considering cached data. Native refresh stays
15
16
  // with its credential owner and happens only on a cache miss before a request.
16
- async function readNativeCredentials() {
17
- const tokens = await loadTokens();
17
+ async function readNativeCredentials(accountRef) {
18
+ const tokens = await loadTokens(accountRef);
18
19
  if (!tokens)
19
20
  return null;
20
21
  if (typeof tokens.accessToken !== 'string' || !tokens.accessToken || typeof tokens.refreshToken !== 'string' || !tokens.refreshToken || !Number.isFinite(tokens.expiresAt))
21
22
  throw new Error('Invalid Native credentials');
22
- return { accessToken: tokens.accessToken, expiresAt: tokens.expiresAt, subscriptionType: 'claude-native', source: 'claude-native', binding: nativeCredentialBinding(tokens) };
23
+ return { accessToken: tokens.accessToken, expiresAt: tokens.expiresAt, subscriptionType: 'claude-native', source: 'claude-native', binding: nativeCredentialBinding(tokens, accountRef) };
23
24
  }
24
25
  async function readCliCredentials() {
25
26
  let raw;
@@ -46,25 +47,27 @@ async function getCliTokens() { return readCliCredentials(); }
46
47
  export async function getCliUsageBinding() {
47
48
  return (await getCliTokens().catch(() => null))?.binding ?? { source: 'claude-cli', storeId: 'claude-cli-default' };
48
49
  }
49
- async function getTokenCandidates() {
50
+ async function getTokenCandidates(accountRef) {
50
51
  const tokens = [], errors = [];
51
52
  try {
52
- const native = await readNativeCredentials();
53
+ const native = await readNativeCredentials(accountRef);
53
54
  if (native)
54
55
  tokens.push(native);
55
56
  }
56
57
  catch {
57
58
  errors.push('Native allowance credentials could not be read');
58
59
  }
59
- try {
60
- const cli = await getCliTokens();
61
- if (cli)
62
- tokens.push(cli);
63
- }
64
- catch {
65
- errors.push('CLI allowance credentials could not be read');
60
+ if (accountRef === undefined) {
61
+ try {
62
+ const cli = await getCliTokens();
63
+ if (cli)
64
+ tokens.push(cli);
65
+ }
66
+ catch {
67
+ errors.push('CLI allowance credentials could not be read');
68
+ }
66
69
  }
67
- return { tokens, errors, key: JSON.stringify([tokens.map(t => t.binding), errors]) };
70
+ return { tokens, errors, key: JSON.stringify([accountRef, tokens.map(t => t.binding), errors]) };
68
71
  }
69
72
  function unavailable(checkedAt, error, stale = false) {
70
73
  return { session: null, weekly: null, subscriptionType: null, fetchedAt: Date.now(), checkedAt,
@@ -74,9 +77,9 @@ function unavailable(checkedAt, error, stale = false) {
74
77
  function changed(checkedAt) {
75
78
  return unavailable(checkedAt, 'Credentials changed while checking allowance. Check again for the current credential source.', true);
76
79
  }
77
- function credentialContext(context) {
80
+ function credentialContext(context, accountRef) {
78
81
  return {
79
- native: context.tokens.find(t => t.source === 'claude-native')?.binding ?? { source: 'claude-native', storeId: 'claude.native' },
82
+ native: context.tokens.find(t => t.source === 'claude-native')?.binding ?? nativeCredentialBinding(null, accountRef),
80
83
  cli: context.tokens.find(t => t.source === 'claude-cli')?.binding ?? { source: 'claude-cli', storeId: 'claude-cli-default' },
81
84
  };
82
85
  }
@@ -101,20 +104,20 @@ function windowValue(raw) {
101
104
  throw new Error('Invalid allowance window');
102
105
  return { utilization: value.utilization, resetsAt: typeof value.resets_at === 'string' ? value.resets_at : null };
103
106
  }
104
- async function checkUsage(initial, sequence) {
107
+ async function checkUsage(initial, sequence, accountRef) {
105
108
  let context = initial;
106
109
  const checkedAt = Date.now(), errors = [...initial.errors];
107
110
  for (let index = 0; index < initial.tokens.length; index++) {
108
111
  let tokens = initial.tokens[index];
109
- if (index && (await getTokenCandidates()).key !== context.key)
112
+ if (index && (await getTokenCandidates(accountRef)).key !== context.key)
110
113
  return changed(checkedAt);
111
114
  try {
112
115
  if (tokens.source === 'claude-native' && tokens.expiresAt <= Date.now() + REFRESH_LEAD_MS_EXPORT) {
113
116
  // Preserve the Native owner's existing locking and expiry refresh.
114
117
  // No allowance failure marks execution auth or invokes forced refresh.
115
- const refreshed = await ensureClaudeNativeTokens();
116
- const binding = nativeCredentialBinding(refreshed);
117
- const next = await getTokenCandidates();
118
+ const refreshed = await ensureClaudeNativeTokens(accountRef);
119
+ const binding = nativeCredentialBinding(refreshed, accountRef);
120
+ const next = await getTokenCandidates(accountRef);
118
121
  if (next.tokens.find(t => t.source === 'claude-native')?.binding.revision !== binding.revision
119
122
  || next.tokens.find(t => t.source === 'claude-cli')?.binding.revision !== context.tokens.find(t => t.source === 'claude-cli')?.binding.revision)
120
123
  return changed(checkedAt);
@@ -133,11 +136,11 @@ async function checkUsage(initial, sequence) {
133
136
  continue;
134
137
  }
135
138
  // Reading the revisions AFTER parsing also fences delayed response bodies.
136
- if ((await getTokenCandidates()).key !== context.key)
139
+ if ((await getTokenCandidates(accountRef)).key !== context.key)
137
140
  return changed(checkedAt);
138
141
  const info = { session, weekly, subscriptionType: tokens.subscriptionType, fetchedAt: Date.now(), checkedAt,
139
142
  source: tokens.source, binding: tokens.binding, identity: { state: 'unknown' }, available: true, stale: false,
140
- credentialContext: credentialContext(context),
143
+ credentialContext: credentialContext(context, accountRef),
141
144
  freshness: 'fresh', fallback: tokens.source === 'claude-cli' && (index > 0 || initial.errors.length > 0) };
142
145
  return remember(context.key, info, sequence);
143
146
  }
@@ -145,17 +148,26 @@ async function checkUsage(initial, sequence) {
145
148
  errors.push(`Allowance request failed (${tokens.source}); execution authentication is unchanged`);
146
149
  }
147
150
  }
148
- if ((await getTokenCandidates()).key !== context.key)
151
+ if ((await getTokenCandidates(accountRef)).key !== context.key)
149
152
  return changed(checkedAt);
150
153
  const error = `${errors.join('; ') || 'No suitable Claude OAuth allowance credentials found'}. Allowance availability is separate from execution authentication.`;
151
154
  const previous = cache.get(context.key)?.value;
152
155
  const info = previous?.binding && (previous.session || previous.weekly)
153
156
  ? { ...previous, available: false, stale: true, freshness: 'stale', checkedAt, error }
154
- : { ...unavailable(checkedAt, error), credentialContext: credentialContext(context) };
157
+ : { ...unavailable(checkedAt, error), credentialContext: credentialContext(context, accountRef) };
155
158
  return remember(context.key, info, sequence);
156
159
  }
157
- export async function getUsage(force = false) {
158
- const candidates = await getTokenCandidates();
160
+ export async function getUsage(force = false, requestedAccount) {
161
+ let accountRef;
162
+ if (requestedAccount !== undefined) {
163
+ try {
164
+ accountRef = await requireClaudeNativeAccount(requestedAccount);
165
+ }
166
+ catch {
167
+ return unavailable(Date.now(), 'The selected Claude Native account is unavailable.');
168
+ }
169
+ }
170
+ const candidates = await getTokenCandidates(accountRef);
159
171
  const pending = inFlight.get(candidates.key);
160
172
  if (pending)
161
173
  return pending;
@@ -163,7 +175,7 @@ export async function getUsage(force = false) {
163
175
  if (!force && cached && Date.now() - cached.cachedAt < CACHE_TTL_MS)
164
176
  return fromCache(cached);
165
177
  const sequence = ++checkSequence;
166
- const promise = Promise.resolve().then(() => checkUsage(candidates, sequence)).finally(() => {
178
+ const promise = Promise.resolve().then(() => checkUsage(candidates, sequence, accountRef)).finally(() => {
167
179
  if (inFlight.get(candidates.key) === promise)
168
180
  inFlight.delete(candidates.key);
169
181
  });
@@ -44,6 +44,7 @@ export declare class WorkerManager {
44
44
  sandbox?: WorkerConfig['sandbox'];
45
45
  interactionMode?: WorkerConfig['interactionMode'];
46
46
  antigravityInteractive?: boolean;
47
+ antigravityHandoffWriter?: boolean;
47
48
  antigravityChatWorkspace?: boolean;
48
49
  disableProviderHooks?: boolean;
49
50
  chatWebAccess?: boolean;
@@ -60,6 +60,7 @@ export class WorkerManager {
60
60
  sandbox: options?.sandbox,
61
61
  interactionMode: options?.interactionMode,
62
62
  antigravityInteractive: options?.antigravityInteractive,
63
+ antigravityHandoffWriter: options?.antigravityHandoffWriter,
63
64
  antigravityChatWorkspace: options?.antigravityChatWorkspace,
64
65
  disableProviderHooks: options?.disableProviderHooks,
65
66
  chatWebAccess: options?.chatWebAccess,
@@ -165,28 +165,41 @@ export function spawnShellChild(run, options) {
165
165
  export function _shellTreeTagForTest(child) {
166
166
  return msysTrees.get(child)?.tag;
167
167
  }
168
- // Prints, one per line, the Windows process id (or, outside Windows, the
169
- // process id) of every MSYS process whose environment holds the tag. Bash
170
- // built-ins only, so it starts nothing per process.
171
- // Test observations on stderr contain process IDs and readability only.
168
+ // Print only the process IDs of matching entries. A readable MSYS /proc
169
+ // entry can still fail when opened. Put both virtual-file reads in a
170
+ // subshell so a failed probe cannot discard the rest of the scan.
171
+ // Diagnostic output contains only process IDs, stages and exit status.
172
172
  export const MSYS_TREE_SWEEP = [
173
173
  'tag=$1',
174
- 'if [ -n "$2" ]; then exec 3>&2; fi',
175
- 'for d in /proc/[0-9]*; do',
176
- ' if [ -n "$2" ]; then',
177
- ' readable=no; [ -r "$d/environ" ] && readable=yes',
178
- ' printf \'entry %s readable=%s\\n\' "${d#/proc/}" "$readable" >&3',
174
+ 'observe=$2',
175
+ 'platform=$3',
176
+ 'proc=${4:-/proc}',
177
+ 'if [ -n "$observe" ]; then exec 3>&2; fi',
178
+ 'for d in "$proc"/[0-9]*; do',
179
+ ' entry=${d##*/}',
180
+ ' [[ "$entry" =~ ^[1-9][0-9]*$ ]] || continue',
181
+ ' if (',
182
+ ' [ -r "$d/environ" ] || exit 0',
183
+ ` if [ -n "$observe" ]; then printf 'probe %s stage=environ\\n' "$entry" >&3; fi`,
184
+ ' hit=',
185
+ ` while IFS= read -r -d '' e || [ -n "$e" ]; do`,
186
+ ' if [ "$e" = "' + PROCESS_TREE_ENV + '=$tag" ]; then hit=1; break; fi',
187
+ ' done < "$d/environ" || exit "$?"',
188
+ ' [ -n "$hit" ] || exit 0',
189
+ ' pid=$entry',
190
+ ' if [ "$platform" = win32 ]; then',
191
+ ` if [ -n "$observe" ]; then printf 'probe %s stage=winpid\\n' "$entry" >&3; fi`,
192
+ ' pid=',
193
+ ' IFS= read -r pid < "$d/winpid" || [ -n "$pid" ] || exit 1',
194
+ ' [[ "$pid" =~ ^[1-9][0-9]*$ ]] || exit 1',
195
+ ' fi',
196
+ ` printf '%s\\n' "$pid"`,
197
+ ' ); then',
198
+ ' :',
199
+ ' else',
200
+ ' status=$?',
201
+ ` if [ -n "$observe" ]; then printf 'probe-failed %s status=%s\\n' "$entry" "$status" >&3; fi`,
179
202
  ' fi',
180
- ' [ -r "$d/environ" ] || continue',
181
- ' hit=',
182
- ' while IFS= read -r -d \'\' e || [ -n "$e" ]; do',
183
- ' if [ "$e" = "' + PROCESS_TREE_ENV + '=$tag" ]; then hit=1; break; fi',
184
- ' done < "$d/environ"',
185
- ' [ -n "$hit" ] || continue',
186
- ' w=',
187
- ' [ -r "$d/winpid" ] && read -r w < "$d/winpid"',
188
- ' if [ -n "$2" ]; then printf \'match %s pid=%s\\n\' "${d#/proc/}" "$w" >&3; fi',
189
- ' printf \'%s\\n\' "${w:-${d#/proc/}}"',
190
203
  'done 2>/dev/null',
191
204
  '',
192
205
  ].join('\n');
@@ -209,8 +222,10 @@ export async function msysTreeSweepRetrying(bash, tag, platform, sweep) {
209
222
  let seen;
210
223
  const found = await sweep(bash, tag, platform, (r) => { seen = r; });
211
224
  const failed = !seen || seen.error !== undefined || seen.code !== 0;
212
- if (failed || found.length === 0) {
213
- const last = (seen?.stderr ?? '').trim().split(/\r?\n/).slice(-3).join(' | ');
225
+ const diagnostics = (seen?.stderr ?? '').trim().split(/\r?\n/);
226
+ const failedProbes = diagnostics.filter(line => line.startsWith('probe-failed '));
227
+ if (failed || found.length === 0 || failedProbes.length) {
228
+ const last = (failed || found.length === 0 ? diagnostics : failedProbes).slice(-3).join(' | ');
214
229
  console.log(`[arco] msys tree sweep attempt ${attempt}: code=${seen?.code} signal=${seen?.signal} error=${seen?.error ?? 'none'} found=${found.length} ${Date.now() - started}ms${last ? ` stderr: ${last}` : ''}`);
215
230
  }
216
231
  if (!failed || seen?.error === 'sweep timed out' || attempt >= 2)
@@ -241,9 +256,7 @@ export function msysTreeSweep(bash, tag, platform = process.platform, observe) {
241
256
  }, SWEEP_TIMEOUT_MS);
242
257
  let sweeper;
243
258
  try {
244
- const args = ['-c', MSYS_TREE_SWEEP, 'arco-sweep', tag];
245
- if (observe)
246
- args.push('observe');
259
+ const args = ['-c', MSYS_TREE_SWEEP, 'arco-sweep', tag, observe ? 'observe' : '', platform];
247
260
  const plan = shellSpawnPlan({ file: bash, args, msys: true }, { env, stdio: ['ignore', 'pipe', observe ? 'pipe' : 'ignore'] }, platform);
248
261
  // The sweep itself must not carry a tag, or it would list itself.
249
262
  if (plan.options.env)
@@ -66,7 +66,7 @@ export function workflowConfigFromMeta(meta, cwd) {
66
66
  // Preserve the default-claude invariant (undefined ≡ claude).
67
67
  primaryProvider: meta.primaryProvider === 'claude' ? undefined : meta.primaryProvider,
68
68
  primaryModel: meta.primaryModel,
69
- primaryEffort: normalizedWorkflowEffort(meta.primaryProvider, meta.primaryModel, meta.primaryEffort),
69
+ primaryEffort: normalizedWorkflowEffort(meta.primaryProvider, meta.primaryModel, meta.primaryEffort, meta.providerAccountRef),
70
70
  skipPermissions: meta.primaryProvider === 'antigravity-cli' ? meta.antigravitySkipPermissions === true : true,
71
71
  ...(meta.providerAccountRef ? { providerAccountRef: meta.providerAccountRef } : {}),
72
72
  // — transport overrides (HIGH: dropping these runs the WRONG transport) —
@@ -129,7 +129,7 @@ export async function readMeta(cwd, wfid) {
129
129
  delete parsed.orchestratorProvider;
130
130
  delete parsed.orchestratorModel;
131
131
  delete parsed.orchestratorEffort;
132
- parsed.primaryEffort = normalizedWorkflowEffort(parsed.primaryProvider, parsed.primaryModel, parsed.primaryEffort);
132
+ parsed.primaryEffort = normalizedWorkflowEffort(parsed.primaryProvider, parsed.primaryModel, parsed.primaryEffort, parsed.providerAccountRef);
133
133
  return parsed;
134
134
  }
135
135
  catch (err) {
@@ -5,7 +5,7 @@ import * as taskDispatcher from '../taskDispatcher.js';
5
5
  import { inferClusterProviderFromModel } from './clusterMembers.js';
6
6
  import type { Session } from '../workflows/types.js';
7
7
  export interface ClusterHandlerDeps {
8
- handleUserMessage: (ws: WebSocket, session: Session, workflowId: string, content: string, clientMessageId: string | undefined, attachments: string[] | undefined, interjection: boolean, kind: 'steer' | 'follow-up' | 'interrupt' | undefined, primitive: 'docs' | 'git' | 'plan-review' | undefined) => Promise<void>;
8
+ handleUserMessage: typeof import('./turnEngine.js').handleUserMessage;
9
9
  handleRemoveWorkflow: (workflowId: string) => void;
10
10
  createBlankNativeWorkflow: (ws: WebSocket, session: Session, config: WorkflowConfig, options?: {
11
11
  clusterMemberPending?: boolean;
@@ -41,7 +41,7 @@ export declare function handleClusterRename(ws: WebSocket, clusterId: string, na
41
41
  export declare function dropClusterWorkflowState(workflowId: string): void;
42
42
  export declare function handleClusterMemberRemove(clusterId: string, workflowId: string): Promise<void>;
43
43
  export declare function handleClusterMemberAdd(ws: WebSocket, clusterId: string, workflowId: string): Promise<void>;
44
- export declare function isKnownCatalogModel(provider: ClusterMemberProvider, modelId: string): Promise<boolean>;
44
+ export declare function isKnownCatalogModel(provider: ClusterMemberProvider, modelId: string, nativeAccount?: string): Promise<boolean>;
45
45
  export declare function catalogDriftProbe(provider: string, model: string): Promise<boolean>;
46
46
  export { inferClusterProviderFromModel };
47
47
  export declare function resolveClusterOverrideProvider(inheritedProvider: ClusterMemberProvider, requestedProvider: ClusterMemberProvider | undefined, requestedModel: string | undefined): {