arco-workbench 0.1.7 → 0.1.9

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 (301) hide show
  1. package/CONTRIBUTING.md +63 -12
  2. package/README.md +21 -17
  3. package/client/dist/assets/{PhosphorBackdrop-DVQdBrTw.js → PhosphorBackdrop-DRu16-Is.js} +1 -1
  4. package/client/dist/assets/{ThemedBackgroundShaderImpl-BfSs2tB4.js → ThemedBackgroundShaderImpl-BLdwwQ4D.js} +1 -1
  5. package/client/dist/assets/{XtermView-DaMjC8Ny.js → XtermView-Xk7_9JaH.js} +1 -1
  6. package/client/dist/assets/{galleryEditor-BCQnXj7R.js → galleryEditor-CI8ClzBa.js} +1 -1
  7. package/client/dist/assets/{index-DD9kFGsF.css → index-BEFgrUJJ.css} +1 -1
  8. package/client/dist/assets/{index-COfbHCYv.js → index-C7WzZfsr.js} +257 -255
  9. package/client/dist/index.html +2 -2
  10. package/client/src/App.tsx +2 -0
  11. package/client/src/components/ChatMessage.tsx +33 -8
  12. package/client/src/components/ChatModeView.tsx +2 -0
  13. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +65 -15
  14. package/client/src/components/ClusterRightPanel/SkillsControl.tsx +124 -0
  15. package/client/src/components/ClusterRightPanel/index.tsx +4 -0
  16. package/client/src/components/ClusterTaskBoardTab.tsx +9 -22
  17. package/client/src/components/CodexLateCommand.tsx +34 -0
  18. package/client/src/components/DialogShell.tsx +2 -0
  19. package/client/src/components/MemberCard.tsx +4 -1
  20. package/client/src/components/MemberPane.tsx +3 -1
  21. package/client/src/components/NeedsYouBadge.tsx +3 -3
  22. package/client/src/components/PhoneUpload.tsx +288 -0
  23. package/client/src/components/PrimaryStatus.tsx +14 -6
  24. package/client/src/components/ProviderReleasesModal.tsx +8 -4
  25. package/client/src/components/ProvidersPopover.tsx +28 -23
  26. package/client/src/components/RuntimeStateBanner.tsx +5 -0
  27. package/client/src/components/SettingsPanel.tsx +2 -2
  28. package/client/src/components/SkillEditorDialog.tsx +2 -2
  29. package/client/src/components/SkillsSettings.tsx +21 -4
  30. package/client/src/components/TabBar.tsx +91 -9
  31. package/client/src/components/TerminalInput.tsx +15 -11
  32. package/client/src/components/TranscriptSendDialog.tsx +12 -8
  33. package/client/src/components/TranscriptWorkerDialog.tsx +119 -0
  34. package/client/src/components/WorkflowView.tsx +2 -0
  35. package/client/src/components/clusterNeedsYou.ts +11 -18
  36. package/client/src/explorer/ArtifactsLens.tsx +37 -28
  37. package/client/src/explorer/ExplorerApp.tsx +5 -4
  38. package/client/src/explorer/types.ts +8 -3
  39. package/client/src/help/content/cluster.tsx +48 -17
  40. package/client/src/help/content/composer.tsx +40 -1
  41. package/client/src/help/content/header.tsx +18 -1
  42. package/client/src/help/content/misc.tsx +9 -1
  43. package/client/src/help/content/settings.tsx +18 -4
  44. package/client/src/help/content/tabbar.tsx +5 -0
  45. package/client/src/help/manualSections/actions.tsx +31 -0
  46. package/client/src/help/manualSections/clusters.tsx +44 -20
  47. package/client/src/help/manualSections/configuration.tsx +20 -0
  48. package/client/src/help/manualSections/gettingStarted.tsx +4 -4
  49. package/client/src/help/manualSections/maintenance.tsx +25 -6
  50. package/client/src/help/manualSections/powerFeatures.tsx +3 -2
  51. package/client/src/help/manualSections/providers.tsx +32 -8
  52. package/client/src/help/manualSections/troubleshooting.tsx +2 -1
  53. package/client/src/help/manualSections/workflows.tsx +12 -0
  54. package/client/src/help/manualSections/workspace.tsx +36 -0
  55. package/client/src/stores/appStore.ts +7 -0
  56. package/client/src/stores/appStore.types.ts +4 -0
  57. package/client/src/styles/global.css +109 -0
  58. package/client/src/utils/phoneTheme.ts +38 -0
  59. package/client/src/utils/phoneUploadApi.ts +10 -0
  60. package/client/src/utils/transcriptWorkerRequest.ts +24 -0
  61. package/client/src/ws/handleServerMessage.ts +31 -8
  62. package/docs/ARCHITECTURE.md +1 -1
  63. package/docs/CLIENT.md +16 -9
  64. package/docs/FEATURES.md +13 -7
  65. package/docs/GETTING_STARTED.md +12 -6
  66. package/docs/GOTCHAS.md +2 -1
  67. package/docs/INDEX.md +1 -1
  68. package/docs/OPERATIONS.md +213 -52
  69. package/docs/PERSISTENCE.md +7 -2
  70. package/docs/PRIMITIVES.md +42 -0
  71. package/docs/PROTOCOL_CLUSTER.md +51 -4
  72. package/docs/PROTOCOL_PRIMITIVES.md +39 -0
  73. package/docs/PROVIDERS.md +84 -13
  74. package/docs/SETTINGS.md +29 -3
  75. package/docs/TASK_LEDGER.md +7 -15
  76. package/native/linux-x64/manifest.json +1 -1
  77. package/native/win32-x64/manifest.json +1 -1
  78. package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +2 -0
  79. package/node_modules/@arco/shared/dist/clusterCoordination.js +5 -1
  80. package/node_modules/@arco/shared/dist/protocol/chat.d.ts +1 -0
  81. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +3 -2
  82. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +15 -1
  83. package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
  84. package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
  85. package/node_modules/@arco/shared/dist/protocol/models.d.ts +4 -3
  86. package/node_modules/@arco/shared/dist/protocol/models.js +26 -2
  87. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +13 -1
  88. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +4 -0
  89. package/node_modules/@arco/shared/dist/protocol/transcriptWorker.d.ts +47 -0
  90. package/node_modules/@arco/shared/dist/protocol/transcriptWorker.js +2 -0
  91. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
  92. package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +1 -0
  93. package/node_modules/@arco/shared/dist/runtimeVersions.js +14 -0
  94. package/node_modules/@arco/shared/package.json +1 -1
  95. package/package.json +2 -2
  96. package/scripts/packaging/arco.mjs +1 -1
  97. package/scripts/packaging/native-repair.mjs +32 -4
  98. package/server/dist/atomicFile.js +1 -2
  99. package/server/dist/capabilities.d.ts +5 -2
  100. package/server/dist/capabilities.js +59 -9
  101. package/server/dist/cliUpdateDecision.d.ts +1 -1
  102. package/server/dist/cliUpdateDecision.js +5 -3
  103. package/server/dist/clusterDirector.js +2 -1
  104. package/server/dist/clusterPeerOps.js +14 -8
  105. package/server/dist/clusterProgress.js +1 -1
  106. package/server/dist/clusterRehydrate.js +2 -0
  107. package/server/dist/clusterSkills.d.ts +13 -0
  108. package/server/dist/clusterSkills.js +81 -0
  109. package/server/dist/clusterSnapshots.js +2 -0
  110. package/server/dist/clusterStore.d.ts +7 -2
  111. package/server/dist/clusterStore.js +42 -1
  112. package/server/dist/diagnostics/codeSkew.js +1 -0
  113. package/server/dist/eventLog.d.ts +7 -0
  114. package/server/dist/eventLog.js +70 -13
  115. package/server/dist/explorerDocs.d.ts +10 -6
  116. package/server/dist/explorerDocs.js +75 -34
  117. package/server/dist/historyLimits.d.ts +1 -0
  118. package/server/dist/historyLimits.js +3 -0
  119. package/server/dist/http/attachmentUpload.d.ts +13 -0
  120. package/server/dist/http/attachmentUpload.js +38 -0
  121. package/server/dist/http/browserWorktrees.d.ts +23 -0
  122. package/server/dist/http/browserWorktrees.js +120 -0
  123. package/server/dist/http/phoneUploadDrafts.d.ts +13 -0
  124. package/server/dist/http/phoneUploadDrafts.js +125 -0
  125. package/server/dist/http/phoneUploadListener.d.ts +17 -0
  126. package/server/dist/http/phoneUploadListener.js +81 -0
  127. package/server/dist/http/phoneUploadNetwork.d.ts +9 -0
  128. package/server/dist/http/phoneUploadNetwork.js +106 -0
  129. package/server/dist/http/phoneUploadPage.d.ts +2 -0
  130. package/server/dist/http/phoneUploadPage.js +136 -0
  131. package/server/dist/http/phoneUploadRouteHistory.d.ts +4 -0
  132. package/server/dist/http/phoneUploadRouteHistory.js +72 -0
  133. package/server/dist/http/phoneUploadRoutes.d.ts +4 -0
  134. package/server/dist/http/phoneUploadRoutes.js +419 -0
  135. package/server/dist/http/phoneUploadTheme.d.ts +17 -0
  136. package/server/dist/http/phoneUploadTheme.js +96 -0
  137. package/server/dist/http/projectBinding.d.ts +1 -0
  138. package/server/dist/http/projectBinding.js +3 -2
  139. package/server/dist/http/readConfinement.js +5 -1
  140. package/server/dist/http/router.js +14 -25
  141. package/server/dist/http/writeConfinement.js +19 -2
  142. package/server/dist/index.js +24 -1
  143. package/server/dist/jsonlLines.d.ts +4 -0
  144. package/server/dist/jsonlLines.js +53 -0
  145. package/server/dist/management/identity.js +1 -0
  146. package/server/dist/mcp/clusterMcpTools.js +4 -4
  147. package/server/dist/primitives/seedWorker.d.ts +1 -0
  148. package/server/dist/primitives/seedWorker.js +2 -1
  149. package/server/dist/project/taskLedger.d.ts +4 -0
  150. package/server/dist/project/taskLedger.js +7 -4
  151. package/server/dist/providerConversation.d.ts +1 -0
  152. package/server/dist/providerConversation.js +17 -0
  153. package/server/dist/providers/claude-native/resumeSummary.d.ts +9 -0
  154. package/server/dist/providers/claude-native/resumeSummary.js +102 -49
  155. package/server/dist/providers/claude-native/worker.js +8 -4
  156. package/server/dist/providers/claude.js +2 -1
  157. package/server/dist/providers/clusterTaskToolDefinitions.js +4 -4
  158. package/server/dist/providers/codex-appserver/catalog.js +16 -1
  159. package/server/dist/providers/codex-appserver/heldCommands.d.ts +14 -0
  160. package/server/dist/providers/codex-appserver/heldCommands.js +54 -0
  161. package/server/dist/providers/codex-appserver/index.d.ts +52 -2
  162. package/server/dist/providers/codex-appserver/index.js +239 -21
  163. package/server/dist/providers/codex-appserver/lateCommands.d.ts +62 -0
  164. package/server/dist/providers/codex-appserver/lateCommands.js +195 -0
  165. package/server/dist/providers/codex-appserver/worker.d.ts +23 -1
  166. package/server/dist/providers/codex-appserver/worker.js +89 -20
  167. package/server/dist/providers/codex.js +2 -1
  168. package/server/dist/providers/codexCodeMode.d.ts +2 -1
  169. package/server/dist/providers/codexCodeMode.js +8 -3
  170. package/server/dist/providers/cursor/print.js +2 -1
  171. package/server/dist/providers/cursor/worker.js +2 -1
  172. package/server/dist/providers/llamacpp.js +17 -8
  173. package/server/dist/providers/ollamaRecovery.js +6 -6
  174. package/server/dist/providers/ollamaResilience.js +3 -3
  175. package/server/dist/providers/ollamaTokens.js +1 -1
  176. package/server/dist/quota.d.ts +0 -18
  177. package/server/dist/quota.js +0 -44
  178. package/server/dist/replacementHistory.d.ts +19 -0
  179. package/server/dist/replacementHistory.js +49 -0
  180. package/server/dist/server/broadcast.d.ts +2 -1
  181. package/server/dist/server/broadcast.js +1 -0
  182. package/server/dist/server/prompts.d.ts +1 -0
  183. package/server/dist/server/prompts.js +6 -1
  184. package/server/dist/sessionJsonl.d.ts +1 -1
  185. package/server/dist/sessionJsonl.js +115 -40
  186. package/server/dist/smartPickupAdapters.js +15 -2
  187. package/server/dist/transcriptWorker.d.ts +34 -0
  188. package/server/dist/transcriptWorker.js +201 -0
  189. package/server/dist/workers/WorkerManager.d.ts +1 -0
  190. package/server/dist/workers/WorkerManager.js +1 -0
  191. package/server/dist/workers/processKill.d.ts +9 -1
  192. package/server/dist/workers/processKill.js +26 -10
  193. package/server/dist/workflowStore.d.ts +1 -0
  194. package/server/dist/workflowStore.js +31 -0
  195. package/server/dist/ws/clusterHandlers.d.ts +1 -0
  196. package/server/dist/ws/clusterHandlers.js +62 -26
  197. package/server/dist/ws/handoffHandlers.js +7 -2
  198. package/server/dist/ws/transcriptWorkerHandlers.d.ts +25 -0
  199. package/server/dist/ws/transcriptWorkerHandlers.js +139 -0
  200. package/server/dist/ws/turnEngine.js +40 -9
  201. package/server/dist/ws/updatePrimaryConfig.js +27 -8
  202. package/server/dist/ws/workflowHandlers.d.ts +4 -1
  203. package/server/dist/ws/workflowHandlers.js +3 -1
  204. package/server/package.json +1 -1
  205. package/server/src/atomicFile.ts +1 -2
  206. package/server/src/capabilities.ts +58 -17
  207. package/server/src/cliUpdateDecision.ts +5 -4
  208. package/server/src/clusterDirector.ts +2 -1
  209. package/server/src/clusterPeerOps.ts +15 -9
  210. package/server/src/clusterProgress.ts +1 -1
  211. package/server/src/clusterRehydrate.ts +2 -0
  212. package/server/src/clusterSkills.ts +79 -0
  213. package/server/src/clusterSnapshots.ts +1 -0
  214. package/server/src/clusterStore.ts +38 -0
  215. package/server/src/diagnostics/codeSkew.ts +1 -0
  216. package/server/src/eventLog.ts +73 -13
  217. package/server/src/explorerDocs.ts +75 -34
  218. package/server/src/historyLimits.ts +2 -0
  219. package/server/src/http/attachmentUpload.ts +49 -0
  220. package/server/src/http/browserWorktrees.ts +124 -0
  221. package/server/src/http/phoneUploadDrafts.ts +118 -0
  222. package/server/src/http/phoneUploadListener.ts +96 -0
  223. package/server/src/http/phoneUploadNetwork.ts +117 -0
  224. package/server/src/http/phoneUploadPage.ts +137 -0
  225. package/server/src/http/phoneUploadRouteHistory.ts +73 -0
  226. package/server/src/http/phoneUploadRoutes.ts +398 -0
  227. package/server/src/http/phoneUploadTheme.ts +97 -0
  228. package/server/src/http/projectBinding.ts +3 -2
  229. package/server/src/http/readConfinement.ts +5 -1
  230. package/server/src/http/router.ts +12 -26
  231. package/server/src/http/writeConfinement.ts +13 -2
  232. package/server/src/index.ts +23 -0
  233. package/server/src/jsonlLines.ts +52 -0
  234. package/server/src/management/identity.ts +1 -0
  235. package/server/src/mcp/clusterMcpTools.ts +4 -4
  236. package/server/src/primitives/seedWorker.ts +3 -1
  237. package/server/src/project/taskLedger.ts +7 -5
  238. package/server/src/providerConversation.ts +15 -0
  239. package/server/src/providers/claude-native/resumeSummary.ts +98 -50
  240. package/server/src/providers/claude-native/worker.ts +8 -4
  241. package/server/src/providers/claude.ts +2 -1
  242. package/server/src/providers/clusterTaskToolDefinitions.ts +4 -4
  243. package/server/src/providers/codex-appserver/catalog.ts +14 -1
  244. package/server/src/providers/codex-appserver/heldCommands.ts +58 -0
  245. package/server/src/providers/codex-appserver/index.ts +222 -20
  246. package/server/src/providers/codex-appserver/lateCommands.ts +225 -0
  247. package/server/src/providers/codex-appserver/worker.ts +85 -21
  248. package/server/src/providers/codex.ts +2 -1
  249. package/server/src/providers/codexCodeMode.ts +9 -4
  250. package/server/src/providers/cursor/print.ts +2 -1
  251. package/server/src/providers/cursor/worker.ts +2 -1
  252. package/server/src/providers/llamacpp.ts +18 -7
  253. package/server/src/providers/llamacppRecovery.ts +2 -0
  254. package/server/src/providers/ollamaRecovery.ts +6 -6
  255. package/server/src/providers/ollamaResilience.ts +3 -3
  256. package/server/src/providers/ollamaTokens.ts +1 -1
  257. package/server/src/providers/ollamaToolSubset.ts +3 -3
  258. package/server/src/quota.ts +0 -50
  259. package/server/src/replacementHistory.ts +44 -0
  260. package/server/src/server/broadcast.ts +2 -0
  261. package/server/src/server/prompts.ts +8 -1
  262. package/server/src/sessionJsonl.ts +92 -32
  263. package/server/src/smartPickupAdapters.ts +17 -3
  264. package/server/src/transcriptWorker.ts +182 -0
  265. package/server/src/workers/WorkerManager.ts +2 -0
  266. package/server/src/workers/processKill.ts +35 -7
  267. package/server/src/workflowStore.ts +21 -0
  268. package/server/src/ws/clusterHandlers.ts +43 -25
  269. package/server/src/ws/handoffHandlers.ts +7 -1
  270. package/server/src/ws/transcriptWorkerHandlers.ts +126 -0
  271. package/server/src/ws/turnEngine.ts +35 -8
  272. package/server/src/ws/updatePrimaryConfig.ts +25 -6
  273. package/server/src/ws/workflowHandlers.ts +3 -1
  274. package/shared/dist/clusterCoordination.d.ts +2 -0
  275. package/shared/dist/clusterCoordination.js +5 -1
  276. package/shared/dist/protocol/chat.d.ts +1 -0
  277. package/shared/dist/protocol/clientMessages.d.ts +3 -2
  278. package/shared/dist/protocol/clusters.d.ts +15 -1
  279. package/shared/dist/protocol/index.d.ts +1 -0
  280. package/shared/dist/protocol/index.js +1 -0
  281. package/shared/dist/protocol/models.d.ts +4 -3
  282. package/shared/dist/protocol/models.js +26 -2
  283. package/shared/dist/protocol/serverMessages.d.ts +13 -1
  284. package/shared/dist/protocol/tasks.d.ts +4 -0
  285. package/shared/dist/protocol/transcriptWorker.d.ts +47 -0
  286. package/shared/dist/protocol/transcriptWorker.js +2 -0
  287. package/shared/dist/protocol/workflows.d.ts +1 -0
  288. package/shared/dist/runtimeVersions.d.ts +1 -0
  289. package/shared/dist/runtimeVersions.js +14 -0
  290. package/shared/src/clusterCoordination.ts +7 -1
  291. package/shared/src/protocol/chat.ts +1 -0
  292. package/shared/src/protocol/clientMessages.ts +5 -0
  293. package/shared/src/protocol/clusters.ts +20 -6
  294. package/shared/src/protocol/index.ts +1 -0
  295. package/shared/src/protocol/models.ts +31 -5
  296. package/shared/src/protocol/serverMessages.ts +13 -0
  297. package/shared/src/protocol/settings.ts +2 -3
  298. package/shared/src/protocol/tasks.ts +4 -7
  299. package/shared/src/protocol/transcriptWorker.ts +49 -0
  300. package/shared/src/protocol/workflows.ts +4 -0
  301. package/shared/src/runtimeVersions.ts +14 -0
