arco-workbench 0.1.6 → 0.1.8

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 (236) hide show
  1. package/CONTRIBUTING.md +52 -12
  2. package/README.md +20 -13
  3. package/client/dist/assets/{PhosphorBackdrop-BR-TgB5x.js → PhosphorBackdrop-D7jdAV_G.js} +1 -1
  4. package/client/dist/assets/{ThemedBackgroundShaderImpl-DgcFj6JN.js → ThemedBackgroundShaderImpl-DrDm60h8.js} +1 -1
  5. package/client/dist/assets/{XtermView-CflVBQgC.js → XtermView-BGFujb1e.js} +1 -1
  6. package/client/dist/assets/{galleryEditor-BB-emfmi.js → galleryEditor-D951A2sE.js} +1 -1
  7. package/client/dist/assets/{index-B_EqHDz3.js → index-CsVy3eZm.js} +248 -248
  8. package/client/dist/index.html +1 -1
  9. package/client/src/buildCheck.ts +3 -1
  10. package/client/src/components/AppUpdateNotice.tsx +2 -1
  11. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +24 -12
  12. package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +65 -15
  13. package/client/src/components/ClusterRightPanel/SkillsControl.tsx +107 -0
  14. package/client/src/components/ClusterRightPanel/index.tsx +6 -1
  15. package/client/src/components/ClusterTaskBoardTab.tsx +9 -22
  16. package/client/src/components/HeaderVersionBox.tsx +7 -4
  17. package/client/src/components/NeedsYouBadge.tsx +3 -3
  18. package/client/src/components/ProviderReleasesModal.tsx +8 -4
  19. package/client/src/components/ProvidersPopover.tsx +28 -23
  20. package/client/src/components/SettingsPanel.tsx +2 -2
  21. package/client/src/components/SkillsSettings.tsx +5 -0
  22. package/client/src/components/TabBar.tsx +91 -9
  23. package/client/src/components/TerminalInput.tsx +12 -10
  24. package/client/src/components/TranscriptSendDialog.tsx +12 -8
  25. package/client/src/components/TranscriptWorkerDialog.tsx +119 -0
  26. package/client/src/components/UpdateAction.tsx +18 -4
  27. package/client/src/components/UpdateResultNotice.tsx +3 -1
  28. package/client/src/components/clusterNeedsYou.ts +11 -18
  29. package/client/src/help/content/cluster.tsx +54 -22
  30. package/client/src/help/content/composer.tsx +22 -0
  31. package/client/src/help/content/header.tsx +19 -1
  32. package/client/src/help/content/misc.tsx +8 -0
  33. package/client/src/help/content/rightPanel.tsx +1 -1
  34. package/client/src/help/content/settings.tsx +19 -5
  35. package/client/src/help/content/tabbar.tsx +5 -0
  36. package/client/src/help/manualSections/actions.tsx +31 -0
  37. package/client/src/help/manualSections/clusters.tsx +58 -21
  38. package/client/src/help/manualSections/configuration.tsx +38 -4
  39. package/client/src/help/manualSections/maintenance.tsx +30 -0
  40. package/client/src/help/manualSections/plans.tsx +5 -1
  41. package/client/src/help/manualSections/providers.tsx +32 -8
  42. package/client/src/help/manualSections/troubleshooting.tsx +2 -1
  43. package/client/src/help/manualSections/workflows.tsx +19 -0
  44. package/client/src/help/manualSections/workspace.tsx +6 -0
  45. package/client/src/stores/appUpdateStore.ts +29 -8
  46. package/client/src/utils/transcriptWorkerRequest.ts +24 -0
  47. package/client/src/utils/wsSession.ts +2 -1
  48. package/client/src/ws/handleServerMessage.ts +8 -2
  49. package/docs/ARCHITECTURE.md +1 -1
  50. package/docs/CLIENT.md +9 -8
  51. package/docs/FEATURES.md +8 -5
  52. package/docs/GETTING_STARTED.md +9 -4
  53. package/docs/GOTCHAS.md +2 -1
  54. package/docs/OPERATIONS.md +37 -4
  55. package/docs/PERSISTENCE.md +25 -3
  56. package/docs/PRIMITIVES.md +42 -0
  57. package/docs/PROTOCOL_CLUSTER.md +51 -5
  58. package/docs/PROTOCOL_PRIMITIVES.md +39 -0
  59. package/docs/PROVIDERS.md +50 -13
  60. package/docs/SETTINGS.md +27 -3
  61. package/docs/TASK_LEDGER.md +7 -15
  62. package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +2 -0
  63. package/node_modules/@arco/shared/dist/clusterCoordination.js +5 -1
  64. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +3 -0
  65. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +3 -2
  66. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +13 -1
  67. package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
  68. package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
  69. package/node_modules/@arco/shared/dist/protocol/models.d.ts +4 -3
  70. package/node_modules/@arco/shared/dist/protocol/models.js +26 -2
  71. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +2 -1
  72. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +4 -0
  73. package/node_modules/@arco/shared/dist/protocol/transcriptWorker.d.ts +47 -0
  74. package/node_modules/@arco/shared/dist/protocol/transcriptWorker.js +2 -0
  75. package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +1 -0
  76. package/node_modules/@arco/shared/dist/runtimeVersions.js +14 -0
  77. package/node_modules/@arco/shared/package.json +1 -1
  78. package/package.json +2 -2
  79. package/scripts/packaging/arco.mjs +1 -1
  80. package/scripts/packaging/native-repair.mjs +78 -12
  81. package/scripts/packaging/update.mjs +5 -1
  82. package/server/dist/atomicFile.js +1 -2
  83. package/server/dist/capabilities.d.ts +5 -2
  84. package/server/dist/capabilities.js +59 -9
  85. package/server/dist/cliUpdateDecision.d.ts +1 -1
  86. package/server/dist/cliUpdateDecision.js +5 -3
  87. package/server/dist/clusterAutoTurn.d.ts +4 -0
  88. package/server/dist/clusterAutoTurn.js +29 -25
  89. package/server/dist/clusterBusyReminder.js +1 -1
  90. package/server/dist/clusterDirector.js +1 -1
  91. package/server/dist/clusterPeerOps.js +10 -7
  92. package/server/dist/clusterProgress.js +1 -1
  93. package/server/dist/clusterSkills.d.ts +13 -0
  94. package/server/dist/clusterSkills.js +81 -0
  95. package/server/dist/clusterSnapshots.js +2 -0
  96. package/server/dist/clusterStore.d.ts +10 -2
  97. package/server/dist/clusterStore.js +64 -1
  98. package/server/dist/diagnostics/codeSkew.js +1 -0
  99. package/server/dist/eventLog.d.ts +7 -0
  100. package/server/dist/eventLog.js +70 -13
  101. package/server/dist/historyLimits.d.ts +1 -0
  102. package/server/dist/historyLimits.js +3 -0
  103. package/server/dist/http/router.js +1 -1
  104. package/server/dist/index.js +24 -1
  105. package/server/dist/jsonlLines.d.ts +4 -0
  106. package/server/dist/jsonlLines.js +53 -0
  107. package/server/dist/management/identity.js +1 -0
  108. package/server/dist/mcp/clusterMcpTools.js +4 -4
  109. package/server/dist/project/taskLedger.d.ts +4 -0
  110. package/server/dist/project/taskLedger.js +7 -4
  111. package/server/dist/providerConversation.d.ts +1 -0
  112. package/server/dist/providerConversation.js +17 -0
  113. package/server/dist/providers/claude-native/resumeSummary.d.ts +9 -0
  114. package/server/dist/providers/claude-native/resumeSummary.js +102 -49
  115. package/server/dist/providers/claude-native/worker.js +8 -4
  116. package/server/dist/providers/claude.js +2 -1
  117. package/server/dist/providers/clusterTaskToolDefinitions.js +4 -4
  118. package/server/dist/providers/codex-appserver/catalog.js +16 -1
  119. package/server/dist/providers/codex.js +2 -1
  120. package/server/dist/providers/codexCodeMode.d.ts +1 -1
  121. package/server/dist/providers/codexCodeMode.js +4 -3
  122. package/server/dist/providers/cursor/print.js +2 -1
  123. package/server/dist/providers/cursor/worker.js +2 -1
  124. package/server/dist/providers/llamacpp.js +17 -8
  125. package/server/dist/providers/ollamaRecovery.js +6 -6
  126. package/server/dist/providers/ollamaResilience.js +3 -3
  127. package/server/dist/providers/ollamaTokens.js +1 -1
  128. package/server/dist/quota.d.ts +0 -18
  129. package/server/dist/quota.js +0 -44
  130. package/server/dist/replacementHistory.d.ts +19 -0
  131. package/server/dist/replacementHistory.js +49 -0
  132. package/server/dist/server/broadcast.d.ts +2 -1
  133. package/server/dist/server/broadcast.js +1 -0
  134. package/server/dist/server/prompts.d.ts +1 -0
  135. package/server/dist/server/prompts.js +6 -1
  136. package/server/dist/sessionJsonl.d.ts +1 -1
  137. package/server/dist/sessionJsonl.js +115 -40
  138. package/server/dist/smartPickup.d.ts +2 -1
  139. package/server/dist/smartPickup.js +28 -1
  140. package/server/dist/smartPickupAdapters.js +15 -2
  141. package/server/dist/smartPickupLedger.js +6 -4
  142. package/server/dist/smartPickupObserver.d.ts +1 -0
  143. package/server/dist/smartPickupObserver.js +24 -15
  144. package/server/dist/transcriptWorker.d.ts +34 -0
  145. package/server/dist/transcriptWorker.js +201 -0
  146. package/server/dist/workflowStore.d.ts +1 -0
  147. package/server/dist/workflowStore.js +31 -0
  148. package/server/dist/ws/clusterHandlers.d.ts +2 -0
  149. package/server/dist/ws/clusterHandlers.js +64 -27
  150. package/server/dist/ws/handoffHandlers.js +5 -2
  151. package/server/dist/ws/transcriptWorkerHandlers.d.ts +25 -0
  152. package/server/dist/ws/transcriptWorkerHandlers.js +139 -0
  153. package/server/dist/ws/turnEngine.js +23 -9
  154. package/server/dist/ws/updatePrimaryConfig.js +27 -8
  155. package/server/dist/ws/workflowHandlers.d.ts +4 -1
  156. package/server/dist/ws/workflowHandlers.js +3 -1
  157. package/server/package.json +1 -1
  158. package/server/src/atomicFile.ts +1 -2
  159. package/server/src/capabilities.ts +58 -17
  160. package/server/src/cliUpdateDecision.ts +5 -4
  161. package/server/src/clusterAutoTurn.ts +26 -21
  162. package/server/src/clusterBusyReminder.ts +1 -1
  163. package/server/src/clusterDirector.ts +1 -1
  164. package/server/src/clusterPeerOps.ts +11 -8
  165. package/server/src/clusterProgress.ts +1 -1
  166. package/server/src/clusterSkills.ts +79 -0
  167. package/server/src/clusterSnapshots.ts +1 -0
  168. package/server/src/clusterStore.ts +64 -1
  169. package/server/src/diagnostics/codeSkew.ts +1 -0
  170. package/server/src/eventLog.ts +73 -13
  171. package/server/src/historyLimits.ts +2 -0
  172. package/server/src/http/router.ts +1 -1
  173. package/server/src/index.ts +23 -0
  174. package/server/src/jsonlLines.ts +52 -0
  175. package/server/src/management/identity.ts +1 -0
  176. package/server/src/mcp/clusterMcpTools.ts +4 -4
  177. package/server/src/project/taskLedger.ts +7 -5
  178. package/server/src/providerConversation.ts +15 -0
  179. package/server/src/providers/claude-native/resumeSummary.ts +98 -50
  180. package/server/src/providers/claude-native/worker.ts +8 -4
  181. package/server/src/providers/claude.ts +2 -1
  182. package/server/src/providers/clusterTaskToolDefinitions.ts +4 -4
  183. package/server/src/providers/codex-appserver/catalog.ts +14 -1
  184. package/server/src/providers/codex.ts +2 -1
  185. package/server/src/providers/codexCodeMode.ts +4 -4
  186. package/server/src/providers/cursor/print.ts +2 -1
  187. package/server/src/providers/cursor/worker.ts +2 -1
  188. package/server/src/providers/llamacpp.ts +18 -7
  189. package/server/src/providers/llamacppRecovery.ts +2 -0
  190. package/server/src/providers/ollamaRecovery.ts +6 -6
  191. package/server/src/providers/ollamaResilience.ts +3 -3
  192. package/server/src/providers/ollamaTokens.ts +1 -1
  193. package/server/src/providers/ollamaToolSubset.ts +3 -3
  194. package/server/src/quota.ts +0 -50
  195. package/server/src/replacementHistory.ts +44 -0
  196. package/server/src/server/broadcast.ts +2 -0
  197. package/server/src/server/prompts.ts +8 -1
  198. package/server/src/sessionJsonl.ts +92 -32
  199. package/server/src/smartPickup.ts +27 -3
  200. package/server/src/smartPickupAdapters.ts +17 -3
  201. package/server/src/smartPickupLedger.ts +6 -4
  202. package/server/src/smartPickupObserver.ts +20 -11
  203. package/server/src/transcriptWorker.ts +182 -0
  204. package/server/src/workflowStore.ts +21 -0
  205. package/server/src/ws/clusterHandlers.ts +46 -27
  206. package/server/src/ws/handoffHandlers.ts +5 -1
  207. package/server/src/ws/transcriptWorkerHandlers.ts +126 -0
  208. package/server/src/ws/turnEngine.ts +20 -8
  209. package/server/src/ws/updatePrimaryConfig.ts +25 -6
  210. package/server/src/ws/workflowHandlers.ts +3 -1
  211. package/shared/dist/clusterCoordination.d.ts +2 -0
  212. package/shared/dist/clusterCoordination.js +5 -1
  213. package/shared/dist/protocol/autoPickup.d.ts +3 -0
  214. package/shared/dist/protocol/clientMessages.d.ts +3 -2
  215. package/shared/dist/protocol/clusters.d.ts +13 -1
  216. package/shared/dist/protocol/index.d.ts +1 -0
  217. package/shared/dist/protocol/index.js +1 -0
  218. package/shared/dist/protocol/models.d.ts +4 -3
  219. package/shared/dist/protocol/models.js +26 -2
  220. package/shared/dist/protocol/serverMessages.d.ts +2 -1
  221. package/shared/dist/protocol/tasks.d.ts +4 -0
  222. package/shared/dist/protocol/transcriptWorker.d.ts +47 -0
  223. package/shared/dist/protocol/transcriptWorker.js +2 -0
  224. package/shared/dist/runtimeVersions.d.ts +1 -0
  225. package/shared/dist/runtimeVersions.js +14 -0
  226. package/shared/src/clusterCoordination.ts +7 -1
  227. package/shared/src/protocol/autoPickup.ts +5 -0
  228. package/shared/src/protocol/clientMessages.ts +5 -0
  229. package/shared/src/protocol/clusters.ts +16 -1
  230. package/shared/src/protocol/index.ts +1 -0
  231. package/shared/src/protocol/models.ts +31 -5
  232. package/shared/src/protocol/serverMessages.ts +2 -0
  233. package/shared/src/protocol/settings.ts +2 -3
  234. package/shared/src/protocol/tasks.ts +4 -7
  235. package/shared/src/protocol/transcriptWorker.ts +49 -0
  236. package/shared/src/runtimeVersions.ts +14 -0
