arco-workbench 0.1.9 → 0.2.0

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 (761) hide show
  1. package/CONTRIBUTING.md +14 -12
  2. package/README.md +5 -3
  3. package/client/dist/THIRD_PARTY_LICENSES.txt +3912 -0
  4. package/client/dist/assets/{PhosphorBackdrop-DRu16-Is.js → PhosphorBackdrop-9jNRO1ZM.js} +1 -1
  5. package/client/dist/assets/{ThemedBackgroundShaderImpl-BLdwwQ4D.js → ThemedBackgroundShaderImpl-tUi3k54Y.js} +1 -1
  6. package/client/dist/assets/XtermView-B7BOSnVo.js +10 -0
  7. package/client/dist/assets/{galleryEditor-CI8ClzBa.js → galleryEditor-Ohc2h9cD.js} +1 -1
  8. package/client/dist/assets/index-CVJVD2Vn.css +1 -0
  9. package/client/dist/assets/index-ILGXWriO.js +638 -0
  10. package/client/dist/index.html +3 -3
  11. package/client/src/App.tsx +42 -9
  12. package/client/src/components/AskUserQuestionNotice.tsx +37 -10
  13. package/client/src/components/AttachmentPill.tsx +3 -2
  14. package/client/src/components/AuthReloginNotice.tsx +25 -6
  15. package/client/src/components/AutomaticMessage.tsx +3 -1
  16. package/client/src/components/CatchMeUp.tsx +4 -1
  17. package/client/src/components/ChatMessage.tsx +43 -5
  18. package/client/src/components/ChatModeView.tsx +20 -4
  19. package/client/src/components/ChatPanel.tsx +5 -0
  20. package/client/src/components/ClusterActivityTab.tsx +9 -3
  21. package/client/src/components/ClusterComposerButtons.tsx +5 -3
  22. package/client/src/components/ClusterPlanTab.tsx +55 -8
  23. package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +38 -99
  24. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +36 -12
  25. package/client/src/components/ClusterRightPanel/MailboxModal.tsx +61 -8
  26. package/client/src/components/ClusterRightPanel/MemberRow.tsx +46 -14
  27. package/client/src/components/ClusterRightPanel/PhoneMemberList.tsx +56 -0
  28. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +38 -9
  29. package/client/src/components/ClusterRightPanel/SkillsControl.tsx +6 -5
  30. package/client/src/components/ClusterRightPanel/index.tsx +188 -39
  31. package/client/src/components/ClusterRightPanel/memberSettings.ts +2 -2
  32. package/client/src/components/ClusterRightPanel/panels.ts +1 -0
  33. package/client/src/components/ClusterRightPanel/types.ts +5 -1
  34. package/client/src/components/ClusterRightPanel/useFreshMemberPicker.ts +82 -0
  35. package/client/src/components/ClusterTab.tsx +76 -23
  36. package/client/src/components/ClusterTaskBoardTab.tsx +35 -6
  37. package/client/src/components/Connections/Connections.tsx +5 -8
  38. package/client/src/components/Connections/model.ts +2 -2
  39. package/client/src/components/DialogShell.tsx +4 -0
  40. package/client/src/components/DirectorContinuePrompt.tsx +56 -0
  41. package/client/src/components/FileExplorer.tsx +54 -1
  42. package/client/src/components/FileViewerModal.tsx +39 -7
  43. package/client/src/components/FirstRun.tsx +3 -2
  44. package/client/src/components/ForwardMessages.tsx +6 -3
  45. package/client/src/components/GateApprovalNotice.tsx +7 -4
  46. package/client/src/components/GeminiSkillNotice.tsx +12 -0
  47. package/client/src/components/GeminiSubagentLine.tsx +5 -0
  48. package/client/src/components/GitDialog.tsx +15 -6
  49. package/client/src/components/GitOtherWork.tsx +2 -1
  50. package/client/src/components/HandoffDialog.tsx +3 -2
  51. package/client/src/components/HeaderVersionBox.tsx +6 -2
  52. package/client/src/components/HistoryTab.tsx +127 -108
  53. package/client/src/components/Home/HomeView.tsx +14 -3
  54. package/client/src/components/Home/ResearchLibrary.tsx +107 -0
  55. package/client/src/components/Home/home.css +6 -0
  56. package/client/src/components/LoginFlow.tsx +12 -5
  57. package/client/src/components/MemberCard.tsx +8 -2
  58. package/client/src/components/MemberPane.tsx +12 -4
  59. package/client/src/components/MobileNotices.tsx +26 -0
  60. package/client/src/components/MobileQuestionBar.tsx +35 -0
  61. package/client/src/components/MobileShell.tsx +811 -0
  62. package/client/src/components/MobileTextSize.tsx +27 -0
  63. package/client/src/components/NativeSubagentControls.tsx +12 -1
  64. package/client/src/components/NorthStarBar.tsx +2 -0
  65. package/client/src/components/NotificationToasts.tsx +6 -2
  66. package/client/src/components/OperatorQuestionNotice.tsx +2 -2
  67. package/client/src/components/PendingQuestionsButton.tsx +44 -5
  68. package/client/src/components/PhoneUpload.tsx +4 -2
  69. package/client/src/components/PlanComposerDialog.tsx +7 -7
  70. package/client/src/components/ProjectsSettings.tsx +3 -0
  71. package/client/src/components/ProvidersPopover.tsx +9 -6
  72. package/client/src/components/PurgeConversationModal.tsx +1 -1
  73. package/client/src/components/QueuedMessagesIndicator.tsx +1 -1
  74. package/client/src/components/Recall/RecallView.tsx +31 -8
  75. package/client/src/components/ResearchFolderSetting.tsx +64 -0
  76. package/client/src/components/RightPanel/ActivityTab.tsx +9 -4
  77. package/client/src/components/RightPanel/BlastRadiusTab.tsx +6 -8
  78. package/client/src/components/RightPanel/ConfigTab.tsx +18 -10
  79. package/client/src/components/RightPanel/FilesTab.tsx +34 -19
  80. package/client/src/components/RightPanel/PlanTab.tsx +67 -24
  81. package/client/src/components/RightPanel/UsageTab.tsx +30 -3
  82. package/client/src/components/RightPanel/index.tsx +42 -3
  83. package/client/src/components/RuntimeStateBanner.tsx +8 -0
  84. package/client/src/components/ScratchCloseDialog.tsx +124 -0
  85. package/client/src/components/SettingsPanel.tsx +181 -69
  86. package/client/src/components/SkillActivityIndicator.tsx +93 -0
  87. package/client/src/components/SystemHeader.tsx +2 -7
  88. package/client/src/components/SystemModal.tsx +37 -45
  89. package/client/src/components/TabBar.tsx +52 -8
  90. package/client/src/components/TabContextMenu.tsx +12 -102
  91. package/client/src/components/TaskCard.tsx +13 -17
  92. package/client/src/components/TaskChildComposer.tsx +24 -0
  93. package/client/src/components/TasksPanel.tsx +7 -17
  94. package/client/src/components/Terminal/FloatingTerminalWindow.tsx +11 -3
  95. package/client/src/components/Terminal/FloatingWindow.tsx +36 -14
  96. package/client/src/components/Terminal/XtermView.tsx +19 -2
  97. package/client/src/components/Terminal/phoneKeys.ts +9 -0
  98. package/client/src/components/TerminalInput.tsx +149 -32
  99. package/client/src/components/TranscriptWorkerDialog.tsx +2 -2
  100. package/client/src/components/UpdateAction.tsx +9 -6
  101. package/client/src/components/UsageBar.tsx +118 -10
  102. package/client/src/components/UserManual/MobileManualContent.tsx +58 -0
  103. package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +8 -5
  104. package/client/src/components/WorkflowCreator/PastChatsList.tsx +3 -1
  105. package/client/src/components/WorkflowCreator/ProjectPicker.tsx +3 -3
  106. package/client/src/components/WorkflowCreator/ResearchStartForm.tsx +335 -0
  107. package/client/src/components/WorkflowCreator/index.tsx +124 -36
  108. package/client/src/components/WorkflowCreator/memberProviders.ts +20 -5
  109. package/client/src/components/WorkflowCreator/pendingTemplateApply.ts +20 -0
  110. package/client/src/components/WorkflowCreator/types.ts +18 -0
  111. package/client/src/components/WorkflowStatusChip.tsx +1 -0
  112. package/client/src/components/WorkflowView.tsx +51 -13
  113. package/client/src/components/chatMessageLabel.ts +4 -0
  114. package/client/src/components/clusterActivity.helpers.ts +5 -1
  115. package/client/src/components/clusterNeedsYou.ts +3 -8
  116. package/client/src/components/clusterSurface.helpers.ts +6 -1
  117. package/client/src/components/composer/submitComposer.ts +7 -1
  118. package/client/src/components/help/HelpBanner.tsx +10 -5
  119. package/client/src/components/help/HelpPopover.tsx +5 -0
  120. package/client/src/components/media/MediaModalHost.tsx +13 -8
  121. package/client/src/components/plans/PhonePlanView.tsx +66 -0
  122. package/client/src/components/plans/phonePlanChecklist.ts +45 -0
  123. package/client/src/components/providerIndicator.ts +83 -0
  124. package/client/src/components/research/AddResearcherSection.tsx +50 -0
  125. package/client/src/components/research/ExportResearchDialog.tsx +52 -0
  126. package/client/src/components/research/QuickResearchOverview.tsx +92 -0
  127. package/client/src/components/research/RerunResearchDialog.tsx +61 -0
  128. package/client/src/components/research/ResearchCloseDialog.tsx +98 -0
  129. package/client/src/components/research/ResearchRemoveDialog.tsx +37 -0
  130. package/client/src/components/research/ResearchReopenDialog.tsx +160 -0
  131. package/client/src/components/research/ResearchResultsTab.css +289 -0
  132. package/client/src/components/research/ResearchResultsTab.tsx +207 -0
  133. package/client/src/components/research/ResearchRoundsStrip.tsx +127 -0
  134. package/client/src/components/research/SavedQuickKeep.tsx +58 -0
  135. package/client/src/components/research/SendResearchDialog.tsx +126 -0
  136. package/client/src/components/research/StartResearchProjectDialog.tsx +108 -0
  137. package/client/src/components/research/researchExports.ts +26 -0
  138. package/client/src/components/research/researchLinks.tsx +30 -0
  139. package/client/src/components/research/researchView.ts +64 -0
  140. package/client/src/components/research/researcherRow.tsx +104 -0
  141. package/client/src/components/settings/AppVersionSection.tsx +2 -0
  142. package/client/src/components/settings/SettingsLayout.tsx +23 -4
  143. package/client/src/components/settings/navigation.ts +4 -4
  144. package/client/src/components/settings/settings.css +18 -0
  145. package/client/src/components/usageVisibility.ts +4 -6
  146. package/client/src/components/workSurface/WorkSurfaceControls.tsx +7 -0
  147. package/client/src/explorer/StorageLens.tsx +10 -3
  148. package/client/src/help/content/chat.tsx +5 -8
  149. package/client/src/help/content/cluster.tsx +70 -30
  150. package/client/src/help/content/composer.tsx +13 -8
  151. package/client/src/help/content/header.tsx +17 -24
  152. package/client/src/help/content/media.tsx +2 -2
  153. package/client/src/help/content/misc.tsx +174 -38
  154. package/client/src/help/content/recall.tsx +2 -2
  155. package/client/src/help/content/rightPanel.tsx +8 -8
  156. package/client/src/help/content/settings.tsx +48 -14
  157. package/client/src/help/content/tabbar.tsx +6 -2
  158. package/client/src/help/manualSections/actions.tsx +7 -2
  159. package/client/src/help/manualSections/chat.tsx +16 -15
  160. package/client/src/help/manualSections/clusters.tsx +348 -69
  161. package/client/src/help/manualSections/configuration.tsx +25 -18
  162. package/client/src/help/manualSections/deepseek.tsx +4 -5
  163. package/client/src/help/manualSections/gettingStarted.tsx +30 -26
  164. package/client/src/help/manualSections/maintenance.tsx +9 -5
  165. package/client/src/help/manualSections/plans.tsx +4 -4
  166. package/client/src/help/manualSections/powerFeatures.tsx +51 -18
  167. package/client/src/help/manualSections/providers.tsx +56 -21
  168. package/client/src/help/manualSections/reference.tsx +6 -6
  169. package/client/src/help/manualSections/strata.tsx +8 -8
  170. package/client/src/help/manualSections/workflows.tsx +3 -3
  171. package/client/src/help/manualSections/workspace.tsx +115 -39
  172. package/client/src/hooks/useWebSocket.ts +21 -4
  173. package/client/src/layout/PhoneBottomSheet.tsx +71 -0
  174. package/client/src/layout/PhonePage.tsx +71 -0
  175. package/client/src/layout/SlideOut.tsx +36 -9
  176. package/client/src/layout/layoutRange.ts +41 -4
  177. package/client/src/layout/phoneChip.ts +14 -0
  178. package/client/src/layout/phoneOverlay.ts +81 -0
  179. package/client/src/layout/phonePageActions.ts +40 -0
  180. package/client/src/stores/appStore.ts +36 -10
  181. package/client/src/stores/appStore.types.ts +29 -3
  182. package/client/src/stores/directorContinueStore.ts +22 -0
  183. package/client/src/stores/draftStore.ts +56 -2
  184. package/client/src/stores/phoneStore.ts +196 -0
  185. package/client/src/stores/terminalStore.ts +8 -0
  186. package/client/src/styles/contextual-help.css +10 -0
  187. package/client/src/styles/global.css +293 -0
  188. package/client/src/themes/apply.ts +9 -1
  189. package/client/src/themes/bootstrap.ts +21 -1
  190. package/client/src/themes/providerThemes.ts +1 -0
  191. package/client/src/utils/codexAccountHome.ts +9 -0
  192. package/client/src/utils/format.ts +8 -2
  193. package/client/src/utils/gitBranchMark.ts +3 -0
  194. package/client/src/utils/homeModel.ts +7 -0
  195. package/client/src/utils/longPress.ts +64 -0
  196. package/client/src/utils/modelCatalog.ts +4 -0
  197. package/client/src/utils/providerStatusCheck.ts +30 -0
  198. package/client/src/utils/startupGate.ts +6 -0
  199. package/client/src/ws/handleServerMessage.ts +106 -7
  200. package/docs/ARCHITECTURE.md +63 -37
  201. package/docs/ARCHITECTURE_REVIEW.md +1 -1
  202. package/docs/BACKUP.md +60 -9
  203. package/docs/CHAT.md +15 -11
  204. package/docs/CHECKPOINTS.md +2 -0
  205. package/docs/CLIENT.md +70 -36
  206. package/docs/DEEPSEEK.md +9 -10
  207. package/docs/DIAGNOSTICS.md +8 -7
  208. package/docs/DOCKER.md +16 -2
  209. package/docs/EXTENDING.md +10 -26
  210. package/docs/FEATURES.md +23 -15
  211. package/docs/GENESIS.md +3 -1
  212. package/docs/GETTING_STARTED.md +82 -16
  213. package/docs/GIT_WORKBENCH.md +5 -5
  214. package/docs/GLOSSARY.md +36 -23
  215. package/docs/GOTCHAS.md +102 -67
  216. package/docs/HTTP_API.md +182 -86
  217. package/docs/INDEX.md +1 -0
  218. package/docs/KNOWLEDGE.md +2 -2
  219. package/docs/LOCAL_SERVICES.md +9 -8
  220. package/docs/MCP_REGISTRY.md +18 -13
  221. package/docs/MEDIA_STUDIO.md +7 -11
  222. package/docs/OPERATIONS.md +101 -24
  223. package/docs/OPERATOR_ACTIONS.md +24 -22
  224. package/docs/PERSISTENCE.md +65 -24
  225. package/docs/PHOSPHOR_DEMO.md +1 -4
  226. package/docs/PLAN_OR_BOARD.md +2 -2
  227. package/docs/PRIMITIVES.md +17 -17
  228. package/docs/PROTOCOL.md +60 -9
  229. package/docs/PROTOCOL_CLUSTER.md +92 -22
  230. package/docs/PROTOCOL_PRIMITIVES.md +10 -4
  231. package/docs/PROVIDERS.md +291 -145
  232. package/docs/RECALL.md +40 -31
  233. package/docs/REMOTE_MANAGEMENT.md +27 -51
  234. package/docs/REPO_LAYOUT.md +4 -3
  235. package/docs/RESEARCH.md +189 -0
  236. package/docs/RESUME_INDEX.md +10 -19
  237. package/docs/SERVICE_MODE.md +11 -5
  238. package/docs/SETTINGS.md +18 -13
  239. package/docs/STORAGE_PLAN.md +3 -3
  240. package/docs/STRATA.md +14 -11
  241. package/docs/TASK_LEDGER.md +19 -8
  242. package/docs/TERMINAL.md +14 -10
  243. package/docs/THIRD_PARTY.md +21 -4
  244. package/docs/VOICE.md +16 -28
  245. package/native/linux-arm64/manifest.json +1 -1
  246. package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +1 -0
  247. package/node_modules/@arco/shared/dist/clusterCoordination.js +9 -1
  248. package/node_modules/@arco/shared/dist/clusterRolePresets.js +13 -4
  249. package/node_modules/@arco/shared/dist/index.d.ts +1 -0
  250. package/node_modules/@arco/shared/dist/index.js +1 -0
  251. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +7 -0
  252. package/node_modules/@arco/shared/dist/protocol/autoPickup.js +22 -11
  253. package/node_modules/@arco/shared/dist/protocol/chat.d.ts +1 -1
  254. package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +1 -0
  255. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +18 -3
  256. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +177 -4
  257. package/node_modules/@arco/shared/dist/protocol/clusters.js +48 -2
  258. package/node_modules/@arco/shared/dist/protocol/handoffs.d.ts +1 -0
  259. package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
  260. package/node_modules/@arco/shared/dist/protocol/models.js +4 -3
  261. package/node_modules/@arco/shared/dist/protocol/providers.d.ts +3 -2
  262. package/node_modules/@arco/shared/dist/protocol/providers.js +1 -1
  263. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +28 -3
  264. package/node_modules/@arco/shared/dist/protocol/settings.d.ts +4 -0
  265. package/node_modules/@arco/shared/dist/protocol/settings.js +3 -1
  266. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +42 -0
  267. package/node_modules/@arco/shared/dist/protocol/tasks.js +17 -0
  268. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +4 -0
  269. package/node_modules/@arco/shared/dist/protocol/workflows.js +2 -0
  270. package/node_modules/@arco/shared/dist/researchActivity.d.ts +4 -0
  271. package/node_modules/@arco/shared/dist/researchActivity.js +29 -0
  272. package/node_modules/@arco/shared/package.json +1 -1
  273. package/package.json +3 -2
  274. package/scripts/packaging/services.mjs +19 -2
  275. package/scripts/packaging/update.mjs +9 -0
  276. package/server/dist/arcoHome.js +19 -3
  277. package/server/dist/auth.d.ts +4 -2
  278. package/server/dist/auth.js +42 -4
  279. package/server/dist/authLoginSession.d.ts +2 -1
  280. package/server/dist/authLoginSession.js +13 -3
  281. package/server/dist/capabilities.d.ts +2 -2
  282. package/server/dist/capabilities.js +11 -6
  283. package/server/dist/chatMode.d.ts +3 -0
  284. package/server/dist/chatMode.js +25 -2
  285. package/server/dist/checkedFile.d.ts +1 -1
  286. package/server/dist/checkedFile.js +48 -41
  287. package/server/dist/cliUpdateDecision.js +1 -1
  288. package/server/dist/clusterAutoTurn.d.ts +4 -1
  289. package/server/dist/clusterAutoTurn.js +25 -4
  290. package/server/dist/clusterBusyReminder.js +2 -1
  291. package/server/dist/clusterDirector.js +5 -2
  292. package/server/dist/clusterMailTally.d.ts +11 -0
  293. package/server/dist/clusterMailTally.js +29 -0
  294. package/server/dist/clusterMailbox.d.ts +8 -1
  295. package/server/dist/clusterMailbox.js +53 -4
  296. package/server/dist/clusterOpenWork.d.ts +22 -0
  297. package/server/dist/clusterOpenWork.js +85 -0
  298. package/server/dist/clusterPeerOps.d.ts +32 -5
  299. package/server/dist/clusterPeerOps.js +253 -49
  300. package/server/dist/clusterPlanBridge.d.ts +7 -1
  301. package/server/dist/clusterPlanBridge.js +58 -0
  302. package/server/dist/clusterPlanStore.d.ts +6 -0
  303. package/server/dist/clusterPlanStore.js +58 -0
  304. package/server/dist/clusterPresets.js +23 -3
  305. package/server/dist/clusterProgress.js +2 -2
  306. package/server/dist/clusterSkills.js +2 -2
  307. package/server/dist/clusterSnapshots.d.ts +1 -0
  308. package/server/dist/clusterSnapshots.js +7 -1
  309. package/server/dist/clusterStore.d.ts +34 -1
  310. package/server/dist/clusterStore.js +194 -21
  311. package/server/dist/clusterTurnOrigin.d.ts +2 -0
  312. package/server/dist/clusterTurnOrigin.js +19 -0
  313. package/server/dist/connectionCatalog.js +1 -0
  314. package/server/dist/cursorUsage.js +3 -3
  315. package/server/dist/defaults/models.md +11 -14
  316. package/server/dist/directorContinue.d.ts +47 -0
  317. package/server/dist/directorContinue.js +311 -0
  318. package/server/dist/directorContinueHook.d.ts +3 -0
  319. package/server/dist/directorContinueHook.js +16 -0
  320. package/server/dist/effortValidation.d.ts +3 -0
  321. package/server/dist/effortValidation.js +34 -0
  322. package/server/dist/fileAccessPolicy.js +1 -0
  323. package/server/dist/fileFetch.d.ts +7 -1
  324. package/server/dist/fileFetch.js +50 -29
  325. package/server/dist/geminiMembers.d.ts +8 -0
  326. package/server/dist/geminiMembers.js +113 -0
  327. package/server/dist/git.d.ts +3 -0
  328. package/server/dist/git.js +17 -24
  329. package/server/dist/gitOtherWork.js +5 -4
  330. package/server/dist/gitSnapshots.js +66 -5
  331. package/server/dist/http/authLoginRoutes.js +1 -1
  332. package/server/dist/http/clusterRoutes.js +466 -4
  333. package/server/dist/http/diagnosticsRoutes.js +8 -0
  334. package/server/dist/http/fileWriteRoutes.js +11 -3
  335. package/server/dist/http/phoneUploadRoutes.js +2 -1
  336. package/server/dist/http/readConfinement.d.ts +11 -0
  337. package/server/dist/http/readConfinement.js +30 -0
  338. package/server/dist/http/recallRoutes.js +1 -1
  339. package/server/dist/http/router.js +48 -11
  340. package/server/dist/http/storageRoutes.js +114 -7
  341. package/server/dist/http/workflowDataRoutes.js +20 -0
  342. package/server/dist/http/writeConfinement.js +12 -1
  343. package/server/dist/index.d.ts +13 -0
  344. package/server/dist/index.js +353 -56
  345. package/server/dist/initialProviders.js +1 -1
  346. package/server/dist/manualCompactCapability.js +1 -1
  347. package/server/dist/mcp/clusterMcpLoopback.d.ts +1 -0
  348. package/server/dist/mcp/clusterMcpLoopback.js +1 -0
  349. package/server/dist/mcp/clusterMcpServer.js +3 -2
  350. package/server/dist/mcp/clusterMcpTools.d.ts +3 -0
  351. package/server/dist/mcp/clusterMcpTools.js +79 -25
  352. package/server/dist/mcp/mcpConfigWriter.d.ts +1 -0
  353. package/server/dist/mcp/mcpConfigWriter.js +2 -0
  354. package/server/dist/mcp/workerMailBridge.d.ts +17 -0
  355. package/server/dist/mcp/workerMailBridge.js +104 -0
  356. package/server/dist/planStore.js +1 -0
  357. package/server/dist/primitives/seedWorker.d.ts +10 -1
  358. package/server/dist/primitives/seedWorker.js +14 -15
  359. package/server/dist/project/taskLedger.d.ts +3 -0
  360. package/server/dist/project/taskLedger.js +16 -0
  361. package/server/dist/providers/{cursor → acp}/acpJsonRpc.js +1 -1
  362. package/server/dist/providers/acp/permissionGate.d.ts +3 -0
  363. package/server/dist/providers/acp/permissionGate.js +46 -0
  364. package/server/dist/providers/antigravity/index.d.ts +15 -0
  365. package/server/dist/providers/antigravity/index.js +251 -0
  366. package/server/dist/providers/antigravity/researchSignIn.d.ts +24 -0
  367. package/server/dist/providers/antigravity/researchSignIn.js +93 -0
  368. package/server/dist/providers/antigravity/status.d.ts +18 -0
  369. package/server/dist/providers/antigravity/status.js +28 -0
  370. package/server/dist/providers/antigravity/usage.d.ts +7 -0
  371. package/server/dist/providers/antigravity/usage.js +35 -0
  372. package/server/dist/providers/claude/researcherFence.d.ts +7 -0
  373. package/server/dist/providers/claude/researcherFence.js +27 -0
  374. package/server/dist/providers/claude-native/catalog.d.ts +2 -1
  375. package/server/dist/providers/claude-native/catalog.js +4 -0
  376. package/server/dist/providers/claude-native/index.d.ts +1 -0
  377. package/server/dist/providers/claude-native/index.js +9 -1
  378. package/server/dist/providers/claude-native/peerTools.d.ts +1 -0
  379. package/server/dist/providers/claude-native/peerTools.js +26 -4
  380. package/server/dist/providers/claude-native/taskAdmission.d.ts +7 -1
  381. package/server/dist/providers/claude-native/taskAdmission.js +30 -8
  382. package/server/dist/providers/claude-native/tools.d.ts +1 -0
  383. package/server/dist/providers/claude-native/tools.js +47 -18
  384. package/server/dist/providers/claude-native/worker.d.ts +22 -1
  385. package/server/dist/providers/claude-native/worker.js +281 -51
  386. package/server/dist/providers/claude-native/workerHelpers.d.ts +5 -0
  387. package/server/dist/providers/claude-native/workerHelpers.js +95 -5
  388. package/server/dist/providers/claude.d.ts +2 -0
  389. package/server/dist/providers/claude.js +194 -22
  390. package/server/dist/providers/clusterTaskToolDefinitions.js +2 -1
  391. package/server/dist/providers/codex-appserver/heldCommands.d.ts +2 -2
  392. package/server/dist/providers/codex-appserver/heldCommands.js +9 -3
  393. package/server/dist/providers/codex-appserver/index.d.ts +9 -0
  394. package/server/dist/providers/codex-appserver/index.js +106 -5
  395. package/server/dist/providers/codex-appserver/lateCommands.js +1 -0
  396. package/server/dist/providers/codex-appserver/modelAvailability.d.ts +20 -0
  397. package/server/dist/providers/codex-appserver/modelAvailability.js +34 -0
  398. package/server/dist/providers/codex-appserver/worker.d.ts +11 -0
  399. package/server/dist/providers/codex-appserver/worker.js +199 -25
  400. package/server/dist/providers/codex.js +1 -0
  401. package/server/dist/providers/codexVersion.d.ts +2 -0
  402. package/server/dist/providers/codexVersion.js +8 -0
  403. package/server/dist/providers/codexWebSearch.js +1 -1
  404. package/server/dist/providers/cursor/agentEnv.d.ts +20 -0
  405. package/server/dist/providers/cursor/agentEnv.js +93 -0
  406. package/server/dist/providers/cursor/authState.js +2 -1
  407. package/server/dist/providers/cursor/authToken.d.ts +25 -2
  408. package/server/dist/providers/cursor/authToken.js +118 -27
  409. package/server/dist/providers/cursor/catalog.d.ts +6 -0
  410. package/server/dist/providers/cursor/catalog.js +91 -1
  411. package/server/dist/providers/cursor/chatSandbox.d.ts +3 -1
  412. package/server/dist/providers/cursor/chatSandbox.js +24 -8
  413. package/server/dist/providers/cursor/isolated.d.ts +6 -0
  414. package/server/dist/providers/cursor/isolated.js +313 -0
  415. package/server/dist/providers/cursor/isolatedVersion.d.ts +6 -0
  416. package/server/dist/providers/cursor/isolatedVersion.js +35 -0
  417. package/server/dist/providers/cursor/modelMap.js +9 -5
  418. package/server/dist/providers/cursor/print.js +10 -8
  419. package/server/dist/providers/cursor/worker.js +8 -3
  420. package/server/dist/providers/index.js +10 -2
  421. package/server/dist/providers/llamacpp.js +3 -2
  422. package/server/dist/providers/ollama.d.ts +3 -2
  423. package/server/dist/providers/ollama.js +29 -10
  424. package/server/dist/providers/ollamaTools.d.ts +3 -0
  425. package/server/dist/providers/ollamaTools.js +31 -29
  426. package/server/dist/research/exportResults.d.ts +15 -0
  427. package/server/dist/research/exportResults.js +60 -0
  428. package/server/dist/research/isolatedArtifact.d.ts +4 -0
  429. package/server/dist/research/isolatedArtifact.js +56 -0
  430. package/server/dist/research/quickPromotion.d.ts +27 -0
  431. package/server/dist/research/quickPromotion.js +402 -0
  432. package/server/dist/research/quickResearchChat.d.ts +4 -0
  433. package/server/dist/research/quickResearchChat.js +187 -0
  434. package/server/dist/research/researchClose.d.ts +31 -0
  435. package/server/dist/research/researchClose.js +373 -0
  436. package/server/dist/research/researchCopy.d.ts +16 -0
  437. package/server/dist/research/researchCopy.js +180 -0
  438. package/server/dist/research/researchCreate.d.ts +40 -0
  439. package/server/dist/research/researchCreate.js +334 -0
  440. package/server/dist/research/researchDoctrine.d.ts +2 -0
  441. package/server/dist/research/researchDoctrine.js +26 -0
  442. package/server/dist/research/researchFolder.d.ts +23 -0
  443. package/server/dist/research/researchFolder.js +191 -0
  444. package/server/dist/research/researchLibrary.d.ts +54 -0
  445. package/server/dist/research/researchLibrary.js +281 -0
  446. package/server/dist/research/researchRetry.d.ts +25 -0
  447. package/server/dist/research/researchRetry.js +96 -0
  448. package/server/dist/research/researchRounds.d.ts +108 -0
  449. package/server/dist/research/researchRounds.js +996 -0
  450. package/server/dist/research/researchState.d.ts +112 -0
  451. package/server/dist/research/researchState.js +191 -0
  452. package/server/dist/research/researchTools.d.ts +57 -0
  453. package/server/dist/research/researchTools.js +57 -0
  454. package/server/dist/research/researchTripwires.d.ts +18 -0
  455. package/server/dist/research/researchTripwires.js +196 -0
  456. package/server/dist/research/resultSelection.d.ts +27 -0
  457. package/server/dist/research/resultSelection.js +161 -0
  458. package/server/dist/research/savedQuickPromotion.d.ts +19 -0
  459. package/server/dist/research/savedQuickPromotion.js +259 -0
  460. package/server/dist/research/sendToProject.d.ts +36 -0
  461. package/server/dist/research/sendToProject.js +293 -0
  462. package/server/dist/server/broadcast.d.ts +5 -1
  463. package/server/dist/server/broadcast.js +45 -5
  464. package/server/dist/server/updateCheck.js +1 -0
  465. package/server/dist/settings.js +27 -3
  466. package/server/dist/skillActivity.d.ts +11 -0
  467. package/server/dist/skillActivity.js +33 -0
  468. package/server/dist/smartPickup.d.ts +1 -0
  469. package/server/dist/smartPickup.js +12 -4
  470. package/server/dist/smartPickupAdapters.js +3 -2
  471. package/server/dist/smartPickupEvaluator.d.ts +1 -0
  472. package/server/dist/smartPickupObserver.js +47 -14
  473. package/server/dist/storageActions.d.ts +9 -0
  474. package/server/dist/storageActions.js +5 -0
  475. package/server/dist/storageOverview.d.ts +1 -0
  476. package/server/dist/storageOverview.js +12 -5
  477. package/server/dist/taskDispatcher.js +3 -2
  478. package/server/dist/toolboxWorkflow.js +2 -1
  479. package/server/dist/updateCheck.d.ts +3 -2
  480. package/server/dist/updateCheck.js +39 -1
  481. package/server/dist/workers/StreamParser.d.ts +1 -0
  482. package/server/dist/workers/StreamParser.js +23 -1
  483. package/server/dist/workers/WorkerManager.d.ts +4 -0
  484. package/server/dist/workers/WorkerManager.js +5 -1
  485. package/server/dist/workers/antigravityIsolatedLaunch.d.ts +25 -0
  486. package/server/dist/workers/antigravityIsolatedLaunch.js +88 -0
  487. package/server/dist/workers/checkedLinuxWorker.d.ts +38 -0
  488. package/server/dist/workers/checkedLinuxWorker.js +192 -0
  489. package/server/dist/workers/claudeAccessLease.d.ts +24 -0
  490. package/server/dist/workers/claudeAccessLease.js +157 -0
  491. package/server/dist/workers/claudeAccessSource.d.ts +2 -0
  492. package/server/dist/workers/claudeAccessSource.js +27 -0
  493. package/server/dist/workers/claudeIsolatedLaunch.d.ts +19 -0
  494. package/server/dist/workers/claudeIsolatedLaunch.js +104 -0
  495. package/server/dist/workers/cliResearcherDoctrine.d.ts +4 -0
  496. package/server/dist/workers/cliResearcherDoctrine.js +20 -0
  497. package/server/dist/workers/codexAccessLease.d.ts +26 -0
  498. package/server/dist/workers/codexAccessLease.js +208 -0
  499. package/server/dist/workers/codexIsolatedLaunch.d.ts +21 -0
  500. package/server/dist/workers/codexIsolatedLaunch.js +95 -0
  501. package/server/dist/workers/codexIsolatedPolicy.d.ts +5 -0
  502. package/server/dist/workers/codexIsolatedPolicy.js +49 -0
  503. package/server/dist/workers/cursorIsolatedLaunch.d.ts +37 -0
  504. package/server/dist/workers/cursorIsolatedLaunch.js +178 -0
  505. package/server/dist/workers/isolatedCliHome.d.ts +4 -0
  506. package/server/dist/workers/isolatedCliHome.js +107 -0
  507. package/server/dist/workers/limits.js +1 -1
  508. package/server/dist/workers/linuxWorkerSandbox.d.ts +48 -0
  509. package/server/dist/workers/linuxWorkerSandbox.js +192 -0
  510. package/server/dist/workers/processKill.d.ts +2 -0
  511. package/server/dist/workers/processKill.js +28 -2
  512. package/server/dist/workers/providerRuntimeDiscovery.d.ts +13 -0
  513. package/server/dist/workers/providerRuntimeDiscovery.js +126 -0
  514. package/server/dist/workers/researchSandboxAvailability.d.ts +3 -0
  515. package/server/dist/workers/researchSandboxAvailability.js +78 -0
  516. package/server/dist/workers/workerAccessPass.d.ts +12 -0
  517. package/server/dist/workers/workerAccessPass.js +123 -0
  518. package/server/dist/workers/workerHiddenDirectories.d.ts +3 -0
  519. package/server/dist/workers/workerHiddenDirectories.js +16 -0
  520. package/server/dist/workers/workerSocketDirectory.d.ts +2 -0
  521. package/server/dist/workers/workerSocketDirectory.js +16 -0
  522. package/server/dist/workers/workerWebProxy.d.ts +28 -0
  523. package/server/dist/workers/workerWebProxy.js +206 -0
  524. package/server/dist/workflowMeta.d.ts +5 -0
  525. package/server/dist/workflowMeta.js +7 -3
  526. package/server/dist/workflowStore.js +43 -25
  527. package/server/dist/workflows/purgeWorkflow.js +15 -0
  528. package/server/dist/workflows/types.d.ts +6 -0
  529. package/server/dist/workspace.d.ts +1 -0
  530. package/server/dist/workspace.js +8 -0
  531. package/server/dist/ws/clusterHandlers.d.ts +5 -0
  532. package/server/dist/ws/clusterHandlers.js +373 -26
  533. package/server/dist/ws/clusterMembers.d.ts +5 -0
  534. package/server/dist/ws/clusterMembers.js +15 -5
  535. package/server/dist/ws/compactHandlers.js +43 -8
  536. package/server/dist/ws/compareHandlers.d.ts +12 -0
  537. package/server/dist/ws/compareHandlers.js +32 -14
  538. package/server/dist/ws/handoffHandlers.js +39 -3
  539. package/server/dist/ws/operatorQuestionHandlers.d.ts +5 -0
  540. package/server/dist/ws/operatorQuestionHandlers.js +17 -2
  541. package/server/dist/ws/taskLedgerHandlers.js +1 -0
  542. package/server/dist/ws/taskLifecycle.d.ts +25 -1
  543. package/server/dist/ws/taskLifecycle.js +53 -1
  544. package/server/dist/ws/turnEngine.d.ts +18 -1
  545. package/server/dist/ws/turnEngine.js +281 -52
  546. package/server/dist/ws/turnPrompt.js +3 -1
  547. package/server/dist/ws/updatePrimaryConfig.js +11 -3
  548. package/server/dist/ws/workflowHandlers.js +17 -4
  549. package/server/package.json +1 -1
  550. package/server/src/arcoHome.ts +16 -3
  551. package/server/src/auth.ts +50 -6
  552. package/server/src/authLoginSession.ts +10 -5
  553. package/server/src/capabilities.ts +13 -8
  554. package/server/src/chatMode.ts +24 -2
  555. package/server/src/checkedFile.ts +42 -31
  556. package/server/src/cliUpdateDecision.ts +1 -1
  557. package/server/src/clusterAutoTurn.ts +29 -5
  558. package/server/src/clusterBusyReminder.ts +2 -1
  559. package/server/src/clusterDirector.ts +5 -2
  560. package/server/src/clusterMailTally.ts +28 -0
  561. package/server/src/clusterMailbox.ts +49 -4
  562. package/server/src/clusterOpenWork.ts +94 -0
  563. package/server/src/clusterPeerOps.ts +238 -52
  564. package/server/src/clusterPlanBridge.ts +54 -1
  565. package/server/src/clusterPlanStore.ts +59 -0
  566. package/server/src/clusterPresets.ts +17 -3
  567. package/server/src/clusterProgress.ts +2 -2
  568. package/server/src/clusterSkills.ts +2 -2
  569. package/server/src/clusterSnapshots.ts +7 -1
  570. package/server/src/clusterStore.ts +192 -20
  571. package/server/src/clusterTurnOrigin.ts +19 -0
  572. package/server/src/connectionCatalog.ts +1 -0
  573. package/server/src/cursorUsage.ts +3 -3
  574. package/server/src/defaults/models.md +11 -14
  575. package/server/src/directorContinue.ts +309 -0
  576. package/server/src/directorContinueHook.ts +15 -0
  577. package/server/src/effortValidation.ts +31 -0
  578. package/server/src/fileAccessPolicy.ts +1 -0
  579. package/server/src/fileFetch.ts +47 -29
  580. package/server/src/geminiMembers.ts +116 -0
  581. package/server/src/git.ts +20 -22
  582. package/server/src/gitOtherWork.ts +5 -4
  583. package/server/src/gitSnapshots.ts +53 -5
  584. package/server/src/http/authLoginRoutes.ts +2 -2
  585. package/server/src/http/clusterRoutes.ts +314 -6
  586. package/server/src/http/diagnosticsRoutes.ts +9 -0
  587. package/server/src/http/fileWriteRoutes.ts +13 -5
  588. package/server/src/http/phoneUploadRoutes.ts +2 -1
  589. package/server/src/http/readConfinement.ts +30 -0
  590. package/server/src/http/recallRoutes.ts +1 -1
  591. package/server/src/http/router.ts +43 -10
  592. package/server/src/http/storageRoutes.ts +86 -7
  593. package/server/src/http/workflowDataRoutes.ts +20 -0
  594. package/server/src/http/writeConfinement.ts +10 -1
  595. package/server/src/index.ts +295 -18
  596. package/server/src/initialProviders.ts +1 -1
  597. package/server/src/manualCompactCapability.ts +1 -1
  598. package/server/src/mcp/clusterMcpLoopback.ts +2 -0
  599. package/server/src/mcp/clusterMcpServer.ts +3 -2
  600. package/server/src/mcp/clusterMcpTools.ts +83 -27
  601. package/server/src/mcp/mcpConfigWriter.ts +4 -0
  602. package/server/src/mcp/workerMailBridge.ts +99 -0
  603. package/server/src/planStore.ts +1 -0
  604. package/server/src/primitives/seedWorker.ts +19 -14
  605. package/server/src/project/taskLedger.ts +23 -0
  606. package/server/src/providers/{cursor → acp}/acpJsonRpc.ts +3 -3
  607. package/server/src/providers/acp/permissionGate.ts +47 -0
  608. package/server/src/providers/antigravity/index.ts +187 -0
  609. package/server/src/providers/antigravity/researchSignIn.ts +76 -0
  610. package/server/src/providers/antigravity/status.ts +24 -0
  611. package/server/src/providers/antigravity/usage.ts +29 -0
  612. package/server/src/providers/claude/researcherFence.ts +25 -0
  613. package/server/src/providers/claude-native/catalog.ts +5 -0
  614. package/server/src/providers/claude-native/index.ts +8 -1
  615. package/server/src/providers/claude-native/peerTools.ts +24 -4
  616. package/server/src/providers/claude-native/taskAdmission.ts +35 -9
  617. package/server/src/providers/claude-native/tools.ts +39 -19
  618. package/server/src/providers/claude-native/worker.ts +270 -52
  619. package/server/src/providers/claude-native/workerHelpers.ts +88 -5
  620. package/server/src/providers/claude.ts +160 -22
  621. package/server/src/providers/clusterTaskToolDefinitions.ts +2 -1
  622. package/server/src/providers/codex-appserver/heldCommands.ts +7 -3
  623. package/server/src/providers/codex-appserver/index.ts +87 -3
  624. package/server/src/providers/codex-appserver/lateCommands.ts +1 -0
  625. package/server/src/providers/codex-appserver/modelAvailability.ts +40 -0
  626. package/server/src/providers/codex-appserver/worker.ts +155 -25
  627. package/server/src/providers/codex.ts +1 -0
  628. package/server/src/providers/codexVersion.ts +9 -0
  629. package/server/src/providers/codexWebSearch.ts +1 -1
  630. package/server/src/providers/cursor/agentEnv.ts +103 -0
  631. package/server/src/providers/cursor/authState.ts +2 -1
  632. package/server/src/providers/cursor/authToken.ts +137 -31
  633. package/server/src/providers/cursor/catalog.ts +89 -1
  634. package/server/src/providers/cursor/chatSandbox.ts +20 -8
  635. package/server/src/providers/cursor/isolated.ts +282 -0
  636. package/server/src/providers/cursor/isolatedVersion.ts +33 -0
  637. package/server/src/providers/cursor/modelMap.ts +9 -5
  638. package/server/src/providers/cursor/print.ts +10 -8
  639. package/server/src/providers/cursor/worker.ts +8 -3
  640. package/server/src/providers/index.ts +10 -2
  641. package/server/src/providers/llamacpp.ts +3 -1
  642. package/server/src/providers/ollama.ts +30 -11
  643. package/server/src/providers/ollamaTools.ts +33 -27
  644. package/server/src/research/exportResults.ts +47 -0
  645. package/server/src/research/isolatedArtifact.ts +48 -0
  646. package/server/src/research/quickPromotion.ts +325 -0
  647. package/server/src/research/quickResearchChat.ts +147 -0
  648. package/server/src/research/researchClose.ts +340 -0
  649. package/server/src/research/researchCopy.ts +170 -0
  650. package/server/src/research/researchCreate.ts +306 -0
  651. package/server/src/research/researchDoctrine.ts +27 -0
  652. package/server/src/research/researchFolder.ts +202 -0
  653. package/server/src/research/researchLibrary.ts +306 -0
  654. package/server/src/research/researchRetry.ts +86 -0
  655. package/server/src/research/researchRounds.ts +891 -0
  656. package/server/src/research/researchState.ts +309 -0
  657. package/server/src/research/researchTools.ts +59 -0
  658. package/server/src/research/researchTripwires.ts +158 -0
  659. package/server/src/research/resultSelection.ts +127 -0
  660. package/server/src/research/savedQuickPromotion.ts +174 -0
  661. package/server/src/research/sendToProject.ts +220 -0
  662. package/server/src/server/broadcast.ts +39 -5
  663. package/server/src/server/updateCheck.ts +1 -0
  664. package/server/src/settings.ts +22 -5
  665. package/server/src/skillActivity.ts +35 -0
  666. package/server/src/smartPickup.ts +14 -4
  667. package/server/src/smartPickupAdapters.ts +3 -2
  668. package/server/src/smartPickupEvaluator.ts +3 -0
  669. package/server/src/smartPickupObserver.ts +38 -12
  670. package/server/src/storageActions.ts +6 -0
  671. package/server/src/storageOverview.ts +13 -6
  672. package/server/src/taskDispatcher.ts +3 -1
  673. package/server/src/toolboxWorkflow.ts +2 -1
  674. package/server/src/updateCheck.ts +31 -3
  675. package/server/src/workers/StreamParser.ts +20 -1
  676. package/server/src/workers/WorkerManager.ts +10 -1
  677. package/server/src/workers/antigravityIsolatedLaunch.ts +82 -0
  678. package/server/src/workers/checkedLinuxWorker.ts +212 -0
  679. package/server/src/workers/claudeAccessLease.ts +122 -0
  680. package/server/src/workers/claudeAccessSource.ts +20 -0
  681. package/server/src/workers/claudeIsolatedLaunch.ts +91 -0
  682. package/server/src/workers/cliResearcherDoctrine.ts +20 -0
  683. package/server/src/workers/codexAccessLease.ts +146 -0
  684. package/server/src/workers/codexIsolatedLaunch.ts +72 -0
  685. package/server/src/workers/codexIsolatedPolicy.ts +38 -0
  686. package/server/src/workers/cursorIsolatedLaunch.ts +159 -0
  687. package/server/src/workers/isolatedCliHome.ts +75 -0
  688. package/server/src/workers/limits.ts +1 -1
  689. package/server/src/workers/linuxWorkerSandbox.ts +193 -0
  690. package/server/src/workers/processKill.ts +34 -2
  691. package/server/src/workers/providerRuntimeDiscovery.ts +108 -0
  692. package/server/src/workers/researchSandboxAvailability.ts +68 -0
  693. package/server/src/workers/workerAccessPass.ts +96 -0
  694. package/server/src/workers/workerHiddenDirectories.ts +16 -0
  695. package/server/src/workers/workerSocketDirectory.ts +13 -0
  696. package/server/src/workers/workerWebProxy.ts +194 -0
  697. package/server/src/workflowMeta.ts +10 -3
  698. package/server/src/workflowStore.ts +39 -26
  699. package/server/src/workflows/purgeWorkflow.ts +18 -0
  700. package/server/src/workflows/types.ts +13 -0
  701. package/server/src/workspace.ts +8 -0
  702. package/server/src/ws/clusterHandlers.ts +302 -26
  703. package/server/src/ws/clusterMembers.ts +15 -5
  704. package/server/src/ws/compactHandlers.ts +37 -5
  705. package/server/src/ws/compareHandlers.ts +34 -11
  706. package/server/src/ws/handoffHandlers.ts +36 -3
  707. package/server/src/ws/operatorQuestionHandlers.ts +14 -2
  708. package/server/src/ws/taskLedgerHandlers.ts +1 -0
  709. package/server/src/ws/taskLifecycle.ts +58 -4
  710. package/server/src/ws/turnEngine.ts +265 -49
  711. package/server/src/ws/turnPrompt.ts +3 -1
  712. package/server/src/ws/updatePrimaryConfig.ts +10 -3
  713. package/server/src/ws/workflowHandlers.ts +15 -4
  714. package/shared/dist/clusterCoordination.d.ts +1 -0
  715. package/shared/dist/clusterCoordination.js +9 -1
  716. package/shared/dist/clusterRolePresets.js +13 -4
  717. package/shared/dist/index.d.ts +1 -0
  718. package/shared/dist/index.js +1 -0
  719. package/shared/dist/protocol/autoPickup.d.ts +7 -0
  720. package/shared/dist/protocol/autoPickup.js +22 -11
  721. package/shared/dist/protocol/chat.d.ts +1 -1
  722. package/shared/dist/protocol/checkpoints.d.ts +1 -0
  723. package/shared/dist/protocol/clientMessages.d.ts +18 -3
  724. package/shared/dist/protocol/clusters.d.ts +177 -4
  725. package/shared/dist/protocol/clusters.js +48 -2
  726. package/shared/dist/protocol/handoffs.d.ts +1 -0
  727. package/shared/dist/protocol/models.d.ts +6 -1
  728. package/shared/dist/protocol/models.js +4 -3
  729. package/shared/dist/protocol/providers.d.ts +3 -2
  730. package/shared/dist/protocol/providers.js +1 -1
  731. package/shared/dist/protocol/serverMessages.d.ts +28 -3
  732. package/shared/dist/protocol/settings.d.ts +4 -0
  733. package/shared/dist/protocol/settings.js +3 -1
  734. package/shared/dist/protocol/tasks.d.ts +42 -0
  735. package/shared/dist/protocol/tasks.js +17 -0
  736. package/shared/dist/protocol/workflows.d.ts +4 -0
  737. package/shared/dist/protocol/workflows.js +2 -0
  738. package/shared/dist/researchActivity.d.ts +4 -0
  739. package/shared/dist/researchActivity.js +29 -0
  740. package/shared/src/clusterCoordination.ts +12 -1
  741. package/shared/src/clusterRolePresets.ts +13 -4
  742. package/shared/src/index.ts +2 -0
  743. package/shared/src/protocol/autoPickup.ts +28 -11
  744. package/shared/src/protocol/chat.ts +1 -1
  745. package/shared/src/protocol/checkpoints.ts +1 -0
  746. package/shared/src/protocol/clientMessages.ts +14 -0
  747. package/shared/src/protocol/clusters.ts +231 -5
  748. package/shared/src/protocol/handoffs.ts +1 -0
  749. package/shared/src/protocol/models.ts +11 -4
  750. package/shared/src/protocol/providers.ts +6 -3
  751. package/shared/src/protocol/reviews.ts +2 -2
  752. package/shared/src/protocol/serverMessages.ts +28 -3
  753. package/shared/src/protocol/settings.ts +14 -1
  754. package/shared/src/protocol/tasks.ts +73 -0
  755. package/shared/src/protocol/workflows.ts +8 -0
  756. package/shared/src/researchActivity.ts +23 -0
  757. package/client/dist/assets/XtermView-Xk7_9JaH.js +0 -10
  758. package/client/dist/assets/index-BEFgrUJJ.css +0 -1
  759. package/client/dist/assets/index-C7WzZfsr.js +0 -614
  760. package/client/src/components/HeaderAuthChip.tsx +0 -207
  761. /package/server/dist/providers/{cursor → acp}/acpJsonRpc.d.ts +0 -0
