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
@@ -9,8 +9,8 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com" />
10
10
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
11
11
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Share+Tech+Mono&display=swap" rel="stylesheet" />
12
- <script type="module" crossorigin src="/assets/index-COfbHCYv.js"></script>
13
- <link rel="stylesheet" crossorigin href="/assets/index-DD9kFGsF.css">
12
+ <script type="module" crossorigin src="/assets/index-C7WzZfsr.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-BEFgrUJJ.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="root"></div>
@@ -1,3 +1,4 @@
1
+ import { PhoneUploadWindow } from './components/PhoneUpload';
1
2
  import { memberReviewScopeSupported, MEMBER_REVIEW_SCOPE_REASON } from './utils/memberReviewScope';
2
3
  import { requestVoicePanel } from './voice/panels';
3
4
  import { CatchMeUp } from './components/CatchMeUp';
@@ -637,6 +638,7 @@ ${scopeBody}
637
638
  }}
638
639
  >
639
640
  <ThemedBackgroundShader />
641
+ <PhoneUploadWindow />
640
642
 
641
643
  <div
642
644
  style={{
@@ -4,7 +4,7 @@ import { OperatorQuestionNotice } from './OperatorQuestionNotice';
4
4
  import { useMessageSelectionStore } from '../stores/messageSelectionStore';
5
5
  import { memo, useMemo, useRef, useState } from 'react';
6
6
  import { useAppStore, type ClusterMemberLabel } from '../stores/appStore';
7
- import ReactMarkdown, { type Components } from 'react-markdown';
7
+ import ReactMarkdown, { defaultUrlTransform, type Components } from 'react-markdown';
8
8
  import remarkGfm from 'remark-gfm';
9
9
  import rehypeHighlight from 'rehype-highlight';
10
10
  import type { ChatMessage as ChatMessageType } from '@arco/shared';
@@ -26,6 +26,7 @@ export type { WrittenFilesIndex };
26
26
  import { useOperatorLabel } from '../utils/operatorLabel';
27
27
  import { useTerminalStore } from '../stores/terminalStore';
28
28
  import { detectCommand } from './Terminal/detectCommand';
29
+ import { DialogShell } from './DialogShell';
29
30
 
30
31
  // Thresholds above which an operator message auto-collapses into a pill.
31
32
  // Either dimension triggers — a single 2000-char paragraph is as intrusive
@@ -89,6 +90,11 @@ function hasMarkdownFileRef(text: string): boolean {
89
90
  return MARKDOWN_FILE_REF_RE.test(text);
90
91
  }
91
92
 
93
+ // A Windows drive path in a Markdown link is a local viewer target.
94
+ function chatMarkdownUrl(url: string, key: string): string {
95
+ return key === 'href' && /^[A-Za-z]:[\\/]/.test(url) ? url : defaultUrlTransform(url);
96
+ }
97
+
92
98
  // Extract pure text from a ReactMarkdown children prop. Markdown headings /
93
99
  // inline-code may pass children as a string, an array of strings, or wrapped
94
100
  // elements (when the heading itself contains nested formatting). We only
@@ -404,7 +410,7 @@ function ChatMessageInner({ message, jobId, jobCwd, writtenFiles, onCancelQueued
404
410
  const renderSystemMarkdown = isSystem && hasMarkdownFileRef(displayContent);
405
411
 
406
412
  // Filename auto-link: any markdown heading / inline `code` / `[link]` / image
407
- // whose text resolves to a file under the workflow CWD opens FileViewerModal.
413
+ // whose text resolves to a project file opens FileViewerModal.
408
414
  // State + modal live at message scope so each bubble owns its own viewer.
409
415
  const [viewerPath, setViewerPath] = useState<string | null>(null);
410
416
  // Shared mousedown coords for all FileLink spans in this bubble. A useRef
@@ -479,7 +485,10 @@ function ChatMessageInner({ message, jobId, jobCwd, writtenFiles, onCancelQueued
479
485
  <CopyablePre {...props} workflowId={jobId}>{children}</CopyablePre>
480
486
  ),
481
487
  a: ({ node: _node, href, children, ...props }) => {
482
- const resolved = href ? resolveChatFilePath(href, jobCwd, writtenFiles) : null;
488
+ let target = href;
489
+ // Markdown encodes local URL characters, including spaces in a checkout name.
490
+ try { if (href) target = decodeURIComponent(href); } catch { /* keep the original spelling */ }
491
+ const resolved = target ? resolveChatFilePath(target, jobCwd, writtenFiles) : null;
483
492
  if (resolved) return <FileLink filePath={resolved}>{children}</FileLink>;
484
493
  return <a {...props} href={href} target="_blank" rel="noopener noreferrer">{children}</a>;
485
494
  },
@@ -678,6 +687,7 @@ function ChatMessageInner({ message, jobId, jobCwd, writtenFiles, onCancelQueued
678
687
  remarkPlugins={[remarkGfm]}
679
688
  rehypePlugins={[rehypeHighlight]}
680
689
  components={markdownComponents}
690
+ urlTransform={chatMarkdownUrl}
681
691
  >
682
692
  {part.value}
683
693
  </ReactMarkdown>
@@ -714,6 +724,7 @@ function ChatMessageInner({ message, jobId, jobCwd, writtenFiles, onCancelQueued
714
724
  remarkPlugins={[remarkGfm]}
715
725
  rehypePlugins={[rehypeHighlight]}
716
726
  components={markdownComponents}
727
+ urlTransform={chatMarkdownUrl}
717
728
  >
718
729
  {displayContent}
719
730
  </ReactMarkdown>
@@ -866,6 +877,8 @@ function hashSenderColor(senderWorkflowId: string | undefined): string {
866
877
  function PeerMessageBlock({ message, jobId, onMakeTask }: { message: ChatMessageType; jobId?: string; onMakeTask?: (content: string, fromWorkflowId: string) => void }) {
867
878
  const selected = useMessageSelectionStore((s) => !!jobId && (s.selected[jobId]?.includes(message.id) ?? false));
868
879
  const isSent = message.role === 'peer-sent';
880
+ const [open, setOpen] = useState(false);
881
+ const openButton = useRef<HTMLButtonElement>(null);
869
882
  const senderColor = hashSenderColor(message.senderWorkflowId);
870
883
  const arrow = isSent ? '→' : '←';
871
884
  const verb = isSent ? 'sent to' : 'from';
@@ -879,9 +892,14 @@ function PeerMessageBlock({ message, jobId, onMakeTask }: { message: ChatMessage
879
892
  const senderLabel = peerInfo
880
893
  ? (peerInfo.role ? `${peerInfo.displayName} (${peerInfo.role})` : peerInfo.displayName)
881
894
  : fallbackLabel;
882
- return (
895
+ const self = useAppStore((s) => jobId ? s.clusterMemberLabels[jobId] : undefined);
896
+ const selfLabel = self?.displayName ?? jobId?.slice(0, 8) ?? 'This member';
897
+ return (<>
883
898
  <div
899
+ data-help="cluster.peer-message"
900
+ onClick={(event) => { if (!(event.target as HTMLElement).closest('button, input, a')) { openButton.current?.focus(); setOpen(true); } }}
884
901
  style={{
902
+ cursor: 'pointer',
885
903
  margin: '8px 16px',
886
904
  padding: '8px 12px',
887
905
  borderLeft: `3px solid ${senderColor}`,
@@ -944,11 +962,18 @@ function PeerMessageBlock({ message, jobId, onMakeTask }: { message: ChatMessage
944
962
  </button>
945
963
  ) : null}
946
964
  </div>
947
- <div style={{ color: 'var(--color-fg)', whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>
948
- {message.content}
949
- </div>
965
+ <button ref={openButton} type="button" aria-label={`Open peer message ${verb} ${senderLabel}`} aria-haspopup="dialog" data-help="cluster.peer-message" onClick={() => setOpen(true)} style={{ padding: 0, border: 0, background: 'transparent', color: 'var(--color-fg)', textAlign: 'left', font: 'inherit', cursor: 'pointer', whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>
966
+ {message.content.length > 200 ? `${message.content.slice(0, 200)}…` : message.content}
967
+ </button>
950
968
  </div>
951
- );
969
+ {open && <DialogShell title="Peer message" dataHelp="cluster.peer-message" onClose={() => setOpen(false)} width={720}
970
+ actions={<button type="button" onClick={() => setOpen(false)}>CLOSE</button>}>
971
+ <p>From: {isSent ? selfLabel : senderLabel}<br />To: {isSent ? senderLabel : selfLabel}<br />
972
+ {message.timestamp ? `Sent: ${new Date(message.timestamp).toLocaleString()}` : 'Time unavailable'}</p>
973
+ {isSent && message.peerFullContent === undefined && <p>Only the saved preview is available for this older sent message.</p>}
974
+ <div style={{ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }}>{isSent ? (message.peerFullContent ?? message.content) : message.content}</div>
975
+ </DialogShell>}
976
+ </>);
952
977
  }
953
978
 
954
979
  // Memoised. ChatPanel virtualises with `overscan: 16`, so ~30 rows
@@ -1,3 +1,4 @@
1
+ import { PhoneUploadButton } from './PhoneUpload';
1
2
  import { TidyComposer } from './TidyComposer';
2
3
  import { useMessageBoxSize, messageBoxMinHeight, messageBoxMaxHeight } from '../utils/messageBoxSize';
3
4
  import { PendingQuestionsButton } from './PendingQuestionsButton';
@@ -340,6 +341,7 @@ export function ChatModeView({ job, onRenameWorkflow, onSend, onCancel, onLoadEa
340
341
  {uploading ? '…' : '+'}
341
342
  </button>
342
343
  )}
344
+ {canAttach && <PhoneUploadButton workflowId={job.id} style={{ height: '30px', padding: '0 10px', borderRadius: '15px' }} />}
343
345
  <textarea
344
346
  data-help="chat.input"
345
347
  ref={areaRef}
@@ -12,6 +12,7 @@ import {
12
12
  type ClusterStatePayload,
13
13
  type EffortLevel,
14
14
  type ModelName,
15
+ type TranscriptWorkerPreview,
15
16
  } from '@arco/shared';
16
17
  import { useAppStore } from '../../stores/appStore';
17
18
  import { useCodexCatalogFor } from '../../hooks/useCodexCatalog';
@@ -19,6 +20,7 @@ import { effortsForModel } from '../../utils/format';
19
20
  import { capDefaultEffort } from '../../utils/effortDefaults';
20
21
  import { modelsForProvider, useModelCatalogs } from '../../utils/modelCatalog';
21
22
  import { MemberSettingsFields } from './MemberSettingsFields';
23
+ import { requestTranscriptWorker } from '../../utils/transcriptWorkerRequest';
22
24
  import { memberSettingsFrom, memberTuning, type MemberSettings } from './memberSettings';
23
25
 
24
26
  const menuStyle: CSSProperties = {
@@ -67,7 +69,32 @@ export function ReplaceMemberDialog({
67
69
  const [role, setRole] = useState(member.role ?? '');
68
70
  const [memberSettings, setMemberSettings] = useState<MemberSettings>(() => memberSettingsFrom(job?.config, { tier: member.tier, focus: member.focus, keepAutoCompaction: true }));
69
71
  const otherDirector = cluster.members.some((m) => m.workflowId !== member.workflowId && isClusterDirector(m.role));
70
- const [includeHistory, setIncludeHistory] = useState(false);
72
+ const [historyMode, setHistoryMode] = useState<'none' | 'recent' | 'full'>('none');
73
+ const [historyTurns, setHistoryTurns] = useState('10');
74
+ const [historyResult, setHistoryResult] = useState<{ key: string; preview: TranscriptWorkerPreview } | null>(null);
75
+ const [historyError, setHistoryError] = useState('');
76
+ const [historyLoading, setHistoryLoading] = useState(false);
77
+ const turnCount = Number(historyTurns);
78
+ const validTurns = Number.isInteger(turnCount) && turnCount >= 1 && turnCount <= 50;
79
+ const historyKey = `${cluster.clusterId}:${member.workflowId}:${historyMode}:${historyMode === 'recent' ? historyTurns : '10'}`;
80
+ const historyPreview = historyResult?.key === historyKey ? historyResult.preview : null;
81
+ useEffect(() => {
82
+ let active = true;
83
+ setHistoryError(''); setHistoryResult(null);
84
+ if (historyMode === 'none') { setHistoryLoading(false); return; }
85
+ if (historyMode === 'recent' && !validTurns) { setHistoryLoading(false); setHistoryError('Choose from 1 to 50 turns.'); return; }
86
+ setHistoryLoading(true);
87
+ void requestTranscriptWorker({ type: 'transcript_worker_preview', workflowId: member.workflowId,
88
+ turns: historyMode === 'recent' ? turnCount : 10, includePartial: false, preface: '',
89
+ replacement: { clusterId: cluster.clusterId, mode: historyMode },
90
+ }).then(result => {
91
+ if (!active) return;
92
+ if (!result.preview) throw new Error('The history preview is unavailable. Choose the history mode again.');
93
+ setHistoryResult({ key: historyKey, preview: result.preview });
94
+ }).catch(error => { if (active) setHistoryError(error instanceof Error ? error.message : String(error)); })
95
+ .finally(() => { if (active) setHistoryLoading(false); });
96
+ return () => { active = false; };
97
+ }, [historyKey]);
71
98
  const [transferTasks, setTransferTasks] = useState(true);
72
99
  const codexAccounts = settings?.providerAccounts?.codex ?? [];
73
100
  const codexCatalog = useCodexCatalogFor(account);
@@ -116,15 +143,15 @@ export function ReplaceMemberDialog({
116
143
  setAccessMode(next);
117
144
  if (next === 'isolated') {
118
145
  if (provider !== 'claude') pickProvider('claude');
119
- setIncludeHistory(false);
146
+ setHistoryMode('none');
120
147
  setTransferTasks(false);
121
148
  }
122
149
  };
123
150
 
124
151
  const directorBlocked = isClusterDirector(role) && otherDirector;
125
- const ready = !!model && !directorBlocked;
152
+ const ready = !!model && !directorBlocked && (historyMode === 'none' || (!!historyPreview && !historyLoading && !historyError));
126
153
  const submit = () => {
127
- if (!wsSendRaw || !model || directorBlocked) return;
154
+ if (!wsSendRaw || !ready) return;
128
155
  wsSendRaw({
129
156
  type: 'cluster_member_replace',
130
157
  clusterId: cluster.clusterId,
@@ -137,7 +164,9 @@ export function ReplaceMemberDialog({
137
164
  ...(name.trim() && name.trim() !== originalName ? { name: name.trim() } : {}),
138
165
  role: role.trim(),
139
166
  ...memberTuning(memberSettings, provider),
140
- includeHistory,
167
+ includeHistory: historyMode !== 'none',
168
+ historyMode,
169
+ ...(historyMode !== 'none' ? { historyTurns: historyMode === 'recent' ? turnCount : 10, historyToken: historyPreview!.token } : {}),
141
170
  transferActiveTasks: transferTasks,
142
171
  });
143
172
  onClose();
@@ -316,17 +345,37 @@ export function ReplaceMemberDialog({
316
345
  <label
317
346
  className="display-font"
318
347
  data-help="cluster.replace.history"
319
- style={{ fontSize: '10px', color: 'var(--color-fg)', opacity: accessMode === 'isolated' ? 0.45 : 1 }}
348
+ style={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: '6px', fontSize: '10px', color: 'var(--color-fg)', opacity: accessMode === 'isolated' ? 0.45 : 1 }}
320
349
  >
321
- <input
322
- type="checkbox"
323
- data-help="cluster.replace.history"
324
- checked={includeHistory}
325
- disabled={accessMode === 'isolated'}
326
- onChange={(e) => setIncludeHistory(e.target.checked)}
327
- style={{ accentColor: 'var(--color-accent-primary)' }}
328
- /> INCLUDE PRIOR WORKFLOW HISTORY
350
+ HISTORY
351
+ <select aria-label="Replacement history" data-help="cluster.replace.history" value={historyMode}
352
+ disabled={accessMode === 'isolated'} onChange={event => setHistoryMode(event.target.value as typeof historyMode)} style={menuStyle}>
353
+ <option value="none">NO HISTORY</option>
354
+ <option value="recent">RECENT HISTORY</option>
355
+ <option value="full">FULL HISTORY</option>
356
+ </select>
329
357
  </label>
358
+ {historyMode === 'recent' && <label className="display-font" data-help="cluster.replace.history" style={{ display: 'flex', alignItems: 'center', gap: '6px', flexWrap: 'wrap', fontSize: '10px' }}>
359
+ LAST TURNS
360
+ <input aria-label="Recent history turns" type="number" min={1} max={50} step={1} value={historyTurns}
361
+ onChange={event => setHistoryTurns(event.target.value)} style={{ ...menuStyle, flex: '0 1 72px', width: '72px' }} />
362
+ <span style={{ color: 'var(--color-fg-muted)' }}>1 to 50, within 128 KiB</span>
363
+ </label>}
364
+ {historyMode !== 'none' && <div role="status" style={{ fontSize: '10px', lineHeight: 1.4, overflowWrap: 'anywhere', color: historyError || historyPreview?.truncated || historyPreview?.historyFallback ? 'var(--color-warning)' : 'var(--color-fg-muted)' }}>
365
+ {historyLoading ? 'Checking the saved history...' : historyError || (historyPreview && (
366
+ !historyPreview.selectedTurns && historyPreview.truncated
367
+ ? 'No whole recent turn fits the history limit. No earlier history will be copied.'
368
+ : historyMode === 'full' && !historyPreview.historyFallback
369
+ ? `The full prior transcript and action digest fit within 512 KiB (${historyPreview.bytes} bytes).`
370
+ : historyMode === 'full'
371
+ ? historyPreview.truncated
372
+ ? `Only the most recent ${historyPreview.selectedTurns} of ${historyPreview.availableTurns} turns fit within 512 KiB. Earlier turns will not be copied.`
373
+ : `The full history exceeds 512 KiB. All ${historyPreview.selectedTurns} turns fit as text and tool/file receipts; the full action digest will not be copied.`
374
+ : historyPreview.selectedTurns < Math.min(turnCount, historyPreview.availableTurns)
375
+ ? `Only ${historyPreview.selectedTurns} of the requested ${turnCount} turns fit within 128 KiB. Earlier turns will not be copied (${historyPreview.availableTurns} available).`
376
+ : `The most recent ${historyPreview.selectedTurns} of ${historyPreview.availableTurns} available turns will be copied (${historyPreview.bytes} bytes).`
377
+ ))}
378
+ </div>}
330
379
  <label
331
380
  className="display-font"
332
381
  data-help="cluster.replace.tasks"
@@ -341,7 +390,7 @@ export function ReplaceMemberDialog({
341
390
  style={{ accentColor: 'var(--color-accent-primary)' }}
342
391
  /> TRANSFER ACTIVE TASK ASSIGNMENTS
343
392
  </label>
344
- {includeHistory && (
393
+ {historyMode !== 'none' && !!historyPreview?.seed && (
345
394
  <div style={{ color: 'var(--color-warning)', fontSize: '10px' }}>
346
395
  This starts one visible seed turn and spends a model call. No provider session is reused.
347
396
  </div>
@@ -350,6 +399,7 @@ export function ReplaceMemberDialog({
350
399
  <button
351
400
  type="button"
352
401
  onClick={onClose}
402
+ data-help="cluster.replace.cancel"
353
403
  className="display-font"
354
404
  style={{
355
405
  padding: '4px 10px',
@@ -0,0 +1,124 @@
1
+ import { useEffect, useState, type CSSProperties } from 'react';
2
+ import { ROLE_PRESETS, presetForText, type ArcoSkillRef, type ClusterStatePayload, type ClusterSkillPin } from '@arco/shared';
3
+ import { useAppStore } from '../../stores/appStore';
4
+ import { useStartupStore } from '../../stores/startupStore';
5
+ import { DialogShell, SETTINGS_CHILD_DIALOG_Z_INDEX } from '../DialogShell';
6
+
7
+ interface Skill { scope: 'project' | 'global'; slug: string; name: string; off?: boolean }
8
+ const button: CSSProperties = { padding: '3px 8px', background: 'transparent', border: '1px solid var(--color-border-hairline)', borderRadius: '3px', color: 'var(--color-fg)', cursor: 'pointer', fontSize: '10px', letterSpacing: '1px' };
9
+ const roleLabel = (role: string) => presetForText(role)?.label ?? role;
10
+ const sameRef = (a: ArcoSkillRef, b: ArcoSkillRef) => a.scope === b.scope && a.slug === b.slug;
11
+
12
+ export function SkillsControl({ cluster, memberId }: { cluster: ClusterStatePayload; memberId?: string }) {
13
+ const send = useAppStore(s => s.wsSendRaw);
14
+ const connected = useAppStore(s => s.connected);
15
+ const [open, setOpen] = useState(false);
16
+ const [adding, setAdding] = useState(false);
17
+ const [selected, setSelected] = useState('');
18
+ const [pinning, setPinning] = useState<Skill | null>(null);
19
+ const [catalog, setCatalog] = useState<Skill[] | null>(null);
20
+ const [error, setError] = useState('');
21
+ const pins = cluster.skillPins ?? [];
22
+ const role = cluster.members.find(member => member.workflowId === memberId)?.role;
23
+ const applicable = pins.filter(pin => pin.role === undefined || pin.role === role);
24
+ const count = memberId ? new Set(applicable.map(pin => `${pin.scope}:${pin.slug}`)).size : pins.length;
25
+ const pinKey = JSON.stringify(pins);
26
+ useEffect(() => {
27
+ if (!open) return;
28
+ let cancelled = false;
29
+ setCatalog(null); setError('');
30
+ fetch(`/api/skills?cwd=${encodeURIComponent(cluster.cwd)}`).then(async response => {
31
+ if (!response.ok) throw new Error('The skill list is unavailable. Close and open this window to try again.');
32
+ return response.json();
33
+ }).then(data => { if (!cancelled) setCatalog([...(data.project ?? []), ...(data.global ?? [])]); })
34
+ .catch(reason => { if (!cancelled) setError(String(reason.message ?? reason)); });
35
+ return () => { cancelled = true; };
36
+ }, [open, cluster.cwd, pinKey]);
37
+ if (memberId && count === 0) return null;
38
+ return <>
39
+ <button type="button" className="display-font" data-help="cluster.skills" style={button}
40
+ aria-label={`${memberId ? 'Skills inherited from cluster' : 'Cluster skills'}, ${count} ${count === 1 ? 'pin' : 'pins'}`} aria-haspopup="dialog" aria-expanded={open}
41
+ onClick={() => setOpen(true)}>{memberId ? 'FROM CLUSTER' : 'SKILLS'} [{count}]</button>
42
+ {open && !adding && !pinning && <DialogShell title="Cluster skills" dataHelp="cluster.skills" onClose={() => setOpen(false)} closeOnBackdrop width={620}
43
+ actions={<><button type="button" style={button} data-help="cluster.skills.add" disabled={catalog === null || !catalog.some(skill => !skill.off)} onClick={() => { setSelected(''); setAdding(true); }}>ADD SKILL</button><button type="button" style={button} data-help="cluster.skills" onClick={() => {
44
+ setOpen(false); useStartupStore.getState().setSettingsSection('skills'); useAppStore.getState().setShowSettings(true);
45
+ }}>SETTINGS &gt; SKILLS</button></>}>
46
+ <p>Full skill text is added to every turn for matching members, including new and replaced members. Only the operator changes these pins.</p>
47
+ {!pins.length && <p>No skills are pinned to this cluster. Select ADD SKILL to pin one.</p>}
48
+ {error && <p role="alert">{error}</p>}
49
+ {catalog && !catalog.some(skill => !skill.off) && <p>No available skills. Create or turn on a skill in Settings &gt; SKILLS.</p>}
50
+ {pins.map((pin, index) => {
51
+ const skill = catalog?.find(item => sameRef(item, pin));
52
+ const status = catalog === null ? 'Loading' : !skill ? 'Missing or unreadable' : skill.off ? 'Off' : 'Available';
53
+ return <div key={JSON.stringify([pin.scope, pin.slug, pin.role])} style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: '8px', padding: '8px 0', borderBottom: '1px solid var(--color-border-hairline)' }}>
54
+ <div style={{ flex: '1 1 180px', minWidth: 0, overflowWrap: 'anywhere' }}>
55
+ <strong>{skill?.name ?? pin.slug}</strong> <span style={{ color: 'var(--color-fg-muted)' }}>({pin.scope})</span>
56
+ <div>{pin.role === undefined ? 'All members' : `Role: ${roleLabel(pin.role)}`}</div>
57
+ <div style={{ color: 'var(--color-fg-muted)' }}>{status}</div>
58
+ </div>
59
+ <button type="button" data-help="cluster.skills.unpin" style={button} disabled={!connected}
60
+ aria-label={`Unpin ${skill?.name ?? pin.slug} from ${pin.role === undefined ? 'all members' : roleLabel(pin.role)}`}
61
+ onClick={() => send?.({ type: 'cluster_skills_set', clusterId: cluster.clusterId, pins: pins.filter((_pin, n) => n !== index) })}>UNPIN</button>
62
+ </div>;
63
+ })}
64
+ <p>Tab pins, cluster pins and matching role pins share one limit: 12 unique skills and 64 KiB of text. Missing or off skills are skipped. A skill that grows beyond the limit is reported in the conversation.</p>
65
+ </DialogShell>}
66
+ {open && adding && <DialogShell zIndex={9700} title="Add cluster skill" dataHelp="cluster.skills.add" onClose={() => setAdding(false)} width={620}
67
+ actions={<><button type="button" style={button} onClick={() => setAdding(false)}>CANCEL</button><button type="button" style={button} disabled={!selected} onClick={() => { const skill = catalog?.find(item => JSON.stringify([item.scope, item.slug]) === selected); if (skill) { setAdding(false); setPinning(skill); } }}>NEXT</button></>}>
68
+ <label>Skill<select className="arco-field" aria-label="Skill to add" data-help="cluster.skills.add" value={selected} onChange={event => setSelected(event.target.value)} style={{ display: 'block', width: '100%', minWidth: 0 }}>
69
+ <option value="">Select a skill</option>{catalog?.filter(skill => !skill.off).map(skill => <option key={JSON.stringify([skill.scope, skill.slug])} value={JSON.stringify([skill.scope, skill.slug])}>{skill.name} ({skill.scope})</option>)}
70
+ </select></label>
71
+ </DialogShell>}
72
+ {open && pinning && <PinSkillDialog skill={pinning} cwd={cluster.cwd} kind="cluster" initialTargetId={cluster.clusterId} onClose={() => setPinning(null)} />}
73
+ </>;
74
+ }
75
+
76
+ export function PinSkillDialog({ skill, cwd, kind, onClose, onPinned, initialTargetId }: { skill: Skill; cwd: string; kind: 'tab' | 'cluster'; onClose: () => void; initialTargetId?: string; onPinned?: (result: { kind: 'tab' | 'cluster'; id: string; role?: string; scope: 'project' | 'global'; slug: string; message: string }) => void }) {
77
+ const clusters = useAppStore(s => s.clusters);
78
+ const jobs = useAppStore(s => s.jobs);
79
+ const activeClusterId = useAppStore(s => s.activeClusterId);
80
+ const activeJobId = useAppStore(s => s.activeJobId);
81
+ const send = useAppStore(s => s.wsSendRaw);
82
+ const connected = useAppStore(s => s.connected);
83
+ const targets = kind === 'cluster'
84
+ ? Object.values(clusters).filter(cluster => skill.scope === 'global' || cluster.cwd === cwd).map(cluster => ({ id: cluster.clusterId, name: cluster.name ?? `Cluster ${cluster.clusterId.slice(0, 8)}` }))
85
+ : Object.values(jobs).filter(job => job.config.kind !== 'chat' && (skill.scope === 'global' || job.config.workingDirectory === cwd)).map(job => ({ id: job.id, name: job.config.name || job.id.slice(0, 8) }));
86
+ const activeTarget = initialTargetId ?? (kind === 'cluster' ? activeClusterId ?? Object.values(clusters).find(item => item.members.some(member => member.workflowId === activeJobId))?.clusterId : activeJobId);
87
+ const [target, setTarget] = useState(targets.find(item => item.id === activeTarget)?.id ?? targets[0]?.id ?? '');
88
+ const [scope, setScope] = useState('all');
89
+ const [customRole, setCustomRole] = useState('');
90
+ const cluster = kind === 'cluster' ? clusters[target] : undefined;
91
+ const roles = [...new Set([...(cluster?.members.flatMap(member => member.role ? [member.role] : []) ?? []), ...ROLE_PRESETS.map(preset => preset.text)])];
92
+ const role = scope === 'all' ? undefined : scope === 'custom' ? customRole.trim() : scope.slice(5);
93
+ const valid = targets.some(item => item.id === target) && (scope === 'all' || !!role) && connected;
94
+ const members = cluster?.members.filter(member => role === undefined || member.role === role).length ?? 1;
95
+ const pin = () => {
96
+ if (!valid) return;
97
+ if (cluster) {
98
+ const next: ClusterSkillPin = { scope: skill.scope, slug: skill.slug, ...(role !== undefined ? { role } : {}) };
99
+ const pins = cluster.skillPins ?? [];
100
+ if (!pins.some(existing => sameRef(existing, next) && existing.role === next.role)) send?.({ type: 'cluster_skills_set', clusterId: target, pins: [...pins, next] });
101
+ } else {
102
+ const existing = jobs[target]?.config.pinnedSkills ?? [];
103
+ if (!existing.some(ref => sameRef(ref, skill))) send?.({ type: 'update_primary_config', workflowId: target, pinnedSkills: [...existing, { scope: skill.scope, slug: skill.slug }] });
104
+ }
105
+ const name = targets.find(item => item.id === target)?.name ?? target;
106
+ const destination = cluster ? `${name} (${role === undefined ? 'All members' : roleLabel(role)})` : name;
107
+ onPinned?.({ kind, id: target, role, scope: skill.scope, slug: skill.slug, message: `Pinned ${skill.name} to ${destination}.` });
108
+ onClose();
109
+ };
110
+ return <DialogShell zIndex={SETTINGS_CHILD_DIALOG_Z_INDEX} title={`Pin ${skill.name} to ${kind}`} dataHelp="settings.skills.pin" onClose={onClose} width={620}
111
+ actions={<><button type="button" data-help="settings.skills.pin" style={button} onClick={onClose}>CANCEL</button><button type="button" data-help="settings.skills.pin" style={button} disabled={!valid} onClick={pin}>PIN</button></>}>
112
+ {!targets.length ? <p>Open {kind === 'cluster' ? 'a cluster' : 'an Agent tab'}{skill.scope === 'project' ? ' for this project' : ''} to pin this skill.</p> : <>
113
+ <label>{kind === 'cluster' ? 'Cluster' : 'Tab'}<select className="arco-field" aria-label={`Pin destination ${kind}`} data-help="settings.skills.pin" value={target} style={{ display: 'block', width: '100%', minWidth: 0 }} onChange={event => { setTarget(event.target.value); setScope('all'); }}>
114
+ {targets.map(item => <option key={item.id} value={item.id}>{item.name}</option>)}
115
+ </select></label>
116
+ {cluster && <label>Apply to<select className="arco-field" aria-label="Cluster skill scope" data-help="settings.skills.pin" value={scope} style={{ display: 'block', width: '100%', minWidth: 0 }} onChange={event => setScope(event.target.value)}>
117
+ <option value="all">All members</option>{roles.map(saved => <option key={saved} value={`role:${saved}`}>Role: {roleLabel(saved)}</option>)}<option value="custom">Other role</option>
118
+ </select></label>}
119
+ {scope === 'custom' && <label>Exact saved role text<input className="arco-field" aria-label="Exact saved role text" data-help="settings.skills.pin" value={customRole} maxLength={120} onChange={event => setCustomRole(event.target.value)} style={{ display: 'block', width: '100%' }} /></label>}
120
+ <p>{cluster ? `Added to every turn for ${members} current ${members === 1 ? 'member' : 'members'}; new and replaced matching members inherit it.` : 'Added to every turn in this tab.'} The combined limit is 12 unique skills and 64 KiB with existing tab and cluster pins.</p>
121
+ {skill.scope === 'project' && <p>Pinning applies this project's skill text even when project trust is off. Review the skill before pinning it.</p>}
122
+ </>}
123
+ </DialogShell>;
124
+ }
@@ -40,6 +40,7 @@ import { ClusterHandoffsTab } from './ClusterHandoffsTab';
40
40
  import { ClusterReviewsList } from './ClusterReviewsList';
41
41
  import { MailboxModal } from './MailboxModal';
42
42
  import { EfficiencyControl } from './EfficiencyControl';
43
+ import { SkillsControl } from './SkillsControl';
43
44
  import { ProjectTrustChip } from './ProjectTrustChip';
44
45
  import { ProgressControl } from './ProgressControl';
45
46
  import { AutoPickupControl, autoPickupStateOf } from './AutoPickupControl';
@@ -229,6 +230,7 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
229
230
  // outer splitter narrow enough to crush the panel.
230
231
  flex: 1,
231
232
  minWidth: '240px',
233
+ minHeight: 0,
232
234
  display: 'flex',
233
235
  flexDirection: 'column',
234
236
  borderLeft: '1px solid var(--color-border-hairline)',
@@ -249,6 +251,7 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
249
251
  onToggleIdleNudger ? `MAIL ALERTS ${cluster.idleNudgerEnabled ? 'ON' : 'OFF'}` : null,
250
252
  onToggleAutoTurn ? `AUTO-PICKUP ${pickup}` : null,
251
253
  onSetEfficiency ? (cluster.efficiencyLevel ?? 'thorough').toUpperCase() : null,
254
+ cluster.skillPins?.length ? `SKILLS ${cluster.skillPins.length}` : null,
252
255
  onSetTaskBoardMode || onSetTaskBoardAttached ? `BOARD ${cluster.taskBoardMode && cluster.taskBoardMode !== 'none' && cluster.taskBoardAttached !== false ? cluster.taskBoardMode.toUpperCase() : 'OFF'}` : null,
253
256
  cluster.remoteEnabled ? 'REMOTE ON' : null,
254
257
  ].filter(Boolean).join(' · ');
@@ -333,6 +336,7 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
333
336
  onSetEfficiency={onSetEfficiency}
334
337
  />
335
338
  )}
339
+ <SkillsControl cluster={cluster} />
336
340
  {/* DD7 — cluster-wide project trust for the pinned cwd. Self-hiding
337
341
  when the repo ships nothing the gate suppresses. */}
338
342
  <ProjectTrustChip cwd={cluster.cwd} />
@@ -33,6 +33,7 @@ import {
33
33
  releaseSummary,
34
34
  NO_RELEASE,
35
35
  namedCommitsForTask,
36
+ plainSignoffSummary,
36
37
  reviewTasksWithMetSignoff,
37
38
  splitRecentAndOlderReview,
38
39
  } from './clusterNeedsYou';
@@ -222,8 +223,6 @@ export function ClusterTaskBoardTab({
222
223
  // Bulk accept only touches review cards the operator can see: recent ones,
223
224
  // plus older ones while that row is expanded.
224
225
  const visibleReview = olderOpen ? [...recentReview, ...olderReview] : recentReview;
225
- const autoMarkDone = useAppStore((s) => s.settings?.autoMarkDoneOnMetSignoff === true);
226
- const autoDoneSent = useRef<Set<string>>(new Set());
227
226
  const [selectedTaskId, setSelectedTaskId] = useState<string | null>(null);
228
227
  // Needs-you popover: open this task's drawer, then clear the request. A done
229
228
  // task is only drawn with SHOW DONE on, but the drawer reads from all tasks.
@@ -353,19 +352,6 @@ export function ClusterTaskBoardTab({
353
352
  onUpdateTaskStatus(taskShowReader, taskId, 'done', cluster.taskBoardKey);
354
353
  };
355
354
 
356
- // Optional auto-done (Settings > Agents and clusters). Same operator path as
357
- // ACCEPT: onUpdateTaskStatus -> task_ledger_update. Each task and sign-off is
358
- // sent once, so a rejected update is not retried in a loop.
359
- useEffect(() => {
360
- if (!autoMarkDone || !taskShowReader || !onUpdateTaskStatus) return;
361
- for (const t of reviewTasksWithMetSignoff(tasks)) {
362
- const key = `${t.id}:${t.signoff?.at ?? 0}`;
363
- if (autoDoneSent.current.has(key)) continue;
364
- autoDoneSent.current.add(key);
365
- onUpdateTaskStatus(taskShowReader, t.id, 'done', cluster.taskBoardKey);
366
- }
367
- }, [autoMarkDone, tasks, taskShowReader, onUpdateTaskStatus, cluster.taskBoardKey]);
368
-
369
355
  const acceptAllMet = () => {
370
356
  if (!taskShowReader || !onUpdateTaskStatus) return;
371
357
  const met = reviewTasksWithMetSignoff(visibleReview);
@@ -1298,7 +1284,7 @@ function TaskDetailDrawer({
1298
1284
  </div>
1299
1285
  <div ref={detailScroll} style={{ flex: 1, minHeight: 0, overflowY: 'auto', padding: '8px 10px 12px' }}>
1300
1286
  {task.status === 'review' && (
1301
- <DrawerSection title="TO ACCEPT">
1287
+ <DrawerSection title={task.signoff && task.signoff.state !== 'met' ? 'REVIEW' : 'TO ACCEPT'}>
1302
1288
  <InlineBlock
1303
1289
  label="Director sign-off"
1304
1290
  body={task.signoff
@@ -1306,9 +1292,9 @@ function TaskDetailDrawer({
1306
1292
  : 'No sign-off yet.'}
1307
1293
  />
1308
1294
  {task.signoff?.summary && (
1309
- <div title={task.signoff.summary} data-testid="review-signoff-summary"
1295
+ <div title={plainSignoffSummary(task.signoff)} data-testid="review-signoff-summary"
1310
1296
  style={{ color: 'var(--color-fg)', fontSize: '11px', marginTop: '5px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
1311
- {task.signoff.summary}
1297
+ {plainSignoffSummary(task.signoff)}
1312
1298
  </div>
1313
1299
  )}
1314
1300
  <div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px', marginTop: '8px' }}>
@@ -1533,11 +1519,11 @@ function TaskDetailDrawer({
1533
1519
  </FieldGrid>
1534
1520
  {task.blockedReason && <InlineBlock label="Blocked reason" body={task.blockedReason} />}
1535
1521
  {/* §D3 — director's advisory sign-off (the same verdict surfaced as a
1536
- chip on the card). Advisory only; done stays operator-only. */}
1522
+ chip on the card). */}
1537
1523
  {task.signoff && (
1538
1524
  <InlineBlock
1539
1525
  label="Director sign-off"
1540
- body={`${signoffChip(task.signoff).label}${task.signoff.summary ? `: ${task.signoff.summary}` : ''}\n${task.signoff.byWorkflowId ? `by ${nameFor(task.signoff.byWorkflowId)} · ` : ''}${formatTime(task.signoff.at)}`}
1526
+ body={`${signoffChip(task.signoff).label}${plainSignoffSummary(task.signoff) ? `: ${plainSignoffSummary(task.signoff)}` : ''}\n${task.signoff.byWorkflowId ? `by ${nameFor(task.signoff.byWorkflowId)} · ` : ''}${formatTime(task.signoff.at)}`}
1541
1527
  />
1542
1528
  )}
1543
1529
  {task.notes && <InlineBlock label="Notes" body={task.notes} />}
@@ -2069,14 +2055,14 @@ function BoardCard({
2069
2055
  const showSignoff = Boolean(so) || col === 'review';
2070
2056
  const chip = signoffChip(so);
2071
2057
  const signoffTitle = so
2072
- ? `Director sign-off: ${so.state}${so.summary ? `: ${so.summary}` : ''}${so.byWorkflowId ? ` (by ${nameFor(so.byWorkflowId)}, ${formatTime(so.at)})` : ''}`
2058
+ ? `Director sign-off: ${signoffChip(so).label}${plainSignoffSummary(so) ? `: ${plainSignoffSummary(so)}` : ''}${so.byWorkflowId ? ` (by ${nameFor(so.byWorkflowId)}, ${formatTime(so.at)})` : ''}`
2073
2059
  : 'No director sign-off yet';
2074
2060
  // A per-card click target that must not trigger the card drag or open the
2075
2061
  // drawer — stop pointer + click from bubbling to the draggable card button.
2076
2062
  const stop = (e: { stopPropagation: () => void }) => e.stopPropagation();
2077
2063
  const canRecheck = Boolean(onRecheck && so?.byWorkflowId);
2078
2064
  const commits = namedCommitsForTask(t);
2079
- const signoffSummary = col === 'review' ? so?.summary?.trim() : undefined;
2065
+ const signoffSummary = col === 'review' ? plainSignoffSummary(so) : undefined;
2080
2066
  return (
2081
2067
  <button
2082
2068
  ref={setNodeRef}
@@ -2109,6 +2095,7 @@ function BoardCard({
2109
2095
  >
2110
2096
  {t.title}
2111
2097
  </div>
2098
+ {t.status === 'done' && t.directorClosure && <div style={{ fontSize: '10px', color: 'var(--color-fg-muted)' }}>Closed by director · {formatTime(t.directorClosure.at)}</div>}
2112
2099
  {signoffSummary && (
2113
2100
  <div
2114
2101
  title={signoffSummary}
@@ -0,0 +1,34 @@
1
+ import type { JobState } from '../stores/appStore';
2
+
3
+ export function runningCodexCommand(job: JobState | undefined) {
4
+ return job?.codexLateCommands?.findLast(command => command.waitingUntil > Date.now());
5
+ }
6
+
7
+ // The tab's turn is open only because the agent waits on this command. A
8
+ // server or a command from an earlier turn is running, not waited on.
9
+ export function waitedCodexCommand(job: JobState | undefined) {
10
+ return job?.busy ? job.codexLateCommands?.findLast(command => command.waiting && command.waitingUntil > Date.now()) : undefined;
11
+ }
12
+
13
+ export function CodexLateCommandLine({ job, header }: { job: JobState | undefined; header?: boolean }) {
14
+ const waited = waitedCodexCommand(job);
15
+ const command = waited ?? runningCodexCommand(job);
16
+ if (!command) return null;
17
+ let label = 'Shell command';
18
+ try { label = JSON.parse(command.input).command?.replace(/\s+/g, ' ').trim() || label; }
19
+ catch { /* keep the fallback */ }
20
+ const started = new Date(command.startedAt).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit', second: '2-digit' });
21
+ // While the turn is held open for it, the agent is waiting on this command.
22
+ const text = waited ? `Waiting for a command started at ${started}: ${label}` : `Command still running since ${started}: ${label}`;
23
+ return <div
24
+ role="status"
25
+ data-help="worker.header.late-command"
26
+ data-testid="codex-command-running"
27
+ title={text}
28
+ style={{
29
+ color: 'var(--color-accent-secondary)', overflow: 'hidden', textOverflow: 'ellipsis',
30
+ whiteSpace: 'nowrap', minWidth: 0, fontSize: '10px', flexShrink: 0,
31
+ ...(header ? { padding: '4px 12px', borderBottom: '1px solid var(--color-border-hairline)' } : {}),
32
+ }}
33
+ >{text}</div>;
34
+ }
@@ -9,6 +9,8 @@ import { confirmationSurfaceSize, contentSurfaceSize, formSurfaceSize, pickerSur
9
9
  // The header and footer never scroll away, so the result line and the actions
10
10
  // stay visible at small window heights.
11
11
 
12
+ export const SETTINGS_CHILD_DIALOG_Z_INDEX = 9701;
13
+
12
14
  export const dialogTitleStyle: CSSProperties = {
13
15
  fontSize: '12px', letterSpacing: '3px', color: 'var(--color-accent-primary)', margin: 0, fontWeight: 'normal',
14
16
  };
@@ -1,3 +1,4 @@
1
+ import { CodexLateCommandLine, runningCodexCommand } from './CodexLateCommand';
1
2
  // docs/CLIENT.md - compact ~120px card per cluster member.
2
3
  //
3
4
  // Read-only-with-click; no composer, no primitive bar (those live in the
@@ -65,6 +66,7 @@ export function MemberCard({ job, displayName, status, role, pendingMail = 0, on
65
66
  const wfid = job?.id ?? '';
66
67
  const wfidShort = wfid.slice(0, 8);
67
68
  const busy = status === 'busy';
69
+ const lateCommand = runningCodexCommand(job);
68
70
  const waitingQuestion = hasWaitingQuestion(job);
69
71
  const bodyText = useSettledPreview(job);
70
72
  const bodyDim = bodyText === '[no turns]';
@@ -172,10 +174,11 @@ export function MemberCard({ job, displayName, status, role, pendingMail = 0, on
172
174
  })()}
173
175
  {density === 'compact' && roleChipLabel && <span data-help="cluster.member-card.role-chip" title={trimmedRole} style={{ padding: '0 4px', border: '1px solid var(--color-accent-secondary-a40, var(--color-accent-secondary-dim))', color: 'var(--color-accent-secondary)', fontSize: '9px', letterSpacing: '1px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0, flex: '0 1 auto' }}>{roleChipLabel}</span>}
174
176
  <span style={{ marginLeft: 'auto', color: busy ? 'var(--color-accent-primary)' : 'var(--color-fg-muted)', fontSize: '10px', flexShrink: 0 }}>
175
- {status === 'busy' ? 'WORKING' : 'IDLE'}
177
+ {busy ? 'WORKING' : lateCommand ? 'COMMAND RUNNING' : 'IDLE'}
176
178
  </span>
177
179
  {wfid && <BriefControl scope="worker" targetId={wfid} label="BRIEF" data-help="cluster.member-brief" testId="member-brief" title="A short synopsis of this member from facts Arco can see. Read-only; sends nothing." style={{ padding: '1px 5px', fontSize: '9px', flexShrink: 0 }} />}
178
180
  </div>
181
+ <CodexLateCommandLine job={job} />
179
182
  {/* Line 2 — wfid prefix · role chip (when set). Folded into the
180
183
  tooltip and line 1 in the compact density. */}
181
184
  {density !== 'compact' && <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '10px', letterSpacing: '1px' }}>