arco-workbench 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1363) hide show
  1. package/CONTRIBUTING.md +40 -8
  2. package/README.md +35 -21
  3. package/THIRD_PARTY_NOTICES +789 -0
  4. package/client/dist/assets/{PhosphorBackdrop-CNumba2X.js → PhosphorBackdrop-D6cbmLNY.js} +1 -1
  5. package/client/dist/assets/{ThemedBackgroundShaderImpl-DX5KyCt3.js → ThemedBackgroundShaderImpl-2dyerOi4.js} +1 -1
  6. package/client/dist/assets/{XtermView-DhS5g8Rt.js → XtermView-AIwo7O3D.js} +2 -2
  7. package/client/dist/assets/galleryEditor-DXAuxS8D.js +702 -0
  8. package/client/dist/assets/index-8j6p-pmQ.js +610 -0
  9. package/client/dist/assets/index-DD9kFGsF.css +1 -0
  10. package/client/dist/index.html +2 -2
  11. package/client/src/App.tsx +44 -55
  12. package/client/src/alerts/desktopAlerts.ts +20 -12
  13. package/client/src/alerts/desktopTest.ts +68 -0
  14. package/client/src/alerts/focusNotice.ts +16 -0
  15. package/client/src/buildCheck.ts +42 -2
  16. package/client/src/components/ArchitectureReviewDialog.tsx +98 -0
  17. package/client/src/components/ArtifactModal.tsx +4 -6
  18. package/client/src/components/ArtifactMoveDialog.tsx +11 -7
  19. package/client/src/components/AskUserQuestionNotice.tsx +2 -1
  20. package/client/src/components/AutomaticMessage.tsx +19 -0
  21. package/client/src/components/BriefControl.tsx +4 -2
  22. package/client/src/components/BrowserNotice.tsx +35 -0
  23. package/client/src/components/CatchMeUp.tsx +12 -6
  24. package/client/src/components/ChatMessage.tsx +15 -4
  25. package/client/src/components/ChatModeView.tsx +23 -16
  26. package/client/src/components/ChatPanel.tsx +33 -5
  27. package/client/src/components/CheckpointActions.tsx +91 -26
  28. package/client/src/components/ClusterActivityTab.tsx +4 -2
  29. package/client/src/components/ClusterMemberPicker.tsx +6 -3
  30. package/client/src/components/ClusterPlanTab.tsx +93 -62
  31. package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +16 -5
  32. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +25 -14
  33. package/client/src/components/ClusterRightPanel/MailboxModal.tsx +7 -3
  34. package/client/src/components/ClusterRightPanel/MemberRow.tsx +5 -2
  35. package/client/src/components/ClusterRightPanel/MemberSettingsFields.tsx +104 -0
  36. package/client/src/components/ClusterRightPanel/MessageGuardControl.tsx +1 -1
  37. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +85 -7
  38. package/client/src/components/ClusterRightPanel/index.tsx +90 -36
  39. package/client/src/components/ClusterRightPanel/memberSettings.ts +52 -0
  40. package/client/src/components/ClusterRightPanel/panels.ts +18 -0
  41. package/client/src/components/ClusterRightPanel/types.ts +9 -10
  42. package/client/src/components/ClusterTab.tsx +252 -62
  43. package/client/src/components/ClusterTaskBoardTab.tsx +22 -598
  44. package/client/src/components/CommandPalette.tsx +17 -6
  45. package/client/src/components/ComputerAgentPicker.tsx +1 -1
  46. package/client/src/components/ComputerPanel.tsx +4 -2
  47. package/client/src/components/Connections/Connections.tsx +5 -2
  48. package/client/src/components/Connections/EndpointEditor.tsx +2 -2
  49. package/client/src/components/Connections/connections.css +1 -1
  50. package/client/src/components/Connections/model.ts +5 -1
  51. package/client/src/components/ContextMeter.tsx +15 -4
  52. package/client/src/components/DeepSeekControls.tsx +7 -6
  53. package/client/src/components/DiagnosticsTab.tsx +3 -2
  54. package/client/src/components/DialogShell.tsx +19 -11
  55. package/client/src/components/FileExplorer.tsx +8 -9
  56. package/client/src/components/FileViewerModal.tsx +37 -12
  57. package/client/src/components/FirstRun.tsx +8 -7
  58. package/client/src/components/GateApprovalNotice.tsx +4 -2
  59. package/client/src/components/GitDialog.tsx +1 -0
  60. package/client/src/components/GitHubPanel/CodeView.tsx +35 -23
  61. package/client/src/components/GitHubPanel/IssueView.tsx +6 -4
  62. package/client/src/components/GitHubPanel/PullView.tsx +7 -6
  63. package/client/src/components/GitHubPanel/RunView.tsx +7 -5
  64. package/client/src/components/GitHubPanel/shared.tsx +23 -8
  65. package/client/src/components/HandoffSeedPill.tsx +5 -5
  66. package/client/src/components/HandoffSource.tsx +54 -0
  67. package/client/src/components/HeaderAuthChip.tsx +22 -1
  68. package/client/src/components/HeaderDropdown.tsx +5 -0
  69. package/client/src/components/HeaderVersionBox.tsx +3 -0
  70. package/client/src/components/HistoryTab.tsx +59 -32
  71. package/client/src/components/Home/AddProject.tsx +1 -1
  72. package/client/src/components/Home/HomeView.tsx +28 -19
  73. package/client/src/components/Home/LocationDialog.tsx +1 -1
  74. package/client/src/components/Home/ProjectCard.tsx +5 -3
  75. package/client/src/components/Home/home.css +4 -4
  76. package/client/src/components/KeepButton.tsx +22 -0
  77. package/client/src/components/LlamacppCatalogEditor.tsx +12 -3
  78. package/client/src/components/LocalRuntimeStatus.tsx +54 -0
  79. package/client/src/components/MdTuneupDialog.tsx +3 -1
  80. package/client/src/components/MemberCard.tsx +44 -42
  81. package/client/src/components/MemberPane.tsx +11 -10
  82. package/client/src/components/ModelHealthPanel.tsx +5 -4
  83. package/client/src/components/NativeSubagentControls.tsx +64 -0
  84. package/client/src/components/NeedsYouBadge.tsx +13 -6
  85. package/client/src/components/NorthStarBar.tsx +5 -3
  86. package/client/src/components/NotificationCenter.tsx +14 -2
  87. package/client/src/components/NotificationChannelsSettings.tsx +38 -30
  88. package/client/src/components/NotificationToasts.tsx +6 -8
  89. package/client/src/components/PendingQuestionsButton.tsx +4 -1
  90. package/client/src/components/PlanBodyRenderer.tsx +1 -0
  91. package/client/src/components/PlanCandidateBanner.tsx +20 -3
  92. package/client/src/components/PlanReviewPicker.tsx +6 -3
  93. package/client/src/components/PreviewTab.tsx +62 -25
  94. package/client/src/components/PrimaryStatus.tsx +20 -74
  95. package/client/src/components/ProjectsSettings.tsx +28 -2
  96. package/client/src/components/ProviderReleasesModal.tsx +13 -3
  97. package/client/src/components/ProvidersPopover.tsx +81 -23
  98. package/client/src/components/PublicProjectBox.tsx +10 -6
  99. package/client/src/components/PurgeConversationModal.tsx +7 -2
  100. package/client/src/components/QueuedMessagesIndicator.tsx +42 -150
  101. package/client/src/components/Recall/RecallResultRow.tsx +4 -2
  102. package/client/src/components/Recall/RecallView.tsx +12 -9
  103. package/client/src/components/ResearchDialog.tsx +1 -1
  104. package/client/src/components/ReviewDialog.tsx +12 -5
  105. package/client/src/components/RightPanel/ActivityTab.tsx +32 -16
  106. package/client/src/components/RightPanel/CodebaseMemorySection.tsx +3 -1
  107. package/client/src/components/RightPanel/ConfigTab.tsx +129 -140
  108. package/client/src/components/RightPanel/GenesisTab.tsx +67 -24
  109. package/client/src/components/RightPanel/HandoffsTab.tsx +4 -0
  110. package/client/src/components/RightPanel/KnowledgeTab.tsx +1 -1
  111. package/client/src/components/RightPanel/LedgerTab.tsx +1 -1
  112. package/client/src/components/RightPanel/McpRegistrySection.tsx +7 -6
  113. package/client/src/components/RightPanel/MoveTargetModal.tsx +6 -3
  114. package/client/src/components/RightPanel/OutputsPanel.tsx +40 -17
  115. package/client/src/components/RightPanel/PlanTab.tsx +109 -111
  116. package/client/src/components/RightPanel/ReviewTab.tsx +7 -4
  117. package/client/src/components/RightPanel/UsageTab.tsx +18 -5
  118. package/client/src/components/RightPanel/format.ts +3 -1
  119. package/client/src/components/RightPanel/index.tsx +10 -2
  120. package/client/src/components/RightPanel/types.ts +4 -2
  121. package/client/src/components/RunAsPicker.tsx +5 -3
  122. package/client/src/components/RuntimeStateBanner.tsx +13 -3
  123. package/client/src/components/SavedClustersList.tsx +30 -3
  124. package/client/src/components/ServicesTab.tsx +17 -34
  125. package/client/src/components/SettingsPanel.tsx +101 -337
  126. package/client/src/components/ShortcutCheatSheet.tsx +6 -4
  127. package/client/src/components/SkillEditorDialog.tsx +2 -1
  128. package/client/src/components/SkillsSettings.tsx +307 -0
  129. package/client/src/components/SpawnDialog.tsx +3 -3
  130. package/client/src/components/SpawnSeedPill.tsx +5 -4
  131. package/client/src/components/StaleBuildBanner.tsx +3 -1
  132. package/client/src/components/StorageWarnings.tsx +3 -1
  133. package/client/src/components/SystemHeader.tsx +17 -10
  134. package/client/src/components/SystemModal.tsx +6 -5
  135. package/client/src/components/TabBar.tsx +20 -10
  136. package/client/src/components/TabContextMenu.tsx +36 -10
  137. package/client/src/components/TaskCard.tsx +16 -11
  138. package/client/src/components/TasksPanel.tsx +13 -11
  139. package/client/src/components/Terminal/XtermView.tsx +2 -0
  140. package/client/src/components/TerminalInput.tsx +248 -447
  141. package/client/src/components/TerminalSessions.tsx +1 -1
  142. package/client/src/components/TokenBadge.tsx +20 -17
  143. package/client/src/components/ToolCallPill.tsx +5 -3
  144. package/client/src/components/ToolboxMenu.tsx +5 -5
  145. package/client/src/components/TranscriptSendDialog.tsx +1 -1
  146. package/client/src/components/TurnTimer.tsx +21 -0
  147. package/client/src/components/UpdateAction.tsx +4 -1
  148. package/client/src/components/UsageBar.tsx +32 -126
  149. package/client/src/components/UserManual/index.tsx +6 -4
  150. package/client/src/components/VoiceMenu.tsx +5 -1
  151. package/client/src/components/VoiceSetupSettings.tsx +21 -11
  152. package/client/src/components/WorkerCard.tsx +7 -1
  153. package/client/src/components/WorkerDetailModal.tsx +7 -3
  154. package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +6 -6
  155. package/client/src/components/WorkflowCreator/ProjectPicker.tsx +13 -12
  156. package/client/src/components/WorkflowCreator/index.tsx +237 -78
  157. package/client/src/components/WorkflowCreator/types.ts +5 -3
  158. package/client/src/components/WorkflowStatusChip.tsx +93 -13
  159. package/client/src/components/WorkflowView.tsx +55 -24
  160. package/client/src/components/WorkspaceRename.tsx +11 -1
  161. package/client/src/components/activityTime.ts +4 -0
  162. package/client/src/components/compare/CompareDialog.tsx +6 -3
  163. package/client/src/components/compare/CompareOverlay.tsx +10 -3
  164. package/client/src/components/composer/submitComposer.ts +191 -0
  165. package/client/src/components/diff/ChangesPanel.tsx +4 -2
  166. package/client/src/components/diff/LiveChangesPanel.tsx +18 -2
  167. package/client/src/components/editor/CodeEditor.tsx +17 -2
  168. package/client/src/components/headerPopoverState.ts +15 -0
  169. package/client/src/components/help/DocViewer.tsx +6 -4
  170. package/client/src/components/help/HelpCard.tsx +3 -2
  171. package/client/src/components/help/HelpPopover.tsx +3 -1
  172. package/client/src/components/media/AudioEditor/AudioOpsPanel.tsx +16 -2
  173. package/client/src/components/media/DirectoryPicker.tsx +18 -11
  174. package/client/src/components/media/ImageEditor/ImageEditor.tsx +2 -2
  175. package/client/src/components/media/MediaModalHost.tsx +7 -15
  176. package/client/src/components/media/MediaStemsControls.tsx +16 -2
  177. package/client/src/components/media/VideoEditor/VideoOpsPanel.tsx +16 -2
  178. package/client/src/components/media/launchers.ts +4 -0
  179. package/client/src/components/plans/PlanChooser.tsx +135 -0
  180. package/client/src/components/plans/PlanRefsSection.tsx +47 -28
  181. package/client/src/components/plans/planBodySave.ts +17 -0
  182. package/client/src/components/plans/planRefs.ts +21 -11
  183. package/client/src/components/plans/startPlanGenesis.ts +37 -0
  184. package/client/src/components/primitives/Panel.tsx +1 -0
  185. package/client/src/components/providerPanelState.ts +17 -0
  186. package/client/src/components/settings/AppVersionSection.tsx +5 -5
  187. package/client/src/components/settings/AppWindowBrowserSection.tsx +88 -0
  188. package/client/src/components/settings/PreviewPortsSection.tsx +31 -0
  189. package/client/src/components/settings/SettingsLayout.tsx +1 -1
  190. package/client/src/components/settings/appWindowBrowserReport.ts +23 -0
  191. package/client/src/components/settings/navigation.ts +5 -1
  192. package/client/src/components/settings/settings.css +6 -0
  193. package/client/src/components/terminalInput/planDraft.ts +5 -5
  194. package/client/src/components/usageVisibility.ts +3 -2
  195. package/client/src/components/workSurface/WorkSurfaceControls.tsx +125 -10
  196. package/client/src/components/workSurface/workSurface.css +10 -2
  197. package/client/src/explorer/ArtifactsLens.tsx +53 -17
  198. package/client/src/explorer/ExplorerApp.tsx +8 -6
  199. package/client/src/explorer/PlansLens.tsx +80 -20
  200. package/client/src/explorer/RecentsLens.tsx +22 -61
  201. package/client/src/explorer/StorageLens.tsx +10 -4
  202. package/client/src/explorer/changedAttribution.ts +23 -0
  203. package/client/src/explorer/launch.ts +6 -3
  204. package/client/src/explorer/treeReveal.ts +21 -0
  205. package/client/src/explorer/types.ts +3 -3
  206. package/client/src/help/content/chat.tsx +17 -10
  207. package/client/src/help/content/cluster.tsx +135 -104
  208. package/client/src/help/content/composer.tsx +124 -43
  209. package/client/src/help/content/gitOps.tsx +19 -19
  210. package/client/src/help/content/github.tsx +9 -4
  211. package/client/src/help/content/header.tsx +70 -51
  212. package/client/src/help/content/media.tsx +20 -20
  213. package/client/src/help/content/misc.tsx +347 -163
  214. package/client/src/help/content/recall.tsx +12 -12
  215. package/client/src/help/content/rightPanel.tsx +199 -102
  216. package/client/src/help/content/settings.tsx +117 -44
  217. package/client/src/help/content/shared.tsx +1 -1
  218. package/client/src/help/content/tabbar.tsx +1 -1
  219. package/client/src/help/manualSections/actions.tsx +24 -17
  220. package/client/src/help/manualSections/chat.tsx +28 -5
  221. package/client/src/help/manualSections/clusters.tsx +193 -131
  222. package/client/src/help/manualSections/configuration.tsx +232 -48
  223. package/client/src/help/manualSections/deepseek.tsx +7 -5
  224. package/client/src/help/manualSections/gettingStarted.tsx +74 -12
  225. package/client/src/help/manualSections/maintenance.tsx +60 -13
  226. package/client/src/help/manualSections/media.tsx +14 -12
  227. package/client/src/help/manualSections/plans.tsx +108 -25
  228. package/client/src/help/manualSections/powerFeatures.tsx +145 -50
  229. package/client/src/help/manualSections/providers.tsx +237 -42
  230. package/client/src/help/manualSections/reference.tsx +19 -11
  231. package/client/src/help/manualSections/strata.tsx +6 -6
  232. package/client/src/help/manualSections/troubleshooting.tsx +14 -8
  233. package/client/src/help/manualSections/voice.tsx +12 -7
  234. package/client/src/help/manualSections/workflows.tsx +76 -19
  235. package/client/src/help/manualSections/workspace.tsx +173 -46
  236. package/client/src/help/shortcuts.ts +1 -0
  237. package/client/src/hooks/useWebSocket.ts +49 -25
  238. package/client/src/layout/SlideOut.tsx +77 -0
  239. package/client/src/layout/ToolbarOverflow.tsx +97 -0
  240. package/client/src/layout/keepInWindow.ts +216 -0
  241. package/client/src/layout/layoutRange.ts +129 -0
  242. package/client/src/main.tsx +2 -0
  243. package/client/src/phosphor-demo/Demo.tsx +5 -13
  244. package/client/src/phosphor-demo/demo.css +1 -1
  245. package/client/src/stores/appStore.ts +65 -14
  246. package/client/src/stores/appStore.types.ts +35 -16
  247. package/client/src/stores/docEditStore.ts +13 -21
  248. package/client/src/stores/draftStore.ts +28 -4
  249. package/client/src/stores/knowledgeDistillStore.ts +4 -2
  250. package/client/src/stores/mdTuneupStore.ts +10 -5
  251. package/client/src/stores/notificationChannelsStore.ts +21 -11
  252. package/client/src/stores/planGenesisStore.ts +67 -0
  253. package/client/src/stores/recallStore.ts +6 -0
  254. package/client/src/stores/terminalStore.ts +1 -1
  255. package/client/src/styles/global.css +72 -0
  256. package/client/src/styles/matrix.css +7 -0
  257. package/client/src/themes/apply.ts +3 -3
  258. package/client/src/themes/bootstrap.ts +3 -0
  259. package/client/src/utils/activeProject.ts +6 -0
  260. package/client/src/utils/activityPresentation.ts +51 -0
  261. package/client/src/utils/browserFamily.ts +22 -0
  262. package/client/src/utils/chatFileLinks.ts +3 -2
  263. package/client/src/utils/chatText.ts +14 -6
  264. package/client/src/utils/checkedJson.ts +11 -0
  265. package/client/src/utils/checkpointChanges.ts +18 -0
  266. package/client/src/utils/clusterCreation.ts +39 -0
  267. package/client/src/utils/clusterNudge.ts +31 -0
  268. package/client/src/utils/displayMessages.ts +45 -7
  269. package/client/src/utils/effortDefaults.ts +4 -3
  270. package/client/src/utils/format.ts +11 -4
  271. package/client/src/utils/gateArgs.ts +3 -2
  272. package/client/src/utils/handoffSeeds.ts +13 -0
  273. package/client/src/utils/historyEvents.ts +21 -12
  274. package/client/src/utils/homeModel.ts +19 -3
  275. package/client/src/utils/memberReviewScope.ts +6 -0
  276. package/client/src/utils/outputNavigation.ts +16 -0
  277. package/client/src/utils/outputStyleText.ts +8 -0
  278. package/client/src/utils/publicProject.ts +102 -28
  279. package/client/src/utils/queuedMessageEdit.ts +40 -0
  280. package/client/src/utils/requestGeneration.ts +8 -0
  281. package/client/src/utils/rewindSupport.ts +17 -0
  282. package/client/src/utils/settingsRequests.ts +36 -0
  283. package/client/src/utils/settingsResponse.ts +8 -0
  284. package/client/src/utils/wsSession.ts +12 -5
  285. package/client/src/vendor/odysseus-editor/editor/clipboard-and-drop.js +9 -9
  286. package/client/src/vendor/odysseus-editor/editor/keyboard-shortcuts.js +2 -2
  287. package/client/src/vendor/odysseus-editor/editor/state.js +8 -0
  288. package/client/src/vendor/odysseus-editor/editor.css +13 -5
  289. package/client/src/vendor/odysseus-editor/galleryEditor.d.ts +1 -1
  290. package/client/src/vendor/odysseus-editor/galleryEditor.js +16 -5
  291. package/client/src/voice/executor.ts +4 -3
  292. package/client/src/voice/panels.ts +14 -3
  293. package/client/src/voice/screen.ts +48 -6
  294. package/client/src/voice/setupAudio.ts +5 -3
  295. package/client/src/ws/handleServerMessage.ts +154 -36
  296. package/client/src/ws/operatorQuestions.ts +2 -2
  297. package/docs/ARCHITECTURE.md +95 -55
  298. package/docs/ARCHITECTURE_REVIEW.md +47 -0
  299. package/docs/BACKUP.md +5 -2
  300. package/docs/CHAT.md +48 -37
  301. package/docs/CHECKPOINTS.md +43 -16
  302. package/docs/CLIENT.md +218 -82
  303. package/docs/CODEX_GPT56_CLUSTER_INCOMPAT.md +1 -1
  304. package/docs/DEEPSEEK.md +6 -6
  305. package/docs/DIAGNOSTICS.md +12 -7
  306. package/docs/EXTENDING.md +52 -48
  307. package/docs/FEATURES.md +33 -20
  308. package/docs/GENESIS.md +42 -6
  309. package/docs/GETTING_STARTED.md +59 -25
  310. package/docs/GIT_WORKBENCH.md +15 -9
  311. package/docs/GLOSSARY.md +42 -40
  312. package/docs/GOTCHAS.md +70 -57
  313. package/docs/HTTP_API.md +145 -47
  314. package/docs/INDEX.md +3 -4
  315. package/docs/KNOWLEDGE.md +6 -4
  316. package/docs/LOCAL_SERVICES.md +6 -6
  317. package/docs/LSP.md +4 -3
  318. package/docs/MCP_REGISTRY.md +16 -12
  319. package/docs/MEDIA_STUDIO.md +23 -16
  320. package/docs/NOTIFICATIONS.md +50 -17
  321. package/docs/OPERATIONS.md +211 -120
  322. package/docs/OPERATOR_ACTIONS.md +43 -24
  323. package/docs/OUTPUTS.md +27 -10
  324. package/docs/PERSISTENCE.md +88 -34
  325. package/docs/PHOSPHOR_DEMO.md +4 -4
  326. package/docs/PLAN_OR_BOARD.md +9 -4
  327. package/docs/PREVIEW_VERIFY.md +10 -8
  328. package/docs/PRIMITIVES.md +90 -87
  329. package/docs/PROTOCOL.md +100 -29
  330. package/docs/PROTOCOL_CLUSTER.md +77 -14
  331. package/docs/PROTOCOL_PRIMITIVES.md +9 -9
  332. package/docs/PROVIDERS.md +471 -82
  333. package/docs/RECALL.md +17 -12
  334. package/docs/REMOTE_MANAGEMENT.md +69 -8
  335. package/docs/REPO_LAYOUT.md +1 -1
  336. package/docs/RESUME_INDEX.md +16 -17
  337. package/docs/SERVICE_MODE.md +45 -10
  338. package/docs/SETTINGS.md +58 -7
  339. package/docs/STORAGE_PLAN.md +54 -49
  340. package/docs/STRATA.md +4 -4
  341. package/docs/TASK_LEDGER.md +33 -12
  342. package/docs/TERMINAL.md +14 -12
  343. package/docs/THIRD_PARTY.md +1 -3
  344. package/docs/VOICE.md +15 -7
  345. package/native/darwin-arm64/manifest.json +1 -1
  346. package/native/win32-arm64/manifest.json +1 -1
  347. package/node_modules/@arco/shared/dist/clusterCoordination.js +15 -7
  348. package/node_modules/@arco/shared/dist/clusterRolePresets.js +8 -6
  349. package/node_modules/@arco/shared/dist/codexChat.d.ts +2 -0
  350. package/node_modules/@arco/shared/dist/codexChat.js +5 -0
  351. package/node_modules/@arco/shared/dist/folderName.d.ts +1 -0
  352. package/node_modules/@arco/shared/dist/folderName.js +18 -0
  353. package/node_modules/@arco/shared/dist/index.d.ts +6 -0
  354. package/node_modules/@arco/shared/dist/index.js +6 -0
  355. package/node_modules/@arco/shared/dist/localRuntimeStatus.d.ts +23 -0
  356. package/node_modules/@arco/shared/dist/localRuntimeStatus.js +47 -0
  357. package/node_modules/@arco/shared/dist/notificationTitle.d.ts +9 -0
  358. package/node_modules/@arco/shared/dist/notificationTitle.js +23 -0
  359. package/node_modules/@arco/shared/dist/outputStyle.d.ts +10 -0
  360. package/node_modules/@arco/shared/dist/outputStyle.js +28 -0
  361. package/node_modules/@arco/shared/dist/outputs.d.ts +1 -0
  362. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +2 -0
  363. package/node_modules/@arco/shared/dist/protocol/chat.d.ts +4 -0
  364. package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +24 -2
  365. package/node_modules/@arco/shared/dist/protocol/checkpoints.js +1 -0
  366. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +9 -14
  367. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +21 -4
  368. package/node_modules/@arco/shared/dist/protocol/clusters.js +3 -3
  369. package/node_modules/@arco/shared/dist/protocol/connections.d.ts +2 -0
  370. package/node_modules/@arco/shared/dist/protocol/diagnostics.js +1 -1
  371. package/node_modules/@arco/shared/dist/protocol/genesis.d.ts +9 -0
  372. package/node_modules/@arco/shared/dist/protocol/mcp.d.ts +1 -0
  373. package/node_modules/@arco/shared/dist/protocol/mcp.js +8 -5
  374. package/node_modules/@arco/shared/dist/protocol/mdTuneup.d.ts +2 -0
  375. package/node_modules/@arco/shared/dist/protocol/models.d.ts +3 -1
  376. package/node_modules/@arco/shared/dist/protocol/models.js +19 -8
  377. package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +2 -1
  378. package/node_modules/@arco/shared/dist/protocol/notifications.js +15 -3
  379. package/node_modules/@arco/shared/dist/protocol/plans.d.ts +2 -1
  380. package/node_modules/@arco/shared/dist/protocol/remoteManagement.d.ts +6 -0
  381. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +69 -10
  382. package/node_modules/@arco/shared/dist/protocol/settings.d.ts +16 -4
  383. package/node_modules/@arco/shared/dist/protocol/settings.js +17 -1
  384. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +1 -0
  385. package/node_modules/@arco/shared/dist/protocol/usage.d.ts +1 -0
  386. package/node_modules/@arco/shared/dist/protocol/workers.d.ts +1 -0
  387. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +73 -14
  388. package/node_modules/@arco/shared/dist/protocol/workflows.js +66 -0
  389. package/node_modules/@arco/shared/dist/publicGuardrails.d.ts +1 -1
  390. package/node_modules/@arco/shared/dist/publicGuardrails.js +1 -1
  391. package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +2 -0
  392. package/node_modules/@arco/shared/dist/runtimeVersions.js +13 -0
  393. package/node_modules/@arco/shared/dist/shellTool.d.ts +2 -0
  394. package/node_modules/@arco/shared/dist/shellTool.js +9 -0
  395. package/node_modules/@arco/shared/package.json +1 -1
  396. package/node_modules/xlsx/LICENSE +201 -0
  397. package/node_modules/xlsx/dist/cpexcel.js +1506 -0
  398. package/node_modules/xlsx/package.json +69 -0
  399. package/node_modules/xlsx/xlsx.js +28103 -0
  400. package/node_modules/xlsx/xlsx.mjs +28228 -0
  401. package/package.json +22 -3
  402. package/scripts/packaging/arco.mjs +3 -3
  403. package/scripts/packaging/browsers.mjs +366 -0
  404. package/scripts/packaging/launch.mjs +34 -20
  405. package/scripts/packaging/services.mjs +1 -1
  406. package/scripts/packaging/storage.mjs +39 -3
  407. package/server/dist/appBrowsers.d.ts +45 -0
  408. package/server/dist/appBrowsers.js +73 -0
  409. package/server/dist/architectureReview.d.ts +60 -0
  410. package/server/dist/architectureReview.js +347 -0
  411. package/server/dist/architectureSkill.d.ts +8 -0
  412. package/server/dist/architectureSkill.js +70 -0
  413. package/server/dist/arcoHome.d.ts +1 -0
  414. package/server/dist/arcoHome.js +43 -3
  415. package/server/dist/artifactCopy.d.ts +3 -0
  416. package/server/dist/artifactCopy.js +113 -36
  417. package/server/dist/atomicFile.d.ts +1 -1
  418. package/server/dist/atomicFile.js +6 -1
  419. package/server/dist/attention.d.ts +5 -1
  420. package/server/dist/attention.js +27 -16
  421. package/server/dist/auth.d.ts +1 -0
  422. package/server/dist/auth.js +19 -6
  423. package/server/dist/authLoginSession.d.ts +2 -0
  424. package/server/dist/authLoginSession.js +6 -1
  425. package/server/dist/boundedRead.d.ts +26 -0
  426. package/server/dist/boundedRead.js +246 -0
  427. package/server/dist/capabilities.d.ts +4 -1
  428. package/server/dist/capabilities.js +25 -8
  429. package/server/dist/catchUp.d.ts +7 -0
  430. package/server/dist/catchUp.js +20 -1
  431. package/server/dist/checkedFile.d.ts +5 -0
  432. package/server/dist/checkedFile.js +138 -0
  433. package/server/dist/claudeTransport.d.ts +7 -0
  434. package/server/dist/claudeTransport.js +14 -0
  435. package/server/dist/clusterAutoTurn.d.ts +7 -0
  436. package/server/dist/clusterAutoTurn.js +54 -7
  437. package/server/dist/clusterBusyReminder.d.ts +7 -0
  438. package/server/dist/clusterBusyReminder.js +45 -0
  439. package/server/dist/clusterDirector.js +6 -3
  440. package/server/dist/clusterIdleNudger.d.ts +6 -0
  441. package/server/dist/clusterIdleNudger.js +5 -0
  442. package/server/dist/clusterMailbox.d.ts +4 -2
  443. package/server/dist/clusterMailbox.js +104 -24
  444. package/server/dist/clusterPeerOps.js +9 -21
  445. package/server/dist/clusterPlanBridge.d.ts +6 -3
  446. package/server/dist/clusterPlanBridge.js +48 -45
  447. package/server/dist/clusterPresets.js +46 -32
  448. package/server/dist/clusterProgress.js +3 -0
  449. package/server/dist/clusterSnapshots.d.ts +1 -1
  450. package/server/dist/clusterSnapshots.js +17 -2
  451. package/server/dist/clusterStore.d.ts +3 -0
  452. package/server/dist/clusterStore.js +23 -13
  453. package/server/dist/clusterTurnTools.d.ts +4 -0
  454. package/server/dist/clusterTurnTools.js +9 -0
  455. package/server/dist/commandShell.d.ts +56 -0
  456. package/server/dist/commandShell.js +278 -0
  457. package/server/dist/compactionCounter.d.ts +6 -0
  458. package/server/dist/compactionCounter.js +73 -0
  459. package/server/dist/compactionReport.d.ts +8 -0
  460. package/server/dist/compactionReport.js +15 -0
  461. package/server/dist/contentSearch.js +16 -6
  462. package/server/dist/contextCalibrator.js +7 -2
  463. package/server/dist/contextEstimator.d.ts +4 -0
  464. package/server/dist/contextEstimator.js +76 -17
  465. package/server/dist/contextRefs.d.ts +1 -0
  466. package/server/dist/contextRefs.js +44 -9
  467. package/server/dist/conversationActivity.d.ts +3 -0
  468. package/server/dist/conversationActivity.js +27 -0
  469. package/server/dist/cursorUsage.js +15 -4
  470. package/server/dist/diagnostics/checks.js +4 -12
  471. package/server/dist/diagnostics/executableLookup.d.ts +2 -0
  472. package/server/dist/diagnostics/executableLookup.js +28 -0
  473. package/server/dist/diagnostics/modelHealth.js +3 -12
  474. package/server/dist/diagnostics/supportBundle.js +5 -13
  475. package/server/dist/eventLog.d.ts +19 -0
  476. package/server/dist/eventLog.js +299 -99
  477. package/server/dist/existingClusterMembers.d.ts +1 -0
  478. package/server/dist/existingClusterMembers.js +9 -0
  479. package/server/dist/explorerArtifacts.js +46 -12
  480. package/server/dist/explorerChanged.d.ts +7 -0
  481. package/server/dist/explorerChanged.js +116 -80
  482. package/server/dist/explorerDocs.d.ts +11 -0
  483. package/server/dist/explorerDocs.js +46 -48
  484. package/server/dist/explorerLaunch.d.ts +4 -0
  485. package/server/dist/explorerLaunch.js +9 -1
  486. package/server/dist/fileAccessPolicy.d.ts +21 -0
  487. package/server/dist/fileAccessPolicy.js +89 -1
  488. package/server/dist/fileContent/decodeSlots.d.ts +1 -0
  489. package/server/dist/fileContent/decodeSlots.js +50 -0
  490. package/server/dist/fileContent/detect.d.ts +2 -0
  491. package/server/dist/fileContent/detect.js +55 -0
  492. package/server/dist/fileContent/externalImage.d.ts +3 -0
  493. package/server/dist/fileContent/externalImage.js +68 -0
  494. package/server/dist/fileContent/icons.d.ts +4 -0
  495. package/server/dist/fileContent/icons.js +58 -0
  496. package/server/dist/fileContent/images.d.ts +15 -0
  497. package/server/dist/fileContent/images.js +182 -0
  498. package/server/dist/fileContent/legacyText.d.ts +3 -0
  499. package/server/dist/fileContent/legacyText.js +19 -0
  500. package/server/dist/fileContent/notebook.d.ts +2 -0
  501. package/server/dist/fileContent/notebook.js +54 -0
  502. package/server/dist/fileContent/office.d.ts +3 -0
  503. package/server/dist/fileContent/office.js +349 -0
  504. package/server/dist/fileContent/pdf.d.ts +2 -0
  505. package/server/dist/fileContent/pdf.js +76 -0
  506. package/server/dist/fileContent/pngRows.d.ts +4 -0
  507. package/server/dist/fileContent/pngRows.js +118 -0
  508. package/server/dist/fileContent/svg.d.ts +3 -0
  509. package/server/dist/fileContent/svg.js +60 -0
  510. package/server/dist/fileContent/types.d.ts +8 -0
  511. package/server/dist/fileContent/types.js +43 -0
  512. package/server/dist/fileContent/worker.d.ts +1 -0
  513. package/server/dist/fileContent/worker.js +68 -0
  514. package/server/dist/fileContent.d.ts +55 -0
  515. package/server/dist/fileContent.js +81 -0
  516. package/server/dist/fileContextReceipts.d.ts +12 -0
  517. package/server/dist/fileContextReceipts.js +53 -0
  518. package/server/dist/fileFetch.d.ts +17 -0
  519. package/server/dist/fileFetch.js +191 -0
  520. package/server/dist/fileVersion.d.ts +10 -0
  521. package/server/dist/fileVersion.js +43 -0
  522. package/server/dist/genesis/creative.js +28 -36
  523. package/server/dist/genesis/prompts.js +4 -0
  524. package/server/dist/genesis/savePlan.d.ts +5 -0
  525. package/server/dist/genesis/savePlan.js +49 -0
  526. package/server/dist/genesis/stages.js +4 -4
  527. package/server/dist/gitDiff.js +25 -5
  528. package/server/dist/gitSnapshots.d.ts +18 -0
  529. package/server/dist/gitSnapshots.js +280 -149
  530. package/server/dist/gitWorking.js +15 -13
  531. package/server/dist/github.js +5 -1
  532. package/server/dist/goalRun.d.ts +1 -1
  533. package/server/dist/goalRun.js +7 -5
  534. package/server/dist/handoffHistory.d.ts +26 -0
  535. package/server/dist/handoffHistory.js +80 -0
  536. package/server/dist/handoffHistoryProtocol.d.ts +59 -0
  537. package/server/dist/handoffHistoryProtocol.js +20 -0
  538. package/server/dist/handoffHistorySupport.d.ts +2 -0
  539. package/server/dist/handoffHistorySupport.js +11 -0
  540. package/server/dist/handoffHistoryTool.d.ts +29 -0
  541. package/server/dist/handoffHistoryTool.js +235 -0
  542. package/server/dist/handoffPrompts.js +6 -4
  543. package/server/dist/handoffReplay.d.ts +9 -0
  544. package/server/dist/handoffReplay.js +14 -0
  545. package/server/dist/handoffSeedCache.d.ts +3 -0
  546. package/server/dist/handoffSeedCache.js +26 -0
  547. package/server/dist/http/appBrowserRoutes.d.ts +3 -0
  548. package/server/dist/http/appBrowserRoutes.js +16 -0
  549. package/server/dist/http/architectureReviewRoutes.d.ts +3 -0
  550. package/server/dist/http/architectureReviewRoutes.js +117 -0
  551. package/server/dist/http/clusterRoutes.js +13 -1
  552. package/server/dist/http/clusterSnapshotRoutes.js +8 -3
  553. package/server/dist/http/connectionsRoutes.js +3 -1
  554. package/server/dist/http/diffRoutes.js +37 -3
  555. package/server/dist/http/explorerRoot.d.ts +3 -0
  556. package/server/dist/http/explorerRoot.js +22 -0
  557. package/server/dist/http/explorerRoutes.js +65 -12
  558. package/server/dist/http/fileRead.js +2 -3
  559. package/server/dist/http/fileWriteRoutes.js +4 -3
  560. package/server/dist/http/gitCompareRoutes.js +4 -6
  561. package/server/dist/http/gitDiffRoutes.js +3 -3
  562. package/server/dist/http/gitOpRoutes.js +3 -5
  563. package/server/dist/http/gitWorktreeRoutes.js +3 -3
  564. package/server/dist/http/handoffHistoryRoutes.d.ts +4 -0
  565. package/server/dist/http/handoffHistoryRoutes.js +59 -0
  566. package/server/dist/http/imageWriteRoutes.js +6 -2
  567. package/server/dist/http/knowledgeRoutes.js +2 -0
  568. package/server/dist/http/mediaOpsRoutes.js +2 -3
  569. package/server/dist/http/originGuard.d.ts +1 -1
  570. package/server/dist/http/originGuard.js +95 -12
  571. package/server/dist/http/outputRoutes.js +31 -6
  572. package/server/dist/http/projectBinding.d.ts +3 -0
  573. package/server/dist/http/projectBinding.js +133 -0
  574. package/server/dist/http/providerThrottleRoutes.d.ts +8 -0
  575. package/server/dist/http/providerThrottleRoutes.js +96 -0
  576. package/server/dist/http/publicProjectRoutes.js +50 -9
  577. package/server/dist/http/readConfinement.d.ts +2 -1
  578. package/server/dist/http/readConfinement.js +17 -15
  579. package/server/dist/http/router.js +224 -62
  580. package/server/dist/http/searchRoutes.js +4 -4
  581. package/server/dist/http/sessionTransport.d.ts +2 -0
  582. package/server/dist/http/sessionTransport.js +32 -0
  583. package/server/dist/http/skillManagementRoutes.d.ts +5 -0
  584. package/server/dist/http/skillManagementRoutes.js +166 -0
  585. package/server/dist/http/storageRoutes.js +20 -6
  586. package/server/dist/http/utilityAgentRoutes.js +27 -5
  587. package/server/dist/http/workflowDataRoutes.js +75 -14
  588. package/server/dist/http/writeConfinement.d.ts +5 -3
  589. package/server/dist/http/writeConfinement.js +37 -11
  590. package/server/dist/http/wsAuth.d.ts +3 -2
  591. package/server/dist/http/wsAuth.js +26 -8
  592. package/server/dist/imageTokens.d.ts +7 -0
  593. package/server/dist/imageTokens.js +85 -0
  594. package/server/dist/index.js +283 -178
  595. package/server/dist/inputDeliveryHistory.d.ts +21 -0
  596. package/server/dist/inputDeliveryHistory.js +146 -0
  597. package/server/dist/keepStore.d.ts +4 -0
  598. package/server/dist/keepStore.js +48 -0
  599. package/server/dist/knowledge/store.js +28 -20
  600. package/server/dist/legacyTarRestore.d.ts +1 -0
  601. package/server/dist/legacyTarRestore.js +240 -0
  602. package/server/dist/llamacppCatalog.d.ts +8 -1
  603. package/server/dist/llamacppCatalog.js +65 -13
  604. package/server/dist/localRuntimeStatus.d.ts +35 -0
  605. package/server/dist/localRuntimeStatus.js +136 -0
  606. package/server/dist/lsp/client.js +28 -9
  607. package/server/dist/lsp/servers.js +2 -2
  608. package/server/dist/managedPath.d.ts +2 -0
  609. package/server/dist/managedPath.js +47 -0
  610. package/server/dist/management/hubGuard.d.ts +23 -0
  611. package/server/dist/management/hubGuard.js +118 -0
  612. package/server/dist/management/hubLink.d.ts +4 -1
  613. package/server/dist/management/hubLink.js +8 -1
  614. package/server/dist/management/initHubLink.d.ts +12 -0
  615. package/server/dist/management/initHubLink.js +44 -22
  616. package/server/dist/manualCompactCapability.d.ts +2 -0
  617. package/server/dist/manualCompactCapability.js +7 -0
  618. package/server/dist/mcp/arcoMcpServer.js +4 -0
  619. package/server/dist/mcp/client.d.ts +4 -4
  620. package/server/dist/mcp/client.js +31 -10
  621. package/server/dist/mcp/clusterMcpLoopback.d.ts +4 -0
  622. package/server/dist/mcp/clusterMcpLoopback.js +21 -1
  623. package/server/dist/mcp/clusterMcpTools.js +25 -26
  624. package/server/dist/mcp/fileContent.d.ts +8 -0
  625. package/server/dist/mcp/fileContent.js +55 -0
  626. package/server/dist/mcp/fileMcpServer.d.ts +1 -0
  627. package/server/dist/mcp/fileMcpServer.js +13 -0
  628. package/server/dist/mcp/fileMcpTools.d.ts +2 -0
  629. package/server/dist/mcp/fileMcpTools.js +54 -0
  630. package/server/dist/mcp/handoffHistoryMcpTools.d.ts +3 -0
  631. package/server/dist/mcp/handoffHistoryMcpTools.js +27 -0
  632. package/server/dist/mcp/mcpConfigWriter.d.ts +5 -0
  633. package/server/dist/mcp/mcpConfigWriter.js +44 -12
  634. package/server/dist/mcp/planMcpTools.d.ts +6 -14
  635. package/server/dist/mcp/planMcpTools.js +6 -250
  636. package/server/dist/mcp/planReadMcpServer.d.ts +1 -0
  637. package/server/dist/mcp/planReadMcpServer.js +19 -0
  638. package/server/dist/mcp/registry.js +44 -38
  639. package/server/dist/mcp/registryWiring.js +4 -5
  640. package/server/dist/media/demucs.d.ts +5 -0
  641. package/server/dist/media/demucs.js +16 -4
  642. package/server/dist/media/ffmpeg.js +24 -16
  643. package/server/dist/media/scratch.js +24 -9
  644. package/server/dist/noticeSource.d.ts +2 -0
  645. package/server/dist/noticeSource.js +11 -0
  646. package/server/dist/notifications.d.ts +1 -0
  647. package/server/dist/notifications.js +7 -3
  648. package/server/dist/npmPlatformResolve.d.ts +9 -3
  649. package/server/dist/npmPlatformResolve.js +24 -5
  650. package/server/dist/ntfyTransport.d.ts +2 -1
  651. package/server/dist/ntfyTransport.js +15 -4
  652. package/server/dist/outputGrants.d.ts +9 -0
  653. package/server/dist/outputGrants.js +63 -0
  654. package/server/dist/outputs.js +78 -13
  655. package/server/dist/peerRecipientContext.js +22 -5
  656. package/server/dist/planStore.d.ts +11 -2
  657. package/server/dist/planStore.js +236 -64
  658. package/server/dist/planTools.d.ts +41 -0
  659. package/server/dist/planTools.js +259 -0
  660. package/server/dist/previewAutoDetect.js +31 -23
  661. package/server/dist/previewPortConfiguration.d.ts +2 -0
  662. package/server/dist/previewPortConfiguration.js +32 -0
  663. package/server/dist/previewPorts.d.ts +1 -0
  664. package/server/dist/previewPorts.js +3 -0
  665. package/server/dist/previewProxy.d.ts +30 -9
  666. package/server/dist/previewProxy.js +226 -183
  667. package/server/dist/primaryBackgroundTracker.d.ts +15 -2
  668. package/server/dist/primaryBackgroundTracker.js +172 -63
  669. package/server/dist/primitives/exportContext.d.ts +3 -0
  670. package/server/dist/primitives/exportContext.js +77 -15
  671. package/server/dist/primitives/localFileContext.d.ts +3 -0
  672. package/server/dist/primitives/localFileContext.js +38 -0
  673. package/server/dist/primitives/reviewContent.d.ts +2 -0
  674. package/server/dist/primitives/reviewContent.js +53 -6
  675. package/server/dist/primitives/runCompare.js +1 -1
  676. package/server/dist/primitives/runDocEdit.js +1 -1
  677. package/server/dist/primitives/runMdTuneup.d.ts +2 -1
  678. package/server/dist/primitives/runMdTuneup.js +20 -34
  679. package/server/dist/primitives/runResearch.js +1 -1
  680. package/server/dist/primitives/runReviewer.d.ts +2 -0
  681. package/server/dist/primitives/runReviewer.js +5 -2
  682. package/server/dist/primitives/seedWorker.d.ts +11 -2
  683. package/server/dist/primitives/seedWorker.js +26 -12
  684. package/server/dist/project/orchestrationProposals.d.ts +1 -0
  685. package/server/dist/project/orchestrationProposals.js +5 -1
  686. package/server/dist/project/taskLedger.d.ts +1 -0
  687. package/server/dist/project/taskLedger.js +17 -11
  688. package/server/dist/projectGlob.d.ts +1 -0
  689. package/server/dist/projectGlob.js +9 -0
  690. package/server/dist/projectIgnore.d.ts +1 -0
  691. package/server/dist/projectIgnore.js +24 -0
  692. package/server/dist/projectScan.d.ts +24 -0
  693. package/server/dist/projectScan.js +101 -0
  694. package/server/dist/projectStateIgnore.d.ts +13 -0
  695. package/server/dist/projectStateIgnore.js +36 -1
  696. package/server/dist/projects.d.ts +11 -3
  697. package/server/dist/projects.js +141 -40
  698. package/server/dist/prompts.js +7 -8
  699. package/server/dist/proportionateTestingSkill.d.ts +7 -0
  700. package/server/dist/proportionateTestingSkill.js +32 -0
  701. package/server/dist/providers/attachmentLabels.d.ts +4 -0
  702. package/server/dist/providers/attachmentLabels.js +9 -0
  703. package/server/dist/providers/attachments.d.ts +1 -3
  704. package/server/dist/providers/attachments.js +58 -173
  705. package/server/dist/providers/claude-native/apiEndpoint.d.ts +2 -0
  706. package/server/dist/providers/claude-native/apiEndpoint.js +8 -0
  707. package/server/dist/providers/claude-native/appendOnlyPrefix.js +21 -1
  708. package/server/dist/providers/claude-native/catalog.js +17 -15
  709. package/server/dist/providers/claude-native/contentBlocks.d.ts +22 -2
  710. package/server/dist/providers/claude-native/contentBlocks.js +31 -8
  711. package/server/dist/providers/claude-native/contextBudget.d.ts +0 -4
  712. package/server/dist/providers/claude-native/contextBudget.js +0 -2
  713. package/server/dist/providers/claude-native/editApply.js +6 -1
  714. package/server/dist/providers/claude-native/fileContent.d.ts +15 -0
  715. package/server/dist/providers/claude-native/fileContent.js +120 -0
  716. package/server/dist/providers/claude-native/filterConfigs/bash-cargo-test.js +2 -0
  717. package/server/dist/providers/claude-native/filterConfigs/bash-jest-vitest.js +2 -0
  718. package/server/dist/providers/claude-native/filterConfigs/bash-pytest.js +2 -0
  719. package/server/dist/providers/claude-native/filterConfigs/index.js +2 -1
  720. package/server/dist/providers/claude-native/foldDigest.js +10 -2
  721. package/server/dist/providers/claude-native/gateReview.d.ts +1 -1
  722. package/server/dist/providers/claude-native/gateReview.js +0 -0
  723. package/server/dist/providers/claude-native/hookIf.d.ts +28 -0
  724. package/server/dist/providers/claude-native/hookIf.js +590 -0
  725. package/server/dist/providers/claude-native/hooks.d.ts +77 -7
  726. package/server/dist/providers/claude-native/hooks.js +344 -52
  727. package/server/dist/providers/claude-native/imageRead.d.ts +15 -0
  728. package/server/dist/providers/claude-native/imageRead.js +108 -0
  729. package/server/dist/providers/claude-native/index.d.ts +4 -1
  730. package/server/dist/providers/claude-native/index.js +32 -2
  731. package/server/dist/providers/claude-native/mediaLimits.d.ts +6 -0
  732. package/server/dist/providers/claude-native/mediaLimits.js +15 -0
  733. package/server/dist/providers/claude-native/mediaRetention.d.ts +11 -0
  734. package/server/dist/providers/claude-native/mediaRetention.js +66 -0
  735. package/server/dist/providers/claude-native/mediaRetirementNotice.d.ts +1 -0
  736. package/server/dist/providers/claude-native/mediaRetirementNotice.js +12 -0
  737. package/server/dist/providers/claude-native/modelParams.d.ts +6 -0
  738. package/server/dist/providers/claude-native/modelParams.js +21 -3
  739. package/server/dist/providers/claude-native/oauth.js +9 -8
  740. package/server/dist/providers/claude-native/outputAccumulator.d.ts +2 -0
  741. package/server/dist/providers/claude-native/outputAccumulator.js +29 -18
  742. package/server/dist/providers/claude-native/peerTools.js +3 -158
  743. package/server/dist/providers/claude-native/pretoolGuards.js +92 -9
  744. package/server/dist/providers/claude-native/registryTools.js +4 -2
  745. package/server/dist/providers/claude-native/resumeSummary.d.ts +23 -2
  746. package/server/dist/providers/claude-native/resumeSummary.js +135 -28
  747. package/server/dist/providers/claude-native/sandboxExecutor.js +26 -19
  748. package/server/dist/providers/claude-native/taskAdmission.d.ts +21 -0
  749. package/server/dist/providers/claude-native/taskAdmission.js +75 -0
  750. package/server/dist/providers/claude-native/toolChecks.d.ts +38 -0
  751. package/server/dist/providers/claude-native/toolChecks.js +96 -0
  752. package/server/dist/providers/claude-native/toolPosture.js +5 -3
  753. package/server/dist/providers/claude-native/toolResultEviction.d.ts +4 -3
  754. package/server/dist/providers/claude-native/toolResultEviction.js +18 -29
  755. package/server/dist/providers/claude-native/tools.d.ts +17 -4
  756. package/server/dist/providers/claude-native/tools.js +248 -135
  757. package/server/dist/providers/claude-native/usageContext.d.ts +30 -0
  758. package/server/dist/providers/claude-native/usageContext.js +70 -0
  759. package/server/dist/providers/claude-native/wireFingerprint.d.ts +2 -2
  760. package/server/dist/providers/claude-native/wireFingerprint.js +2 -2
  761. package/server/dist/providers/claude-native/worker.d.ts +63 -1
  762. package/server/dist/providers/claude-native/worker.js +1103 -324
  763. package/server/dist/providers/claude-native/workerHelpers.d.ts +13 -0
  764. package/server/dist/providers/claude-native/workerHelpers.js +117 -6
  765. package/server/dist/providers/claude-native/workspaceFacts.js +2 -2
  766. package/server/dist/providers/claude.d.ts +1 -0
  767. package/server/dist/providers/claude.js +69 -85
  768. package/server/dist/providers/clusterTaskToolDefinitions.d.ts +11 -0
  769. package/server/dist/providers/clusterTaskToolDefinitions.js +161 -0
  770. package/server/dist/providers/codex-appserver/catalog.js +26 -20
  771. package/server/dist/providers/codex-appserver/index.js +10 -3
  772. package/server/dist/providers/codex-appserver/jsonRpc.d.ts +2 -1
  773. package/server/dist/providers/codex-appserver/jsonRpc.js +11 -3
  774. package/server/dist/providers/codex-appserver/worker.d.ts +5 -0
  775. package/server/dist/providers/codex-appserver/worker.js +119 -81
  776. package/server/dist/providers/codex.js +55 -58
  777. package/server/dist/providers/codexChatBoundary.d.ts +11 -0
  778. package/server/dist/providers/codexChatBoundary.js +60 -0
  779. package/server/dist/providers/codexCodeMode.js +2 -2
  780. package/server/dist/providers/codexContextWindow.js +2 -2
  781. package/server/dist/providers/codexHome.d.ts +1 -0
  782. package/server/dist/providers/codexHome.js +6 -0
  783. package/server/dist/providers/codexImageTool.d.ts +6 -0
  784. package/server/dist/providers/codexImageTool.js +21 -0
  785. package/server/dist/providers/codexVersion.d.ts +1 -0
  786. package/server/dist/providers/codexVersion.js +14 -0
  787. package/server/dist/providers/codexWebSearch.d.ts +2 -0
  788. package/server/dist/providers/codexWebSearch.js +4 -0
  789. package/server/dist/providers/cursor/acpJsonRpc.d.ts +1 -0
  790. package/server/dist/providers/cursor/acpJsonRpc.js +3 -1
  791. package/server/dist/providers/cursor/authState.d.ts +10 -0
  792. package/server/dist/providers/cursor/authState.js +78 -0
  793. package/server/dist/providers/cursor/catalog.js +22 -14
  794. package/server/dist/providers/cursor/chatSandbox.d.ts +11 -0
  795. package/server/dist/providers/cursor/chatSandbox.js +81 -0
  796. package/server/dist/providers/cursor/filePlugin.d.ts +4 -0
  797. package/server/dist/providers/cursor/filePlugin.js +31 -0
  798. package/server/dist/providers/cursor/index.d.ts +1 -0
  799. package/server/dist/providers/cursor/index.js +30 -4
  800. package/server/dist/providers/cursor/modelMap.d.ts +35 -0
  801. package/server/dist/providers/cursor/modelMap.js +180 -0
  802. package/server/dist/providers/cursor/print.js +95 -30
  803. package/server/dist/providers/cursor/worker.d.ts +4 -1
  804. package/server/dist/providers/cursor/worker.js +169 -89
  805. package/server/dist/providers/errorClassifier.js +6 -2
  806. package/server/dist/providers/handoffHistoryBinding.d.ts +11 -0
  807. package/server/dist/providers/handoffHistoryBinding.js +43 -0
  808. package/server/dist/providers/index.d.ts +1 -1
  809. package/server/dist/providers/index.js +10 -5
  810. package/server/dist/providers/llamacpp.d.ts +1 -0
  811. package/server/dist/providers/llamacpp.js +102 -192
  812. package/server/dist/providers/llamacppManager.d.ts +5 -0
  813. package/server/dist/providers/llamacppManager.js +68 -32
  814. package/server/dist/providers/llamacppVersion.d.ts +1 -0
  815. package/server/dist/providers/llamacppVersion.js +5 -0
  816. package/server/dist/providers/lmstudio.d.ts +3 -3
  817. package/server/dist/providers/lmstudio.js +133 -207
  818. package/server/dist/providers/localFileMedia.d.ts +25 -0
  819. package/server/dist/providers/localFileMedia.js +302 -0
  820. package/server/dist/providers/localMcp.d.ts +17 -0
  821. package/server/dist/providers/localMcp.js +85 -0
  822. package/server/dist/providers/localShellLifecycle.d.ts +7 -0
  823. package/server/dist/providers/localShellLifecycle.js +33 -0
  824. package/server/dist/providers/localToolDispatch.d.ts +28 -0
  825. package/server/dist/providers/localToolDispatch.js +90 -0
  826. package/server/dist/providers/ollama.d.ts +2 -1
  827. package/server/dist/providers/ollama.js +180 -181
  828. package/server/dist/providers/ollamaDurableCompaction.js +5 -4
  829. package/server/dist/providers/ollamaExecutionHistory.d.ts +1 -1
  830. package/server/dist/providers/ollamaExecutionHistory.js +55 -14
  831. package/server/dist/providers/ollamaFencedTools.js +10 -11
  832. package/server/dist/providers/ollamaResilience.js +9 -13
  833. package/server/dist/providers/ollamaTokens.js +3 -4
  834. package/server/dist/providers/ollamaToolSubset.d.ts +2 -0
  835. package/server/dist/providers/ollamaToolSubset.js +11 -40
  836. package/server/dist/providers/ollamaTools.d.ts +13 -0
  837. package/server/dist/providers/ollamaTools.js +225 -219
  838. package/server/dist/providers/outputStyle.d.ts +2 -1
  839. package/server/dist/providers/outputStyle.js +70 -76
  840. package/server/dist/providers/providerFileContent.d.ts +40 -0
  841. package/server/dist/providers/providerFileContent.js +151 -0
  842. package/server/dist/providers/renderedTranscript.d.ts +1 -0
  843. package/server/dist/providers/renderedTranscript.js +3 -0
  844. package/server/dist/providers/requestDeadline.d.ts +1 -0
  845. package/server/dist/providers/requestDeadline.js +26 -0
  846. package/server/dist/providers/sessionScope.d.ts +2 -0
  847. package/server/dist/providers/sessionScope.js +8 -0
  848. package/server/dist/providers/types.d.ts +1 -0
  849. package/server/dist/publicProject.d.ts +10 -2
  850. package/server/dist/publicProject.js +59 -13
  851. package/server/dist/publicProjectChoice.d.ts +4 -0
  852. package/server/dist/publicProjectChoice.js +46 -0
  853. package/server/dist/quota.d.ts +10 -7
  854. package/server/dist/quota.js +49 -19
  855. package/server/dist/recall/search.js +9 -32
  856. package/server/dist/recall/transcriptSearch.d.ts +4 -0
  857. package/server/dist/recall/transcriptSearch.js +29 -0
  858. package/server/dist/recentFilesLedger.js +9 -7
  859. package/server/dist/recentProjectActivity.d.ts +11 -0
  860. package/server/dist/recentProjectActivity.js +69 -0
  861. package/server/dist/scanDeadline.d.ts +4 -0
  862. package/server/dist/scanDeadline.js +48 -0
  863. package/server/dist/searchText.d.ts +1 -0
  864. package/server/dist/searchText.js +22 -0
  865. package/server/dist/server/broadcast.d.ts +2 -2
  866. package/server/dist/server/broadcast.js +130 -58
  867. package/server/dist/sessionJsonl.js +45 -19
  868. package/server/dist/settings.d.ts +6 -1
  869. package/server/dist/settings.js +183 -56
  870. package/server/dist/skillManagement.d.ts +125 -0
  871. package/server/dist/skillManagement.js +709 -0
  872. package/server/dist/skillMutation.d.ts +1 -0
  873. package/server/dist/skillMutation.js +6 -0
  874. package/server/dist/skills.d.ts +75 -1
  875. package/server/dist/skills.js +254 -75
  876. package/server/dist/smartPickup.d.ts +1 -0
  877. package/server/dist/smartPickup.js +2 -1
  878. package/server/dist/smartPickupAdapters.d.ts +1 -0
  879. package/server/dist/smartPickupAdapters.js +31 -8
  880. package/server/dist/storageActions.d.ts +2 -2
  881. package/server/dist/storageArchive.js +55 -24
  882. package/server/dist/storageRoot.d.ts +5 -0
  883. package/server/dist/storageRoot.js +38 -0
  884. package/server/dist/storageTurnWatch.d.ts +6 -0
  885. package/server/dist/storageTurnWatch.js +36 -0
  886. package/server/dist/taskDispatcher.js +69 -41
  887. package/server/dist/templates/store.js +75 -59
  888. package/server/dist/terminal/ptyManager.d.ts +3 -1
  889. package/server/dist/terminal/ptyManager.js +44 -37
  890. package/server/dist/terminal/ptyPidRegistry.d.ts +4 -2
  891. package/server/dist/terminal/ptyPidRegistry.js +9 -63
  892. package/server/dist/thirdPartySkills.d.ts +4 -0
  893. package/server/dist/thirdPartySkills.js +80 -0
  894. package/server/dist/toolPath.d.ts +1 -0
  895. package/server/dist/toolPath.js +38 -0
  896. package/server/dist/toolboxWorkflow.js +2 -1
  897. package/server/dist/uploadImages.d.ts +6 -0
  898. package/server/dist/uploadImages.js +155 -0
  899. package/server/dist/voice/computerContext.js +2 -0
  900. package/server/dist/voice/conditionSchema.d.ts +1 -0
  901. package/server/dist/voice/conditionSchema.js +3 -1
  902. package/server/dist/voice/conditions.js +1 -1
  903. package/server/dist/workers/StreamParser.d.ts +3 -0
  904. package/server/dist/workers/StreamParser.js +45 -11
  905. package/server/dist/workers/WorkerManager.d.ts +9 -2
  906. package/server/dist/workers/WorkerManager.js +18 -18
  907. package/server/dist/workers/durablePidRegistry.d.ts +53 -0
  908. package/server/dist/workers/durablePidRegistry.js +289 -0
  909. package/server/dist/workers/limits.js +1 -1
  910. package/server/dist/workers/pidRegistry.d.ts +6 -9
  911. package/server/dist/workers/pidRegistry.js +13 -101
  912. package/server/dist/workers/processActivity.d.ts +6 -0
  913. package/server/dist/workers/processActivity.js +13 -0
  914. package/server/dist/workers/processKill.d.ts +30 -0
  915. package/server/dist/workers/processKill.js +174 -0
  916. package/server/dist/workers/processStartTime.d.ts +21 -5
  917. package/server/dist/workers/processStartTime.js +127 -50
  918. package/server/dist/workflowMeta.d.ts +15 -12
  919. package/server/dist/workflowMeta.js +42 -10
  920. package/server/dist/workflowStore.d.ts +1 -0
  921. package/server/dist/workflowStore.js +194 -23
  922. package/server/dist/workflows/modelTitles.js +4 -3
  923. package/server/dist/workflows/sessionIndex.d.ts +2 -0
  924. package/server/dist/workflows/sessionIndex.js +24 -2
  925. package/server/dist/workflows/types.d.ts +15 -5
  926. package/server/dist/workspace.d.ts +1 -0
  927. package/server/dist/workspace.js +5 -0
  928. package/server/dist/ws/afterTurn.d.ts +9 -0
  929. package/server/dist/ws/afterTurn.js +25 -0
  930. package/server/dist/ws/clusterHandlers.d.ts +7 -2
  931. package/server/dist/ws/clusterHandlers.js +361 -407
  932. package/server/dist/ws/clusterMembers.d.ts +42 -0
  933. package/server/dist/ws/clusterMembers.js +165 -0
  934. package/server/dist/ws/compactHandlers.js +38 -28
  935. package/server/dist/ws/gateHandlers.js +2 -1
  936. package/server/dist/ws/genesisHandlers.js +171 -116
  937. package/server/dist/ws/handoffHandlers.d.ts +3 -1
  938. package/server/dist/ws/handoffHandlers.js +367 -196
  939. package/server/dist/ws/previewCaptureHandlers.js +1 -4
  940. package/server/dist/ws/taskLedgerHandlers.d.ts +6 -1
  941. package/server/dist/ws/taskLedgerHandlers.js +28 -12
  942. package/server/dist/ws/taskLifecycle.d.ts +15 -0
  943. package/server/dist/ws/taskLifecycle.js +39 -0
  944. package/server/dist/ws/turnEngine.d.ts +27 -8
  945. package/server/dist/ws/turnEngine.js +1790 -1637
  946. package/server/dist/ws/turnPrompt.d.ts +17 -0
  947. package/server/dist/ws/turnPrompt.js +47 -0
  948. package/server/dist/ws/turnSettings.d.ts +41 -0
  949. package/server/dist/ws/turnSettings.js +61 -0
  950. package/server/dist/ws/updatePrimaryConfig.js +63 -40
  951. package/server/dist/ws/workflowHandlers.d.ts +2 -1
  952. package/server/dist/ws/workflowHandlers.js +220 -180
  953. package/server/package.json +1 -1
  954. package/server/src/appBrowsers.ts +95 -0
  955. package/server/src/architectureReview.ts +327 -0
  956. package/server/src/architectureSkill.ts +71 -0
  957. package/server/src/arcoHome.ts +42 -3
  958. package/server/src/artifactCopy.ts +90 -24
  959. package/server/src/atomicFile.ts +6 -1
  960. package/server/src/attention.ts +24 -17
  961. package/server/src/auth.ts +20 -6
  962. package/server/src/authLoginSession.ts +7 -2
  963. package/server/src/boundedRead.ts +172 -0
  964. package/server/src/capabilities.ts +26 -9
  965. package/server/src/catchUp.ts +19 -2
  966. package/server/src/checkedFile.ts +90 -0
  967. package/server/src/claudeTransport.ts +14 -0
  968. package/server/src/clusterAutoTurn.ts +55 -7
  969. package/server/src/clusterBusyReminder.ts +45 -0
  970. package/server/src/clusterDirector.ts +6 -3
  971. package/server/src/clusterIdleNudger.ts +6 -0
  972. package/server/src/clusterMailbox.ts +96 -26
  973. package/server/src/clusterPeerOps.ts +6 -19
  974. package/server/src/clusterPlanBridge.ts +37 -45
  975. package/server/src/clusterPresets.ts +44 -31
  976. package/server/src/clusterProgress.ts +3 -0
  977. package/server/src/clusterSnapshots.ts +16 -2
  978. package/server/src/clusterStore.ts +25 -14
  979. package/server/src/clusterTurnTools.ts +11 -0
  980. package/server/src/commandShell.ts +287 -0
  981. package/server/src/compactionCounter.ts +69 -0
  982. package/server/src/compactionReport.ts +20 -0
  983. package/server/src/contentSearch.ts +8 -3
  984. package/server/src/contextCalibrator.ts +6 -1
  985. package/server/src/contextEstimator.ts +71 -16
  986. package/server/src/contextRefs.ts +41 -11
  987. package/server/src/conversationActivity.ts +26 -0
  988. package/server/src/cursorUsage.ts +13 -3
  989. package/server/src/diagnostics/checks.ts +4 -11
  990. package/server/src/diagnostics/executableLookup.ts +20 -0
  991. package/server/src/diagnostics/modelHealth.ts +3 -11
  992. package/server/src/diagnostics/supportBundle.ts +5 -13
  993. package/server/src/eventLog.ts +228 -81
  994. package/server/src/existingClusterMembers.ts +9 -0
  995. package/server/src/explorerArtifacts.ts +27 -10
  996. package/server/src/explorerChanged.ts +99 -67
  997. package/server/src/explorerDocs.ts +37 -31
  998. package/server/src/explorerLaunch.ts +10 -2
  999. package/server/src/fileAccessPolicy.ts +82 -1
  1000. package/server/src/fileContent/decodeSlots.ts +31 -0
  1001. package/server/src/fileContent/detect.ts +28 -0
  1002. package/server/src/fileContent/externalImage.ts +49 -0
  1003. package/server/src/fileContent/icons.ts +37 -0
  1004. package/server/src/fileContent/images.ts +140 -0
  1005. package/server/src/fileContent/legacyText.ts +16 -0
  1006. package/server/src/fileContent/notebook.ts +37 -0
  1007. package/server/src/fileContent/office.ts +234 -0
  1008. package/server/src/fileContent/pdf.ts +59 -0
  1009. package/server/src/fileContent/pngRows.ts +54 -0
  1010. package/server/src/fileContent/svg.ts +42 -0
  1011. package/server/src/fileContent/types.ts +39 -0
  1012. package/server/src/fileContent/worker.ts +43 -0
  1013. package/server/src/fileContent.ts +108 -0
  1014. package/server/src/fileContextReceipts.ts +44 -0
  1015. package/server/src/fileFetch.ts +167 -0
  1016. package/server/src/fileVersion.ts +36 -0
  1017. package/server/src/genesis/creative.ts +27 -33
  1018. package/server/src/genesis/prompts.ts +3 -0
  1019. package/server/src/genesis/savePlan.ts +45 -0
  1020. package/server/src/genesis/stages.ts +4 -4
  1021. package/server/src/gitDiff.ts +20 -5
  1022. package/server/src/gitSnapshots.ts +288 -191
  1023. package/server/src/gitWorking.ts +11 -11
  1024. package/server/src/github.ts +3 -1
  1025. package/server/src/goalRun.ts +7 -4
  1026. package/server/src/handoffHistory.ts +89 -0
  1027. package/server/src/handoffHistoryProtocol.ts +20 -0
  1028. package/server/src/handoffHistorySupport.ts +10 -0
  1029. package/server/src/handoffHistoryTool.ts +192 -0
  1030. package/server/src/handoffPrompts.ts +6 -4
  1031. package/server/src/handoffReplay.ts +20 -0
  1032. package/server/src/handoffSeedCache.ts +22 -0
  1033. package/server/src/http/appBrowserRoutes.ts +17 -0
  1034. package/server/src/http/architectureReviewRoutes.ts +86 -0
  1035. package/server/src/http/clusterRoutes.ts +13 -1
  1036. package/server/src/http/clusterSnapshotRoutes.ts +8 -3
  1037. package/server/src/http/connectionsRoutes.ts +5 -1
  1038. package/server/src/http/diffRoutes.ts +36 -3
  1039. package/server/src/http/explorerRoot.ts +20 -0
  1040. package/server/src/http/explorerRoutes.ts +59 -12
  1041. package/server/src/http/fileRead.ts +2 -1
  1042. package/server/src/http/fileWriteRoutes.ts +3 -2
  1043. package/server/src/http/gitCompareRoutes.ts +4 -5
  1044. package/server/src/http/gitDiffRoutes.ts +3 -2
  1045. package/server/src/http/gitOpRoutes.ts +3 -4
  1046. package/server/src/http/gitWorktreeRoutes.ts +3 -2
  1047. package/server/src/http/handoffHistoryRoutes.ts +42 -0
  1048. package/server/src/http/imageWriteRoutes.ts +5 -1
  1049. package/server/src/http/knowledgeRoutes.ts +2 -0
  1050. package/server/src/http/mediaOpsRoutes.ts +2 -1
  1051. package/server/src/http/originGuard.ts +71 -14
  1052. package/server/src/http/outputRoutes.ts +26 -5
  1053. package/server/src/http/projectBinding.ts +108 -0
  1054. package/server/src/http/providerThrottleRoutes.ts +76 -0
  1055. package/server/src/http/publicProjectRoutes.ts +40 -8
  1056. package/server/src/http/readConfinement.ts +16 -9
  1057. package/server/src/http/router.ts +173 -60
  1058. package/server/src/http/searchRoutes.ts +4 -4
  1059. package/server/src/http/sessionTransport.ts +27 -0
  1060. package/server/src/http/skillManagementRoutes.ts +120 -0
  1061. package/server/src/http/storageRoutes.ts +19 -6
  1062. package/server/src/http/utilityAgentRoutes.ts +19 -5
  1063. package/server/src/http/workflowDataRoutes.ts +68 -16
  1064. package/server/src/http/writeConfinement.ts +31 -12
  1065. package/server/src/http/wsAuth.ts +27 -9
  1066. package/server/src/imageTokens.ts +60 -0
  1067. package/server/src/index.ts +265 -178
  1068. package/server/src/inputDeliveryHistory.ts +122 -0
  1069. package/server/src/keepStore.ts +37 -0
  1070. package/server/src/knowledge/store.ts +27 -19
  1071. package/server/src/legacyTarRestore.ts +177 -0
  1072. package/server/src/llamacppCatalog.ts +47 -12
  1073. package/server/src/localRuntimeStatus.ts +121 -0
  1074. package/server/src/lsp/client.ts +19 -11
  1075. package/server/src/lsp/servers.ts +2 -2
  1076. package/server/src/managedPath.ts +38 -0
  1077. package/server/src/management/hubGuard.ts +135 -0
  1078. package/server/src/management/hubLink.ts +8 -2
  1079. package/server/src/management/initHubLink.ts +45 -37
  1080. package/server/src/manualCompactCapability.ts +8 -0
  1081. package/server/src/mcp/arcoMcpServer.ts +4 -0
  1082. package/server/src/mcp/client.ts +28 -11
  1083. package/server/src/mcp/clusterMcpLoopback.ts +27 -1
  1084. package/server/src/mcp/clusterMcpTools.ts +24 -25
  1085. package/server/src/mcp/fileContent.ts +34 -0
  1086. package/server/src/mcp/fileMcpServer.ts +12 -0
  1087. package/server/src/mcp/fileMcpTools.ts +51 -0
  1088. package/server/src/mcp/handoffHistoryMcpTools.ts +21 -0
  1089. package/server/src/mcp/mcpConfigWriter.ts +43 -12
  1090. package/server/src/mcp/planMcpTools.ts +9 -285
  1091. package/server/src/mcp/planReadMcpServer.ts +19 -0
  1092. package/server/src/mcp/registry.ts +41 -35
  1093. package/server/src/mcp/registryWiring.ts +4 -5
  1094. package/server/src/media/demucs.ts +11 -4
  1095. package/server/src/media/ffmpeg.ts +21 -16
  1096. package/server/src/media/scratch.ts +17 -10
  1097. package/server/src/noticeSource.ts +11 -0
  1098. package/server/src/notifications.ts +8 -4
  1099. package/server/src/npmPlatformResolve.ts +25 -8
  1100. package/server/src/ntfyTransport.ts +12 -4
  1101. package/server/src/outputGrants.ts +53 -0
  1102. package/server/src/outputs.ts +54 -11
  1103. package/server/src/peerRecipientContext.ts +16 -5
  1104. package/server/src/planStore.ts +201 -55
  1105. package/server/src/planTools.ts +303 -0
  1106. package/server/src/previewAutoDetect.ts +26 -19
  1107. package/server/src/previewPortConfiguration.ts +28 -0
  1108. package/server/src/previewPorts.ts +2 -0
  1109. package/server/src/previewProxy.ts +156 -189
  1110. package/server/src/primaryBackgroundTracker.ts +151 -61
  1111. package/server/src/primitives/exportContext.ts +67 -16
  1112. package/server/src/primitives/localFileContext.ts +31 -0
  1113. package/server/src/primitives/reviewContent.ts +42 -7
  1114. package/server/src/primitives/runCompare.ts +1 -1
  1115. package/server/src/primitives/runDocEdit.ts +1 -1
  1116. package/server/src/primitives/runMdTuneup.ts +17 -27
  1117. package/server/src/primitives/runResearch.ts +1 -1
  1118. package/server/src/primitives/runReviewer.ts +6 -2
  1119. package/server/src/primitives/seedWorker.ts +36 -17
  1120. package/server/src/project/orchestrationProposals.ts +6 -1
  1121. package/server/src/project/taskLedger.ts +17 -11
  1122. package/server/src/projectGlob.ts +9 -0
  1123. package/server/src/projectIgnore.ts +19 -0
  1124. package/server/src/projectScan.ts +76 -0
  1125. package/server/src/projectStateIgnore.ts +40 -1
  1126. package/server/src/projects.ts +114 -36
  1127. package/server/src/prompts.ts +5 -8
  1128. package/server/src/proportionateTestingSkill.ts +31 -0
  1129. package/server/src/providers/attachmentLabels.ts +8 -0
  1130. package/server/src/providers/attachments.ts +52 -174
  1131. package/server/src/providers/claude-native/apiEndpoint.ts +9 -0
  1132. package/server/src/providers/claude-native/appendOnlyPrefix.ts +17 -1
  1133. package/server/src/providers/claude-native/catalog.ts +16 -14
  1134. package/server/src/providers/claude-native/contentBlocks.ts +39 -8
  1135. package/server/src/providers/claude-native/contextBudget.ts +0 -6
  1136. package/server/src/providers/claude-native/editApply.ts +6 -1
  1137. package/server/src/providers/claude-native/fileContent.ts +98 -0
  1138. package/server/src/providers/claude-native/filterConfigs/bash-cargo-test.ts +1 -0
  1139. package/server/src/providers/claude-native/filterConfigs/bash-jest-vitest.ts +1 -0
  1140. package/server/src/providers/claude-native/filterConfigs/bash-pytest.ts +1 -0
  1141. package/server/src/providers/claude-native/filterConfigs/index.ts +2 -1
  1142. package/server/src/providers/claude-native/foldDigest.ts +9 -2
  1143. package/server/src/providers/claude-native/gateReview.ts +0 -0
  1144. package/server/src/providers/claude-native/hookIf.ts +414 -0
  1145. package/server/src/providers/claude-native/hooks.ts +398 -54
  1146. package/server/src/providers/claude-native/imageRead.ts +92 -0
  1147. package/server/src/providers/claude-native/index.ts +32 -1
  1148. package/server/src/providers/claude-native/mediaLimits.ts +14 -0
  1149. package/server/src/providers/claude-native/mediaRetention.ts +49 -0
  1150. package/server/src/providers/claude-native/mediaRetirementNotice.ts +8 -0
  1151. package/server/src/providers/claude-native/modelParams.ts +23 -2
  1152. package/server/src/providers/claude-native/oauth.ts +9 -8
  1153. package/server/src/providers/claude-native/outputAccumulator.ts +29 -17
  1154. package/server/src/providers/claude-native/peerTools.ts +3 -169
  1155. package/server/src/providers/claude-native/pretoolGuards.ts +76 -9
  1156. package/server/src/providers/claude-native/registryTools.ts +4 -2
  1157. package/server/src/providers/claude-native/resumeSummary.ts +138 -28
  1158. package/server/src/providers/claude-native/sandboxExecutor.ts +24 -16
  1159. package/server/src/providers/claude-native/taskAdmission.ts +62 -0
  1160. package/server/src/providers/claude-native/toolChecks.ts +127 -0
  1161. package/server/src/providers/claude-native/toolPosture.ts +5 -3
  1162. package/server/src/providers/claude-native/toolResultEviction.ts +17 -7
  1163. package/server/src/providers/claude-native/tools.ts +228 -130
  1164. package/server/src/providers/claude-native/usageContext.ts +93 -0
  1165. package/server/src/providers/claude-native/wireFingerprint.ts +2 -2
  1166. package/server/src/providers/claude-native/worker.ts +1056 -334
  1167. package/server/src/providers/claude-native/workerHelpers.ts +133 -6
  1168. package/server/src/providers/claude-native/workspaceFacts.ts +2 -2
  1169. package/server/src/providers/claude.ts +65 -93
  1170. package/server/src/providers/clusterTaskToolDefinitions.ts +180 -0
  1171. package/server/src/providers/codex-appserver/catalog.ts +26 -19
  1172. package/server/src/providers/codex-appserver/index.ts +8 -3
  1173. package/server/src/providers/codex-appserver/jsonRpc.ts +9 -2
  1174. package/server/src/providers/codex-appserver/worker.ts +108 -77
  1175. package/server/src/providers/codex.ts +49 -57
  1176. package/server/src/providers/codexChatBoundary.ts +55 -0
  1177. package/server/src/providers/codexCodeMode.ts +2 -2
  1178. package/server/src/providers/codexContextWindow.ts +2 -2
  1179. package/server/src/providers/codexHome.ts +6 -0
  1180. package/server/src/providers/codexImageTool.ts +22 -0
  1181. package/server/src/providers/codexVersion.ts +13 -0
  1182. package/server/src/providers/codexWebSearch.ts +5 -0
  1183. package/server/src/providers/cursor/acpJsonRpc.ts +3 -1
  1184. package/server/src/providers/cursor/authState.ts +72 -0
  1185. package/server/src/providers/cursor/catalog.ts +20 -13
  1186. package/server/src/providers/cursor/chatSandbox.ts +71 -0
  1187. package/server/src/providers/cursor/filePlugin.ts +27 -0
  1188. package/server/src/providers/cursor/index.ts +29 -4
  1189. package/server/src/providers/cursor/modelMap.ts +182 -0
  1190. package/server/src/providers/cursor/print.ts +80 -27
  1191. package/server/src/providers/cursor/worker.ts +156 -84
  1192. package/server/src/providers/errorClassifier.ts +7 -2
  1193. package/server/src/providers/handoffHistoryBinding.ts +40 -0
  1194. package/server/src/providers/index.ts +12 -6
  1195. package/server/src/providers/llamacpp.ts +93 -176
  1196. package/server/src/providers/llamacppManager.ts +62 -33
  1197. package/server/src/providers/llamacppVersion.ts +4 -0
  1198. package/server/src/providers/lmstudio.ts +124 -190
  1199. package/server/src/providers/localFileMedia.ts +229 -0
  1200. package/server/src/providers/localMcp.ts +76 -0
  1201. package/server/src/providers/localShellLifecycle.ts +30 -0
  1202. package/server/src/providers/localToolDispatch.ts +111 -0
  1203. package/server/src/providers/ollama.ts +161 -171
  1204. package/server/src/providers/ollamaCtxFallback.ts +1 -2
  1205. package/server/src/providers/ollamaDurableCompaction.ts +5 -4
  1206. package/server/src/providers/ollamaExecutionHistory.ts +40 -13
  1207. package/server/src/providers/ollamaFencedTools.ts +10 -11
  1208. package/server/src/providers/ollamaResilience.ts +10 -13
  1209. package/server/src/providers/ollamaTokens.ts +4 -7
  1210. package/server/src/providers/ollamaToolSubset.ts +14 -2
  1211. package/server/src/providers/ollamaTools.ts +212 -200
  1212. package/server/src/providers/outputStyle.ts +72 -72
  1213. package/server/src/providers/providerFileContent.ts +133 -0
  1214. package/server/src/providers/renderedTranscript.ts +2 -0
  1215. package/server/src/providers/requestDeadline.ts +27 -0
  1216. package/server/src/providers/sessionScope.ts +9 -0
  1217. package/server/src/providers/types.ts +3 -0
  1218. package/server/src/publicProject.ts +54 -13
  1219. package/server/src/publicProjectChoice.ts +39 -0
  1220. package/server/src/quota.ts +48 -23
  1221. package/server/src/recall/search.ts +9 -32
  1222. package/server/src/recall/transcriptSearch.ts +27 -0
  1223. package/server/src/recentFilesLedger.ts +10 -8
  1224. package/server/src/recentProjectActivity.ts +56 -0
  1225. package/server/src/scanDeadline.ts +26 -0
  1226. package/server/src/searchText.ts +16 -0
  1227. package/server/src/server/broadcast.ts +120 -54
  1228. package/server/src/sessionJsonl.ts +31 -17
  1229. package/server/src/settings.ts +137 -41
  1230. package/server/src/skillManagement.ts +585 -0
  1231. package/server/src/skillMutation.ts +6 -0
  1232. package/server/src/skills.ts +195 -25
  1233. package/server/src/smartPickup.ts +3 -2
  1234. package/server/src/smartPickupAdapters.ts +31 -10
  1235. package/server/src/storageActions.ts +1 -1
  1236. package/server/src/storageArchive.ts +42 -22
  1237. package/server/src/storageRoot.ts +30 -0
  1238. package/server/src/storageTurnWatch.ts +39 -0
  1239. package/server/src/taskDispatcher.ts +22 -2
  1240. package/server/src/templates/store.ts +72 -57
  1241. package/server/src/terminal/ptyManager.ts +37 -27
  1242. package/server/src/terminal/ptyPidRegistry.ts +10 -58
  1243. package/server/src/thirdPartySkills.ts +79 -0
  1244. package/server/src/toolPath.ts +31 -0
  1245. package/server/src/toolboxWorkflow.ts +2 -1
  1246. package/server/src/uploadImages.ts +124 -0
  1247. package/server/src/voice/computerContext.ts +2 -1
  1248. package/server/src/voice/conditionSchema.ts +3 -1
  1249. package/server/src/voice/conditions.ts +1 -1
  1250. package/server/src/workers/StreamParser.ts +42 -11
  1251. package/server/src/workers/WorkerManager.ts +32 -35
  1252. package/server/src/workers/durablePidRegistry.ts +266 -0
  1253. package/server/src/workers/limits.ts +1 -1
  1254. package/server/src/workers/pidRegistry.ts +15 -89
  1255. package/server/src/workers/processActivity.ts +14 -0
  1256. package/server/src/workers/processKill.ts +175 -1
  1257. package/server/src/workers/processStartTime.ts +137 -49
  1258. package/server/src/workflowMeta.ts +59 -19
  1259. package/server/src/workflowStore.ts +177 -22
  1260. package/server/src/workflows/modelTitles.ts +4 -3
  1261. package/server/src/workflows/sessionIndex.ts +24 -3
  1262. package/server/src/workflows/types.ts +20 -10
  1263. package/server/src/workspace.ts +6 -0
  1264. package/server/src/ws/afterTurn.ts +34 -0
  1265. package/server/src/ws/clusterHandlers.ts +198 -276
  1266. package/server/src/ws/clusterMembers.ts +204 -0
  1267. package/server/src/ws/compactHandlers.ts +38 -11
  1268. package/server/src/ws/gateHandlers.ts +2 -1
  1269. package/server/src/ws/genesisHandlers.ts +49 -6
  1270. package/server/src/ws/handoffHandlers.ts +168 -53
  1271. package/server/src/ws/previewCaptureHandlers.ts +1 -4
  1272. package/server/src/ws/taskLedgerHandlers.ts +22 -13
  1273. package/server/src/ws/taskLifecycle.ts +41 -0
  1274. package/server/src/ws/turnEngine.ts +488 -366
  1275. package/server/src/ws/turnPrompt.ts +60 -0
  1276. package/server/src/ws/turnSettings.ts +95 -0
  1277. package/server/src/ws/updatePrimaryConfig.ts +55 -31
  1278. package/server/src/ws/workflowHandlers.ts +187 -158
  1279. package/shared/dist/clusterCoordination.js +15 -7
  1280. package/shared/dist/clusterRolePresets.js +8 -6
  1281. package/shared/dist/codexChat.d.ts +2 -0
  1282. package/shared/dist/codexChat.js +5 -0
  1283. package/shared/dist/folderName.d.ts +1 -0
  1284. package/shared/dist/folderName.js +18 -0
  1285. package/shared/dist/index.d.ts +6 -0
  1286. package/shared/dist/index.js +6 -0
  1287. package/shared/dist/localRuntimeStatus.d.ts +23 -0
  1288. package/shared/dist/localRuntimeStatus.js +47 -0
  1289. package/shared/dist/notificationTitle.d.ts +9 -0
  1290. package/shared/dist/notificationTitle.js +23 -0
  1291. package/shared/dist/outputStyle.d.ts +10 -0
  1292. package/shared/dist/outputStyle.js +28 -0
  1293. package/shared/dist/outputs.d.ts +1 -0
  1294. package/shared/dist/protocol/autoPickup.d.ts +2 -0
  1295. package/shared/dist/protocol/chat.d.ts +4 -0
  1296. package/shared/dist/protocol/checkpoints.d.ts +24 -2
  1297. package/shared/dist/protocol/checkpoints.js +1 -0
  1298. package/shared/dist/protocol/clientMessages.d.ts +9 -14
  1299. package/shared/dist/protocol/clusters.d.ts +21 -4
  1300. package/shared/dist/protocol/clusters.js +3 -3
  1301. package/shared/dist/protocol/connections.d.ts +2 -0
  1302. package/shared/dist/protocol/diagnostics.js +1 -1
  1303. package/shared/dist/protocol/genesis.d.ts +9 -0
  1304. package/shared/dist/protocol/mcp.d.ts +1 -0
  1305. package/shared/dist/protocol/mcp.js +8 -5
  1306. package/shared/dist/protocol/mdTuneup.d.ts +2 -0
  1307. package/shared/dist/protocol/models.d.ts +3 -1
  1308. package/shared/dist/protocol/models.js +19 -8
  1309. package/shared/dist/protocol/notifications.d.ts +2 -1
  1310. package/shared/dist/protocol/notifications.js +15 -3
  1311. package/shared/dist/protocol/plans.d.ts +2 -1
  1312. package/shared/dist/protocol/remoteManagement.d.ts +6 -0
  1313. package/shared/dist/protocol/serverMessages.d.ts +69 -10
  1314. package/shared/dist/protocol/settings.d.ts +16 -4
  1315. package/shared/dist/protocol/settings.js +17 -1
  1316. package/shared/dist/protocol/tasks.d.ts +1 -0
  1317. package/shared/dist/protocol/usage.d.ts +1 -0
  1318. package/shared/dist/protocol/workers.d.ts +1 -0
  1319. package/shared/dist/protocol/workflows.d.ts +73 -14
  1320. package/shared/dist/protocol/workflows.js +66 -0
  1321. package/shared/dist/publicGuardrails.d.ts +1 -1
  1322. package/shared/dist/publicGuardrails.js +1 -1
  1323. package/shared/dist/runtimeVersions.d.ts +2 -0
  1324. package/shared/dist/runtimeVersions.js +13 -0
  1325. package/shared/dist/shellTool.d.ts +2 -0
  1326. package/shared/dist/shellTool.js +9 -0
  1327. package/shared/src/clusterCoordination.ts +12 -7
  1328. package/shared/src/clusterRolePresets.ts +8 -6
  1329. package/shared/src/codexChat.ts +8 -0
  1330. package/shared/src/folderName.ts +11 -0
  1331. package/shared/src/index.ts +8 -0
  1332. package/shared/src/localRuntimeStatus.ts +53 -0
  1333. package/shared/src/notificationTitle.ts +23 -0
  1334. package/shared/src/outputStyle.ts +35 -0
  1335. package/shared/src/outputs.ts +3 -0
  1336. package/shared/src/protocol/autoPickup.ts +2 -0
  1337. package/shared/src/protocol/chat.ts +5 -0
  1338. package/shared/src/protocol/checkpoints.ts +40 -8
  1339. package/shared/src/protocol/clientMessages.ts +11 -11
  1340. package/shared/src/protocol/clusters.ts +40 -10
  1341. package/shared/src/protocol/connections.ts +6 -0
  1342. package/shared/src/protocol/diagnostics.ts +1 -1
  1343. package/shared/src/protocol/genesis.ts +11 -0
  1344. package/shared/src/protocol/mcp.ts +12 -7
  1345. package/shared/src/protocol/mdTuneup.ts +4 -2
  1346. package/shared/src/protocol/models.ts +22 -8
  1347. package/shared/src/protocol/notifications.ts +16 -3
  1348. package/shared/src/protocol/plans.ts +5 -7
  1349. package/shared/src/protocol/remoteManagement.ts +10 -3
  1350. package/shared/src/protocol/serverMessages.ts +88 -7
  1351. package/shared/src/protocol/settings.ts +35 -5
  1352. package/shared/src/protocol/tasks.ts +1 -0
  1353. package/shared/src/protocol/usage.ts +3 -3
  1354. package/shared/src/protocol/workers.ts +5 -0
  1355. package/shared/src/protocol/workflows.ts +133 -21
  1356. package/shared/src/publicGuardrails.ts +1 -1
  1357. package/shared/src/runtimeVersions.ts +15 -0
  1358. package/shared/src/shellTool.ts +9 -0
  1359. package/client/dist/assets/galleryEditor-fPb76Cjv.js +0 -702
  1360. package/client/dist/assets/index-CjkHb-_n.js +0 -592
  1361. package/client/dist/assets/index-DIbh3ae5.css +0 -1
  1362. package/client/src/components/ConversationMenu.tsx +0 -467
  1363. package/client/src/stores/sessionIndexStore.ts +0 -92
