arco-workbench 0.1.5 → 0.1.7
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.
- package/CONTRIBUTING.md +9 -0
- package/README.md +17 -5
- package/client/dist/assets/{PhosphorBackdrop-D6cbmLNY.js → PhosphorBackdrop-DVQdBrTw.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-2dyerOi4.js → ThemedBackgroundShaderImpl-BfSs2tB4.js} +1 -1
- package/client/dist/assets/{XtermView-AIwo7O3D.js → XtermView-DaMjC8Ny.js} +1 -1
- package/client/dist/assets/{galleryEditor-DXAuxS8D.js → galleryEditor-BCQnXj7R.js} +1 -1
- package/client/dist/assets/{index-8j6p-pmQ.js → index-COfbHCYv.js} +245 -243
- package/client/dist/index.html +1 -1
- package/client/src/alerts/desktopAlerts.ts +13 -0
- package/client/src/buildCheck.ts +3 -1
- package/client/src/components/AppUpdateNotice.tsx +2 -1
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +46 -11
- package/client/src/components/ClusterRightPanel/MemberRow.tsx +1 -1
- package/client/src/components/ClusterRightPanel/index.tsx +2 -1
- package/client/src/components/ClusterTaskBoardTab.tsx +54 -3
- package/client/src/components/ContextMeter.tsx +7 -0
- package/client/src/components/HeaderVersionBox.tsx +7 -4
- package/client/src/components/Home/HomeView.tsx +1 -1
- package/client/src/components/NeedsYouBadge.tsx +31 -16
- package/client/src/components/OperatorQuestionNotice.tsx +10 -1
- package/client/src/components/ProvidersPopover.tsx +23 -12
- package/client/src/components/TabBar.tsx +11 -8
- package/client/src/components/TabStatusChip.tsx +8 -7
- package/client/src/components/UpdateAction.tsx +18 -4
- package/client/src/components/UpdateResultNotice.tsx +3 -1
- package/client/src/components/clusterNeedsYou.ts +27 -8
- package/client/src/help/content/cluster.tsx +50 -27
- package/client/src/help/content/composer.tsx +8 -1
- package/client/src/help/content/header.tsx +25 -14
- package/client/src/help/content/misc.tsx +8 -0
- package/client/src/help/content/rightPanel.tsx +1 -1
- package/client/src/help/content/settings.tsx +1 -1
- package/client/src/help/content/tabbar.tsx +2 -1
- package/client/src/help/manualSections/clusters.tsx +78 -19
- package/client/src/help/manualSections/configuration.tsx +20 -4
- package/client/src/help/manualSections/gettingStarted.tsx +10 -0
- package/client/src/help/manualSections/maintenance.tsx +50 -8
- package/client/src/help/manualSections/plans.tsx +5 -1
- package/client/src/help/manualSections/providers.tsx +10 -3
- package/client/src/help/manualSections/reference.tsx +1 -1
- package/client/src/help/manualSections/workflows.tsx +20 -0
- package/client/src/help/manualSections/workspace.tsx +7 -1
- package/client/src/questions/waitingQuestion.ts +3 -2
- package/client/src/stores/appStore.ts +1 -1
- package/client/src/stores/appStore.types.ts +1 -0
- package/client/src/stores/appUpdateStore.ts +29 -8
- package/client/src/stores/notificationStore.ts +2 -0
- package/client/src/utils/activityPresentation.ts +1 -1
- package/client/src/utils/tabStatus.ts +8 -0
- package/client/src/utils/wsSession.ts +2 -1
- package/client/src/voice/commands.ts +4 -3
- package/client/src/voice/executor.ts +3 -3
- package/client/src/ws/handleServerMessage.ts +22 -2
- package/client/src/ws/operatorQuestions.ts +2 -0
- package/docs/CLIENT.md +3 -3
- package/docs/FEATURES.md +1 -1
- package/docs/GETTING_STARTED.md +16 -6
- package/docs/GLOSSARY.md +6 -2
- package/docs/GOTCHAS.md +17 -5
- package/docs/OPERATIONS.md +207 -5
- package/docs/PERSISTENCE.md +22 -1
- package/docs/PRIMITIVES.md +1 -1
- package/docs/PROTOCOL.md +1 -1
- package/docs/PROTOCOL_CLUSTER.md +18 -7
- package/docs/PROVIDERS.md +10 -5
- package/docs/SETTINGS.md +4 -2
- package/docs/TASK_LEDGER.md +6 -0
- package/docs/VOICE.md +2 -0
- package/native/darwin-arm64/manifest.json +1 -1
- package/native/win32-arm64/manifest.json +1 -1
- package/node_modules/@arco/shared/dist/clusterRolePresets.d.ts +1 -1
- package/node_modules/@arco/shared/dist/clusterRolePresets.js +10 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.js +9 -1
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +2 -2
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -0
- package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/operatorQuestions.d.ts +12 -0
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +9 -3
- package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +2 -2
- package/scripts/packaging/arco.mjs +1 -0
- package/scripts/packaging/native-repair.mjs +46 -8
- package/scripts/packaging/update.mjs +5 -1
- package/server/dist/attention.d.ts +1 -1
- package/server/dist/attention.js +6 -4
- package/server/dist/capabilities.d.ts +9 -8
- package/server/dist/capabilities.js +71 -102
- package/server/dist/cliUpdateDecision.d.ts +34 -0
- package/server/dist/cliUpdateDecision.js +152 -0
- package/server/dist/clusterAutoTurn.d.ts +4 -0
- package/server/dist/clusterAutoTurn.js +29 -25
- package/server/dist/clusterBusyReminder.js +1 -1
- package/server/dist/clusterDirector.js +1 -0
- package/server/dist/clusterPeerOps.js +2 -2
- package/server/dist/clusterStore.d.ts +3 -0
- package/server/dist/clusterStore.js +22 -0
- package/server/dist/defaults/models.md +1 -1
- package/server/dist/fileAccessPolicy.js +7 -5
- package/server/dist/http/workflowDataRoutes.js +1 -1
- package/server/dist/index.js +5 -1
- package/server/dist/primitives/seedWorker.d.ts +1 -0
- package/server/dist/primitives/seedWorker.js +2 -1
- package/server/dist/providerConversation.d.ts +9 -0
- package/server/dist/providerConversation.js +80 -0
- package/server/dist/providers/claude-native/retainedContext.d.ts +4 -0
- package/server/dist/providers/claude-native/retainedContext.js +20 -0
- package/server/dist/providers/claude-native/worker.d.ts +1 -0
- package/server/dist/providers/claude-native/worker.js +34 -6
- package/server/dist/providers/codex-appserver/operatorQuestions.d.ts +5 -0
- package/server/dist/providers/codex-appserver/operatorQuestions.js +30 -0
- package/server/dist/providers/codex-appserver/worker.js +9 -4
- package/server/dist/providers/ollama.js +2 -3
- package/server/dist/server/broadcast.d.ts +1 -1
- package/server/dist/smartPickup.d.ts +2 -1
- package/server/dist/smartPickup.js +28 -1
- package/server/dist/smartPickupAdapters.d.ts +1 -0
- package/server/dist/smartPickupAdapters.js +18 -5
- package/server/dist/smartPickupLedger.js +6 -4
- package/server/dist/smartPickupObserver.d.ts +1 -0
- package/server/dist/smartPickupObserver.js +69 -23
- package/server/dist/workers/WorkerManager.d.ts +1 -0
- package/server/dist/workers/WorkerManager.js +1 -0
- package/server/dist/workers/limits.js +6 -2
- package/server/dist/workflowMeta.d.ts +11 -1
- package/server/dist/workflowMeta.js +132 -6
- package/server/dist/workflows/types.d.ts +1 -0
- package/server/dist/ws/clusterHandlers.d.ts +1 -0
- package/server/dist/ws/clusterHandlers.js +2 -1
- package/server/dist/ws/compactHandlers.d.ts +1 -1
- package/server/dist/ws/compactHandlers.js +11 -4
- package/server/dist/ws/handoffHandlers.js +16 -6
- package/server/dist/ws/operatorQuestionHandlers.d.ts +2 -1
- package/server/dist/ws/operatorQuestionHandlers.js +9 -1
- package/server/dist/ws/turnEngine.d.ts +2 -4
- package/server/dist/ws/turnEngine.js +88 -129
- package/server/package.json +1 -1
- package/server/src/attention.ts +5 -4
- package/server/src/capabilities.ts +70 -111
- package/server/src/cliUpdateDecision.ts +159 -0
- package/server/src/clusterAutoTurn.ts +26 -21
- package/server/src/clusterBusyReminder.ts +1 -1
- package/server/src/clusterDirector.ts +1 -0
- package/server/src/clusterPeerOps.ts +2 -2
- package/server/src/clusterStore.ts +26 -1
- package/server/src/defaults/models.md +1 -1
- package/server/src/fileAccessPolicy.ts +7 -5
- package/server/src/http/workflowDataRoutes.ts +1 -1
- package/server/src/index.ts +5 -1
- package/server/src/primitives/seedWorker.ts +3 -1
- package/server/src/providerConversation.ts +71 -0
- package/server/src/providers/claude-native/retainedContext.ts +22 -0
- package/server/src/providers/claude-native/worker.ts +33 -5
- package/server/src/providers/codex-appserver/operatorQuestions.ts +24 -0
- package/server/src/providers/codex-appserver/worker.ts +8 -4
- package/server/src/providers/ollama.ts +2 -3
- package/server/src/smartPickup.ts +27 -3
- package/server/src/smartPickupAdapters.ts +19 -5
- package/server/src/smartPickupLedger.ts +6 -4
- package/server/src/smartPickupObserver.ts +51 -17
- package/server/src/workers/WorkerManager.ts +2 -0
- package/server/src/workers/limits.ts +7 -2
- package/server/src/workflowMeta.ts +139 -5
- package/server/src/workflows/types.ts +1 -0
- package/server/src/ws/clusterHandlers.ts +3 -2
- package/server/src/ws/compactHandlers.ts +9 -3
- package/server/src/ws/handoffHandlers.ts +13 -6
- package/server/src/ws/operatorQuestionHandlers.ts +10 -2
- package/server/src/ws/turnEngine.ts +80 -135
- package/shared/dist/clusterRolePresets.d.ts +1 -1
- package/shared/dist/clusterRolePresets.js +10 -0
- package/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/shared/dist/protocol/autoPickup.js +9 -1
- package/shared/dist/protocol/clientMessages.d.ts +2 -2
- package/shared/dist/protocol/models.d.ts +6 -0
- package/shared/dist/protocol/notifications.d.ts +4 -0
- package/shared/dist/protocol/operatorQuestions.d.ts +12 -0
- package/shared/dist/protocol/serverMessages.d.ts +9 -3
- package/shared/dist/protocol/workflows.d.ts +1 -0
- package/shared/src/clusterRolePresets.ts +11 -1
- package/shared/src/protocol/autoPickup.ts +14 -1
- package/shared/src/protocol/clientMessages.ts +2 -1
- package/shared/src/protocol/models.ts +5 -2
- package/shared/src/protocol/notifications.ts +5 -0
- package/shared/src/protocol/operatorQuestions.ts +13 -0
- package/shared/src/protocol/serverMessages.ts +12 -2
- package/shared/src/protocol/workflows.ts +4 -0
package/client/dist/index.html
CHANGED
|
@@ -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-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-COfbHCYv.js"></script>
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-DD9kFGsF.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
@@ -42,6 +42,15 @@ export function isViewingWorkflow(state: ViewState, workflowId: string): boolean
|
|
|
42
42
|
return !state.activeClusterId && state.activeJobId === workflowId;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
const questionNotifications = new Map<string, Notification>();
|
|
46
|
+
export function clearQuestionAlert(requestId: string): void {
|
|
47
|
+
const id = `question-${requestId}`;
|
|
48
|
+
useNotificationStore.getState().removeNotice(id);
|
|
49
|
+
useAppStore.getState().dismissNotification(id);
|
|
50
|
+
questionNotifications.get(id)?.close();
|
|
51
|
+
questionNotifications.delete(id);
|
|
52
|
+
}
|
|
53
|
+
|
|
45
54
|
// One notification per event: the event id is the tag, so a second browser
|
|
46
55
|
// window on the same computer replaces rather than repeats it.
|
|
47
56
|
export function handleAttentionEvent(msg: AttentionEventMessage): void {
|
|
@@ -60,6 +69,10 @@ export function handleAttentionEvent(msg: AttentionEventMessage): void {
|
|
|
60
69
|
if (!ok) return;
|
|
61
70
|
try {
|
|
62
71
|
const n = new Notification(attentionTitle(msg.workflowName, msg.kind), { body: 'Open Arco to see it.', tag: msg.id });
|
|
72
|
+
if (msg.id.startsWith('question-')) {
|
|
73
|
+
questionNotifications.set(msg.id, n);
|
|
74
|
+
n.onclose = () => { if (questionNotifications.get(msg.id) === n) questionNotifications.delete(msg.id); };
|
|
75
|
+
}
|
|
63
76
|
n.onclick = () => {
|
|
64
77
|
try { window.focus(); } catch { /* ignore */ }
|
|
65
78
|
focusWorkflowTab(msg.workflowId);
|
package/client/src/buildCheck.ts
CHANGED
|
@@ -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 {
|
|
@@ -32,7 +32,7 @@ const MODE_HELP: Record<AutoPickupMode, string> = {
|
|
|
32
32
|
off: 'No automatic worker turns. MAIL ALERTS and NUDGE stay available.',
|
|
33
33
|
rule: 'Recommended: wakes members when mail arrives; skips acknowledgements and stops loops.',
|
|
34
34
|
'smart-observe': 'The chosen evaluator reads an idle member\'s waiting mail and answers wake, wait or ask. Answers are only logged; no turn starts.',
|
|
35
|
-
'smart-auto': '
|
|
35
|
+
'smart-auto': 'A wake answer starts a turn when every limit allows it; an ask answer alerts the operator. An evaluator failure attempts ordinary pickup through the same limits.',
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export function autoPickupStateOf(cluster: ClusterStatePayload): ClusterAutoPickupState {
|
|
@@ -43,14 +43,35 @@ function describeDecision(state: ClusterAutoPickupState): string | null {
|
|
|
43
43
|
const d = state.lastDecision;
|
|
44
44
|
if (!d) return null;
|
|
45
45
|
const when = new Date(d.at).toLocaleTimeString();
|
|
46
|
+
if (d.reason === 'session_expired') return `${when}: Smart session expired. Mail waits until Smart is armed again, Rule-based is chosen, or NUDGE is used. Change Armed session length in AUTO-PICKUP > LIMITS before arming.`;
|
|
46
47
|
const unloaded = /^evaluator_error:model_not_loaded_(lmstudio|llamacpp|strata|deepseek)$/.exec(d.reason);
|
|
47
48
|
const names = { lmstudio: 'LM Studio', llamacpp: 'llama.cpp', strata: 'Strata', deepseek: 'DeepSeek' } as const;
|
|
49
|
+
if (d.outcome.startsWith('fallback_')) {
|
|
50
|
+
const cause = unloaded ? `model not loaded in ${names[unloaded[1] as keyof typeof names]}; load it or choose another`
|
|
51
|
+
: d.reason.replace(/^(evaluator_error|invalid_answer):/, '').replace(/_/g, ' ');
|
|
52
|
+
const outcome = d.outcome === 'fallback_woke' ? 'ordinary pickup started.'
|
|
53
|
+
: d.outcome === 'fallback_observed' ? 'would use ordinary pickup. No turn started.'
|
|
54
|
+
: `ordinary pickup held: ${d.outcome.replace(/^fallback_skipped:/, '').replace(/_/g, ' ')}.`;
|
|
55
|
+
return `${when}: Evaluator failed (${cause}); ${outcome}`;
|
|
56
|
+
}
|
|
48
57
|
const what = d.action ? `answered ${d.action}` : unloaded
|
|
49
58
|
? `model not loaded in ${names[unloaded[1] as keyof typeof names]}; load it or choose another`
|
|
50
59
|
: d.reason.replace(/_/g, ' ');
|
|
51
60
|
return `${when}: ${what}${d.action ? ` (${d.reason.replace(/_/g, ' ')}), ${d.outcome}` : ''}`;
|
|
52
61
|
}
|
|
53
62
|
|
|
63
|
+
function useSessionRemaining(expiresAt?: number, pausedAt?: number): number | null {
|
|
64
|
+
const [now, setNow] = useState(Date.now);
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (expiresAt === undefined) return;
|
|
67
|
+
setNow(Date.now());
|
|
68
|
+
if (pausedAt !== undefined) return;
|
|
69
|
+
const timer = setInterval(() => setNow(Date.now()), 30_000);
|
|
70
|
+
return () => clearInterval(timer);
|
|
71
|
+
}, [expiresAt, pausedAt]);
|
|
72
|
+
return expiresAt === undefined ? null : Math.max(0, Math.ceil((expiresAt - (pausedAt ?? now)) / 60_000));
|
|
73
|
+
}
|
|
74
|
+
|
|
54
75
|
export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload }) {
|
|
55
76
|
const state = autoPickupStateOf(cluster);
|
|
56
77
|
const wsSendRaw = useAppStore((s) => s.wsSendRaw);
|
|
@@ -60,9 +81,11 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
|
|
|
60
81
|
wsSendRaw?.({ type: 'cluster_auto_pickup_set', clusterId: cluster.clusterId, mode, ...(evaluator ? { evaluator } : {}), ...(limits ? { limits } : {}), ...(ruleLimits ? { ruleLimits } : {}), ...(remindBusy !== undefined ? { remindBusy } : {}) });
|
|
61
82
|
};
|
|
62
83
|
const on = state.mode !== 'off';
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
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);
|
|
86
|
+
const decision = describeDecision(state);
|
|
87
|
+
const modeTitle = on
|
|
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.`
|
|
66
89
|
: 'AUTO-PICKUP is off. Click to choose a mode.';
|
|
67
90
|
return (
|
|
68
91
|
<>
|
|
@@ -74,9 +97,10 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
|
|
|
74
97
|
onClick={() => setOpen(true)}
|
|
75
98
|
data-help="cluster.auto-turn"
|
|
76
99
|
aria-haspopup="dialog"
|
|
77
|
-
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' : ''}`}
|
|
101
|
+
aria-description={decision ?? undefined}
|
|
78
102
|
className="display-font"
|
|
79
|
-
title={
|
|
103
|
+
title={`${modeTitle}${decision ? ` ${decision}` : ''}`}
|
|
80
104
|
style={{
|
|
81
105
|
padding: '3px 8px',
|
|
82
106
|
background: on ? 'var(--color-accent-primary-a06)' : 'transparent',
|
|
@@ -88,9 +112,13 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
|
|
|
88
112
|
}}
|
|
89
113
|
>
|
|
90
114
|
{AUTO_PICKUP_MODE_LABELS[state.mode].chip}
|
|
115
|
+
{state.paused ? ' - PAUSED' : ''}
|
|
91
116
|
{isSmartPickupMode(state.mode) && state.counters ? ` · ${state.counters.wakesThisSession}/${state.limits.wakesPerSession}` : ''}
|
|
92
117
|
</button>
|
|
93
|
-
{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 })}>
|
|
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>}
|
|
94
122
|
{on && (
|
|
95
123
|
<button
|
|
96
124
|
type="button"
|
|
@@ -104,13 +132,14 @@ export function AutoPickupControl({ cluster }: { cluster: ClusterStatePayload })
|
|
|
104
132
|
TURN OFF
|
|
105
133
|
</button>
|
|
106
134
|
)}
|
|
107
|
-
{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); }} />}
|
|
108
136
|
</>
|
|
109
137
|
);
|
|
110
138
|
}
|
|
111
139
|
|
|
112
|
-
function AutoPickupDialog({ state, onClose, onApply }: {
|
|
140
|
+
function AutoPickupDialog({ state, onPause, onClose, onApply }: {
|
|
113
141
|
state: ClusterAutoPickupState;
|
|
142
|
+
onPause: () => void;
|
|
114
143
|
onClose: () => void;
|
|
115
144
|
onApply: (mode: AutoPickupMode, evaluator?: SmartPickupEvaluator, limits?: Partial<SmartPickupLimits>, ruleLimits?: Partial<RulePickupLimits>, remindBusy?: boolean) => void;
|
|
116
145
|
}) {
|
|
@@ -164,6 +193,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
|
|
|
164
193
|
: null;
|
|
165
194
|
const field: React.CSSProperties = { display: 'block', margin: '4px 0 10px' };
|
|
166
195
|
const decision = describeDecision(state);
|
|
196
|
+
const remaining = useSessionRemaining(state.session?.expiresAt, state.pausedAt);
|
|
167
197
|
return (
|
|
168
198
|
<div onClick={onClose} style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.6)', zIndex: 60, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
|
|
169
199
|
<div
|
|
@@ -177,6 +207,11 @@ function AutoPickupDialog({ state, onClose, onApply }: {
|
|
|
177
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)' }}
|
|
178
208
|
>
|
|
179
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>}
|
|
180
215
|
<fieldset style={{ border: 'none', padding: 0, margin: 0 }}>
|
|
181
216
|
<legend className="display-font" style={{ fontSize: '10px', letterSpacing: '1.5px', color: 'var(--color-fg-muted)' }}>MODE</legend>
|
|
182
217
|
{AUTO_PICKUP_MODES.map((m, i) => (
|
|
@@ -202,7 +237,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
|
|
|
202
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) }))} />
|
|
203
238
|
</label>; })}
|
|
204
239
|
<button type="button" data-help="cluster.auto-pickup-rule-reset" onClick={() => setRuleLimits({ ...DEFAULT_RULE_PICKUP_LIMITS })}>RESET LIMITS</button>
|
|
205
|
-
{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 ? '
|
|
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>}
|
|
206
241
|
</section>}
|
|
207
242
|
{smart && (
|
|
208
243
|
<section data-help="cluster.auto-pickup-evaluator" style={{ borderTop: '1px solid var(--color-border-hairline)', marginTop: '10px', paddingTop: '10px' }}>
|
|
@@ -263,7 +298,7 @@ function AutoPickupDialog({ state, onClose, onApply }: {
|
|
|
263
298
|
|
|
264
299
|
{(state.counters || decision) && (
|
|
265
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)' }}>
|
|
266
|
-
{state.session && <div>Session ends at {new Date(state.session.expiresAt).toLocaleTimeString()}.</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>}
|
|
267
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>}
|
|
268
303
|
{decision && <div>Last decision: {decision}</div>}
|
|
269
304
|
</section>
|
|
@@ -32,7 +32,7 @@ export function MemberRow({
|
|
|
32
32
|
onDetach?: (clusterId: string, workflowId: string) => void;
|
|
33
33
|
}) {
|
|
34
34
|
// Two distinct UI modes share the role surface:
|
|
35
|
-
// popoverOpen → preset list (
|
|
35
|
+
// popoverOpen → preset list (8 presets + CLEAR + Custom…) anchored to SET
|
|
36
36
|
// editingCustom → inline text editor (the pre-popover affordance, kept
|
|
37
37
|
// as the "Custom…" escape hatch).
|
|
38
38
|
// Esc / click-outside dismisses the popover. Picking a preset commits +
|
|
@@ -243,7 +243,8 @@ export function ClusterRightPanel({ cluster, compactSettings = false, tabRequest
|
|
|
243
243
|
arming surface is wired (both come from the same parent). */}
|
|
244
244
|
{compactSettings && (onToggleIdleNudger || onSetTaskBoardMode || onSetTaskBoardAttached || onSetEfficiency || onSetRemote || onSetProgress) && (() => {
|
|
245
245
|
// Medium and wide layouts: one summary line; SETTINGS opens the full block.
|
|
246
|
-
const
|
|
246
|
+
const pickupState = autoPickupStateOf(cluster);
|
|
247
|
+
const pickup = `${AUTO_PICKUP_MODE_LABELS[pickupState.mode].chip}${pickupState.paused ? ' - PAUSED' : ''}`;
|
|
247
248
|
const parts = [
|
|
248
249
|
onToggleIdleNudger ? `MAIL ALERTS ${cluster.idleNudgerEnabled ? 'ON' : 'OFF'}` : null,
|
|
249
250
|
onToggleAutoTurn ? `AUTO-PICKUP ${pickup}` : null,
|
|
@@ -823,6 +823,8 @@ export function ClusterTaskBoardTab({
|
|
|
823
823
|
canEdit={canCreateTask}
|
|
824
824
|
onEditTask={editTask}
|
|
825
825
|
onDeleteTask={deleteTask}
|
|
826
|
+
onQuickDone={taskShowReader && onUpdateTaskStatus ? quickDone : undefined}
|
|
827
|
+
onRecheck={wsSendRaw && recheckSenderFor(selectedTask) ? recheckTask : undefined}
|
|
826
828
|
onUpdateTaskStatus={onUpdateTaskStatus}
|
|
827
829
|
onReassignTask={onReassignTask}
|
|
828
830
|
onReclaimRun={onReclaimRun}
|
|
@@ -1119,6 +1121,8 @@ function TaskDetailDrawer({
|
|
|
1119
1121
|
canEdit,
|
|
1120
1122
|
onEditTask,
|
|
1121
1123
|
onDeleteTask,
|
|
1124
|
+
onQuickDone,
|
|
1125
|
+
onRecheck,
|
|
1122
1126
|
onUpdateTaskStatus,
|
|
1123
1127
|
onReassignTask,
|
|
1124
1128
|
onReclaimRun,
|
|
@@ -1140,6 +1144,8 @@ function TaskDetailDrawer({
|
|
|
1140
1144
|
canEdit: boolean;
|
|
1141
1145
|
onEditTask: (taskId: string, patch: { title?: string; notes?: string; priority?: number; parentIds?: string[]; release?: string }) => void;
|
|
1142
1146
|
onDeleteTask: (taskId: string) => void;
|
|
1147
|
+
onQuickDone?: (taskId: string) => void;
|
|
1148
|
+
onRecheck?: (task: WorktreeAwareLedgerTask) => void;
|
|
1143
1149
|
onUpdateTaskStatus?: (workflowId: string, taskId: string, status: LedgerTaskStatus, boardKey?: string) => void;
|
|
1144
1150
|
onReassignTask?: (workflowId: string, taskId: string, assigneeWorkflowId: string | null, boardKey?: string) => void;
|
|
1145
1151
|
onReclaimRun?: (clusterId: string, workflowId: string, taskId: string, runId: string, boardKey?: string) => void;
|
|
@@ -1147,6 +1153,10 @@ function TaskDetailDrawer({
|
|
|
1147
1153
|
onClose: () => void;
|
|
1148
1154
|
}) {
|
|
1149
1155
|
const runs = details?.runs ?? [];
|
|
1156
|
+
const detailScroll = useRef<HTMLDivElement | null>(null);
|
|
1157
|
+
useEffect(() => {
|
|
1158
|
+
if (task.status === 'review' && detailScroll.current) detailScroll.current.scrollTop = 0;
|
|
1159
|
+
}, [task.id, task.status]);
|
|
1150
1160
|
const openRuns = runs.filter(runOpen);
|
|
1151
1161
|
const linkedRefs = details?.referenceDocs?.refs ?? [];
|
|
1152
1162
|
const [openRef, setOpenRef] = useState<{ planId: string; slug: string; exists: boolean } | null>(null);
|
|
@@ -1286,7 +1296,40 @@ function TaskDetailDrawer({
|
|
|
1286
1296
|
CLOSE
|
|
1287
1297
|
</button>
|
|
1288
1298
|
</div>
|
|
1289
|
-
<div style={{ flex: 1, minHeight: 0, overflowY: 'auto', padding: '8px 10px 12px' }}>
|
|
1299
|
+
<div ref={detailScroll} style={{ flex: 1, minHeight: 0, overflowY: 'auto', padding: '8px 10px 12px' }}>
|
|
1300
|
+
{task.status === 'review' && (
|
|
1301
|
+
<DrawerSection title="TO ACCEPT">
|
|
1302
|
+
<InlineBlock
|
|
1303
|
+
label="Director sign-off"
|
|
1304
|
+
body={task.signoff
|
|
1305
|
+
? `${signoffChip(task.signoff).label}\n${task.signoff.byWorkflowId ? `by ${nameFor(task.signoff.byWorkflowId)}` : 'Author not recorded'} · ${formatTime(task.signoff.at)}`
|
|
1306
|
+
: 'No sign-off yet.'}
|
|
1307
|
+
/>
|
|
1308
|
+
{task.signoff?.summary && (
|
|
1309
|
+
<div title={task.signoff.summary} data-testid="review-signoff-summary"
|
|
1310
|
+
style={{ color: 'var(--color-fg)', fontSize: '11px', marginTop: '5px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
|
|
1311
|
+
{task.signoff.summary}
|
|
1312
|
+
</div>
|
|
1313
|
+
)}
|
|
1314
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '6px', marginTop: '8px' }}>
|
|
1315
|
+
<button type="button" className="display-font" data-help="cluster.board-accept"
|
|
1316
|
+
disabled={!onQuickDone} onClick={() => onQuickDone?.(task.id)}
|
|
1317
|
+
title="Accept this task: mark it done."
|
|
1318
|
+
style={{ ...smallButtonStyle(Boolean(onQuickDone)), color: onQuickDone ? '#58a66c' : 'var(--color-fg-muted)' }}>
|
|
1319
|
+
✓ ACCEPT
|
|
1320
|
+
</button>
|
|
1321
|
+
<button type="button" className="display-font" data-help="cluster.board-recheck"
|
|
1322
|
+
disabled={!onRecheck} onClick={() => onRecheck?.(task)}
|
|
1323
|
+
title={onRecheck ? `Ask ${task.signoff?.byWorkflowId ? nameFor(task.signoff.byWorkflowId) : 'the director'} to re-verify this task actually met its target.` : 'No sign-off author is available for re-review.'}
|
|
1324
|
+
style={smallButtonStyle(Boolean(onRecheck))}>
|
|
1325
|
+
↩ RECHECK
|
|
1326
|
+
</button>
|
|
1327
|
+
</div>
|
|
1328
|
+
<p style={{ color: 'var(--color-fg-muted)', fontSize: '11px', margin: '6px 0 0' }}>
|
|
1329
|
+
Accepting is optional; nothing waits on it.
|
|
1330
|
+
</p>
|
|
1331
|
+
</DrawerSection>
|
|
1332
|
+
)}
|
|
1290
1333
|
{loading && (
|
|
1291
1334
|
<div style={{ fontSize: '11px', color: 'var(--color-fg-muted)', marginBottom: '8px' }}>
|
|
1292
1335
|
Loading task details…
|
|
@@ -1347,7 +1390,7 @@ function TaskDetailDrawer({
|
|
|
1347
1390
|
)}
|
|
1348
1391
|
|
|
1349
1392
|
{canEdit && (
|
|
1350
|
-
<DrawerSection title="Edit">
|
|
1393
|
+
<DrawerSection key={task.status === 'review' ? task.id : undefined} title="Edit" collapsed={task.status === 'review'}>
|
|
1351
1394
|
<div
|
|
1352
1395
|
data-help="cluster.task-edit"
|
|
1353
1396
|
style={{
|
|
@@ -1667,7 +1710,15 @@ function TaskDetailDrawer({
|
|
|
1667
1710
|
);
|
|
1668
1711
|
}
|
|
1669
1712
|
|
|
1670
|
-
function DrawerSection({ title, children }: { title: string; children: ReactNode }) {
|
|
1713
|
+
function DrawerSection({ title, children, collapsed = false }: { title: string; children: ReactNode; collapsed?: boolean }) {
|
|
1714
|
+
if (collapsed) return (
|
|
1715
|
+
<details style={{ paddingTop: '8px', marginTop: '8px', borderTop: '1px solid var(--color-border-hairline)' }}>
|
|
1716
|
+
<summary className="display-font" style={{ fontSize: '10px', letterSpacing: '1px', color: 'var(--color-fg-muted)', marginBottom: '6px', cursor: 'pointer' }}>
|
|
1717
|
+
{title}
|
|
1718
|
+
</summary>
|
|
1719
|
+
{children}
|
|
1720
|
+
</details>
|
|
1721
|
+
);
|
|
1671
1722
|
return (
|
|
1672
1723
|
<section style={{ paddingTop: '8px', marginTop: '8px', borderTop: '1px solid var(--color-border-hairline)' }}>
|
|
1673
1724
|
<div className="display-font" style={{ fontSize: '10px', letterSpacing: '1px', color: 'var(--color-fg-muted)', marginBottom: '6px' }}>
|
|
@@ -49,6 +49,13 @@ export function ContextMeter({ job, onRecalibrate }: { job: JobState; onRecalibr
|
|
|
49
49
|
const cu = job.contextUsage;
|
|
50
50
|
const outCumulative = job.totalTokens.output;
|
|
51
51
|
|
|
52
|
+
if (job.providerConversation) {
|
|
53
|
+
const explanation = job.providerConversation === 'unavailable'
|
|
54
|
+
? 'The previous provider conversation cannot be resumed because its saved thread id is unavailable. The next message starts a new conversation. Earlier messages remain in this tab.'
|
|
55
|
+
: 'A new provider conversation has started. Its context reading is not available yet. Earlier usage remains in the conversation history.';
|
|
56
|
+
return <span title={explanation} aria-label={`CTX: unavailable. ${explanation}`} style={{ color: 'var(--color-fg-muted)' }}>CTX: -</span>;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
if (cu) {
|
|
53
60
|
const fillColor = contextPercentColor(cu.percentOfWindow);
|
|
54
61
|
const estK = compact(cu.estimatedTokens);
|
|
@@ -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>
|
|
@@ -291,5 +291,5 @@ export function HomeView({ onResume }: { onResume?: (config: WorkflowConfig) =>
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
function HomeWorkStatus({ kind, id, waiting, busy }: { kind: 'job' | 'cluster'; id: string; waiting: boolean; busy: boolean }) {
|
|
294
|
-
return <TabStatusChip status={useTabStatus(kind, id, waiting, busy)} />;
|
|
294
|
+
return <TabStatusChip status={useTabStatus(kind, id, waiting, busy)} busy={busy} />;
|
|
295
295
|
}
|
|
@@ -8,16 +8,10 @@ import type { LedgerTask } from '@arco/shared';
|
|
|
8
8
|
import { useAppStore } from '../stores/appStore';
|
|
9
9
|
import { requestBoardTask } from '../stores/boardTaskRequest';
|
|
10
10
|
import { hasWaitingQuestion } from '../questions/waitingQuestion';
|
|
11
|
-
import { buildNeedsYouItems,
|
|
11
|
+
import { buildNeedsYouItems, needsYouSummary, NEEDS_YOU_KIND, type NeedsYouItem } from './clusterNeedsYou';
|
|
12
12
|
import { useKeepInWindow } from '../layout/keepInWindow';
|
|
13
13
|
|
|
14
14
|
const EMPTY_TASKS: LedgerTask[] = [];
|
|
15
|
-
const KIND_LABEL: Record<NeedsYouItem['kind'], string> = {
|
|
16
|
-
review: 'ACCEPT',
|
|
17
|
-
blocked: 'BLOCKED',
|
|
18
|
-
question: 'QUESTION',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
15
|
export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: string; compact?: boolean }) {
|
|
22
16
|
const cluster = useAppStore((s) => s.clusters[clusterId]);
|
|
23
17
|
const jobs = useAppStore((s) => s.jobs);
|
|
@@ -33,8 +27,18 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
|
|
|
33
27
|
|
|
34
28
|
const items = useMemo(() => {
|
|
35
29
|
const waitingQuestions = (cluster?.members ?? [])
|
|
36
|
-
.
|
|
37
|
-
|
|
30
|
+
.flatMap((m) => {
|
|
31
|
+
const job = jobs[m.workflowId];
|
|
32
|
+
if (!job || !hasWaitingQuestion(job)) return [];
|
|
33
|
+
const pending = job.messages.flatMap((message) => message.operatorQuestion?.status === 'pending' ? [message.operatorQuestion] : []);
|
|
34
|
+
// Keep member jump targets and count one entry per pending mode.
|
|
35
|
+
// Legacy Native question ids describe a blocking tool question.
|
|
36
|
+
const blocking = (job.claudeNativePendingQuestionIds?.length ?? 0) > 0 || pending.some((question) => question.mode !== 'async');
|
|
37
|
+
return [
|
|
38
|
+
...(blocking ? [{ workflowId: m.workflowId, displayName: m.displayName, mode: 'blocking' as const }] : []),
|
|
39
|
+
...(pending.some((question) => question.mode === 'async') ? [{ workflowId: m.workflowId, displayName: m.displayName, mode: 'async' as const }] : []),
|
|
40
|
+
];
|
|
41
|
+
});
|
|
38
42
|
// Done and archived tasks are never listed: only review and blocked count.
|
|
39
43
|
return buildNeedsYouItems({ tasks, waitingQuestions });
|
|
40
44
|
}, [cluster?.members, jobs, tasks]);
|
|
@@ -58,6 +62,7 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
|
|
|
58
62
|
useEffect(() => { if (items.length === 0) setOpen(false); }, [items.length]);
|
|
59
63
|
|
|
60
64
|
if (!cluster || items.length === 0) return null;
|
|
65
|
+
const summary = needsYouSummary(items);
|
|
61
66
|
|
|
62
67
|
const toggle = () => {
|
|
63
68
|
const rect = buttonRef.current?.getBoundingClientRect();
|
|
@@ -80,28 +85,37 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
|
|
|
80
85
|
className="display-font"
|
|
81
86
|
data-help="cluster.needs-you"
|
|
82
87
|
data-testid="cluster-needs-you"
|
|
83
|
-
aria-label={
|
|
88
|
+
aria-label={summary.label}
|
|
84
89
|
aria-haspopup="true"
|
|
85
90
|
aria-expanded={open}
|
|
86
91
|
onClick={toggle}
|
|
87
|
-
title=
|
|
92
|
+
title={summary.title}
|
|
88
93
|
style={{
|
|
89
|
-
flex: '0 0 auto',
|
|
94
|
+
flex: compact ? '0 0 auto' : '0 1 auto',
|
|
90
95
|
marginLeft: compact ? 0 : '6px',
|
|
91
96
|
width: compact ? '32px' : undefined,
|
|
92
97
|
minWidth: 0,
|
|
98
|
+
maxWidth: '100%',
|
|
99
|
+
whiteSpace: compact ? 'nowrap' : 'normal',
|
|
93
100
|
overflow: 'hidden',
|
|
94
101
|
textOverflow: 'ellipsis',
|
|
95
102
|
padding: compact ? '2px' : '2px 7px',
|
|
96
103
|
fontSize: '9px',
|
|
97
104
|
letterSpacing: compact ? 0 : '1px',
|
|
98
|
-
color: '
|
|
105
|
+
color: summary.stopped > 0 ? 'var(--color-warning)' : 'var(--color-fg-muted)',
|
|
99
106
|
background: open ? 'var(--color-accent-primary-a06)' : 'transparent',
|
|
100
107
|
border: '1px solid currentColor',
|
|
101
108
|
cursor: 'pointer',
|
|
102
109
|
}}
|
|
103
110
|
>
|
|
104
|
-
{compact ?
|
|
111
|
+
{compact ? summary.compactLabel : summary.groups.map((group, index) => (
|
|
112
|
+
<span key={group.kind}>
|
|
113
|
+
{index > 0 && <span style={{ color: 'var(--color-fg-muted)' }}> · </span>}
|
|
114
|
+
<span style={{ color: group.stopped ? 'var(--color-warning)' : 'var(--color-fg-muted)', whiteSpace: 'nowrap' }}>
|
|
115
|
+
{group.count} {group.label}
|
|
116
|
+
</span>
|
|
117
|
+
</span>
|
|
118
|
+
))}
|
|
105
119
|
</button>
|
|
106
120
|
{open && anchor && (
|
|
107
121
|
<div
|
|
@@ -129,6 +143,7 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
|
|
|
129
143
|
key={item.id}
|
|
130
144
|
type="button"
|
|
131
145
|
role="menuitem"
|
|
146
|
+
title={NEEDS_YOU_KIND[item.kind].description}
|
|
132
147
|
onClick={() => pick(item)}
|
|
133
148
|
style={{
|
|
134
149
|
textAlign: 'left',
|
|
@@ -146,8 +161,8 @@ export function NeedsYouBadge({ clusterId, compact = false }: { clusterId: strin
|
|
|
146
161
|
onMouseLeave={(e) => { e.currentTarget.style.borderColor = 'transparent'; }}
|
|
147
162
|
>
|
|
148
163
|
<span style={{ display: 'flex', gap: '6px', alignItems: 'baseline', minWidth: 0 }}>
|
|
149
|
-
<span className="display-font" style={{ fontSize: '9px', letterSpacing: '1px', color: '
|
|
150
|
-
{
|
|
164
|
+
<span className="display-font" style={{ fontSize: '9px', letterSpacing: '1px', color: NEEDS_YOU_KIND[item.kind].stopped ? 'var(--color-warning)' : 'var(--color-fg-muted)', flexShrink: 0 }}>
|
|
165
|
+
{NEEDS_YOU_KIND[item.kind].label}
|
|
151
166
|
</span>
|
|
152
167
|
<span style={{ fontSize: '11px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{item.title}</span>
|
|
153
168
|
</span>
|
|
@@ -20,6 +20,12 @@ export function OperatorQuestionNotice({ workflowId, question, error }: { workfl
|
|
|
20
20
|
send!({ type: 'operator_question_reply', workflowId, requestId: question.requestId,
|
|
21
21
|
answers: Object.fromEntries(question.questions.map((q) => [q.id, [answers[q.id]]])) });
|
|
22
22
|
};
|
|
23
|
+
const dismiss = () => {
|
|
24
|
+
if (disabled) return;
|
|
25
|
+
updateMessage(workflowId, `operator-question-${question.requestId}`, { operatorQuestionError: undefined });
|
|
26
|
+
setSending(true);
|
|
27
|
+
send!({ type: 'operator_question_dismiss', workflowId, requestId: question.requestId });
|
|
28
|
+
};
|
|
23
29
|
return <div id={`operator-question-${question.requestId}`} style={{ borderLeft: '2px solid var(--color-accent-secondary)', padding: '10px 12px', background: 'var(--color-bg-sunken)', marginBottom: 12 }}>
|
|
24
30
|
<div className="display-font" style={{ color: 'var(--color-accent-secondary)', fontSize: 11, letterSpacing: 1, marginBottom: 8 }}>
|
|
25
31
|
{question.provider.toUpperCase()} · {pending ? question.mode === 'blocking' ? 'WAITING FOR YOUR ANSWER' : 'QUESTION · AGENT CAN CONTINUE' : question.status.toUpperCase()}
|
|
@@ -39,7 +45,10 @@ export function OperatorQuestionNotice({ workflowId, question, error }: { workfl
|
|
|
39
45
|
style={{ boxSizing: 'border-box', width: '100%', padding: '6px 8px', fontSize: 12, color: 'var(--color-text-primary)', background: 'var(--color-bg-sunken)', border: '1px solid var(--color-border-hairline)', borderRadius: 3 }} />}
|
|
40
46
|
</> : question.status === 'answered' && <div style={{ color: 'var(--color-fg-muted)', fontSize: 12 }}>{q.secret ? 'Answer sent (hidden)' : question.answers?.[q.id]?.join(', ')}</div>}
|
|
41
47
|
</fieldset>)}
|
|
42
|
-
{pending && <
|
|
48
|
+
{pending && <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}>
|
|
49
|
+
<button type="submit" disabled={disabled || !ready} className="display-font" style={{ padding: '5px 10px', border: '1px solid var(--color-accent-secondary)', borderRadius: 3, background: 'transparent', color: 'var(--color-accent-secondary)', opacity: disabled || !ready ? 0.5 : 1 }}>{sending ? 'SENDING…' : 'SEND ANSWERS'}</button>
|
|
50
|
+
<button type="button" disabled={disabled} onClick={dismiss} data-help="question.dismiss" className="display-font" style={{ padding: '5px 10px', border: '1px solid var(--color-accent-secondary)', borderRadius: 3, background: 'transparent', color: 'var(--color-accent-secondary)', opacity: disabled ? 0.5 : 1 }}>DISMISS</button>
|
|
51
|
+
</div>}
|
|
43
52
|
{pending && !connected && <span style={{ color: 'var(--color-fg-muted)', fontSize: 12 }}> Reconnecting before you can answer…</span>}
|
|
44
53
|
{error && <div role="alert" style={{ color: 'var(--color-danger)', fontSize: 12, marginTop: 6 }}>{error}</div>}
|
|
45
54
|
{question.reason && <div style={{ color: 'var(--color-fg-muted)', fontSize: 12 }}>{question.reason}</div>}
|