arco-workbench 0.1.9 → 0.2.1

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 (768) 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-BbR3xmfD.js} +1 -1
  5. package/client/dist/assets/{ThemedBackgroundShaderImpl-BLdwwQ4D.js → ThemedBackgroundShaderImpl-UMjbs9ZN.js} +1 -1
  6. package/client/dist/assets/XtermView-n135qz-f.js +10 -0
  7. package/client/dist/assets/{galleryEditor-CI8ClzBa.js → galleryEditor-CFSke4by.js} +1 -1
  8. package/client/dist/assets/index-CVJVD2Vn.css +1 -0
  9. package/client/dist/assets/index-DeoJbjI3.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 -4
  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 +221 -71
  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 +4 -2
  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 +18 -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 +56 -17
  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 +27 -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 +16 -8
  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/appUpdateStore.ts +7 -1
  183. package/client/src/stores/directorContinueStore.ts +22 -0
  184. package/client/src/stores/draftStore.ts +56 -2
  185. package/client/src/stores/phoneStore.ts +196 -0
  186. package/client/src/stores/terminalStore.ts +8 -0
  187. package/client/src/styles/contextual-help.css +10 -0
  188. package/client/src/styles/global.css +293 -0
  189. package/client/src/themes/apply.ts +9 -1
  190. package/client/src/themes/bootstrap.ts +21 -1
  191. package/client/src/themes/providerThemes.ts +1 -0
  192. package/client/src/utils/codexAccountHome.ts +9 -0
  193. package/client/src/utils/format.ts +8 -2
  194. package/client/src/utils/gitBranchMark.ts +3 -0
  195. package/client/src/utils/homeModel.ts +7 -0
  196. package/client/src/utils/longPress.ts +64 -0
  197. package/client/src/utils/modelCatalog.ts +4 -0
  198. package/client/src/utils/providerStatusCheck.ts +30 -0
  199. package/client/src/utils/startupGate.ts +6 -0
  200. package/client/src/ws/handleServerMessage.ts +106 -7
  201. package/docs/ARCHITECTURE.md +63 -37
  202. package/docs/ARCHITECTURE_REVIEW.md +1 -1
  203. package/docs/BACKUP.md +60 -9
  204. package/docs/CHAT.md +15 -11
  205. package/docs/CHECKPOINTS.md +2 -0
  206. package/docs/CLIENT.md +70 -36
  207. package/docs/DEEPSEEK.md +9 -10
  208. package/docs/DIAGNOSTICS.md +8 -7
  209. package/docs/DOCKER.md +16 -2
  210. package/docs/EXTENDING.md +10 -26
  211. package/docs/FEATURES.md +23 -15
  212. package/docs/GENESIS.md +3 -1
  213. package/docs/GETTING_STARTED.md +82 -16
  214. package/docs/GIT_WORKBENCH.md +5 -5
  215. package/docs/GLOSSARY.md +36 -23
  216. package/docs/GOTCHAS.md +102 -67
  217. package/docs/HTTP_API.md +183 -87
  218. package/docs/INDEX.md +1 -0
  219. package/docs/KNOWLEDGE.md +2 -2
  220. package/docs/LOCAL_SERVICES.md +9 -8
  221. package/docs/MCP_REGISTRY.md +18 -13
  222. package/docs/MEDIA_STUDIO.md +7 -11
  223. package/docs/OPERATIONS.md +117 -32
  224. package/docs/OPERATOR_ACTIONS.md +24 -22
  225. package/docs/PERSISTENCE.md +65 -24
  226. package/docs/PHOSPHOR_DEMO.md +1 -4
  227. package/docs/PLAN_OR_BOARD.md +2 -2
  228. package/docs/PRIMITIVES.md +17 -17
  229. package/docs/PROTOCOL.md +61 -10
  230. package/docs/PROTOCOL_CLUSTER.md +92 -22
  231. package/docs/PROTOCOL_PRIMITIVES.md +10 -4
  232. package/docs/PROVIDERS.md +291 -145
  233. package/docs/RECALL.md +40 -31
  234. package/docs/REMOTE_MANAGEMENT.md +27 -51
  235. package/docs/REPO_LAYOUT.md +4 -3
  236. package/docs/RESEARCH.md +189 -0
  237. package/docs/RESUME_INDEX.md +10 -19
  238. package/docs/SERVICE_MODE.md +11 -5
  239. package/docs/SETTINGS.md +25 -16
  240. package/docs/STORAGE_PLAN.md +3 -3
  241. package/docs/STRATA.md +14 -11
  242. package/docs/TASK_LEDGER.md +19 -8
  243. package/docs/TERMINAL.md +14 -10
  244. package/docs/THIRD_PARTY.md +21 -4
  245. package/docs/VOICE.md +16 -28
  246. package/native/linux-arm64/manifest.json +1 -1
  247. package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +1 -0
  248. package/node_modules/@arco/shared/dist/clusterCoordination.js +9 -1
  249. package/node_modules/@arco/shared/dist/clusterRolePresets.js +13 -4
  250. package/node_modules/@arco/shared/dist/index.d.ts +1 -0
  251. package/node_modules/@arco/shared/dist/index.js +1 -0
  252. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +7 -0
  253. package/node_modules/@arco/shared/dist/protocol/autoPickup.js +22 -11
  254. package/node_modules/@arco/shared/dist/protocol/chat.d.ts +1 -1
  255. package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +1 -0
  256. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +18 -3
  257. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +177 -4
  258. package/node_modules/@arco/shared/dist/protocol/clusters.js +48 -2
  259. package/node_modules/@arco/shared/dist/protocol/handoffs.d.ts +1 -0
  260. package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
  261. package/node_modules/@arco/shared/dist/protocol/models.js +4 -3
  262. package/node_modules/@arco/shared/dist/protocol/providers.d.ts +3 -2
  263. package/node_modules/@arco/shared/dist/protocol/providers.js +1 -1
  264. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +29 -4
  265. package/node_modules/@arco/shared/dist/protocol/settings.d.ts +4 -0
  266. package/node_modules/@arco/shared/dist/protocol/settings.js +3 -1
  267. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +42 -0
  268. package/node_modules/@arco/shared/dist/protocol/tasks.js +17 -0
  269. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +4 -0
  270. package/node_modules/@arco/shared/dist/protocol/workflows.js +2 -0
  271. package/node_modules/@arco/shared/dist/researchActivity.d.ts +4 -0
  272. package/node_modules/@arco/shared/dist/researchActivity.js +29 -0
  273. package/node_modules/@arco/shared/package.json +1 -1
  274. package/package.json +3 -2
  275. package/scripts/packaging/services.mjs +19 -2
  276. package/scripts/packaging/update.mjs +92 -26
  277. package/server/dist/arcoHome.js +19 -3
  278. package/server/dist/auth.d.ts +4 -2
  279. package/server/dist/auth.js +42 -4
  280. package/server/dist/authLoginSession.d.ts +2 -1
  281. package/server/dist/authLoginSession.js +21 -3
  282. package/server/dist/capabilities.d.ts +2 -2
  283. package/server/dist/capabilities.js +11 -6
  284. package/server/dist/chatMode.d.ts +3 -0
  285. package/server/dist/chatMode.js +25 -2
  286. package/server/dist/checkedFile.d.ts +1 -1
  287. package/server/dist/checkedFile.js +48 -41
  288. package/server/dist/cliUpdateDecision.js +1 -1
  289. package/server/dist/clusterAutoTurn.d.ts +4 -1
  290. package/server/dist/clusterAutoTurn.js +25 -4
  291. package/server/dist/clusterBusyReminder.js +2 -1
  292. package/server/dist/clusterDirector.js +5 -2
  293. package/server/dist/clusterMailTally.d.ts +11 -0
  294. package/server/dist/clusterMailTally.js +29 -0
  295. package/server/dist/clusterMailbox.d.ts +8 -1
  296. package/server/dist/clusterMailbox.js +53 -4
  297. package/server/dist/clusterOpenWork.d.ts +22 -0
  298. package/server/dist/clusterOpenWork.js +85 -0
  299. package/server/dist/clusterPeerOps.d.ts +32 -5
  300. package/server/dist/clusterPeerOps.js +253 -49
  301. package/server/dist/clusterPlanBridge.d.ts +7 -1
  302. package/server/dist/clusterPlanBridge.js +58 -0
  303. package/server/dist/clusterPlanStore.d.ts +6 -0
  304. package/server/dist/clusterPlanStore.js +58 -0
  305. package/server/dist/clusterPresets.js +23 -3
  306. package/server/dist/clusterProgress.js +2 -2
  307. package/server/dist/clusterSkills.js +2 -2
  308. package/server/dist/clusterSnapshots.d.ts +1 -0
  309. package/server/dist/clusterSnapshots.js +7 -1
  310. package/server/dist/clusterStore.d.ts +34 -1
  311. package/server/dist/clusterStore.js +194 -21
  312. package/server/dist/clusterTurnOrigin.d.ts +2 -0
  313. package/server/dist/clusterTurnOrigin.js +19 -0
  314. package/server/dist/connectionCatalog.js +1 -0
  315. package/server/dist/cursorUsage.js +3 -3
  316. package/server/dist/defaults/models.md +11 -14
  317. package/server/dist/directorContinue.d.ts +47 -0
  318. package/server/dist/directorContinue.js +311 -0
  319. package/server/dist/directorContinueHook.d.ts +3 -0
  320. package/server/dist/directorContinueHook.js +16 -0
  321. package/server/dist/effortValidation.d.ts +3 -0
  322. package/server/dist/effortValidation.js +34 -0
  323. package/server/dist/fileAccessPolicy.js +1 -0
  324. package/server/dist/fileFetch.d.ts +7 -1
  325. package/server/dist/fileFetch.js +50 -29
  326. package/server/dist/geminiMembers.d.ts +8 -0
  327. package/server/dist/geminiMembers.js +113 -0
  328. package/server/dist/git.d.ts +3 -0
  329. package/server/dist/git.js +17 -24
  330. package/server/dist/gitOtherWork.js +5 -4
  331. package/server/dist/gitSnapshots.js +66 -5
  332. package/server/dist/http/authLoginRoutes.js +1 -1
  333. package/server/dist/http/clusterRoutes.js +466 -4
  334. package/server/dist/http/diagnosticsRoutes.js +8 -0
  335. package/server/dist/http/fileWriteRoutes.js +11 -3
  336. package/server/dist/http/phoneUploadRoutes.js +2 -1
  337. package/server/dist/http/readConfinement.d.ts +11 -0
  338. package/server/dist/http/readConfinement.js +30 -0
  339. package/server/dist/http/recallRoutes.js +1 -1
  340. package/server/dist/http/router.js +48 -11
  341. package/server/dist/http/storageRoutes.js +114 -7
  342. package/server/dist/http/workflowDataRoutes.js +20 -0
  343. package/server/dist/http/writeConfinement.js +12 -1
  344. package/server/dist/index.d.ts +13 -0
  345. package/server/dist/index.js +353 -56
  346. package/server/dist/initialProviders.js +1 -1
  347. package/server/dist/manualCompactCapability.js +1 -1
  348. package/server/dist/mcp/clusterMcpLoopback.d.ts +1 -0
  349. package/server/dist/mcp/clusterMcpLoopback.js +1 -0
  350. package/server/dist/mcp/clusterMcpServer.js +3 -2
  351. package/server/dist/mcp/clusterMcpTools.d.ts +3 -0
  352. package/server/dist/mcp/clusterMcpTools.js +79 -25
  353. package/server/dist/mcp/mcpConfigWriter.d.ts +1 -0
  354. package/server/dist/mcp/mcpConfigWriter.js +2 -0
  355. package/server/dist/mcp/workerMailBridge.d.ts +17 -0
  356. package/server/dist/mcp/workerMailBridge.js +104 -0
  357. package/server/dist/planStore.js +1 -0
  358. package/server/dist/primitives/seedWorker.d.ts +10 -1
  359. package/server/dist/primitives/seedWorker.js +14 -15
  360. package/server/dist/project/taskLedger.d.ts +3 -0
  361. package/server/dist/project/taskLedger.js +16 -0
  362. package/server/dist/providers/{cursor → acp}/acpJsonRpc.js +1 -1
  363. package/server/dist/providers/acp/permissionGate.d.ts +3 -0
  364. package/server/dist/providers/acp/permissionGate.js +46 -0
  365. package/server/dist/providers/antigravity/index.d.ts +15 -0
  366. package/server/dist/providers/antigravity/index.js +251 -0
  367. package/server/dist/providers/antigravity/researchSignIn.d.ts +24 -0
  368. package/server/dist/providers/antigravity/researchSignIn.js +93 -0
  369. package/server/dist/providers/antigravity/status.d.ts +18 -0
  370. package/server/dist/providers/antigravity/status.js +29 -0
  371. package/server/dist/providers/antigravity/usage.d.ts +7 -0
  372. package/server/dist/providers/antigravity/usage.js +36 -0
  373. package/server/dist/providers/claude/researcherFence.d.ts +7 -0
  374. package/server/dist/providers/claude/researcherFence.js +27 -0
  375. package/server/dist/providers/claude-native/catalog.d.ts +2 -1
  376. package/server/dist/providers/claude-native/catalog.js +4 -0
  377. package/server/dist/providers/claude-native/index.d.ts +1 -0
  378. package/server/dist/providers/claude-native/index.js +9 -1
  379. package/server/dist/providers/claude-native/peerTools.d.ts +1 -0
  380. package/server/dist/providers/claude-native/peerTools.js +26 -4
  381. package/server/dist/providers/claude-native/taskAdmission.d.ts +7 -1
  382. package/server/dist/providers/claude-native/taskAdmission.js +30 -8
  383. package/server/dist/providers/claude-native/tools.d.ts +1 -0
  384. package/server/dist/providers/claude-native/tools.js +47 -18
  385. package/server/dist/providers/claude-native/worker.d.ts +22 -1
  386. package/server/dist/providers/claude-native/worker.js +281 -51
  387. package/server/dist/providers/claude-native/workerHelpers.d.ts +5 -0
  388. package/server/dist/providers/claude-native/workerHelpers.js +95 -5
  389. package/server/dist/providers/claude.d.ts +2 -0
  390. package/server/dist/providers/claude.js +194 -22
  391. package/server/dist/providers/clusterTaskToolDefinitions.js +2 -1
  392. package/server/dist/providers/codex-appserver/heldCommands.d.ts +2 -2
  393. package/server/dist/providers/codex-appserver/heldCommands.js +9 -3
  394. package/server/dist/providers/codex-appserver/index.d.ts +9 -0
  395. package/server/dist/providers/codex-appserver/index.js +106 -5
  396. package/server/dist/providers/codex-appserver/lateCommands.js +1 -0
  397. package/server/dist/providers/codex-appserver/modelAvailability.d.ts +20 -0
  398. package/server/dist/providers/codex-appserver/modelAvailability.js +34 -0
  399. package/server/dist/providers/codex-appserver/worker.d.ts +11 -0
  400. package/server/dist/providers/codex-appserver/worker.js +199 -25
  401. package/server/dist/providers/codex.js +1 -0
  402. package/server/dist/providers/codexVersion.d.ts +2 -0
  403. package/server/dist/providers/codexVersion.js +8 -0
  404. package/server/dist/providers/codexWebSearch.js +1 -1
  405. package/server/dist/providers/cursor/agentEnv.d.ts +20 -0
  406. package/server/dist/providers/cursor/agentEnv.js +93 -0
  407. package/server/dist/providers/cursor/authState.js +2 -1
  408. package/server/dist/providers/cursor/authToken.d.ts +25 -2
  409. package/server/dist/providers/cursor/authToken.js +118 -27
  410. package/server/dist/providers/cursor/catalog.d.ts +6 -0
  411. package/server/dist/providers/cursor/catalog.js +91 -1
  412. package/server/dist/providers/cursor/chatSandbox.d.ts +3 -1
  413. package/server/dist/providers/cursor/chatSandbox.js +24 -8
  414. package/server/dist/providers/cursor/isolated.d.ts +6 -0
  415. package/server/dist/providers/cursor/isolated.js +313 -0
  416. package/server/dist/providers/cursor/isolatedVersion.d.ts +6 -0
  417. package/server/dist/providers/cursor/isolatedVersion.js +35 -0
  418. package/server/dist/providers/cursor/modelMap.js +9 -5
  419. package/server/dist/providers/cursor/print.js +10 -8
  420. package/server/dist/providers/cursor/worker.js +8 -3
  421. package/server/dist/providers/index.js +10 -2
  422. package/server/dist/providers/llamacpp.js +3 -2
  423. package/server/dist/providers/ollama.d.ts +3 -2
  424. package/server/dist/providers/ollama.js +29 -10
  425. package/server/dist/providers/ollamaTools.d.ts +3 -0
  426. package/server/dist/providers/ollamaTools.js +31 -29
  427. package/server/dist/research/exportResults.d.ts +15 -0
  428. package/server/dist/research/exportResults.js +60 -0
  429. package/server/dist/research/isolatedArtifact.d.ts +4 -0
  430. package/server/dist/research/isolatedArtifact.js +56 -0
  431. package/server/dist/research/quickPromotion.d.ts +27 -0
  432. package/server/dist/research/quickPromotion.js +402 -0
  433. package/server/dist/research/quickResearchChat.d.ts +4 -0
  434. package/server/dist/research/quickResearchChat.js +187 -0
  435. package/server/dist/research/researchClose.d.ts +31 -0
  436. package/server/dist/research/researchClose.js +373 -0
  437. package/server/dist/research/researchCopy.d.ts +16 -0
  438. package/server/dist/research/researchCopy.js +180 -0
  439. package/server/dist/research/researchCreate.d.ts +40 -0
  440. package/server/dist/research/researchCreate.js +334 -0
  441. package/server/dist/research/researchDoctrine.d.ts +2 -0
  442. package/server/dist/research/researchDoctrine.js +26 -0
  443. package/server/dist/research/researchFolder.d.ts +23 -0
  444. package/server/dist/research/researchFolder.js +191 -0
  445. package/server/dist/research/researchLibrary.d.ts +54 -0
  446. package/server/dist/research/researchLibrary.js +281 -0
  447. package/server/dist/research/researchRetry.d.ts +25 -0
  448. package/server/dist/research/researchRetry.js +96 -0
  449. package/server/dist/research/researchRounds.d.ts +108 -0
  450. package/server/dist/research/researchRounds.js +996 -0
  451. package/server/dist/research/researchState.d.ts +112 -0
  452. package/server/dist/research/researchState.js +191 -0
  453. package/server/dist/research/researchTools.d.ts +57 -0
  454. package/server/dist/research/researchTools.js +57 -0
  455. package/server/dist/research/researchTripwires.d.ts +18 -0
  456. package/server/dist/research/researchTripwires.js +196 -0
  457. package/server/dist/research/resultSelection.d.ts +27 -0
  458. package/server/dist/research/resultSelection.js +161 -0
  459. package/server/dist/research/savedQuickPromotion.d.ts +19 -0
  460. package/server/dist/research/savedQuickPromotion.js +259 -0
  461. package/server/dist/research/sendToProject.d.ts +36 -0
  462. package/server/dist/research/sendToProject.js +293 -0
  463. package/server/dist/server/broadcast.d.ts +5 -1
  464. package/server/dist/server/broadcast.js +45 -5
  465. package/server/dist/server/updateCheck.js +1 -0
  466. package/server/dist/settings.js +27 -3
  467. package/server/dist/skillActivity.d.ts +11 -0
  468. package/server/dist/skillActivity.js +33 -0
  469. package/server/dist/smartPickup.d.ts +1 -0
  470. package/server/dist/smartPickup.js +12 -4
  471. package/server/dist/smartPickupAdapters.js +3 -2
  472. package/server/dist/smartPickupEvaluator.d.ts +1 -0
  473. package/server/dist/smartPickupObserver.js +47 -14
  474. package/server/dist/storageActions.d.ts +9 -0
  475. package/server/dist/storageActions.js +5 -0
  476. package/server/dist/storageOverview.d.ts +1 -0
  477. package/server/dist/storageOverview.js +12 -5
  478. package/server/dist/taskDispatcher.js +3 -2
  479. package/server/dist/toolboxWorkflow.js +2 -1
  480. package/server/dist/updateCheck.d.ts +3 -2
  481. package/server/dist/updateCheck.js +53 -29
  482. package/server/dist/updateManager.d.ts +2 -4
  483. package/server/dist/updateManager.js +4 -1
  484. package/server/dist/windowsCommand.d.ts +15 -0
  485. package/server/dist/windowsCommand.js +85 -4
  486. package/server/dist/workers/StreamParser.d.ts +1 -0
  487. package/server/dist/workers/StreamParser.js +23 -1
  488. package/server/dist/workers/WorkerManager.d.ts +4 -0
  489. package/server/dist/workers/WorkerManager.js +5 -1
  490. package/server/dist/workers/antigravityIsolatedLaunch.d.ts +25 -0
  491. package/server/dist/workers/antigravityIsolatedLaunch.js +88 -0
  492. package/server/dist/workers/checkedLinuxWorker.d.ts +38 -0
  493. package/server/dist/workers/checkedLinuxWorker.js +192 -0
  494. package/server/dist/workers/claudeAccessLease.d.ts +24 -0
  495. package/server/dist/workers/claudeAccessLease.js +157 -0
  496. package/server/dist/workers/claudeAccessSource.d.ts +2 -0
  497. package/server/dist/workers/claudeAccessSource.js +27 -0
  498. package/server/dist/workers/claudeIsolatedLaunch.d.ts +19 -0
  499. package/server/dist/workers/claudeIsolatedLaunch.js +104 -0
  500. package/server/dist/workers/cliResearcherDoctrine.d.ts +4 -0
  501. package/server/dist/workers/cliResearcherDoctrine.js +20 -0
  502. package/server/dist/workers/codexAccessLease.d.ts +26 -0
  503. package/server/dist/workers/codexAccessLease.js +208 -0
  504. package/server/dist/workers/codexIsolatedLaunch.d.ts +21 -0
  505. package/server/dist/workers/codexIsolatedLaunch.js +95 -0
  506. package/server/dist/workers/codexIsolatedPolicy.d.ts +5 -0
  507. package/server/dist/workers/codexIsolatedPolicy.js +49 -0
  508. package/server/dist/workers/cursorIsolatedLaunch.d.ts +37 -0
  509. package/server/dist/workers/cursorIsolatedLaunch.js +178 -0
  510. package/server/dist/workers/isolatedCliHome.d.ts +4 -0
  511. package/server/dist/workers/isolatedCliHome.js +107 -0
  512. package/server/dist/workers/limits.js +1 -1
  513. package/server/dist/workers/linuxWorkerSandbox.d.ts +48 -0
  514. package/server/dist/workers/linuxWorkerSandbox.js +192 -0
  515. package/server/dist/workers/processKill.d.ts +2 -0
  516. package/server/dist/workers/processKill.js +28 -2
  517. package/server/dist/workers/providerRuntimeDiscovery.d.ts +13 -0
  518. package/server/dist/workers/providerRuntimeDiscovery.js +126 -0
  519. package/server/dist/workers/researchSandboxAvailability.d.ts +3 -0
  520. package/server/dist/workers/researchSandboxAvailability.js +78 -0
  521. package/server/dist/workers/workerAccessPass.d.ts +12 -0
  522. package/server/dist/workers/workerAccessPass.js +123 -0
  523. package/server/dist/workers/workerHiddenDirectories.d.ts +3 -0
  524. package/server/dist/workers/workerHiddenDirectories.js +16 -0
  525. package/server/dist/workers/workerSocketDirectory.d.ts +2 -0
  526. package/server/dist/workers/workerSocketDirectory.js +16 -0
  527. package/server/dist/workers/workerWebProxy.d.ts +28 -0
  528. package/server/dist/workers/workerWebProxy.js +206 -0
  529. package/server/dist/workflowMeta.d.ts +5 -0
  530. package/server/dist/workflowMeta.js +7 -3
  531. package/server/dist/workflowStore.js +43 -25
  532. package/server/dist/workflows/purgeWorkflow.js +15 -0
  533. package/server/dist/workflows/types.d.ts +6 -0
  534. package/server/dist/workspace.d.ts +1 -0
  535. package/server/dist/workspace.js +8 -0
  536. package/server/dist/ws/clusterHandlers.d.ts +5 -0
  537. package/server/dist/ws/clusterHandlers.js +373 -26
  538. package/server/dist/ws/clusterMembers.d.ts +5 -0
  539. package/server/dist/ws/clusterMembers.js +15 -5
  540. package/server/dist/ws/compactHandlers.js +43 -8
  541. package/server/dist/ws/compareHandlers.d.ts +12 -0
  542. package/server/dist/ws/compareHandlers.js +32 -14
  543. package/server/dist/ws/handoffHandlers.js +39 -3
  544. package/server/dist/ws/operatorQuestionHandlers.d.ts +5 -0
  545. package/server/dist/ws/operatorQuestionHandlers.js +17 -2
  546. package/server/dist/ws/taskLedgerHandlers.js +1 -0
  547. package/server/dist/ws/taskLifecycle.d.ts +25 -1
  548. package/server/dist/ws/taskLifecycle.js +53 -1
  549. package/server/dist/ws/turnEngine.d.ts +18 -1
  550. package/server/dist/ws/turnEngine.js +281 -52
  551. package/server/dist/ws/turnPrompt.js +3 -1
  552. package/server/dist/ws/updatePrimaryConfig.js +11 -3
  553. package/server/dist/ws/workflowHandlers.js +17 -4
  554. package/server/package.json +1 -1
  555. package/server/src/arcoHome.ts +16 -3
  556. package/server/src/auth.ts +50 -6
  557. package/server/src/authLoginSession.ts +18 -5
  558. package/server/src/capabilities.ts +13 -8
  559. package/server/src/chatMode.ts +24 -2
  560. package/server/src/checkedFile.ts +42 -31
  561. package/server/src/cliUpdateDecision.ts +1 -1
  562. package/server/src/clusterAutoTurn.ts +29 -5
  563. package/server/src/clusterBusyReminder.ts +2 -1
  564. package/server/src/clusterDirector.ts +5 -2
  565. package/server/src/clusterMailTally.ts +28 -0
  566. package/server/src/clusterMailbox.ts +49 -4
  567. package/server/src/clusterOpenWork.ts +94 -0
  568. package/server/src/clusterPeerOps.ts +238 -52
  569. package/server/src/clusterPlanBridge.ts +54 -1
  570. package/server/src/clusterPlanStore.ts +59 -0
  571. package/server/src/clusterPresets.ts +17 -3
  572. package/server/src/clusterProgress.ts +2 -2
  573. package/server/src/clusterSkills.ts +2 -2
  574. package/server/src/clusterSnapshots.ts +7 -1
  575. package/server/src/clusterStore.ts +192 -20
  576. package/server/src/clusterTurnOrigin.ts +19 -0
  577. package/server/src/connectionCatalog.ts +1 -0
  578. package/server/src/cursorUsage.ts +3 -3
  579. package/server/src/defaults/models.md +11 -14
  580. package/server/src/directorContinue.ts +309 -0
  581. package/server/src/directorContinueHook.ts +15 -0
  582. package/server/src/effortValidation.ts +31 -0
  583. package/server/src/fileAccessPolicy.ts +1 -0
  584. package/server/src/fileFetch.ts +47 -29
  585. package/server/src/geminiMembers.ts +116 -0
  586. package/server/src/git.ts +20 -22
  587. package/server/src/gitOtherWork.ts +5 -4
  588. package/server/src/gitSnapshots.ts +53 -5
  589. package/server/src/http/authLoginRoutes.ts +2 -2
  590. package/server/src/http/clusterRoutes.ts +314 -6
  591. package/server/src/http/diagnosticsRoutes.ts +9 -0
  592. package/server/src/http/fileWriteRoutes.ts +13 -5
  593. package/server/src/http/phoneUploadRoutes.ts +2 -1
  594. package/server/src/http/readConfinement.ts +30 -0
  595. package/server/src/http/recallRoutes.ts +1 -1
  596. package/server/src/http/router.ts +43 -10
  597. package/server/src/http/storageRoutes.ts +86 -7
  598. package/server/src/http/workflowDataRoutes.ts +20 -0
  599. package/server/src/http/writeConfinement.ts +10 -1
  600. package/server/src/index.ts +295 -18
  601. package/server/src/initialProviders.ts +1 -1
  602. package/server/src/manualCompactCapability.ts +1 -1
  603. package/server/src/mcp/clusterMcpLoopback.ts +2 -0
  604. package/server/src/mcp/clusterMcpServer.ts +3 -2
  605. package/server/src/mcp/clusterMcpTools.ts +83 -27
  606. package/server/src/mcp/mcpConfigWriter.ts +4 -0
  607. package/server/src/mcp/workerMailBridge.ts +99 -0
  608. package/server/src/planStore.ts +1 -0
  609. package/server/src/primitives/seedWorker.ts +19 -14
  610. package/server/src/project/taskLedger.ts +23 -0
  611. package/server/src/providers/{cursor → acp}/acpJsonRpc.ts +3 -3
  612. package/server/src/providers/acp/permissionGate.ts +47 -0
  613. package/server/src/providers/antigravity/index.ts +187 -0
  614. package/server/src/providers/antigravity/researchSignIn.ts +76 -0
  615. package/server/src/providers/antigravity/status.ts +25 -0
  616. package/server/src/providers/antigravity/usage.ts +30 -0
  617. package/server/src/providers/claude/researcherFence.ts +25 -0
  618. package/server/src/providers/claude-native/catalog.ts +5 -0
  619. package/server/src/providers/claude-native/index.ts +8 -1
  620. package/server/src/providers/claude-native/peerTools.ts +24 -4
  621. package/server/src/providers/claude-native/taskAdmission.ts +35 -9
  622. package/server/src/providers/claude-native/tools.ts +39 -19
  623. package/server/src/providers/claude-native/worker.ts +270 -52
  624. package/server/src/providers/claude-native/workerHelpers.ts +88 -5
  625. package/server/src/providers/claude.ts +160 -22
  626. package/server/src/providers/clusterTaskToolDefinitions.ts +2 -1
  627. package/server/src/providers/codex-appserver/heldCommands.ts +7 -3
  628. package/server/src/providers/codex-appserver/index.ts +87 -3
  629. package/server/src/providers/codex-appserver/lateCommands.ts +1 -0
  630. package/server/src/providers/codex-appserver/modelAvailability.ts +40 -0
  631. package/server/src/providers/codex-appserver/worker.ts +155 -25
  632. package/server/src/providers/codex.ts +1 -0
  633. package/server/src/providers/codexVersion.ts +9 -0
  634. package/server/src/providers/codexWebSearch.ts +1 -1
  635. package/server/src/providers/cursor/agentEnv.ts +103 -0
  636. package/server/src/providers/cursor/authState.ts +2 -1
  637. package/server/src/providers/cursor/authToken.ts +137 -31
  638. package/server/src/providers/cursor/catalog.ts +89 -1
  639. package/server/src/providers/cursor/chatSandbox.ts +20 -8
  640. package/server/src/providers/cursor/isolated.ts +282 -0
  641. package/server/src/providers/cursor/isolatedVersion.ts +33 -0
  642. package/server/src/providers/cursor/modelMap.ts +9 -5
  643. package/server/src/providers/cursor/print.ts +10 -8
  644. package/server/src/providers/cursor/worker.ts +8 -3
  645. package/server/src/providers/index.ts +10 -2
  646. package/server/src/providers/llamacpp.ts +3 -1
  647. package/server/src/providers/ollama.ts +30 -11
  648. package/server/src/providers/ollamaTools.ts +33 -27
  649. package/server/src/research/exportResults.ts +47 -0
  650. package/server/src/research/isolatedArtifact.ts +48 -0
  651. package/server/src/research/quickPromotion.ts +325 -0
  652. package/server/src/research/quickResearchChat.ts +147 -0
  653. package/server/src/research/researchClose.ts +340 -0
  654. package/server/src/research/researchCopy.ts +170 -0
  655. package/server/src/research/researchCreate.ts +306 -0
  656. package/server/src/research/researchDoctrine.ts +27 -0
  657. package/server/src/research/researchFolder.ts +202 -0
  658. package/server/src/research/researchLibrary.ts +306 -0
  659. package/server/src/research/researchRetry.ts +86 -0
  660. package/server/src/research/researchRounds.ts +891 -0
  661. package/server/src/research/researchState.ts +309 -0
  662. package/server/src/research/researchTools.ts +59 -0
  663. package/server/src/research/researchTripwires.ts +158 -0
  664. package/server/src/research/resultSelection.ts +127 -0
  665. package/server/src/research/savedQuickPromotion.ts +174 -0
  666. package/server/src/research/sendToProject.ts +220 -0
  667. package/server/src/server/broadcast.ts +39 -5
  668. package/server/src/server/updateCheck.ts +1 -0
  669. package/server/src/settings.ts +22 -5
  670. package/server/src/skillActivity.ts +35 -0
  671. package/server/src/smartPickup.ts +14 -4
  672. package/server/src/smartPickupAdapters.ts +3 -2
  673. package/server/src/smartPickupEvaluator.ts +3 -0
  674. package/server/src/smartPickupObserver.ts +38 -12
  675. package/server/src/storageActions.ts +6 -0
  676. package/server/src/storageOverview.ts +13 -6
  677. package/server/src/taskDispatcher.ts +3 -1
  678. package/server/src/toolboxWorkflow.ts +2 -1
  679. package/server/src/updateCheck.ts +50 -29
  680. package/server/src/updateManager.ts +5 -2
  681. package/server/src/windowsCommand.ts +83 -4
  682. package/server/src/workers/StreamParser.ts +20 -1
  683. package/server/src/workers/WorkerManager.ts +10 -1
  684. package/server/src/workers/antigravityIsolatedLaunch.ts +82 -0
  685. package/server/src/workers/checkedLinuxWorker.ts +212 -0
  686. package/server/src/workers/claudeAccessLease.ts +122 -0
  687. package/server/src/workers/claudeAccessSource.ts +20 -0
  688. package/server/src/workers/claudeIsolatedLaunch.ts +91 -0
  689. package/server/src/workers/cliResearcherDoctrine.ts +20 -0
  690. package/server/src/workers/codexAccessLease.ts +146 -0
  691. package/server/src/workers/codexIsolatedLaunch.ts +72 -0
  692. package/server/src/workers/codexIsolatedPolicy.ts +38 -0
  693. package/server/src/workers/cursorIsolatedLaunch.ts +159 -0
  694. package/server/src/workers/isolatedCliHome.ts +75 -0
  695. package/server/src/workers/limits.ts +1 -1
  696. package/server/src/workers/linuxWorkerSandbox.ts +193 -0
  697. package/server/src/workers/processKill.ts +34 -2
  698. package/server/src/workers/providerRuntimeDiscovery.ts +108 -0
  699. package/server/src/workers/researchSandboxAvailability.ts +68 -0
  700. package/server/src/workers/workerAccessPass.ts +96 -0
  701. package/server/src/workers/workerHiddenDirectories.ts +16 -0
  702. package/server/src/workers/workerSocketDirectory.ts +13 -0
  703. package/server/src/workers/workerWebProxy.ts +194 -0
  704. package/server/src/workflowMeta.ts +10 -3
  705. package/server/src/workflowStore.ts +39 -26
  706. package/server/src/workflows/purgeWorkflow.ts +18 -0
  707. package/server/src/workflows/types.ts +13 -0
  708. package/server/src/workspace.ts +8 -0
  709. package/server/src/ws/clusterHandlers.ts +302 -26
  710. package/server/src/ws/clusterMembers.ts +15 -5
  711. package/server/src/ws/compactHandlers.ts +37 -5
  712. package/server/src/ws/compareHandlers.ts +34 -11
  713. package/server/src/ws/handoffHandlers.ts +36 -3
  714. package/server/src/ws/operatorQuestionHandlers.ts +14 -2
  715. package/server/src/ws/taskLedgerHandlers.ts +1 -0
  716. package/server/src/ws/taskLifecycle.ts +58 -4
  717. package/server/src/ws/turnEngine.ts +265 -49
  718. package/server/src/ws/turnPrompt.ts +3 -1
  719. package/server/src/ws/updatePrimaryConfig.ts +10 -3
  720. package/server/src/ws/workflowHandlers.ts +15 -4
  721. package/shared/dist/clusterCoordination.d.ts +1 -0
  722. package/shared/dist/clusterCoordination.js +9 -1
  723. package/shared/dist/clusterRolePresets.js +13 -4
  724. package/shared/dist/index.d.ts +1 -0
  725. package/shared/dist/index.js +1 -0
  726. package/shared/dist/protocol/autoPickup.d.ts +7 -0
  727. package/shared/dist/protocol/autoPickup.js +22 -11
  728. package/shared/dist/protocol/chat.d.ts +1 -1
  729. package/shared/dist/protocol/checkpoints.d.ts +1 -0
  730. package/shared/dist/protocol/clientMessages.d.ts +18 -3
  731. package/shared/dist/protocol/clusters.d.ts +177 -4
  732. package/shared/dist/protocol/clusters.js +48 -2
  733. package/shared/dist/protocol/handoffs.d.ts +1 -0
  734. package/shared/dist/protocol/models.d.ts +6 -1
  735. package/shared/dist/protocol/models.js +4 -3
  736. package/shared/dist/protocol/providers.d.ts +3 -2
  737. package/shared/dist/protocol/providers.js +1 -1
  738. package/shared/dist/protocol/serverMessages.d.ts +29 -4
  739. package/shared/dist/protocol/settings.d.ts +4 -0
  740. package/shared/dist/protocol/settings.js +3 -1
  741. package/shared/dist/protocol/tasks.d.ts +42 -0
  742. package/shared/dist/protocol/tasks.js +17 -0
  743. package/shared/dist/protocol/workflows.d.ts +4 -0
  744. package/shared/dist/protocol/workflows.js +2 -0
  745. package/shared/dist/researchActivity.d.ts +4 -0
  746. package/shared/dist/researchActivity.js +29 -0
  747. package/shared/src/clusterCoordination.ts +12 -1
  748. package/shared/src/clusterRolePresets.ts +13 -4
  749. package/shared/src/index.ts +2 -0
  750. package/shared/src/protocol/autoPickup.ts +28 -11
  751. package/shared/src/protocol/chat.ts +1 -1
  752. package/shared/src/protocol/checkpoints.ts +1 -0
  753. package/shared/src/protocol/clientMessages.ts +14 -0
  754. package/shared/src/protocol/clusters.ts +231 -5
  755. package/shared/src/protocol/handoffs.ts +1 -0
  756. package/shared/src/protocol/models.ts +11 -4
  757. package/shared/src/protocol/providers.ts +6 -3
  758. package/shared/src/protocol/reviews.ts +2 -2
  759. package/shared/src/protocol/serverMessages.ts +29 -4
  760. package/shared/src/protocol/settings.ts +14 -1
  761. package/shared/src/protocol/tasks.ts +73 -0
  762. package/shared/src/protocol/workflows.ts +8 -0
  763. package/shared/src/researchActivity.ts +23 -0
  764. package/client/dist/assets/XtermView-Xk7_9JaH.js +0 -10
  765. package/client/dist/assets/index-BEFgrUJJ.css +0 -1
  766. package/client/dist/assets/index-C7WzZfsr.js +0 -614
  767. package/client/src/components/HeaderAuthChip.tsx +0 -207
  768. /package/server/dist/providers/{cursor → acp}/acpJsonRpc.d.ts +0 -0