package/docs/PROVIDERS.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Providers
2
2
 
3
+ Native and local-model file tools read inside the project folder and refuse links that leave it, including links used as search folders. Links to files inside the same folder remain usable. New nested files can still be created. Files outside the project folder are attached to the message instead of opened through the file tool.
4
+
3
5
  **Status:** Guided first-run Connections setup and recovery remain in progress. See [Development status](DEVELOPMENT_STATUS.md).
4
6
 
5
7
  Per-provider deep dive. The generally available providers are **Claude**, **Codex**, **Ollama**, **LM Studio**, **llama.cpp**, and **Cursor**. Two optional integrations, **Strata** and **DeepSeek through Xolotl**, require separately installed external services that Arco does not distribute. All configured providers can act as primaries and reviewers. They differ in spawn mechanism, session resume, auth, and capability detection; this doc tracks each one's particulars. Two providers run multiple transports side-by-side, picked per-tab from the CONFIG tab: **Claude** has `cli` (per-turn `claude` subprocess) and `native` (long-lived in-process Anthropic-API worker via `@anthropic-ai/sdk`); **Codex** has `exec` (per-turn `codex exec` subprocess) and `appserver` (long-lived `codex app-server` child). **Cursor** also has two - `acp` (long-lived) and `print` (stateless one-shot) - but the choice is routed automatically (`sandbox: 'read-only'` -> `print`), not toggled.