@@ -9,7 +9,7 @@
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-B_EqHDz3.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-CsVy3eZm.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-DD9kFGsF.css">
14
14
  </head>
15
15
  <body>
@@ -24,6 +24,8 @@ export function startRecoveryGuard(): void {
24
24
  };
25
25
  document.addEventListener('input', mark, true);
26
26
  document.addEventListener('change', mark, true);
27
+ // A socket can reconnect before the old server stops, or its first probe can fail.
28
+ window.setInterval(() => { void checkBuild(); }, 10_000);
27
29
  }
28
30
 
29
31
  export function hasUnsavedWork(): boolean {
@@ -32,7 +34,7 @@ export function hasUnsavedWork(): boolean {
32
34
  return editedFields.size > 0 || Object.values(useDraftStore.getState().drafts).some((draft) => draft.length > 0)
33
35
  || Object.values(app.attachments).some((attachments) => attachments.length > 0)
34
36
  || Object.values(app.jobs).some((job) => job.config.incognito)
35
- || Boolean(document.querySelector('[role="dialog"], [data-dialog-shell], dialog[open], [contenteditable="true"]:focus'));
37
+ || Boolean(document.querySelector('[role="dialog"]:not([data-recovery-safe]), [data-dialog-shell], dialog[open], [contenteditable="true"]:focus'));
36
38
  }
37
39
 
38
40
  export function reportRecovery(reason: RecoveryReason): void {
@@ -5,11 +5,12 @@ import { useAppUpdateStore } from '../stores/appUpdateStore';
5
5
 
6
6
  export function AppUpdateNotice() {
7
7
  const notice = useAppUpdateStore((s) => s.notice);
8
+ const versionOpen = useAppUpdateStore((s) => s.versionOpen);
8
9
  const refresh = useAppUpdateStore((s) => s.refresh);
9
10
  const settings = useAppStore((s) => s.settings);
10
11
  const [saving, setSaving] = useState(false);
11
12
  useEffect(() => { void refresh().catch(() => {}); }, [refresh]);
12
- if (!notice || !settings || settings.updateCheck === false || settings.updateCheckDismissed === notice.latest) return null;
13
+ if (versionOpen || !notice || !settings || settings.updateCheck === false || settings.updateCheckDismissed === notice.latest) return null;
13
14
  const dismiss = async () => {
14
15
  setSaving(true);
15
16
  try {
@@ -60,15 +60,16 @@ function describeDecision(state: ClusterAutoPickupState): string | null {
60
60
  return `${when}: ${what}${d.action ? ` (${d.reason.replace(/_/g, ' ')}), ${d.outcome}` : ''}`;
61
61
  }
62
62
 
63
- function useSessionRemaining(expiresAt?: number): number | null {
63
+ function useSessionRemaining(expiresAt?: number, pausedAt?: number): number | null {
64
64
  const [now, setNow] = useState(Date.now);
65
65
  useEffect(() => {
66
66
  if (expiresAt === undefined) return;
67
67
  setNow(Date.now());
68
+ if (pausedAt !== undefined) return;
68
69
  const timer = setInterval(() => setNow(Date.now()), 30_000);
69
70
  return () => clearInterval(timer);
70
- }, [expiresAt]);
71
- return expiresAt === undefined ? null : Math.max(0, Math.ceil((expiresAt - now) / 60_000));
71
+ }, [expiresAt, pausedAt]);
72
+ return expiresAt === undefined ? null : Math.max(0, Math.ceil((expiresAt - (pausedAt ?? now)) / 60_000));
72
73
  }
73
74
 
74
75
  export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload }) {
@@ -80,10 +81,11 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
80
81
  wsSendRaw?.({ type: 'cluster_auto_pickup_set', clusterId: cluster.clusterId, mode, ...(evaluator ? { evaluator } : {}), ...(limits ? { limits } : {}), ...(ruleLimits ? { ruleLimits } : {}), ...(remindBusy !== undefined ? { remindBusy } : {}) });
81
82
  };
82
83
  const on = state.mode !== 'off';
83
- const remaining = useSessionRemaining(state.session?.expiresAt);
84
+ const pause = () => wsSendRaw?.({ type: 'cluster_auto_pickup_set', clusterId: cluster.clusterId, mode: state.mode, paused: !state.paused });
85
+ const remaining = useSessionRemaining(state.session?.expiresAt, state.pausedAt);
84
86
  const decision = describeDecision(state);
85
87
  const modeTitle = on
86
- ? `${AUTO_PICKUP_MODE_LABELS[state.mode].label}${remaining !== null ? `, about ${remaining} min left in this session` : ''}. Click to review or change.`
88
+ ? `${AUTO_PICKUP_MODE_LABELS[state.mode].label}${state.paused ? ', paused; automatic pickup and busy reminders are stopped' : ''}${remaining !== null ? `, about ${remaining} min left in this session${state.paused ? ' (clock paused)' : ''}` : ''}. Click to review or change.`
87
89
  : 'AUTO-PICKUP is off. Click to choose a mode.';
88
90
  return (
89
91
  <>
@@ -95,7 +97,7 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
95
97
  onClick={() => setOpen(true)}
96
98
  data-help="cluster.auto-turn"
97
99
  aria-haspopup="dialog"
98
- aria-label={`AUTO-PICKUP: ${AUTO_PICKUP_MODE_LABELS[state.mode].label}`}
100
+ aria-label={`AUTO-PICKUP: ${AUTO_PICKUP_MODE_LABELS[state.mode].label}${state.paused ? ', paused' : ''}`}
99
101
  aria-description={decision ?? undefined}
100
102
  className="display-font"
101
103
  title={`${modeTitle}${decision ? ` ${decision}` : ''}`}
@@ -110,9 +112,13 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
110
112
  }}
111
113
  >
112
114
  {AUTO_PICKUP_MODE_LABELS[state.mode].chip}
115
+ {state.paused ? ' - PAUSED' : ''}
113
116
  {isSmartPickupMode(state.mode) && state.counters ? ` · ${state.counters.wakesThisSession}/${state.limits.wakesPerSession}` : ''}
114
117
  </button>
115
- {state.mode === 'rule' && state.ruleStatus?.budgetPaused && <button type="button" data-help="cluster.auto-pickup-rule-resume" disabled={!connected} onClick={() => wsSendRaw?.({ type: 'cluster_auto_pickup_set', clusterId: cluster.clusterId, mode: 'rule', resumeRule: true })}>RESUME</button>}
118
+ {state.mode === 'rule' && state.ruleStatus?.budgetPaused && <button type="button" data-help="cluster.auto-pickup-rule-resume" disabled={!connected || state.paused} title={state.paused ? 'Resume AUTO-PICKUP before resetting its wake budget.' : 'Start a fresh Rule-based wake budget; hourly member limits remain.'} onClick={() => wsSendRaw?.({ type: 'cluster_auto_pickup_set', clusterId: cluster.clusterId, mode: 'rule', resumeRule: true })}>RESET BUDGET</button>}
119
+ {on && <button type="button" onClick={pause} disabled={!connected} data-help={state.paused ? 'cluster.auto-pickup-resume' : 'cluster.auto-pickup-pause'} aria-label={state.paused ? 'Resume AUTO-PICKUP' : 'Pause AUTO-PICKUP'} title={state.paused ? 'Resume with the same session and wake counts; check idle members with waiting mail through the normal limits.' : 'Pause automatic pickup and busy reminders without changing the mode, session or wake counts.'} className="display-font" style={{ padding: '3px 6px', background: 'transparent', border: '1px solid var(--color-border-hairline)', color: 'var(--color-fg-muted)', cursor: 'pointer', fontSize: '9px', letterSpacing: '1px', whiteSpace: 'nowrap' }}>
120
+ {state.paused ? 'RESUME' : 'PAUSE'}
121
+ </button>}
116
122
  {on && (
117
123
  <button
118
124
  type="button"
@@ -126,13 +132,14 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
126
132
  TURN OFF
127
133
  </button>
128
134
  )}
129
- {open && <AutoPickupDialog state={state} onClose={() => setOpen(false)} onApply={(mode, evaluator, limits, ruleLimits, remindBusy) => { send(mode, evaluator, limits, ruleLimits, remindBusy); setOpen(false); }} />}
135
+ {open && <AutoPickupDialog state={state} onPause={pause} onClose={() => setOpen(false)} onApply={(mode, evaluator, limits, ruleLimits, remindBusy) => { send(mode, evaluator, limits, ruleLimits, remindBusy); setOpen(false); }} />}
130
136
  </>
131
137
  );