package/docs/HTTP_API.md CHANGED
@@ -88,15 +88,20 @@ Liveness. Returns `200 OK` the instant the server is listening - the route only
88
88
  ```ts
89
89
  {
90
90
  status: 'live',
91
- version: '0.1.0',
92
- pid: 12345, // process.pid
93
- uptimeSec: 42 // integer seconds since the process booted
91
+ version: '<running version>', // APP_BUILD.version
92
+ commit?: string, // build commit, when known
93
+ checkoutFingerprint: string, // SHA-256 of the install or checkout folder
94
+ homeFingerprint: string, // SHA-256 of the Arco home folder
95
+ pid: 12345, // process.pid
96
+ uptimeSec: 42 // integer seconds since the process booted
94
97
  }
95
98
  ```
96
99
 
100
+ The two fingerprints let a supervisor tell whether the server answering belongs to the expected install and home without exposing a path. `GET /api/app/version` returns only `{ version, commit? }` (`Cache-Control: no-store`) and, like these routes, needs no session.
101
+
97
102
  ```sh
98
103
  curl http://localhost:3001/healthz
99
- # -> {"status":"live","version":"0.1.0","pid":12345,"uptimeSec":42}
104
+ # -> {"status":"live","version":"<version>","checkoutFingerprint":"...","homeFingerprint":"...","pid":12345,"uptimeSec":42}
100
105
  ```