@@ -10,6 +12,14 @@ For the abstract interface, see `server/src/providers/types.ts`. For when these
10
12
 
11
13
  ---
12
14
 
15
+ ## Child process input failures
16
+
17
+ If a provider CLI, sign-in process, language server or MCP server closes its input early, Arco handles the input-stream error and stays running. Existing exit reporting and request timeouts still apply; failed requests are not automatically resent.
18
+
19
+ ## Diagnostic executable lookup
20
+
21
+ Diagnostics uses platform PATH lookup, including Windows PATHEXT suffixes, to find optional tools and language servers. Model Health uses the runtime's `ARCO_LLAMACPP_BIN` override when configured; otherwise it searches PATH. An invalid configured override is reported missing. These checks do not launch a model.
22
+
13
23
  ## Topics
14
24
 
15
25
  | Topic |
@@ -36,8 +46,8 @@ For the abstract interface, see `server/src/providers/types.ts`. For when these
36
46
 
37
47
  | Provider | Transport | Effort levels | Native resume | Notes |
38
48
  |---|---|---|---|---|
39
- | Claude | `cli` (alternate; also reviewers and handoff seeds) | low / medium / high / xhigh / max | UUID-based (`--session-id` / `--resume`) | Picker: `opus` / `sonnet` family aliases plus pinned ids (Opus 5.5, Fable 5.1, Sonnet 5, Opus 5, Opus 4.8, ...). Per-turn `claude` CLI spawn. Full two-way interop with terminal `claude`. Chat renders from `~/.claude/projects/<cwd-hash>/<sessionId>.jsonl`. Auto-handoff supported. |
40
- | Claude | `native` (new-home default) | low / medium / high / xhigh / max | Replay from `events.jsonl` (Arco-internal; no terminal resume) | Long-lived in-process `@anthropic-ai/sdk` worker, no CLI spawn. OAuth subscription auth + pinned Claude Code wire fingerprint. Append-only request prefix with preserved thinking (required by Fable 5.1 / Mythos 5.1 / Opus 5.5). Ships its own Bash / Read / Edit / Grep / Glob / Task tools, Claude-Code-compatible hooks runner, server-side `compact` + auto-handoff + deterministic Fold, operator-armed plan-mode, parallel `Task` subagent fan-out (depth-1 cap), output-style picker (normal / lite / terse), and posture-based toolsets (operator cycles a full / coding / review / chat posture that scopes exposed tools).
49
+ | Claude | `cli` (alternate; also reviewers and handoff seeds) | low / medium / high / xhigh / max | UUID-based (`--session-id` / `--resume`) | Picker: `opus` / `sonnet` family aliases plus pinned ids (Opus 5.5, Fable 5.2 / 5.1, Sonnet 5, Opus 5, Opus 4.8, ...). Per-turn `claude` CLI spawn. Full two-way interop with terminal `claude`. Chat renders from `~/.claude/projects/<cwd-hash>/<sessionId>.jsonl`. Auto-handoff supported. |
50
+ | Claude | `native` (new-home default) | low / medium / high / xhigh / max | Replay from `events.jsonl` (Arco-internal; no terminal resume) | Long-lived in-process `@anthropic-ai/sdk` worker, no CLI spawn. OAuth subscription auth + pinned Claude Code wire fingerprint. Append-only request prefix with preserved thinking (required by Fable 5.2 / 5.1 and Mythos 5.2 / 5.1 / Opus 5.5). Ships its own Bash / Read / Edit / Grep / Glob / Task tools, Claude-Code-compatible hooks runner, server-side `compact` + auto-handoff + deterministic Fold, operator-armed plan-mode, parallel `Task` subagent fan-out (depth-1 cap), output-style picker (normal / plain / terse), and posture-based toolsets (operator cycles a full / coding / review / chat posture that scopes exposed tools).
41
51
  | Codex | `exec` (alternate; also reviewers and handoff seeds) | model/catalog-driven; Astra / Sol: low through ultra, Luna: through max | UUID-based (`codex exec resume`) | Default model GPT-6 Astra (Sol and Luna also in the cold-catalog fallback; the live `model/list` catalog is authoritative). MAX context by default. Per-turn `codex exec` spawn. Full two-way interop with terminal `codex`. Supported effort values pass through; older models are not widened to Astra-only levels. Reviewer runs `-s read-only`. Transcript hydration on Resume for unclaimed rollouts. |