@@ -63,54 +63,18 @@ See [Updating Arco](#updating-arco). To clear every older copy before a fresh
63
63
  install, see
64
64
  [Before a fresh install: remove older copies](#before-a-fresh-install-remove-older-copies).
65
65
 
66
- `arco setup` asks before installing the service, starts it, and opens the local
67
- URL. Use `arco service install|uninstall|start|stop|restart|status|logs|refresh` for
66
+ `arco setup` prints the package version it runs, then asks before installing the
67
+ service, starts it, and opens the local URL. Use
68
+ `arco service install|uninstall|start|stop|restart|status|logs|refresh` for
68
69
  direct service control, or `arco start` for a foreground run. Service settings
69
70
  come from `ARCO_HOME`, `ARCO_PORT`, `ARCO_HOST`, and the other supported
70
71
  environment values saved at first install. Existing unowned or modified service
71
72
  definitions are refused.
72
73
 
73
- On Windows, `npm install -g arco-workbench` over a running packaged service
74
- fails. npm prints `npm warn cleanup` lines with `EPERM` under
75
- `%APPDATA%\npm\node_modules\arco-workbench`, then `EEXIST` on
76
- `%APPDATA%\npm\arco.cmd`. The `EEXIST` and leftover `arco`, `arco.cmd`, and
77
- `arco.ps1` files come from an earlier install under the previous package name
78
- `@ghreprimand/arco`, which provides the same `arco` command. Arco does not
79
- write those three launcher files itself; npm creates them from the package's
80
- `bin` entry.
81
-
82
- To keep a working `arco-workbench` install and its running service, uninstall
83
- the earlier package and recreate the launchers:
84
-
85
- ```sh
86
- npm uninstall -g @ghreprimand/arco
87
- npm rebuild -g arco-workbench
88
- arco version
89
- ```
90
-
91
- `npm rebuild -g arco-workbench` recreates the launcher files without replacing
92
- package files, so it is safe while the service runs. While the launchers are
93
- missing, the package is still intact when this runs (PowerShell: use
94
- `$env:APPDATA` in place of `%APPDATA%`):
95
-
96
- ```bat
97
- node "%APPDATA%\npm\node_modules\arco-workbench\scripts\packaging\arco.mjs" version
98
- ```
99
-
100
- For a fresh install, uninstall `@ghreprimand/arco` first when
101
- `npm ls -g --depth=0` lists it, then install `arco-workbench` (see
102
- [Before a fresh install: remove older copies](#before-a-fresh-install-remove-older-copies)).
103
- If a direct overwrite left the service holding package files open, stop or
104
- uninstall the service before replacing the package. Do not delete
105
- `%USERPROFILE%\.arco` as a routine step; it holds settings and saved work (see
106
- [Uninstall](#uninstall) if that data must go).
107
-
108
- If `npm install -g arco-workbench` fails with `EEXIST` because an `arco` link
109
- already exists in the global bin folder (for example from `@ghreprimand/arco`
110
- or an earlier source checkout's `npm link`), remove that link or uninstall the
111
- listed package (`npm uninstall -g @ghreprimand/arco` when it appears in
112
- `npm ls -g --depth=0`), then install again. For `EACCES` on Linux or macOS, use
113
- nvm or a user-owned npm prefix (for example under Homebrew's Node).
74
+ On Linux or macOS, an `EEXIST` error on the global `arco` link can come
75
+ from an earlier package or a source checkout linked with `npm link`. Uninstall
76
+ that package or remove its stale link before installing again. For `EACCES`,
77
+ use nvm or a user-owned npm prefix (for example under Homebrew's Node).
114
78
 
115
79
  The package starts on port 3001 when available and chooses the next free port
116
80
  through 3099, then an operating-system-assigned port. It saves and reuses the
@@ -123,6 +87,54 @@ LaunchAgent `arco-workbench.plist` with label `arco-workbench`, or the Windows
123
87
  Task Scheduler logon task `arco-workbench`. See
124
88
  [`SERVICE_MODE.md`](SERVICE_MODE.md).
125
89
 
90
+ ### Windows install and launcher recovery
91
+
92
+ Use [Updating Arco](#updating-arco) for an existing install. A direct npm
93
+ overwrite can fail while the packaged service holds files open. npm can
94
+ report `EPERM` during cleanup. A separate `EEXIST` on `arco.cmd` means a
95
+ launcher is already present. In the confirmed case it belonged to
96
+ `@ghreprimand/arco`, an earlier package that also provides `arco`. npm
97
+ creates `arco`, `arco.cmd`, and `arco.ps1` from the package's `bin` entry.
98
+ `arco setup` manages the service and shortcuts.
99
+
100
+ Use the same terminal and npm installation that produced the error. In
101
+ PowerShell, check the installed packages and the launchers npm would use:
102
+
103
+ ```powershell
104
+ npm ls -g --depth=0
105
+ $prefix = npm prefix -g
106
+ Get-Command arco -All -ErrorAction SilentlyContinue
107
+ Get-ChildItem -LiteralPath $prefix -Name |
108
+ Where-Object { $_ -in 'arco', 'arco.cmd', 'arco.ps1' }
109
+ ```
110
+
111
+ The usual prefix is `%APPDATA%\npm`. Use the reported prefix for a custom
112
+ installation. If a launcher remains, open it as text and look for
113
+ `node_modules\@ghreprimand\arco`, `node_modules\arco-workbench`, or a
114
+ linked source checkout. Check each remaining launcher, since they can point
115
+ to different targets. Remove only stale launchers whose targets belong to
116
+ the Arco copy being removed.
117
+
118
+ If the older package is listed, remove it with
119
+ `npm uninstall -g @ghreprimand/arco`. If the current package is intact and
120
+ its launchers are missing, recreate them with `npm rebuild -g arco-workbench`.
121
+ Then run `arco version` and `arco doctor`. The version identifies which
122
+ package the launcher reaches. The doctor checks the runtime and native
123
+ modules. If the launcher is missing, run the same checks from the package
124
+ directly in PowerShell:
125
+
126
+ ```powershell
127
+ $cli = Join-Path $prefix 'node_modules\arco-workbench\scripts\packaging\arco.mjs'
128
+ node $cli version
129
+ node $cli doctor
130
+ ```
131
+
132
+ A failed direct overwrite can leave package files or dependencies incomplete.
133
+ If the installed package cannot run or fails its runtime checks, follow the
134
+ [manual package update steps](#packaged-install) with the service stopped.
135
+ Keep the Arco home with its settings and saved work. To remove all older
136
+ copies, follow [Before a fresh install: remove older copies](#before-a-fresh-install-remove-older-copies).
137
+
126
138
  ### Source checkout
127
139
 
128
140
  Contributor source runs retain the checkout commands:
@@ -147,8 +159,15 @@ Studio Build Tools on Windows). Provider CLIs (`claude`, `codex`,
147
159
 
148
160
  If a global install reports `EACCES` on Linux or macOS, use nvm or a user-owned
149
161
  npm prefix. On Windows, use `arco.cmd` if PowerShell execution policy blocks the
150
- shim. If `arco doctor` reports missing or incompatible native modules, install
151
- the platform build tools and run `arco setup --repair-native`.
162
+ shim. Only run `arco setup --repair-native` when Arco reports that a native
163
+ part will not load, including a missing or incompatible module in `arco doctor`.
164
+ The repair requires a working platform build toolchain.
165
+
166
+ A failed repair names the compile or link step when its output identifies it
167
+ and repeats the last decisive error line. Build output stays visible above it.
168
+ Build tools may be missing, out of date or broken; installing them again is
169
+ not always the answer. The installed native parts stay unchanged and keep
170
+ working. Resolve the reported toolchain error before retrying a needed repair.
152
171
 
153
172
  **`NODE_ENV=production` drops dev dependencies.** With `NODE_ENV=production` exported in the shell, `npm ci` and `npm install` skip `devDependencies` (TypeScript, Vite, tsx), so `npm run build` fails with missing type definitions. Install with `env -u NODE_ENV npm ci --include=dev` (POSIX) or `npm ci --include=dev` after clearing the variable (PowerShell: `Remove-Item Env:NODE_ENV`).
154
173
 
@@ -465,10 +484,10 @@ for manual review.
465
484
 
466
485
  On Windows, `arco.cmd` is acceptable if the PowerShell shim is blocked. After
467
486
  uninstalling `arco-workbench`, check `npm ls -g --depth=0` for the earlier
468
- package `@ghreprimand/arco` and run `npm uninstall -g @ghreprimand/arco` when
469
- it is listed; that package owns the `arco`, `arco.cmd`, and `arco.ps1`
470
- launcher files. Then check `%APPDATA%\npm` for any leftover launchers and
471
- remove them before installing again.
487
+ `@ghreprimand/arco` package and uninstall it if it is listed and being removed.
488
+ Check the three launcher names in the prefix reported by `npm prefix -g`.
489
+ Follow [Windows install and launcher recovery](#windows-install-and-launcher-recovery)
490
+ to inspect their targets. Remove only stale launchers for the copies removed.
472
491
 
473
492
  ### 3. Optional: delete Arco data (permanent)
474
493
 
@@ -582,9 +601,10 @@ npm uninstall -g arco-workbench
582
601
  npm uninstall -g @ghreprimand/arco
583
602
  ```
584
603
 
585
- Then confirm `arco version` no longer runs an old copy. On Windows, check
586
- `%APPDATA%\npm` for leftover `arco`, `arco.cmd`, and `arco.ps1`, and remove any
587
- that remain.
604
+ Then confirm `arco version` no longer runs an old copy. On Windows, inspect
605
+ the three launchers under the prefix reported by `npm prefix -g` and remove
606
+ only stale launchers for the copies removed. See
607
+ [Windows install and launcher recovery](#windows-install-and-launcher-recovery).
588
608
 
589
609
  ### 3. Stop a source checkout
590
610
 
@@ -740,6 +760,145 @@ SSH session reaches it. Set `ARCO_HOST=0.0.0.0` **only** when you deliberately
740
760
  want LAN/tailnet clients to reach the surface directly - there is no user login,
741
761
  only the browser session cookie and the Host and Origin check above.
742
762
 
763
+ ### Upload from phone
764
+
765
+ Open **UPLOAD FROM PHONE** beside Attach and scan the code on a phone on the
766
+ same private network or tailnet as this computer. The picker accepts photos,
767
+ PDFs, text and supported office documents. There is no account or relay. The
768
+ window lists each offered private IPv4 origin as `http://<ipv4>:<port>` from
769
+ the listener (home LAN and Tailscale addresses when present). It never lists
770
+ MagicDNS names, machine names or the desktop page's proxy URL. When several
771
+ origins appear, choose one. The QR encodes the full upload link for that origin
772
+ (`/phone-upload` plus the secret after `#`). The line under the code shows the
773
+ origin only, so you can tell which address and port it is using.
774
+
775
+ When the server itself listens on a private address (`ARCO_HOST` set to
776
+ `0.0.0.0`, `::` or one private address), the code uses that listener. With the
777
+ default loopback bind, opening the window starts a temporary phone listener on
778
+ each private IPv4 network and tailnet address of this computer, container
779
+ bridges excluded, one address at a time and never a wildcard. It tries Arco's
780
+ own port first and takes a free port on an address where that is taken. It
781
+ answers only the phone upload page and its upload endpoint; every other path
782
+ returns 404 and WebSocket upgrades are refused, so the workbench, its API and
783
+ the terminal stay on loopback. It closes about a minute after no code is open
784
+ and no upload is in progress. The main server's bind does not change.
785
+
786
+ Each offered address is marked UNVERIFIED until a file arrives through it.
787
+ After a successful upload the address is marked VERIFIED BY UPLOAD with the
788
+ time it last worked; the open window shows this on its next poll. The address
789
+ and port, its mark and, once it has worked, `Last worked` with the time each
790
+ take their own line, in the choice buttons when several addresses are
791
+ available and under the code for the chosen address, so a narrow window wraps
792
+ them cleanly. If one address does not open on the phone and another is
793
+ offered, close the window, open it again and choose the other address. Arco
794
+ knows it opened a listener there but cannot tell from the computer whether the
795
+ phone can reach it: the firewall or the network (a guest Wi-Fi, a router that
796
+ keeps devices apart) may block it, and settings can change after an address has
797
+ worked. **More info**, shown once in the window, says so and lists what to
798
+ check. Arco does not inspect the
799
+ firewall; reading its rules can need administrator rights and start a password
800
+ prompt.
801
+
802
+ The result is kept in `phone-upload-routes.json` in Arco's home: for each
803
+ address and port, only the time a file last arrived through it, at most 16
804
+ entries, written atomically and read again after a restart. Opening a code and
805
+ failed uploads record nothing, and the file holds no phone address, file name,
806
+ size or link token. If the file cannot be written the upload still succeeds and
807
+ the log has one line with the error code. Deleting the file while Arco is
808
+ stopped returns every address to UNVERIFIED; a running Arco keeps its copy in
809
+ memory and writes it back on the next successful upload.
810
+
811
+ Arco makes no firewall or system change. If the phone cannot open the page,
812
+ check that it is on the same network and that the computer's firewall allows
813
+ incoming connections on the port in the code; **More info** says so. Windows and
814
+ macOS may ask once whether Node.js may accept connections; allow it on private
815
+ networks. The phone itself must connect directly; an upload that arrives
816
+ through a reverse proxy such as Tailscale Serve is refused.
817
+
818
+ The phone page uses the Arco theme that was active on the computer when the
819
+ code was opened: its colours, borders and, for the themes that use a font
820
+ bundled with Arco (Victor Mono, Excalifont), that font. Other theme fonts load
821
+ from the internet on the computer, so the phone uses its own font instead. The
822
+ desktop page sends the theme's applied values with the request that opens the
823
+ code; the server keeps only fixed colour, border and font-name values that pass
824
+ strict checks, and the phone page reads them, and any bundled font, with the
825
+ code's token from the same `/phone-upload` path. No CSS, HTML or URL from the
826
+ desktop reaches the phone page, the page makes no request outside Arco, and the
827
+ page's content security policy is unchanged. A page that cannot read the theme
828
+ keeps its plain look.
829
+
830
+ The code allows uploads for five minutes, with up to 10 files, 20 MiB per file
831
+ and 100 MiB total. Closing it revokes further uploads but keeps files already
832
+ in the draft. The original conversation receives the attachments, and its
833
+ normal Send submits them. Arco removes discarded phone attachments and expires
834
+ unsent ones after 30 minutes. Anyone on the private network who obtains the
835
+ code may put a file in that draft. Plain HTTP can be observed on the network.
836
+ Use a trusted private network and review attachments before sending.
837
+
838
+ #### Same private LAN - upload only
839
+
840
+ Goal: the phone puts files in one draft. The workbench stays on this computer.
841
+
842
+ 1. Leave Arco on the default bind (`ARCO_HOST=127.0.0.1`). The desktop page stays
843
+ on loopback (or the packaged local URL).
844
+ 2. On the computer, open the conversation and press **UPLOAD FROM PHONE**.
845
+ 3. If several addresses appear, each shows the origin, then **UNVERIFIED** or
846
+ **VERIFIED BY UPLOAD**, then **Last worked** with a time when verified, each
847
+ on its own line. Choose the home-LAN origin, for example
848
+ `http://192.0.2.10:3001`. That line is the address and port only. **More info**
849
+ (once in the window) explains reachability and what to check.
850
+ 4. On the phone, join the same Wi-Fi or LAN as the computer (not a guest network
851
+ that isolates clients). Scan the QR code so the phone opens the full link.
852
+ Do not type only the origin shown under the code; that address alone is not
853
+ the upload page with the link token. Use **Take Photo** or **Choose Files**.
854
+ 5. If the page does not load: confirm the same network; allow incoming
855
+ connections on the private profile for the port in the origin (Windows and
856
+ macOS may ask once); on Linux, allow that TCP port only on the private or LAN
857
+ zone. Do not open it to the public internet. Arco does not change the
858
+ firewall.
859
+ 6. After a file arrives, the desktop mark becomes **VERIFIED BY UPLOAD** with
860
+ **Last worked** and the local time. Review attachments, then **Send**.
861
+
862
+ This path is not setting `ARCO_HOST=0.0.0.0` so phones browse the full
863
+ workbench. That bind exposes filesystem and control surfaces with only the
864
+ session cookie and Host/Origin checks (see Exposure posture above).
865
+
866
+ #### Same Tailscale tailnet - upload only
867
+
868
+ Goal: phone and desktop share a Tailscale network; upload uses the Tailscale
869
+ IPv4 origin in the chooser.
870
+
871
+ 1. Install Tailscale on the Arco computer and the phone; sign both into the same
872
+ tailnet. MagicDNS names help the operator recognise devices in the Tailscale
873
+ console; they do not appear in Arco's chooser.
874
+ 2. Keep Arco on the default loopback bind for the desktop session.
875
+ 3. Open **UPLOAD FROM PHONE**. When several addresses appear, choose the
876
+ Tailscale IPv4 origin Arco shows (CGNAT `100.x` form). Origins are always
877
+ `http://<ipv4>:<port>` from the listener; never a MagicDNS name.
878
+ 4. On the phone (cellular or another network is fine if Tailscale is up), scan
879
+ the QR for the full upload link. Direct connection only: do not put the
880
+ upload URL behind Tailscale Serve or Funnel; Serve and reverse-proxy uploads
881
+ are refused.
882
+ 5. Allow the port in the origin for the Tailscale interface or zone if the OS
883
+ firewall blocks it; do not publish that port on the public internet.
884
+ 6. A successful upload marks that origin **VERIFIED BY UPLOAD** as on the LAN
885
+ path.
886
+
887
+ Peer connectivity on a tailnet normally needs no extra inbound ports on the LAN
888
+ edge; still allow the Arco phone-upload port on the Arco host so the phone's
889
+ Tailscale interface can reach that listener.
890
+
891
+ #### Whole Arco on a private network (contrast)
892
+
893
+ When the operator wants the full UI from another device on a trusted private
894
+ network or via Tailscale Serve HTTPS, that is a deliberate bind or Serve setup
895
+ (`ARCO_HOST` and/or Tailscale Serve as in [Remote management](REMOTE_MANAGEMENT.md)
896
+ and Exposure posture). There is still no user password - only the browser
897
+ session cookie and Host/Origin checks. That path is separate from **UPLOAD FROM
898
+ PHONE**. The QR temporary listener answers only `/phone-upload` and its upload
899
+ API; it does not open the workbench, API or terminal. Never use Funnel or any
900
+ public relay to expose Arco or the upload listener.
901
+
743
902
  The **Security & Exposure** group in the System modal's Diagnostics tab (and the
744
903
  support bundle) reports this posture: bind address, terminal/git/filesystem/
745
904
  credential exposure, preview proxy, local model endpoints, and risky env flags -
@@ -898,6 +1057,8 @@ The shape regression is pinned by
898
1057
 
899
1058
  ### Reproducing the live unit on a clean install
900
1059
 
1060
+ Installed packages may have no Git checkout. Startup revision probes then keep the revision unknown and the code-skew diagnostic skipped, without printing a fatal Git line. This does not prevent the server from starting.
1061
+
901
1062
  Deployment caveat: `core.code-skew` compares startup Git HEAD with current HEAD,
902
1063
  not asset contents. Committing an already-deployed build or documentation alone
903
1064
  can warn without a pending runtime fix. For a verified **client-only** update,
@@ -162,6 +162,9 @@ Since 0.1.4 a live `events.jsonl` that passes 16 MiB (`ARCO_EVENT_SEGMENT_BYTES`
162
162
  - Effective sequence numbers: releases before 0.1.5 wrote a checkpoint record with its checkpoint's number, so a log can repeat a number (each checkpoint) or go back to an older one (REVERT TO HERE), and a restart right after such a record continued from it, reusing numbers. Nothing on disk is rewritten. The `workflowStore` readers (`replayEvents`, `replayEventsWithTs`, `replayTailEvents`, `scanEventsOfTypes`, `readEventsPageBefore`) give each record, in file order, the number max(own, previous + 1), and set `parentEventSeq` to the previous one where the number changed; a log in order keeps its numbers. When numbers drift past records the log already held, the tail and from-seq readers read the whole history so every reader agrees. On first use (`initWorkflowStore`) the whole history is scanned once, and new records continue after the last effective number.
163
163
  - An unreadable segment is reported and skipped by readers; the history shows a gap unless the live file still holds those records, and nothing is deleted. This includes a segment removed or replaced between listing and opening it (ARCHIVE or DELETE running while a reader reads the history): the open error goes to the reader, not to the process. `arco storage unseal` stops for that conversation and keeps its segments.
164
164
  - A log whose `log-format.json` names a newer format is not written to; events still reach open tabs.
165
+ - Asynchronous record readers use 64 KiB input chunks for the live file and stream Brotli decompression for sealed files. Only the current record is assembled before decoding, preserving UTF-8 split across chunks, CRLF and an unfinished last line. Records above 16 MiB are still read in full, with one warning per source file per process; this is not a refusal or a fixed memory cap on unusually large records. Reading does not rewrite, move or convert any log. Full-history callers still determine how many decoded records they retain.
166
+ - Native resume reads a byte-addressed source through `openLogByteSource`: raw bytes for plain logs, or newline-normalized, overlap-filtered bytes for sealed history. Size counting and range reads stream; no whole-history string or sealed-history buffer is created. The existing summary boundary, delivery projection, branch walk, max-sequence cutoff and cache format are unchanged. Replay still retains the event arrays required by those algorithms, so this is not a fixed memory bound for reconstruction.
167
+ - Native reconstruction refuses an uncached range above 1 GiB (1,073,741,824 bytes) before parsing it into an event array. This covers whole-log exact/rewind reconstruction and the older prefix when no valid summary cache exists. `NativeReconstructionLimitError` reaches the existing one-line conversation notice; the agent continues without rebuilt context and the earlier transcript remains. A valid summary cache and small tail can still resume a larger history without parsing its old prefix. This is a fixed product guard, not a setting, heap flag or projection change. In cold synthetic runs with the ordinary 4,288 MiB Node heap, a near-768 MiB history used 2,844,948 KiB peak RSS and about 2,430 MiB sampled heap; a near-1 GiB history used 3,691,200 KiB peak RSS and about 3,035 MiB heap, leaving about 1,253 MiB (29 percent) of measured heap margin. The bound follows the larger completed run; retained event shapes and other server activity still affect memory. Claude CLI loading completed the separate 2 GB fixture and does not use this Native reconstruction guard.
165
168
  - Every reader goes through `eventLog.ts`: `readLogLines`, `readLogText`, `readLogTail`, `readLogHeadSync`, `readLogTailSync`. Do not open `events.jsonl` directly in new code.
166
169
  - Closed conversations are not written to, so they are sealed only on request: COMPRESS OLD LOGS (`POST /api/storage/compress-logs`) seals a project's closed conversations whose live log is at least 1 MiB (`workflowStore.sealWorkflowLogNow`).
167
170
  - `arco storage unseal` (`npm run storage:unseal` in a checkout) writes each sealed history back to one plain `events.jsonl`, checks it, then removes the segments and the marker. It leaves out only the live copies of sealed records (the same rule as the readers) and keeps every other live record in its place, older numbers included; the server's `unsealLog` and `scripts/packaging/storage.mjs` follow the same rule and are tested on the same fixtures. It refuses while Arco is running and skips a linked `.arco`, `.arco/workflows` or conversation folder.
@@ -283,6 +286,8 @@ Missing metadata is recreated from the authoritative workflow configuration at c
283
286
 
284
287
  Recreating a file cannot recover an id already lost before restart. Arco does not guess from the session index or provider rollouts. Codex, Cursor and Claude CLI tabs with earlier replies but no saved external conversation show `CTX: -`; old usage remains historical. A new provider conversation produces one durable notice, then waits for its own context reading. Claude Native and local providers can replay their retained history without an external id. Missing authored state still needs its originals or a backup.
285
288
 
289
+ A missing live log can mean that a workflow has no saved turns. A live log path that opens but is not a regular file counts as a reconstruction failure even if its reported size is zero. A Native reconstruction failure adds one persisted `system_notice` through the existing conversation-notice path: "Earlier context could not be rebuilt for this conversation, so the agent continues without it. Earlier messages remain in this tab." For a refused oversized parse, the same line names the 1024 MiB reconstruction limit. It does not delete or rewrite history. A CLI initial-history read failure similarly says that the saved conversation is intact and future messages will appear when readable. These notices describe different failures from a lost external conversation id; they do not claim that the provider lost its saved conversation.
290
+
286
291
  Per-workflow identity file. Atomic writes via `atomicFile.ts`. The type is `WorkflowMeta` in `server/src/workflowMeta.ts` (exhaustive list there); `workflowConfigFromMeta` is the single meta -> `WorkflowConfig` projection used on rehydrate and Past Chats reopen - a new persisted per-tab field must be added to **both** or it silently resets on restart.
287
292
 
288
293
  ```ts
@@ -415,7 +420,7 @@ Why each part:
415
420
  - **`disableRssGuard`** - opt-out for the 32 GB tree-RSS kill. Set only for workflows running legitimate high-memory workloads (kernel compiles, big LTO links). Honored only for primary turns; reviewers and handoff reflections always run under the global cap.
416
421
  - **`preview`** - `{ port, framework?, manual }`. Currently bound dev-server port for the Preview tab. `manual: true` means the operator typed the port and hit BIND; `manual: false` means `previewAutoDetect` resolved it. The auto-detector never overwrites a `manual: true` entry. On rehydrate the server broadcasts `preview_set` with `freshlyBound: false` so the UI restores the iframe without auto-flipping the active tab.
417
422
  - **`previewHistory`** - most-recent-first list of bound dev-server ports for this workflow (capped at 5). Append on every successful `set_preview_port`; consecutive same-port events dedupe to a timestamp refresh. Replayed via `preview_history` on rehydrate alongside `preview_set` so reconnect doesn't lose the chain.
418
- - **`claudeTransport`** - `'cli' | 'native' | undefined`. Per-tab override of the global `claude.transport` setting. Persisted so tab reload picks up the choice without consulting cascade. **Meta-reconcile is gated on `claudeTransport !== 'native'`** - Native sessions write no CLI rollout, so the dispatcher must not pin a phantom CLI session UUID on `wf.primarySessionId` (it would auto-degrade an original-worker Spawn into a `claude --resume <phantom>` against a missing rollout, killing the handoff silently). **Session storage note:** the Claude Native transport writes to the same `~/.claude/projects/<cwd-hash>/<sessionId>.jsonl` path that the CLI transport uses - it's Claude Code's own session file, written by the SDK's built-in JSONL logger. Arco reads this file via the session watcher (`chokidar`) to drive `session_entry` events regardless of transport.
423
+ - **`claudeTransport`** - `'cli' | 'native' | undefined`. Per-tab override of the global `claude.transport` setting. Persisted so tab reload picks up the choice without consulting cascade. **Meta-reconcile is gated on `claudeTransport !== 'native'`** - Native sessions write no CLI rollout, so the dispatcher must not pin a phantom CLI session UUID on `wf.primarySessionId` (it would auto-degrade an original-worker Spawn into a `claude --resume <phantom>` against a missing rollout, killing the handoff silently). **Session storage note:** the CLI writes `~/.claude/projects/<cwd-hash>/<sessionId>.jsonl` (or the configured Claude home). Arco's `sessionJsonl.ts` watcher reads only bytes after its last complete newline, using 64 KiB chunks and leaving a partial record for the next notification. It watches the parent directory so replacing the file does not strand the watcher on the old inode; a changed file identity or a size below the saved offset resets reading to byte zero. The watcher never writes the session file. Native history is rebuilt from Arco's event log and does not start this CLI watcher. Initial CLI loading uses the same 64 KiB chunks, decodes one complete LF-terminated record at a time, and returns the complete byte boundary for the watcher. It still retains the entries required by the existing history API; paging is unchanged. A missing file is empty history; other read failures produce one session-history notice. The watcher is still installed and anchors at the first readable complete boundary, preventing historical terminal rows from becoming false concurrent-session warnings.
419
424
  - **`codexTransport`** - `'exec' | 'appserver' | undefined`. Per-tab override of the global `codex.transport` setting; same persistence semantics.
420
425
  - **`claudeNativeCompact`** / **`autoHandoff`** - per-tab toggles for Native server-side compaction and Arco-managed handoff. See PROVIDERS.md Native management.
421
426
  - **Legacy `efficiencyAutoCompact`** - read only for migration: conservative becomes On at 80%, aggressive becomes On at 70%, and off leaves Provider. A saved explicit policy wins.
@@ -797,7 +802,7 @@ Global shape (representative subset):
797
802
  ollama?: { baseUrl?, backends?, modelHostMap?,... }, lmstudio?: { baseUrl? },
798
803
  fallbackChains?, autoHandoffDefaults?, handoffSummarizer?, defaultProjectTrust?, mediaUnconfined?, mediaAllowedRoots?, pinnedServices?, tabOrder?,
799
804
  onboardingComplete?, providerConfirmed?, // first-run setup finished or skipped; a provider check succeeded
800
- autoMarkDoneOnMetSignoff?, // Settings > Agents and clusters > Board auto-done
805
+ autoMarkDoneOnMetSignoff?, // Board auto-done; absent means on
801
806
  //...
802
807
  }
803
808
  ```
@@ -16,6 +16,7 @@ This doc covers each one end-to-end: trigger, server flow, events emitted, clien
16
16
  | [1. Primary turn (the seed worker)](#1-primary-turn-the-seed-worker) |
17
17
  | [2. Review](#2-review) |
18
18
  | [3. Handoff](#3-handoff) |
19
+ | [Copy turns to a new worker](#copy-turns-to-a-new-worker) |
19
20
  | [4. Spawn from here](#4-spawn-from-here) |
20
21
  | [5. DOCS and GIT one-off prompts](#5-docs-and-git-one-off-prompts) |
21
22
  | [6. HISTORY-tab actions](#6-history-tab-actions) |
@@ -562,6 +563,47 @@ sequenceDiagram
562
563
 
563
564
  ---
564
565
 
566
+ ## Copy turns to a new worker
567
+
568
+ TRANSCRIPT in any Agent composer can open a fresh worker with exact copied
569
+ turns. A standalone source opens the new-worker form; a cluster source keeps
570
+ its existing peer-delivery form and offers NEW WORKER. Existing peer sends and
571
+ Spawn are unchanged: Spawn still uses an agent-written handoff in the same cwd.
572
+
573
+ Choose the last 1-50 operator turns (default 3), an optional preface, working
574
+ directory, provider/model/effort/account and permission setting. Permission
575
+ prompts start on. The source's raw operator and visible primary text retain
576
+ whitespace and ordering. Contiguous output deltas are joined before framing;
577
+ literal USER/AGENT lines remain quoted JSON data. Thinking, injected project
578
+ instructions, mail and transport metadata are excluded. Tools become one-line
579
+ name/status receipts with output omitted; attachment receipts name their source
580
+ location/type without copying files. Relative paths refer to the source project.
581
+
582
+ PREVIEW reads the server's stored history, including records missing from the
583
+ browser tail. The running partial turn is omitted unless selected. The preface
584
+ is at most 4096 UTF-8 bytes and the complete seed at most 32768 bytes; an
585
+ oversized selection is refused, never clipped. Rewound sources follow the
586
+ current branch; missing ancestry cannot produce an exact preview. Each preview
587
+ binds a fixed source cutoff, selected content and structural history marker.
588
+ Ordinary later appends are outside that snapshot. Rewind or changed content
589
+ requires a refreshed preview. Source and destination validation finishes before
590
+ creating the tab; errors retain the form and preface.
591
+
592
+ SEND TO NEW WORKER creates a normal standalone Agent workflow and dispatches
593
+ that accepted seed once as its first user message. The preface comes before the
594
+ source label and quoted records. Sign-in files, source pins, cluster membership,
595
+ goals and provider session ids are not copied. Destination settings apply as
596
+ for a normal new tab. Repeated delivery of the same accepted preview returns
597
+ the existing new workflow rather than creating or seeding another one. The
598
+ source continues independently. The copied seed is saved in the new project's
599
+ normal conversation state.
600
+
601
+ The implementation uses `transcriptWorker.ts`, browser-only handlers in
602
+ `ws/transcriptWorkerHandlers.ts`, the normal workflow creator/turn engine and a
603
+ streaming view of workflow events. It retains a limited candidate ring; rewind
604
+ ancestry and tool linkage use metadata rather than old payload arrays. It does
605
+ not change Native reconstruction, old replay protocols or history paging.
606
+
565
607
  ## 4. Spawn from here
566
608
 
567
609
  The child keeps its own admission through preparation and pre-warm. Cancelling the child stops its pending preparation; cancelling an original-worker reflection also revokes that reflection. Once the parent is released, later parent turns are independent of the child's pre-warm. Stale callbacks cannot seed or complete into a newer child turn.
@@ -18,11 +18,15 @@ Cluster mode groups tabs sharing one cwd so members can hand notes between opera
18
18
 
19
19
  ### Peer messaging (workflow-scoped)
20
20
 
21
+ Select a sent or received PEER card in the conversation to read the available
22
+ message in a dialog. Older sent records may contain only a preview; the dialog
23
+ says when the full body was not saved. Close the dialog to return to the card.
24
+
21
25
  Three workflow-scoped event kinds - emitted on each member's own `broadcastWorkflow` channel so events.jsonl carries the per-member view.
22
26
 
23
27
  #### `peer_message_sent` <-
24
28
 
25
- Emitted on the sender's workflow when `peer_send` succeeds. Carries a content preview only; the full content lives on the recipient's matching `peer_message_received`.
29
+ Emitted on the sender's workflow when `peer_send` succeeds. New events carry the full content and a compact preview; older sender events may have only the preview. The recipient's matching `peer_message_received` carries the delivered content.
26
30
 
27
31
  ```ts
28
32
  {
@@ -32,6 +36,8 @@ Emitted on the sender's workflow when `peer_send` succeeds. Carries a content pr
32
36
  from: string, // sender workflowId (== workflowId above)
33
37
  to: string, // recipient workflowId
34
38
  contentPreview: string, // up to 200 chars
39
+ content?: string, // full content on new events
40
+ ts?: number, // original send time
35
41
  chainDepth?: number, // auto-turn chain depth; stamped server-side at broadcast (operator-initiated sends ride at depth 0). The auto-turn detector refuses to fire when chainDepth ≥ AUTO_TURN_MAX_CHAIN_DEPTH.
36
42
  }
37
43
  ```
@@ -271,8 +277,9 @@ session. The server clones the source WorkflowConfig plus name/role/tier/focus,
271
277
  then applies every field the request carries: provider/model/effort/account,
272
278
  access, `name` (non-empty renames), `role` (empty clears; a second director is
273
279
  refused with `multiple_directors`) and the member tuning above.
274
- `includeHistory` and `transferActiveTasks` are independent opt-ins. ISOLATED
275
- members reject both options.
280
+ `historyMode` and `transferActiveTasks` are independent choices. History defaults to `none`; legacy `includeHistory: true` selects `full`. ISOLATED members reject history and task transfer. `recent` accepts 1 to 50 turns (default 10) within a 128 KiB seed; `full` preserves the old transcript and action digest within 512 KiB, otherwise fitting the newest contiguous whole turns within that budget through the shared transcript reader. Tools and attachments become receipts in reduced copies. No text is clipped; an oversized newest turn can produce an explicit zero-turn copy.
281
+
282
+ New clients request `transcript_worker_preview` with `replacement: { clusterId, mode }` and send its token. The existing socket-owned cache fixes the cutoff and checks the history again before replacement. Preview fields include selected/requested/available turns, bytes, `truncated` and `historyFallback`; REPLACE stays disabled until the preview completes. Changed or rewound history requires a fresh preview. Legacy requests without a history mode still work without a token. A partial copy adds one persisted `system_notice` in the new workflow; old conversation files remain. The existing fitting full-history renderer retains its event array; this change does not promise bounded memory for that legacy renderer.
276
283
 
277
284
  ```ts
278
285
  {
@@ -292,7 +299,10 @@ members reject both options.
292
299
  efficiencyToolFilter?: 'off' | 'conservative' | 'aggressive',
293
300
  fastMode?: boolean,
294
301
  autoCompaction?: { enabled: boolean, thresholdPercent: number } | null,
295
- includeHistory?: boolean,
302
+ includeHistory?: boolean, // legacy true selects full
303
+ historyMode?: 'none' | 'recent' | 'full',
304
+ historyTurns?: number, // 1..50, default 10
305
+ historyToken?: string, // required by new history-mode clients
296
306
  transferActiveTasks?: boolean
297
307
  }
298
308
 
@@ -451,6 +461,8 @@ Operator edited a member's work-size hint from the Members sub-tab. `tier` is on
451
461
 
452
462
  Efficiency guides coordination and testing. Balanced, the default for new clusters, asks for one lowest-level test per real fault, tests for the changed area per change, and the full check once before a release. Browser tests cover journeys that need a real screen, one per journey rather than layout, theme or size permutations. New suites, gates, test tooling and CI checks need operator approval, using the operator-question tool where available. The full check should take about ten minutes; longer runs prompt a proposal to cut work before adding tests. Flaky tests are fixed or deleted, not retried. Lean runs only changed-area tests and adds tests only for faults found; the full check runs only when requested. Thorough tests new behaviour and faults, runs neighbouring tests and the full check before handover. Every level sorts product faults from test faults and states what a user would lose before a failure blocks work; product faults and faulty tests are fixed, while cosmetic or momentary faults are noted. Project rules and plans take precedence when they ask for more or less testing. Safety checks, message guards, requested review and landing review remain unchanged. Every member receives the testing directive each turn. Directors assign complete outcomes, read the accepted diff and check that project-required checks ran; they do not invent gates or make one-off incidents into permanent rules or tests without the operator. Directors classify each failed check as a product fault or a fault in a test, housekeeping rule or CI service. Product faults are fixed. Faulty tests or rules are fixed, skipped on that system with a stated reason, or deleted so checks go green and can be trusted; red checks are neither ignored nor released over. A job dropped by the CI service is rerun alone. CI stays small enough to pass in one run and contains checks whose failures tell the operator something about the product. Housekeeping findings warn instead of failing a run. Peers report what was done, what ran and what remains uncovered. The Tester runs project checks and tests peer work where a real fault is likely, modifying test files only. Long checks go to peers; Directors never run builds, tests or CI waits themselves or wait more than 60 seconds inside a turn. Nudges, mail notices and auto-pickup follow the testing directive without adding checks.
453
463
 
464
+ Non-Director members and standalone agents wait inside their turns for build, test or CI results needed by their reports. Each command or polling step lasts at most 120 seconds and may be repeated as long as the job needs. Between waits they check and act on new messages, using `peer_read` in a cluster. They report after the result arrives. After a progress report or an answer while assigned work remains, non-Director members and standalone agents continue that work in the same turn; they end the turn only when it is done or with one stated blocker. If blocked or if a job clearly cannot finish within a reasonable time, they name what they await and say that a nudge is needed before ending the turn. This instruction change adds no completion wake or waiting-status display. The provider prompt supplies the wait rule once. Cluster coordination and the Director contract do not repeat it. Local-provider baselines stay role-neutral until turn preparation or handoff prewarm resolves the member role.
465
+
454
466
  Message guard is a separate control beside Efficiency and in cluster creation. `messageGuard` has `{ mode: 'warn' | 'hard' | 'none', threshold: number }`; thresholds are integers from 1 through 1000. Warn only accepts legitimate sends above the threshold and adds one warning to a successful send result per sender per primary turn. Hard limit refuses mail at the cap; refused mail is not delivered. No limit removes the peer-send quota only, retaining automatic-execution, provider, permission, size and deduplication limits. Its retained threshold is used if a bounded mode is selected later.
455
467
 
456
468
  Successful model send results include `guard` with `mode`, `count`, `cap`, `threshold`, `remaining` and an optional `warning`. Cap/remaining are null outside Hard limit; threshold is null for No limit. Counts span all recipients and reserve capacity before enqueue to fence concurrent sends. Failed/refused sends refund their reservation. The existing `primary_turn_started` boundary resets counts and warning state for that sender; these counters are process-local and are not restored after server restart. Consolidate related information for the same recipient; do not start turns to evade a cap. Operator-driven transcript sends keep their existing explicit bypass.
@@ -465,6 +477,37 @@ Omitted `addendum` keeps NOTE; empty clears it; non-empty replaces it, trimmed t
465
477
 
466
478
  All new creation paths use explicit Balanced, Warn only at 15, a cluster-local board and progress tracking set to Both. Explicit creation settings override those defaults. Stored omitted style fields still mean Thorough; old omitted board fields keep the existing interpretation. Snapshot restore uses saved settings and old-format fallbacks rather than creation defaults. No existing board is moved, merged or copied by the new default. Guard state rides in cluster state and snapshot metadata; automatic-execution arming remains off on restore.
467
479
 
480
+ ### `cluster_skills_set` ->
481
+
482
+ The operator's SKILLS control beside EFFICIENCY lists configured cluster pins.
483
+ Settings > SKILLS offers PIN TO TAB and PIN TO CLUSTER; a cluster target is all
484
+ members or an exact saved role string, including a custom role. Agents have no
485
+ pin or unpin tool. Built-ins use an editable project/global copy, as tab pins do.
486
+
487
+ ```ts
488
+ { type: 'cluster_skills_set', clusterId: string,
489
+ pins: Array<{ scope: 'project' | 'global', slug: string, role?: string }> }
490
+ ```
491
+
492
+ This replaces the cluster's `skillPins` array under its metadata lock and
493
+ echoes it in `cluster_state`. Empty clears it; omitted metadata means no pins.
494
+ No bodies are stored in cluster or tab metadata. Each turn resolves all-member
495
+ pins, matching-role pins and direct tab pins, deduplicated by source and slug.
496
+ Inherited project skills resolve from the cluster project, including for an
497
+ isolated member. Added, replaced, restarted and snapshot-restored members inherit
498
+ the current pins without copying them into their own `pinnedSkills`.
499
+
500
+ The combined per-member set has the existing 12-skill and 64 KiB body limits.
501
+ An addition over either limit is refused before saving. Role changes and member
502
+ replacement validate the proposed set too. Direct tab-pin edits share the
503
+ cluster lock so concurrent edits cannot each validate against stale state.
504
+ Configured role targets are checked even when they currently have no member.
505
+ Removing pins remains possible after a skill grows. On later turns missing,
506
+ off or overgrown skills use the existing skipped-skill notice and bounded
507
+ resolver. The popup keeps missing/off references visible instead of silently
508
+ retargeting a moved or deleted skill. The count is configured entries, not a
509
+ claim that every pin applies to every member. Running turns are unchanged.
510
+
468
511
  ### `cluster_progress_set` ->
469
512
 
470
513
  2026-06-29 - operator picked which surface(s) the cluster keeps current, from the ClusterRightPanel progress chip or the `+ NEW` cluster creator. `mode` is one of `CLUSTER_PROGRESS_MODES` (`plan` / `board` / `both`; server rejects unknown strings with `cluster_progress_set rejected: unknown_mode`, unknown cluster with `unknown_cluster`). Each mode resolves server-side (`clusterProgress.ts` `buildProgressDoctrine(mode, hasPlan, hasBoard)`) to a deterministic system-prompt doctrine block injected into every member's next turn - a plan-upkeep clause (keep the shared plan's `[ ]`/`[x]` current via `cluster_plan_tick`), a board-upkeep clause (move tasks through their statuses as work progresses), plus a reconcile line when BOTH surfaces are live. Each clause is gated on the surface actually existing (`hasPlan` / `hasBoard`), so a mode with no matching surface injects nothing. The progress default `both` is non-empty: pre-feature clusters with a plan start getting the upkeep nudge. Takes effect on each member's **next** turn (in-flight untouched). Server persists to cluster `meta.json` and rebroadcasts `cluster_state`; `cluster_state.progressTracking` is echoed only when non-default (absent ≡ `both`). Passes the four-question test: operator-set, deterministic doctrine, logged via `cluster_state`, reversible by flipping the chip.
@@ -871,6 +914,8 @@ Evaluator adapters (`server/src/smartPickupAdapters.ts`), reported by `GET /api/
871
914
  | Codex | a fresh `codex -c mcp_servers={} app-server` in an empty temporary folder; `thread/start` with `sandbox: read-only`, `approvalPolicy: never`, `config.web_search: disabled`, `ephemeral: true` and no resume; `turn/start` with a read-only `sandboxPolicy`; only the last final-answer agent message is kept; any item other than the prompt echo, reasoning and agent messages, and any server request (approval, question, dynamic tool), ends the request with no decision and kills the process | available when enabled and signed in |
872
915
  | LM Studio, llama.cpp, Strata, DeepSeek | one shared OpenAI-compatible chat request to the already loaded model, no tools declared, returned tool calls rejected; never loads, unloads or switches a model | available while the chosen model is loaded |
873
916
 
917
+ Cursor and Codex stop the evaluator child before removing its temporary folder. Shared cleanup allows up to 250 ms for child exit and three removal retries with 100, 200 and 300 ms delays, so a Windows child can release its working directory. Cleanup errors never replace the evaluator answer or refusal.
918
+
874
919
  `scripts/smart-pickup-eval.ts` runs the synthetic corpus (`scripts/smoke/fixtures/smart-auto-pickup-corpus-v2.json` by default; `--corpus <path>` selects another corpus, including v1) against one provider and model, or several with `--pairs provider:model,...`, mapping each case through `server/src/smartPickupCorpus.ts` onto the same snapshot input the app builds (open tasks, thread context); it prints each answer, a summary table with the acceptance check for Smart: Automatic (held-out actionable recall at least 0.9, unnecessary wakes at most 10 percent of non-actionable cases, no injection-driven wake, no-decision rate under 5 percent) and a confusion matrix per pair; `--max-calls N` caps the requests of the run; `--provider fake-oracle` makes no request. `--only <case id>` runs one case and `--verbose` prints timestamped phase timings (`initialize`, `session_new`, `set_mode`, `first_token`, `prompt`) and clipped protocol frames; like the app, the script retries a start-up failure once.
875
920
 
876
921
  ### `cluster_auto_turn_fired` <-
@@ -1090,6 +1135,8 @@ task-board contents are not part of a cluster snapshot.
1090
1135
 
1091
1136
  ## Director roles and work size
1092
1137
 
1138
+ A Director is instructed to answer the operator first. For an unresolved issue, the answer recommends the next step, names its owner, and states any operator decision or action and when it is needed. The Director owns worker coordination and says when a worker already owns the follow-up and the operator has nothing to do. It promises later follow-up only when an available trigger can wake it, and asks the operator to nudge the Director only when progress depends on it. New work waits for operator approval; already approved work continues.
1139
+
1093
1140
  A new cluster or preset may have at most one director. Role text beginning with Director or Coordinator identifies a director. Existing clusters and saved presets remain readable without rewriting their roles. Assigning a director to another member is rejected. Legacy clusters that already have two directors remain intact, surface a warning on MEMBERS rows, and still allow REPLACE that preserves both directors' roles. The optional `tier` field is a work-size hint for the director: light for quick edits, standard for normal feature work, and heavy for large or architectural changes. It does not change model or effort and is most useful when several members can take the same work. Template review offers work size only for repeated roles.
1094
1141
 
1095
1142
  ## Composer and task editor recovery
@@ -632,6 +632,45 @@ Fires after handoff. Announces the new CLI session ID and prepares the client to
632
632
 
633
633
  ---
634
634
 
635
+ ## Exact turns to a new worker
636
+
637
+ These operator/browser messages are separate from `spawn_from_here_request`.
638
+ No agent tool exposes them.
639
+
640
+ ```ts
641
+ { type: 'transcript_worker_preview', requestId: string, workflowId: string,
642
+ turns: number, includePartial: boolean, preface: string }
643
+ { type: 'transcript_worker_result', requestId: string,
644
+ preview?: { token: string, seed: string, bytes: number, availableTurns: number,
645
+ selectedTurns: number, partialIncluded: boolean, cutoffSeq: number },
646
+ newWorkflowId?: string, error?: string }
647
+ { type: 'transcript_worker_create', requestId: string, token: string,
648
+ destination: { workingDirectory: string, name: string, provider: ProviderName,
649
+ model: string, effort: EffortLevel, providerAccountRef?: string,
650
+ skipPermissions?: boolean } }
651
+ ```
652
+
653
+ Preview accepts integer turn counts 1-50 and a preface of at most 4096 UTF-8
654
+ bytes. The entire encoded seed has a 32768-byte limit. A running partial turn
655
+ is included only on explicit selection. The server frames exact operator and
656
+ visible primary text, plus bounded tool/attachment receipts, without reading
657
+ attachment files. Hidden reasoning and injected instructions are not copied.
658
+
659
+ The preview token is scoped to its WebSocket and expires after ten minutes;
660
+ the server retains at most 32 preview records. Create revalidates the source
661
+ cutoff/content/branch marker and the destination before allocating a tab.
662
+ Ordinary appends preserve the accepted snapshot; rewind, replacement or an
663
+ unavailable source requires another preview. A repeated create for the same
664
+ token returns the existing new workflow id without a second seed. The normal
665
+ `workflow_created` is initially background-created; the successful response
666
+ lets the requesting form focus that tab. The exact seed is its first normal
667
+ `user_message_echo`, followed by the standard primary-turn events.
668
+
669
+ Destination is a fresh allowlisted WorkflowConfig, not a clone of the source.
670
+ No source resume id, pins, cluster membership or armed run is accepted. The
671
+ chosen provider/account resolves normally without copying sign-in files.
672
+ Existing transcript peer-send and Spawn wire contracts remain unchanged.
673
+
635
674
  ## Related links
636
675
 
637
676
  - [WebSocket protocol](PROTOCOL.md)