101
106
 
102
107
  ### `GET /health`
@@ -153,19 +158,27 @@ A write failure answers `500 { error: 'Upload failed' }`. The route itself is no
153
158
 
154
159
  The client may follow up with an `upload_complete` WS message; the server echoes `file_uploaded` back to **that socket only** (not a workflow broadcast - uploads are unscoped).
155
160
 
156
- ### `GET /api/file-content?path=<path>[&cwd=<cwd>][&workflowId=<wfid>]`
161
+ ### `GET /api/file-content?path=<path>[&cwd=<cwd>][&workflowId=<wfid>][&artifactOwner=<wfid>]`
157
162
 
158
- JSON-wrapped file read for `FileViewerModal` (uploaded attachments, files clicked from a `ToolCallPill`, chat `[artifact:...]` popups). Always answers **200** with a discriminated body from `readFileForExplorer` (`server/src/http/fileRead.ts`):
163
+ JSON-wrapped file read for `FileViewerModal` (uploaded attachments, files clicked from a `ToolCallPill`, chat `[artifact:...]` popups). The body is discriminated by `type` (`readFileForExplorer` in `server/src/http/fileRead.ts`):
159
164
 
160
165
  ```ts
161
- | { type: 'text', content: string, size: number } // ≤ 2 MiB (MAX_TEXT_SIZE); NUL in first 8 KiB -> 'binary'
162
- | { type: 'image', dataUrl: string, size: number } // png/jpg/gif/webp/svg/bmp/ico, ≤ 10 MiB (MAX_IMAGE_SIZE)
163
- | { type: 'binary', size: number }
164
- | { type: 'too-large', size: number, kind: 'text' | 'image' }
165
- | { type: 'error', error: string } // every candidate failed
166
+ | { type: 'text', content: string, size: number, resolvedPath: string, artifactOwner?: string } // <= 2 MiB (MAX_TEXT_SIZE); NUL in first 8 KiB -> 'binary'
167
+ | { type: 'image', dataUrl: string, size: number, resolvedPath: string, artifactOwner?: string } // png/jpg/gif/webp/svg/bmp/ico, <= 10 MiB (MAX_IMAGE_SIZE)
168
+ | { type: 'binary', size: number, resolvedPath: string, artifactOwner?: string }
169
+ | { type: 'too-large', size: number, kind: 'text' | 'image', resolvedPath: string, artifactOwner?: string }
170
+ | { type: 'choices', choices: Array<{ workflowId: string, name: string }> } // 200: the name matches an artifact of more than one cluster member
171
+ | { type: 'error', error: string } // 403 or 404
166
172
  ```
167
173
 
168
- Candidate resolution, first hit wins (why: agents routinely name files they wrote by bare basename, and `resolve(path)` alone resolves against the *server* cwd): (1) a **relative** `path` with `cwd` -> resolved inside the cwd (skipped if it escapes); (2) `resolve(path)`; (3) with `cwd`+`workflowId`, the basename inside that workflow's `artifacts/` dir. Only `ENOENT` advances to the next candidate.
174
+ `resolvedPath` is the file that was read. A success answers `200`. Failures answer `403` (the path is refused or outside every readable folder) or `404` (not found) with `{ type: 'error', error }`; a missing file is reported by the name that was asked for.
175
+
176
+ Resolution (`resolveBrowserRead` in `server/src/http/readConfinement.ts`):
177
+ 1. With `cwd` and `workflowId`, an output the workflow tracked under that path is used first.
178
+ 2. A relative `path` resolves inside the workflow's project folder; an absolute `path` is used as given. Either must lie inside a readable root: the bound project folder (or, with no binding, the known project folders and the file-tree root), the uploads folder or the scratch folder. A file in a registered Git worktree of the project is also allowed.
179
+ 3. Only when the file does not exist, and `path` is a bare file name without a leading dot or a backslash, the workflow's own `artifacts/` folder is tried.
180
+
181
+ If that fails with "not found" and `cwd` and `workflowId` name a conversation that is a cluster member, the server looks for the same bare name in the `artifacts/` folder of every member of that cluster. One match is returned with `artifactOwner` set to the member's display name. Several matches return `type: 'choices'`; the client then repeats the request with `artifactOwner=<workflowId of the chosen member>`. When nothing matches, the `404` error names the members that were searched: `File not found: <name>. Searched the project and artifacts of: <names>.`
169
182
 
170
183
  ### `GET /api/files?path=<dir>`
171
184
 