42
52
  | Codex | `app-server` (new-home default) | model/catalog-driven (same as `exec`) | UUID-based (rollouts in `~/.codex/sessions/`) | Long-lived `codex app-server` per tab. Structured `turn/interrupt` cancel + non-destructive `turn/steer` mid-turn input + `localImage` attachments + crash-recovery circuit breaker + output-style picker + native compact with context-signal reset. Reviewers / handoff seeds always run on `exec`. |
43
53
  | Cursor | `acp` (default) + `print` | baked into the model id (`-low` / `-high` / `-xhigh` / `-max`) | `session/load` (loadSession capability) | Long-lived `cursor-agent acp` ACP worker; ~153 models incl. Grok. Steer / cancel / session resume / live model-swap via `session/set_model`. No per-turn token signal (the Usage tab is dashboard-polled). Cluster member via an in-process loopback HTTP MCP server. Read-only reviewer / primitives run a stateless `cursor-agent -p --mode ask` one-shot. |
@@ -58,6 +68,12 @@ See [Settings: Utility agent](SETTINGS.md#utility-agent) and
58
68
 
59
69
  Auth is per-service: browser OAuth for Claude (CLI login, plus a separate OAuth flow for Native); terminal-launched TUI for Codex; `gh auth token` for GitHub; Ollama / LM Studio / Strata probe their HTTP endpoints (prepared local Strata profiles can also start on demand); llama.cpp probes for the binary + reads `~/.arco/llamacpp.json`; Cursor uses its own `cursor-agent login`. The auth overlay blocks app use only when no primary-capable provider is authed.
60
70
 
71
+ ### Background programs
72
+
73
+ ACTIVITY > BACKGROUND lists programs the agent started through a shell tool and left running, such as a dev server or long build. Arco helpers, configured MCP servers and provider programs are excluded. Jobs remain visible across turns and briefly show completion after exiting. Process discovery currently requires Linux.
74
+
75
+ The tracker matches shell-tool commands to process arguments and follows their known children. Claude CLI, Codex exec and app-server, and Cursor ACP supply these events. Providers without a discoverable child-process id do not feed this process tracker. Native and local tool execution keep their existing task reporting.
76
+
61
77
  ## The provider abstraction
62
78
 
63
79
  Every provider implements `ProviderProcess` from `server/src/providers/types.ts`:
@@ -109,7 +125,7 @@ interrupted; unavailable requests visibly queue as follow-ups.
109
125
  waits for the actual child `exit` (10-second ceiling) before session resume.
110
126
  - Claude Native cancels its stream/tools and awaits the actual `runTurn` promise.
111
127
  If another correction cancels startup before its prompt entered history,
112
- `turnInputAccepted:false` carries that unsubmitted correction into the next prompt.
128
+ `turnInputAccepted:false` carries that unsubmitted correction into the next prompt. This also applies while Native startup loads handoff history and sub-agent settings.
113
129
  - Codex app-server uses `turn/interrupt` and waits for matching interrupted
114
130
  completion. Concurrent STOP/interrupt requests share one cancellation waiter.
115
131
 
@@ -120,8 +136,86 @@ turn. Existing edits remain in place; this action disarms an armed Goal Run.
120
136
  Tests: `npm run test:interrupt-send`, `npm run smoke:interrupt-send` (isolated fake
121
137
  CLIs plus real Native loop over mocked Anthropic streaming; zero model spend).
122
138
 
139
+ ### Local file context across turns
140
+
141
+ In Agent tabs, Ollama, llama.cpp, LM Studio, Strata and DeepSeek keep named attachment and tool-file receipts across turns and reload. Each request restores up to two recent fitted images and 8 KiB of decoded text. Current attachments take priority in the request's media budget. Text-only models receive descriptions instead of image inputs. Older receipts name saved files or the original tool and input so the agent can use Read or request another range. Missing files produce an explicit notice.
142
+
143
+ Ollama, llama.cpp and LM Studio replay saved file records as separate chronological messages labelled `Arco historical file context`. These records come from Arco events, not assistant prose, and are not new user requests. Receipt-like assistant text stays assistant text. For a file not listed in the records, the agent must call Read before describing its contents; a saved reference alone does not supply its contents. Existing saved conversations use the same event projection without migration. Receipt text keeps its existing 16 KiB replay budget, with short labels added. New turns append records rather than rebuilding a growing leading system block. Ollama compaction uses the same labelled replay. The prior-turn auto-summary and Strata/DeepSeek replay format are unchanged. This separation does not guarantee model accuracy.
144
+
145
+ Snapshots live in the conversation's `file-context/` folder, outside ARTIFACTS. Each saved result retains at most two images and 32 KiB of decoded text; request preparation considers up to 64 references. Repeated reads reuse snapshots with identical saved content. Older snapshots remain readable. Disk snapshots are immutable and are not automatically deleted. Storage measurement includes them in Conversation files, and operator ARCHIVE, RESTORE and DELETE include the folder. Incognito keeps tool-file context in bounded memory only and clears it on close or reset. Switching to Native retains readable receipts; it does not restore local snapshots as native image blocks.
146
+
123
147
  ## Claude
124
148
 
149
+ ### Native file reads and attachments
150
+
151
+ Claude Native Read, Task helpers and operator attachments use Arco's portable file decoder. Initial, queued, follow-up and steered attachments use the same preparation. Tool cards show the file name, type, dimensions or selected document range instead of binary bytes. After reload, Native retains MCP media receipts with the original tool name and input for requesting the result again. Text reads retain the 256 KiB cap and line controls. UTF-8 and byte-order-marked UTF-16 text are recognized. Non-UTF-8 text without NUL bytes and with fewer than 1% unexpected control bytes per 16 KiB chunk is decoded as Windows-1252 and marked. Line ranges apply to the decoded text. A selected text range containing NUL bytes receives a binary-file note, including when those bytes occur after the initial header.
152
+
153
+ PNG, JPEG, GIF, WebP, AVIF, HEIC, TIFF, BMP and ICO are fitted with bundled codecs. No image converter installation is required. Available ImageMagick or macOS sips can accelerate decoding. Images fit within 2,000 pixels per side and 5 MB base64. The entire image is scaled without cropping; animated or multipage images use their first frame. ICO uses its largest embedded PNG or bitmap. SVG supplies bounded source text and a fitted preview. Its isolated WebAssembly renderer executes no scripts and resolves no external resources or system fonts. Text requiring a font may be absent from the preview; the source remains available.
154
+
155
+ Read accepts `pages`, such as `"1-3,5"`. PDFs provide extracted text and scanned-page images by default. Use `pdf_mode: "visual"` with `pages` to request selected PDF pages for layout, charts or figures. Word (`.doc`, `.docx`), Excel (`.xls`, `.xlsx`), PowerPoint (`.ppt`, `.pptx`), OpenDocument and RTF become text with headings, table rows, sheet names or slide labels. Notebook cells retain source and outputs, including images. Files ending in `.ipynb` retain cell selection even when metadata precedes the cell list. SVG outputs include source and a fitted image; other unsupported rich outputs leave a cell-numbered receipt naming their media type.
156
+
157
+ For spreadsheets, presentations and notebooks, `pages` selects sheets, slides or cells. Word-processing ranges select explicit page breaks and bounded sections, not printed-layout pages. Embedded images follow supported document relationships; legacy images without section mappings are available when reading the whole document. Macros, external links and notebook code are never executed.
158
+
159
+ Sources can be up to 512 MB. PNG scanline decoding supports 512 megapixels; other raster decoders allow 250 megapixels. Oversized or malformed files produce a note explaining how to supply a smaller file or range. Claude Native uses independent request image and PDF-page caps from the selected context window: 100 images at 200k, 600 above it; 100 PDF pages below 1M, 600 at 1M or above. Unknown windows use 100 for each. Encoded media is capped at 128 MiB for the first-party API and conservatively at 20 MiB for custom or unknown endpoints, whose upstream request limits may be smaller. Text, tools and other request fields still contribute to the provider's total request size.
160
+
161
+ Native context and media limits use 200,000 tokens for Sonnet 4, Sonnet 4.5,
162
+ Opus 4, Opus 4.1 and Opus 4.5, including their dated IDs. Sonnet 4.5 therefore
163
+ shows 50% context fill at 100,000 retained prompt tokens and admits 100 images
164
+ and 100 visual PDF pages. Its former 1M beta is retired. Sonnet 4.6 and newer
165
+ 1M families retain their larger windows; Haiku 5.5 also uses 1M. Haiku 4.5
166
+ remains at 200K. See [Anthropic's context-window reference](https://platform.claude.com/docs/en/build-with-claude/context-windows).
167
+
168
+ Only real image blocks and base64 PDF documents consume media counts. Fetched text and ordinary text documents do not; a fetched base64 PDF counts its real pages. Tool input JSON is not media. Missing PDF page counts are measured from the bytes. Above 20 images, Arco retains its 2,000-pixel per-side rule.
169
+
170
+ Between API requests, older media becomes text receipts when needed to admit new media. One notice at the end of the turn totals the old images and PDF documents replaced, omitting empty categories; attach or request a file again to bring it back. Tool pairing remains intact; older signed reasoning is omitted and prompt-prefix bookkeeping restarts. An in-progress assistant/tool-result round keeps its original signed thinking and tool identifiers, matching in-turn compaction. Unaffected histories stay unchanged. If the new media alone exceeds the guard, a notice names the limit and image, page and encoded-size totals. Use COMPACT or HANDOFF, then attach or request the file again. A managed upload path does not grant Read access outside the workflow.
171
+
172
+ See the provider's [vision limits](https://platform.claude.com/docs/en/build-with-claude/vision) and [PDF limits](https://platform.claude.com/docs/en/build-with-claude/pdf-support).
173
+
174
+ MCP image and embedded document results use the same decoder. Linked resources are described rather than fetched automatically. Native `read_url` uses the shared public URL decoder for file links. Anthropic's server-side `web_fetch` remains available for web pages and citations. Utility jobs remain bounded text-only tasks without file tools.
175
+
176
+ Live requests and token counting receive typed media. Saved events and text summaries keep receipts and attachment references, never base64 payloads. Use Read again after reload or compaction for exact detail. Evicted raw results remain recoverable in local artifacts. Saved replay drops reasoning signatures when replacing their media with receipts.
177
+
178
+ [Anthropic's vision limits](https://platform.claude.com/docs/en/build-with-claude/vision) and [PDF limits](https://platform.claude.com/docs/en/build-with-claude/pdf-support) vary by endpoint and model. Arco deliberately uses stricter limits.
179
+
180
+ Native shell results carry exit, signal, timeout and cancellation status separately from output text. Failed commands show failed activity, run PostToolUseFailure hooks and select failure filters. Compiler, configuration and test-collection diagnostics remain visible when a test-result filter cannot safely summarize them.
181
+
182
+ Native Task model overrides are applied to the child workflow configuration before deriving its primary. The live child, emitted tab configuration and saved metadata therefore name the same requested model, including after promotion or reopen.
183
+
184
+ ### Claude Native sub-agent controls
185
+
186
+ Settings - Agents and clusters supplies `nativeSubagents` defaults; a tab's CONFIG values override individual fields. `maxRunning` defaults to 4 (range 1-32), `maxStarts` to 8 per parent turn (range 1-128), and `model` to Agent's choice. Both finite limits apply to existing installs on the next parent turn. Blank limits inherit Settings in a tab or the defaults in Settings. Settings changes apply next turn.
187
+
188
+ Agent's choice preserves the existing rule: use the parent's model unless the agent names another. A selected catalog model overrides the agent's requested model, including after hooks. An unavailable selection is refused instead of substituted. This does not bound token use or spending; no ask-first or pricing control is included.
189
+
190
+ Each parent has a FIFO running limit and a cumulative start budget across all tool rounds. Admitted extra Tasks wait with a QUEUED row and no child workflow yet. Queued tasks reserve budget places; cancellation before start refunds the reservation. A started child counts even if it fails or is cancelled. Calls beyond the budget return a plain refusal telling the agent not to retry unless requested. A new parent turn resets the budget. Queued and running tasks can be cancelled individually; parent cancellation stops both. Individual CANCEL tells the parent that the operator cancelled that sub-agent, asks it not to start a replacement unless the operator requests one, and asks it to count the task as cancelled. These are model instructions, not an additional admission limit. Chat, cluster members and depth-capped Task children are refused at dispatch and again before child creation.
191
+
192
+ Inline and TASKS rows retain the effective model through event replay, including the concrete model when reported by the child. Older rows use saved child metadata or show Model not recorded. The silence strip says Waiting for N sub-agents while Tasks remain pending. The parent still waits for final Task replies; this is not background execution.
193
+
194
+ | Provider | Sub-agent enforcement in this release |
195
+ | --- | --- |
196
+ | Claude Native | Arco enforces the running limit, per-turn start budget and selected model for ordinary Agent tabs outside clusters. |
197
+ | Claude CLI | Provider-owned Agent and ultracode Workflow calls; Native limits/model do not apply. Existing `--tools`/`--disallowedTools` remove tools but do not impose these limits. No new switches are applied. |
198
+ | Codex exec and app-server | Provider-owned harness; Native limits/model do not apply. Installed feature switches `multi_agent` and `multi_agent_v2` exist but alone do not prove all code-mode spawning routes absent. No new Agent switches are applied. |
199
+ | Cursor ACP/print | Provider-owned Agent tools; no child count/model control established by installed help. Ordinary print Chat keeps its existing empty tool allowlist. |
200
+ | Local providers | No built-in Arco Task/spawn tool. Peer messages address existing members. These limits do not cover shell-launched programs or third-party MCP tools. |
201
+
202
+ Missing CLI, Codex or Cursor child-specific settings remain unconfirmed, not established as unsupported. Provider-owned children are not converted into Native task rows by these controls.
203
+
204
+
205
+ Spawn from a HISTORY point reads the selected earlier prefix even when it is outside the recent replay tail. Cancelled handoffs leave prior Native context intact, including the older-history summary. A cancellation or failure during pre-warm revokes an earlier prepared artifact for replay; a successful fallback after a failed reflection remains valid. Derived summary caches from the earlier replay rule are rebuilt automatically; original events remain unchanged.
206
+
207
+ Context `@file:` references expand supported documents and notebook cells as text, and send supported media through the provider attachment path. Unsupported binary content becomes a note. Text is limited to 64 KiB per reference; the aggregate context budget also applies to media.
208
+
209
+ Native Read and local Read keep their 256 KiB and 32 KiB output caps while reading in chunks; `offset` and `limit` still select later lines. Special files are refused.
210
+
211
+ Grep skips binary files and searches UTF-8, UTF-16 and Windows-1252 text. A legacy text chunk with at least one percent disallowed control characters is treated as binary. JavaScript search reports shortened long lines. Native ripgrep decodes legacy text output and also checks legacy text for non-ASCII search terms.
212
+
213
+ Native `read_url`, local WebFetch and the read-only CLI `fetch_file` tool use `fileFetch.ts`. Text downloads stop at 128 KiB; recognized images and documents have the shared 512 MiB source budget before decoding and provider limits apply. The reader checks public HTTP(S) hosts, resolved addresses and every direct HTTP redirect. Source-size and deadline refusals return a note. Native server web tools run on the provider service.
214
+
215
+ Native Read keeps the partial-read warning when its output is capped, until a later complete read covers the file. Native Grep reports invalid patterns and search failures as errors; a successful search with no matches remains empty. Native Bash keeps its newest output tail even if saving the full output fails, and reports that full output is unavailable. Native and local-model Write create nested parent directories on Windows.
216
+
217
+ Registry MCP schemas keep their definitions and validation metadata, including local references. Unsupported top-level `oneOf`, `allOf` and `anyOf` are still removed before Native requests.
218
+
125
219
  ### Chat-mode execution contract
126
220
 
127
221
  `WorkerConfig.interactionMode:'chat'` is a hard tool boundary shared by the
@@ -130,24 +224,40 @@ first). The one exception is the per-tab web toggle - `chatWebArmed()` in
130
224
  `server/src/chatMode.ts` decides, and every transport states the mode
131
225
  explicitly instead of inheriting a provider default:
132
226
 
133
- - **Claude Native** - empty `tools`, or `buildChatWebTools()` (Anthropic
134
- `web_search` + `web_fetch` only, deliberately no `code_execution`) when armed;
227
+ - **Claude Native** - empty `tools`, or `buildChatWebTools()` (server
228
+ `web_search` + `web_fetch` and portable `read_url`, deliberately no `code_execution`) when armed;
135
229
  only the chat system block.
136
- - **Claude CLI** - `--tools ""`, or `--tools WebSearch,WebFetch` when armed,
230
+ - **Claude CLI** - `--tools ""`, or `--tools WebSearch,WebFetch` when armed, WEB grants permission for exactly `WebSearch` and `WebFetch` with `--allowedTools`, so the non-interactive CLI can run the enabled pair.
137
231
  plus `--strict-mcp-config`.
138
- - **Codex** - read-only sandbox in the isolated chat cwd (its CLI has no
139
- universal tool allowlist, so isolation + sandboxing are the defense);
140
- `web_search="live"|"disabled"` on both `exec` (`-c`) and app-server (thread
141
- config), plus chat `baseInstructions` on app-server.
232
+ - **Codex** - ordinary Chat always runs on `exec`, including saved tabs configured for app-server. Saved app-server conversations resume the same Codex session ID on exec, preserving provider history. Start and resume disable command execution, local image reading, apps, plugins, remote plugins, subagents, image generation, memories and hooks, plus skills and project documents. `--ignore-user-config --ignore-rules` keep user tools and rules out. Chat additionally disables agents and goals and excludes the host's builtin functions namespace, which contains patch tools. Strict startup validation refuses unsupported controls before a model turn. The lowest tested compatible Codex version is `0.167.0`; its strict startup check accepts both WEB policies. WEB keeps the exec host enabled for live web tools while command execution, local image readers and extension restrictions stay in force; WEB off disables that host. A cached installed-capability probe refuses unsupported versions before a model turn. The read-only sandbox is additional protection, not a disk-read boundary. Documents arrive as inline text and images through explicit `-i` inputs; `web_search="live"|"disabled"` follows WEB. The header shows EXEC. There is no mid-turn steering; send the next message after the reply. Native compaction and structured questions remain Agent app-server features. Computer mode keeps its separate privileged transport.
142
233
  - **Ollama** - no tools, or exactly `WebSearch` / `WebFetch` (local SearXNG +
143
234
  fetch) when armed, re-checked at dispatch by `ollamaToolCallAllowed()` so a
144
235
  hallucinated known tool name cannot cross the boundary.
145
236
  - **Strata** - the shared OpenAI HTTP worker advertises and dispatches only
146
237
  `WebSearch` / `WebFetch` when Chat web access is armed. Standalone logs/image
147
238
  caches mean it is unavailable in strict Incognito.
148
- - **llama.cpp, LM Studio** - tool schemas omitted; no web option.
149
- - **Cursor** - routed to the stateless `-p --mode ask` transport
150
- (`--stream-partial-output` in chat) with deterministic transcript replay.
239
+ - **llama.cpp, LM Studio** - tool schemas omitted; no web option. Both still
240
+ re-check `ollamaToolCallAllowed()` at dispatch, so a tool call the model
241
+ writes as text (llama.cpp's `<tool_call>` fallback) is refused in Chat and
242
+ in plan-review turns, even with AUTO on.
243
+ - **Cursor** - each Chat turn runs `-p --mode ask` in a private folder under
244
+ the selected Arco home, removed when the turn ends. Startup removes abandoned
245
+ turn folders without following links. Cursor Chat has no web access; its
246
+ header shows `NO WEB` and offers no web toggle. It receives no project
247
+ plugin, additional read folders or `--force`. Explicit permissions deny all
248
+ reads, writes, shell, web fetches and MCP tools, including previously approved
249
+ servers. An empty `--allowed-tools` list excludes every built-in tool family;
250
+ indexing, semantic search and lint context are disabled. Workspace context
251
+ comes from the private turn folder; the restricted workspace-exclusion flag
252
+ is not used. Account, team or model refusals appear as one plain sentence
253
+ naming Cursor, without the retry dump.
254
+ Documents arrive as extracted text. Only fitted copies of the current
255
+ message's images go through `--image`, never through a Read fallback.
256
+ Arco checks required flags with a deliberate parser error before starting a turn.
257
+ Missing required isolation controls refuse Chat; an unsupported image input
258
+ refuses images with a plain message. These Cursor flags are internal and may
259
+ change between versions. Agent ACP sessions and read-only reviews retain
260
+ their existing project access and argument builder.
151
261
 
152
262
  **Computer voice exception.** A `voiceOperator` Chat receives only the
153
263
  bounded `arco_*` tools from `server/src/voice/toolDefinitions.ts`, with
@@ -202,7 +312,7 @@ Reviewers and handoff seed turns always run on `cli` regardless of the tab's tra
202
312
 
203
313
  ### Native transport - append-only prefix (2026-09-01)
204
314
 
205
- Append-only prefix delivery is a current Native transport invariant. The in-process worker freezes `system` + `tools` on its first request and delivers every later config change (north-star, output style, cluster plan, CLAUDE.md re-read, posture, plan mode, MCP attach) as an appended `role:'system'` message with text and/or `tool_addition` / `tool_removal` blocks, so Claude Fable 5.1's preserved-thinking check never sees an edited prefix and the prompt cache survives config changes. Thinking blocks persist across turns (they used to be pruned at turn end). Every prefix mutation is a `ctx_action` in `events.jsonl`; `input_transformations` from Anthropic are logged per round. Pure helpers: `server/src/providers/claude-native/appendOnlyPrefix.ts` (`npm run test:append-only -w server`). Invariants: [Gotchas: Claude Native transport](GOTCHAS.md#claude-native-transport).
315
+ Append-only prefix delivery is a current Native transport invariant. The in-process worker freezes `system` + `tools` on its first request and delivers every later config change (north-star, output style, cluster plan, CLAUDE.md re-read, posture, plan mode, MCP attach) as an appended `role:'system'` message with text and/or `tool_addition` / `tool_removal` blocks, so Claude Fable 5.2 / 5.1's preserved-thinking check never sees an edited prefix and the prompt cache survives config changes. Thinking blocks persist across turns (they used to be pruned at turn end). Every prefix mutation is a `ctx_action` in `events.jsonl`; `input_transformations` from Anthropic are logged per round. Pure helpers: `server/src/providers/claude-native/appendOnlyPrefix.ts` (`npm run test:append-only -w server`). Invariants: [Gotchas: Claude Native transport](GOTCHAS.md#claude-native-transport).
206
316
 
207
317
  ### CLI transport
208
318
 
@@ -210,7 +320,7 @@ Append-only prefix delivery is a current Native transport invariant. The in-proc
210
320
 
211
321
  ### Spawn
212
322
 
213
- `spawn('claude', args, { detached: true, env: { ...process.env, ARCO_INVOKER: 'sdk-cli' } })`. The `ARCO_INVOKER` env var lets the concurrent-writer guard distinguish Arco-issued writes from foreign `claude --resume` terminal writes hitting the same JSONL.
323
+ `spawn('claude', args, { detached: true, env: { ...process.env } })` (through `commandArgs`, so Windows resolves the command shim). The concurrent-writer guard reads the `entrypoint` field the Claude CLI writes on each session JSONL row: `sdk-cli` for turns Arco started, any other value for a `claude --resume` terminal writing to the same JSONL (`server/src/ws/turnEngine.ts`).
214
324
 
215
325
  ### Argv (primary)
216
326
 
@@ -222,7 +332,7 @@ claude
222
332
  --include-partial-messages
223
333
  --model <m>
224
334
  --effort <e> # forced xhigh under ultracode
225
- [--input-format stream-json] # only when image attachments are present
335
+ [--input-format stream-json] # when image or PDF blocks are present
226
336
  [--session-id <uuid>] # first turn (Arco pre-mints)
227
337
  [--resume <uuid>] # subsequent turns
228
338
  [--no-session-persistence] # neither id set (workers, incognito)
@@ -246,7 +356,7 @@ Same base + `--no-session-persistence` (don't write a session JSONL) + optional
246
356
 
247
357
  ### Stdin
248
358
 
249
- For text-only prompts, the prompt is the last positional argument. For attachments (images), the prompt is sent as a `stream-json` envelope on stdin so binary content rides cleanly.
359
+ Text-only prompts use plain stdin. When prepared attachments contain images, stdin carries a single `stream-json` user envelope with media before the request text. Documents provide decoded text, with scanned PDF pages sent as images.
250
360
 
251
361
  **GOTCHA - ARG_MAX overflow** (large-prompt handling): when an inline `--append-system-prompt` value would push the argv past Linux's `MAX_ARG_STRLEN` (~128 KB/arg), `execve` kills the spawn with `E2BIG`. Arco's mitigation: above that threshold it writes the appendSystemPrompt to a tmpfile (`append-sp-{id}-{pid}.txt`) and passes it via the **separate** `--append-system-prompt-file` flag (a documented peer of `--append-system-prompt` in the CLI's bare help) - not the same flag with a path. If the tmpfile write fails it falls back to the inline `--append-system-prompt` argv (which may then E2BIG, but the operator sees a real spawn error rather than a silently-dropped prompt). Tmpfiles are cleaned up on settle and on server exit.
252
362
 
@@ -286,7 +396,7 @@ API-key fallback: if `ANTHROPIC_API_KEY` is set in the spawned process env, the
286
396
  - **API overload retry loop** - `overloaded_error` and `{"type":"error"}` envelopes from the CLI are caught, surfaced as `system_notice`, and retried with 15s/30s/60s backoff up to 3 attempts. Same session id, so retries are idempotent. Implemented in the result path inside `claude.ts`.
287
397
  - **Throttle detection** - stderr regexes catch "usage limit reached", "try again at HH:MM", "resets at <ISO>". Translated to `quota.markThrottled('claude', errorText, resetsAt)`.
288
398
  - **Output cap** - accumulated text is capped at `MAX_WORKER_OUTPUT_BYTES = 50 MB` (override via `ARCO_MAX_WORKER_OUTPUT_BYTES` env). Beyond that, Arco emits a truncation notice and forces the worker to settle. The 32 GB tree-RSS guard handles actual memory runaways; the text cap is the secondary safety net for "model went berserk printing forever."
289
- - **Image attachments** - sent as stream-json `content` blocks (5 MB per image). Non-image attachments are appended as `[attached file: <path>]` references in the prompt text.
399
+ - **Attachments** - fitted images use stream-json `content` blocks. Documents and notebooks provide decoded text, while other binaries provide a note. Agent labels identify the source path alongside its decoded content; Chat labels use the attachment name.
290
400
  - **Concurrent-writer guard** - the JSONL watcher inspects new entries' `entrypoint` field. If a foreign (`!= 'sdk-cli'`) entrypoint appears, Arco fires `[WARN] Concurrent writer detected on session <uuid>...` and refuses new turns for 60 seconds. Operator must Handoff to recover.
291
401
 
292
402
  ### Ultracode (sticky, CLI-only)
@@ -354,23 +464,33 @@ These moves are pure (no behavior change); `workerParity.test.ts` / `stripTraili
354
464
 
355
465
  #### Auth
356
466
 
357
- OAuth subscription flow lifted verbatim from `earendil-works/pi`:
467
+ OAuth subscription flow adapted from `earendil-works/pi`:
358
468
 
359
469
  - `CLIENT_ID = 9d1c250a-e61b-44d9-88ed-5944d1962f5e` (stored as base64 + `atob` at module load - minor protection against repo scrapes; not a security boundary).
360
- - Callback `127.0.0.1:53692/callback` (overridable via `ARCO_OAUTH_CALLBACK_HOST`). On `EADDRINUSE` we fall back to manual-paste mode automatically.
470
+ - OAuth state and the PKCE verifier are independent random values. The authorization URL carries state and the S256 challenge; the callback carries code and state; the verifier stays server-side until the token exchange. Callback `127.0.0.1:53692/callback` (overridable via `ARCO_OAUTH_CALLBACK_HOST`). On `EADDRINUSE` we fall back to manual-paste mode automatically.
361
471
  - Tokens persist to `~/.arco/auth.json` under `claude.native` - mode 0600, parent dir 0700, atomic tmp+rename, `proper-lockfile` around the read-refresh-write cycle. Lock is **not** held across the SDK call.
362
472
  - Refresh runs 30s ahead of expiry. On `400 invalid_grant`, the loop emits `[AUTH:claude]` system_notice and fails the turn; after three consecutive auth failures within the workflow the notice escalates and auto-retry stops until the operator re-logs in.
363
473
  - Re-login goes through `POST /api/auth/claude-native/login` (returns the authorize URL + a `manualFallback` flag); the callback is captured by the local server or accepted via `POST /api/auth/claude-native/callback` (`{ url }` body) for headless / port-blocked operators.
364
474
 
475
+ Saved Native login tokens use `https://api.anthropic.com` for both workflow requests and the Native evaluator. An inherited `ANTHROPIC_BASE_URL` alone cannot redirect them. An explicit `claudeNative.baseUrl` in the global settings file selects a custom endpoint; project settings cannot select that destination. The next turn or evaluation reads the setting, and an existing worker rebuilds its SDK client when the endpoint changes. Remove the setting to restore the provider default.
476
+
477
+ Saved-login worker and evaluator clients explicitly disable SDK API-key inheritance. Their requests carry the saved OAuth Authorization header without an unrelated environment X-Api-Key header. API-key-only SDK clients keep their environment key and endpoint.
478
+
479
+ A configured custom endpoint receives the saved Native login token. Configure only a trusted destination. This setting does not add API-key-only Native sign-in or change the SDK's environment endpoint behavior for API-key-only callers.
480
+
365
481
  #### Headers (wire fingerprint)
366
482
 
367
483
  | Header | Value | Notes |
368
484
  |---|---|---|
369
485
  | `anthropic-beta` | `claude-code-20250219,oauth-2025-04-20` | `+,interleaved-thinking-2025-05-14` is appended only for non-adaptive Anthropic thinking paths by default. Current Pi skips it for adaptive-thinking models because those models have interleaving built in. CONFIG has a Native-only debug override (`claudeNativeForceInterleavedThinkingBeta`) to force it for A/B testing. |
370
- | `user-agent` | `claude-cli/2.1.280` | Pinned in `wireFingerprint.ts`, **not** tracked from `claude --version`. Anthropic gates new models on it (Fable 5.1 needed ≥2.1.251; bumped again for Opus 5.5). Bump only on an observed rejection. |
486
+ | `user-agent` | `claude-cli/2.1.319` | Pinned in `wireFingerprint.ts`, **not** tracked from `claude --version`. Anthropic gates new models on it (Fable 5.2 requires 2.1.290 or newer). Bump only on an observed rejection. |
371
487
  | `x-app` | `cli` | Constant. |
372
488
  | `anthropic-dangerous-direct-browser-access` | `true` | Current Pi sends it on the SDK `authToken` path; Arco mirrors that wire fingerprint. |
373
489
 
490
+ Fable 5.2 and Mythos 5.2 use a 1M context window and five effort levels: low, medium, high, xhigh and max. Native keeps their thinking and request prefix intact. A date suffix on bare Fable 5 or Mythos 5 keeps the original model behavior. Switching a tab from 5.2 to another model drops its earlier reasoning; the request still works.
491
+
492
+ Short utility jobs (including BRIEF, CATCH ME UP, TIDY and Smart AUTO-PICKUP) and text compaction summaries use low effort on Fable/Mythos 5.2 and later 5.x point releases. Their response caps reserve another 8,192 tokens for reasoning. Utility answers keep the original visible-size limit. Compaction input splitting reserves this extra output space too. Normal worker turns keep the selected effort and 128K response cap.
493
+
374
494
  Adaptive-thinking `max_tokens` follows current Pi model metadata: Fable/Mythos 5, Opus 5 / 5.5, Opus 4.6/4.7/4.8, Sonnet 5, and the `opus`/`opus[1m]` family aliases use 128K output; Sonnet 4.6 uses 64K. Effort still rides through `output_config.effort`; the cap is headroom, not a request to spend it. Capability decisions (thinking params, max_tokens, ctx window, catalog ctx-management gating) key on `capModel()` - the concrete id Anthropic echoed for an alias tab (persisted as `meta.resolvedModelId`, announced via the `model_resolved` event). The request `model:` field is **always a concrete id**: the Messages API does not resolve family aliases (`model: "opus"` → `not_found_error: model: opus` - only the Claude Code CLI resolves them, client-side), so `requestModel()` maps an alias through `resolveClaudeAliasFromCatalog()` to the newest in-family catalog id before dispatch. The tab's configured model stays the alias, so auto-tracking lives in the resolution rather than on the wire. A turn ending `stop_reason: 'refusal'` (HTTP 200) surfaces as a `system_notice` + durable `primary_refusal` event instead of a blank turn. See [Gotchas: Claude Native transport](GOTCHAS.md#claude-native-transport) for both invariants.
375
495
 
376
496
  The first system block is hardcoded to `"You are Claude Code, Anthropic's official CLI for Claude."` and marked `cache_control: { type: 'ephemeral', ttl: '1h' }` so all Native tabs on a machine share the cached prefix. The appendSystemPrompt block (rendered transcript / skills / CLAUDE.md) carries the standard ephemeral marker.
@@ -382,17 +502,19 @@ The first system block is hardcoded to `"You are Claude Code, Anthropic's offici
382
502
  Per-tab `WorkflowConfig.claudeNativeThinkingDisplay` (`'omitted'` default | `'summarized'` | `'updates'`, Native-only). `buildThinkingParams(model, effort, display)` stamps `thinking: { type: 'adaptive', display }` on adaptive-thinking models. `omitted` is Claude-Code parity, but a multi-minute Opus/Fable adaptive think then streams only `ping` events - nothing bumps `lastPrimaryEventAt`, so the client's 30s stuck banner fires on a healthy worker (547s of legitimate silence observed with Fable 5 @ high). The CONFIG-tab **THINKING VISIBILITY** picker flips to `summarized`, streaming thinking deltas into the Activity tab (which also refresh the stuck clock). The round-trip stderr label reads `adaptive(effort,display)`. Primitives leave it unset ⇒ `omitted`; **Task children inherit** the parent's value.
383
503
 
384
504
  **Thinking display is not retention.** `updates` requests short progress notes on
385
- supported models (Fable 5 / 5.1, Mythos 5.1, Opus 5.5) but cannot guarantee them:
505
+ supported models (Fable 5 / 5.1 / 5.2, Mythos 5.1 / 5.2, Opus 5.5) but cannot guarantee them:
386
506
  the 2026-09-01 Fable 5.1 Native acceptance emitted none. On Opus 5.5 the notes Opus 5
387
507
  returned as `text` arrive as thinking blocks, so `omitted` hides them - prefer
388
- `summarized` there. Binding-enforcing Fable/Mythos 5.1 and Opus 5.5 keep thinking
508
+ `summarized` there. Binding-enforcing Fable/Mythos 5.2 / 5.1 and Opus 5.5 keep thinking
389
509
  and an append-only prefix regardless of display mode. See `FABLE_51_APPEND_ONLY_PLAN.md`.
390
510
 
391
511
  #### Tool surface (7a)
392
512
 
393
- Read / Write / Edit / Bash / Grep / Glob / KillShell / TodoWrite. Path validation reuses `resolveWithinCwd`. Per-tool output cap 64 KB; Read gets 256 KB (looser than Ollama's 32 KB - Claude windows are larger). Edit refuses if the target file wasn't Read in this turn (Claude Code parity). Bash registers each spawned shell against the worker's per-turn shell map so KillShell + cancel can target it; `run_in_background:true` returns a `shellId` immediately.
513
+ Read / Write / Edit / Bash / Grep / Glob / KillShell / TodoWrite. Path validation reuses `resolveWithinCwd`. Per-tool output cap 64 KB; Read gets 256 KB (looser than Ollama's 32 KB - Claude windows are larger). Edit refuses if the target file wasn't Read in this turn (Claude Code parity). Bash registers each spawned shell against the worker's per-turn shell map so KillShell + cancel can target it; `run_in_background:true` returns a `shellId` immediately. Closing or handing off the tab ends background shells still running (SIGTERM, then SIGKILL after 2 s; `taskkill` on Windows), and the worker waits until they have ended.
394
514
 
395
- **Edit apply.** When the exact `old_string` match fails, `Edit` (`editApply.ts`) falls through an ordered set of fuzzy strategies - `escape-drift` → `trailing-ws` → `indent` - each of which must resolve to exactly one location unless `replace_all`; an ambiguous fuzzy match is refused with a `closestLinesHint` rather than guessed. **Bash output** is bounded-tail: the model sees the last ~64 KB of combined chronological stdout+stderr through one accumulator, while the COMPLETE output spills to a per-run tempfile so a noisy command can't evict context. **File mutations** are serialized through a module-level per-realpath queue (`file-mutation-queue.ts`, keyed by `realpath` so symlink aliases share one queue) - this closes the silent edit-loss window when two Native workers on one cwd (e.g. cluster members) write the same file; a write that actually had to wait emits `file_mutation_queued`.
515
+ CLI version and help probes stop after five seconds and cap output at 2 MB. Unanswered Codex app-server RPC requests expire after 30 seconds; interrupt and compaction deadlines also cover the initial acknowledgement.
516
+
517
+ **Edit apply.** `replace_all` selects non-overlapping matches from left to right, including when whitespace normalization is needed; unmatched lines remain unchanged. When the exact `old_string` match fails, `Edit` (`editApply.ts`) falls through an ordered set of fuzzy strategies - `escape-drift` → `trailing-ws` → `indent` - each of which must resolve to exactly one location unless `replace_all`; an ambiguous fuzzy match is refused with a `closestLinesHint` rather than guessed. **Bash output** is bounded-tail: the model sees the last ~64 KB of combined chronological stdout+stderr through one accumulator, while the COMPLETE output spills to a per-run tempfile so a noisy command can't evict context. **File mutations** are serialized through a module-level per-realpath queue (`file-mutation-queue.ts`, keyed by `realpath` so symlink aliases share one queue) - this closes the silent edit-loss window when two Native workers on one cwd (e.g. cluster members) write the same file; a write that actually had to wait emits `file_mutation_queued`.
396
518
 
397
519
  Native also advertises Anthropic server-side `web_search_20260209` and `web_fetch_20260309` tools as `web_search` / `web_fetch`, plus `code_execution_20260120` so Anthropic's 2026 server-tool dynamic filtering path is available. These are not Arco-local tools: Anthropic executes them server-side and returns `server_tool_use` plus `web_search_tool_result` / `web_fetch_tool_result` content blocks. The Native worker surfaces the invocation in activity, but never routes it through `executeNativeTool()`. After the final answer, retained Native history is pruned of completed server-tool evidence, citation metadata, and hidden thinking; the model has already integrated the useful findings, and the next-turn prompt should not retain hundreds of KB of raw server-search evidence.
398
520
 
@@ -412,9 +534,9 @@ The Native worker is a first-class MCP host for the operator's enabled-and-allow
412
534
 
413
535
  #### Post-write LSP diagnostics (C3)
414
536
 
415
- After a successful `Write`/`Edit`, the tool calls a **fire-and-forget** `ctx.onFileWritten?.(abs)` hook (wrapped in `try/catch` - a diagnostics failure must NEVER break the write; the write path is P0). The worker wires it to the `lspManager` subsystem (`server/src/lsp/`), which lazy-spawns the project's language server (`typescript-language-server` / `pyright` / `gopls` / `rust-analyzer`, whichever is on PATH), opens the changed file, and forwards the server's `publishDiagnostics` to the client as a workflow-scoped `diagnostics {file, items[]}` message (rendered as a count badge + list on the Activity tab). Absent server ⇒ silent no-op (operator installs the LSP server themselves - bring-your-own-upstream, same as the caveman output style). Lifecycle mirrors `llamacppManager` (one server per `(cwd, languageId)`, dedup, idle-reap, shutdown-kill). **Full detail: `docs/LSP.md`.**
537
+ After a successful `Write`/`Edit`, the tool calls a **fire-and-forget** `ctx.onFileWritten?.(abs)` hook (wrapped in `try/catch` - a diagnostics failure must NEVER break the write; the write path is P0). The worker wires it to the `lspManager` subsystem (`server/src/lsp/`), which lazy-spawns the project's language server (`typescript-language-server` / `pyright` / `gopls` / `rust-analyzer`, whichever is on PATH), opens the changed file, and forwards the server's `publishDiagnostics` to the client as a workflow-scoped `diagnostics {file, items[]}` message (rendered as a count badge + list on the Activity tab). Absent server ⇒ silent no-op (operator installs the LSP server themselves - bring-your-own-upstream). Lifecycle mirrors `llamacppManager` (one server per `(cwd, languageId)`, dedup, idle-reap, shutdown-kill). **Full detail: `docs/LSP.md`.**
416
538
 
417
- ** (WebFetch / WebSearch) - server-side.** The plan-doc spec called for ~150 LOC of local WebFetch + WebSearch with SSRF guard, Camoufox stealth fallback, and pluggable Brave/Tavily/Kagi/SearXNG providers. Not needed: Native authenticates as Claude Code (OAuth + the pinned `claude-cli/<version>` user-agent from `wireFingerprint.ts`) and advertises Anthropic's server-side web tools. Anthropic executes calls server-side. No local web implementation is used.
539
+ ** (WebFetch / WebSearch) - server-side.** The plan-doc spec called for ~150 LOC of local WebFetch + WebSearch with SSRF guard, Camoufox stealth fallback, and pluggable Brave/Tavily/Kagi/SearXNG providers. Not needed: Native authenticates as Claude Code (OAuth + the pinned `claude-cli/<version>` user-agent from `wireFingerprint.ts`) and advertises Anthropic's server-side web tools. Anthropic executes calls server-side. The separate `read_url` companion uses Arco's public URL reader for file links.
418
540
 
419
541
  #### Tool surface (7b - Arco-integrated)
420
542
 
@@ -446,7 +568,7 @@ Plus 11 board-gated `cluster_task_*` task-board tools (list / show / create / cl
446
568
  **Restricted cluster members.** A BLIND member keeps its project cwd but the
447
569
  turn engine withholds the normal cluster plan/board/roster/role/focus/
448
570
  efficiency/progress context and registers only `peer_send` / `peer_read` from
449
- the cluster surface. ISOLATED is a stricter Claude-Native-only bootstrap: the
571
+ the cluster surface. llama.cpp and LM Studio advertise only those cluster tools to BLIND members. ISOLATED is a stricter Claude-Native-only bootstrap: the
450
572
  worker cwd becomes
451
573
  `~/.arco/clusters/<clusterId>/isolates/<wfid>/workspace`; Bash, KillShell,
452
574
  Task, project prompt/resource discovery, attachments, hooks, skills,
@@ -464,35 +586,47 @@ CLI Claude and both Codex transports get the same peer surface via a stdio MCP c
464
586
 
465
587
  **Project-trust gate.** Project-local agent surfaces that the worker would otherwise honor - the repo's `CLAUDE.md` (`claudeMdDiscovery.ts`), its `.claude/skills`, and its `.claude/settings.json` hooks - are suppressed until the operator vouches for the repo. `projectTrust.ts` resolves an effective trust for the cwd from a USER/GLOBAL-scope `~/.arco/trust.json` (deepest recorded ancestor wins) in a two-pass bootstrap, so a cloned repo can't self-grant trust by shipping its own trust file. Decision values are `always` / `never` (`ask` until the operator chooses); the gate logs its decision plus the suppressed-resource summary, and a recorded decision is one reversible line in `trust.json`. This closes the cloned-repo prompt-injection vector.
466
588
 
467
- | Event | Behavior |
468
- |---|---|
469
- | `PreToolUse` | Fires inside the dispatcher before each tool call. Non-zero exit blocks the tool; stderr surfaces as the tool result. |
470
- | `PostToolUse` | Fires after each tool returns. Exit code informational; stderr appended to result. |
471
- | `UserPromptSubmit` | Fires at the top of `runTurn`. Non-zero exit aborts the turn with stderr as a `system_notice`. |
472
- | `Stop` | Fires when the loop emits `result`. Informational. |
473
- | `SubagentStop` | Fires from inside the `Task` tool wrapper when the spawned child settles (success or error). Payload includes `taskId`, `childWorkflowId`, `status: 'completed' \| 'error'`, and `finalTextLength` / `error` accordingly. Informational - exit code does not block. |
474
- | `Notification` | Fires alongside `system_notice` emissions. |
475
- | `PreCompact` | Documented no-op pass-through (Native does not run a local compact hook; provider-side compaction and Handoff cover context management). |
589
+ Native runs command hooks as Claude Code's public hooks reference describes (`fireHooks()` and `evaluateHooks()` in `hooks.ts`). The events it fires:
590
+
591
+ | Event | When | Exit 2, or a blocking JSON decision |
592
+ |---|---|---|
593
+ | `UserPromptSubmit` | At the top of `runTurn`, before the first request. Matcher ignored. | Rejects the prompt: no request is made, the operator sees the reason and the original prompt (`suppressOriginalPrompt` leaves it out). `additionalContext` and plain-text stdout ride with the prompt. |
594
+ | `PreToolUse` | Before each tool call, matched against the tool name. | Refuses the call; the model gets `PreToolUse:<tool> hook error: [<command>]: <reason>`. `permissionDecision` `deny` refuses with its reason, `ask` parks the call on the approval card (category `hook-ask`), `allow` skips no Arco check, `defer` is ignored (non-interactive mode only). `updatedInput` replaces the whole input. `additionalContext` rides with the result. |
595
+ | `PostToolUse` | After a tool that succeeded. | The tool already ran: exit 2 stderr and the `reason` of `decision: "block"` are added next to the result. `updatedToolOutput` (a string, or `{ stdout, stderr }` for the shell tool) replaces what the model sees. `additionalContext` follows the result. |
596
+ | `PostToolUseFailure` | After a tool that failed (`error` holds its text). | As PostToolUse. |
597
+ | `Stop` | When the model finished responding (not after a cancel, truncation or refusal). Matcher ignored. | Keeps the model working: the reason (or `additionalContext`) becomes its next instruction. `stop_hook_active` is true on the continuation; after `CLAUDE_CODE_STOP_HOOK_BLOCK_CAP` (default 8) continuations in a row, counted from the last tool call, the turn ends. |
598
+ | `SubagentStop` | Instead of Stop on a Task child's first turn, matched against the agent type the parent asked for (`subagent_type`, default `general-purpose`). Input adds `agent_id`, `agent_type` and `agent_transcript_path`. | As Stop, for the child. |
599
+ | `PreCompact` | Before COMPACT, FOLD and SERVER FOLD, matched against `manual` (a button) or `auto` (auto-compaction, including a compaction inside a long turn, or auto-fold). Input: `trigger`, `custom_instructions` (null). | Skips the compaction; the notice gives the reason. `systemMessage` and `continue` are discarded. Not fired for the API's own server-side compaction, which happens inside a request. |
600
+ | `Notification` | `permission_prompt` when an approval card (review gate or hook `ask`) has waited 6 s; `idle_prompt` 60 s after a turn finished with no new message since (not after a cancel, not for a Task child). Matched against the type. Input: `message`, `title`, `notification_type`. | Cannot block. Runs in the background; exit code, stdout and stderr are ignored. |
476
601
 
477
- Default hook timeout 30s; per-hook `timeout` field overrides. Timed-out hooks get SIGTERM then SIGKILL after 2s grace; treated as non-zero exit. `CLAUDE_PROJECT_DIR=cfg.cwd` is set on the subprocess env; the per-event JSON payload is written to stdin. Inherited env minus any `ARCO_*` debug flags. Hook subprocesses register against the per-turn shell map so cancel + KillShell tear them down.
602
+ Reading a hook's result, as in the reference: exit 0 applies the JSON object on stdout (plain text is success, and context on UserPromptSubmit); exit 2 is a blocking error where the event can block, with stderr as the reason unless the JSON makes a blocking decision with its own; any other exit is a non-blocking error the operator sees as a `[HOOKS] <event>:<tool> hook error` notice with the first line of stderr, unless stdout is a valid JSON object, whose fields then decide. `continue: false` stops processing (the call is refused and the turn ends after the round; on Stop it lets the turn end), with `stopReason` shown to the operator. `systemMessage` is shown to the operator. Matching handlers run in parallel; an identical handler defined in more than one settings file runs once. Matchers: `*`, empty or none match everything; letters, digits, `_`, `-`, spaces, `,` and `|` only is an exact name or list of names; anything else is an unanchored regular expression.
478
603
 
479
- **Hook stdout parsing.** Native parses the documented Claude Code shape from each hook's stdout via `parseHookOutput` (`server/src/providers/claude-native/hooks.ts`). Tolerant: non-JSON stdout returns `{}`, malformed JSON returns `{}`, non-object top-level returns `{}` - never throws. Recognized fields:
604
+ `onFailure`: a failure (cannot start, exit other than 0 or 2, timeout, invalid JSON) lets the action go ahead unless `onFailure` is `"block"`, which then does what exit 2 does (no effect on Stop and SubagentStop). On Windows without Git Bash, a shell-form PreToolUse hook with `onFailure` unset also blocks on failure, as in Claude Code. `async: true` starts the hook in the background with no timeout; its `additionalContext` and `systemMessage` reach the model with the next request. `asyncRewake: true` also runs in the background (with its timeout); exit 2 wakes the model with its stderr (or stdout): during a turn with the next request, on an idle tab as a queued follow-up that starts a turn. Closing the tab or handing it off ends every background hook still running, with its child processes, and the worker waits until they have ended.
480
605
 
481
- - `hookSpecificOutput.updatedInput` (PreToolUse) - merged into the tool input via `{ ...input, ...updatedInput }` (last-write-wins across multiple hooks). Each rewrite emits a `hook_rewrote_input` event so transcript review can attribute the mutation back to its origin.
482
- - `hookSpecificOutput.additionalContext` (PostToolUse) - appended to the tool_result the model sees on the next turn.
483
- - `hookSpecificOutput.permissionDecision` - recognized but not yet acted on (today's PreToolUse-block behavior is exit-code-driven; permission decisions slot here for a future revision).
484
- - `decision: "block"` (PostToolUse) - synthesizes a `[PostToolUse hook blocked]` is_error tool_result and the model retries.
485
- - `reason` - surfaced in the synthetic tool_result for blocking decisions.
606
+ Hook input carries Claude Code's common fields plus Arco's `workflow_id`: `session_id` (the workflow id), `transcript_path` (the tab's event log, `<project>/.arco/workflows/<id>/events.jsonl`, JSON lines in Arco's own format, written in the background so it can lag the current turn), `cwd`, `permission_mode`, `hook_event_name`, and `tool_use_id` on tool events. File paths in `tool_input` (`file_path`, `notebook_path`) are absolute. During a Task child's first turn every hook also gets `agent_id` (the child's workflow id) and `agent_type`, and `session_id` and `transcript_path` name the parent. Not sent: `prompt_id`, `scratchpad_dir`, `effort`. Plugin placeholders are only rewritten in PowerShell commands.
486
607
 
487
- The parser is the load-bearing piece for using rtk (`rtk-ai/rtk`) on Native: drop rtk into `~/.claude/settings.json` once and Native + CLI both apply its tool_input rewrites. Without B0's parser, Native fired the hook but discarded the rewrite.
608
+ **`if`** (`hookIf.ts`): one permission rule per handler, as in Claude Code, read on tool events only; on any other event a handler with `if` never runs. `Bash(git *)` and `PowerShell(Remove-Item *)` check each subcommand (split on `&&`, `||`, `;`, `|`, `&` and newlines, plus the bodies of `$()`, backticks, subshells and loops; leading `VAR=value`, `timeout`, `nice`, `nohup` and similar wrappers and bare `xargs` are skipped; PowerShell aliases become the cmdlet and case is ignored). A pattern naming more than the program also matches a command holding `$()`, backticks or `$VAR`. `Edit(path)` covers Edit and Write, `Read(path)` covers Read, Grep and Glob, in gitignore syntax: `//` absolute, `~/` home, `/` the settings file's project (or `~/.claude` for user settings), else the project folder, with a bare name matching at any depth. Also `WebFetch(domain:host)`, `Agent(type)` or `Task(type)`, `mcp__server`, and `Tool(param:value)`. A command it cannot take apart (an unclosed quote, a here-document, a trailing operator) or a rule it cannot read runs the hook.
609
+
610
+ Command hooks follow Claude Code's exec form and shell form (`hookLaunch()` in `hooks.ts`):
611
+
612
+ - **Exec form** (`args` set): `command` is the program, resolved on `PATH`, started with `args` as its argument list and no shell, on every system. `${CLAUDE_PROJECT_DIR}` in `command` and in each argument is replaced by the project folder as plain text. On Windows `command` must be a real program such as `node.exe`; a `.cmd` or `.bat` file needs shell form. `shell` is ignored.
613
+ - **Shell form** (no `args`): the hook's `shell` field (`"bash"` or `"powershell"`) when set, else `commandShell()` (`server/src/commandShell.ts`): `/bin/sh -c` on Linux and macOS; Git Bash on Windows (`CLAUDE_CODE_GIT_BASH_PATH`, then the Git install of `git` on `PATH`, then the standard install folders; never the WSL `bash.exe` in the Windows system folder); PowerShell on Windows without Git Bash (`pwsh.exe`, then Windows PowerShell 5.1). PowerShell gets the command base64-encoded (`-EncodedCommand`, or a temporary `.ps1` when too long for a command line) with UTF-8 input and output, and `${CLAUDE_PROJECT_DIR}`, `${CLAUDE_PLUGIN_ROOT}` and `${CLAUDE_PLUGIN_DATA}` rewritten to `${env:NAME}`. `"shell": "powershell"` uses `pwsh` on Linux and macOS when it is installed.
614
+
615
+ A hook that runs in PowerShell only because Git Bash is missing carries `shellNotice`, and the worker emits it once as a `[HOOKS]` system notice (information). A hook that cannot start (no shell at all, the shell it asks for is missing, or a spawn error such as a missing program or working folder) carries `notRun`; unless that failure blocks (above), the action goes ahead and the worker emits one `[HOOKS]` notice per reason.
616
+
617
+ **The shell tool on Windows without Git Bash.** As in Claude Code, the model then gets a `PowerShell` tool instead of `Bash` (`shellToolName()`), so hooks matching `PowerShell` fire for it and `Bash` matchers do not. The other name is an unknown tool, refused before any hook. Every check keyed on Bash treats it the same (`isShellToolName()` in `shared/src/shellTool.ts`): the hardline floor (which also knows the PowerShell and cmd forms of its hazards), the review gate, tool postures, isolated members, the output filter, eviction, Fold and resume digests, the tool-call counter and the tool cards. The local-model Bash tool keeps its name.
618
+
619
+ Default hook timeout 600 s (30 s on UserPromptSubmit); per-hook `timeout` field overrides. Timed-out hooks get SIGTERM then SIGKILL after 2s grace; the output is discarded. On Windows `taskkill /T /F` ends the tree at once; with Git Bash the child also carries `ARCO_PROCESS_TREE` in its environment, and the kill first lists every MSYS process holding it through Git Bash's `/proc`, because a background job (`cmd &`) loses its Windows parent and `/T` alone misses it (`spawnShellChild()` and `signalChildTree()` in `server/src/workers/processKill.ts`, used by hooks, both Bash tools and sandbox shell scripts). Git Bash commands are passed in MSYS quoting on a verbatim command line, so backslashes (a JSON hook output with a Windows path) arrive unchanged. `CLAUDE_PROJECT_DIR=cfg.cwd` is set on the subprocess env; the per-event JSON payload is written to stdin. Inherited env minus any `ARCO_*` debug flags. Hook subprocesses register against the per-turn shell map so cancel + KillShell tear them down; background hooks end when the worker is disposed.
620
+
621
+ Reading `updatedInput` is the load-bearing piece for using rtk (`rtk-ai/rtk`) on Native: drop rtk into `~/.claude/settings.json` once and Native + CLI both apply its tool_input rewrites; each rewrite emits a `hook_rewrote_input` event so transcript review can attribute it.
488
622
 
489
623
  **Pre-tool-use guards.** `pretoolGuards.ts` runs after the PreToolUse hook fold and before `executeNativeTool`. Today: `checkConfigProtection` blocks `Edit`/`Write`/`MultiEdit` against lint/format/type-check config (`.eslintrc*`, `.prettierrc*`, `tsconfig.json`, `tsconfig.*.json`, `.editorconfig`, `.ruff.toml`, etc.) by basename match on the resolved absolute path. Returns a synthetic `[blocked by config-protection]` tool_result that nudges the model to fix the code instead of weakening the gate. Emits `tool_gate_triggered` with `gate: "config-protection"`. Default ON; per-tab CONFIG-tab toggle deferred.
490
624
 
491
- Three more deterministic floors run in the same dispatcher pre-flight (all static rules, no model judgment): **H17 hardline-command floor** (`detectHardlineCommand` / `checkHardlineCommand`) refuses a Bash command that would restart or kill the Arco service (`systemctl ... arco...`) or `rm -rf` the repo / cwd / `$HOME` / `/` / `*` - returns `[blocked by hardline-command-floor]`. It's a coarse always-on floor, not a sandbox: nothing the model does from a turn needs to restart Arco or wipe the repo. **H47 sensitive-path write floor** (`gateSensitiveWrite`, `tools.ts`) gates a `Write` / `Edit` whose resolved path is a `.env*` file or sits under a `.git` / `.ssh` segment behind an explicit operator allow via the AskUserQuestion machinery - fail-closed (refused outright when no approval channel is wired). **H62 partial-read→full-write warning** (`checkPartialReadFullWrite`) flags a full-file `Write` to a file only partially `Read` this turn, so the model doesn't clobber the untouched tail.
625
+ Three more deterministic floors run in the same dispatcher pre-flight (all static rules, no model judgment; their order is the `PRE_TOOL_GUARDS` list in `claude-native/toolChecks.ts`): **H17 hardline-command floor** (`detectHardlineCommand` / `checkHardlineCommand`) refuses a Bash command that would restart or kill the Arco service (`systemctl ... arco...`) or `rm -rf` the repo / cwd / `$HOME` / `/` / `*` - returns `[blocked by hardline-command-floor]`. It's a coarse always-on floor, not a sandbox: nothing the model does from a turn needs to restart Arco or wipe the repo. **H47 sensitive-path write floor** (`gateSensitiveWrite`, `tools.ts`) gates a `Write` / `Edit` whose resolved path is a `.env*` file or sits under a `.git` / `.ssh` segment behind an explicit operator allow via the AskUserQuestion machinery - fail-closed (refused outright when no approval channel is wired). **H62 partial-read→full-write warning** (`checkPartialReadFullWrite`) flags a full-file `Write` to a file only partially `Read` this turn, so the model doesn't clobber the untouched tail.
492
626
 
493
627
  **In-turn tool-loop guardrail.** `toolLoopGuard.ts` watches for the same `(tool, args)` repeating within one operator turn - the in-turn sibling of 3.1's cross-turn stuck-worker breaker. Default posture is warnings-only: a `tool_loop_warning` event + `system_notice`. The hard-stop (abort the loop) is opt-in via `ARCO_TOOL_LOOP_GUARD=stop`.
494
628
 
495
- **Tool-result filtering.** `filterToolResult.ts` is a pure-TS staged pipeline applied to a single tool_result before it enters `messages[]`. Plugged into `dispatchTool` between `executeNativeTool` and the PostToolUse hook fold so operator-curated hook stderr / `additionalContext` stays unfiltered. Stages, all optional per pack:
629
+ **Tool-result filtering.** `filterToolResult.ts` is a pure-TS staged pipeline applied to a single tool_result before it enters `messages[]`. Plugged into `dispatchTool` between `executeNativeToolResult` and the PostToolUse hook fold so operator-curated hook stderr / `additionalContext` stays unfiltered. Stages, all optional per pack:
496
630
 
497
631
  1. `strip_ansi` - removes CSI / OSC / single-byte ESC sequences.
498
632
  2. `replace[]` - `{ pattern: RegExp, replacement: string }[]` substitutions.
@@ -522,11 +656,39 @@ When the filter actually shrinks output, the worker writes the pre-filter raw by
522
656
 
523
657
  **Auto-compaction.** Provider uses Arco compaction near 90% for Claude Native and Ollama, reserving 10% headroom; Claude CLI and Codex retain their own behavior. Explicit per-worker and cluster policies win. Older Native `efficiencyAutoCompact` values migrate from conservative to On at 80%, aggressive to On at 70%, and off to Provider. Claude API compaction is an optional per-tab beta under ADVANCED, off for new tabs. When it is on, the Provider default does not start a second Native compaction.
524
658
 
525
- **Output style.** Operator-armed terseness picker on the CONFIG tab and New Workflow / Cluster creator. Three discrete levels - `normal` (default; no addendum), `lite` (drop fillers / hedging / pleasantries; keep grammar), `terse` (also drop articles, fragments OK, short synonyms; named `caveman` before 2026-05-10). `outputStyleAddendum(level)` (`server/src/providers/outputStyle.ts`) returns the provider prompt text. Claude Native appends it as a system block after existing project-context blocks, with `cache_control: ephemeral` so it participates in the prefix cache. Codex app-server folds the same addendum into its stable prompt prefix before the `---` separator. `normal` returns null and emits no extra block. Switching takes effect on the next turn. Claude CLI, Codex exec, local transports ignore it because Arco has no equivalent stable request-shaping point there. Each level's text leads with explicit "auto-clarity" rules (security warnings, irreversible operations, multi-step sequences -> full prose) and a verbatim-preserve list (code blocks, error strings, file paths, function names, API identifiers, command flags, regex patterns). Cuts *output* tokens, not input - measure via the `primary_turn_token_usage` event.
659
+ **In-turn auto-compaction (Claude Native).** A single long turn (hundreds of tool calls) can fill the window before the turn ends, and the between-turn policy never gets a turn boundary. Arco runs the Native request loop itself, so the worker also checks after each tool round: when the round's measured prompt size (see "Context size from usage" below; never the summed usage of a round that ran web search, web fetch or code execution) is at least the threshold of the model's context window, it compacts before the next request and continues the same turn. A round whose size cannot be measured is skipped, never compacted. The threshold is the tab's or cluster's AUTO-COMPACTION threshold when one is set, 70% under Provider; Off means off; with Claude API compaction (beta) on, Arco does not compact in the turn. The check runs at a clean boundary: every `tool_use` of the round has its `tool_result` and no request is in flight. The history before that round is summarized with the same summarizer and projection as COMPACT (recent user and assistant text kept verbatim through `projectKeptTail`); the round itself is kept raw (the assistant message with its thinking and `tool_use` blocks, and the user message with every `tool_result`), after a user note saying the compaction was automatic and to continue the task. The request that started the turn is always kept word for word: its text and attachment references are placed before the automatic note unless a kept-tail message already carries that text; a request over `KEPT_REQUEST_MAX_BYTES` (128,000 UTF-8 bytes) is never cut, the in-turn compaction is deferred for that turn and one notice says why; `native_compacted` persists it as `keptRequest` and replay rebuilds the same user text from it. The kept tail alone does not guarantee this: in a long turn it holds tool rounds, and when the model wrote no text between tool calls a later steer or mail message collapses the opening request out of the tail. If the summary request would not fit the window, the prefix is summarized in parts, oldest first. Every part stays within its estimated input budget, including the carried summary and any leading context note; a single message larger than a part is cut into consecutive slices, so nothing is dropped. At most one in-turn compaction runs per threshold crossing: if the next request is still at or above the threshold, one notice says so and Arco does not compact again until a request falls below it. A failed summary leaves the history unchanged, posts a notice and the turn continues. CANCEL during the summary ends the turn the usual way with the history unchanged. Cancellation is latched for the whole compaction, including between summary parts and before a new summary request; later parts are not started. A later explicit compaction starts a fresh operation. A steer that arrives meanwhile is delivered after the compacted history. Events: `native_compacting` and `native_compacted` carry `trigger: 'auto-in-turn'`, `percent` and `thresholdPercent`; `native_compacted` also carries `inTurn`, the `continueNote` (replay rebuilds it so the rest of the turn pairs with it) and, when `count_tokens` answers, `promptTokensAfter` with `contextWindow`, which refresh CTX at once. Chat shows `Compacting automatically (context N%)` and then `Compacted, continuing`; there is no takeover and no COMPACTED: CONTINUE. The compaction counts for auto-handoff like any other.
660
+
661
+ **Context size from usage (Claude Native).** A response that ran server tools (web search, web fetch, code execution) is sampled several times inside one request, and its top-level `usage` fields are the sum over those passes: right for billing, wrong as a prompt size. One research round with eleven passes of about 90k tokens reads as 97% of a 1M window while the real context is under 30%. `server/src/providers/claude-native/usageContext.ts` holds the rule every context decision uses: the last `message` entry of `usage.iterations` when the API sends it (its `input_tokens` plus cache read and cache creation); otherwise the top-level usage, but only for a round with no `server_tool_use` block or server tool result; otherwise no figure. The in-turn check measures an unmeasured round with `count_tokens` on the history as it stands and skips the decision when that fails. `count_tokens` leaves out the server-tool definitions (web search, web fetch, code execution: a few hundred tokens together, under 0.5% of any window), so the count sits marginally under the next request's size; the threshold is unaffected. The end-of-turn `lastPromptTokens` (which drives `context_usage`, `context_budget`, the between-turn auto-compaction and auto-handoff readings and the CTX meter) is `count_tokens` first and the single-pass usage second; a final round that ran server tools without `usage.iterations` and without a count reports no context figure for that turn rather than an inflated one. USAGE totals keep summing every pass; when `usage.iterations` lists a `compaction` pass, which the top-level fields leave out, the billed round is the sum over all entries. Displays follow the same rule: the CTX meter and the ACTIVITY session line show the measured context size or `-`, and Claude helper usage totals are not context readings; the worker context badge remains `-` until a separate measurement is available. Turn usage is never labelled as context. Anthropic's documentation states that `usage.iterations` is present when a compaction ran during the request; whether it is also sent for plain server-tool rounds is not documented, so the fallbacks above are the normal path and the console records which one measured a round.
662
+
663
+ Saved in-turn summaries also include the verbatim assistant narration of the retained round. The live worker keeps that round raw instead, so each representation retains the narration once. Rebuilt workers recover that text through the existing text-only replay; tool protocol blocks are not added to replay. The marker schema is unchanged.
664
+
665
+ **Auto-continue.** COMPACTION AUTO-CONTINUE applies only to automatic compactions between turns. The manual COMPACT button never sends a continue message; the composer offers COMPACTED: CONTINUE instead. An in-turn compaction needs no continue message, because the turn itself goes on.
666
+
667
+ **Output style.** A per-tab picker on the CONFIG tab, in the New workflow and cluster creator, and in the cluster member settings (ADD WORKERS, REPLACE). Three levels:
668
+
669
+ - `normal`: no addendum.
670
+ - `plain` (the default): full sentences with articles, short where possible (long ones are split, with no word limit), the answer first, one name per thing, no filler or hedging, and no repeating of earlier messages. The final reply of every turn is complete: what was done, what was checked and how, what was found with exact numbers, assumptions, risks, what is left with the next step, and anything that needs the operator.
671
+ - `terse`: full sentences with articles, at most about 20 words each, the answer first, no filler, hedging or recap, and one short line per tool phase with no chatter between routine calls.
672
+
673
+ Both addenda keep every negation (not, never, no, only, except), number and unit, keep code, commands, paths, identifiers and error text verbatim, and say that text which persists outside the chat (code, comments, commits, docs, plans, board tasks and comments, mail to other agents, skills, memory files) follows the project's conventions and is never compressed. Both also keep the operator's language (or the one asked for; quoted text never switches it), show a code change as the changed lines with one or two lines of context unless the whole file is asked for, new or mostly changed, and quote only the shortest decisive error line. During tool runs both ask for one short line per phase; Plain also asks for the reason when the approach changes. No saving is claimed: current models already answer concisely, so the levels are about readability.
674
+
675
+ `DEFAULT_OUTPUT_STYLE` (`shared/src/outputStyle.ts`) is the one default. A tab, member, preset or template with no saved style uses it; an explicit `normal` stays `normal`. A saved `lite` (before 0.1.5) reads as `plain` and `caveman` (before 2026-05-10) as `terse`, on every read path (`normalizeOutputStyle`). The default is stored as unset. `outputStyleAddendum(level)` (`server/src/providers/outputStyle.ts`) returns the fixed text; it is a constant, so the prompt prefix stays byte-identical from turn to turn. Switching takes effect on the next turn.
676
+
677
+ Where each provider puts it:
678
+
679
+ | Provider | Applied | How |
680
+ |---|---|---|
681
+ | Claude Native | yes | Last system block, after `appendSystemPrompt` and `systemPrompt`; a later change is an appended system message (append-only prefix). |
682
+ | Claude CLI | yes | End of `--append-system-prompt`, after the north star and the appended prompt. |
683
+ | Codex app-server | yes | End of the stable prompt prefix, before the `---` separator. |
684
+ | Codex exec | yes | End of the prompt prefix on stdin, before the `---` separator. |
685
+ | Cursor (ACP and print) | yes | End of the prompt prefix, after the north star, before the `---` separator. |
686
+ | Ollama, llama.cpp | yes | End of the system message; `/no_think` stays first on low effort. |
687
+ | LM Studio, Strata, DeepSeek | yes | End of the system message (the shared OpenAI-compatible worker). |
526
688
 
527
- **Adding a new level (e.g., a hypothetical `ultra`):** must pass operator sign-off + a plan-doc update first. The level's text MUST preserve code blocks / error strings / file paths verbatim and MUST NOT compress security warnings, irreversible operations, or order-sensitive multi-step sequences. The auto-clarity escape hatch in each level enforces this.
689
+ **Adding a level** needs the operator's decision first. Its text keeps the negation, number, verbatim and persisted-text rules above.
528
690
 
529
- **Output-style scope for primitives.** Review / Handoff seed / DOCS / GIT spawn paths force `outputStyle: 'normal'` regardless of the source tab's pick. Hard-coded at four sites: `runReviewer.ts` (reviewer WorkerConfig), `exportContext.ts` (CLI handoff path, Native handoff path, fresh-summarizer path), and `handleUserMessage` (overrides outputStyle when `UserMessage.primitive === 'docs' | 'git'`, set by the in-tab DOCS / GIT composer dialogs). DOCS / GIT new-tab spawn forces normal client-side via `spawnConfigFromRunAs`. Spawn-from-here DOES inherit - operator flips in the child tab if needed.
691
+ **Output-style scope for primitives.** Review / Handoff seed / DOCS / GIT spawn paths force `outputStyle: 'normal'` regardless of the source tab's pick. Hard-coded at: `runReviewer.ts` (reviewer WorkerConfig), `exportContext.ts` (CLI handoff path, Native handoff path, fresh-summarizer path), `runResearch.ts`, `runCompare.ts` and `compareHandlers.ts`, `runDocEdit.ts`, `runMdTuneup.ts`, `recall/summarize.ts`, `knowledge/distill.ts`, `genesisHandlers.ts`, and `handleUserMessage` (overrides outputStyle when `UserMessage.primitive === 'docs' | 'git'`, set by the in-tab DOCS / GIT composer dialogs, and on the first turn of a plan review). DOCS / GIT new-tab spawn forces normal client-side via `spawnConfigFromRunAs`. Any other worker spawned without a level gets no addendum: only a tab's own turns resolve the default (`resolveTurnSettings`). Spawn-from-here and Task children DO inherit the tab's level - operator flips in the child tab if needed. `outputStyle.test.ts` checks the hard-coded sites.
530
692
 
531
693
  #### Review safe-mode - edit-before-approve gate (DEBAG)
532
694
 
@@ -540,7 +702,7 @@ Native sessions are Arco-internal - there's no `~/.claude/projects/<sid>.jsonl`
540
702
 
541
703
  On `ensureStarted`, if the workflow's `events.jsonl` has prior `user_message_echo` + `primary_text` entries, the worker reconstructs `this.messages` from them so a server restart picks up where it left off (replay-only - periodic snapshot deferred per 14 Q7). The reconstructed shape is logged to stderr under `[claude-native:<wfid>]` for forensic comparison; tool_use / tool_result events are not replayed (the next turn sees a clean USER/ASSISTANT history).
542
704
 
543
- **Restore points / forks (Native-first).** A `revert_to_point_request` (HistoryTab "REWIND CONVERSATION" action) makes the server append a `leaf_move` event and set `meta.leafSeq`; a branch-aware replay pre-pass (`filterEventsToBranch` in `resumeSummary.ts`, driven by `replayMessagesWithResumePolicy`) then reconstructs `messages` along the active leaf only (absent `leafSeq` ⇒ byte-identical to the old linear replay). The rewind is reversible - "undo the undo" is just another `leaf_move`. Native-first; rejected on CLI / Codex. `branch_summary` is RESERVED and unemitted - forks ship via `leaf_move`, not `branch_summary`. This is the active-branch behavior used when resuming the conversation.
705
+ **Restore points / forks (Native-first).** A `revert_to_point_request` (HistoryTab "REWIND CONVERSATION" action) makes the server append a `leaf_move` event and set `meta.leafSeq`; a branch-aware replay pre-pass (`filterEventsToBranch` in `resumeSummary.ts`, driven by `replayMessagesWithResumePolicy`) then reconstructs `messages` along the active leaf only (absent `leafSeq` ⇒ byte-identical to the old linear replay). The rewind is reversible - "undo the undo" is just another `leaf_move`. Native-first: the button stays visible for every provider, disabled with the reason beside it when the worker is not Claude Native, and the server refuses those requests. `branch_summary` is RESERVED and unemitted - forks ship via `leaf_move`, not `branch_summary`. This is the active-branch behavior used when resuming the conversation.
544
706
 
545
707
  #### Context management
546
708
 
@@ -551,7 +713,7 @@ Anthropic's `/v1/models` exposes three context-management capabilities. Arco kee
551
713
  | `clear_thinking` (strip stale thinking blocks server-side) | off | none today; keep off unless an explicit operator surface is added |
552
714
  | `clear_tool_uses` (strip stale tool i/o server-side) | off | none today; keep off unless an explicit operator surface is added |
553
715
  | `compact_20260112` (server-managed summarization at threshold) | off for Native | CONFIG > ADVANCED "Claude API compaction (beta)" toggle (`WorkflowConfig.claudeNativeCompact`; explicit `true` enables) |
554
- | Auto-handoff (Arco rotates to fresh session at threshold) | opt-in (default `false` for new Claude tabs) | CONFIG-tab "AUTO-HANDOFF" toggle (`WorkflowConfig.autoHandoff.enabled`) |
716
+ | Auto-handoff (Arco starts a fresh session after N compactions, default 5) | opt-in (default `false` for new tabs) | CONFIG-tab "AUTO-HANDOFF" Hand off after N compactions (`WorkflowConfig.autoHandoff.enabled`, `afterCompactions`) |
555
717
 
556
718
  `clear_thinking` and `clear_tool_uses` ship behind `anthropic-beta: context-management-2025-06-27` if they are ever used, but Native deliberately does not send that beta or those edits by default. The 2026-05-31 Opus 4.8 A/B test showed that `clear_tool_uses` can replace live web-search evidence with `Search result was cleared`, causing repeated searches and stale-source answers. Compact rides on `compact-2026-01-12` and is emitted only when the operator has explicitly enabled the per-tab toggle and the active model's cached `/v1/models` catalog entry advertises `compact_20260112`. An unrecognized model conservatively skips all betas rather than risk a 400. Compaction is `{ type: 'compact_20260112' }` in `context_management.edits`, not a sibling `context_management.compact` object. Per-request beta-header override is set on the SDK call so a live model swap mid-tab re-evaluates capabilities cleanly. The `Claude API compaction (beta)` toggle is only rendered when `transport === 'native'` and the active model's catalog entry has `compact_20260112: { supported: true }`; missing `WorkflowConfig.claudeNativeCompact` means disabled, and explicit `true` is the durable enable.
557
719
 
@@ -559,10 +721,10 @@ Anthropic's `/v1/models` exposes three context-management capabilities. Arco kee
559
721
 
560
722
  Distinct from the Anthropic server-side edits above - these are Arco-owned, deterministic, and run in-process:
561
723
 
562
- - **Token-budget meter (2.3).** `contextBudget.ts` emits a `context_budget` event (`{ usedTokens, effectiveWindow, pct, thresholds: { warnAt, autoAt, foldAt? } }`) each turn - `pct` is measured against the *effective* window (raw window minus reserved output tokens), so it's the signal the Fold / auto-fold and warn gates read rather than the raw-window `context_usage` that drives the CTX bar. Transient (derived from persisted `lastPromptTokens`), not persisted itself.
563
- - **Fold + auto-fold (2.1).** A deterministic in-place transcript trim (`foldDigest.ts`) - keeps recent turns verbatim and digests the older middle, no LLM call. Manual via the composer FOLD button (`fold_workflow` WS message); armed per-tab via the CONFIG `autoFold` toggle - an `autoFold { enabled, foldAt }` field on the per-tab config-update message (default OFF; `foldAt` is the budget-meter pct that triggers the in-place Fold, below `autoHandoff.warnAt`; persists to `meta.json` + `WorkflowConfig.autoFold`). Emits `context_folded`. Cheaper than Handoff or compact - same worker, no summarizer round-trip, no fresh spawn.
724
+ - **Token-budget meter (2.3).** `contextBudget.ts` emits a `context_budget` event (`{ usedTokens, effectiveWindow, pct, thresholds: { foldAt? }, crossed: { fold } }`) each turn - `pct` is measured against the *effective* window (raw window minus reserved output tokens), so it's the signal the Fold / auto-fold gate reads rather than the raw-window `context_usage` that drives the CTX bar. Transient (derived from persisted `lastPromptTokens`), not persisted itself.
725
+ - **Fold + auto-fold (2.1).** A deterministic in-place transcript trim (`foldDigest.ts`) - keeps recent turns verbatim and digests the older middle, no LLM call. Manual via the composer FOLD button (`fold_workflow` WS message); armed per-tab via the CONFIG `autoFold` toggle - an `autoFold { enabled, foldAt }` field on the per-tab config-update message (default OFF; `foldAt` is **FOLD AT**, the budget-meter pct that triggers the in-place Fold; persists to `meta.json` + `WorkflowConfig.autoFold`). A Fold is not counted toward auto-handoff. Emits `context_folded`. Cheaper than Handoff or compact - same worker, no summarizer round-trip, no fresh spawn.
564
726
  - **Tool-result eviction (2.2).** `toolResultEviction.ts` is the aggregate largest-first spill that fires only when a batch of tool results' summed cost exceeds the turn budget; the raw output is gzipped to a workspace-relative `rawArtifactPath` (same convention as `tool_filtered`, fully reversible) and a `tool_evicted` event (`{ toolUseId, toolName, originalBytes, filteredBytes, rawArtifactPath }`) records what was spilled.
565
- - **Retained-history server-tool prune (`retainedContext.ts`).** After a settled turn, `pruneServerToolEvidenceAfterTurn` drops that turn's `server_tool_use` / `*_tool_result` / citation blocks (the final answer already absorbed the findings) - thinking is always kept, and the whole prune is skipped on binding-enforcing models (`enforcesPreservedThinking()`: `fable-5-1` / `mythos-5-1` / `opus-5-5`). Two pairing invariants make it safe, and breaking either one wedges the tab permanently with a 400 that every later request replays: it never edits the **latest assistant message**, and it keeps any `server_tool_use` whose result lives *in* that protected message (the `pause_turn` shape, where call and result straddle two assistant messages). `stripDanglingServerToolResults` runs at the top of each turn as the mirror of `pruneOrphanToolUse` - one detector per direction. Both failure shapes and the exact 400 wordings: [Gotchas: Claude Native transport](GOTCHAS.md#claude-native-transport).
727
+ - **Retained-history server-tool prune (`retainedContext.ts`).** After a settled turn, `pruneServerToolEvidenceAfterTurn` drops that turn's `server_tool_use` / `*_tool_result` / citation blocks (the final answer already absorbed the findings) - thinking is always kept, and the whole prune is skipped on binding-enforcing models (`enforcesPreservedThinking()`: `fable-5-2` / `fable-5-1` / `mythos-5-2` / `mythos-5-1` / `opus-5-5`). Two pairing invariants make it safe, and breaking either one wedges the tab permanently with a 400 that every later request replays: it never edits the **latest assistant message**, and it keeps any `server_tool_use` whose result lives *in* that protected message (the `pause_turn` shape, where call and result straddle two assistant messages). `stripDanglingServerToolResults` runs at the top of each turn as the mirror of `pruneOrphanToolUse` - one detector per direction. Both failure shapes and the exact 400 wordings: [Gotchas: Claude Native transport](GOTCHAS.md#claude-native-transport).
566
728
  - **Workspace facts.** `workspaceFacts.ts` auto-detects the project's ecosystem / package manager / verify commands / git branch once at session start and folds a short `--- Workspace facts ---` block into the system prompt (omitted entirely when nothing is detected ⇒ zero input-token cost), so the model and any verify-loop agree on the single "did I break it?" command.
567
729
  - **Aggregate `@`-ref budget gate.** Beyond the per-ref 64 KB cap, `contextRefs.ts` tracks the aggregate of all `@`-file expansions in one message: soft-warn past ~25% of the model's window, hard-refuse any ref that would push the aggregate past ~50% (with a clear "drop a ref or send fewer files" reason) so a big paste can't silently crowd out the operator's instruction.
568
730
 
@@ -570,7 +732,7 @@ Distinct from the Anthropic server-side edits above - these are Arco-owned, dete
570
732
 
571
733
  `server/src/catalog.ts` polls `https://api.anthropic.com/v1/models` (using the worker's OAuth tokens + standard wire fingerprint), distills the wire shape to the picker's camelCase form via `distillCatalogModel()`, and caches the result for one hour (`REFRESH_INTERVAL_MS = 60 * 60 * 1000`). Refresh is lazy - the next request after expiry triggers it; `?force=1` on `GET /api/claude-native/catalog` bypasses the cache. Capability flags (`clearThinking`, `clearToolUses`, `compact`) are derived from the catalog entry's `supportedFeatures`, but only `compact` is consumed by the worker by default. The CONFIG-tab model picker uses `compact` to gate the CONFIG > ADVANCED Claude API compaction (beta) toggle, and `getCachedModelCapabilities(modelId)` is called per Native request to decide whether to send `compact-2026-01-12` + `{ type: 'compact_20260112' }`. Cold-start, fetch failure, or an unrecognized id (operator typo, picker out of sync) all return `null` and the worker conservatively skips the beta - the `[claude-native:<wfid>] → messages.create ... ctx_mgmt=compact` log line shows what actually went out. Static fallbacks still need to be updated when a new family ships: `supportsClaudeAdaptiveThinking()` / `CLAUDE_MODEL_EFFORTS` control effort semantics, `adaptiveMaxTokensForModel()` controls output cap, and `contextEstimator.ts` controls the CTX denominator before the live catalog can help.
572
734
 
573
- Compact + auto-handoff coexist; both can be on (two safety nets), either can be off, or both off (operator drives Handoff manually). See plan-doc 15 for the full combination matrix and the resolved beta-header strings.
735
+ Compaction handles context fill; auto-handoff counts compactions (`native_compacted`, automatic and COMPACT) and starts a fresh session after N of them in one conversation. On Claude Native it needs Arco's auto-compaction on; Claude API compaction (`compact_20260112`) is not counted. See plan-doc 15 for the full combination matrix and the resolved beta-header strings.
574
736
 
575
737
  #### Operator in-place compact (`⊟ COMPACT` / `native_compacted`)
576
738
 
@@ -680,11 +842,15 @@ Default `unicode61` tokenizer (no stopwords - 'added' / 'fix' / 'the' all retain
680
842
 
681
843
  ## Codex
682
844
 
845
+ App-server ignores a late turn/start acknowledgement after that turn has ended. Generated images finish saving and emit their artifact and terminal tool status before the turn settles. Enabled registry servers are passed to app-server as well as exec; changing a launch definition recycles the app-server child before its next turn.
846
+
847
+ Context-window and code-mode metadata use the selected account home first, then `CODEX_HOME`, then the CLI default home. MAX therefore reads the same account metadata as the spawned CLI. Concurrent Native, Codex and Cursor catalog refreshes share the complete fallback result: unavailable catalogs return their last snapshot or an empty result for the normal picker fallback.
848
+
683
849
  Two transports ship side-by-side, selected per-tab via `codex.transport`. New Arco homes use `appserver`; the home and project settings cascade can select either transport, and a per-tab choice takes precedence. Existing cascade and per-tab choices remain unchanged. Per-tab override lives on `WorkflowConfig.codexTransport` and is editable from the CONFIG tab without a server restart.
684
850
 
685
851
  Reviewers and handoff seed turns always run on `exec` regardless of the tab's transport - the per-workflow appserver child is too heavy for one-shot reviewer paths and there's no reviewer feature that benefits from mid-turn steer.
686
852
 
687
- The Codex CONFIG tab is sparse next to Claude Native by design, not omission. The Native-only efficiency knobs (Claude API compaction (beta) under CONFIG > ADVANCED, interleaved-thinking beta, tool-result filter, fact-force first edit, sandbox tools) all reach *inside* the in-process Anthropic request - request body, `anthropic-beta` headers, the `tools[]` array, or per-tool dispatch. Codex runs as an external subprocess, so Arco can't mutate those internals and the controls have nowhere to attach. **Output style is the exception on `appserver`:** Arco owns the per-turn `turn/start` input and folds the same style addendum into the stable prompt prefix. Codex `exec` still ignores it. What Codex *does* surface besides output style - codebase-index/memory + MCP servers - are the things you configure *around* a subprocess rather than inside its request. See [Gotchas: Efficiency behavior](GOTCHAS.md#efficiency-behavior) for the fact-force-specific analysis (notably why the `appserver` approval bindings don't give a usable pre-execution gate today).
853
+ The Codex CONFIG tab is sparse next to Claude Native by design, not omission. The Native-only efficiency knobs (Claude API compaction (beta) under CONFIG > ADVANCED, interleaved-thinking beta, tool-result filter, fact-force first edit, sandbox tools) all reach *inside* the in-process Anthropic request - request body, `anthropic-beta` headers, the `tools[]` array, or per-tool dispatch. Codex runs as an external subprocess, so Arco can't mutate those internals and the controls have nowhere to attach. **Output style is the exception:** Arco owns the prompt prefix on both transports (`turn/start` input on `appserver`, stdin on `exec`) and folds the style addendum into it. What Codex *does* surface besides output style - codebase-index/memory + MCP servers - are the things you configure *around* a subprocess rather than inside its request. See [Gotchas: Efficiency behavior](GOTCHAS.md#efficiency-behavior) for the fact-force-specific analysis (notably why the `appserver` approval bindings don't give a usable pre-execution gate today).
688
854
 
689
855
  ### `exec` transport
690
856
 
@@ -782,6 +948,12 @@ API-key fallback: `OPENAI_API_KEY` env var.
782
948
 
783
949
  ### `app-server` transport
784
950
 
951
+ A status update for an existing tool call updates its original Activity card
952
+ without splitting an assistant reply that is still streaming. New tool calls
953
+ still separate reply segments. The same ordering applies after reload or event
954
+ replay; tool cards keep their starting position when they complete or fail.
955
+ Cursor reasoning, Cursor tool updates and operator steering still separate reply segments. Cursor keeps those boundaries after reconnect while the tool card stays in its original position.
956
+
785
957
  Settled app-server results now carry the last token-usage notification's
786
958
  `lastPromptTokens` for ordinary workers as well as Incognito. Computer scripts
787
959
  read that final-request prompt and the reported window directly for context
@@ -804,9 +976,9 @@ before announcing the boundary; the next request uses `thread/start` with no
804
976
  summary or old transcript. KEEP CONTEXT/OFF pause automatic resets. This is
805
977
  separate from Codex compaction, which remains the fallback within a long turn.
806
978
 
807
- The child is long-lived, but `WorkerConfig` is per-turn. The per-turn wrapper refreshes the cached worker with the current config before `ensureStarted()` / `beginTurn()`, then `beginTurn()` converts image attachments into `localImage` input items and folds non-images into `[attached file: <path>]` lines in the trailing text item. This is what makes images attached to a cluster member/broadcast arrive in Codex app-server as actual image inputs instead of merely persisting on the Arco chat echo.
979
+ The child is long-lived, but `WorkerConfig` is per-turn. The per-turn wrapper refreshes the cached worker with the current config before `ensureStarted()` / `beginTurn()`, then `beginTurn()` converts fitted images into `localImage` input items. Documents and notebooks provide decoded text alongside `[attached file: <path>]` labels; other binaries provide a note. This is what makes images attached to a cluster member/broadcast arrive in Codex app-server as actual image inputs instead of merely persisting on the Arco chat echo.
808
980
 
809
- Arco passes a minimal thread config override on both `thread/start` and `thread/resume`: `web_search: "live"` (Chat tabs send `"live"` or `"disabled"` per the web toggle). This mirrors the native Codex CLI expectation that web search is available when the model chooses to look online, without changing approvals, sandboxing, model, profile, or MCP wiring. Do not set `tools.web_search` from the vendored 0.128 bindings without revalidating against the installed Codex CLI; Codex 0.131 rejects the stale generated shape during thread bootstrap.
981
+ Arco passes a minimal thread config override on both `thread/start` and `thread/resume`: `web_search: "live"` (Chat tabs send `"live"` or `"disabled"` per the web toggle). Exec and exec resume explicitly send the same search policy: Agent tabs use live search; Chat follows its web toggle. This makes web search available when the model chooses to look online, without changing approvals, sandboxing, model, profile, or MCP wiring. Do not set `tools.web_search` from the vendored 0.128 bindings without revalidating against the installed Codex CLI; Codex 0.131 rejects the stale generated shape during thread bootstrap.
810
982
 
811
983
  Reviewers and handoff seed turns always run on `exec` regardless of the tab's transport. The dispatcher branch in `server/src/providers/index.ts` only takes the appserver path when `config.codexTransport === 'appserver'`; reviewer / seed paths leave that field unset.
812
984
 
@@ -821,7 +993,7 @@ Implemented in `jsonRpc.ts`. Message names locked in vendored bindings - methods
821
993
 
822
994
  #### Mid-turn steer
823
995
 
824
- The `WorkerConfig.drainSteer` callback fires on every `item/completed` notification while a turn is in flight (any item type - `commandExecution`, `fileChange`, `mcpToolCall`, etc.). When the bucket is non-empty, the worker sends `turn/steer` with `expectedTurnId: currentTurnId` and a single text-folded `UserInput`. Codex's protocol enforces the precondition - if the turn ended in the round-trip window the steer fails loudly rather than landing in the next turn.
996
+ The `WorkerConfig.drainSteer` callback fires on every `item/completed` notification while a turn is in flight (any item type - `commandExecution`, `fileChange`, `mcpToolCall`, etc.). When the bucket is non-empty, the worker sends `turn/steer` with `expectedTurnId: currentTurnId` and text plus any fitted `localImage` input items. Codex's protocol enforces the precondition - if the turn ended in the round-trip window the steer fails loudly rather than landing in the next turn.
825
997
 
826
998
  The drain is destructive (server-side `splice(0)`); the worker re-enqueues on three failure shapes via the new `WorkerConfig.requeueSteer` hook:
827
999
 
@@ -829,9 +1001,9 @@ The drain is destructive (server-side `splice(0)`); the worker re-enqueues on th
829
1001
  - Mismatched `expectedTurnId` (turn ended) → re-enqueue as **follow-up**. The post-turn merge path picks them up.
830
1002
  - Other RPC / transport errors → re-enqueue as **follow-up** *plus* a `system_notice` so the operator sees the slip.
831
1003
 
832
- Re-broadcasts `queue_update` after the re-enqueue (the original drain emitted a snapshot showing the bucket empty). The originator's optimistic chat row stays cleared from the prior `queued_messages_drained`; the queue strip is the source of truth for "items waiting" until the next drain succeeds.
1004
+ Re-broadcasts `queue_update` after the re-enqueue (the original drain emitted a snapshot showing the bucket empty). The originator's optimistic chat row stays cleared from the prior `queued_messages_drained`; PENDING is the source of truth for "items waiting" until the next drain succeeds.
833
1005
 
834
- Steer attachments fold to `[attached file: <path>]` text references (parity with Ollama / llama.cpp - mid-turn image re-encoding deferred until a real ask).
1006
+ Steer attachments use the same decoder as initial attachments: fitted images become `localImage` items, documents and notebooks provide text, and other binaries provide a note. Agent path labels and Chat name labels identify attachments. Local providers likewise prepare steering attachments and check vision support before sending images.
835
1007
 
836
1008
  #### Cancel
837
1009
 
@@ -906,7 +1078,7 @@ Operator's `~/.codex/config.toml` is left untouched - `-c` overrides only set th
906
1078
 
907
1079
  ### Registry MCP
908
1080
 
909
- Both Codex transports also register the operator-curated **MCP registry** servers a tab has enabled, via the same `-c mcp_servers.<key>.*` override form (`buildCodexMcpOverrides` extends to `McpConfigOptions.registryServers`; `env` rides through as a TOML inline table). **Known gap - Codex has NO per-tool allow/deny flag** ("No equivalent to Claude's `--tools` allow-list"), so enabling a server on a Codex tab exposes **all** of that server's tools. The dangerous-tool denylist is therefore **not enforceable on Codex** - Arco surfaces this honestly in the MCP CONFIG section (gap banner + per-tool "(not gated on Codex)" labels) rather than faking enforcement. Server-level enable/disable IS honored. Full detail: `docs/MCP_REGISTRY.md`.
1081
+ Both Codex transports register enabled MCP registry servers through `-c mcp_servers.<key>.*` overrides. Codex 0.167 and later receive `disabled_tools` for explicitly disabled tools and cached dangerous tools that were not ticked. Older or unknown versions keep server-level wiring and show a per-tool enforcement warning in CONFIG. Registry denylist changes recycle app-server before the next turn. See `docs/MCP_REGISTRY.md` for probe and compatibility limits.
910
1082
 
911
1083
  #### `exec` lifecycle
912
1084
 
@@ -914,9 +1086,9 @@ Per-turn - symmetric with Claude CLI. `codex.ts buildArgs()` appends the two `-c
914
1086
 
915
1087
  #### `app-server` lifecycle
916
1088
 
917
- Per-appserver-process - the MCP child lives for the full lifetime of the long-lived `codex app-server` child, NOT per-turn. Asymmetric with `exec` and Claude CLI. `CodexAppServerWorker.ensureStarted()` injects the `-c` overrides into the `codex app-server` argv at bootstrap; `bootstrappedClusterId` records what cluster the appserver was bound to.
1089
+ Per-appserver-process - the MCP child lives for the full lifetime of the long-lived `codex app-server` child, NOT per-turn. Asymmetric with `exec` and Claude CLI. `CodexAppServerWorker.ensureStarted()` injects the `-c` overrides into the `codex app-server` argv at bootstrap; `currentMcpSignature` records the bootstrap context (cluster id, board attachment, codebase-memory index, account, Codex home, access mode, role, model, context policy and tool surface).
918
1090
 
919
- When the operator joins / detaches a workflow from a cluster mid-conversation, the cached worker's `currentClusterId` no longer matches `config.clusterId` on the next turn. The dispatcher (`codex-appserver/index.ts acquireWorker`) detects the mismatch, disposes the cached worker, and re-bootstraps with (or without) the MCP child wired in. Codex thread state survives via `thread/resume`, so the conversation continues unbroken - only the MCP wiring flips.
1091
+ When the operator joins / detaches a workflow from a cluster mid-conversation, or another part of that context changes, the cached worker's `currentMcpSignature` no longer matches the signature computed from the next turn's config (`computeMcpSignature`). The dispatcher (`codex-appserver/index.ts acquireWorker`) detects the mismatch, retires the cached worker, and re-bootstraps with (or without) the MCP child wired in. Codex thread state survives via `thread/resume`, so the conversation continues unbroken - only the MCP wiring flips.
920
1092
 
921
1093
  Per-turn injection (plan + role + mailbox prologue) flows through `beginTurn(prompt, appendSystemPrompt)` and lands in the `UserInput[]` payload's trailing text element. Same `${appendSystemPrompt}\n\n---\n\n${prompt}` shape as `exec`. App-server has a separate bounded 48 KB cluster fold because JSON-RPC stdin has no argv ceiling; this admits the full 32 KB maximum plan plus the small cluster blocks. The 16 KB cap remains on CLI transports. Repeating a large plan consumes thread context, so 48 KB remains a ceiling rather than becoming unlimited.
922
1094
 
@@ -968,6 +1140,8 @@ against isolated Vite with all API/WebSocket traffic stubbed.
968
1140
 
969
1141
  ## Cursor
970
1142
 
1143
+ ACP and print output decode UTF-8 across pipe chunks, preserving multibyte text and filenames. Cancelling native compression finishes its cancellation wait when compression settles; its fallback timer cannot kill a later turn.
1144
+
971
1145
  `server/src/providers/cursor/` - a long-lived per-workflow ACP worker (`worker.ts`) driving
972
1146
  `cursor-agent acp` over JSON-RPC (`acpJsonRpc.ts`), a per-turn wrapper + worker cache (`index.ts`),
973
1147
  a `cursor-agent models` catalog (`catalog.ts`), and a stateless `cursor-agent -p --mode ask` one-shot
@@ -989,8 +1163,44 @@ ACP error. `CursorAcpTurn` narrowly recognizes that exact response, withholds on
989
1163
  prefix from the normal stream, emits `[AUTH:cursor]` for the shared inline re-login UI, and disposes the
990
1164
  cached worker. After the operator completes login and resends, `acquireWorker` starts the current CLI
991
1165
  with the current credentials and attempts the normal `session/load` resume. Any longer answer that only
992
- mentions signing in falls through as normal assistant text. `POST /api/auth-login?provider=cursor`
993
- opens a terminal running `cursor-agent login`.
1166
+ mentions signing in falls through as normal assistant text.
1167
+
1168
+ Connections > Cursor runs `cursor-agent login` inside Arco (`authLoginSession.ts`, with
1169
+ `NO_OPEN_BROWSER=1`) and shows the link it prints; the CLI finishes on its own once the page confirms.
1170
+ `POST /api/auth-login?provider=cursor` still returns the terminal command as a fallback.
1171
+
1172
+ A readable token is not proof of a working sign-in. `providers/cursor/authState.ts` remembers the last
1173
+ rejection (`Authentication required` from `session/new`, the sign-in reply above, a `401` from the usage
1174
+ API, or an authentication error from the catalog refresh) with a fingerprint of the token it was seen
1175
+ with. While that token is unchanged, the Cursor status reads not signed in with `signInRejected` and
1176
+ Connections offers Sign in again; a new token (a fresh login) clears it. Status polls make no network
1177
+ call; the explicit Connections check also runs `cursor-agent status` once.
1178
+
1179
+ Sign-in failures never count toward the start-failure breaker in `index.ts` (three failed starts in a
1180
+ row stop a tab from retrying until HANDOFF): they show the `[AUTH:cursor]` sign-in notice instead, so
1181
+ signing in again and resending is enough. A start that fails also ends its `cursor-agent acp` child.
1182
+
1183
+ ### Model selection
1184
+
1185
+ `cursor-agent acp` ignores `--model`: every `session/new` reports `currentModelId: "default[]"`,
1186
+ whatever was passed (captured in `providers/cursor/fixtures/acp-models.json`). ACP advertises one id
1187
+ per model, carrying the settings saved for that model in the Cursor CLI, for example
1188
+ `grok-4.7[context=256k,reasoning_effort=high,fast=true]`, and `session/set_model` and
1189
+ `session/set_config_option` accept only those ids. The catalog that Arco's picker shows lists every
1190
+ variant separately (`grok-4.7-medium`, `grok-4.7-high-fast`).
1191
+
1192
+ After every `session/new` and `session/load`, and whenever the CONFIG model changes, the worker maps
1193
+ the catalog id to the advertised id by model name, effort, fast and thinking (`modelMap.ts`), selects
1194
+ it with `session/set_config_option` (or `session/set_model` on a CLI without it) and checks the
1195
+ returned `currentValue`. When the advertised id carries other settings than the chosen variant, the
1196
+ session runs that variant and a notice names both models and how to change the saved setting (choose
1197
+ the variant once in the Cursor CLI with `/model`, then HANDOFF). A model Cursor does not offer, a
1198
+ refused or an unconfirmed switch also produce a notice naming the model the session runs on. The model
1199
+ chip shows the effective model. Selecting a model over ACP also saves it as the Cursor CLI's default
1200
+ model. The print transport passes the catalog id with `--model`, `auto` included, so a chat on Auto
1201
+ does not run the CLI's saved default. The Smart AUTO-PICKUP Cursor evaluator selects and confirms the
1202
+ exact model the same way and refuses (`startup_model_unavailable`, `startup_model_unconfirmed`)
1203
+ otherwise.
994
1204
 
995
1205
  ### Usage
996
1206
 
@@ -1010,6 +1220,8 @@ usage nor the standard `usage_update { used, size }` notification, even though t
1010
1220
  those optional shapes. Dashboard events are billing totals across internal calls, not a retained
1011
1221
  prompt snapshot, so they are not a valid substitute for context fill.
1012
1222
 
1223
+ Incomplete Cursor usage pages never appear as complete monthly totals. A page cap or an early end before the reported event count makes the snapshot unavailable with an incomplete-usage message and a dashboard link.
1224
+
1013
1225
  ### Context compression
1014
1226
 
1015
1227
  Cursor automatically summarizes older history as its context fills. Arco also exposes an idle-only
@@ -1021,7 +1233,7 @@ an ordinary model prompt instead of a slash command. `available_commands_update`
1021
1233
  active turn; when Cursor has supplied an authoritative snapshot, Arco refuses rather than guessing
1022
1234
  if `compress` is absent. The underlying Cursor session persists the summary. Arco records the action
1023
1235
  through the existing `ctx_action` + system-notice compact path; Handoff remains the clean-session escape
1024
- hatch. Cursor still has no Arco auto-handoff threshold because ACP supplies no trusted fill signal.
1236
+ hatch. Cursor has no Arco auto-handoff: ACP does not report Cursor's own compressions, so Arco cannot count them.
1025
1237
 
1026
1238
  **Included-allocation gauge.** `cursorUsage.ts` also GETs `/api/usage-summary` (the endpoint the Spending
1027
1239
  page calls) → `CursorIncludedUsage` (`used`/`limit`/`remaining` cents, `totalPercentUsed` /
@@ -1114,15 +1326,26 @@ listener down).
1114
1326
 
1115
1327
  ## Ollama
1116
1328
 
1329
+ Stateless local replay keeps the brief and later exchanges after a completed handoff, without reintroducing the archived prefix. Failed or cancelled handoffs preserve earlier context. Messages containing literal USER or AGENT role labels use a tagged JSON-string representation internally so those lines, their whitespace and their backslashes stay inside the original message. Existing plain rendered transcripts remain readable.
1330
+
1117
1331
  `server/src/providers/ollama.ts` + `server/src/providers/ollamaTools.ts`. Pure HTTP, no subprocess.
1118
1332
 
1119
1333
  > **Operator health readout.** The System modal's **Models** tab (A3 - `docs/DIAGNOSTICS.md` Local model health panel) surfaces the resolved base URL, reachability, installed-model count + names, and the daemon version for Ollama, reusing `probeOllama()` / `getOllamaBase()`. Read-only, operator-triggered.
1120
1334
 
1121
1335
  ### Spawn
1122
1336
 
1123
- `fetch(\`${OLLAMA_URL_BASE}/api/chat\`, { method: 'POST', body: JSON.stringify({ model, messages, stream: true, keep_alive: '10m', tools }) })`. No subprocess; the response is an NDJSON stream. Image attachments ride the final user message's `images` field (base64, 5 MB each; vision-capable models only); non-images fold as `[attached file: <path>]`.
1337
+ `fetch(\`${OLLAMA_URL_BASE}/api/chat\`, { method: 'POST', body: JSON.stringify({ model, messages, stream: true, keep_alive: '10m', tools }) })`. No subprocess; the response is an NDJSON stream. Fitted image attachments ride the final user message's `images` field when the model reports vision support; otherwise the message contains an image note. Documents and notebooks provide decoded text with source-path labels in Agent tabs and name labels in Chat, while other binaries provide a note.
1124
1338
 
1125
- **Image downscaling (all providers).** Every image upload gets a background-derived sibling `<path>.model.<ext>` (≤2000px long edge, ≤3.75 MB raw, JPEG q85 fallback; ImageMagick `magick`/`convert`, macOS `sips`) in `providers/attachments.ts`. Models receive that copy: `modelImagePath` (sync - Claude CLI, Native `buildImageBlock`, Codex exec `-i`) or `awaitModelImage` (≤5 s - Codex app-server `localImage`, Cursor ACP, Ollama, llama.cpp, LM Studio staging); `turnEngine` also awaits before spawning so a send right after a paste gets the copy. Media type follows the derived file; text refs keep the original path; the original file is never modified. No image tool ⇒ original, as before.
1339
+ **Image fitting.** `providers/attachments.ts` uses the shared portable decoder
1340
+ for upload copies. It fits images within 2,000 pixels per side and 5 MB base64,
1341
+ including large GIFs. ImageMagick and macOS sips are optional accelerators.
1342
+ Project files and their text references remain unchanged; derived model copies use
1343
+ PNG or JPEG as needed. Managed JPEG and PNG uploads follow the replacement
1344
+ policy below before model fitting. Path-based adapters select a copy through
1345
+ `modelImagePath` or `awaitModelImage`. Claude Native prepares typed attachment
1346
+ content through `readFileContent` directly. See
1347
+ [Native file reads and attachments](#native-file-reads-and-attachments) for
1348
+ formats, document ranges and decoder limits.
1126
1349
 
1127
1350
  `OLLAMA_URL_BASE` defaults to `http://localhost:11434`. Override it with the env var. `settings.ollama.baseUrl` supports DD12 config-value interpolation (`!cmd ...` runs a command; `${ENV}` reads an env var) through `resolveConfigValue`, so the endpoint can be derived at resolve time. `keep_alive` is per request (`'10m'`), long enough for consecutive turns and short enough to return VRAM when a tab is idle; see Quirks.
1128
1351
 
@@ -1181,6 +1404,7 @@ The applied `options` envelope is the **single insertion point** and is prefix-c
1181
1404
 
1182
1405
  - **Ground truth** is Ollama's `prompt_eval_count` on the `done:true` line (the actual prompt count the daemon saw) → carried on the result event as `lastPromptTokens`.
1183
1406
  - **`estimatePromptTokens`** is the forward-looking pre-turn estimate. It **counts tool-call arguments** (a tool-only assistant turn has `content:null` with the whole payload in `tool_calls[].function.arguments` - naïve counting undershoots ~20-30% and the compaction gate goes blind), plus tool results and the advertised tool schemas (sent every turn).
1407
+ - Compaction estimates first apply the serving model's vision support and request image budget. Admitted images use pixel dimensions through the same pure helper as Native context management. Compression size does not alter this visual estimate. Unknown or incomplete headers use a bounded conservative image cost. The daemon's later `prompt_eval_count` remains the measured context figure.
1184
1408
  - Reuses the existing `ContextUsageMessage` → CTX bar; the denominator is the per-backend probed `num_ctx` (`OLLAMA_DEFAULT_WINDOW` = 2048 fallback). Context compaction reads `context_usage.percentOfWindow` (post-turn) + `estimatePromptTokens()` (forward-looking) to decide whether to compact.
1185
1409
 
1186
1410
  ### Auto-compaction
@@ -1197,13 +1421,13 @@ The applied `options` envelope is the **single insertion point** and is prefix-c
1197
1421
  `server/src/providers/ollamaCtxFallback.ts` `planCtxEscalation` - on a detected overflow, re-dispatch to a larger window instead of failing. Builds on multi-backend routing. Emits a `context_window_fallback` `system_notice` (from→to). **Escalate, don't re-compact** - context compaction owns the transcript; this is the escape hatch when even compaction isn't enough or a bigger window exists.
1198
1422
 
1199
1423
  - **Order:** (1) `numctx_bump` - same backend/model, request the **full probed ceiling**, only when it's `>` the failing window; (2) `peer_backend` - a different backend whose probed window for the same model is known-larger.
1200
- - Reuses multi-backend routing's `contextOverflow` classification (400 stays non-retryable + HOT - it's not the host's fault). Bounded re-dispatch (max 2 hops, `MAX_CTX_ESCALATIONS`, no re-pick), with a mid-stream guard so a re-dispatch can't double-emit.
1424
+ - Reuses multi-backend routing's `contextOverflow` classification (only explicit context-overflow detail in a 400 triggers widening; unrelated 400 errors remain validation failures). Bounded re-dispatch (max 2 hops, `MAX_CTX_ESCALATIONS`, no re-pick), with a mid-stream guard so a re-dispatch can't double-emit.
1201
1425
 
1202
1426
  ### Relevant-tool subsetting
1203
1427
 
1204
1428
  `server/src/providers/ollamaToolSubset.ts` (pure) caps the advertised tool catalog so large schema payloads don't degrade small-model tool selection (Hardening 7 - heuristic, no embeddings).
1205
1429
 
1206
- - **`OLLAMA_CORE_TOOLS`** = `Read/Grep/Glob/Bash` (+ cluster peer/plan tools when the workflow is a member) - never trimmed. The remainder is ranked by term-overlap relevance against the **stable system-block signal** (not the volatile last message - see prefix-cache invariant in GOTCHAS), capped at **9** (`ARCO_OLLAMA_TOOL_CAP`, floored at the core size).
1430
+ - **`OLLAMA_CORE_TOOLS`** = `Read/Grep/Glob/Bash` (+ cluster peer/plan tools when the workflow is a member) - never trimmed. The remainder is ranked by term-overlap relevance against the **stable system-block signal** (not the volatile last message - see prefix-cache invariant in GOTCHAS), capped at **9** (`ARCO_OLLAMA_TOOL_CAP`, floored at the core size), plus a separate allowance for the advertised cluster coordination tools.
1207
1431
  - Computed **once per turn** from a stable signal → byte-identical `tools[]` across turns = prefix-cache-safe. Passthrough below the cap; disable entirely with `ARCO_OLLAMA_TOOL_SUBSET=0`. The chosen subset is logged to `events.jsonl`.
1208
1432
 
1209
1433
  ### Capability-gated tool handling
@@ -1212,6 +1436,7 @@ The applied `options` envelope is the **single insertion point** and is prefix-c
1212
1436
 
1213
1437
  - **`resolveToolMode`** gates on the model's probed `tools` capability (`/api/show`): `'native'` (advertise `tools[]`, parse native `tool_calls` - behavior before native tool-call support for capable models), `'fenced'` (inject the protocol, parse fenced blocks), `'none'` (no tools - no cwd / one-shot / structured `format`). Override: `ARCO_OLLAMA_TOOL_MODE = auto|native|fenced`.
1214
1438
  - **Protocol.** A ` ```tool ` / ` ~~~tool ` fenced block holding a JSON object, folded **into the system block** (prefix-cache-stable + counted by the context-fill estimator for free - the fenced-prompt text rides every request where native schemas would). `buildFencedToolPrompt` is a **pure** function of the (already-subsetted, already-stable) tool list.
1439
+ - Only explicit `tool` fences or recognized tool-call shapes request an action. Ordinary code and JSON examples remain answer text; malformed explicit tool blocks still return an argument error. `cluster_plan_tick` stays callable because changing a checkbox is a mutation, while plan readers remain injected context.
1215
1440
  - Robust parser (fence → brace-slice → key-drift → bare-JSON fallback, with `argError` feedback). Parsed calls reuse the native `dispatchToolCalls` path; results are reframed as labeled `role:'user'` messages. The action-vs-context split: context-reader tools stay prompt-injected rather than exposed as callable tools.
1216
1441
 
1217
1442
  ### Model-lifecycle console
@@ -1233,7 +1458,7 @@ Turns "why did my model unload / why is VRAM full" into visible operator state.
1233
1458
 
1234
1459
  `server/src/providers/ollamaUtility.ts` is a **separate, non-streaming, JSON-only, capped** call shape for discrete BACKGROUND jobs - distinct from the interactive `streamOneTurn`. A configurable cheap/small model (e.g. a 3B) runs the context compaction summary (its most important consumer) and, when their operator-armed triggers ship, model-titles + recall summaries - keeping the expensive primary free.
1235
1460
 
1236
- **Config (`settings.ollama.utility`, settings-file-only):**
1461
+ **Config (`settings.ollama.utility`; set in Settings > Providers and models > Sign-in, accounts and local endpoints, field OLLAMA COMPACTION UTILITY MODEL, or in the settings file):**
1237
1462
 
1238
1463
  ```jsonc
1239
1464
  "ollama": {
@@ -1249,7 +1474,7 @@ Turns "why did my model unload / why is VRAM full" into visible operator state.
1249
1474
 
1250
1475
  **utility-model summary seam:** `runUtilitySummaryJob({ messages, maxTokens?, framing?, onNotice? }) → Promise<string | null>`. Context compaction passes the **pre-sliced older-half messages** + a cap; this returns the summary text, or `null` when the utility model is unconfigured/failed. **Context compaction supplies the deterministic fallback** (a structural digest) for the `null` case - this seam never invents one, so the "never fails closed" guarantee lives in context compaction.
1251
1476
 
1252
- **Pause switch (2026-09-29):** `settings.ollama.utility.enabled: false` (Settings → OLLAMA COMPACTION UTILITY MODEL → ENABLED) makes `resolveUtilityConfig` return null - every job behaves as unconfigured (compaction → deterministic digest, titles skip, the fit calculator reserves nothing) while model/host/titles stay saved. Absent ⇒ enabled. The Settings save path carries `enabled`/`titles` through its whole-object replace (it used to drop them).
1477
+ **Pause switch (2026-09-29):** `settings.ollama.utility.enabled: false` (Settings > Providers and models > OLLAMA COMPACTION UTILITY MODEL > ENABLED) makes `resolveUtilityConfig` return null - every job behaves as unconfigured (compaction → deterministic digest, titles skip, the fit calculator reserves nothing) while model/host/titles stay saved. Absent ⇒ enabled. The Settings save path carries `enabled`/`titles` through its whole-object replace (it used to drop them).
1253
1478
 
1254
1479
  **Session titles (opt-in, 2026-09-29):** `settings.ollama.utility.titles: true` (default OFF - arming the utility model for compaction does NOT arm titles) makes `workflows/modelTitles.ts` generate a 5-8-word RESUME-picker title after a workflow's turns: one-shot per session, first ≤4 operator messages, 32-token cap, job `session-title` (visible `system_notice`), applied through `applyModelTitle` (logged to `title-events.jsonl`; an operator rename always outranks). Fire-and-forget after the session-index upsert in `writeMeta`; failure leaves the derived title. Tab labels (`config.name`) are operator-owned and never touched. `npm run test:model-titles`.
1255
1480
 
@@ -1305,16 +1530,18 @@ The v1 allowlist (`server/src/providers/ollamaTools.ts`):
1305
1530
  | Tool | Args | Notes |
1306
1531
  |---|---|---|
1307
1532
  | `Read` | `file_path`, optional `offset` (1-based start line) / `limit` (max lines) | 32 KB byte cap, refuses directories. Tighter than Claude's 256 KB because local model windows are smaller; chunk via `offset`/`limit` for larger files. |
1308
- | `Glob` | `pattern`, optional `path` | Node 22 `fs.promises.glob`. Cwd-rooted base. |
1309
- | `Grep` | `pattern`, optional `path` / `case_insensitive` / `files_only` | POSIX walk (no ripgrep dep), skips `node_modules` / `.git` / `dist` / `.arco` / `.cache` / etc. 5000-file walk cap, 64 KB output cap. |
1533
+ | `Glob` | `pattern`, optional `path` | Bounded matching under the cwd or `path`: 1,000 results, 20,000 visited entries or 1,000 milliseconds. Skips ignored folders and nested checkouts; reports results truncated. Individually ignored files and explicit ignored-folder scopes remain searchable. |
1534
+ | `Grep` | `pattern`, optional `path` / `case_insensitive` / `files_only` | JavaScript content search without a ripgrep dependency; supports a single-file `path`. Skips ignored folders and nested checkouts, retaining individually ignored files and explicit ignored-folder scopes. Stops at 5,000 files, 20,000 entries or 1,000 milliseconds; 64 KB output cap and truncation notices. |
1310
1535
  | `Write` | `file_path`, `content` | mkdir -p parents, refuses to clobber a directory. |
1311
- | `Bash` | `command`, optional `description` / `timeout` | `/bin/sh -c` in the workflow cwd. Stdin closed (no hangs). Combined stdout+stderr cap 64 KB, default 60s timeout, hard ceiling 600s. Spawned `detached:true` so timeout / abort / output-cap kills the whole process tree. Footer reminders apply. |
1536
+ | `Bash` | `command`, optional `description` / `timeout` | `/bin/sh -c` (Git Bash on Windows, see `commandShell.ts`; on Windows without Git Bash it is the `PowerShell` tool, as in Claude Code) in the workflow cwd. Stdin closed (no hangs). Combined stdout+stderr cap 64 KB, default 60s timeout, hard ceiling 600s. Spawned `detached:true` so timeout / abort / output-cap kills the whole process tree. Footer reminders apply. |
1312
1537
  | `WebSearch` | `query`, optional `max_results` (1-10, default 5) | Hits the operator's local SearXNG instance (`ARCO_SEARXNG_URL`, default `http://127.0.0.1:8888`). Returns a markdown list of `title - url\n snippet`. SearXNG bang syntax (`!g foo`) routes to specific engines. 10s timeout. |
1313
1538
  | `WebFetch` | `url`, optional `mode` (`auto` / `fast` / `stealth`) | Fast path: native `fetch()` with browser UA, 10s timeout, HTML→text strip. Stealth path: shells out to `/opt/camoufox/bin/python` (configurable via `ARCO_CAMOUFOX_PYTHON`) and uses Camoufox's `inner_text("body")`, 30s timeout. Auto mode tries fast, falls back to stealth on Cloudflare/403/empty signals. SSRF guard blocks loopback / RFC1918 / link-local hosts (`127.0.0.0/8`, `10/8`, `172.16/12`, `192.168/16`, `169.254/16`, IPv6 loopback / unique-local / link-local). |
1314
1539
 
1540
+ STOP ends the active local Bash tree. Closing or handing off its tab also ends active local shells and drains tree cleanup and pipe closure for up to 15 seconds. This runtime is shared by Ollama, llama.cpp, LM Studio, Strata and DeepSeek; it does not expose Native's `run_in_background` API. A fully redirected background job whose command has already returned is outside this active-shell tracking.
1541
+
1315
1542
  The web tools are the only network-touching ones in v1. SSRF guard is intentional - operators who genuinely need to fetch a localhost URL can use `Bash + curl` in AUTO mode (their explicit choice).
1316
1543
 
1317
- **Path validation.** Every tool resolves its path argument via `resolveWithinCwd()`; absolute paths and `..`-escapes are both rejected. The tool runtime is the only way a local model can touch the filesystem in Arco, so the security boundary lives here, not in the loop layer.
1544
+ **Path validation.** Arco-managed file tools stay within the project folder and reject links that leave it. Files elsewhere are attached to the message instead of opened through the file tool. Browser file views use a separate allowed-root policy that refuses private folders. That private-folder list does not apply inside project folders, so agent file tools can read project content such as `.claude` or `.codex`. Claude Native also asks before writes to a small set of sensitive targets; that approval is not a read filter. These checks are not a shell sandbox. In AUTO, local-model Bash commands execute; SAFE returns a denial. Provider CLI tools follow their own sandbox and approval settings.
1318
1545
 
1319
1546
  **AUTO vs SAFE.** AUTO mode (`WorkerConfig.skipPermissions = true`) executes tools server-side. SAFE mode (default) returns a denial string the model sees as the tool result, so the loop converges without a new operator-approval protocol surface - the operator can always cancel mid-turn. Per 5.4 design choice (a).
1320
1547
 
@@ -1352,7 +1579,7 @@ None. Ollama is a local daemon - Arco just probes `${OLLAMA_URL_BASE}/api/tags`
1352
1579
  - **Tool-loop cap.** `MAX_TOOL_TURNS = 50` by default (`ARCO_OLLAMA_MAX_TOOL_TURNS`, max 200). A workflow that needs more is suspect; split the task or open an issue.
1353
1580
  - **False-final recovery.** Local thinking models sometimes answer with preparation text ("let me check...", "step 1...") and no tool calls. `OllamaWorkerProcess.run()` detects short preparatory-only replies and injects up to two private continuation prompts so the model actually calls tools or gives a real answer.
1354
1581
  - **Cluster completion guard.** In cluster member turns, non-director Ollama workers get one bounded continuation if they try to finish without `peer_send`. The coaching prompt tells them to send a concise PASS/FAIL or DONE/BLOCKED report to the assigning peer before ending. This is a deterministic backstop for local models that understand the task but forget the peer-report tool.
1355
- - **Mid-turn steer.** Operator messages typed while an Ollama tool-loop is running are queued to the steering bucket and delivered at the next iteration boundary - `OllamaWorkerProcess.run` calls `WorkerConfig.drainSteer` after `messages.push(...toolResults)` and before the next `streamOneTurn`, appending each drained item as a `role:'user'` message. Drains the *whole* steering bucket per hook fire (not one-at-a-time); follow-up bucket is untouched and still drains as the merged post-turn turn. Steers landing while the worker is mid-API-call deliver on the *next* iteration - Arco does not abort in-flight calls. Persistence shape is unchanged: the `user_message_echo` with `kind: 'steer'` was emitted at enqueue time in `handleUserMessage`, so transcript replay shows the steer at its enqueue position. The drain-time broadcasts are `queue_update` (clears the queue strip) + `queued_messages_drained` (clears the originator's QUEUED pill).
1582
+ - **Mid-turn steer.** Operator messages typed while an Ollama tool-loop is running are queued to the steering bucket and delivered at the next iteration boundary - `OllamaWorkerProcess.run` calls `WorkerConfig.drainSteer` after `messages.push(...toolResults)` and before the next `streamOneTurn`, appending each drained item as a `role:'user'` message. Drains the *whole* steering bucket per hook fire (not one-at-a-time); follow-up bucket is untouched and still drains as the merged post-turn turn. Steers landing while the worker is mid-API-call deliver on the *next* iteration - Arco does not abort in-flight calls. Persistence shape is unchanged: the `user_message_echo` with `kind: 'steer'` was emitted at enqueue time in `handleUserMessage`, so transcript replay shows the steer at its enqueue position. The drain-time broadcasts are `queue_update` (updates PENDING) + `queued_messages_drained` (clears the originator's queued optimistic).
1356
1583
  - **Single-slot daemon.** `OLLAMA_NUM_PARALLEL=1` + `OLLAMA_MAX_LOADED_MODELS=1` are required for prefix-cache reliability; concurrent workflows hitting the same daemon will serialize.
1357
1584
  - **Polite eviction.** `keep_alive` defaults to `'10m'` per request - long enough that consecutive turns never reload, short enough that walking away from a workflow returns VRAM to other GPU consumers (Resolve, games). Override via daemon-level `OLLAMA_KEEP_ALIVE` env if you want forever-loaded; per-request value still wins.
1358
1585
  - **Cache invariance.** Anything that mutates the system prompt, transcript bytes, or `options` between turns flushes the prefix cache. Don't inject timestamps / random ids into system prompts.
@@ -1388,6 +1615,8 @@ When a retriever lands, it calls `fuseRRF` (`Σ 1/(k+rank)`, `RRF_DEFAULT_K`=60
1388
1615
 
1389
1616
  ## LM Studio
1390
1617
 
1618
+ Standard cluster members using LM Studio, Strata or DeepSeek receive the same shared plan, assigned role and coordination instructions as the other local HTTP providers, once each. Blind members keep the existing restricted context and do not receive the shared plan.
1619
+
1391
1620
  `server/src/providers/lmstudio.ts`. Pure HTTP, no subprocess - a standalone module that talks LM Studio's **OpenAI-compatible** REST API .
1392
1621
 
1393
1622
  **Standing verdict: OpenAI-compat endpoint, NOT the SDK.** LM Studio is a *runtime* (an Ollama competitor), not a frontend; its app/engine are closed-source and only the client SDKs are public. It exposes an OpenAI-compatible API on `http://localhost:1234/v1` (`/chat/completions`, `/models`, `/embeddings`). Adding it as a configurable OpenAI-compat endpoint reuses Arco's existing HTTP plumbing for near-zero cost - adopting the native `lmstudio.js` `ws://` SDK would add a dependency tracking LM Studio's app version for features Arco already owns (its own tool-loop). It is **not** modeled on llama.cpp's lifecycle-coupled worker either; it's its own module.
@@ -1569,6 +1798,10 @@ require operator coordination and leave both profiles stopped afterward.
1569
1798
 
1570
1799
  ## llama.cpp
1571
1800
 
1801
+ A managed server exit or process error clears ready state; the next request can load a replacement.
1802
+
1803
+ Endpoint overrides in `extraArgs`, including the suggested `--port 8081` fix, use one host and port for listener checks, health polling, loaded state and inference. The final `--host` or `--port` flag wins; malformed port overrides are refused before launch.
1804
+
1572
1805
  `server/src/providers/llamacpp.ts` (provider) + `server/src/providers/llamacppManager.ts` (lifecycle) + `server/src/llamacppCatalog.ts` (operator-declared model registry).
1573
1806
 
1574
1807
  Supported in Chat (tools omitted) but rejected for Incognito: the shared daemon always writes `~/.arco/llamacpp.log`.
@@ -1584,6 +1817,8 @@ Two non-obvious differences from Ollama:
1584
1817
  1. **Operator-declared model registry, not auto-discovery.** llama-server is one model per process and needs explicit `-m` / `--mmproj` / `-c` / `-ngl` flags. The catalog at `~/.arco/llamacpp.json` names each loadout up front; the lifecycle manager spawns `llama-server` with the right flags on first use.
1585
1818
  2. **Arco owns the daemon process.** Ollama runs as its own systemd / homebrew daemon; llama-server is spawned + babysat by Arco. Switching models is SIGTERM old → wait → spawn new. Idle eviction reclaims VRAM after `ARCO_LLAMACPP_KEEPALIVE_MS` (default 10 minutes).
1586
1819
 
1820
+ Catalog edits and deletions use the version that was reviewed. Duplicate aliases are refused, including renames. If another change wins first, reload the registry and review the pending edit again. A diagnosis fix follows the same rule and does not reload a model when its catalog save conflicts.
1821
+
1587
1822
  ### Spawn
1588
1823
 
1589
1824
  `POST /v1/chat/completions` with `stream: true`. OpenAI SSE format (not Ollama NDJSON). Workers always go through `llamacppManager.ensureLoaded(alias)` first, which blocks 20-30s on the cold-start of a 17GB GGUF and is a no-op once loaded.
@@ -1650,7 +1885,7 @@ Same 5 MB cap and `.png/.jpg/.jpeg/.gif/.webp` allowlist as the Ollama path.
1650
1885
 
1651
1886
  ### Tool runtime
1652
1887
 
1653
- Reused from `ollamaTools.ts` - the local-tool runtime (Bash/Read/Write/etc.) is provider-agnostic. AUTO mode executes; SAFE mode returns a denial string the model treats as the tool result so the loop converges without an operator-approval ping-pong. `isKnownOllamaTool()` is a strict allowlist gate; tools the model invents are rejected.
1888
+ Reused from `ollamaTools.ts` - the local-tool runtime (Bash/Read/Write/etc.) is provider-agnostic, and every local provider decides each call through `decideLocalToolCall` in `localToolDispatch.ts` with its own rules. AUTO mode executes; SAFE mode returns a denial string the model treats as the tool result so the loop converges without an operator-approval ping-pong. `isKnownOllamaTool()` is a strict allowlist gate; tools the model invents are rejected.
1654
1889
 
1655
1890
  OpenAI fragment-assembly: tool calls arrive across multiple SSE events, partial by `index`. Reassembled in `partialToolCalls` map, emitted as a single `ToolCall[]` once `finish_reason === 'tool_calls'`.
1656
1891
 
@@ -1720,7 +1955,7 @@ The compaction path (context fill) does require a model call. The model summariz
1720
1955
 
1721
1956
  ## External MCP integrations
1722
1957
 
1723
- External MCP servers that Arco surfaces as operator-attachable per-tab options. Unlike the in-process per-cluster MCP server (Cluster + scope), these are operator-installed binaries running on the same machine. Arco's job is the UX (toggle, status, re-index button) + persistence of intent + spawn-time wiring to inject the server entry into the worker's `--mcp-config`.
1958
+ External MCP servers that Arco surfaces as operator-attachable per-tab options. CONFIG > MCP SERVERS is available on Claude Native and CLI, Codex exec and app-server, Cursor Agent, Ollama, llama.cpp, LM Studio, Strata and DeepSeek Agent tabs. The registry list is shared across tabs; enablement and tool choices belong to each tab. Standard and BLIND cluster members have the same controls. Chat tabs and isolated members do not receive configured servers and do not show this section. Unlike the in-process per-cluster MCP server (Cluster + scope), these are operator-installed binaries running on the same machine. Arco's job is the UX (toggle, status, re-index button) + persistence of intent + spawn-time wiring to inject the server entry into the worker's `--mcp-config`.
1724
1959
 
1725
1960
  Each entry below follows the same shape: install path → operator surface → fences → persistence shape.
1726
1961
 
@@ -1765,7 +2000,7 @@ Future entries (e.g. operator-installed Linear / Jira MCPs) should follow the sa
1765
2000
  | Mid-turn cancel | yes (SIGKILL) | yes (loop-abort, in-process) | yes (SIGKILL) | yes (`turn/interrupt` + 5s ack; SIGKILL fallback) | yes (abort fetch) | yes (abort fetch) | yes (abort fetch) |
1766
2001
  | Mid-turn steer | post-turn drain | drain hook between tool-result append + next API call | post-turn drain | `turn/steer` RPC (precondition: `expectedTurnId`) | yes (between tool-loop iterations) | yes (between tool-loop iterations) | yes (between tool-loop iterations) |
1767
2002
  | Concurrent-writer guard | yes | n/a (Arco-internal session) | no | no | n/a | n/a | n/a |
1768
- | Auto-handoff support | yes | yes | yes (rollout snapshot) | yes (rollout snapshot) | yes | no - in-place auto-recovery instead (context fill / stall / tool-cap / reasoning runaway) | no |
2003
+ | Auto-handoff support (after N compactions) | yes (CLI `compact_boundary`) | yes (`native_compacted`; needs auto-compaction) | no (exec reports no compactions) | yes (`contextCompaction` / `thread/compacted`) | yes (durable compaction; needs auto-compaction) | no - in-place auto-recovery instead (context fill / stall / tool-cap / reasoning runaway) | no |
1769
2004
  | Server-side context-mgmt | n/a | operator-armed (`compact` OFF by default - CONFIG ADVANCED Claude API compaction (beta) toggle, gated on catalog support; `clear_thinking` / `clear_tool_uses` intentionally off) | n/a | n/a | n/a | n/a | n/a |
1770
2005
  | Cluster peer tools | per-spawn stdio MCP child via `--mcp-config` | registered in-process | per-turn stdio MCP child via `-c mcp_servers.*` TOML overrides | per-appserver-process stdio MCP child via `-c mcp_servers.*` TOML overrides | in-process tool registry (`localClusterCapacity`, default 1) | in-process tool registry (`localClusterCapacity`, default 1) | no |
1771
2006
  | Chat tabs | yes (+ web) | yes (+ web) | yes (+ web) | yes (+ web) | yes (+ web) | yes (not Incognito) | yes |
@@ -1819,6 +2054,8 @@ Smoke: `npm run smoke:error-classify` (pure unit - no WS, no server boot).
1819
2054
 
1820
2055
  ## Provider fallback chains
1821
2056
 
2057
+ HTTP provider error envelopes retain their status when passed through text results. A 429 can advance to the next configured bounded-job provider; a 413 stays on context recovery, and transient server errors retain their retry classification. Ordinary prose containing an HTTP example does not supply a status.
2058
+
1822
2059
  `server/src/providers/fallbackChain.ts` runs a **bounded job** (a reviewer or a
1823
2060
  research leg - never a live operator conversation) across an ordered list of
1824
2061
  provider "legs". It spawns leg 0; if that leg fails with a classified error
@@ -1937,3 +2174,155 @@ error.
1937
2174
  - [Settings](SETTINGS.md)
1938
2175
  - [Gotchas](GOTCHAS.md)
1939
2176
  - [Documentation style](STYLE.md)
2177
+
2178
+ HANDOFF starts a fresh session and can help when changing to an unrelated task, correcting a worker on a wrong track, switching provider or model, or using a provider without compaction. Compaction is lossy but has no fixed limit. Plans, board, goal, artifacts and Git remain outside the conversation. QUICK builds a deterministic seed; ORIGINAL WORKER writes a reflection; FRESH SUMMARIZER uses a separate worker.
2179
+
2180
+ ## Request completion bounds
2181
+
2182
+ OpenAI-compatible generation includes waiting for response headers in its stall deadline. llama.cpp uses the smaller of the recovery stall and turn budgets while recovery is enabled. Discovery keeps its three-second deadline through model-list JSON parsing. WebSearch keeps its deadline and operator cancellation active through JSON parsing.
2183
+
2184
+ OpenAI-compatible streams finish at `[DONE]`; Ollama streams finish at `done: true`, even when the HTTP body remains open. Claude CLI snapshots track text by message and block so repeated snapshots do not hide later blocks or shorter final answers.
2185
+
2186
+ Claude Native token-count telemetry has a five-second deadline and is cancelled by STOP. A cancelled or failed count falls back to response usage so turn completion does not wait on telemetry.
2187
+
2188
+ Claude Native checks MCP session health and launch settings at each turn boundary. Failed or closed sessions reconnect, and a changed command, arguments or environment replaces the previous session. Healthy unchanged sessions stay open.
2189
+
2190
+ FOLD and S-FOLD can restore a saved Claude Native conversation after a server restart, before its next turn. Deterministic Fold replays the saved log without needing provider credentials; Server Fold retains its normal request and fallback behavior.
2191
+
2192
+ Deterministic Fold keeps the newest complete question and answer together, even when that exchange exceeds the tail token target or is the whole saved conversation.
2193
+
2194
+ Claude CLI session watching belongs to the current workflow and session generation. A delayed load from an older reconnect or handoff cannot replay rows or replace a newer watcher.
2195
+
2196
+ Automatic Claude CLI calibration starts only while the same session remains idle. A new primary turn or cancellation during estimation or probe admission prevents a concurrent context probe.
2197
+
2198
+ STOP also revokes a normal message still preparing prompt or file context. It cannot enter a queue or start a provider turn after that cancellation.
2199
+
2200
+ A busy message resolves its selected one-shot skills before entering the queue. The same skill context is delivered once whether the provider consumes it as mid-turn steering or the queue runs it after the turn.
2201
+
2202
+ ## Local-model recovery and cluster tools
2203
+
2204
+ A successful larger context window is retained for later tool requests on that backend during the same turn. Peer escalation sends the larger window explicitly. Only identified context-overflow errors trigger widening; other request validation errors retain their original explanation.
2205
+
2206
+ Transient backend failures receive bounded retries even with one backend. DNS lookup failures can use the configured hostname fallback. A rejected structured review synthesis keeps the completed free-text review and reports the fallback.
2207
+
2208
+ Cluster coordination tools have a separate allowance from action tools, so joining a cluster does not remove file-writing and web-research tools. Local-model peer messages can retry with confirm after a status-confirmation response; the first-send guard still applies.
2209
+
2210
+ Claude Native file guards use the same resolved file identity as Read, Write and Edit. A linked project folder or an in-project file alias preserves the partial-read warning and first-edit tracking. Configuration protection checks both the requested name and the resolved target. These checks do not expand which folders file tools may access.
2211
+
2212
+ ### Bounded file discovery
2213
+
2214
+ Claude Native and local-model Glob, and JavaScript Grep when used instead of ripgrep, skip Git-ignored directories and nested Git checkouts or worktrees below the search root. Each walk has an entry and time budget; a limited response says "results truncated" and asks for a narrower path or pattern. Individually ignored files and explicitly selected ignored folders stay searchable. Useful hidden folders remain searchable, including explicit `.github/**` patterns. Grep can also target a single file. Selecting a nested checkout itself as the search root searches that checkout normally. Ripgrep keeps its existing Git-ignore behavior and execution limit.
2215
+
2216
+ Claude Native and local-model Glob can return a directory alias for a directory-only pattern such as `src-link/`. The alias must resolve within the project and pass the path checks. Glob does not walk through directory aliases.
2217
+
2218
+ ## Reading files and attachments
2219
+
2220
+ Arco's file tools read inside the project folder. Files elsewhere reach the model only when the operator attaches them to the message.
2221
+
2222
+ Arco decodes file contents before sending them to a model. Local providers use
2223
+ this reader for `Read`; Claude CLI, Codex and Cursor can use the read-only
2224
+ `read_file` MCP tool for files in their workflow folder. It fits images,
2225
+ extracts document text and reads notebook cells without extra software.
2226
+ Other binary files produce a named-file note instead of raw bytes.
2227
+
2228
+ The same decoding applies to operator attachments, including Chat tabs that
2229
+ have no file tools. Chat labels attachments by name and restores earlier uploads
2230
+ within the same limits after restart; unavailable uploads require reattachment.
2231
+ Claude Native and Claude CLI send PDF text by default; scanned pages provide fitted images. Agent attachment receipts explain how to request visual pages.
2232
+
2233
+ Larger PDFs send a bounded range and a notice; use `read_file` with `pages` for another range. For layout, charts or figures, use `pdf_mode: "visual"` with an explicit `pages` range. Word, Excel, PowerPoint,
2234
+ OpenDocument and RTF files become text. Other local and CLI transports
2235
+ receive extracted PDF text and fitted scanned-page images.
2236
+
2237
+ Large documents are bounded; use
2238
+ `pages` on `Read` or `read_file` to select PDF pages, spreadsheet sheets,
2239
+ presentation slides or notebook cells, for example `1-3,5`. Text files retain
2240
+ line addressing through `offset` and `limit`.
2241
+
2242
+ Images use the selected transport's native image input. Ollama checks the
2243
+ serving model's reported vision capability for every request. llama.cpp needs
2244
+ both a vision-capable catalog entry and its projector. LM Studio uses native
2245
+ model metadata when available; Strata and DeepSeek use their reported model
2246
+ capabilities. An unknown or text-only model receives a clear image note.
2247
+ MCP image results follow the same capability checks.
2248
+
2249
+ Codex exec, Codex app-server and Claude CLI receive file-reading guidance only
2250
+ when the workflow file server is attached. Chat omits that guidance. Cursor ACP
2251
+ uses its loopback file server in solo tabs too; cluster membership alone without
2252
+ a working folder does not advertise file tools.
2253
+
2254
+ Codex enables its local image tool on both transports. Arco inspects `codex
2255
+ features list`: CLIs advertising `view_image` receive `features.view_image=true`;
2256
+ older CLIs retain `tools.view_image=true`. The probe is cached for one minute. Cursor ACP exposes the
2257
+ file reader in solo and cluster tabs and avoids decoding binary bytes in its
2258
+ text-file callback. Cursor print Agent turns use a temporary read-only file-reader
2259
+ plugin in a private nested temporary folder, which meets Cursor's minimum plugin-path depth. When a workflow identity is supplied, it also exposes only `plan_list`,
2260
+ `plan_ref_list` and `plan_ref_read` through a separate plan server. It receives
2261
+ no plan writers, cluster board tools or configured registry tools. Chat turns
2262
+ omit the project plugin and file-tool guidance while retaining decoded operator
2263
+ attachments. Agent turns keep ask mode and the original workflow folder, and
2264
+ remove the temporary plugin when the subprocess ends. It does not change saved Cursor MCP configuration or
2265
+ approve unrelated MCP servers.
2266
+
2267
+
2268
+ Claude CLI streaming input uses the documented `SDKUserMessage.message`
2269
+ content blocks. Images and PDFs precede the request text. See the
2270
+ [Claude SDK input schema](https://code.claude.com/docs/en/agent-sdk/typescript#sdkusermessage).
2271
+
2272
+ ### Public URL files
2273
+
2274
+ Native `read_url`, local `WebFetch` and the read-only `fetch_file` tool in the Claude CLI, Codex and
2275
+ Cursor file servers share the public URL reader. Fetched images become fitted
2276
+ image blocks. PDFs provide selected page text or scanned-page images; Native `read_url` and `fetch_file` accept `pdf_mode: "visual"` with `pages` for selected visual pages. MCP tools return fitted images for visual pages. `pages`, such as `2-4`, also selects supported document ranges.
2277
+ The range selects decoded content; the downloaded source still has a byte cap.
2278
+
2279
+ The direct reader accepts HTTP(S), checks every resolved address and rechecks
2280
+ each redirect before following it. Loopback, private and link-local targets are
2281
+ refused. Text downloads have a 128 KiB budget; media and document sources have
2282
+ the shared 512 MiB limit. The direct request and decoding deadline is 10,000 ms.
2283
+ Cancellation releases the response reader. Local WebFetch can use its existing
2284
+ browser fallback for bot-protected text pages.
2285
+
2286
+ Native `read_url` returns PDF text and scanned-page images by default. Use `pdf_mode: "visual"` with `pages` for selected native PDF pages. It follows
2287
+ Chat web access and the agent tool posture. WEB LOOKUPS / TURN also sets its
2288
+ separate per-turn call cap, including failed attempts; the default is 15.
2289
+ Its image and document results share Native context media limits. Reload keeps
2290
+ the source URL and a receipt so the model can call `read_url` again.
2291
+
2292
+ ### Local cluster board tools
2293
+
2294
+ Ollama, llama.cpp, LM Studio, Strata and DeepSeek expose all eleven `cluster_task_*` tools to standard-access cluster members with an attached task board. These tools list, show, create, claim, update, heartbeat, comment, link, unlink, block and submit completion reports through the existing cluster board API. Completion submits to review; done and archived remain operator-only.
2295
+
2296
+ The BOARD mode takes effect on the next turn. Detached boards and BLIND members receive no board tools, and execution repeats those checks. Local execution still requires AUTO mode and a workflow folder. Explicit tool allowlists still apply. Ollama models without native tools use the existing fenced-call protocol. LM Studio history requires the selected model to report `trained_for_tool_use` in its [native model metadata](https://lmstudio.ai/docs/developer/rest/list); false or missing metadata leaves history unattached. This does not change the older server's other tools. Ollama keeps attached board tools in its coordination core, outside relevance trimming; its tool cap grows by the attached coordination-tool count. Native and local providers share the board descriptions and argument schemas.
2297
+
2298
+ ### Workflow plan tools on Native and local providers
2299
+
2300
+ Claude Native, Ollama, llama.cpp, LM Studio, Strata and DeepSeek offer `plan_create`, `plan_attach`, `plan_list`, `plan_ref_write`, `plan_ref_list` and `plan_ref_read` in Agent tabs with a workflow folder and identity. These are workflow plan tools, separate from cluster shared-plan tools and Native plan mode. Ordinary Chat tabs and ISOLATED Native members do not receive them. Local execution requires AUTO mode; explicit local tool allowlists still apply.
2301
+
2302
+ The schemas, descriptions, structure checks, reference slug validation and REST operations live in `server/src/planTools.ts`. MCP, Native and local adapters share them. Creating a plan attaches it to the calling workflow; model-supplied arguments cannot replace that identity or its project folder. Replacing a plan body or deleting a plan remains outside this tool family. Ollama ranks these tools as ordinary relevance candidates by default. Plan-related task context or an explicit plan request keeps all six for that turn, adding their count to the normal cap.
2303
+
2304
+ ### MCP response media accounting
2305
+
2306
+ The MCP reader retains up to 20 decoded image blocks per tool response; PDF resources are decoded to text and scanned-page images. Encoded text resources use the bounded text path and do not consume that media count. A PDF document block can contain several pages; provider request guards count its actual pages separately. Source decoding remains bounded to 100 response entries and the per-source byte limit.
2307
+
2308
+ ### Uploaded image storage
2309
+
2310
+ Uploaded JPEG and PNG files over 1 MiB (1,048,576 bytes) or 2,000 pixels on their long edge are optimized inside Arco's managed uploads folder. A successfully written, decoded and dimension-checked smaller file replaces the larger upload at the same path. The larger uploaded copy is deleted by that replacement; messages, event logs, saved file context and handoff/replay references continue to resolve. Arco does not keep a full-size upload backup.
2311
+
2312
+ Source format determines encoding: JPEG photos stay JPEG at quality 90, retaining EXIF orientation metadata; PNG screenshots stay PNG. PNG pixels are reduced only above the 2,000-pixel edge limit. Images are never enlarged. Files at or below both thresholds stay byte-identical. A failed write, verification or replacement, or an encoded result that is not smaller, leaves the upload untouched.
2313
+
2314
+ Only regular files beneath the managed uploads folder qualify. Symlinked files, links at or inside the uploads folder, escaping realpaths and files outside that folder are refused. A linked parent of the uploads folder is supported. Project images read through Read, file references or a request to inspect a path are never rewritten, replaced or deleted, and no copy is written beside them. PDF, Word and other non-image uploads are unchanged. Other image formats retain the existing model-copy behavior without replacing their uploaded originals.
2315
+
2316
+ Animated and 16-bit PNG uploads remain unchanged. The smaller copy keeps the picture, but PNG text chunks and colour profiles, and JPEG metadata other than EXIF, are not carried over.
2317
+
2318
+ Model fitting does not enlarge images. JPEG, PNG, GIF and WebP uploads that already fit the 2,000-pixel edge and 3.75 MiB model byte limits need no model-copy sibling; optional image converters are checked against the source dimensions.
2319
+
2320
+ ### Earlier conversations after a handoff
2321
+
2322
+ Successful Handoff and Spawn operations save their source conversation and the event boundary used for the transfer. The latest seed and HANDOFFS panel show **From** and earlier sources. Opening one selects or reopens that conversation in HISTORY, limited to the recorded boundary; **Show full history** removes that display filter. A source request opens the side panel from a closed narrow drawer or focus mode. Closing a tab preserves the source. Deleted or archived sources remain unavailable until a retained archive is restored through Storage.
2323
+
2324
+ Source links survive restart and chains of handoffs, including a handoff within the same tab. Chat, incognito, BLIND and ISOLATED conversations do not receive these links. The links contain references, not copied transcripts. Eligible agents on Claude Native, Claude CLI, Codex exec and app-server, Cursor print and ACP, and local providers can use `handoff_history` to list, search and read their earlier conversation chain. CLI and Codex expose it through the workflow MCP server; Cursor uses its reader plugin or loopback server. Local providers keep it in the advertised subset when attached. Explicit tool allowlists still apply. Ollama models without native tools use the existing fenced-call protocol. LM Studio history requires the selected model to report `trained_for_tool_use` in its [native model metadata](https://lmstudio.ai/docs/developer/rest/list); false or missing metadata leaves history unattached. This does not change the older server's other tools. The tool and its availability block are rebuilt on ordinary turns and after compaction or model changes; Chat, incognito, BLIND and ISOLATED remain excluded.
2325
+
2326
+ `handoff_history` accepts `sources`, `list`, `search` and `read`. Source keys come from `sources`; turn ids come from `list` or `search`. Search is literal, case-insensitive and excludes tool calls/results unless `include_tools` is true. A no-match result explains that exclusion. Returned history is labelled as earlier conversation, not instructions.
2327
+
2328
+ Responses contain at most 20 turns and 24 KiB of JSON. Each text chunk is at most 8 KiB; repeat the same arguments with the returned cursor to continue a long turn or page. Previews are capped at 512 bytes. Binary payloads and reasoning events are excluded. The underlying reader may buffer existing log records, including oversized ones; these limits bound returned content, not internal log-reading memory. HANDOFFS reads availability from the server even when a reload loads only recent turns and omits the seed.