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.
- package/CONTRIBUTING.md +52 -12
- package/README.md +20 -13
- package/client/dist/assets/{PhosphorBackdrop-BR-TgB5x.js → PhosphorBackdrop-D7jdAV_G.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-DgcFj6JN.js → ThemedBackgroundShaderImpl-DrDm60h8.js} +1 -1
- package/client/dist/assets/{XtermView-CflVBQgC.js → XtermView-BGFujb1e.js} +1 -1
- package/client/dist/assets/{galleryEditor-BB-emfmi.js → galleryEditor-D951A2sE.js} +1 -1
- package/client/dist/assets/{index-B_EqHDz3.js → index-CsVy3eZm.js} +248 -248
- package/client/dist/index.html +1 -1
- package/client/src/buildCheck.ts +3 -1
- package/client/src/components/AppUpdateNotice.tsx +2 -1
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +24 -12
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +65 -15
- package/client/src/components/ClusterRightPanel/SkillsControl.tsx +107 -0
- package/client/src/components/ClusterRightPanel/index.tsx +6 -1
- package/client/src/components/ClusterTaskBoardTab.tsx +9 -22
- package/client/src/components/HeaderVersionBox.tsx +7 -4
- package/client/src/components/NeedsYouBadge.tsx +3 -3
- package/client/src/components/ProviderReleasesModal.tsx +8 -4
- package/client/src/components/ProvidersPopover.tsx +28 -23
- package/client/src/components/SettingsPanel.tsx +2 -2
- package/client/src/components/SkillsSettings.tsx +5 -0
- package/client/src/components/TabBar.tsx +91 -9
- package/client/src/components/TerminalInput.tsx +12 -10
- package/client/src/components/TranscriptSendDialog.tsx +12 -8
- package/client/src/components/TranscriptWorkerDialog.tsx +119 -0
- package/client/src/components/UpdateAction.tsx +18 -4
- package/client/src/components/UpdateResultNotice.tsx +3 -1
- package/client/src/components/clusterNeedsYou.ts +11 -18
- package/client/src/help/content/cluster.tsx +54 -22
- package/client/src/help/content/composer.tsx +22 -0
- package/client/src/help/content/header.tsx +19 -1
- 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 +19 -5
- package/client/src/help/content/tabbar.tsx +5 -0
- package/client/src/help/manualSections/actions.tsx +31 -0
- package/client/src/help/manualSections/clusters.tsx +58 -21
- package/client/src/help/manualSections/configuration.tsx +38 -4
- package/client/src/help/manualSections/maintenance.tsx +30 -0
- package/client/src/help/manualSections/plans.tsx +5 -1
- package/client/src/help/manualSections/providers.tsx +32 -8
- package/client/src/help/manualSections/troubleshooting.tsx +2 -1
- package/client/src/help/manualSections/workflows.tsx +19 -0
- package/client/src/help/manualSections/workspace.tsx +6 -0
- package/client/src/stores/appUpdateStore.ts +29 -8
- package/client/src/utils/transcriptWorkerRequest.ts +24 -0
- package/client/src/utils/wsSession.ts +2 -1
- package/client/src/ws/handleServerMessage.ts +8 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLIENT.md +9 -8
- package/docs/FEATURES.md +8 -5
- package/docs/GETTING_STARTED.md +9 -4
- package/docs/GOTCHAS.md +2 -1
- package/docs/OPERATIONS.md +37 -4
- package/docs/PERSISTENCE.md +25 -3
- package/docs/PRIMITIVES.md +42 -0
- package/docs/PROTOCOL_CLUSTER.md +51 -5
- package/docs/PROTOCOL_PRIMITIVES.md +39 -0
- package/docs/PROVIDERS.md +50 -13
- package/docs/SETTINGS.md +27 -3
- package/docs/TASK_LEDGER.md +7 -15
- package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +2 -0
- package/node_modules/@arco/shared/dist/clusterCoordination.js +5 -1
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +13 -1
- package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +4 -3
- package/node_modules/@arco/shared/dist/protocol/models.js +26 -2
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/transcriptWorker.d.ts +47 -0
- package/node_modules/@arco/shared/dist/protocol/transcriptWorker.js +2 -0
- package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +1 -0
- package/node_modules/@arco/shared/dist/runtimeVersions.js +14 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +2 -2
- package/scripts/packaging/arco.mjs +1 -1
- package/scripts/packaging/native-repair.mjs +78 -12
- package/scripts/packaging/update.mjs +5 -1
- package/server/dist/atomicFile.js +1 -2
- package/server/dist/capabilities.d.ts +5 -2
- package/server/dist/capabilities.js +59 -9
- package/server/dist/cliUpdateDecision.d.ts +1 -1
- package/server/dist/cliUpdateDecision.js +5 -3
- 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 -1
- package/server/dist/clusterPeerOps.js +10 -7
- package/server/dist/clusterProgress.js +1 -1
- package/server/dist/clusterSkills.d.ts +13 -0
- package/server/dist/clusterSkills.js +81 -0
- package/server/dist/clusterSnapshots.js +2 -0
- package/server/dist/clusterStore.d.ts +10 -2
- package/server/dist/clusterStore.js +64 -1
- package/server/dist/diagnostics/codeSkew.js +1 -0
- package/server/dist/eventLog.d.ts +7 -0
- package/server/dist/eventLog.js +70 -13
- package/server/dist/historyLimits.d.ts +1 -0
- package/server/dist/historyLimits.js +3 -0
- package/server/dist/http/router.js +1 -1
- package/server/dist/index.js +24 -1
- package/server/dist/jsonlLines.d.ts +4 -0
- package/server/dist/jsonlLines.js +53 -0
- package/server/dist/management/identity.js +1 -0
- package/server/dist/mcp/clusterMcpTools.js +4 -4
- package/server/dist/project/taskLedger.d.ts +4 -0
- package/server/dist/project/taskLedger.js +7 -4
- package/server/dist/providerConversation.d.ts +1 -0
- package/server/dist/providerConversation.js +17 -0
- package/server/dist/providers/claude-native/resumeSummary.d.ts +9 -0
- package/server/dist/providers/claude-native/resumeSummary.js +102 -49
- package/server/dist/providers/claude-native/worker.js +8 -4
- package/server/dist/providers/claude.js +2 -1
- package/server/dist/providers/clusterTaskToolDefinitions.js +4 -4
- package/server/dist/providers/codex-appserver/catalog.js +16 -1
- package/server/dist/providers/codex.js +2 -1
- package/server/dist/providers/codexCodeMode.d.ts +1 -1
- package/server/dist/providers/codexCodeMode.js +4 -3
- package/server/dist/providers/cursor/print.js +2 -1
- package/server/dist/providers/cursor/worker.js +2 -1
- package/server/dist/providers/llamacpp.js +17 -8
- package/server/dist/providers/ollamaRecovery.js +6 -6
- package/server/dist/providers/ollamaResilience.js +3 -3
- package/server/dist/providers/ollamaTokens.js +1 -1
- package/server/dist/quota.d.ts +0 -18
- package/server/dist/quota.js +0 -44
- package/server/dist/replacementHistory.d.ts +19 -0
- package/server/dist/replacementHistory.js +49 -0
- package/server/dist/server/broadcast.d.ts +2 -1
- package/server/dist/server/broadcast.js +1 -0
- package/server/dist/server/prompts.d.ts +1 -0
- package/server/dist/server/prompts.js +6 -1
- package/server/dist/sessionJsonl.d.ts +1 -1
- package/server/dist/sessionJsonl.js +115 -40
- package/server/dist/smartPickup.d.ts +2 -1
- package/server/dist/smartPickup.js +28 -1
- package/server/dist/smartPickupAdapters.js +15 -2
- package/server/dist/smartPickupLedger.js +6 -4
- package/server/dist/smartPickupObserver.d.ts +1 -0
- package/server/dist/smartPickupObserver.js +24 -15
- package/server/dist/transcriptWorker.d.ts +34 -0
- package/server/dist/transcriptWorker.js +201 -0
- package/server/dist/workflowStore.d.ts +1 -0
- package/server/dist/workflowStore.js +31 -0
- package/server/dist/ws/clusterHandlers.d.ts +2 -0
- package/server/dist/ws/clusterHandlers.js +64 -27
- package/server/dist/ws/handoffHandlers.js +5 -2
- package/server/dist/ws/transcriptWorkerHandlers.d.ts +25 -0
- package/server/dist/ws/transcriptWorkerHandlers.js +139 -0
- package/server/dist/ws/turnEngine.js +23 -9
- package/server/dist/ws/updatePrimaryConfig.js +27 -8
- package/server/dist/ws/workflowHandlers.d.ts +4 -1
- package/server/dist/ws/workflowHandlers.js +3 -1
- package/server/package.json +1 -1
- package/server/src/atomicFile.ts +1 -2
- package/server/src/capabilities.ts +58 -17
- package/server/src/cliUpdateDecision.ts +5 -4
- package/server/src/clusterAutoTurn.ts +26 -21
- package/server/src/clusterBusyReminder.ts +1 -1
- package/server/src/clusterDirector.ts +1 -1
- package/server/src/clusterPeerOps.ts +11 -8
- package/server/src/clusterProgress.ts +1 -1
- package/server/src/clusterSkills.ts +79 -0
- package/server/src/clusterSnapshots.ts +1 -0
- package/server/src/clusterStore.ts +64 -1
- package/server/src/diagnostics/codeSkew.ts +1 -0
- package/server/src/eventLog.ts +73 -13
- package/server/src/historyLimits.ts +2 -0
- package/server/src/http/router.ts +1 -1
- package/server/src/index.ts +23 -0
- package/server/src/jsonlLines.ts +52 -0
- package/server/src/management/identity.ts +1 -0
- package/server/src/mcp/clusterMcpTools.ts +4 -4
- package/server/src/project/taskLedger.ts +7 -5
- package/server/src/providerConversation.ts +15 -0
- package/server/src/providers/claude-native/resumeSummary.ts +98 -50
- package/server/src/providers/claude-native/worker.ts +8 -4
- package/server/src/providers/claude.ts +2 -1
- package/server/src/providers/clusterTaskToolDefinitions.ts +4 -4
- package/server/src/providers/codex-appserver/catalog.ts +14 -1
- package/server/src/providers/codex.ts +2 -1
- package/server/src/providers/codexCodeMode.ts +4 -4
- package/server/src/providers/cursor/print.ts +2 -1
- package/server/src/providers/cursor/worker.ts +2 -1
- package/server/src/providers/llamacpp.ts +18 -7
- package/server/src/providers/llamacppRecovery.ts +2 -0
- package/server/src/providers/ollamaRecovery.ts +6 -6
- package/server/src/providers/ollamaResilience.ts +3 -3
- package/server/src/providers/ollamaTokens.ts +1 -1
- package/server/src/providers/ollamaToolSubset.ts +3 -3
- package/server/src/quota.ts +0 -50
- package/server/src/replacementHistory.ts +44 -0
- package/server/src/server/broadcast.ts +2 -0
- package/server/src/server/prompts.ts +8 -1
- package/server/src/sessionJsonl.ts +92 -32
- package/server/src/smartPickup.ts +27 -3
- package/server/src/smartPickupAdapters.ts +17 -3
- package/server/src/smartPickupLedger.ts +6 -4
- package/server/src/smartPickupObserver.ts +20 -11
- package/server/src/transcriptWorker.ts +182 -0
- package/server/src/workflowStore.ts +21 -0
- package/server/src/ws/clusterHandlers.ts +46 -27
- package/server/src/ws/handoffHandlers.ts +5 -1
- package/server/src/ws/transcriptWorkerHandlers.ts +126 -0
- package/server/src/ws/turnEngine.ts +20 -8
- package/server/src/ws/updatePrimaryConfig.ts +25 -6
- package/server/src/ws/workflowHandlers.ts +3 -1
- package/shared/dist/clusterCoordination.d.ts +2 -0
- package/shared/dist/clusterCoordination.js +5 -1
- package/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/shared/dist/protocol/clusters.d.ts +13 -1
- package/shared/dist/protocol/index.d.ts +1 -0
- package/shared/dist/protocol/index.js +1 -0
- package/shared/dist/protocol/models.d.ts +4 -3
- package/shared/dist/protocol/models.js +26 -2
- package/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/shared/dist/protocol/tasks.d.ts +4 -0
- package/shared/dist/protocol/transcriptWorker.d.ts +47 -0
- package/shared/dist/protocol/transcriptWorker.js +2 -0
- package/shared/dist/runtimeVersions.d.ts +1 -0
- package/shared/dist/runtimeVersions.js +14 -0
- package/shared/src/clusterCoordination.ts +7 -1
- package/shared/src/protocol/autoPickup.ts +5 -0
- package/shared/src/protocol/clientMessages.ts +5 -0
- package/shared/src/protocol/clusters.ts +16 -1
- package/shared/src/protocol/index.ts +1 -0
- package/shared/src/protocol/models.ts +31 -5
- package/shared/src/protocol/serverMessages.ts +2 -0
- package/shared/src/protocol/settings.ts +2 -3
- package/shared/src/protocol/tasks.ts +4 -7
- package/shared/src/protocol/transcriptWorker.ts +49 -0
- package/shared/src/runtimeVersions.ts +14 -0
|
@@ -4,6 +4,7 @@ import remarkGfm from 'remark-gfm';
|
|
|
4
4
|
import rehypeHighlight from 'rehype-highlight';
|
|
5
5
|
import 'highlight.js/styles/atom-one-dark.css';
|
|
6
6
|
import { strataEngineReleaseVersion } from '@arco/shared';
|
|
7
|
+
import { DialogPortal, containDialogTab } from './DialogShell';
|
|
7
8
|
import { contentSurfaceSize, WorkSurfaceControls } from './workSurface/WorkSurfaceControls';
|
|
8
9
|
|
|
9
10
|
// Shared in-app release/source history for operator-managed runtimes.
|
|
@@ -49,10 +50,11 @@ export function ProviderReleasesModal({ onClose, installedVersion, runtime }: Pr
|
|
|
49
50
|
|
|
50
51
|
useEffect(() => {
|
|
51
52
|
const onKey = (e: KeyboardEvent) => {
|
|
52
|
-
if (e.key === 'Escape') onClose();
|
|
53
|
+
if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); onClose(); return; }
|
|
54
|
+
containDialogTab(e, surface.current);
|
|
53
55
|
};
|
|
54
|
-
|
|
55
|
-
return () =>
|
|
56
|
+
document.addEventListener('keydown', onKey, true);
|
|
57
|
+
return () => document.removeEventListener('keydown', onKey, true);
|
|
56
58
|
}, [onClose]);
|
|
57
59
|
|
|
58
60
|
useEffect(() => {
|
|
@@ -90,6 +92,7 @@ export function ProviderReleasesModal({ onClose, installedVersion, runtime }: Pr
|
|
|
90
92
|
}, [repo, runtime, installedVersion]);
|
|
91
93
|
|
|
92
94
|
return (
|
|
95
|
+
<DialogPortal>
|
|
93
96
|
<div
|
|
94
97
|
onClick={onClose}
|
|
95
98
|
style={{
|
|
@@ -99,7 +102,7 @@ export function ProviderReleasesModal({ onClose, installedVersion, runtime }: Pr
|
|
|
99
102
|
display: 'flex',
|
|
100
103
|
alignItems: 'center',
|
|
101
104
|
justifyContent: 'center',
|
|
102
|
-
zIndex:
|
|
105
|
+
zIndex: 9800,
|
|
103
106
|
backdropFilter: 'blur(3px)',
|
|
104
107
|
}}
|
|
105
108
|
>
|
|
@@ -248,5 +251,6 @@ export function ProviderReleasesModal({ onClose, installedVersion, runtime }: Pr
|
|
|
248
251
|
</div>
|
|
249
252
|
</div>
|
|
250
253
|
</div>
|
|
254
|
+
</DialogPortal>
|
|
251
255
|
);
|
|
252
256
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LocalRuntimeRows, enabledLocalRows } from './LocalRuntimeStatus';
|
|
2
|
-
import { compareLlamacppBuild } from '@arco/shared';
|
|
2
|
+
import { compareCursorVersions, compareLlamacppBuild } from '@arco/shared';
|
|
3
3
|
import type { Capabilities, CliUpdateOutcome } from '@arco/shared';
|
|
4
4
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
5
5
|
import { useAppStore } from '../stores/appStore';
|
|
@@ -19,8 +19,8 @@ import { setProviderPanelOpen } from './providerPanelState';
|
|
|
19
19
|
// store slices + owns the update-check + Ollama-releases-modal state that used
|
|
20
20
|
// to sit in SystemHeader.
|
|
21
21
|
|
|
22
|
-
type CliProvider = 'claude' | 'codex';
|
|
23
|
-
type VersionedProvider = CliProvider | 'ollama' | 'llamacpp' | '
|
|
22
|
+
type CliProvider = 'claude' | 'codex' | 'cursor';
|
|
23
|
+
type VersionedProvider = CliProvider | 'ollama' | 'llamacpp' | 'strata' | 'deepseek';
|
|
24
24
|
|
|
25
25
|
// Lightweight semver compare — the four upstream sources we read all emit
|
|
26
26
|
// dotted-numeric versions (npm registry + GitHub release tags after stripping
|
|
@@ -61,14 +61,19 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
61
61
|
if (onOpenChange) onOpenChange(next); else setOwnOpen(next);
|
|
62
62
|
};
|
|
63
63
|
const [releasesRuntime, setReleasesRuntime] = useState<ReleaseRuntime | null>(null);
|
|
64
|
+
const openReleases = (runtime: ReleaseRuntime) => {
|
|
65
|
+
buttonRef.current?.focus();
|
|
66
|
+
setOpen(false);
|
|
67
|
+
setReleasesRuntime(runtime);
|
|
68
|
+
};
|
|
64
69
|
const [checking, setChecking] = useState<CliProvider | null>(null);
|
|
65
|
-
const [checkResult, setCheckResult] = useState<Record<CliProvider, string | null>>({ claude: null,
|
|
70
|
+
const [checkResult, setCheckResult] = useState<Record<CliProvider, string | null>>({ claude: null, codex: null, cursor: null });
|
|
66
71
|
const [checkOutcome, setCheckOutcome] = useState<Partial<Record<CliProvider, CliUpdateOutcome>>>({});
|
|
67
72
|
// The row's result slot is a narrow right-aligned chip, so the displayed
|
|
68
73
|
// string is truncated hard. Keep the untruncated text for the tooltip —
|
|
69
74
|
// an update failure ("Missing optional dependency @openai/codex-linux-x64…")
|
|
70
75
|
// is only actionable if the operator can read the whole thing.
|
|
71
|
-
const [checkDetail, setCheckDetail] = useState<Record<CliProvider, string | null>>({ claude: null,
|
|
76
|
+
const [checkDetail, setCheckDetail] = useState<Record<CliProvider, string | null>>({ claude: null, codex: null, cursor: null });
|
|
72
77
|
const rootRef = useRef<HTMLDivElement>(null);
|
|
73
78
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
74
79
|
const panelRef = useRef<HTMLDivElement>(null);
|
|
@@ -76,10 +81,10 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
76
81
|
const wasOpen = useRef(false);
|
|
77
82
|
useEffect(() => {
|
|
78
83
|
setProviderPanelOpen(open, panelToken.current);
|
|
79
|
-
if (!open && wasOpen.current) buttonRef.current?.focus();
|
|
84
|
+
if (!open && wasOpen.current && !releasesRuntime) buttonRef.current?.focus();
|
|
80
85
|
wasOpen.current = open;
|
|
81
86
|
return () => { if (open) setProviderPanelOpen(false, panelToken.current); };
|
|
82
|
-
}, [open]);
|
|
87
|
+
}, [open, releasesRuntime]);
|
|
83
88
|
useLayoutEffect(() => {
|
|
84
89
|
if (!open) return;
|
|
85
90
|
const panel = panelRef.current;
|
|
@@ -142,7 +147,7 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
142
147
|
try {
|
|
143
148
|
const res = await fetch(`/api/check-updates?provider=${provider}`, { method: 'POST' });
|
|
144
149
|
const data = await res.json() as { outcome?: CliUpdateOutcome; currentVersion?: string; message?: string; capabilities?: Capabilities; error?: string; notice?: string };
|
|
145
|
-
const version = data.currentVersion ?? (provider === 'codex' ? capabilities?.codexVersion : capabilities?.cliVersion) ?? 'unknown';
|
|
150
|
+
const version = data.currentVersion ?? (provider === 'codex' ? capabilities?.codexVersion : provider === 'cursor' ? capabilities?.cursorVersion : capabilities?.cliVersion) ?? 'unknown';
|
|
146
151
|
let msg: string;
|
|
147
152
|
const detail = data.error ?? data.message ?? data.notice ?? 'The version did not change. Arco could not check whether it is up to date.';
|
|
148
153
|
// A notice means the server did something the version string alone doesn't
|
|
@@ -192,8 +197,8 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
192
197
|
// GitHub releases since the upstream is operator-built (no self-update path).
|
|
193
198
|
{ provider: 'llamacpp' as VersionedProvider, label: 'LLAMA', version: llamacppLive?.version ?? 'unknown' },
|
|
194
199
|
// Cursor: date-versioned `cursor-agent` (self-updating, curl-installed — no
|
|
195
|
-
// npm registry latest to compare against)
|
|
196
|
-
//
|
|
200
|
+
// npm registry latest to compare against). Its public installer supplies
|
|
201
|
+
// latest metadata; a row click runs its updater and the changelog stays separate.
|
|
197
202
|
{ provider: 'cursor' as VersionedProvider, label: 'CURSOR', version: capabilities?.cursorVersion ?? 'unknown' },
|
|
198
203
|
] as const)
|
|
199
204
|
.filter(({ provider, version }) => {
|
|
@@ -210,14 +215,14 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
210
215
|
})
|
|
211
216
|
.map((r) => {
|
|
212
217
|
const broken = r.version === 'broken';
|
|
213
|
-
// Cursor
|
|
214
|
-
//
|
|
218
|
+
// Cursor's public installer supplies its dated latest build without
|
|
219
|
+
// an npm lookup. A broken
|
|
215
220
|
// CLI has no parseable version either, so skip the compare rather than let
|
|
216
221
|
// compareSemver read 'broken' as 0.0.0 and call it outdated.
|
|
217
|
-
const latest =
|
|
222
|
+
const latest = broken ? undefined : r.provider === 'deepseek' ? capabilities?.latestVersions?.xolotl : capabilities?.latestVersions?.[r.provider];
|
|
218
223
|
const outdated = r.provider === 'codex' && capabilities?.codexUpdate
|
|
219
224
|
? capabilities.codexUpdate.updateAvailable
|
|
220
|
-
: !!latest && (r.provider === 'deepseek' ? r.version !== latest : r.provider === 'llamacpp' ? (compareLlamacppBuild(r.version, latest) ?? 0) < 0 : compareSemver(r.version, latest) < 0);
|
|
225
|
+
: !!latest && (r.provider === 'deepseek' ? r.version !== latest : r.provider === 'llamacpp' ? (compareLlamacppBuild(r.version, latest) ?? 0) < 0 : r.provider === 'cursor' ? (compareCursorVersions(r.version, latest) ?? 0) < 0 : compareSemver(r.version, latest) < 0);
|
|
221
226
|
return { ...r, latest, outdated, broken };
|
|
222
227
|
});
|
|
223
228
|
|
|
@@ -298,7 +303,7 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
298
303
|
const isDeepSeek = provider === 'deepseek';
|
|
299
304
|
const isLlamacpp = provider === 'llamacpp';
|
|
300
305
|
const isCursor = provider === 'cursor';
|
|
301
|
-
const isCli = !isOllama && !isLlamacpp && !
|
|
306
|
+
const isCli = !isOllama && !isLlamacpp && !isStrata && !isDeepSeek;
|
|
302
307
|
const busy = isCli && checking === (provider as CliProvider);
|
|
303
308
|
const result = isCli ? checkResult[provider as CliProvider] : null;
|
|
304
309
|
const detail = isCli ? checkDetail[provider as CliProvider] : null;
|
|
@@ -322,21 +327,19 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
322
327
|
? `llama.cpp ${version} · model "${llamacppLoadedAlias}" loaded (click to view upstream releases)`
|
|
323
328
|
: `llama.cpp ${version} · no model loaded (click to view upstream releases)`
|
|
324
329
|
: isCursor
|
|
325
|
-
? `cursor-agent ${version}
|
|
330
|
+
? `cursor-agent ${version}${outdated ? ` → ${latest} available` : ''} (click to run cursor-agent update)`
|
|
326
331
|
: outdated
|
|
327
332
|
? `${label} CLI outdated: v${version} → v${latest} (click to install)`
|
|
328
333
|
: `${label} CLI v${version} (click to check for updates)`;
|
|
329
334
|
const onClick = isDeepSeek
|
|
330
|
-
? () =>
|
|
335
|
+
? () => openReleases('xolotl')
|
|
331
336
|
: isStrata
|
|
332
|
-
? () =>
|
|
337
|
+
? () => openReleases('strata')
|
|
333
338
|
: isOllama
|
|
334
|
-
? () =>
|
|
339
|
+
? () => openReleases('ollama')
|
|
335
340
|
: isLlamacpp
|
|
336
341
|
? () => window.open('https://github.com/ggml-org/llama.cpp/releases', '_blank', 'noopener')
|
|
337
|
-
:
|
|
338
|
-
? () => window.open('https://cursor.com/changelog', '_blank', 'noopener')
|
|
339
|
-
: () => checkForUpdates(provider as CliProvider);
|
|
342
|
+
: () => checkForUpdates(provider as CliProvider);
|
|
340
343
|
const versionDisplay = busy ? '…'
|
|
341
344
|
: result ? result
|
|
342
345
|
: isDeepSeek ? version.slice(0, 12)
|
|
@@ -344,12 +347,13 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
344
347
|
: (isLlamacpp && llamacppLoadedAlias) ? `v${version} · ${llamacppLoadedAlias}`
|
|
345
348
|
: `v${version}`;
|
|
346
349
|
return (
|
|
347
|
-
<span key={provider} data-help={isDeepSeek ? 'header.xolotl-version' : isStrata ? 'header.strata-version' : 'header.cli-versions'} style={{ display: 'flex' }}>
|
|
350
|
+
<span key={provider} data-help={isDeepSeek ? 'header.xolotl-version' : isStrata ? 'header.strata-version' : 'header.cli-versions'} style={{ display: 'flex', flexDirection: isCursor ? 'column' : undefined }}>
|
|
348
351
|
<button
|
|
349
352
|
onClick={onClick}
|
|
350
353
|
disabled={busy}
|
|
351
354
|
className="display-font"
|
|
352
355
|
title={detail ?? baseTitle}
|
|
356
|
+
aria-label={detail ?? baseTitle}
|
|
353
357
|
style={{
|
|
354
358
|
display: 'flex',
|
|
355
359
|
width: '100%',
|
|
@@ -370,6 +374,7 @@ export function ProvidersPopover({ open: controlledOpen, onOpenChange }: { open?
|
|
|
370
374
|
<span style={{ fontSize: '9px', letterSpacing: '1.5px', color: 'var(--color-fg-muted)', whiteSpace: 'nowrap' }}>{label}</span>
|
|
371
375
|
<span style={{ fontSize: '10px', color: versionColor }}>{versionDisplay}</span>
|
|
372
376
|
</button>
|
|
377
|
+
{isCursor && <a href="https://cursor.com/docs/cli/changelog" target="_blank" rel="noopener noreferrer" aria-label="Cursor CLI changelog" data-help="header.cursor-changelog" style={{ alignSelf: 'flex-end', padding: '4px', fontSize: '9px', lineHeight: 1.4 }}>CURSOR CHANGELOG ↗</a>}
|
|
373
378
|
</span>
|
|
374
379
|
);
|
|
375
380
|
})}
|
|
@@ -1667,7 +1667,7 @@ function AutoHandoffDefaultsSection() {
|
|
|
1667
1667
|
function BoardAutoDoneSection() {
|
|
1668
1668
|
const settings = useAppStore((s) => s.settings);
|
|
1669
1669
|
const setSettings = useAppStore((s) => s.setSettings);
|
|
1670
|
-
const enabled = settings?.autoMarkDoneOnMetSignoff
|
|
1670
|
+
const enabled = settings?.autoMarkDoneOnMetSignoff !== false;
|
|
1671
1671
|
const [saving, setSaving] = useState(false);
|
|
1672
1672
|
|
|
1673
1673
|
const commit = async (next: boolean) => {
|
|
@@ -1700,7 +1700,7 @@ function BoardAutoDoneSection() {
|
|
|
1700
1700
|
Mark done automatically when the director signs off as met
|
|
1701
1701
|
</label>
|
|
1702
1702
|
<div style={{ fontSize: '10px', color: 'var(--color-fg-muted)', fontFamily: 'var(--font-body)', lineHeight: 1.5, margin: '6px 0 14px' }}>
|
|
1703
|
-
|
|
1703
|
+
On by default. A new director met sign-off marks the task done on the server; partial and not-met sign-offs do not change the task status. Turn this off to accept finished tasks yourself.
|
|
1704
1704
|
</div>
|
|
1705
1705
|
</div>
|
|
1706
1706
|
);
|
|
@@ -3,6 +3,7 @@ import { createTwoFilesPatch } from 'diff';
|
|
|
3
3
|
import { DialogShell } from './DialogShell';
|
|
4
4
|
import { DirectoryBrowser } from './media/DirectoryPicker';
|
|
5
5
|
import { SkillEditorDialog, type SkillEditorTarget } from './SkillEditorDialog';
|
|
6
|
+
import { PinSkillDialog } from './ClusterRightPanel/SkillsControl';
|
|
6
7
|
|
|
7
8
|
// Settings > SKILLS (P8.6): list, create, edit and delete skills, plus IMPORT
|
|
8
9
|
// (GitHub link, folder, zip), UPDATE with a per-file diff, ON/OFF, MOVE between
|
|
@@ -63,6 +64,7 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
63
64
|
const [importing, setImporting] = useState(false);
|
|
64
65
|
const [updating, setUpdating] = useState<SkillSummary | null>(null);
|
|
65
66
|
const [sharing, setSharing] = useState<SkillSummary | null>(null);
|
|
67
|
+
const [pinning, setPinning] = useState<{ skill: SkillSummary; kind: 'tab' | 'cluster' } | null>(null);
|
|
66
68
|
|
|
67
69
|
const refresh = async () => {
|
|
68
70
|
setError(null);
|
|
@@ -118,6 +120,8 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
118
120
|
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap' }}>
|
|
119
121
|
<button type="button" style={small} onClick={() => setEditor({ scope: s.scope, slug: s.slug })}>EDIT</button>
|
|
120
122
|
<button type="button" style={small} data-help="settings.skills.toggle" onClick={() => void toggle(s)}>{s.off ? 'TURN ON' : 'TURN OFF'}</button>
|
|
123
|
+
<button type="button" style={small} data-help="settings.skills.pin-tab" disabled={s.off} onClick={() => setPinning({ skill: s, kind: 'tab' })}>PIN TO TAB</button>
|
|
124
|
+
<button type="button" style={small} data-help="settings.skills.pin-cluster" disabled={s.off} onClick={() => setPinning({ skill: s, kind: 'cluster' })}>PIN TO CLUSTER</button>
|
|
121
125
|
{(s.scope === 'global' || cwd) && <button type="button" style={small} data-help="settings.skills.move" disabled={s.scope === 'global' && !cwd} onClick={() => move(s)}>{s.scope === 'project' ? 'MOVE TO GLOBAL' : 'MOVE TO PROJECT'}</button>}
|
|
122
126
|
<button type="button" style={small} data-help="settings.skills.duplicate" onClick={() => duplicate(s)}>DUPLICATE</button>
|
|
123
127
|
{(s.source?.kind === 'github' || s.source?.kind === 'folder') && <button type="button" style={small} data-help="settings.skills.update" onClick={() => setUpdating(s)}>UPDATE</button>}
|
|
@@ -130,6 +134,7 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
130
134
|
|
|
131
135
|
return (
|
|
132
136
|
<div data-help="settings.skills">
|
|
137
|
+
{pinning && <PinSkillDialog skill={pinning.skill} kind={pinning.kind} cwd={cwd} onClose={() => setPinning(null)} />}
|
|
133
138
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px', gap: '6px' }}>
|
|
134
139
|
<span className="display-font" style={{ fontSize: '11px', letterSpacing: '2px', color: 'var(--color-accent-primary-dim)' }}>SKILLS</span>
|
|
135
140
|
<span style={{ display: 'flex', gap: '6px' }}>
|
|
@@ -3,7 +3,7 @@ import { hasWaitingQuestion } from '../questions/waitingQuestion';
|
|
|
3
3
|
import { TabStatusChip, useTabStatus } from './TabStatusChip';
|
|
4
4
|
import { clusterHasIdleMail, tabStatusPresentation } from '../utils/tabStatus';
|
|
5
5
|
import { layoutPoint } from '../utils/pointer';
|
|
6
|
-
import { useMemo, useRef, useState } from 'react';
|
|
6
|
+
import { useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
7
7
|
import {
|
|
8
8
|
DndContext,
|
|
9
9
|
PointerSensor,
|
|
@@ -125,6 +125,90 @@ function applyTabOrder<T extends { id: string }>(items: T[], order: string[] | u
|
|
|
125
125
|
return [...known, ...unknown];
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
// Keep scrolling local to the strip: scrollIntoView can also move the page.
|
|
129
|
+
function TabScrollRow({ activeKey, children }: { activeKey: string; children: ReactNode }) {
|
|
130
|
+
const row = useRef<HTMLDivElement>(null);
|
|
131
|
+
const content = useRef<HTMLDivElement>(null);
|
|
132
|
+
const [edges, setEdges] = useState({ before: false, after: false });
|
|
133
|
+
|
|
134
|
+
useLayoutEffect(() => {
|
|
135
|
+
const el = row.current;
|
|
136
|
+
const inner = content.current;
|
|
137
|
+
if (!el || !inner) return;
|
|
138
|
+
const measure = () => setEdges((previous) => {
|
|
139
|
+
const before = el.scrollLeft > 1;
|
|
140
|
+
const after = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;
|
|
141
|
+
return previous.before === before && previous.after === after ? previous : { before, after };
|
|
142
|
+
});
|
|
143
|
+
const reveal = (target: Element | null) => {
|
|
144
|
+
if (!target) return;
|
|
145
|
+
const bounds = el.getBoundingClientRect();
|
|
146
|
+
const tab = target.getBoundingClientRect();
|
|
147
|
+
const scale = bounds.width / el.clientWidth || 1;
|
|
148
|
+
const left = (tab.left - bounds.left) / scale;
|
|
149
|
+
const right = (tab.right - bounds.left) / scale;
|
|
150
|
+
if (left < 32) el.scrollLeft += left - 32;
|
|
151
|
+
else if (right > el.clientWidth - 32) el.scrollLeft += Math.min(left - 32, right - el.clientWidth + 32);
|
|
152
|
+
measure();
|
|
153
|
+
};
|
|
154
|
+
let width = el.clientWidth;
|
|
155
|
+
const resize = new ResizeObserver(() => {
|
|
156
|
+
if (width !== el.clientWidth) {
|
|
157
|
+
width = el.clientWidth;
|
|
158
|
+
reveal(inner.querySelector('[data-active-tab="true"]'));
|
|
159
|
+
}
|
|
160
|
+
measure();
|
|
161
|
+
});
|
|
162
|
+
resize.observe(el);
|
|
163
|
+
resize.observe(inner);
|
|
164
|
+
const wheel = (event: WheelEvent) => {
|
|
165
|
+
// Preserve native horizontal gestures and browser zoom.
|
|
166
|
+
if (event.ctrlKey || event.deltaX !== 0 || event.deltaY === 0) return;
|
|
167
|
+
const unit = event.deltaMode === 1 ? 16 : event.deltaMode === 2 ? el.clientWidth : 1;
|
|
168
|
+
const previous = el.scrollLeft;
|
|
169
|
+
el.scrollLeft += event.deltaY * unit;
|
|
170
|
+
if (el.scrollLeft !== previous) event.preventDefault();
|
|
171
|
+
};
|
|
172
|
+
const focus = (event: FocusEvent) => {
|
|
173
|
+
const target = event.target;
|
|
174
|
+
// Pointer focus must not move the control between pointerdown and click.
|
|
175
|
+
if (target instanceof Element && target.matches(':focus-visible')) reveal(target);
|
|
176
|
+
};
|
|
177
|
+
el.addEventListener('wheel', wheel, { passive: false });
|
|
178
|
+
el.addEventListener('scroll', measure);
|
|
179
|
+
el.addEventListener('focusin', focus);
|
|
180
|
+
reveal(inner.querySelector('[data-active-tab="true"]'));
|
|
181
|
+
measure();
|
|
182
|
+
return () => {
|
|
183
|
+
resize.disconnect();
|
|
184
|
+
el.removeEventListener('wheel', wheel);
|
|
185
|
+
el.removeEventListener('scroll', measure);
|
|
186
|
+
el.removeEventListener('focusin', focus);
|
|
187
|
+
};
|
|
188
|
+
}, [activeKey]);
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<div style={{ position: 'relative', minWidth: 0 }}>
|
|
192
|
+
<div ref={row} aria-label="Open tabs" style={{ overflowX: 'auto', overscrollBehaviorX: 'contain' }}>
|
|
193
|
+
<div ref={content} style={{ display: 'flex', alignItems: 'stretch', width: 'max-content', minWidth: '100%' }}>
|
|
194
|
+
{children}
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
{([-1, 1] as const).map((direction) => (
|
|
198
|
+
<button key={direction} type="button" aria-label={direction < 0 ? 'Previous tabs' : 'Next tabs'}
|
|
199
|
+
title={direction < 0 ? 'More tabs to the left' : 'More tabs to the right'} data-help="tabbar.scroll"
|
|
200
|
+
hidden={direction < 0 ? !edges.before : !edges.after}
|
|
201
|
+
onClick={() => { const el = row.current; if (el) el.scrollLeft += direction * Math.max(32, el.clientWidth * 0.7); }}
|
|
202
|
+
style={{ position: 'absolute', top: 0, bottom: 0, [direction < 0 ? 'left' : 'right']: 0,
|
|
203
|
+
width: 32, padding: 0, background: 'var(--color-bg-panel)', color: 'var(--color-accent-primary)',
|
|
204
|
+
border: '1px solid var(--color-border)', cursor: 'pointer', fontSize: 20 }}>
|
|
205
|
+
{direction < 0 ? '<' : '>'}
|
|
206
|
+
</button>
|
|
207
|
+
))}
|
|
208
|
+
</div>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
128
212
|
export function TabBar({ onRemoveWorkflow, requestRecallSummary, onCreateCluster, onDeleteCluster, onAddClusterMember, onCreateClusterWithFreshWorkers }: Props) {
|
|
129
213
|
const jobs = useAppStore((s) => s.jobs);
|
|
130
214
|
const activeJobId = useAppStore((s) => s.activeJobId);
|
|
@@ -224,6 +308,7 @@ export function TabBar({ onRemoveWorkflow, requestRecallSummary, onCreateCluster
|
|
|
224
308
|
aria-current={showHome ? 'page' : undefined}
|
|
225
309
|
aria-label="Home: projects, open work and saved sessions"
|
|
226
310
|
data-help="tabbar.home"
|
|
311
|
+
data-active-tab={showHome}
|
|
227
312
|
className="display-font"
|
|
228
313
|
style={{
|
|
229
314
|
padding: '8px 14px',
|
|
@@ -261,13 +346,7 @@ export function TabBar({ onRemoveWorkflow, requestRecallSummary, onCreateCluster
|
|
|
261
346
|
}}
|
|
262
347
|
>
|
|
263
348
|
{/* Top row — clusters + standalone workflow tabs, drag-reorderable */}
|
|
264
|
-
<
|
|
265
|
-
style={{
|
|
266
|
-
display: 'flex',
|
|
267
|
-
alignItems: 'stretch',
|
|
268
|
-
overflowX: 'auto',
|
|
269
|
-
}}
|
|
270
|
-
>
|
|
349
|
+
<TabScrollRow activeKey={showHome ? 'home' : showCreator ? 'new' : activeClusterId ?? activeJobId ?? ''}>
|
|
271
350
|
{homeButton}
|
|
272
351
|
<DndContext sensors={sensors} onDragEnd={onDragEnd}>
|
|
273
352
|
<SortableContext items={topRowItems.map((it) => it.id)} strategy={horizontalListSortingStrategy}>
|
|
@@ -309,6 +388,7 @@ export function TabBar({ onRemoveWorkflow, requestRecallSummary, onCreateCluster
|
|
|
309
388
|
<button
|
|
310
389
|
onClick={showJobCreator}
|
|
311
390
|
data-help="tabbar.new"
|
|
391
|
+
data-active-tab={showCreator && !showHome}
|
|
312
392
|
className="display-font"
|
|
313
393
|
style={{
|
|
314
394
|
padding: '8px 14px',
|
|
@@ -324,7 +404,7 @@ export function TabBar({ onRemoveWorkflow, requestRecallSummary, onCreateCluster
|
|
|
324
404
|
>
|
|
325
405
|
+ NEW
|
|
326
406
|
</button>
|
|
327
|
-
</
|
|
407
|
+
</TabScrollRow>
|
|
328
408
|
|
|
329
409
|
{/* the per-member bottom row was removed: the cluster's
|
|
330
410
|
left-pane member cards already focus a member, the account badge
|
|
@@ -511,6 +591,7 @@ function SortableWorkflowTab({ job, isActive, onActivate, onClose, onContextMenu
|
|
|
511
591
|
<div
|
|
512
592
|
ref={setNodeRef}
|
|
513
593
|
data-help="tabbar.tab"
|
|
594
|
+
data-active-tab={isActive}
|
|
514
595
|
onContextMenu={onContextMenu}
|
|
515
596
|
{...attributes}
|
|
516
597
|
{...listeners}
|
|
@@ -597,6 +678,7 @@ function SortableClusterTab({ cluster, isActive, onActivate, onClose }: ClusterT
|
|
|
597
678
|
<div
|
|
598
679
|
ref={setNodeRef}
|
|
599
680
|
data-help="tabbar.cluster"
|
|
681
|
+
data-active-tab={isActive}
|
|
600
682
|
{...attributes}
|
|
601
683
|
{...listeners}
|
|
602
684
|
style={{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { effectiveCodexTransport } from '@arco/shared';
|
|
2
2
|
import { TurnTimer } from './TurnTimer';
|
|
3
|
+
import { SkillsControl } from './ClusterRightPanel/SkillsControl';
|
|
3
4
|
import { BriefControl } from './BriefControl';
|
|
4
5
|
import { ClusterComposerButtons, type ClusterComposerControls } from './ClusterComposerButtons';
|
|
5
6
|
import type { SpawnMemberIdentity } from '@arco/shared';
|
|
@@ -457,9 +458,9 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
457
458
|
const [showResearchDialog, setShowResearchDialog] = useState(false);
|
|
458
459
|
const [showTranscriptDialog, setShowTranscriptDialog] = useState(false);
|
|
459
460
|
const [showForwardDialog, setShowForwardDialog] = useState(false);
|
|
460
|
-
// Cluster lookup for
|
|
461
|
-
//
|
|
462
|
-
//
|
|
461
|
+
// Cluster lookup for existing-member transcript and forward destinations.
|
|
462
|
+
// Standalone tabs still offer TRANSCRIPT for a new worker; membership
|
|
463
|
+
// controls whether the existing peer-delivery destination is available.
|
|
463
464
|
const clusterForJob = useAppStore((s) => {
|
|
464
465
|
for (const c of Object.values(s.clusters)) {
|
|
465
466
|
if (c.members.some((m) => m.workflowId === job.id)) return c;
|
|
@@ -841,6 +842,7 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
841
842
|
</span>
|
|
842
843
|
)}
|
|
843
844
|
{onCancelQueued && <QueuedMessagesIndicator job={job} onCancel={onCancelQueued} />}
|
|
845
|
+
{clusterForJob && <SkillsControl cluster={clusterForJob} memberId={job.id} />}
|
|
844
846
|
{/* Standing pins persist in WorkflowConfig/meta.json and are re-injected
|
|
845
847
|
every turn. They remain visible until explicitly removed. */}
|
|
846
848
|
{pinnedSkills.length > 0 && (
|
|
@@ -1443,12 +1445,12 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
1443
1445
|
</button>
|
|
1444
1446
|
)}
|
|
1445
1447
|
|
|
1446
|
-
{
|
|
1448
|
+
{job.config.kind !== 'chat' && job.config.kind !== 'cluster' && (
|
|
1447
1449
|
<button
|
|
1448
1450
|
onClick={() => setShowTranscriptDialog(true)}
|
|
1449
|
-
data-help="
|
|
1451
|
+
data-help="composer.transcript-worker"
|
|
1450
1452
|
className="display-font"
|
|
1451
|
-
title="Send a
|
|
1453
|
+
title="Send a transcript to a cluster member, or copy exact turns to a new worker in another folder"
|
|
1452
1454
|
style={{
|
|
1453
1455
|
padding: '3px 8px',
|
|
1454
1456
|
background: 'transparent',
|
|
@@ -1982,15 +1984,15 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
1982
1984
|
/>
|
|
1983
1985
|
)}
|
|
1984
1986
|
|
|
1985
|
-
{showTranscriptDialog &&
|
|
1987
|
+
{showTranscriptDialog && (
|
|
1986
1988
|
<TranscriptSendDialog
|
|
1987
|
-
cluster={clusterForJob}
|
|
1989
|
+
cluster={clusterForJob ?? undefined}
|
|
1988
1990
|
fromWorkflowId={job.id}
|
|
1989
1991
|
messages={job.messages}
|
|
1990
|
-
onConfirm={(recipients, content) => {
|
|
1992
|
+
onConfirm={onTranscriptSend ? (recipients, content) => {
|
|
1991
1993
|
setShowTranscriptDialog(false);
|
|
1992
1994
|
for (const to of recipients) onTranscriptSend(to, content);
|
|
1993
|
-
}}
|
|
1995
|
+
} : undefined}
|
|
1994
1996
|
onCancel={() => setShowTranscriptDialog(false)}
|
|
1995
1997
|
/>
|
|
1996
1998
|
)}
|
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
// budget + dedupe gates and raises the content cap to 32 KB.
|
|
6
6
|
|
|
7
7
|
import { DialogShell } from './DialogShell';
|
|
8
|
+
import { TranscriptWorkerDialog } from './TranscriptWorkerDialog';
|
|
8
9
|
import { useMemo, useState } from 'react';
|
|
9
10
|
import type { ChatMessage, ClusterStatePayload } from '@arco/shared';
|
|
10
11
|
import { DEFAULT_TRANSCRIPT_INCLUDE, formatRow, turnBoundaries, type TranscriptInclude } from '../utils/transcriptFormat';
|
|
11
12
|
|
|
12
13
|
interface Props {
|
|
13
|
-
cluster
|
|
14
|
+
cluster?: ClusterStatePayload;
|
|
14
15
|
fromWorkflowId: string;
|
|
15
16
|
messages: ChatMessage[];
|
|
16
17
|
/** One delivery per recipient, all with the same text. */
|
|
17
|
-
onConfirm
|
|
18
|
+
onConfirm?: (toWorkflowIds: string[], content: string) => void;
|
|
18
19
|
onCancel: () => void;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -23,7 +24,8 @@ type Scope = 'full' | 'last-turn' | 'last-n';
|
|
|
23
24
|
const MAX_BYTES = 32 * 1024;
|
|
24
25
|
|
|
25
26
|
export function TranscriptSendDialog({ cluster, fromWorkflowId, messages, onConfirm, onCancel }: Props) {
|
|
26
|
-
const peers = cluster
|
|
27
|
+
const peers = cluster?.members.filter((m) => m.workflowId !== fromWorkflowId) ?? [];
|
|
28
|
+
const [destination, setDestination] = useState<'members' | 'worker'>(peers.length && onConfirm ? 'members' : 'worker');
|
|
27
29
|
const [toWfids, setToWfids] = useState<string[]>(peers.length === 1 ? [peers[0].workflowId] : []);
|
|
28
30
|
const [note, setNote] = useState('');
|
|
29
31
|
const [include, setInclude] = useState<TranscriptInclude>(DEFAULT_TRANSCRIPT_INCLUDE);
|
|
@@ -31,9 +33,9 @@ export function TranscriptSendDialog({ cluster, fromWorkflowId, messages, onConf
|
|
|
31
33
|
const [nTurns, setNTurns] = useState(3);
|
|
32
34
|
|
|
33
35
|
const senderName = useMemo(() => {
|
|
34
|
-
const m = cluster
|
|
36
|
+
const m = cluster?.members.find((mm) => mm.workflowId === fromWorkflowId);
|
|
35
37
|
return m?.displayName ?? fromWorkflowId.slice(0, 8);
|
|
36
|
-
}, [cluster
|
|
38
|
+
}, [cluster?.members, fromWorkflowId]);
|
|
37
39
|
|
|
38
40
|
const content = useMemo(() => {
|
|
39
41
|
const boundaries = turnBoundaries(messages);
|
|
@@ -57,16 +59,18 @@ export function TranscriptSendDialog({ cluster, fromWorkflowId, messages, onConf
|
|
|
57
59
|
|
|
58
60
|
const byteLen = new TextEncoder().encode(content).length;
|
|
59
61
|
const overLimit = byteLen > MAX_BYTES;
|
|
60
|
-
const canSend = toWfids.length > 0 && content.trim().length > 0 && !overLimit;
|
|
62
|
+
const canSend = !!onConfirm && toWfids.length > 0 && content.trim().length > 0 && !overLimit;
|
|
63
|
+
if (destination === 'worker') return <TranscriptWorkerDialog workflowId={fromWorkflowId} onCancel={onCancel} onMembers={peers.length && onConfirm ? () => setDestination('members') : undefined} />;
|
|
61
64
|
|
|
62
65
|
const handleSend = () => {
|
|
63
66
|
if (!canSend) return;
|
|
64
|
-
onConfirm(toWfids, content);
|
|
67
|
+
onConfirm?.(toWfids, content);
|
|
65
68
|
};
|
|
66
69
|
|
|
67
70
|
return (
|
|
68
|
-
<DialogShell title={`Send transcript - from ${senderName}`} ariaLabel="Send transcript" onClose={onCancel} closeOnBackdrop width={720} zIndex={50}
|
|
71
|
+
<DialogShell title={`Send transcript - from ${senderName}`} ariaLabel="Send transcript" dataHelp="cluster.transcript-send" onClose={onCancel} closeOnBackdrop width={720} zIndex={50}
|
|
69
72
|
actions={<>
|
|
73
|
+
<button type="button" data-help="composer.transcript-worker" onClick={() => setDestination('worker')} className="display-font">NEW WORKER</button>
|
|
70
74
|
<button type="button" onClick={onCancel} className="display-font" style={{ background: 'transparent', border: '1px solid var(--color-border-hairline)', color: 'var(--color-fg-muted)', padding: '5px 12px', cursor: 'pointer', fontSize: '10px', letterSpacing: '1px' }}>CANCEL</button>
|
|
71
75
|
<button
|
|
72
76
|
type="button"
|