132
138
  }
133
139
 
134
- function AutoPickupDialog({ state, onClose, onApply }: {
140
+ function AutoPickupDialog({ state, onPause, onClose, onApply }: {
135
141
  state: ClusterAutoPickupState;
142
+ onPause: () => void;
136
143
  onClose: () => void;
137
144
  onApply: (mode: AutoPickupMode, evaluator?: SmartPickupEvaluator, limits?: Partial<SmartPickupLimits>, ruleLimits?: Partial<RulePickupLimits>, remindBusy?: boolean) => void;
138
145
  }) {
@@ -186,7 +193,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
186
193
  : null;
187
194
  const field: React.CSSProperties = { display: 'block', margin: '4px 0 10px' };
188
195
  const decision = describeDecision(state);
189
- const remaining = useSessionRemaining(state.session?.expiresAt);
196
+ const remaining = useSessionRemaining(state.session?.expiresAt, state.pausedAt);
190
197
  return (
191
198
  <div onClick={onClose} style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.6)', zIndex: 60, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
192
199
  <div
@@ -200,6 +207,11 @@ function AutoPickupDialog({ state, onClose, onApply }: {
200
207
  style={{ ...formSurfaceSize(), overflowY: 'auto', background: 'var(--color-bg-dialog)', border: '1px solid var(--color-accent-primary-dim)', borderRadius: '6px', padding: '18px 20px', fontSize: '12px', lineHeight: 1.5, color: 'var(--color-fg)' }}
201
208
  >
202
209
  <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}><h2 id="auto-pickup-title" className="display-font glow-text-bright" style={{ margin: '0 0 10px', fontSize: '14px', letterSpacing: '2px' }}>AUTO-PICKUP</h2><WorkSurfaceControls surface={surface} storageKey="auto-pickup" /></div>
210
+ {state.mode !== 'off' && <p>
211
+ {state.paused ? 'Paused. Waiting mail stays in the mailbox; NUDGE still works.' : 'Automatic pickup is not paused.'}{' '}
212
+ {state.session && state.paused ? 'The Smart session clock is paused. ' : ''}
213
+ <button type="button" disabled={!connected} data-help={state.paused ? 'cluster.auto-pickup-resume' : 'cluster.auto-pickup-pause'} aria-label={state.paused ? 'Resume AUTO-PICKUP' : 'Pause AUTO-PICKUP'} onClick={onPause}>{state.paused ? 'RESUME' : 'PAUSE'}</button>
214
+ </p>}
203
215
  <fieldset style={{ border: 'none', padding: 0, margin: 0 }}>
204
216
  <legend className="display-font" style={{ fontSize: '10px', letterSpacing: '1.5px', color: 'var(--color-fg-muted)' }}>MODE</legend>
205
217
  {AUTO_PICKUP_MODES.map((m, i) => (
@@ -225,7 +237,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
225
237
  <input className="arco-field" type="number" min={spec.min} max={spec.max} step={1} value={Number.isFinite(ruleLimits[k]) ? ruleLimits[k] : ''} onChange={(e) => setRuleLimits((prior) => ({ ...prior, [k]: e.target.value === '' ? Number.NaN : Number(e.target.value) }))} />
226
238
  </label>; })}
227
239
  <button type="button" data-help="cluster.auto-pickup-rule-reset" onClick={() => setRuleLimits({ ...DEFAULT_RULE_PICKUP_LIMITS })}>RESET LIMITS</button>
228
- {state.ruleStatus && <p>Automatic wakes: {state.ruleStatus.wakes} of {ruleLimits.wakesPerArming} this arming.{state.ruleStatus.ledgerUnavailable ? ' Paused: the Rule-based ledger is unavailable.' : state.ruleStatus.budgetPaused ? ' Paused: resume to start a fresh budget.' : ''}{state.ruleStatus.pausedPair ? ' Alternating pair paused.' : ''}</p>}
240
+ {state.ruleStatus && <p>Automatic wakes: {state.ruleStatus.wakes} of {ruleLimits.wakesPerArming} this arming.{state.ruleStatus.ledgerUnavailable ? ' Paused: the Rule-based ledger is unavailable.' : state.ruleStatus.budgetPaused ? ' Wake budget reached. Select RESET BUDGET beside AUTO-PICKUP after resuming any operator pause.' : ''}{state.ruleStatus.pausedPair ? ' Alternating pair paused.' : ''}</p>}
229
241
  </section>}
230
242
  {smart && (
231
243
  <section data-help="cluster.auto-pickup-evaluator" style={{ borderTop: '1px solid var(--color-border-hairline)', marginTop: '10px', paddingTop: '10px' }}>
@@ -286,7 +298,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
286
298
 
287
299
  {(state.counters || decision) && (
288
300
  <section data-help="cluster.auto-pickup-status" aria-label="AUTO-PICKUP status" style={{ borderTop: '1px solid var(--color-border-hairline)', marginTop: '10px', paddingTop: '10px', color: 'var(--color-fg-muted)' }}>
289
- {state.session && <div>About {remaining} min remain. Session ends at {new Date(state.session.expiresAt).toLocaleTimeString()}. Change Armed session length under LIMITS before arming.</div>}
301
+ {state.session && <div>About {remaining} min remain. {state.paused ? 'Session clock paused.' : `Session ends at ${new Date(state.session.expiresAt).toLocaleTimeString()}.`} Change Armed session length under LIMITS before arming.</div>}
290
302
  {state.counters && <div>Evaluator requests: {state.counters.callsThisSession} this session, {state.counters.callsLastHour} in the last hour, {state.counters.inFlight} in progress. Automatic wakes: {state.counters.wakesThisSession} of {state.limits.wakesPerSession} this session, {state.counters.wakesLastHour} in the last hour.</div>}
291
303
  {decision && <div>Last decision: {decision}</div>}
292
304
  </section>
@@ -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,107 @@
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 } 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 [catalog, setCatalog] = useState<Skill[] | null>(null);
17
+ const [error, setError] = useState('');
18
+ const pins = cluster.skillPins ?? [];
19
+ const role = cluster.members.find(member => member.workflowId === memberId)?.role;
20
+ const applicable = pins.filter(pin => pin.role === undefined || pin.role === role);
21
+ const count = memberId ? new Set(applicable.map(pin => `${pin.scope}:${pin.slug}`)).size : pins.length;
22
+ const pinKey = JSON.stringify(pins);
23
+ useEffect(() => {
24
+ if (!open) return;
25
+ let cancelled = false;
26
+ setCatalog(null); setError('');
27
+ fetch(`/api/skills?cwd=${encodeURIComponent(cluster.cwd)}`).then(async response => {
28
+ if (!response.ok) throw new Error('The skill list is unavailable. Close and open this window to try again.');
29
+ return response.json();
30
+ }).then(data => { if (!cancelled) setCatalog([...(data.project ?? []), ...(data.global ?? [])]); })
31
+ .catch(reason => { if (!cancelled) setError(String(reason.message ?? reason)); });
32
+ return () => { cancelled = true; };
33
+ }, [open, cluster.cwd, pinKey]);
34
+ if (memberId && count === 0) return null;
35
+ return <>
36
+ <button type="button" className="display-font" data-help="cluster.skills" style={button}
37
+ aria-label={`${memberId ? 'Skills inherited from cluster' : 'Cluster skills'}, ${count} ${count === 1 ? 'pin' : 'pins'}`} aria-haspopup="dialog" aria-expanded={open}
38
+ onClick={() => setOpen(true)}>{memberId ? 'FROM CLUSTER' : 'SKILLS'} [{count}]</button>
39
+ {open && <DialogShell title="Cluster skills" dataHelp="cluster.skills" onClose={() => setOpen(false)} closeOnBackdrop width={620}
40
+ actions={<button type="button" style={button} data-help="cluster.skills" onClick={() => {
41
+ setOpen(false); useStartupStore.getState().setSettingsSection('skills'); useAppStore.getState().setShowSettings(true);
42
+ }}>SETTINGS &gt; SKILLS</button>}>
43
+ <p>Full skill text is added to every turn for matching members, including new and replaced members. Only the operator changes these pins.</p>
44
+ {!pins.length && <p>No skills are pinned to this cluster. Pin a skill from Settings &gt; SKILLS.</p>}
45
+ {error && <p role="alert">{error}</p>}
46
+ {pins.map((pin, index) => {
47
+ const skill = catalog?.find(item => sameRef(item, pin));
48
+ const status = catalog === null ? 'Loading' : !skill ? 'Missing or unreadable' : skill.off ? 'Off' : 'Available';
49
+ 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)' }}>
50
+ <div style={{ flex: '1 1 180px', minWidth: 0, overflowWrap: 'anywhere' }}>
51
+ <strong>{skill?.name ?? pin.slug}</strong> <span style={{ color: 'var(--color-fg-muted)' }}>({pin.scope})</span>
52
+ <div>{pin.role === undefined ? 'All members' : `Role: ${roleLabel(pin.role)}`}</div>
53
+ <div style={{ color: 'var(--color-fg-muted)' }}>{status}</div>
54
+ </div>
55
+ <button type="button" data-help="cluster.skills.unpin" style={button} disabled={!connected}
56
+ aria-label={`Unpin ${skill?.name ?? pin.slug} from ${pin.role === undefined ? 'all members' : roleLabel(pin.role)}`}
57
+ onClick={() => send?.({ type: 'cluster_skills_set', clusterId: cluster.clusterId, pins: pins.filter((_pin, n) => n !== index) })}>UNPIN</button>
58
+ </div>;
59
+ })}
60
+ <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>
61
+ </DialogShell>}
62
+ </>;
63
+ }
64
+
65
+ export function PinSkillDialog({ skill, cwd, kind, onClose }: { skill: Skill; cwd: string; kind: 'tab' | 'cluster'; onClose: () => void }) {
66
+ const clusters = useAppStore(s => s.clusters);
67
+ const jobs = useAppStore(s => s.jobs);
68
+ const send = useAppStore(s => s.wsSendRaw);
69
+ const connected = useAppStore(s => s.connected);
70
+ const targets = kind === 'cluster'
71
+ ? 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)}` }))
72
+ : 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) }));
73
+ const [target, setTarget] = useState(targets[0]?.id ?? '');
74
+ const [scope, setScope] = useState('all');
75
+ const [customRole, setCustomRole] = useState('');
76
+ const cluster = kind === 'cluster' ? clusters[target] : undefined;
77
+ const roles = [...new Set([...(cluster?.members.flatMap(member => member.role ? [member.role] : []) ?? []), ...ROLE_PRESETS.map(preset => preset.text)])];
78
+ const role = scope === 'all' ? undefined : scope === 'custom' ? customRole.trim() : scope.slice(5);
79
+ const valid = targets.some(item => item.id === target) && (scope === 'all' || !!role) && connected;
80
+ const members = cluster?.members.filter(member => role === undefined || member.role === role).length ?? 1;
81
+ const pin = () => {
82
+ if (!valid) return;
83
+ if (cluster) {
84
+ const next: ClusterSkillPin = { scope: skill.scope, slug: skill.slug, ...(role !== undefined ? { role } : {}) };
85
+ const pins = cluster.skillPins ?? [];
86
+ if (!pins.some(existing => sameRef(existing, next) && existing.role === next.role)) send?.({ type: 'cluster_skills_set', clusterId: target, pins: [...pins, next] });
87
+ } else {
88
+ const existing = jobs[target]?.config.pinnedSkills ?? [];
89
+ if (!existing.some(ref => sameRef(ref, skill))) send?.({ type: 'update_primary_config', workflowId: target, pinnedSkills: [...existing, { scope: skill.scope, slug: skill.slug }] });
90
+ }
91
+ onClose();
92
+ };
93
+ return <DialogShell title={`Pin ${skill.name} to ${kind}`} dataHelp="settings.skills.pin" onClose={onClose} width={620}
94
+ 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></>}>
95
+ {!targets.length ? <p>Open {kind === 'cluster' ? 'a cluster' : 'an Agent tab'}{skill.scope === 'project' ? ' for this project' : ''} to pin this skill.</p> : <>
96
+ <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'); }}>
97
+ {targets.map(item => <option key={item.id} value={item.id}>{item.name}</option>)}
98
+ </select></label>
99
+ {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)}>
100
+ <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>
101
+ </select></label>}
102
+ {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>}
103
+ <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>
104
+ {skill.scope === 'project' && <p>Pinning applies this project's skill text even when project trust is off. Review the skill before pinning it.</p>}
105
+ </>}
106
+ </DialogShell>;
107
+ }
@@ -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)',
@@ -243,11 +245,13 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
243
245
  arming surface is wired (both come from the same parent). */}
244
246
  {compactSettings && (onToggleIdleNudger || onSetTaskBoardMode || onSetTaskBoardAttached || onSetEfficiency || onSetRemote || onSetProgress) && (() => {
245
247
  // Medium and wide layouts: one summary line; SETTINGS opens the full block.
246
- const pickup = AUTO_PICKUP_MODE_LABELS[autoPickupStateOf(cluster).mode].chip;
248
+ const pickupState = autoPickupStateOf(cluster);
249
+ const pickup = `${AUTO_PICKUP_MODE_LABELS[pickupState.mode].chip}${pickupState.paused ? ' - PAUSED' : ''}`;
247
250
  const parts = [
248
251
  onToggleIdleNudger ? `MAIL ALERTS ${cluster.idleNudgerEnabled ? 'ON' : 'OFF'}` : null,
249
252
  onToggleAutoTurn ? `AUTO-PICKUP ${pickup}` : null,
250
253
  onSetEfficiency ? (cluster.efficiencyLevel ?? 'thorough').toUpperCase() : null,
254
+ cluster.skillPins?.length ? `SKILLS ${cluster.skillPins.length}` : null,
251
255
  onSetTaskBoardMode || onSetTaskBoardAttached ? `BOARD ${cluster.taskBoardMode && cluster.taskBoardMode !== 'none' && cluster.taskBoardAttached !== false ? cluster.taskBoardMode.toUpperCase() : 'OFF'}` : null,
252
256
  cluster.remoteEnabled ? 'REMOTE ON' : null,
253
257
  ].filter(Boolean).join(' · ');
@@ -332,6 +336,7 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
332
336
  onSetEfficiency={onSetEfficiency}
333
337
  />
334
338
  )}
339
+ <SkillsControl cluster={cluster} />
335
340
  {/* DD7 — cluster-wide project trust for the pinned cwd. Self-hiding
336
341
  when the repo ships nothing the gate suppresses. */}
337
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}
@@ -17,15 +17,17 @@ export function HeaderVersionBox() {
17
17
  const refresh = useAppUpdateStore((s) => s.refresh);
18
18
  const settings = useAppStore((s) => s.settings);
19
19
  const [open, setOpen] = useState(false);
20
+ const [autoConfirm, setAutoConfirm] = useState(false);
20
21
  const [busy, setBusy] = useState(false);
21
22
  const [error, setError] = useState('');
22
23
  const root = useRef<HTMLSpanElement>(null);
23
24
  const placeRef = useKeepInWindow();
25
+ useEffect(() => { useAppUpdateStore.getState().setVersionOpen(open); return () => useAppUpdateStore.getState().setVersionOpen(false); }, [open]);
24
26
  useEffect(() => { void refresh().catch(() => {}); }, [refresh]);
25
27
  useEffect(() => { if (notice?.latest) void refresh().catch(() => {}); }, [notice?.latest, refresh]);
26
28
  useEffect(() => {
27
29
  if (!open) return;
28
- const away = (event: MouseEvent) => { if (root.current && !root.current.contains(event.target as Node)) setOpen(false); };
30
+ const away = (event: MouseEvent) => { if (root.current && !root.current.contains(event.target as Node) && !(event.target as Element).closest('[aria-label="Confirm update"]')) setOpen(false); };
29
31
  const key = (event: KeyboardEvent) => { if (event.key === 'Escape') setOpen(false); };
30
32
  document.addEventListener('mousedown', away); document.addEventListener('keydown', key);
31
33
  return () => { document.removeEventListener('mousedown', away); document.removeEventListener('keydown', key); };
@@ -43,7 +45,7 @@ export function HeaderVersionBox() {
43
45
  : `Up to date (${current || 'version unknown'}). Last checked: ${checked}.`;
44
46
  const aria = updating ? 'Arco is updating' : available ? `Arco update available: ${plain(latest as string)}. Open update.` : `Arco version ${current || 'unknown'}. ${!checks ? 'Release checks are off.' : 'Up to date.'} Open version details.`;
45
47
  const check = async () => {
46
- setBusy(true); setError('');
48
+ setAutoConfirm(false); setBusy(true); setError('');
47
49
  try { await refresh(true); } catch { setError('Release check unavailable'); } finally { setBusy(false); }
48
50
  };
49
51
  const versions = () => { setOpen(false); useStartupStore.getState().setSettingsSection('cli-versions'); useAppStore.getState().setShowSettings(true); };
@@ -57,7 +59,7 @@ export function HeaderVersionBox() {
57
59
  aria-label={aria}
58
60
  aria-haspopup="dialog"
59
61
  aria-expanded={open}
60
- onClick={() => setOpen((value) => !value)}
62
+ onClick={() => { if (!open) setAutoConfirm(available); setOpen((value) => !value); }}
61
63
  style={{
62
64
  ...headerActionStyle,
63
65
  fontSize: '10px',
@@ -77,6 +79,7 @@ export function HeaderVersionBox() {
77
79
  </button>
78
80
  {(open || updating) && <div
79
81
  role="dialog"
82
+ data-recovery-safe
80
83
  aria-label={available ? 'Arco update' : 'Arco version'}
81
84
  data-testid="header-version-popover"
82
85
  ref={placeRef}
@@ -84,7 +87,7 @@ export function HeaderVersionBox() {
84
87
  >
85
88
  {available ? <>
86
89
  <div>Arco {plain(latest as string)} is available{current ? ` (running ${current})` : ''}.</div>
87
- <UpdateAction latest={latest} url={url} autoConfirm />
90
+ <UpdateAction latest={latest} url={url} autoConfirm={autoConfirm} />
88
91
  {url && <div><a href={url} target="_blank" rel="noopener noreferrer">Release notes</a></div>}
89
92
  </> : <>
90
93
  <div>Running: {current || 'unknown'}</div>
@@ -1,5 +1,5 @@
1
- // Needs-you counter for the cluster members header: review tasks with a
2
- // director sign-off, tasks blocked on the operator, and members waiting on an
1
+ // Needs-you counter for the cluster members header: tasks blocked on the
2
+ // operator and members waiting on an
3
3
  // answer. Click opens a list; picking a task opens the BOARD with it selected,
4
4
  // picking a question focuses that member. Read-only: it never sends anything.
5
5
 
@@ -39,7 +39,7 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
39
39
  ...(pending.some((question) => question.mode === 'async') ? [{ workflowId: m.workflowId, displayName: m.displayName, mode: 'async' as const }] : []),
40
40
  ];
41
41
  });
42
- // Done and archived tasks are never listed: only review and blocked count.
42
+ // Only tasks blocked on the operator appear alongside questions.
43
43
  return buildNeedsYouItems({ tasks, waitingQuestions });
44
44
  }, [cluster?.members, jobs, tasks]);
45
45