@@ -175,17 +188,17 @@ One-level directory listing for the `FileExplorer` panel (lazy - the explorer re
175
188
  { path: string /* resolved */, files: Array<{ name: string, path: string, isDirectory: boolean }> }
176
189
  ```
177
190
 
178
- Dot-entries hidden; directories first, then name-sorted. An unreadable dir answers `200 { path: '', files: [] }`.
191
+ Dot-entries hidden; directories first, then name-sorted. A protected, dangling or escaping entry is left out. Any failure (a missing, unsafe or unreadable folder) answers `200 { path: '', files: [] }`.
179
192
 
180
193
  ### `POST /api/mkdir`
181
194
 
182
195
  Create a directory. Body:
183
196
 
184
197
  ```ts
185
- { parent: string, name: string } // parent is an absolute path; name is the new directory name
198
+ { parent: string, name: string, exclusive?: boolean } // parent is an absolute path; name is the new directory name
186
199
  ```
187
200
 
188
- `name` must be a single non-hidden path segment (`400` otherwise); `parent` must resolve inside `$HOME` (`403`). Returns `200 { path: <created dir> }` (`mkdir -p` - existing dirs succeed). Used by the cwd folder-browser when an operator creates a fresh project directory.
201
+ `parent` and `name` are required (`400 { error: 'parent and name are required' }`). `name` is trimmed and must be a single non-hidden path segment (`400`); with `exclusive` it must also pass the new-folder name rules (`400 { error }` with the reason). `parent` goes through the same safe-folder check as file reads. A parent that is missing, protected, a filesystem root or not a folder fails with `500 { error: <message> }`. Returns `200 { path: <created dir> }`. Without `exclusive` this is `mkdir -p`: an existing folder succeeds. With `exclusive` the folder is created with a plain `mkdir`, and an existing file or folder answers `409 { error: 'A file or folder with that name already exists.' }`. Used by the cwd folder-browser when a user creates a fresh project directory.
189
202
 
190
203
  ### `GET /api/list-dirs?path=<absolute>`
191
204
 
@@ -194,7 +207,7 @@ Lists subdirectories of the given path. Used by the cwd folder-browser in `Workf
194
207
  - **No `path`** -> starts at `settings.defaultWorkingDirectory` (operator-set, Settings), else `~/Projects`, else `$HOME`.
195
208
  - **Unreadable `path`** (a Linux default opened on a Mac, a deleted folder, ...) -> falls back to listing `$HOME` rather than returning an empty `{parent:'',dirs:[]}`, so the browser always has a non-empty parent with a working `↑ UP` and is never a dead-end. (Returning empty is the last-resort only if `$HOME` itself can't be read.)
196
209
 
197
- **Response:** `{ parent: <resolved absolute path>, dirs: Array<{ name, path }> }` (hidden dirs filtered, name-sorted).
210
+ **Response:** `{ parent: <resolved absolute path>, dirs: Array<{ name, path }>, unavailable?: true }` (hidden dirs filtered, name-sorted). `unavailable: true` marks the `$HOME` fallback for an unreadable requested folder.
198
211
 
199
212
  ---
200
213
 
@@ -259,7 +272,7 @@ Tool-use blocks and reasoning-block entries are intentionally **not** materializ
259
272
 
260
273
  ### `GET /api/transcript-export?path=<cwd>&sessionId=<uuid>`
261
274
 
262
- Returns the full **Claude CLI** session (`~/.claude/projects/<encoded-cwd>/<sessionId>.jsonl`) as one markdown download (`Content-Disposition: attachment; filename="arco-<id8>-<date>.md"`; `## Operator` / `## Arco` sections). No pagination. There is no `provider` switch - Codex rollouts are not exportable here. `path` + `sessionId` required (`400`).
275
+ Returns the full **Claude CLI** session (`~/.claude/projects/<encoded-cwd>/<sessionId>.jsonl`) as one markdown download (`Content-Disposition: attachment; filename="arco-<id8>-<date>.md"`; `## Operator` / `## Arco` sections). No pagination. There is no `provider` switch - Codex rollouts are not exportable here. `path` + `sessionId` required (`400`); a `sessionId` that is not a UUID is refused with `400 { error: 'invalid sessionId' }` before any file lookup, as on `/api/transcript`.
263
276
 
264
277
  ---
265
278
 
@@ -343,6 +356,8 @@ What REVERT TO HERE would change, without changing anything (`gitSnapshots.previ
343
356
 
344
357
  ---
345
358
 
359
+ **Errors shared by the `wfid`-scoped Git routes** (`/api/git/diff`, `compare`, `compare/diff`, `fetch`, `worktrees`, `other-work` and `op/<family>`): a missing or invalid `wfid` is `400` (`{ error: 'valid wfid query required' }`; the POST routes answer `{ error: 'invalid wfid' }`, and `op` answers its own `{ ok:false, op, stderr }` shape). A `wfid` that names no open workflow (or whose folder is protected or gone), and a `path` outside that workflow's project or its registered worktrees, is `403 { error }`, and an unexpected failure is `500 { error }`. The "always 200" statements below apply to the cases they describe, after those checks.
360
+
346
361
  ### `GET /api/git/diff?wfid=<wfid>[&path=<cwd>][&file=<repo-rel-path>][&staged=1]`
347
362
 
348
363
  Workbench Expansion I1. Powers the FILES -> SOURCE "Source Control" view: list the working tree's changed files grouped staged / unstaged / untracked, then fetch one file's unified diff on click. **Distinct from `/api/workflows/diff`** (A3, which produces a single whole-tree or ref-vs-ref patch); both feed the same source-agnostic `DiffView`. Backed by `server/src/gitWorking.ts` (`getWorkingChanges` + `getFileDiff`) + `server/src/http/gitDiffRoutes.ts` (the route). Read-only - runs `git status` / `git diff` via `execFile` with an argv array, always passing `--` so a path can't be re-read as a flag; never touches the index/HEAD.
@@ -382,7 +397,7 @@ Workbench Expansion I2. Powers the FILES -> REMOTE view: how the cwd's current b
382
397
 
383
398
  - `wfid` - required; validated against `[A-Za-z0-9._-]+`. Resolves the workflow's live cwd when `path` is omitted.
384
399
  - `path` - explicit cwd; wins over the resolved wfid cwd.
385
- - Always answers **200** with `UpstreamComparisonResponse` `{ isRepo, branch?, upstream?, detached?, hasUpstream?, ahead?[], behind?[], aheadDiffstat?, behindDiffstat? }`:
400
+ - Answers **200** with `UpstreamComparisonResponse` `{ isRepo, branch?, upstream?, detached?, hasUpstream?, ahead?[], behind?[], aheadDiffstat?, behindDiffstat? }`:
386
401
  - `ahead` = local-only commits (`@{u}..HEAD`, **to push**), `behind` = remote-only commits (`HEAD..@{u}`, **to pull**). Each commit `{ hash, subject, author, ts }` (ts = author date, epoch ms); newest first.
387
402
  - `aheadDiffstat` / `behindDiffstat` = `{ files, insertions, deletions }` from `git diff --shortstat` on the symmetric range.
388
403
  - Non-fatal cases (all 200): non-git -> `isRepo:false`; detached HEAD -> `detached:true`; no upstream configured -> `hasUpstream:false` (+ `branch`); in sync -> `ahead:[] behind:[]`.
@@ -425,7 +440,7 @@ Read-only survey for the GIT dialog's Other work section. Same `wfid` / `path` r
425
440
 
426
441
  Workbench Expansion I3. Direct local git operations - operator-clicked actions that **INTENTIONALLY mutate the real index / working tree / refs** (the opposite of A2 checkpoints, which never touch the real index). Backed by `server/src/gitOps.ts` (argv-only, every user value validated by `server/src/gitSafe.ts`, `--` before every pathspec) + `server/src/http/gitOpRoutes.ts`. One POST per op family; wired AFTER `/api/git/status|checkout|diff|compare|fetch` so the `/api/git/op/` prefix can't shadow them.
427
442
 
428
- Common request fields: `{ wfid?, path?,... }` - `wfid` validated when present (resolves the cwd); `path` is an explicit cwd that wins over the resolved wfid cwd; one must yield a cwd. The cwd is checked to be a git repo first. Every op answers **200** with a structured `GitOpResult` body - expected git failures are `{ ok:false, op, stderr }` (not a 500), and a refused push is `{ ok:false, needsConfirm:true, reason }`. On a workflow-scoped call the op + outcome is broadcast as a `git_op_result` event and persisted to `events.jsonl`.
443
+ Common request fields: `{ wfid?, path?,... }` - `wfid` validated when present (resolves the cwd); `path` is an explicit cwd that wins over the resolved wfid cwd; one must yield a cwd. The cwd is checked to be a git repo first. An invalid `wfid` answers `400 { ok:false, op, stderr:'invalid wfid' }` and an unknown family `404 { ok:false, op, stderr:'unknown git op: <family>' }`. Every op otherwise answers **200** with a structured `GitOpResult` body (a missing working directory or a folder that is not a Git repository is `{ ok:false, op, stderr:'no working directory' | 'not a git repository' }`) - expected git failures are `{ ok:false, op, stderr }` (not a 500), and a refused push is `{ ok:false, needsConfirm:true, reason }`. On a workflow-scoped call the op + outcome is broadcast as a `git_op_result` event and persisted to `events.jsonl`.
429
444
 
430
445
  | Family | Extra body fields | git argv | Notes |
431
446
  |---|---|---|---|
@@ -556,6 +571,12 @@ See `docs/DIAGNOSTICS.md`.
556
571
 
557
572
  ---
558
573
 
574
+ ### `GET /api/diagnostics/research-sandbox`
575
+
576
+ Returns `{ claudeCli: boolean, codex: boolean, cursor: boolean, gemini: boolean, geminiSignIn: 'missing' | 'ready' | 'expired', platform: string, codexVersionReason?: string, cursorVersionReason?: string }` after short Linux sandbox availability checks. `platform` reports the server's `process.platform` so Settings can show the Linux-only Gemini for Research note on Windows and macOS. `geminiSignIn` reports the separate Gemini research sign-in state. The optional reasons name an unsupported or unknown installed Codex or Cursor version, or a missing Cursor agent. The checks use temporary files and a scoped mailbox fixture, do not open a sign-in or start a model, and cache their results briefly. A researcher still runs its own preflight before starting. The research start dialog offers each CLI provider only when its check succeeds and it is signed in; Codex requires the supported CLI version.
577
+
578
+ ---
579
+
559
580
  ### `GET /api/diagnostics/support-bundle`
560
581
 
561
582
  Operations A2. **Operator-triggered**, **read-only**. Returns a paste-ready,
@@ -641,7 +662,7 @@ Request body (JSON):
641
662
 
642
663
  - `cwd` - explicit workflow cwd; when omitted, resolved from `wfid` (validated) via `workflowCwds`. One of the two must yield a cwd or the request 400s.
643
664
  - `path` - relative-to-cwd or absolute. **Resolved against `cwd` and re-checked with `resolveWithinCwd` - the exact same path-escape guard the Native `Write`/`Edit` tools use.** Any path that escapes the cwd (relative `../`, an absolute path outside, or a traversal like `foo/../../x`) is **rejected with 400 and nothing is written.** This is load-bearing: a fat-fingered or agent-suggested path must never write outside the project.
644
- - `content` - the full new file contents (whole-file replace, not a patch). Parent dirs inside cwd are created as needed; an existing directory at the target is refused.
665
+ - `content` - the full new file contents (whole-file replace, not a patch). It must be a string: a missing, `null` or non-string `content` is rejected with 400 (`content must be a string`) and the file is left as it was. An explicit empty string is valid and empties the file. Parent dirs inside cwd are created as needed; an existing directory at the target is refused.
645
666
  - Response: `200 { ok: true, path: "<cwd-relative>", bytes: N }` on success; `400 { ok: false, error }` on a rejected escape / bad input; `500 { ok: false, error }` on an unexpected fs error.
646
667
 
647
668
  ---
@@ -988,7 +1009,7 @@ It does not read or restore snapshots.
988
1009
 
989
1010
  ### `POST /api/clusters`
990
1011
 
991
- Create a cluster. Requires at least two member workflows sharing a `cwd`. Each member's provider must be cluster-eligible - `claude` / `codex` / `ollama` / `llamacpp` / `cursor` (`CLUSTER_MEMBER_PROVIDERS`); the route pre-validates via `assertAllMembersClaudeOrCodex` (a stale name - it delegates to `isClusterMemberProvider`) and rejects any other provider with `400 { error: 'member_not_supported:<wfid>' }`. The store-level `createCluster` additionally enforces `cwd`, member count (≥2), and no nested/cross-cluster membership (`member_already_in_cluster`).
1012
+ Create a cluster. Requires at least two member workflows sharing a `cwd`. Each member's provider must be cluster-eligible - `claude` / `codex` / `ollama` / `llamacpp` / `cursor` / `antigravity-cli` (`CLUSTER_MEMBER_PROVIDERS`); the route pre-validates via `assertAllMembersClaudeOrCodex` (a stale name - it delegates to `isClusterMemberProvider`) and rejects any other provider with `400 { error: 'member_not_supported:<wfid>' }`. The store-level `createCluster` additionally enforces `cwd`, member count (≥2), and no nested/cross-cluster membership (`member_already_in_cluster`).
992
1013
 
993
1014
  **Body:**
994
1015
  ```ts
@@ -1024,33 +1045,35 @@ Read current cluster state. Returns the stored record plus a `mailboxDepth` map
1024
1045
 
1025
1046
  Delete a cluster. Fires the same `handleClusterDelete` path as the WS-side delete (MCP-config cleanup + `cluster_deleted` broadcast). Returns `{ deleted: clusterId }`.
1026
1047
 
1048
+ All `peer/<op>` routes answer `404 { error: 'unknown_cluster' }` for an unknown cluster, `405 { error: 'method_not_allowed', op, method }` for a wrong method and `500 { error: 'peer_op_failed', message }` for an unexpected failure. Every `task-*` route answers `400 { error: 'board_detached', message }` when the cluster has no task board (board mode `none`). Two more operations serve a Research Director only: `POST peer/research_round` with `{ from, text }` starts a round, and `POST peer/research_send_to_project` with `{ from, selection }` proposes sending released material (`{ proposed: true, message }`; the operator picks the destination and sends from RESULTS). Both are described in [`RESEARCH.md`](RESEARCH.md).
1049
+
1027
1050
  ### `GET /api/clusters/:id/peer/list?workflowId=<wfid>`
1028
1051
 
1029
- List peer members visible from `workflowId`. Thin wrapper over `clusterPeerOps.peerList`. Used by the CLI MCP child to answer `peer_list` tool calls.
1052
+ List the other members as `workflowId` sees them: `[{ workflowId, displayName, pendingForThem, role?, tier?, focus? }]`. `workflowId` must be a cluster member (`400 { error: 'workflowId must be a cluster member' }`). A BLIND, ISOLATED or researcher caller gets `[]`. In a research project a researcher row shows only the letter, the role `Researcher` and, unless the project is blind and not yet revealed, its provider. Thin wrapper over `clusterPeerOps.peerList`. Used by the CLI MCP child to answer `peer_list` tool calls.
1030
1053
 
1031
1054
  ### `POST /api/clusters/:id/peer/send`
1032
1055
 
1033
- Send a peer message. Body: `{ workflowId, to, content }`. Delegates to `clusterPeerOps.peerSend`; enforces the 16 KB content budget (32 KB for operator transcript-sends) and 60-second dedupe window. Returns `{ ok: true, msgId }` or a structured error (`{ error: 'budget_exceeded' | 'duplicate_send' | 'unknown_peer' |... }`).
1056
+ Send a peer message. Body: `{ from, to, content, confirm?, taskId?, artifactPaths? }`. `from` is the sending member (`400 { error: 'from must be a cluster member' }` otherwise); `to` and `content` are required (`400 { error: 'to and content are required' }`). `confirm: true` sends a status-only Director message after its confirmation step. `taskId` names a board task and records a handoff comment on it (see [`PROTOCOL_CLUSTER.md`](PROTOCOL_CLUSTER.md#continue-the-director)). `artifactPaths` is at most 8 file paths, each at most 4096 characters, copied from an isolated researcher's workspace (`400 { error: 'invalid artifact paths' }` otherwise). Delegates to `clusterPeerOps.peerSend`, which enforces the 16 KB content budget (32 KB for operator transcript-sends), the per-turn message guard and a 60-second duplicate window (`ARCO_PEER_SEND_DEDUPE_MS` changes it; `0` turns it off). Success is `200 { msgId, to, deliveredImmediately, heldForRound?, note? }`; `heldForRound` and `note` appear only when a research project holds the message until its round. A refusal is `400 { error, message, count?, cap? }` with `error` one of `unknown_peer`, `self_send`, `budget_exhausted` (`count` and `cap` give the guard), `content_too_large`, `enqueue_failed`, `recipient_not_in_cluster`, `duplicate_send`, `status_confirmation` or `unknown_task`.
1034
1057
 
1035
1058
  ### `POST /api/clusters/:id/peer/read`
1036
1059
 
1037
- Drain the calling member's mailbox. Body: `{ workflowId }`. Fires `peer_message_received` events for each drained message. Returns the drained messages array.
1060
+ Drain the calling member's mailbox. Body: `{ workflowId, onlyFrom? }`. When `onlyFrom` is a cluster member ID, only that sender's messages are drained; other messages and their attachments stay pending. Fires `peer_message_received` events for each drained message. Returns the drained messages array.
1038
1061
 
1039
1062
  ### `POST /api/clusters/:id/peer/plan-read`
1040
1063
 
1041
- Return the full canonical cluster plan. Body: `{ workflowId }` (must be a member). Read-only - the per-turn injected copy may be a deterministic outline for plans that overflow the string-form fold budget, so members need a pull channel to the full body. Returns `{ title, body, updatedAt, byteLength }`; `400 { error: 'no_plan' }` when no plan is attached.
1064
+ Return the full canonical cluster plan. Body: `{ workflowId }` (must be a member). Read-only - the per-turn injected copy may be a deterministic outline for plans that overflow the string-form fold budget, so members need a pull channel to the full body. Returns `{ planId, revision, title, body, updatedAt, byteLength }`; a Director passes `planId` and `revision` back in `completePlan`. `400 { error: 'no_plan', message }` when no plan is attached.
1042
1065
 
1043
1066
  ### `POST /api/clusters/:id/peer/plan-tick`
1044
1067
 
1045
- Toggle a checkbox in the shared cluster plan. Body: `{ workflowId, lineIndex? | taskText? }`. Exactly one of `lineIndex` or `taskText` must be provided (server returns `invalid_matcher` otherwise). Error codes: `task_not_found`, `ambiguous_task`, `not_a_checkbox_line`, `out_of_range`. On success: `{ toggledLine, before, after }`.
1068
+ Toggle a checkbox in the shared cluster plan. Body: `{ workflowId, lineIndex? | taskText? }`. Exactly one of `lineIndex` or `taskText` must be provided (`invalid_matcher` otherwise). A refusal is `400 { error, message, matches? }` with `error` one of `task_not_found`, `ambiguous_task` (`matches` lists the candidates), `not_a_checkbox_line` or `out_of_range`. On success: `{ toggledLine, before, after }`.
1046
1069
 
1047
1070
  ### `POST /api/clusters/:id/peer/plan-write`
1048
1071
 
1049
- Replace the entire cluster plan body. Body: `{ workflowId, body }`. Enforces the 32 KB cap (`plan_too_large` on overflow). Broadcasts `cluster_plan_changed`. Returns `{ bodyLength, updatedAt }`.
1072
+ Write the shared cluster plan from a member. Body: `{ workflowId, body }`. A member's write is additive: it may add or reword lines but cannot remove an existing numbered item or change a `[ ]`/`[x]` state; replacing or clearing a plan stays operator-only through the PLAN tab. Enforces the 32 KB cap. A refusal is `400 { error, message, limit?, actual?, removed?, statusChanged? }`: `plan_too_large` carries `limit` and `actual`; a refused removal or status change lists `removed` (the dropped lines) and `statusChanged` (`{ text, before, after }`). Broadcasts `cluster_plan_changed`. Returns `{ bodyLength, updatedAt }`.
1050
1073
 
1051
1074
  ### `GET /api/clusters/:id/peer/task-list?workflowId=<wfid>`
1052
1075
 
1053
- List the shared cluster task ledger as seen by `workflowId` (must be a cluster member, else `400`). Thin wrapper over `clusterPeerOps.peerTaskList`. Returns the tasks array directly. On failure returns `{ error: <code>, message }`.
1076
+ List the shared cluster task board as seen by `workflowId` (must be a cluster member, else `400`). Thin wrapper over `clusterPeerOps.peerTaskList`. Returns a compact JSON text from `formatBoardForModel` (`server/src/project/taskLedger.ts`), not the raw task array: `{ activeCount, completedCount, omittedActive?, tasks, recentlyCompleted?, hint }`. Done and archived tasks are left out of `tasks` and counted in `completedCount`; the newest few appear in `recentlyCompleted`; the oldest active rows are dropped when the payload exceeds its byte budget. Use `task-show` for full notes. On failure returns `{ error: <code>, message }`.
1054
1077
 
1055
1078
  ### `GET /api/clusters/:id/peer/task-show?workflowId=<wfid>&id=<taskId>`
1056
1079
 
@@ -1058,7 +1081,7 @@ Show one task's detail record: task fields, parent/child tasks, durable comments
1058
1081
 
1059
1082
  ### `POST /api/clusters/:id/peer/task-create`
1060
1083
 
1061
- Create a non-terminal task in the cluster cwd. Body: `{ workflowId, title, body?, notes?, assignee?, priority?, parentIds?, links?, reviewRequired?, goalMode?, goalMaxTurns?, release? }`. Delegates to `clusterPeerOps.peerTaskCreate`, emits `task_ledger_event` op `create`, and broadcasts a fresh snapshot. Returns the created task object, or `{ error: <code>, message }` on failure.
1084
+ Create a non-terminal task in the cluster cwd. Body: `{ workflowId, title, body?, notes?, assignee?, priority?, parentIds?, links?, reviewRequired?, goalMode?, goalMaxTurns?, release?, status? }`. Delegates to `clusterPeerOps.peerTaskCreate`, emits `task_ledger_event` op `create`, and broadcasts a fresh snapshot. Returns the created task object, or `{ error: <code>, message }` on failure.
1062
1085
 
1063
1086
  ### `POST /api/clusters/:id/peer/task-claim`
1064
1087
 
@@ -1070,7 +1093,7 @@ Record worker activity for a task. Body: `{ workflowId, id, note? }`. Delegates
1070
1093
 
1071
1094
  ### `POST /api/clusters/:id/peer/task-update`
1072
1095
 
1073
- Update a ledger task's status/notes/sign-off. Body: `{ workflowId, id, status?, notes?, signoff? }`. `signoff` ( advisory director sign-off) is `{ state: 'met'|'not_met'|'partial', summary? } | null` - validated + author-stamped by `peerTaskUpdate`; **advisory only, never moves the task to a terminal status** (`done` stays operator-gated). An invalid `signoff.state` -> `400`. Delegates to `clusterPeerOps.peerTaskUpdate` and broadcasts the update. Returns the updated task object, or `{ error: <code>, message }` on failure.
1096
+ Update a ledger task's status/notes/release/sign-off. Body: `{ workflowId, id, status?, notes?, release?, signoff?, completePlan? }`. `completePlan` is `{ planId, itemId, revision }`, accepted only with a Director `met` sign-off on a task linked to that whole plan item. `signoff` is `{ state: 'met'|'not_met'|'partial', summary? } | null` - validated and author-stamped by `peerTaskUpdate`. A Director met sign-off closes the task when Board auto-done is on; direct `done` and `archived` status changes remain operator-only. An invalid `signoff.state` -> `400`. Delegates to `clusterPeerOps.peerTaskUpdate` and broadcasts the update. Returns the updated task object, or `{ error: <code>, message }` on failure.
1074
1097
 
1075
1098
  ### `POST /api/clusters/:id/peer/task-link`
1076
1099
 
@@ -1092,6 +1115,27 @@ Block a task. Body: `{ workflowId, id, reason }`. Delegates to `clusterPeerOps.p
1092
1115
 
1093
1116
  Submit a completion report. Body: `{ workflowId, id, summary }`. Delegates to `clusterPeerOps.peerTaskComplete`, moves the task to `review`, appends a `COMPLETION REPORT` comment, and broadcasts a fresh snapshot. It never marks `done`; terminal statuses remain operator-only. Returns the updated task object, or `{ error: <code>, message }`.
1094
1117
 
1118
+ ### Research projects
1119
+
1120
+ See [RESEARCH.md](RESEARCH.md).
1121
+
1122
+ - `POST /api/research/:clusterId/reveal`: the operator's Reveal of a blind project. `{ revealed: true }`, or 409 `not_blind_or_unknown`.
1123
+ - `GET /api/research/:clusterId/summaries`: `{ latest, rounds }`, whether `synthesis.md` exists and which `syntheses/round-N.md` files exist. 404 `unknown_research`.
1124
+ - `GET /api/research/:clusterId/researchers/:letter/unsent`: `{ unsent: [{ letter, path, bytes }] }` for one researcher, shown by REMOVE. 404 `unknown_research`.
1125
+ - `GET /api/research/:clusterId/close-preview`: `{ unsent: [{ letter, path, bytes }] }`, the researcher files not yet in `sources/`. 404 `unknown_research`.
1126
+ - `GET /api/research/library`: `{ rows: [{ projectId, name, folder, status, question, createdAt, closedAt?, researchers, rounds, clusterId? }] }`, the Research library on Home, newest first. `status` is `open`, `closed` or `missing`. Scans the configured research folder for projects the index does not know.
1127
+ - `GET /api/research/library/:projectId/reopen`: what the REOPEN dialog needs: `{ reopenable, reason?, director: { resumable, reason?, provider?, model?, effort? }, researchers, nextLetter, slots }`. 404 `unknown_project`.
1128
+ - `POST /api/research/library/:projectId/locate`: body `{ folder }`. Accepts only a folder whose `research.json` belongs to the project and updates the library and the closed record. 400 `invalid_folder` or `not_this_project`; 404 `unknown_project`.
1129
+ - `POST /api/research/library/:projectId/forget`: removes the project from the library only. 409 `project_open`; 404 when unknown.
1130
+ - `POST /api/research/:clusterId/close`: body `{ moveUnsent }`. Writes the researcher logs, moves unsent files when asked and removes the researchers' folders. `{ ok: true, logsWrittenTo, moved, removed }`; 409 `researcher_busy` with `letters`; 404 `unknown_research`.
1131
+ - `GET /api/research/:clusterId/keep-as-project` and `POST` the same path; `GET` and `POST /api/research/saved-quick/:chatId/keep-as-project`: promote a Quick research result to a project. `GET` answers the journal phase (`{ phase, message, folder? }`, or `{ phase: 'idle' }`; the saved-quick form answers `404 unknown_chat` for an unknown chat). `POST` takes `{ folderRoot? }` (16 KB cap) and answers `202 { phase, message }`. A failure is `400 { error }`.
1132
+ - `POST /api/research/:clusterId/rounds/:n/extend`: the operator's +15 MIN on a round deadline. `{ deadline }`; `404 unknown_round`; `409` with another code when the round cannot be extended.
1133
+ - `POST /api/research/:clusterId/rounds/:n/retry/:letter`: RETRY on a failed or timed-out researcher. `{ late, file }`; `404` for `not_research`, `unknown_round` or `unknown_researcher`; `409 { error, message }` otherwise (for example `busy`).
1134
+ - `GET /api/research/:clusterId/rerun-preview` and `POST /api/research/:clusterId/rerun-round`: read the settings of an open project for a rerun (`{ name, brief, blind, sourceProject, director, researchers }`), and start another round with the current panel from `{ brief }` (at most 20000 characters, 32 KB body). `rerun-round` answers `{ round, receiptError? }`. Both answer `400 { error }` for a closed project; any other method is `405`.
1135
+ - `POST /api/research/:clusterId/preview-export`, `prepare-export` and `confirm-export`: export released research. Body (16 KB cap): `{ selection }` and, for `prepare-export`, `{ kind: 'markdown' | 'file' | 'zip', path? }`; `confirm-export` takes `{ token }` and answers `{ recorded: true }`. `preview-export` answers `{ files }`. Failures are `400 { error }`.
1136
+ - `POST /api/research/:clusterId/preview-start`, `prepare-start` and `confirm-start`: start a separate project from released research after the operator picks a folder. `prepare-start` takes `{ selection, parent, name, useExisting? }`; `confirm-start` takes `{ token, workflowId }` and answers `{ recorded: true }`. Failures are `400 { error }`.
1137
+ - `POST /api/research/:clusterId/send-to-project`, `confirm-composer` and `dismiss-send-proposal`: send released research to a folder copy, a plan reference, or a conversation composer. `send-to-project` takes `{ selection, destination?, folderCopy?, planId?, composerWorkflowId?, continueChat? }` with at least one destination (`400` otherwise) and answers an object with `folder`, `plan` and `composer` results, each carrying its own `error` on failure. `confirm-composer` takes `{ token }`; `dismiss-send-proposal` clears the Director's pending proposal (`{ dismissed: true }`). `GET .../summaries` also returns `proposal`, the Director's pending send proposal or `null`.
1138
+
1095
1139
  ---
1096
1140
 
1097
1141
  ## Cluster presets
@@ -1194,11 +1238,20 @@ Discard a single pending message before the recipient drains it. The recipient n
1194
1238
 
1195
1239
  Once a message is delivered (drained via `peer_read`) the file no longer exists; the durable record lives in the recipient's `events.jsonl` as `peer_message_received`. This endpoint only mutates the transient mailbox file layer - there is no "cancel a delivered message" surface.
1196
1240
 
1241
+ ### `PUT /api/clusters/:id/mailbox/:wfid/:msgId`
1242
+
1243
+ Replace the text of one pending message (EDIT in the mailbox modal). Body: `{ "content": "..." }`, at most 32 KB. The rewrite happens under the mailbox lock and keeps the message id, sender, time, attachments and `fromGemini` marker.
1244
+
1245
+ - `200 { "ok": true, "msgId": "..." }` - the pending message now carries the new text.
1246
+ - `400 { "error": "empty_message" }` - `content` is missing or blank.
1247
+ - `409 { "error": "already_delivered" }` - the message was already read or cancelled; nothing changed.
1248
+ - `404 { "error": "unknown_cluster_or_member" }` - `:id` / `:wfid` validation failed.
1249
+
1197
1250
  ---
1198
1251
 
1199
1252
  ## Plans
1200
1253
 
1201
- Backed by `server/src/planStore.ts`.
1254
+ Backed by `server/src/planStore.ts`. Every `/api/plans*` route first checks that `path` names a project Arco knows; an unknown or unavailable project answers `403 { error: 'Project is unavailable' }`. A failure the route does not name below answers `400` (`500` for list, body and delete) with `{ error: <message> }`.
1202
1255
 
1203
1256
  ### `GET /api/plans?path=<cwd>`
1204
1257
 
@@ -1246,7 +1299,7 @@ Create a new plan. Body:
1246
1299
  { title: string, body: string, attach?: boolean, workflowId?: string }
1247
1300
  ```
1248
1301
 
1249
- Server mints `planId`. Returns `{ plan: PlanFull }` with `attachments: []` and `completedAt: null`.
1302
+ Server mints `planId`. Returns `{ plan: PlanFull, publicProject, needsGuardrails }` with `attachments: []` and `completedAt: null`. `publicProject` is the project's effective public-project choice (`true`, `false` or unset); `needsGuardrails` is `true` when the project is public and the new body lacks the guardrail section. In a research project only the Research Director may attach: `403 { error: 'Only the Research Director can attach a plan.' }`.
1250
1303
 
1251
1304
  When `attach: true` and `workflowId` names an active workflow in the same cwd, the server immediately runs the normal attach path: persists `meta.planId`, records the attachment span, acquires the plan watcher, and broadcasts `plan_attached` so the open PLAN tab updates. This is the supported shell-agent path; do not hand-edit `.arco/workflows/<workflowId>/meta.json` to attach a plan because the running server will not see the websocket state transition.
1252
1305
 
@@ -1258,11 +1311,11 @@ curl -sS "http://localhost:3001/api/plans?path=$PWD" \
1258
1311
 
1259
1312
  ### `POST /api/plans/attach?path=<cwd>&planId=<id>&workflowId=<workflowId>`
1260
1313
 
1261
- Attach an existing plan to an active workflow in the same cwd. This mirrors the PLAN tab click / `plan_attach` websocket path and returns `{ ok: true, plan: PlanSummary }`.
1314
+ Attach an existing plan to an active workflow in the same cwd. This mirrors the PLAN tab click / `plan_attach` websocket path and returns `{ ok: true, plan: PlanSummary }`. `400` when a query value is missing or `workflowId` is not active in that cwd (`workflowId is not active in this cwd`); `404 { error: 'plan not found' }`; `403` for a research member other than the Research Director.
1262
1315
 
1263
1316
  ### `POST /api/plans/move?path=<sourceCwd>&planId=<id>`
1264
1317
 
1265
- Move a plan from `path` (source cwd) to another cwd. Body: `{ targetCwd }` (required, else `400`). Backed by `movePlan`; suppresses the source-cwd reconcile broadcast (the move owns it). Returns `{ plan }` on success, or `{ error }` (`400`). An edit to the source plan or its reference documents saved during the move ends up in the moved plan; if the plan keeps changing, the move stops with an error and the plan stays in the source project.
1318
+ Move a plan from `path` (source cwd) to another cwd. Body: `{ targetCwd }` (required, else `400`). Backed by `movePlan`; suppresses the source-cwd reconcile broadcast (the move owns it). Returns `{ plan }` on success, or `{ error }` (`400`). The target must be a project Arco knows. Workflows attached to the plan in the source project are detached. An edit to the source plan or its reference documents saved during the move ends up in the moved plan; if the plan keeps changing, the move stops with an error and the plan stays in the source project.
1266
1319
 
1267
1320
  ### `PATCH /api/plans?path=<cwd>&planId=<id>`
1268
1321
 
@@ -1279,7 +1332,7 @@ Partial update. Body:
1279
1332
 
1280
1333
  Server-side dedup: when `body` is included, the plans-watcher is told to skip its next reconcile so it doesn't double-broadcast `plan_attached` (the PATCH handler already broadcasts directly). Skip flag is no-op when only `completedAt` changes (no `.md` write happens).
1281
1334
 
1282
- Returns `{ plan: PlanFull }`.
1335
+ Returns `{ plan: PlanFull }`; `404 { error: 'plan not found' }`; `409 { error, plan }` for a failed `expectedBody` check; `400` for any other failure. Every workflow attached to the plan receives `plan_attached` with the new title and time.
1283
1336
 
1284
1337
  ### `DELETE /api/plans?path=<cwd>&planId=<id>`
1285
1338
 
@@ -1293,7 +1346,7 @@ Long-form docs attached to one plan, stored as `<cwd>/.arco/plans/<planId>.refs/
1293
1346
 
1294
1347
  - `GET /api/plans/refs?path=<cwd>&planId=<id>` -> `{ refs: PlanRefSummary[] }` (`{ slug, title, bytes, updatedAt }`, slug-sorted).
1295
1348
  - `GET /api/plans/refs/body?path=<cwd>&planId=<id>&slug=<slug>` -> `{ ref: PlanRefFull }` or `404`.
1296
- - `PUT /api/plans/refs?path=<cwd>&planId=<id>&slug=<slug>` body `{ body: string, createOnly?: boolean }` -> `{ ref, created }`. `createOnly: true` atomically refuses existing files or links with `409`; omission keeps ordinary replacement behavior. `404` if the plan doesn't exist, `400` for a bad slug / over-cap body / count cap.
1349
+ - `PUT /api/plans/refs?path=<cwd>&planId=<id>&slug=<slug>` body `{ body: string, createOnly?: boolean }` -> `{ ref, created }`. `createOnly: true` atomically refuses existing files or links with `409`; omission keeps ordinary replacement behavior. `404 { error: 'plan not found' }` if the plan doesn't exist, `409 { error: 'ref already exists' }` for `createOnly`, `400` for a bad slug / over-cap body / count cap. A missing `slug` or a `body` that is not a string is `400`; any other method is `405 { error: 'method not allowed' }`.
1297
1350
  - `DELETE /api/plans/refs?path=<cwd>&planId=<id>&slug=<slug>` -> `{ deleted: true }` or `404`.
1298
1351
 
1299
1352
  PUT and DELETE bump the plan's `updatedAt` and re-broadcast `plan_attached` to attached workflows and `cluster_state` to bound clusters, so open Plan tabs refetch their refs list. Direct file writes don't (the plans watcher ignores the `.refs` dir); the UI also refetches on window focus.
@@ -1338,11 +1391,13 @@ Returns the cached `Capabilities` snapshot (`shared/src/protocol/models.ts`):
1338
1391
  models: ModelName[], // Claude CLI models
1339
1392
  cliVersion: string, // `claude --version`
1340
1393
  codexVersion?: string,
1341
- cursorVersion?: string, // date-stamped, not npm - display-only, no latestVersions.cursor / self-update
1342
- // Latest published upstream versions (npm for the npm-installed CLIs,
1343
- // GitHub Releases for Ollama / llama.cpp). Best-effort: a failed probe leaves
1344
- // the key undefined and the UI shows the installed version with no outdated mark.
1345
- latestVersions?: { claude?, codex?, ollama?, llamacpp? },
1394
+ cursorVersion?: string, // date-stamped Cursor CLI version
1395
+ antigravityVersion?: string,
1396
+ strataVersion?: string,
1397
+ xolotlRevision?: string,
1398
+ codexUpdate?: { kind, updateAvailable, instruction? },
1399
+ // Best-effort update sources; a failed probe leaves its key undefined.
1400
+ latestVersions?: { claude?, codex?, cursor?, 'antigravity-cli'?, ollama?, strata?, xolotl?, llamacpp? },
1346
1401
  }
1347
1402
  ```
1348
1403
 
@@ -1402,9 +1457,12 @@ Distinct from `/api/toolbox`: these are **Arco-managed**, provider-agnostic
1402
1457
  skills authored by the operator from the SettingsPanel SKILLS section. They live
1403
1458
  under `<cwd>/.arco/skills/` (project) and `~/.arco/skills/` (global). The
1404
1459
  catalog (name + description) is injected into every primary turn's system prompt
1405
- as an XML manifest. The same `SKILLS` menu offers **NEW SKILL**, **APPLY ONCE** (full body in the next user
1406
- turn) and **PIN TO TAB** (durable reference; current full body is re-read and
1407
- injected as a standing system instruction every turn until unpinned).
1460
+ as an XML manifest on supported providers. Antigravity CLI receives a first-turn
1461
+ skill list as a conversation line instead; Arco skill picks, tab pins and cluster
1462
+ pins are not sent to Gemini. The same `SKILLS` menu offers **NEW SKILL**,
1463
+ **APPLY ONCE** (full body in the next user turn on supported providers) and
1464
+ **PIN TO TAB** (durable reference; current full body is re-read and injected as a
1465
+ standing system instruction every turn until unpinned, except on Antigravity CLI).
1408
1466
  Backed by `server/src/skills.ts`.
1409
1467
 
1410
1468
  Each skill is a directory containing `SKILL.md` with YAML frontmatter:
@@ -1428,7 +1486,7 @@ Lists all skills visible to a project + the global pool.
1428
1486
  {
1429
1487
  project: SkillSummary[], // empty when cwd is missing
1430
1488
  global: SkillSummary[],
1431
- builtin: Array<{ slug, name, description, scope: 'builtin', operatorOnly: true }>, // shipped with Arco, read-only
1489
+ builtin: Array<{ slug, name, description, scope: 'builtin', operatorOnly: boolean, off?: boolean, replaced?: boolean, path?: string }>, // shipped with Arco, read-only
1432
1490
  }
1433
1491
 
1434
1492
  interface SkillSummary {
@@ -1440,14 +1498,16 @@ interface SkillSummary {
1440
1498
  useCount?: number; // - read-only usage telemetry from the skill-usage sidecar; absent ⇒ never used
1441
1499
  lastUsed?: number; // - epoch ms of last use
1442
1500
  operatorOnly?: boolean; // DD8 - `operator-only: true` frontmatter; withheld from the model manifest, operator-pickable only
1501
+ off?: boolean; // P8.6 - switched off in the skill's `.arco-skill.json`; left out of the manifest, pins and the SKILLS apply list
1502
+ source?: { kind: 'github'; url: string; commit?: string } | { kind: 'folder'; path: string } | { kind: 'zip'; name: string }; // where an imported skill came from
1443
1503
  }
1444
1504
  ```
1445
1505
 
1446
- `cwd` is optional (omit it to list global only). Skills with malformed frontmatter (no `name:`) are silently skipped, matching the toolbox scanner. `useCount` / `lastUsed` are attached from the `skill-usage.json` sidecar in `listSkills` only - they are never folded into the model-facing manifest. `operatorOnly` marks a skill the model is never told exists: it is omitted from the manifest entirely but still listed here and pickable by the operator (who inlines its full body into a turn via the `SKILLS` composer picker).
1506
+ `off` and `source` come from the skill's sidecar file. A built-in entry has `off` (set by `POST /api/skills/state` with `scope: 'builtin'`), `replaced` (a project or global skill with the same slug or name hides it from the manifest) and, unless it is operator-only, the `path` of its materialized `SKILL.md` that agents can read. `cwd` is optional (omit it to list global only); when given it must be a project Arco knows, and any failure, including an unknown project, answers `500 { error }`. Skills with malformed frontmatter (no `name:`) are silently skipped, matching the toolbox scanner. `useCount` / `lastUsed` are attached from the `skill-usage.json` sidecar in `listSkills` only - they are never folded into the model-facing manifest. `operatorOnly` marks a skill the model is never told exists: it is omitted from the manifest entirely but still listed here and pickable by the operator (who inlines its full body into a turn via the `SKILLS` composer picker).
1447
1507
 
1448
1508
  ### `GET /api/skills/body?cwd=<absolute path>&scope=<project|global>&slug=<slug>`
1449
1509
 
1450
- Returns the full skill including `body`. 400 on invalid scope/slug; 404 if missing.
1510
+ Returns the full skill including `body`. `400 { error }` for an invalid scope or slug, a project scope without `cwd`, or a `cwd` that is not a known project; `404 { error: 'skill not found' }` if missing.
1451
1511
 
1452
1512
  **Response:**
1453
1513
  ```ts
@@ -1469,23 +1529,23 @@ Create or update a skill. Body:
1469
1529
  }
1470
1530
  ```
1471
1531
 
1472
- `cwd` query is required for `scope: 'project'`. Returns `{ skill: SkillSummary }`. Path-traversal attempts (slug containing `..`, slashes, or non-`[a-z0-9-]` chars) 400 immediately; the resolved file path is also re-validated against the scope root after resolution as a second-line defence against platform path quirks.
1532
+ `cwd` query is required for `scope: 'project'`. Returns `{ skill: SkillSummary }`. Every failure is `400 { error }`: a bad scope, a missing `cwd`, a `cwd` that is not a known project, a name, description or body over its limit, or an empty one. Path-traversal attempts (slug containing `..`, slashes, or non-`[a-z0-9-]` chars) 400 immediately; the resolved file path is also re-validated against the scope root after resolution as a second-line defence against platform path quirks.
1473
1533
 
1474
1534
  ### `DELETE /api/skills?cwd=<absolute path>&scope=<project|global>&slug=<slug>`
1475
1535
 
1476
- Removes the skill's directory recursively. 404 if missing. Same validation rules as the GET-body endpoint.
1536
+ Removes the skill's directory recursively. `404 { error }` if missing. Same validation rules as the GET-body endpoint.
1477
1537
 
1478
1538
  ### Skill management (P8.6)
1479
1539
 
1480
- All matched before the plain `/api/skills` routes; `cwd` (query) is required for project scope. Errors answer 400 with `{ error }`.
1540
+ All matched before the plain `/api/skills` routes; `cwd` (query) is required for project scope and, when given, must be a known project. Every route except `details` takes `POST` with a JSON body of at most 64 KB (12 MB for `import/preview`, which can carry a zip); a wrong method is `405 { error: 'method not allowed' }`, an unreadable body `400 { error: 'invalid_body' }`, and any other refusal `400 { error }`.
1481
1541
 
1482
1542
  - `POST /api/skills/import/preview` - body `{ source }` with `{ kind: 'github', url }` (a `github.com/.../tree/<ref>/<path>` or `.../blob/<ref>/<path>/SKILL.md` link, or a `raw.githubusercontent.com` link), `{ kind: 'folder', path }` (absolute) or `{ kind: 'zip', name, data }` (base64, at most 8 MB). Returns `{ token, name, description, operatorOnly, files: [{ path, bytes, text, findings }], skipped, source, findingCount }`. Limits: 64 files, 512 KB per file, 2 MB in total, depth 6; links, `..`, absolute and backslash paths, encrypted and zip64 archives are refused; hidden files are skipped.
1483
1543
  - `POST /api/skills/import/confirm` - `{ token, scope }`; writes the reviewed files (mode 0644) and a `.arco-skill.json` sidecar with the source. Returns `{ skill: { scope, slug, name } }`. A token is single-use and expires after 15 minutes.
1484
1544
  - `POST /api/skills/update/preview` - `{ scope, slug }` for a skill imported from GitHub or a folder; returns `{ token, name, changed, files: [{ path, status, text, before?, after?, findings }], source, findingCount }`. `POST /api/skills/update/confirm` - `{ token }` replaces the folder and keeps the off state.
1485
- - `POST /api/skills/state` - `{ scope, slug, off }`. An off skill is left out of the model manifest and pins; `GET /api/skills` reports `off: true` and `source` per skill.
1545
+ - `POST /api/skills/state` - `{ scope, slug, off }`; `scope` may also be `'builtin'` to switch a built-in skill off or on (no `cwd` needed). An off skill is left out of the model manifest and pins; `GET /api/skills` reports `off: true` and `source` per skill.
1486
1546
  - `POST /api/skills/move` - `{ scope, slug, to }`. `POST /api/skills/duplicate` - `{ scope, slug, name }` (the copy has no source).
1487
1547
  - `GET /api/skills/details` - `{ skills: [{ scope, slug, files: [{ path, bytes }], missing }] }`: extra files and referenced skill names that are not installed.
1488
- - `POST /api/skills/share/preview` and `POST /api/skills/share` (`confirm: true`) - `{ slug }`, project scope, registered projects only (403 otherwise). Returns `{ slug, files, alreadyTrackable, publicRepository, lines }`; sharing appends a `# Shared with the repository: <slug>` comment and the lines to `.arco/.gitignore` and verifies with `git check-ignore`. The project-state check reads those lines and leaves the shared skill's files alone.
1548
+ - `POST /api/skills/share/preview` and `POST /api/skills/share` (`confirm: true`, else `400 { error: 'confirmation_required' }`) - `{ slug }`, project scope, registered projects only (`403 { error: 'Project is unavailable' }` otherwise). Returns `{ slug, files, alreadyTrackable, publicRepository, lines }`; sharing appends a `# Shared with the repository: <slug>` comment and the lines to `.arco/.gitignore` and verifies with `git check-ignore`. The project-state check reads those lines and leaves the shared skill's files alone.
1489
1549
 
1490
1550
  ### `POST /api/skills/copy-builtin?cwd=<absolute path>`
1491
1551
 
@@ -1588,7 +1648,7 @@ optional `?cwd=<path>` layers `<cwd>/.arco/settings.json` on top of the global c
1588
1648
 
1589
1649
  ### `POST /api/settings`
1590
1650
 
1591
- Body is a partial `ArcoSettings`. Server merges and atomically writes `~/.arco/settings.json` (the **global** layer only; project-level settings are hand-edited). Returns the new full settings. `themeId` and `fontPackOverride` are validated against `VALID_THEME_IDS` / `VALID_FONT_PACK_IDS` respectively; unknown values 400. Pass `fontPackOverride: null` to clear an override and revert to theme defaults.
1651
+ Body is a partial `ArcoSettings`. Server merges and atomically writes `~/.arco/settings.json` (the **global** layer only; project-level settings are hand-edited). Returns the new full settings. `themeId` and `fontPackOverride` are validated against `VALID_THEME_IDS` / `VALID_FONT_PACK_IDS` respectively; unknown values 400. Pass `fontPackOverride: null` to clear an override and revert to theme defaults. `nativeSubagents` is sanitized through `sanitizeNativeSubagents` (running and start limits, model string, and Background Allowed or Off); see [Persistence](PERSISTENCE.md) and [Background sub-agents](PROVIDERS.md#background-sub-agents).
1592
1652
 
1593
1653
  **Ollama multi-backend is settings-file-only - no dedicated endpoint.** `settings.ollama.backends[]` and `settings.ollama.modelHostMap` are sanitized by `sanitizeOllamaConfig` on read (drop disabled/malformed/duplicate backends; cap 16 backends, 64 map entries) and pass through this POST like any other settings field. The decision: operators edit `~/.arco/settings.json` (or a project `.arco/settings.json`) directly, the same way the legacy single `baseUrl` and `fallbackChains` work - a runtime backend-editor UI/endpoint is deferred (the smaller correct scope for v1; the cooldown state is in-memory and auto-expires, so there's nothing operator-facing to mutate beyond the static list). The existing **DISCOVER ENDPOINTS** flow still fills a single `baseUrl`; multi-backend lists are hand-authored.
1594
1654
 
@@ -1629,7 +1689,8 @@ Returns the per-provider auth snapshot:
1629
1689
  deepseek: AuthStatus, // prepared Exact/Light availability; live residency from /api/deepseek
1630
1690
  strata: AuthStatus, // standalone Strata; context + image modalities from /models
1631
1691
  lmstudio: AuthStatus, // local runtime; loggedIn = LM Studio server reachable
1632
- cursor: AuthStatus, // Cursor (ACP) - loggedIn = ~/.config/cursor/auth.json carries a session token
1692
+ cursor: AuthStatus, // Cursor (ACP) - loggedIn = a readable session token that Cursor has not rejected (see PROVIDERS.md, Cursor > Auth)
1693
+ 'antigravity-cli': AuthStatus, // Gemini through Antigravity CLI; see the note below
1633
1694
  github: AuthStatus,
1634
1695
  }
1635
1696
 
@@ -1667,6 +1728,8 @@ current allowance credential revision when its owner file is readable, with `bin
1667
1728
  separate from the last successful CLI login probe. These bindings identify credential sources, not
1668
1729
  verified allowance accounts or completed OAuth flows.
1669
1730
 
1731
+ `antigravity-cli` is not read from a credential file. `loggedIn` is `true` after a successful in-app login or an interactive turn, `false` with `signInRejected` after the CLI asked for sign-in, and otherwise `probeFailed: true` with the error `Sign-in status is unknown until an interactive turn.` (the status is memory-only, so it is unknown again after a server restart). `installedModels` and `installedModelCapabilities[id]` (`tools`, `vision`, `thinking`, `thinkingLevels`) come from `agy models`, re-read at most once a minute; the thinking levels are `low`, `medium`, `high`, `xhigh`.
1732
+
1670
1733
  `strata` has no login. Its base cascade is `settings.strata.baseUrl` ->
1671
1734
  `STRATA_URL_BASE` -> `http://127.0.0.1:8081/v1`; `POST /api/settings` patches
1672
1735
  `{ strata: { baseUrl } }`, and `{ strata: {} }` resets it. Auth status includes
@@ -1678,23 +1741,34 @@ Polled every 2 minutes by the client.
1678
1741
 
1679
1742
  ### `POST /api/auth-login?provider=<name>`
1680
1743
 
1681
- Triggers the appropriate login flow. Optional `account=<profileId>` is passed through to `triggerAuthLogin` (provider-account profiles). The `provider` query is normalized to one of `github` / `ollama` / `codex` / `cursor`, defaulting any other value (including `lmstudio`) to `claude`. Retired provider identifiers return 400 with an explicit unsupported message. Provider-specific behavior (`triggerAuthLogin`):
1744
+ Prepares a sign-in. Optional `account=<profileId>` selects a Codex account profile. `provider` is one of `claude`, `codex`, `cursor`, `antigravity-cli`, `gemini-research` (the separate sign-in used only by Gemini researchers), `github` or `ollama`; any other value, including `lmstudio`, is treated as `claude`. Retired provider identifiers return `400 { error }` with an explicit unsupported message. Nothing here opens a terminal or a browser. The route returns the command to run, and with `inApp=1` it can also run that command itself and relay its link:
1745
+
1746
+ | Provider | Command returned in `command` | Notes |
1747
+ | --- | --- | --- |
1748
+ | `claude` | `claude auth login --claudeai` | The CLI prints a link and a paste prompt. |
1749
+ | `codex` | `codex login --device-auth` | A profile with its own folder is prefixed with `env CODEX_HOME=<folder>`. The device flow needs no local callback port and works from any device. An unknown `account` returns `{ started: false, manual: 'Unknown Codex account profile: <id>' }`. |
1750
+ | `cursor` | `cursor-agent login` with `NO_OPEN_BROWSER=1` | On Linux the command also unsets `DISPLAY` and `WAYLAND_DISPLAY`, so the sign-in lands in `auth.json` rather than the keyring. The CLI finishes on its own. |
1751
+ | `antigravity-cli` | `agy acp --login` | Paste the authorization code or return URL. |
1752
+ | `gemini-research` | `agy acp --login` with a private home | Used only by Gemini researchers. |
1753
+ | `github` | `gh auth login --hostname github.com --git-protocol https --web` | Device flow. |
1754
+ | `ollama` | none | `started: false` plus a `manual` hint ("run `ollama serve` ..."). Reachability is reported by `/api/auth-status`. |
1682
1755
 
1683
- - **Claude** - spawns `claude auth login --claudeai` detached; returns immediately (`started: true`) and the operator completes browser OAuth.
1684
- - **Codex** - opens a terminal with `codex login`. An optional `account` query selects a Codex account profile.
1685
- - **Cursor** - with `inApp=1`, runs `cursor-agent login` (with `NO_OPEN_BROWSER=1`) in a relayed session that reports the printed link and finishes on its own; otherwise returns the terminal command. An expired long-lived ACP process is retired when its exact sign-in response is observed; the operator resends after completing OAuth and Arco starts a fresh process.
1686
- - **GitHub** - opens a terminal with `gh auth login`.
1687
- - **Ollama** - no auth; returns `started: false` + a `manual` hint ("run `ollama serve` ..."). (Reachability is reported by `/api/auth-status`, not here.)
1756
+ **Response:** always `200` with `AuthLoginResult` (`shared/src/protocol/providers.ts`): `{ started, command?, manual?, hostCommand?, session? }`. `started` is `false` for the fallback: `manual` tells the user to run `command` in Arco's terminal (TOOLS > TERMINAL) or a shell on the server and open the printed link on their own device. In a Docker deployment (`ARCO_DEPLOYMENT=docker`) `hostCommand` is `docker compose exec arco <command>`, to run on the host from the folder holding `compose.yaml`. A truly unexpected throw is `500 { error }`.
1688
1757
 
1689
- When a terminal can't be found, or the systemd service has no desktop display env, the flow returns `started: false` with a `manual` string telling the operator the exact command to run by hand.
1758
+ **In-app sign-in (`inApp=1`).** For `claude`, `codex`, `cursor`, `antigravity-cli` and `gemini-research`, the server runs the command itself (`server/src/authLoginSession.ts`), relays the printed link and code, and answers with `started: true` and `session`. One session per provider can be pending at a time; asking again returns the pending one. `session` is `{ provider, status: 'pending' | 'completed' | 'failed' | 'cancelled', needsCode, awaitingCode?, codeSubmitted?, url?, code?, message?, startedAt, finishedAt? }`. `needsCode` is `true` for Claude, Antigravity and Gemini research (the user pastes the browser's code back) and `false` for Codex and Cursor, which finish on their own once the page confirms (Codex shows a one-time `code` to enter). A session ends after 15 minutes. Its other routes: `GET /api/auth-login/session?provider=` returns `{ session }` (`null` when none); `POST /api/auth-login/code` with `{ provider, code }` writes a one-line code of at most 512 characters to the CLI and returns `{ session }` (`400 { error }` for `no login in progress`, `this provider does not take a pasted code` or `code must be one line`); `POST /api/auth-login/cancel` with `{ provider }` returns `{ session }`. An unknown provider is `400 { error: 'unknown provider' }`; a body over 4096 bytes is refused.
1690
1759
 
1691
- **Response:** always `200` with `{ started: boolean, manual?: string }` - `started: true` = the OAuth flow launched (spawned / a terminal opened); `started: false` carries the `manual` fallback. (A truly unexpected throw is a `500 { error }`.)
1760
+ ### `POST /api/check-updates?provider=<claude|codex|cursor|antigravity-cli>`
1692
1761
 
1693
- ### `POST /api/check-updates?provider=<claude|codex>`
1762
+ Runs the selected CLI's own updater, probes capabilities again, and broadcasts the refreshed snapshot as `capabilities_updated`. `provider` defaults to `claude`; an unrecognized non-retired value also selects Claude. Retired provider identifiers return `400` with an unsupported-provider error. The command depends on the provider:
1694
1763
 
1695
- Runs the selected CLI updater, probes capabilities again, and broadcasts the refreshed snapshot as `capabilities_updated`. `provider` defaults to `claude`; unrecognized non-retired values also select Claude. Retired provider identifiers return `400` with an unsupported-provider error. Claude uses its built-in updater; Codex uses npm installation with a platform-installability check and a repair retry when the post-update probe cannot run the CLI.
1764
+ - **Claude** - its built-in updater (`claude update`).
1765
+ - **Codex** - chosen from how Codex is installed (`server/src/cliUpdateDecision.ts`). A standalone install runs `codex update` when its CLI supports it, and otherwise answers `outcome: 'manual'` with an instruction. An npm install whose global npm folder is the one Codex runs from runs `codex update` when the CLI has it, else `npm install -g @openai/codex@<version>` for the newest version that has a build for this platform; when no installable build exists the answer is `outcome: 'deferred'`, and when the post-update probe cannot run the CLI one `--force` repair retry follows. An npm install that cannot be tied to the npm global folder, or an installation Arco cannot identify, runs nothing and answers `manual` with an instruction. A Codex that already runs the target version is not reinstalled.
1766
+ - **Cursor** - `cursor-agent update`; npm and install scripts are never used as a fallback.
1767
+ - **Antigravity CLI** - `agy update`.
1696
1768
 
1697
- **Response:** `{ provider, updated, previousVersion, currentVersion, capabilities, output, notice?, error? }`. `notice` explains a selected installable version when the registry's latest release is not ready for the current platform. A CLI that remains unavailable after the update returns `updated: false` and an error.
1769
+ The update command is limited to 180 seconds.
1770
+
1771
+ **Response:** `{ provider, updated, previousVersion, currentVersion, capabilities, output, outcome, message, notice?, error? }`. `outcome` is `updated`, `current`, `unchanged`, `deferred`, `manual` or `failed`; `message` is the one-line result the PROVIDERS panel shows. `notice` explains a selected installable version when the registry's latest release is not ready for the current platform. A CLI that remains unavailable after the update, or an updater that exits non-zero, returns `updated: false` and an error.
1698
1772
 
1699
1773
  ## Claude Native auth
1700
1774
 
@@ -1731,9 +1805,11 @@ One pending flow serves the single Native store; a new start supersedes the prev
1731
1805
  }
1732
1806
  ```
1733
1807
 
1808
+ A failure, including a `workflowId` that is not a string of at most 128 characters, answers `500 { error }`.
1809
+
1734
1810
  ### `GET /api/auth/claude-native/flow?id=<flowId>`
1735
1811
 
1736
- Returns `{ flow: ClaudeNativeAuthFlow }` or HTTP 404 after restart, eviction or an unknown id.
1812
+ Returns `{ flow: ClaudeNativeAuthFlow }` or HTTP 404 `{ error: 'Sign-in flow unavailable. Start again.' }` after restart, eviction or an unknown id.
1737
1813
  The id is independent of the OAuth state/verifier. Metadata contains `startedAt`, `expiresAt`,
1738
1814
  `bindingBefore`, optional `workflowId`, and the resulting `binding` only after successful completion.
1739
1815
  Statuses are `pending`, `exchanging`, `complete`, `cancelled`, `expired`, `superseded` and `failed`.
@@ -1763,7 +1839,7 @@ not a successful workflow execution. The existing Native credential-owner lock a
1763
1839
 
1764
1840
  ### `POST /api/auth/claude-native/logout`
1765
1841
 
1766
- Cancels the pending Native bootstrap and clears the persisted tokens. **Response:** `{ ok: true }`.
1842
+ Cancels the pending Native bootstrap and clears the persisted tokens. **Response:** `{ ok: true }`; a failure is `500 { error }`.
1767
1843
 
1768
1844
  ### `POST /api/auth/claude-native/probe`
1769
1845
 
@@ -1806,7 +1882,7 @@ Empirical model probe - sends a minimal `messages.create` request through the li
1806
1882
 
1807
1883
  ### `GET /api/claude-native/catalog[?force=1]`
1808
1884
 
1809
- Anthropic's `/v1/models` response, distilled to the picker shape (camelCase model entry + `supportedEfforts[]` + capability flags) and cached for one hour. Refreshes lazily on the next request after expiry; failures degrade to the last good snapshot. `?force=1` bypasses the cache (CONFIG-tab "REFRESH" button).
1885
+ Anthropic's `/v1/models` response, distilled to the picker shape (camelCase model entry + `supportedEfforts[]` + capability flags) and cached for one hour. Refreshes lazily on the next request after expiry; failures degrade to the last good snapshot. `?force=1` bypasses the cache (CONFIG-tab "REFRESH" button). When no snapshot can be fetched and none is cached the answer is `500 { error }`.
1810
1886
 
1811
1887
  **Response:**
1812
1888
  ```ts
@@ -2008,7 +2084,7 @@ Replace the reviewed catalog. Body: `{ models: LlamacppModelDef[], revision: str
2008
2084
 
2009
2085
  ## Per-tab sandbox
2010
2086
 
2011
- Per-tab SQLite FTS5 index for `ctx_execute` / `ctx_search` / `ctx_fetch` tools (Claude Native only). Enabled when `WorkflowConfig.efficiencySandbox === 'on'`. Backed by `server/src/sandboxStore.ts`.
2087
+ Per-tab SQLite FTS5 index for `ctx_execute` / `ctx_search` / `ctx_fetch` tools (Claude Native only). Enabled when `WorkflowConfig.efficiencySandbox === 'on'`. Backed by `server/src/providers/claude-native/sandboxStore.ts`.
2012
2088
 
2013
2089
  ### `GET /api/workflows/:wfId/sandbox/stats`
2014
2090
 
@@ -2097,34 +2173,34 @@ Returns the count of currently connected WS sessions. Used by the launcher to de
2097
2173
 
2098
2174
  ## GitHub proxy
2099
2175
 
2100
- `/api/github/*` is a thin proxy over the operator's `gh` CLI auth token. The token is fetched per request via `gh auth token` (no caching - `gh` handles refresh). All routes return whatever the GitHub REST API returns; Arco doesn't transform.
2176
+ `/api/github/*` is a thin proxy over the operator's `gh` CLI auth token (`server/src/http/githubRoutes.ts`, `server/src/github.ts`). The token is fetched per request via `gh auth token` (5 second limit, no caching - `gh` handles refresh) and sent to `api.github.com`. Most routes return the GitHub REST body unchanged. The exceptions are `context`, `commit-count`, `rerun`, `tree` (a directory listing reduced to `{ type: 'dir' | 'file', name, path, size?, sha, download_url }`, or with `recursive=1` `{ entries: [{ path, size? }], truncated }` of files only), `issues` (pull requests are removed from the list), `commits/:sha` (only its `files`) and `repos?search=`. Only `GET` and `POST` routes exist; a request whose path matches none answers `404 { error: 'Unknown GitHub endpoint' }`.
2101
2177
 
2102
2178
  | Path | Method | Purpose |
2103
2179
  |---|---|---|
2104
2180
  | `/api/github/user` | GET | Authenticated user |
2105
2181
  | `/api/github/context?path=<cwd>` | GET | Resolve local cwd -> `{ owner, name, branch }` from git remote; 404 when not a GitHub repo |
2106
- | `/api/github/repos` | GET | List repos for the user |
2182
+ | `/api/github/repos` | GET | List repos for the user. Query: `search` (repository names matching the text, owned by the user, newest first; 30 results), `type` (`all`, `owner`, `member`, `public` or `private`; default `owner`) and `page` (default 1; 30 per page, sorted by last push) |
2107
2183
  | `/api/github/repos/:owner/:repo` | GET | Repo metadata |
2108
2184
  | `/api/github/repos/:owner/:repo/branches` | GET | Branches |
2109
2185
  | `/api/github/repos/:owner/:repo/tags` | GET | Tags |
2110
2186
  | `/api/github/repos/:owner/:repo/releases` | GET | Releases |
2111
- | `/api/github/repos/:owner/:repo/commits` | GET | Commits (list) |
2187
+ | `/api/github/repos/:owner/:repo/commits` | GET | Commits (list). Query: `sha` (branch or commit to start from), `path` (only commits touching it), `page` (default 1; 30 per page) |
2112
2188
  | `/api/github/repos/:owner/:repo/commits/:sha` | GET | A single commit's changed files (with patches) - I4 |
2113
2189
  | `/api/github/repos/:owner/:repo/contributors` | GET | Contributors |
2114
2190
  | `/api/github/repos/:owner/:repo/languages` | GET | Languages |
2115
- | `/api/github/repos/:owner/:repo/commit-count` | GET | Total commit count |
2116
- | `/api/github/repos/:owner/:repo/readme` | GET | Decoded README |
2117
- | `/api/github/repos/:owner/:repo/tree` | GET | File tree |
2118
- | `/api/github/repos/:owner/:repo/contents` | GET | File contents |
2119
- | `/api/github/repos/:owner/:repo/pulls` | GET / POST | List PRs / **create a PR** - I4 |
2191
+ | `/api/github/repos/:owner/:repo/commit-count` | GET | Total commit count of `sha` (required, else `400 { error: 'sha query required' }`) as `{ count }`, cached for 60 seconds |
2192
+ | `/api/github/repos/:owner/:repo/readme` | GET | README as GitHub returns it (`content` is base64, with `encoding`); optional `ref` |
2193
+ | `/api/github/repos/:owner/:repo/tree` | GET | One directory (`ref`, `path`), or with `recursive=1` every file of `ref` (`400 { error }` without `ref`) |
2194
+ | `/api/github/repos/:owner/:repo/contents` | GET | One file; `path` is required (`400 { error: 'path query required' }`), `ref` optional |
2195
+ | `/api/github/repos/:owner/:repo/pulls` | GET / POST | List PRs (`state` = `open`, `closed` or `all`; default `open`) / **create a PR** - I4 |
2120
2196
  | `/api/github/repos/:owner/:repo/pulls/:n` | GET | PR detail |
2121
2197
  | `/api/github/repos/:owner/:repo/pulls/:n/files` | GET | PR files |
2122
2198
  | `/api/github/repos/:owner/:repo/pulls/:n/comments` | GET | PR review comments |
2123
- | `/api/github/repos/:owner/:repo/pulls/:n/checks` | GET | PR CI checks |
2124
- | `/api/github/repos/:owner/:repo/pulls/:n/merge` | POST | Merge PR |
2125
- | `/api/github/repos/:owner/:repo/issues` | GET | List issues |
2199
+ | `/api/github/repos/:owner/:repo/pulls/:n/checks` | GET | CI check runs for the commit named by the required `ref` query (`400 { error: 'ref query required' }`); `:n` is not used |
2200
+ | `/api/github/repos/:owner/:repo/pulls/:n/merge` | POST | Merge PR. Body `{ method?: 'merge' \| 'squash' \| 'rebase', title?, message? }` |
2201
+ | `/api/github/repos/:owner/:repo/issues` | GET | List issues (`state` = `open`, `closed` or `all`; default `open`) |
2126
2202
  | `/api/github/repos/:owner/:repo/issues/:n` | GET | Issue detail |
2127
- | `/api/github/repos/:owner/:repo/issues/:n/comments` | GET / POST | Issue comments / new comment |
2203
+ | `/api/github/repos/:owner/:repo/issues/:n/comments` | GET / POST | Issue comments / new comment (body `{ body }`; `400 { error: 'body required' }` when empty) |
2128
2204
  | `/api/github/repos/:owner/:repo/issues/:n/close` | POST | Close issue |
2129
2205
  | `/api/github/repos/:owner/:repo/issues/:n/reopen` | POST | Reopen issue |
2130
2206
  | `/api/github/repos/:owner/:repo/runs` | GET | Workflow runs |
@@ -2132,7 +2208,9 @@ Returns the count of currently connected WS sessions. Used by the launcher to de
2132
2208
  | `/api/github/repos/:owner/:repo/runs/:id/jobs` | GET | Run jobs |
2133
2209
  | `/api/github/repos/:owner/:repo/runs/:id/rerun` | POST | Rerun; accepted empty upstream success returns `{ ok: true }` |
2134
2210
 
2135
- If `gh auth status` reports unauthenticated, every route returns 401 with `{ error: "GitHub CLI not authenticated" }`. Run `gh auth login` (or use the in-UI flow at `POST /api/auth-login?provider=github`).
2211
+ `GET /api/github/context?path=<cwd>` answers `400 { error: 'path query required' }` without `path`, `404 { error }` when the folder is not a Git working tree, has no `origin` remote, or `origin` is not on github.com (that last answer also carries `remote`), and otherwise `{ owner, name, branch }` (`branch` is `null` on a detached HEAD).
2212
+
2213
+ Every other failure answers `502 { error }`, including a missing or empty token (`gh token unavailable: ...`) and any non-success answer from GitHub (`GitHub <status> <text>: <first 300 characters of the body>`); there is no separate 401. Run `gh auth login` (or use the in-UI flow at `POST /api/auth-login?provider=github`).
2136
2214
 
2137
2215
  ### `POST /api/github/repos/:owner/:repo/pulls` - create a pull request
2138
2216
 
@@ -2200,7 +2278,7 @@ System-wide enumeration of TCP listeners. Returns `{ entries: Array<{ port: numb
2200
2278
 
2201
2279
  ## Git operations
2202
2280
 
2203
- Powers the `⎇ GIT` composer button (`client/src/components/GitDialog.tsx`). Two endpoints; live status read + branch checkout. Implementation in `server/src/git.ts`.
2281
+ Powers the `⎇ GIT` composer button (`client/src/components/GitDialog.tsx`). These two endpoints are the live status read and the branch checkout; the other `/api/git/*` routes (diff, compare, fetch, worktrees, other work, and the mutating `op` family) are documented above under Workflows. Implementation in `server/src/git.ts`.
2204
2282
 
2205
2283
  ### `GET /api/git/status?path=<cwd>`
2206
2284
 
@@ -2253,7 +2331,7 @@ type GitRemoteSummary = {
2253
2331
 
2254
2332
  Discovery uses `git rev-parse`, `git status --porcelain=v2`, `git diff --name-status`, `git for-each-ref refs/heads/`, `git remote -v`, and `git symbolic-ref --short refs/remotes/origin/HEAD`. If the path isn't a git repo, returns `{ isRepo: false,... }` with the rest zeroed; the dialog renders an inert "not a repo" banner.
2255
2333
 
2256
- Errors: `400` on missing/invalid `path`; `200` with `isRepo: false` on non-repo paths (not an error).
2334
+ Errors: `400 { error: 'path query required' }` when `path` is missing; `200` with `isRepo: false` on non-repo paths (not an error). `path` must be a project folder Arco knows; any other path, and any unexpected failure, answers `500 { error }` (this route does not map the access refusal to 403).
2257
2335
 
2258
2336
  ### `POST /api/git/checkout`
2259
2337
 
@@ -2277,7 +2355,8 @@ Response:
2277
2355
 
2278
2356
  Behavior:
2279
2357
 
2280
- - **Branch name validation:** `/^[A-Za-z0-9._/-]+$/`. Anything else returns `{ ok: false, error: '...' }` with HTTP 400.
2358
+ - **Request check:** a missing `path` or `branch` is `400 { error: 'path and branch required' }`. Every refusal below answers HTTP `400` with `{ ok: false, error }`; success is `200 { ok: true }`. A `path` outside the known projects, or an unexpected failure, is `500 { error }`.
2359
+ - **Branch name validation:** `/^[A-Za-z0-9._/-]+$/` for `branch` and for `create.fromBranch`. Anything else returns `{ ok: false, error: 'Invalid branch name...' }` (or `'Invalid base-branch name.'`).
2281
2360
  - **Dirty-tree refusal:** runs `git status --porcelain`; if non-empty, returns `{ ok: false, error: 'Working tree has uncommitted changes....' }`. Operator must commit or stash before switching. The refusal happens server-side before any branch state changes.
2282
2361
  - **Plain switch:** runs `git checkout <branch>`.
2283
2362
  - **Create + switch:** verifies the base branch exists (`git rev-parse --verify refs/heads/<base>`), verifies the target doesn't already exist (otherwise checkout would silently switch to the existing branch - surprising), then runs `git checkout -b <branch> <base>`.
@@ -2290,7 +2369,7 @@ Behavior:
2290
2369
 
2291
2370
  The single WebSocket endpoint. All real-time interaction goes through here. See [`PROTOCOL.md`](PROTOCOL.md) for the full message catalog.
2292
2371
 
2293
- The handshake is a standard WebSocket upgrade - no custom subprotocols or auth headers (Arco assumes single-operator local-only usage).
2372
+ The handshake is a standard WebSocket upgrade with no custom subprotocols. It needs an approved `Origin` (otherwise `403`) and, for `/ws` and `/terminal`, the `arco_session_<port>` cookie from `POST /api/session` (otherwise `401`). See the session cookie section and Conventions.
2294
2373
 
2295
2374
  ---
2296
2375
 
@@ -2321,6 +2400,11 @@ falls back to local Kokoro. Effects use ordinary workflow messages.
2321
2400
  | `POST /api/voice/mail-rules?owner=<ComputerId>` | `{action:'create',cluster_id,worker_ids:string[],final_id}`, `{action:'list'}`, `{action:'cancel'|'pause'|'resume',rule_id}` or `{action:'claim-announcement',rule_id}` | `{rule?,rules,announce?,warning?}`; strict schema, ≤4 KB. Exact distinct IDs in one cluster, 1-16 selected workers, separate final recipient, one active rule per cluster, ≤16 globally. Two-hour expiry/30s cooldown/8 nudges per worker. No AUTO-PICKUP coexistence. Claim deduplicates terminal speech. Saved arming waits for durable persistence; private rules memory-only. Errors refuse arming/stop future nudges |
2322
2401
  | `GET /api/voice/watches?owner=<ComputerId>` | - | `{watches,warning?}`; saved watches plus only this owner's memory-only private watches; normal cookie/origin gates, no voice lease required |
2323
2402
  | `POST /api/voice/watches?owner=<ComputerId>` | `{action:'create',target:<exact worker/cluster id>}` or `{action:'cancel',watch_id}` or `{action:'claim-announcement',watch_id}` | `{watch?,watches,announce?,warning?}`; ≤2 KB; exact active busy generations, whole queue boundary, no model polling; only one claim succeeds per terminal watch. Private targets/Computer itself rejected. Saved metadata atomic/durable; private owner watches memory-only. 400 on missing/idle/ambiguous target, cap or persistence failure |
2403
+ | `GET /api/voice/setup` | - | The setup status for the VOICE panel: `{ deployment: 'host' \| 'docker', platform, voiceHome, voiceHomeFromEnv, uv, python, packages, models, ready, notices, install }`; `install` is `{ running, exitCode, startedAt, finishedAt, log }`. No voice lease |
2404
+ | `POST /api/voice/setup/install` | `{}` | `202 { ok: true }` after starting `node scripts/voice/run.mjs setup.py` (the same work as `npm run voice:setup`). `400` in a Docker deployment, `409` when setup is already running, `500` when the script is missing |
2405
+ | `POST /api/voice/setup/cancel` | `{}` | `{ ok }`; `true` when a running setup was stopped |
2406
+ | `GET /api/voice/setup/notices` | - | The `NOTICES.md` of the installed voice models as `text/markdown`; `404` until setup has finished |
2407
+ | `POST /api/voice/setup/transcribe` | mono 16 kHz PCM16, at most 10 seconds | `{ text, ms, recognizer }`; the recognizer is `Parakeet v3` or `Moonshine tiny`. The test phrase of the setup panel, with no session. `409` while setup runs or another test phrase is being recognized, `503` when local speech is not installed, `400` for empty or odd-length audio |
2324
2408
  | `GET /api/voice/status` | - | `{localSpeech,fastWake,interpreter:'codex',model:'gpt-6-luna',effort:'low',defaultVoice,voices}`; output voice catalog from `shared/src/voice.ts` |
2325
2409
  | `POST /api/voice/session` | `{enabled:true,voice?}` | `{sessionId}`; requires installed local speech; optional listed output voice |
2326
2410
  | `POST /api/voice/warmup?session=<id>` | `{}` | `{ready:true,fastWake,recognizer,voice}`; prepares local recognition, speech output and optional streaming wake detection before listening; wake failure falls back to full recognition |
@@ -2335,6 +2419,8 @@ falls back to local Kokoro. Effects use ordinary workflow messages.
2335
2419
  | `POST /api/voice/tool` | `{workflowId,tool,args}` (loopback only, from the `arco-voice` MCP child) | `{ok,result}` or `{ok:false,error}`; relayed to the browser owning the session as WS `voice_tool_call`, answered by `voice_tool_result`; 404 unless the workflow is a `voiceOperator` chat; logged as `[voice tool] ...` |
2336
2420
  | `POST /api/voice/diag?session=<id>` | `{events:[...]}` (≤64 KB, ≤200 events) | `{ok:true}`; each event is written to the journal as `[voice <sid>] client {...}` |
2337
2421
 
2422
+ Status codes. A refused or failed voice request answers `400 { error }`: this includes malformed JSON, a body over its limit, an unknown or expired `session` (`Voice session expired. Enable hands-free mode again.`), a third `POST /api/voice/session` while two are open, a wake utterance that is stale or out of range, and an interpretation request that names an Incognito conversation. `POST /api/voice/session` answers `400` unless `enabled` is `true`, and `503` when local speech is not installed. `POST /api/voice/tool` answers `403` for a caller that is not on the loopback address. A busy recognizer or wake detector answers `409`, and a path under `/api/voice/` that matches nothing is `404 { error: 'Unknown voice operation.' }`. The conditions, activity, mail-rule and watch routes accept `GET` and `POST` only.
2423
+
2338
2424
  The client streams 40 ms wake chunks. The wake endpoint accepts one in-flight chunk per session and scans at most
2339
2425
  three seconds per utterance. Its result only acknowledges a candidate; full
2340
2426
  transcription still verifies Computer as the first word before any action.
@@ -2368,6 +2454,8 @@ a replacement selected by a later request. Tests: `npm run test:voice`.
2368
2454
 
2369
2455
  `POST /api/storage/archive`, `/api/storage/restore` and `/api/storage/delete`, each with `{ path, workflowId, confirm: true }`, act on one conversation. ARCHIVE writes `<project>/.arco/archive/<id>.arcoarchive`, reads it back against each file's hash, then removes the archived files; kept items, links, `keep.json` and `storage-warnings.json` always stay in the folder. Archive, delete and EMPTY SCRATCH hold the conversation's KEEP lock (`keepStore.withKeepLock`, shared with the KEEP writer) from reading the list through the last removal. RESTORE checks the whole archive and refuses (409 `exists`) when any file already exists, then writes every file and removes the archive. DELETE runs the existing purge (folder, checkpoints, Recall row, mailbox), leaves kept items, and removes the archive if there is one. Archive and delete answer 409 `open` for an open or working conversation, 409 `kept` when the whole conversation is kept, and 409 `keep_unreadable` when the KEEP file cannot be read; 404 when there is nothing to act on. No storage action follows a link: when the project's `.arco`, `.arco/workflows`, `.arco/archive`, the conversation folder, its `scratch/`, the archive file or any folder on a restored file's path is a link, the action answers 409 `unsafe` and changes nothing. COMPRESS OLD LOGS skips linked conversation folders. Every action is recorded in `<project>/.arco/storage-actions.jsonl`.
2370
2456
 
2457
+ `GET /api/storage/scratch?workflowId=<id>` measures scratch for a live, server-bound conversation and reports its measurement time and KEEP marks; an unreadable or unsafe folder returns an error. The optional `busyOnly=1` reads turn state without a scan. `POST /api/storage/empty-scratch` with `{ workflowId, confirm: true, onClose: true }` uses that server binding, including saved Chat storage, and reserves the conversation until the existing KEEP-aware operation finishes. A successful removal records a notice and a pending agent-turn reminder. A queued message or failed action leaves the conversation open; nothing is deleted while its turn is working or still stopping.
2458
+
2371
2459
  `POST /api/storage/compress-logs` with `{ path, confirm: true }` (COMPRESS OLD LOGS) seals the live logs of the project's closed conversations into compressed segments, the same lossless sealing as during writes (see [Persistence](PERSISTENCE.md#sealed-segments)). Open or working conversations are skipped and listed in `skippedOpen`; logs under 1 MiB are left plain. `deferred` counts logs whose segments were written but whose live file another program held open (Windows refuses a rename over an open file); the live file stays complete and the next seal replaces it. Each seal runs inside the conversation's write chain, so an event written meanwhile lands in the new live file. The result is `{ ok, sealed, skippedOpen, failed, deferred, beforeBytes, afterBytes }`, and the action is recorded in `storage-actions.jsonl`. Nothing is deleted.
2372
2460
 
2373
2461
  `GET` and `POST /api/storage/policy` read and change `{ autoArchiveClosedDays, budgetGiB, budgetNotice }` in Arco's `storage-policy.json`. Defaults: `null` (auto-archive off), `100`, `true`; invalid values fall back to them. When `autoArchiveClosedDays` is set, a daily run archives conversations closed for that many days that are not kept; it never deletes. `GET /api/storage/budget` returns `{ enabled, limitBytes, totalBytes, measuredAt, over }` from the last measurement; it does not start one. The daily run measures again while the notice is on. `ARCO_STORAGE_POLICY=0` turns the daily run off.
@@ -2385,11 +2473,19 @@ Routes not covered above. Each is served by the module named in the last column.
2385
2473
  | Route | Purpose | Module |
2386
2474
  | --- | --- | --- |
2387
2475
  | `GET /api/app/version` | Running Arco version and build identity (`/healthz` adds liveness fields). | `http/appVersionRoutes.ts` |
2388
- | `GET`, `POST /api/update-check` | Release-check status; `POST` runs a check now (CHECK NOW). | `http/router.ts`, `updateCheck.ts` |
2476
+ | `GET`, `POST /api/update-check` | Release-check status. `POST` runs **CHECK NOW**. A lookup failure sets `checkFailure` to `npm` or `github`, preserves the previous release as stale and clears `updateAvailable`. | `http/router.ts`, `updateCheck.ts` |
2389
2477
  | `GET /api/installation-history` | Whether this Arco home has completed setup or holds saved work, for the Welcome flow. | `http/router.ts` |
2390
2478
  | `GET /api/connections`, `POST /api/connections/check?provider=` | The Connections catalog, and one provider's connection check (a successful check enables that provider). | `http/connectionsRoutes.ts` |
2391
2479
  | `GET /api/auth-login/session?provider=`, `POST /api/auth-login/code`, `POST /api/auth-login/cancel` | The current sign-in session for a provider, the pasted browser code (Claude) and cancel. | `http/authLoginRoutes.ts` |
2392
2480
  | `GET`, `POST`, `PATCH`, `DELETE /api/projects`; `POST /api/projects/relocate`; `POST /api/projects/create` | The registered project list: register, organize (name, pin, archive), forget (files untouched), relocate a missing folder, create a new folder. | `http/projectRoutes.ts` |
2481
+ | `GET /api/handoff-sources?workflowId=[&source=][&offset=]` | Earlier conversations a Handoff or Spawn can read, for the picker: `{ sources: [{ key, name, throughSeq, available }], currentSourceKey?, nextOffset }` in pages of 20; with `source` the saved config of one source (`{ workflowId, throughSeq, config }`). `403` when the conversation may not read history, `404` when the source is gone. Needs the session. | `http/workflowDataRoutes.ts` |
2482
+ | `POST /api/agent-handoff-history` | The agent-side read of earlier conversations. Needs `Authorization: Bearer <token>`, a random token the server mints for one live conversation (24 hours, bound to that conversation); `403` for a missing or stale token, `405` for another method, `413` over 16 KB, `400` for a bad request. Not a browser route and not session-cookie based. See [Architecture](ARCHITECTURE.md). | `http/handoffHistoryRoutes.ts` |
2483
+ | `GET /api/local-runtime-status` | One snapshot of the enabled local runtimes for the header: `{ rows: [{ provider, state, models, detail?, modelExpiries? }], fetchedAt, ollama?, llamacpp? }`. Only enabled providers are probed; the result is cached for 5 seconds. | `http/router.ts`, `localRuntimeStatus.ts` |
2484
+ | `GET /api/antigravity-usage` | Gemini usage from `agy -p /usage`: `{ pools: [{ name, percentLeft, reset }] \| null }`; `null` when the CLI is missing or answers something unreadable. `Cache-Control: no-store`. Each call runs the CLI (5 second limit). | `http/router.ts`, `providers/antigravity/usage.ts` |
2485
+ | `GET /api/antigravity-chat-folder/:workflowId` | The working folder of a saved Antigravity Chat (`{ path }`); `404` for any other conversation or an Incognito chat. | `http/clusterRoutes.ts` |
2486
+ | `GET /api/explorer/plans/target?path=&kind=workflow\|cluster&id=` | Whether a conversation or cluster belongs to the same project as `path` (`{ sameProject }`), for ARTIFACTS plan attach. `400` for a bad target, `404` when the target is gone. | `http/explorerRoutes.ts` |
2487
+ | `POST /api/explorer/plans/attach?path=&clusterId=&planId=` | Attach a project plan to a cluster (not to one member). `400` when the cluster belongs to another project, `404` when the plan is missing; success broadcasts `cluster_plan_changed` and `cluster_state`. Operator session only. | `http/explorerRoutes.ts` |
2488
+ | `POST /api/phone-upload`; `GET`, `DELETE /api/phone-upload/:linkId`; `GET`, `DELETE /api/phone-upload/draft/:fileId` | The operator side of UPLOAD FROM PHONE (see [Operations](OPERATIONS.md)). Needs the session cookie and an `x-arco-phone-owner` header of 64 hex characters (`401`, `403` otherwise). `POST` takes `{ workflowId, origin?, theme? }` and returns the link; `409` when the conversation takes no attachments, `503` when no phone address can be opened. `GET` the link returns `{ files, closed, verifiedAt }`; `DELETE` closes it. The draft routes read a preview (`{ preview? }`) or discard one uploaded file. The phone itself uses the separate `/phone-upload` page and its listener, which accept only the page and upload requests. | `http/phoneUploadRoutes.ts` |
2393
2489
  | `GET /api/terminal-sessions?path=` | Claude Code and Codex terminal sessions for a folder that are not open in Arco (Continue a session from the terminal). | `http/workflowDataRoutes.ts` |
2394
2490
  | `GET /api/outputs`; `GET /api/outputs/file`, `/api/outputs/content`; `POST /api/outputs/open`, `/api/outputs/transfer`, `/api/outputs/text` | Workspace Outputs: list (`workflowId` or `clusterId`, `cwd`), raw file or download and preview content (`id`), OPEN in the default app, copy or move (Save a copy, Move), and save inline text. See [Outputs](OUTPUTS.md). | `http/outputRoutes.ts` |
2395
2491
  | `GET /api/utility-agent/providers`; `POST /api/utility-agent/test`, `/brief`, `/catch-up`, `/tidy`, `/cancel` | Utility agent: which providers can serve, TEST, BRIEF, CATCH ME UP, TIDY and cancel of a running job (`jobId`). | `http/utilityAgentRoutes.ts`, `http/tidyRoutes.ts` |