@@ -0,0 +1,35 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { promisify } from 'node:util';
3
+ import { commandArgs } from '../../windowsCommand.js';
4
+ const exec = promisify(execFile);
5
+ export function parseAntigravityUsage(text) {
6
+ try {
7
+ const value = JSON.parse(text);
8
+ if (value.status !== 'SUCCESS' || value.command?.name !== 'usage' || !Array.isArray(value.command.data?.groups))
9
+ return null;
10
+ const pools = [];
11
+ for (const group of value.command.data.groups) {
12
+ if (typeof group.name !== 'string' || !Array.isArray(group.buckets))
13
+ return null;
14
+ for (const bucket of group.buckets) {
15
+ if (typeof bucket.name !== 'string' || typeof bucket.remaining_fraction !== 'number' || !Number.isFinite(bucket.remaining_fraction) || bucket.remaining_fraction < 0 || bucket.remaining_fraction > 1 || typeof bucket.reset_time !== 'string' || Number.isNaN(Date.parse(bucket.reset_time)))
16
+ return null;
17
+ pools.push({ name: `${group.name} · ${bucket.name}`, percentLeft: Math.round(bucket.remaining_fraction * 100), reset: bucket.reset_time });
18
+ }
19
+ }
20
+ return pools.length ? pools : null;
21
+ }
22
+ catch {
23
+ return null;
24
+ }
25
+ }
26
+ export async function getAntigravityUsage() {
27
+ try {
28
+ const { stdout } = await exec(...commandArgs('agy', ['-p', '/usage', '--output-format', 'json']), { timeout: 5000, killSignal: 'SIGKILL', maxBuffer: 256 * 1024, windowsHide: true });
29
+ return parseAntigravityUsage(stdout);
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1,7 @@
1
+ /** CLI-only policy; callers must also apply and verify the outer OS sandbox. */
2
+ export declare function claudeResearcherFence(options: {
3
+ webAccess: boolean;
4
+ webProxyPort: number;
5
+ }): {
6
+ args: string[];
7
+ };
@@ -0,0 +1,27 @@
1
+ /** CLI-only policy; callers must also apply and verify the outer OS sandbox. */
2
+ export function claudeResearcherFence(options) {
3
+ if (!Number.isInteger(options.webProxyPort) || options.webProxyPort < 1 || options.webProxyPort > 65535) {
4
+ throw new Error('A valid sandbox proxy port is required.');
5
+ }
6
+ const tools = ['Bash', 'Read', 'Write', 'Edit', 'Glob', 'Grep'];
7
+ if (options.webAccess)
8
+ tools.push('WebSearch', 'WebFetch');
9
+ const settings = {
10
+ permissions: {
11
+ blockReadsOutsideWorkingDirectories: true,
12
+ blockWritesOutsideWorkingDirectories: true,
13
+ denyInsteadOfPrompting: true,
14
+ allow: ['Bash(*)', 'Read(//work/**)', 'Edit(//work/**)', 'mcp__arco-cluster__peer_read', 'mcp__arco-cluster__peer_send'],
15
+ deny: ['Read(//home/**)', 'Edit(//home/**)', 'Read(//run/arco-access.json)', 'Read(//run/arco-check.json)'],
16
+ },
17
+ sandbox: {
18
+ enabled: true,
19
+ failIfUnavailable: true,
20
+ allowUnsandboxedCommands: false,
21
+ filesystem: { denyRead: ['/home/worker', '/run/arco-access.json', '/run/arco-check.json'], allowRead: ['/work'] },
22
+ network: { httpProxyPort: options.webProxyPort, allowUnixSockets: ['/run/arco-mail.sock'] },
23
+ },
24
+ };
25
+ return { args: ['--permission-mode', 'dontAsk', '--tools', tools.join(','), '--settings', JSON.stringify(settings), '--strict-mcp-config'] };
26
+ }
27
+ //# sourceMappingURL=researcherFence.js.map
@@ -1,4 +1,4 @@
1
- import { type ClaudeCatalogSnapshot } from '@arco/shared';
1
+ import { type ClaudeCatalogModel, type ClaudeCatalogSnapshot } from '@arco/shared';
2
2
  export interface AnthropicModel {
3
3
  type: 'model';
4
4
  id: string;
@@ -61,6 +61,7 @@ export declare function getCachedModelCapabilities(modelId: string): {
61
61
  supportsClearToolUses: boolean;
62
62
  supportsCompact: boolean;
63
63
  } | null;
64
+ export declare function getCachedClaudeModelEfforts(modelId: string): ClaudeCatalogModel['supportedEfforts'] | undefined;
64
65
  export declare function hasCatalogCache(): boolean;
65
66
  export declare function resolveClaudeAliasFromCatalog(modelId: string): string;
66
67
  export declare function getCatalog(force?: boolean): Promise<ClaudeCatalogSnapshot>;
@@ -37,6 +37,10 @@ export function getCachedModelCapabilities(modelId) {
37
37
  supportsCompact: m.supportsCompact,
38
38
  };
39
39
  }
40
+ // The picker uses the same cached model efforts when a catalog is available.
41
+ export function getCachedClaudeModelEfforts(modelId) {
42
+ return cache?.models.find((model) => model.id === modelId)?.supportedEfforts;
43
+ }
40
44
  // True once a non-empty catalog has been fetched in this process. Callers use
41
45
  // it to decide whether an alias resolution is catalog-backed or a static guess.
42
46
  export function hasCatalogCache() {
@@ -5,6 +5,7 @@ import type { Todo } from './tools.js';
5
5
  export declare function setClaudeNativeTodosBroadcast(fn: (workflowId: string, todos: Todo[]) => void): void;
6
6
  export declare function setClaudeNativePlanBroadcast(fn: (workflowId: string) => PlanBroadcast): void;
7
7
  export declare function setClaudeNativeTaskHandler(fn: TaskSpawnHandler): void;
8
+ export declare function setClaudeNativeTaskNoticeHandler(fn: (workflowId: string, text: string) => void): void;
8
9
  export declare function setClaudeNativeHookWakeHandler(fn: (workflowId: string, text: string) => void): void;
9
10
  export declare function setClaudeNativeWorkflowEventBroadcast(fn: (workflowId: string, msg: ServerMessage) => void): void;
10
11
  export declare function setClaudeNativeClusterEventBroadcast(fn: (clusterId: string, msg: ServerMessage) => void): void;
@@ -35,6 +35,11 @@ export function setClaudeNativeTaskHandler(fn) {
35
35
  // An asyncRewake hook that exits 2 while the tab is idle starts a turn with
36
36
  // its report. Server wires this to the workflow's follow-up queue.
37
37
  let hookWakeFn = null;
38
+ let taskNoticeFn = null;
39
+ // docs/PROVIDERS.md "Background sub-agents": finished children reach the parent.
40
+ export function setClaudeNativeTaskNoticeHandler(fn) {
41
+ taskNoticeFn = fn;
42
+ }
38
43
  export function setClaudeNativeHookWakeHandler(fn) {
39
44
  hookWakeFn = fn;
40
45
  }
@@ -114,7 +119,9 @@ class ClaudeNativeTurn extends EventEmitter {
114
119
  });
115
120
  }
116
121
  async interrupt() {
117
- this.kill();
122
+ // INTERRUPT & SEND: background sub-agents keep running.
123
+ if (!this.settled)
124
+ this.worker.cancel({ keepBackground: true });
118
125
  await this.running;
119
126
  return this.worker.turnInputAccepted;
120
127
  }
@@ -243,6 +250,7 @@ function acquireWorker(workflowId, config) {
243
250
  if (taskHandlerFn)
244
251
  fresh.setTaskHandler(taskHandlerFn);
245
252
  fresh.setHookWakeHandler((text) => hookWakeFn?.(workflowId, text));
253
+ fresh.setTaskNoticeHandler((text) => taskNoticeFn?.(workflowId, text));
246
254
  if (workflowEventBroadcast) {
247
255
  const wfid = workflowId;
248
256
  fresh.setWorkflowEventBroadcast((msg) => { workflowEventBroadcast?.(wfid, msg); });
@@ -13,5 +13,6 @@ export declare function isPeerTool(name: string): boolean;
13
13
  export declare function getPeerToolDefinitions(opts?: {
14
14
  taskBoardAttached?: boolean;
15
15
  accessMode?: ClusterMemberAccessMode;
16
+ researchDirector?: boolean;
16
17
  }): ClaudeToolDef[];
17
18
  export declare function executePeerTool(name: string, args: Record<string, unknown>, ctx: PeerToolContext): Promise<string>;
@@ -2,10 +2,14 @@ import { PEER_SEND_GUARD_DESCRIPTION } from '@arco/shared';
2
2
  import { CLUSTER_TASK_TOOL_DEFINITIONS } from '../clusterTaskToolDefinitions.js';
3
3
  import * as peerOps from '../../clusterPeerOps.js';
4
4
  import { formatBoardForModel } from '../../project/taskLedger.js';
5
+ import { formatResearchRoundResult, RESEARCH_ROUND_TOOL, RESEARCH_SEND_TOOL, proposeResearchSend, researchHeldNote } from '../../research/researchTools.js';
6
+ import { startRound } from '../../research/researchRounds.js';
5
7
  const PEER_TOOL_NAMES = new Set([
6
8
  'peer_list',
7
9
  'peer_send',
8
10
  'peer_read',
11
+ 'research_round',
12
+ 'research_send_to_project',
9
13
  'cluster_plan_read',
10
14
  'cluster_plan_tick',
11
15
  'cluster_plan_write',
@@ -58,6 +62,7 @@ export function getPeerToolDefinitions(opts) {
58
62
  to: { type: 'string', description: 'Peer 8-char display name or full workflowId.' },
59
63
  content: { type: 'string', description: 'Message body (≤ 16 KB UTF-8).' },
60
64
  confirm: { type: 'boolean', description: 'Deliver a status-only message after the first send asks for confirmation.' },
65
+ task_id: { type: 'string', description: "When this message hands a board task to the recipient, the task's full id from cluster_task_list. Arco records the handoff on the task so it can tell the operator the task reached that member. An id not on this cluster's board is refused and nothing is sent." },
61
66
  artifact_paths: {
62
67
  type: 'array',
63
68
  items: { type: 'string' },
@@ -77,7 +82,7 @@ export function getPeerToolDefinitions(opts) {
77
82
  },
78
83
  {
79
84
  name: 'cluster_plan_read',
80
- description: 'Read the full shared cluster plan (markdown body + title + updatedAt). The plan copy injected into your context at turn start may be an OUTLINE (headings, checkbox lines, and labelled standing-directive sections; other prose omitted) when the full plan is large — call this whenever you need the complete text, e.g. before cluster_plan_write or when an outline item needs its surrounding detail. Read-only; cluster mode only.',
85
+ description: 'Read the full shared cluster plan (plan ID + revision + markdown body + title + updatedAt). The plan copy injected into your context at turn start may be an OUTLINE (headings, checkbox lines, and labelled standing-directive sections; other prose omitted) when the full plan is large — call this whenever you need the complete text, e.g. before cluster_plan_write or when an outline item needs its surrounding detail. Read-only; cluster mode only.',
81
86
  input_schema: {
82
87
  type: 'object',
83
88
  properties: {},
@@ -102,7 +107,7 @@ export function getPeerToolDefinitions(opts) {
102
107
  },
103
108
  {
104
109
  name: 'cluster_plan_write',
105
- description: "Write the shared cluster plan body (markdown). Use this to author the initial plan or append/restructure its tasks as scope evolves. Do not write testing, gate or CI standing rules unless the operator asked for them. The plan holds standing rules and tasks only: never write progress/status notes, evidence, commit hashes, CI ids, test counts, or dates into it (those belong on board tasks or in artifacts). Model-driven writes are additive: if a plan already exists, the server rejects writes that remove existing checkbox tasks or change their `[ ]`/`[x]` status. Use cluster_plan_tick for status changes, and ask the operator to replace/clear the plan from the PLAN tab for destructive edits. Body cannot be empty and is capped at 32768 chars.\n\nConvention: only the cluster director should call this. Other members should propose plan changes via peer_send to the director rather than writing directly.\n\nIMPORTANT: if the plan copy in your context is marked as an outline (prose omitted), call cluster_plan_read FIRST and base your rewrite on the full body — rewriting from the outline would silently delete the plan's prose.",
110
+ description: "Write the shared cluster plan body (markdown). Use this to author the initial plan or append/restructure its tasks as scope evolves. Do not write testing, gate or CI standing rules unless the operator asked for them. The plan holds standing rules and tasks only: never write progress/status notes, evidence, commit hashes, CI ids, test counts, or dates into it (those belong on board tasks or in artifacts). Keep each new or lengthened checkbox summary within 240 characters, excluding the item ID and reference links. Put assignment and evidence on the board and specifications in reference docs. Existing numbered items can be shortened when the ID is unique. Model-driven writes cannot remove existing tasks or change their `[ ]`/`[x]` status. Use cluster_plan_tick for status changes, and ask the operator to replace/clear the plan from the PLAN tab for destructive edits. Body cannot be empty and is capped at 32768 chars.\n\nConvention: only the cluster director should call this. Other members should propose plan changes via peer_send to the director rather than writing directly.\n\nIMPORTANT: if the plan copy in your context is marked as an outline (prose omitted), call cluster_plan_read FIRST and base your rewrite on the full body — rewriting from the outline would silently delete the plan's prose.",
106
111
  input_schema: {
107
112
  type: 'object',
108
113
  properties: {
@@ -116,6 +121,8 @@ export function getPeerToolDefinitions(opts) {
116
121
  if (opts?.accessMode && opts.accessMode !== 'standard') {
117
122
  return defs.filter((def) => def.name === 'peer_send' || def.name === 'peer_read');
118
123
  }
124
+ if (opts?.researchDirector)
125
+ defs.push(RESEARCH_ROUND_TOOL, RESEARCH_SEND_TOOL);
119
126
  return opts?.taskBoardAttached === true ? defs : defs.filter((def) => !TASK_TOOL_NAMES.has(def.name));
120
127
  }
121
128
  function asString(v, name) {
@@ -158,23 +165,37 @@ export async function executePeerTool(name, args, ctx) {
158
165
  to,
159
166
  content,
160
167
  confirm: args.confirm === true,
168
+ ...(typeof args.task_id === 'string' ? { taskId: args.task_id } : {}),
161
169
  ...(Array.isArray(args.artifact_paths)
162
170
  ? { artifactPaths: args.artifact_paths.filter((p) => typeof p === 'string') }
163
171
  : {}),
164
172
  });
165
173
  if (!result.ok)
166
174
  return `[error] ${result.message}`;
167
- return JSON.stringify({ msgId: result.msgId, to: result.to, deliveredImmediately: result.deliveredImmediately, ...(result.recipientContext ? { recipientContext: result.recipientContext } : {}), ...(result.guard ? { guard: result.guard } : {}) }, null, 2);
175
+ return JSON.stringify({ msgId: result.msgId, to: result.to, deliveredImmediately: result.deliveredImmediately, ...(result.heldForRound !== undefined ? { heldForRound: Math.max(1, result.heldForRound), note: researchHeldNote(result.heldForRound) } : {}), ...(result.replaced ? { replaced: result.replaced } : {}), ...(result.recipientContext ? { recipientContext: result.recipientContext } : {}), ...(result.guard ? { guard: result.guard } : {}) }, null, 2);
168
176
  }
169
177
  case 'peer_read': {
170
178
  const projected = await peerOps.peerRead(opsCtx);
171
179
  return JSON.stringify(projected, null, 2);
172
180
  }
181
+ case 'research_round': {
182
+ const result = await startRound(ctx.clusterId, ctx.workflowId, typeof args.text === 'string' ? args.text : '');
183
+ return formatResearchRoundResult(result);
184
+ }
185
+ case 'research_send_to_project': {
186
+ try {
187
+ await proposeResearchSend(ctx.clusterId, ctx.workflowId, args);
188
+ return 'The proposal is in RESULTS. The operator chooses a destination and sends it.';
189
+ }
190
+ catch (error) {
191
+ return `[error] ${error instanceof Error ? error.message : String(error)}`;
192
+ }
193
+ }
173
194
  case 'cluster_plan_read': {
174
195
  const result = await peerOps.peerPlanRead(opsCtx);
175
196
  if (!result.ok)
176
197
  return `[error] ${result.code}: ${result.message}`;
177
- return JSON.stringify({ title: result.title, body: result.body, updatedAt: result.updatedAt, byteLength: result.byteLength }, null, 2);
198
+ return JSON.stringify({ planId: result.planId, revision: result.revision, title: result.title, body: result.body, updatedAt: result.updatedAt, byteLength: result.byteLength }, null, 2);
178
199
  }
179
200
  case 'cluster_plan_tick': {
180
201
  // The model may pass either field; validate without throwing so the
@@ -313,6 +334,7 @@ export async function executePeerTool(name, args, ctx) {
313
334
  ...(typeof args.release === 'string' ? { release: args.release } : {}),
314
335
  // §D3 — advisory sign-off; peerTaskUpdate validates state + stamps author.
315
336
  ...(args.signoff !== undefined ? { signoff: args.signoff } : {}),
337
+ ...(args.completePlan !== undefined ? { completePlan: args.completePlan } : {}),
316
338
  }, bcastCluster);
317
339
  if (!result.ok)
318
340
  return `[error] ${result.code}: ${result.message}`;
@@ -2,6 +2,12 @@ export interface NativeTaskLimits {
2
2
  maxRunning: number;
3
3
  maxStarts: number;
4
4
  }
5
+ export declare function nativeTaskBatchApprovalReasons(input: {
6
+ starts: number;
7
+ parentModel: string;
8
+ effectiveModels: string[];
9
+ requestedModels?: string[];
10
+ }): Array<'count' | 'cost' | 'unknown_cost'>;
5
11
  export declare function assertNativeTaskAllowed(context: {
6
12
  interactionMode?: string;
7
13
  inCluster?: boolean;
@@ -13,7 +19,7 @@ export declare class NativeTaskAdmission {
13
19
  private reserved;
14
20
  private active;
15
21
  private queue;
16
- acquire(turn: AbortSignal, limits: NativeTaskLimits, request?: AbortSignal): Promise<{
22
+ acquire(turn: AbortSignal, limits: NativeTaskLimits, request?: AbortSignal, lifetime?: AbortSignal): Promise<{
17
23
  started(): void;
18
24
  release(): void;
19
25
  }>;
@@ -1,3 +1,20 @@
1
+ // Different models are conservatively unknown unless a maintained price
2
+ // source can establish their relative cost for the actual versions.
3
+ export function nativeTaskBatchApprovalReasons(input) {
4
+ const reasons = new Set();
5
+ if (input.starts + input.effectiveModels.length > 4)
6
+ reasons.add('count');
7
+ const parent = input.parentModel.trim().toLowerCase();
8
+ // Consider a requested model even when an operator override changes the
9
+ // effective model: the request is still part of the approval decision.
10
+ for (const name of [...input.effectiveModels, ...(input.requestedModels ?? [])]) {
11
+ const model = name.trim().toLowerCase();
12
+ if (model && model === parent)
13
+ continue;
14
+ reasons.add('unknown_cost');
15
+ }
16
+ return [...reasons];
17
+ }
1
18
  export function assertNativeTaskAllowed(context) {
2
19
  if (context.interactionMode === 'chat' || context.inCluster || context.taskDisabled) {
3
20
  throw new Error('Task not available in Chat, cluster members or depth-capped children.');
@@ -10,12 +27,17 @@ export class NativeTaskAdmission {
10
27
  reserved = 0;
11
28
  active = 0;
12
29
  queue = [];
13
- async acquire(turn, limits, request = turn) {
14
- if (turn.aborted || request.aborted)
30
+ // `turn` counts starts. A background request (docs/PROVIDERS.md "Background
31
+ // sub-agents") passes the parent tab's `lifetime`: it survives the end of
32
+ // the turn and a new turn, and still occupies a running place until it ends.
33
+ async acquire(turn, limits, request = turn, lifetime) {
34
+ const life = lifetime ?? turn;
35
+ const background = life !== turn;
36
+ if (turn.aborted || request.aborted || life.aborted)
15
37
  throw aborted();
16
38
  if (this.turn !== turn) {
17
39
  this.turn = turn;
18
- for (const queued of [...this.queue])
40
+ for (const queued of this.queue.filter((q) => !q.background))
19
41
  queued.cancel();
20
42
  this.limits = { ...limits };
21
43
  this.reserved = 0;
@@ -26,7 +48,7 @@ export class NativeTaskAdmission {
26
48
  this.reserved++;
27
49
  return await new Promise((resolve, reject) => {
28
50
  let finished = false;
29
- const cleanup = () => { turn.removeEventListener('abort', cancel); request.removeEventListener('abort', cancel); };
51
+ const cleanup = () => { life.removeEventListener('abort', cancel); request.removeEventListener('abort', cancel); };
30
52
  const cancel = () => {
31
53
  if (finished)
32
54
  return;
@@ -38,10 +60,10 @@ export class NativeTaskAdmission {
38
60
  reject(aborted());
39
61
  this.drain();
40
62
  };
41
- const waiter = { cancel, enter: () => {
63
+ const waiter = { background, cancel, enter: () => {
42
64
  if (finished)
43
65
  return;
44
- if (turn.aborted || request.aborted || this.turn !== turn) {
66
+ if (life.aborted || request.aborted || (!background && this.turn !== turn)) {
45
67
  cancel();
46
68
  return;
47
69
  }
@@ -60,8 +82,8 @@ export class NativeTaskAdmission {
60
82
  this.drain();
61
83
  } });
62
84
  } };
63
- turn.addEventListener('abort', cancel, { once: true });
64
- if (request !== turn)
85
+ life.addEventListener('abort', cancel, { once: true });
86
+ if (request !== life)
65
87
  request.addEventListener('abort', cancel, { once: true });
66
88
  this.queue.push(waiter);
67
89
  this.drain();
@@ -27,6 +27,7 @@ export interface NativeToolContext {
27
27
  prompt: string;
28
28
  subagentType?: string;
29
29
  model?: string;
30
+ runInBackground?: boolean;
30
31
  }) => Promise<string>;
31
32
  readTaskOutput?: (taskId: string) => Promise<string>;
32
33
  taskDisabled?: boolean;
@@ -40,6 +40,7 @@ const BASH_TIMEOUT_MIN_MS = 1_000;
40
40
  const BASH_TAIL_MAX_LINES = 2_000;
41
41
  // DD2 — grace period between SIGTERM and the SIGKILL escalation in killTree.
42
42
  const KILL_GRACE_MS = 2_000;
43
+ const SHELL_CLOSE_GRACE_MS = 2_500;
43
44
  // JS-walker fallback only — `rg` path is unbounded.
44
45
  const GREP_WALK_FILE_CAP = 5000;
45
46
  // Detect ripgrep once at module load. CLI shells to rg (multi-threaded, Rust,
@@ -592,30 +593,51 @@ function spawnShell(command, cwd) {
592
593
  env: { ...process.env },
593
594
  stdio: ['ignore', 'pipe', 'pipe'],
594
595
  });
595
- child.once('close', run.cleanup);
596
+ let startCloseGrace = () => { };
597
+ const completion = new Promise((resolve) => {
598
+ let code = null;
599
+ let signal = null;
600
+ let timer;
601
+ let settled = false;
602
+ const finish = (leftOpen, error) => {
603
+ if (settled)
604
+ return;
605
+ settled = true;
606
+ if (timer)
607
+ clearTimeout(timer);
608
+ if (leftOpen) {
609
+ child.stdout?.destroy();
610
+ child.stderr?.destroy();
611
+ }
612
+ run.cleanup();
613
+ resolve({ code, signal, error, leftOpen });
614
+ };
615
+ startCloseGrace = () => { if (!timer && !settled)
616
+ timer = setTimeout(() => finish(true), SHELL_CLOSE_GRACE_MS); };
617
+ child.once('exit', (exitCode, exitSignal) => { code = exitCode; signal = exitSignal; startCloseGrace(); });
618
+ child.once('close', (exitCode, exitSignal) => { code = exitCode; signal = exitSignal; finish(false); });
619
+ child.once('error', (error) => finish(false, error));
620
+ });
596
621
  // DD2 — terminate gracefully (SIGTERM) then escalate to SIGKILL after a grace
597
622
  // period if the tree is still alive. A flat SIGKILL gives the child no chance
598
623
  // to flush/clean up (orphaned lockfiles, half-written output); SIGTERM-first
599
624
  // matches how a shell's Ctrl-C behaves. The escalation timer is unref'd so it
600
625
  // never keeps the server process alive on its own.
601
626
  const kills = [];
602
- const exited = new Promise((resolve) => {
603
- child.once('close', () => resolve());
604
- child.once('error', () => resolve());
605
- });
606
627
  const killTree = () => {
628
+ startCloseGrace();
607
629
  const signalTree = (sig) => { kills.push(signalChildTree(child, sig)); };
608
630
  signalTree('SIGTERM');
609
631
  const t = setTimeout(() => signalTree('SIGKILL'), KILL_GRACE_MS);
610
632
  if (typeof t.unref === 'function')
611
633
  t.unref();
612
634
  };
613
- // Closed, and the kills sent until then have finished.
614
- const ended = exited.then(() => Promise.all(kills)).then(() => undefined, () => undefined);
615
- return { child, killTree, ended };
635
+ // Completion and any signals sent by then have finished.
636
+ const ended = completion.then(() => Promise.all(kills)).then(() => undefined, () => undefined);
637
+ return { child, killTree, ended, completion };
616
638
  }
617
639
  async function runBashForeground(command, timeoutMs, ctx) {
618
- const { child, killTree, ended } = spawnShell(command, ctx.cwd);
640
+ const { child, killTree, ended, completion } = spawnShell(command, ctx.cwd);
619
641
  const shellId = ctx.shells.mintId();
620
642
  ctx.shells.byId.set(shellId, { kill: killTree, backgrounded: false, ended });
621
643
  return new Promise((resolveResult) => {
@@ -656,7 +678,7 @@ async function runBashForeground(command, timeoutMs, ctx) {
656
678
  ctx.abortSignal.addEventListener('abort', onAbort, { once: true });
657
679
  child.stdout?.on('data', (b) => acc.push(b));
658
680
  child.stderr?.on('data', (b) => acc.push(b));
659
- const finish = (exitDescription, exitCode, signal, spawnError = false) => {
681
+ const finish = (exitDescription, exitCode, signal, spawnError = false, leftOpen = false) => {
660
682
  if (finished)
661
683
  return;
662
684
  finished = true;
@@ -675,6 +697,8 @@ async function runBashForeground(command, timeoutMs, ctx) {
675
697
  parts.push(`[timed out after ${timeoutMs}ms]`);
676
698
  if (aborted)
677
699
  parts.push('[aborted]');
700
+ if (leftOpen)
701
+ parts.push('[A background process still holds the command output and was left running.]');
678
702
  if (r.truncated) {
679
703
  const total = r.truncatedBy === 'lines' ? `${r.totalLines} lines` : `${r.totalBytes.toLocaleString()} bytes`;
680
704
  const tailKb = Math.round(MAX_TOOL_OUTPUT_BYTES / 1024);
@@ -691,20 +715,23 @@ async function runBashForeground(command, timeoutMs, ctx) {
691
715
  parts.push('(no output)');
692
716
  resolveResult({ text: parts.join('\n'), isError: spawnError || timedOut || aborted || exitCode !== 0, exitCode, signal, timedOut, aborted });
693
717
  };
694
- child.on('error', (err) => finish(`[error] failed to spawn shell: ${err.message}`, null, null, true));
695
- child.on('close', (code, signal) => {
718
+ void completion.then(({ code, signal, error, leftOpen }) => {
719
+ if (error) {
720
+ finish(`[error] failed to spawn shell: ${error.message}`, null, null, true);
721
+ return;
722
+ }
696
723
  const desc = code === null ? `exit signal: ${signal ?? 'unknown'}` : `exit code: ${code}`;
697
- finish(desc, code, signal);
724
+ finish(desc, code, signal, false, leftOpen);
698
725
  });
699
726
  });
700
727
  }
701
728
  function runBashBackground(command, ctx) {
702
- const { child, killTree, ended } = spawnShell(command, ctx.cwd);
729
+ const { child, killTree, ended, completion } = spawnShell(command, ctx.cwd);
703
730
  const shellId = ctx.shells.mintId();
704
731
  ctx.shells.byId.set(shellId, { kill: killTree, backgrounded: true, ended });
705
732
  // Auto-deregister on natural exit so KillShell on a finished bg job
706
733
  // returns the "no such shell" message rather than reporting success.
707
- child.on('close', () => { ctx.shells.byId.delete(shellId); });
734
+ void completion.then(() => { ctx.shells.byId.delete(shellId); });
708
735
  // Don't accumulate output for background — the caller asked for a
709
736
  // detached shell. Drain to /dev/null so the pipe buffer doesn't
710
737
  // back-pressure the child.
@@ -715,7 +742,7 @@ function runBashBackground(command, ctx) {
715
742
  const BashTool = {
716
743
  def: {
717
744
  name: 'Bash',
718
- description: 'Run a shell command in the workflow cwd via sh -c. Foreground: returns stdout+stderr (combined cap 64 KB) + exit code. Default timeout 60s; max 600s. With run_in_background:true, returns a shellId immediately — the command keeps running until it finishes or KillShell terminates it.',
745
+ description: 'Run a shell command in the workflow cwd via sh -c. Foreground: returns stdout+stderr (combined cap 64 KB) + exit code. If a background process keeps output open after the shell exits, the result warns that it was left running. Default timeout 60s; max 600s. With run_in_background:true, returns a shellId immediately — the command keeps running until it finishes or KillShell terminates it.',
719
746
  input_schema: {
720
747
  type: 'object',
721
748
  properties: {
@@ -896,7 +923,7 @@ const AskUserQuestionTool = {
896
923
  const TaskTool = {
897
924
  def: {
898
925
  name: 'Task',
899
- description: 'Spawn a child agent in a new tab to handle a self-contained sub-task. The child runs with the operator\'s visibility (its own tab) and inherits the parent\'s transport. Returns the child\'s final assistant reply when it settles. Depth-1 only — a child cannot itself call Task. Cancel of the parent cancels the child. Instruct the child to END with a concise, verifiable self-report: what it changed (files/paths), what it ran to verify (commands + outcome), and anything left undone or uncertain — so you can trust the result without re-deriving it.',
926
+ description: 'Spawn a child agent in a new tab to handle a self-contained sub-task. The child runs with the operator\'s visibility (its own tab) and inherits the parent\'s transport. Returns the child\'s final assistant reply when it settles. With run_in_background true, returns at once with the taskId; the result arrives later as a notice, and TaskOutput reads its progress meanwhile. Depth-1 only — a child cannot itself call Task. Stopping the parent cancels the child. Instruct the child to END with a concise, verifiable self-report: what it changed (files/paths), what it ran to verify (commands + outcome), and anything left undone or uncertain — so you can trust the result without re-deriving it.',
900
927
  input_schema: {
901
928
  type: 'object',
902
929
  properties: {
@@ -904,6 +931,7 @@ const TaskTool = {
904
931
  prompt: { type: 'string', description: 'The seed prompt for the child agent.' },
905
932
  subagent_type: { type: 'string', description: 'Optional subagent label (informational; child still runs as the parent\'s configured provider).' },
906
933
  model: { type: 'string', description: 'Optional child model. The operator\'s Sub-agent model setting overrides this when set; otherwise an omitted model inherits the parent.' },
934
+ run_in_background: { type: 'boolean', description: 'Run the child in the background and continue working; its result arrives as a notice when it finishes. Default false waits for the result.' },
907
935
  },
908
936
  required: ['description', 'prompt'],
909
937
  },
@@ -917,7 +945,8 @@ const TaskTool = {
917
945
  const prompt = asString(args.prompt, 'prompt');
918
946
  const subagentType = asOptString(args.subagent_type, 'subagent_type');
919
947
  const model = asOptString(args.model, 'model');
920
- return await ctx.spawnTask({ description, prompt, subagentType, model });
948
+ const runInBackground = args.run_in_background === true;
949
+ return await ctx.spawnTask({ description, prompt, subagentType, model, runInBackground });
921
950
  },
922
951
  };
923
952
  // ── TaskOutput (7b) ──
@@ -20,10 +20,12 @@ export interface TaskSpawnArgs {
20
20
  parentWorkflowId: string;
21
21
  taskId?: string;
22
22
  turnSignal?: AbortSignal;
23
+ lifetimeSignal?: AbortSignal;
23
24
  signal?: AbortSignal;
24
25
  policy?: NativeSubagentPolicy;
25
26
  onQueued?: (model: string) => void;
26
27
  onModel?: (model: string) => void;
28
+ onStarted?: () => void;
27
29
  description: string;
28
30
  prompt: string;
29
31
  subagentType?: string;
@@ -112,8 +114,17 @@ export declare class ClaudeNativeWorker extends EventEmitter {
112
114
  private planBroadcast;
113
115
  private taskHandler;
114
116
  private taskTurn;
117
+ private taskStartsThisTurn;
118
+ private approvedTaskModels;
119
+ private taskBatchRefusal;
115
120
  private taskPolicy;
116
121
  private taskRequests;
122
+ private backgroundLife;
123
+ private backgroundTaskIds;
124
+ private backgroundNotices;
125
+ private backgroundNoticeTimer;
126
+ private taskNoticeHandler;
127
+ private backgroundNoticeGatherMs;
117
128
  private workflowEventBroadcast;
118
129
  private clusterEventBroadcast;
119
130
  private toolCallCountSinceCompact;
@@ -129,6 +140,7 @@ export declare class ClaudeNativeWorker extends EventEmitter {
129
140
  setTodosBroadcast(fn: (todos: Todo[]) => void): void;
130
141
  setPlanBroadcast(fn: PlanBroadcast): void;
131
142
  setTaskHandler(fn: TaskSpawnHandler): void;
143
+ setTaskNoticeHandler(fn: (text: string) => void): void;
132
144
  setHookWakeHandler(fn: (text: string) => void): void;
133
145
  setWorkflowEventBroadcast(fn: (msg: ServerMessage) => void): void;
134
146
  setClusterEventBroadcast(fn: (msg: ServerMessage) => void): void;
@@ -214,8 +226,14 @@ export declare class ClaudeNativeWorker extends EventEmitter {
214
226
  private reportHooks;
215
227
  private onBackgroundHook;
216
228
  private takeHookContext;
217
- cancel(): void;
229
+ cancel(opts?: {
230
+ keepBackground?: boolean;
231
+ }): void;
218
232
  private cancelPendingTasks;
233
+ private emitTaskEvent;
234
+ private noteBackgroundSettled;
235
+ private flushBackgroundNotices;
236
+ private startBackgroundTask;
219
237
  dispose(): Promise<void>;
220
238
  private pruneOrphanToolUse;
221
239
  private scrubServerToolEvidenceOnAbort;
@@ -241,6 +259,9 @@ export declare class ClaudeNativeWorker extends EventEmitter {
241
259
  private filterToolOutput;
242
260
  private handleEnterPlanMode;
243
261
  private handleExitPlanMode;
262
+ private batchMarkerPath;
263
+ private batchCatalog;
264
+ private approveTaskBatch;
244
265
  private handleAskUserQuestion;
245
266
  private handleSpawnTask;
246
267
  hasActiveTask(taskId: string): boolean;