arco-workbench 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +63 -12
- package/README.md +21 -17
- package/client/dist/assets/{PhosphorBackdrop-DVQdBrTw.js → PhosphorBackdrop-DRu16-Is.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-BfSs2tB4.js → ThemedBackgroundShaderImpl-BLdwwQ4D.js} +1 -1
- package/client/dist/assets/{XtermView-DaMjC8Ny.js → XtermView-Xk7_9JaH.js} +1 -1
- package/client/dist/assets/{galleryEditor-BCQnXj7R.js → galleryEditor-CI8ClzBa.js} +1 -1
- package/client/dist/assets/{index-DD9kFGsF.css → index-BEFgrUJJ.css} +1 -1
- package/client/dist/assets/{index-COfbHCYv.js → index-C7WzZfsr.js} +257 -255
- package/client/dist/index.html +2 -2
- package/client/src/App.tsx +2 -0
- package/client/src/components/ChatMessage.tsx +33 -8
- package/client/src/components/ChatModeView.tsx +2 -0
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +65 -15
- package/client/src/components/ClusterRightPanel/SkillsControl.tsx +124 -0
- package/client/src/components/ClusterRightPanel/index.tsx +4 -0
- package/client/src/components/ClusterTaskBoardTab.tsx +9 -22
- package/client/src/components/CodexLateCommand.tsx +34 -0
- package/client/src/components/DialogShell.tsx +2 -0
- package/client/src/components/MemberCard.tsx +4 -1
- package/client/src/components/MemberPane.tsx +3 -1
- package/client/src/components/NeedsYouBadge.tsx +3 -3
- package/client/src/components/PhoneUpload.tsx +288 -0
- package/client/src/components/PrimaryStatus.tsx +14 -6
- package/client/src/components/ProviderReleasesModal.tsx +8 -4
- package/client/src/components/ProvidersPopover.tsx +28 -23
- package/client/src/components/RuntimeStateBanner.tsx +5 -0
- package/client/src/components/SettingsPanel.tsx +2 -2
- package/client/src/components/SkillEditorDialog.tsx +2 -2
- package/client/src/components/SkillsSettings.tsx +21 -4
- package/client/src/components/TabBar.tsx +91 -9
- package/client/src/components/TerminalInput.tsx +15 -11
- package/client/src/components/TranscriptSendDialog.tsx +12 -8
- package/client/src/components/TranscriptWorkerDialog.tsx +119 -0
- package/client/src/components/WorkflowView.tsx +2 -0
- package/client/src/components/clusterNeedsYou.ts +11 -18
- package/client/src/explorer/ArtifactsLens.tsx +37 -28
- package/client/src/explorer/ExplorerApp.tsx +5 -4
- package/client/src/explorer/types.ts +8 -3
- package/client/src/help/content/cluster.tsx +48 -17
- package/client/src/help/content/composer.tsx +40 -1
- package/client/src/help/content/header.tsx +18 -1
- package/client/src/help/content/misc.tsx +9 -1
- package/client/src/help/content/settings.tsx +18 -4
- 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 +44 -20
- package/client/src/help/manualSections/configuration.tsx +20 -0
- package/client/src/help/manualSections/gettingStarted.tsx +4 -4
- package/client/src/help/manualSections/maintenance.tsx +25 -6
- package/client/src/help/manualSections/powerFeatures.tsx +3 -2
- 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 +12 -0
- package/client/src/help/manualSections/workspace.tsx +36 -0
- package/client/src/stores/appStore.ts +7 -0
- package/client/src/stores/appStore.types.ts +4 -0
- package/client/src/styles/global.css +109 -0
- package/client/src/utils/phoneTheme.ts +38 -0
- package/client/src/utils/phoneUploadApi.ts +10 -0
- package/client/src/utils/transcriptWorkerRequest.ts +24 -0
- package/client/src/ws/handleServerMessage.ts +31 -8
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLIENT.md +16 -9
- package/docs/FEATURES.md +13 -7
- package/docs/GETTING_STARTED.md +12 -6
- package/docs/GOTCHAS.md +2 -1
- package/docs/INDEX.md +1 -1
- package/docs/OPERATIONS.md +213 -52
- package/docs/PERSISTENCE.md +7 -2
- package/docs/PRIMITIVES.md +42 -0
- package/docs/PROTOCOL_CLUSTER.md +51 -4
- package/docs/PROTOCOL_PRIMITIVES.md +39 -0
- package/docs/PROVIDERS.md +84 -13
- package/docs/SETTINGS.md +29 -3
- package/docs/TASK_LEDGER.md +7 -15
- package/native/linux-x64/manifest.json +1 -1
- package/native/win32-x64/manifest.json +1 -1
- 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/chat.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +15 -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 +13 -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/protocol/workflows.d.ts +1 -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 +32 -4
- 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/clusterDirector.js +2 -1
- package/server/dist/clusterPeerOps.js +14 -8
- package/server/dist/clusterProgress.js +1 -1
- package/server/dist/clusterRehydrate.js +2 -0
- 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 +7 -2
- package/server/dist/clusterStore.js +42 -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/explorerDocs.d.ts +10 -6
- package/server/dist/explorerDocs.js +75 -34
- package/server/dist/historyLimits.d.ts +1 -0
- package/server/dist/historyLimits.js +3 -0
- package/server/dist/http/attachmentUpload.d.ts +13 -0
- package/server/dist/http/attachmentUpload.js +38 -0
- package/server/dist/http/browserWorktrees.d.ts +23 -0
- package/server/dist/http/browserWorktrees.js +120 -0
- package/server/dist/http/phoneUploadDrafts.d.ts +13 -0
- package/server/dist/http/phoneUploadDrafts.js +125 -0
- package/server/dist/http/phoneUploadListener.d.ts +17 -0
- package/server/dist/http/phoneUploadListener.js +81 -0
- package/server/dist/http/phoneUploadNetwork.d.ts +9 -0
- package/server/dist/http/phoneUploadNetwork.js +106 -0
- package/server/dist/http/phoneUploadPage.d.ts +2 -0
- package/server/dist/http/phoneUploadPage.js +136 -0
- package/server/dist/http/phoneUploadRouteHistory.d.ts +4 -0
- package/server/dist/http/phoneUploadRouteHistory.js +72 -0
- package/server/dist/http/phoneUploadRoutes.d.ts +4 -0
- package/server/dist/http/phoneUploadRoutes.js +419 -0
- package/server/dist/http/phoneUploadTheme.d.ts +17 -0
- package/server/dist/http/phoneUploadTheme.js +96 -0
- package/server/dist/http/projectBinding.d.ts +1 -0
- package/server/dist/http/projectBinding.js +3 -2
- package/server/dist/http/readConfinement.js +5 -1
- package/server/dist/http/router.js +14 -25
- package/server/dist/http/writeConfinement.js +19 -2
- 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/primitives/seedWorker.d.ts +1 -0
- package/server/dist/primitives/seedWorker.js +2 -1
- 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-appserver/heldCommands.d.ts +14 -0
- package/server/dist/providers/codex-appserver/heldCommands.js +54 -0
- package/server/dist/providers/codex-appserver/index.d.ts +52 -2
- package/server/dist/providers/codex-appserver/index.js +239 -21
- package/server/dist/providers/codex-appserver/lateCommands.d.ts +62 -0
- package/server/dist/providers/codex-appserver/lateCommands.js +195 -0
- package/server/dist/providers/codex-appserver/worker.d.ts +23 -1
- package/server/dist/providers/codex-appserver/worker.js +89 -20
- package/server/dist/providers/codex.js +2 -1
- package/server/dist/providers/codexCodeMode.d.ts +2 -1
- package/server/dist/providers/codexCodeMode.js +8 -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/smartPickupAdapters.js +15 -2
- package/server/dist/transcriptWorker.d.ts +34 -0
- package/server/dist/transcriptWorker.js +201 -0
- package/server/dist/workers/WorkerManager.d.ts +1 -0
- package/server/dist/workers/WorkerManager.js +1 -0
- package/server/dist/workers/processKill.d.ts +9 -1
- package/server/dist/workers/processKill.js +26 -10
- package/server/dist/workflowStore.d.ts +1 -0
- package/server/dist/workflowStore.js +31 -0
- package/server/dist/ws/clusterHandlers.d.ts +1 -0
- package/server/dist/ws/clusterHandlers.js +62 -26
- package/server/dist/ws/handoffHandlers.js +7 -2
- package/server/dist/ws/transcriptWorkerHandlers.d.ts +25 -0
- package/server/dist/ws/transcriptWorkerHandlers.js +139 -0
- package/server/dist/ws/turnEngine.js +40 -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/clusterDirector.ts +2 -1
- package/server/src/clusterPeerOps.ts +15 -9
- package/server/src/clusterProgress.ts +1 -1
- package/server/src/clusterRehydrate.ts +2 -0
- package/server/src/clusterSkills.ts +79 -0
- package/server/src/clusterSnapshots.ts +1 -0
- package/server/src/clusterStore.ts +38 -0
- package/server/src/diagnostics/codeSkew.ts +1 -0
- package/server/src/eventLog.ts +73 -13
- package/server/src/explorerDocs.ts +75 -34
- package/server/src/historyLimits.ts +2 -0
- package/server/src/http/attachmentUpload.ts +49 -0
- package/server/src/http/browserWorktrees.ts +124 -0
- package/server/src/http/phoneUploadDrafts.ts +118 -0
- package/server/src/http/phoneUploadListener.ts +96 -0
- package/server/src/http/phoneUploadNetwork.ts +117 -0
- package/server/src/http/phoneUploadPage.ts +137 -0
- package/server/src/http/phoneUploadRouteHistory.ts +73 -0
- package/server/src/http/phoneUploadRoutes.ts +398 -0
- package/server/src/http/phoneUploadTheme.ts +97 -0
- package/server/src/http/projectBinding.ts +3 -2
- package/server/src/http/readConfinement.ts +5 -1
- package/server/src/http/router.ts +12 -26
- package/server/src/http/writeConfinement.ts +13 -2
- 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/primitives/seedWorker.ts +3 -1
- 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-appserver/heldCommands.ts +58 -0
- package/server/src/providers/codex-appserver/index.ts +222 -20
- package/server/src/providers/codex-appserver/lateCommands.ts +225 -0
- package/server/src/providers/codex-appserver/worker.ts +85 -21
- package/server/src/providers/codex.ts +2 -1
- package/server/src/providers/codexCodeMode.ts +9 -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/smartPickupAdapters.ts +17 -3
- package/server/src/transcriptWorker.ts +182 -0
- package/server/src/workers/WorkerManager.ts +2 -0
- package/server/src/workers/processKill.ts +35 -7
- package/server/src/workflowStore.ts +21 -0
- package/server/src/ws/clusterHandlers.ts +43 -25
- package/server/src/ws/handoffHandlers.ts +7 -1
- package/server/src/ws/transcriptWorkerHandlers.ts +126 -0
- package/server/src/ws/turnEngine.ts +35 -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/chat.d.ts +1 -0
- package/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/shared/dist/protocol/clusters.d.ts +15 -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 +13 -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/protocol/workflows.d.ts +1 -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/chat.ts +1 -0
- package/shared/src/protocol/clientMessages.ts +5 -0
- package/shared/src/protocol/clusters.ts +20 -6
- package/shared/src/protocol/index.ts +1 -0
- package/shared/src/protocol/models.ts +31 -5
- package/shared/src/protocol/serverMessages.ts +13 -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/protocol/workflows.ts +4 -0
- package/shared/src/runtimeVersions.ts +14 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { createTwoFilesPatch } from 'diff';
|
|
3
|
-
import { DialogShell } from './DialogShell';
|
|
3
|
+
import { DialogShell, SETTINGS_CHILD_DIALOG_Z_INDEX } from './DialogShell';
|
|
4
|
+
import { useAppStore } from '../stores/appStore';
|
|
4
5
|
import { DirectoryBrowser } from './media/DirectoryPicker';
|
|
5
6
|
import { SkillEditorDialog, type SkillEditorTarget } from './SkillEditorDialog';
|
|
7
|
+
import { PinSkillDialog } from './ClusterRightPanel/SkillsControl';
|
|
6
8
|
|
|
7
9
|
// Settings > SKILLS (P8.6): list, create, edit and delete skills, plus IMPORT
|
|
8
10
|
// (GitHub link, folder, zip), UPDATE with a per-file diff, ON/OFF, MOVE between
|
|
@@ -63,6 +65,18 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
63
65
|
const [importing, setImporting] = useState(false);
|
|
64
66
|
const [updating, setUpdating] = useState<SkillSummary | null>(null);
|
|
65
67
|
const [sharing, setSharing] = useState<SkillSummary | null>(null);
|
|
68
|
+
const clusters = useAppStore(s => s.clusters);
|
|
69
|
+
const jobs = useAppStore(s => s.jobs);
|
|
70
|
+
const [pendingPin, setPendingPin] = useState<{ kind: 'tab' | 'cluster'; id: string; role?: string; scope: Scope; slug: string; message: string } | null>(null);
|
|
71
|
+
const [pinning, setPinning] = useState<{ skill: SkillSummary; kind: 'tab' | 'cluster' } | null>(null);
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!pendingPin) return;
|
|
75
|
+
const pins = pendingPin.kind === 'cluster' ? clusters[pendingPin.id]?.skillPins : jobs[pendingPin.id]?.config.pinnedSkills;
|
|
76
|
+
if (pins?.some(pin => pin.scope === pendingPin.scope && pin.slug === pendingPin.slug && (pendingPin.kind === 'tab' || ('role' in pin ? pin.role : undefined) === pendingPin.role))) {
|
|
77
|
+
setNote(pendingPin.message); setPendingPin(null);
|
|
78
|
+
}
|
|
79
|
+
}, [clusters, jobs, pendingPin]);
|
|
66
80
|
|
|
67
81
|
const refresh = async () => {
|
|
68
82
|
setError(null);
|
|
@@ -118,6 +132,8 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
118
132
|
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap' }}>
|
|
119
133
|
<button type="button" style={small} onClick={() => setEditor({ scope: s.scope, slug: s.slug })}>EDIT</button>
|
|
120
134
|
<button type="button" style={small} data-help="settings.skills.toggle" onClick={() => void toggle(s)}>{s.off ? 'TURN ON' : 'TURN OFF'}</button>
|
|
135
|
+
<button type="button" style={small} data-help="settings.skills.pin-tab" disabled={s.off} onClick={() => setPinning({ skill: s, kind: 'tab' })}>PIN TO TAB</button>
|
|
136
|
+
<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
137
|
{(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
138
|
<button type="button" style={small} data-help="settings.skills.duplicate" onClick={() => duplicate(s)}>DUPLICATE</button>
|
|
123
139
|
{(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 +146,7 @@ export function SkillsSettings({ cwd }: { cwd: string }) {
|
|
|
130
146
|
|
|
131
147
|
return (
|
|
132
148
|
<div data-help="settings.skills">
|
|
149
|
+
{pinning && <PinSkillDialog skill={pinning.skill} kind={pinning.kind} cwd={cwd} onClose={() => setPinning(null)} onPinned={result => { setNote(''); setPendingPin(result); }} />}
|
|
133
150
|
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px', gap: '6px' }}>
|
|
134
151
|
<span className="display-font" style={{ fontSize: '11px', letterSpacing: '2px', color: 'var(--color-accent-primary-dim)' }}>SKILLS</span>
|
|
135
152
|
<span style={{ display: 'flex', gap: '6px' }}>
|
|
@@ -211,7 +228,7 @@ export function SkillImportDialog({ cwd, onClose, onImported }: { cwd: string; o
|
|
|
211
228
|
};
|
|
212
229
|
|
|
213
230
|
return (
|
|
214
|
-
<DialogShell title="IMPORT SKILL" ariaLabel="Import skill" dataHelp="settings.skills.import" onClose={onClose} width={720}
|
|
231
|
+
<DialogShell zIndex={SETTINGS_CHILD_DIALOG_Z_INDEX} title="IMPORT SKILL" ariaLabel="Import skill" dataHelp="settings.skills.import" onClose={onClose} width={720}
|
|
215
232
|
status={error ? <span role="alert" style={{ color: 'var(--color-error)' }}>{error}</span> : null}
|
|
216
233
|
actions={<>
|
|
217
234
|
<button type="button" disabled={busy} onClick={() => void review()}>REVIEW</button>
|
|
@@ -261,7 +278,7 @@ function SkillUpdateDialog({ cwd, skill, onClose, onUpdated }: { cwd: string; sk
|
|
|
261
278
|
catch (err) { setError(err instanceof Error ? err.message : String(err)); setBusy(false); }
|
|
262
279
|
};
|
|
263
280
|
return (
|
|
264
|
-
<DialogShell size="viewer" title={`UPDATE ${skill.name.toUpperCase()}`} ariaLabel="Update skill" dataHelp="settings.skills.update" onClose={onClose} width={820}
|
|
281
|
+
<DialogShell zIndex={SETTINGS_CHILD_DIALOG_Z_INDEX} size="viewer" title={`UPDATE ${skill.name.toUpperCase()}`} ariaLabel="Update skill" dataHelp="settings.skills.update" onClose={onClose} width={820}
|
|
265
282
|
status={error ? <span role="alert" style={{ color: 'var(--color-error)' }}>{error}</span> : null}
|
|
266
283
|
actions={<button type="button" disabled={busy || !preview?.changed} onClick={() => void apply()}>APPLY UPDATE</button>}>
|
|
267
284
|
<p style={{ marginTop: 0 }}>Fetched again from {sourceLabel(skill.source)}. Nothing changes until you select APPLY UPDATE; the skill stays on or off as it is.</p>
|
|
@@ -295,7 +312,7 @@ function SkillShareDialog({ cwd, skill, onClose, onShared }: { cwd: string; skil
|
|
|
295
312
|
};
|
|
296
313
|
const isPublic = preview?.publicRepository || markedPublic;
|
|
297
314
|
return (
|
|
298
|
-
<DialogShell title="SHARE WITH REPOSITORY" ariaLabel="Share skill with repository" dataHelp="settings.skills.share" onClose={onClose}
|
|
315
|
+
<DialogShell zIndex={SETTINGS_CHILD_DIALOG_Z_INDEX} title="SHARE WITH REPOSITORY" ariaLabel="Share skill with repository" dataHelp="settings.skills.share" onClose={onClose}
|
|
299
316
|
status={error ? <span role="alert" style={{ color: 'var(--color-error)' }}>{error}</span> : null}
|
|
300
317
|
actions={<button type="button" disabled={busy || !preview || preview.alreadyTrackable} onClick={() => void share()}>{isPublic ? 'SHARE IN PUBLIC REPOSITORY' : 'SHARE'}</button>}>
|
|
301
318
|
{preview?.alreadyTrackable ? <p>Git does not ignore these files; they can already be committed.</p> : <p>Git ignores <code>.arco</code> in this project. SHARE adds an exception for this skill to <code>.arco/.gitignore</code>, so these files show up in Git and can be committed. Arco does not stage or commit them.</p>}
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { PhoneUploadButton } from './PhoneUpload';
|
|
1
2
|
import { effectiveCodexTransport } from '@arco/shared';
|
|
2
3
|
import { TurnTimer } from './TurnTimer';
|
|
4
|
+
import { SkillsControl } from './ClusterRightPanel/SkillsControl';
|
|
3
5
|
import { BriefControl } from './BriefControl';
|
|
4
6
|
import { ClusterComposerButtons, type ClusterComposerControls } from './ClusterComposerButtons';
|
|
5
7
|
import type { SpawnMemberIdentity } from '@arco/shared';
|
|
@@ -50,7 +52,7 @@ import { ToolbarMore, useToolbarOverflow } from '../layout/ToolbarOverflow';
|
|
|
50
52
|
import { useKeepInWindow } from '../layout/keepInWindow';
|
|
51
53
|
|
|
52
54
|
// FILE, PLAN and BRIEF stay on the composer line in every layout.
|
|
53
|
-
const TOOLBAR_KEEP: ReadonlySet<string> = new Set(['composer.attach', 'composer.plan', 'composer.brief']);
|
|
55
|
+
const TOOLBAR_KEEP: ReadonlySet<string> = new Set(['composer.attach', 'composer.upload-from-phone', 'composer.plan', 'composer.brief']);
|
|
54
56
|
|
|
55
57
|
export interface Props {
|
|
56
58
|
job: JobState;
|
|
@@ -457,9 +459,9 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
457
459
|
const [showResearchDialog, setShowResearchDialog] = useState(false);
|
|
458
460
|
const [showTranscriptDialog, setShowTranscriptDialog] = useState(false);
|
|
459
461
|
const [showForwardDialog, setShowForwardDialog] = useState(false);
|
|
460
|
-
// Cluster lookup for
|
|
461
|
-
//
|
|
462
|
-
//
|
|
462
|
+
// Cluster lookup for existing-member transcript and forward destinations.
|
|
463
|
+
// Standalone tabs still offer TRANSCRIPT for a new worker; membership
|
|
464
|
+
// controls whether the existing peer-delivery destination is available.
|
|
463
465
|
const clusterForJob = useAppStore((s) => {
|
|
464
466
|
for (const c of Object.values(s.clusters)) {
|
|
465
467
|
if (c.members.some((m) => m.workflowId === job.id)) return c;
|
|
@@ -841,6 +843,7 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
841
843
|
</span>
|
|
842
844
|
)}
|
|
843
845
|
{onCancelQueued && <QueuedMessagesIndicator job={job} onCancel={onCancelQueued} />}
|
|
846
|
+
{clusterForJob && <SkillsControl cluster={clusterForJob} memberId={job.id} />}
|
|
844
847
|
{/* Standing pins persist in WorkflowConfig/meta.json and are re-injected
|
|
845
848
|
every turn. They remain visible until explicitly removed. */}
|
|
846
849
|
{pinnedSkills.length > 0 && (
|
|
@@ -1219,6 +1222,7 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
1219
1222
|
+ FILE
|
|
1220
1223
|
</button>
|
|
1221
1224
|
</span>
|
|
1225
|
+
<PhoneUploadButton workflowId={job.id} />
|
|
1222
1226
|
|
|
1223
1227
|
{hubLinked && onUpdatePrimary && (
|
|
1224
1228
|
<button
|
|
@@ -1443,12 +1447,12 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
1443
1447
|
</button>
|
|
1444
1448
|
)}
|
|
1445
1449
|
|
|
1446
|
-
{
|
|
1450
|
+
{job.config.kind !== 'chat' && job.config.kind !== 'cluster' && (
|
|
1447
1451
|
<button
|
|
1448
1452
|
onClick={() => setShowTranscriptDialog(true)}
|
|
1449
|
-
data-help="
|
|
1453
|
+
data-help="composer.transcript-worker"
|
|
1450
1454
|
className="display-font"
|
|
1451
|
-
title="Send a
|
|
1455
|
+
title="Send a transcript to a cluster member, or copy exact turns to a new worker in another folder"
|
|
1452
1456
|
style={{
|
|
1453
1457
|
padding: '3px 8px',
|
|
1454
1458
|
background: 'transparent',
|
|
@@ -1982,15 +1986,15 @@ export function TerminalInput({ job, onSend, onCancel, onCancelQueued, onUpload,
|
|
|
1982
1986
|
/>
|
|
1983
1987
|
)}
|
|
1984
1988
|
|
|
1985
|
-
{showTranscriptDialog &&
|
|
1989
|
+
{showTranscriptDialog && (
|
|
1986
1990
|
<TranscriptSendDialog
|
|
1987
|
-
cluster={clusterForJob}
|
|
1991
|
+
cluster={clusterForJob ?? undefined}
|
|
1988
1992
|
fromWorkflowId={job.id}
|
|
1989
1993
|
messages={job.messages}
|
|
1990
|
-
onConfirm={(recipients, content) => {
|
|
1994
|
+
onConfirm={onTranscriptSend ? (recipients, content) => {
|
|
1991
1995
|
setShowTranscriptDialog(false);
|
|
1992
1996
|
for (const to of recipients) onTranscriptSend(to, content);
|
|
1993
|
-
}}
|
|
1997
|
+
} : undefined}
|
|
1994
1998
|
onCancel={() => setShowTranscriptDialog(false)}
|
|
1995
1999
|
/>
|
|
1996
2000
|
)}
|
|
@@ -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"
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useEffect, useRef, useState, type CSSProperties } from 'react';
|
|
2
|
+
import { PRIMARY_PROVIDERS, TERMINAL_CODEX_ACCOUNT, type EffortLevel, type ProviderName, type TranscriptWorkerPreview } from '@arco/shared';
|
|
3
|
+
import { useAppStore } from '../stores/appStore';
|
|
4
|
+
import { useCodexCatalogFor } from '../hooks/useCodexCatalog';
|
|
5
|
+
import { defaultModelForProvider, modelsForProvider, useModelCatalogs } from '../utils/modelCatalog';
|
|
6
|
+
import { capDefaultEffort } from '../utils/effortDefaults';
|
|
7
|
+
import { effortsForModel } from '../utils/format';
|
|
8
|
+
import { requestTranscriptWorker } from '../utils/transcriptWorkerRequest';
|
|
9
|
+
import { DialogShell } from './DialogShell';
|
|
10
|
+
import { DirectoryBrowser } from './media/DirectoryPicker';
|
|
11
|
+
|
|
12
|
+
const field: CSSProperties = { width: '100%', minWidth: 0, display: 'block' };
|
|
13
|
+
const button: CSSProperties = { padding: '5px 10px', cursor: 'pointer', fontSize: '11px', letterSpacing: '1px' };
|
|
14
|
+
const labels: Record<ProviderName, string> = { claude: 'Claude', codex: 'Codex', cursor: 'Cursor', ollama: 'Ollama', llamacpp: 'llama.cpp', lmstudio: 'LM Studio', strata: 'Strata', deepseek: 'DeepSeek' };
|
|
15
|
+
|
|
16
|
+
export function TranscriptWorkerDialog({ workflowId, onCancel, onMembers }: { workflowId: string; onCancel: () => void; onMembers?: () => void }) {
|
|
17
|
+
const job = useAppStore(s => s.jobs[workflowId]);
|
|
18
|
+
const connected = useAppStore(s => s.connected);
|
|
19
|
+
const settings = useAppStore(s => s.settings);
|
|
20
|
+
const auth = useAppStore(s => s.authStatus);
|
|
21
|
+
const enabled = useAppStore(s => s.isProviderEnabled);
|
|
22
|
+
const sourceProvider = job?.config.primaryProvider ?? 'claude';
|
|
23
|
+
const [turns, setTurns] = useState(3);
|
|
24
|
+
const [includePartial, setIncludePartial] = useState(false);
|
|
25
|
+
const [preface, setPreface] = useState('');
|
|
26
|
+
const [directory, setDirectory] = useState(job?.config.workingDirectory ?? '');
|
|
27
|
+
const [browse, setBrowse] = useState(false);
|
|
28
|
+
const [name, setName] = useState(`Worker from ${job?.config.name ?? 'conversation'}`);
|
|
29
|
+
const [provider, setProvider] = useState<ProviderName>(sourceProvider);
|
|
30
|
+
const [model, setModel] = useState(String(job?.config.primaryModel ?? ''));
|
|
31
|
+
const [effort, setEffort] = useState<EffortLevel>(capDefaultEffort(job?.config.primaryEffort ?? 'medium'));
|
|
32
|
+
const [account, setAccount] = useState(sourceProvider === 'codex' ? job?.config.providerAccountRef ?? '' : '');
|
|
33
|
+
const [skipPermissions, setSkipPermissions] = useState(false);
|
|
34
|
+
const [preview, setPreview] = useState<TranscriptWorkerPreview | null>(null);
|
|
35
|
+
const [previewInput, setPreviewInput] = useState('');
|
|
36
|
+
const [phase, setPhase] = useState<'preview' | 'create' | null>(null);
|
|
37
|
+
const [error, setError] = useState('');
|
|
38
|
+
const alive = useRef(true);
|
|
39
|
+
useEffect(() => { alive.current = true; return () => { alive.current = false; }; }, []);
|
|
40
|
+
const codexCatalog = useCodexCatalogFor(account || undefined);
|
|
41
|
+
const catalogs = useModelCatalogs({ codex: codexCatalog });
|
|
42
|
+
const models = modelsForProvider(provider, catalogs).map(String);
|
|
43
|
+
if (provider === sourceProvider && job?.config.primaryModel && !models.includes(String(job.config.primaryModel))) models.unshift(String(job.config.primaryModel));
|
|
44
|
+
const effortOptions = effortsForModel(provider, model, catalogs.claude, codexCatalog);
|
|
45
|
+
const offeredEfforts = effortOptions.length ? effortOptions : ['none' as const];
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!offeredEfforts.includes(effort)) setEffort(offeredEfforts.includes('medium') ? 'medium' : offeredEfforts[0]);
|
|
48
|
+
}, [provider, model, offeredEfforts.join('|'), effort]);
|
|
49
|
+
const providers = PRIMARY_PROVIDERS.filter(value => enabled(value) && !!auth?.[value]?.loggedIn);
|
|
50
|
+
const prefaceBytes = new TextEncoder().encode(preface).length;
|
|
51
|
+
const inputKey = JSON.stringify([turns, includePartial, preface]);
|
|
52
|
+
const invalidate = () => { setPreview(null); setError(''); };
|
|
53
|
+
const readPreview = async () => {
|
|
54
|
+
if (!connected || prefaceBytes > 4096 || phase) return;
|
|
55
|
+
setPhase('preview'); setError('');
|
|
56
|
+
try {
|
|
57
|
+
const result = await requestTranscriptWorker({ type: 'transcript_worker_preview', workflowId, turns, includePartial, preface });
|
|
58
|
+
if (alive.current) {
|
|
59
|
+
if (!result.preview) throw new Error('The preview is unavailable. Try again.');
|
|
60
|
+
setPreview(result.preview);
|
|
61
|
+
setPreviewInput(inputKey);
|
|
62
|
+
}
|
|
63
|
+
} catch (reason) { if (alive.current) { setPreview(null); setError(reason instanceof Error ? reason.message : String(reason)); } }
|
|
64
|
+
finally { if (alive.current) setPhase(null); }
|
|
65
|
+
};
|
|
66
|
+
const create = async () => {
|
|
67
|
+
if (!preview || phase || previewInput !== inputKey) return;
|
|
68
|
+
setPhase('create'); setError('');
|
|
69
|
+
try {
|
|
70
|
+
const result = await requestTranscriptWorker({ type: 'transcript_worker_create', token: preview.token,
|
|
71
|
+
destination: { workingDirectory: directory, name, provider, model, effort, ...(provider === 'codex' && account ? { providerAccountRef: account } : {}), skipPermissions } });
|
|
72
|
+
if (alive.current) {
|
|
73
|
+
if (!result.newWorkflowId) throw new Error('The worker could not be created. Refresh the preview.');
|
|
74
|
+
useAppStore.getState().setActiveJob(result.newWorkflowId);
|
|
75
|
+
onCancel();
|
|
76
|
+
}
|
|
77
|
+
} catch (reason) { if (alive.current) { setPreview(null); setError(reason instanceof Error ? reason.message : String(reason)); } }
|
|
78
|
+
finally { if (alive.current) setPhase(null); }
|
|
79
|
+
};
|
|
80
|
+
if (!job) return null;
|
|
81
|
+
return <DialogShell title="Send turns to a new worker" dataHelp="composer.transcript-worker" onClose={onCancel} width={760}
|
|
82
|
+
status={error ? <span role="alert">{error}</span> : phase ? <span role="status">{phase === 'preview' ? 'Reading stored turns...' : 'Creating the worker...'}</span> : undefined}
|
|
83
|
+
actions={<>
|
|
84
|
+
{onMembers && <button type="button" data-help="composer.transcript-worker" style={button} disabled={!!phase} onClick={onMembers}>EXISTING MEMBERS</button>}
|
|
85
|
+
<button type="button" data-help="composer.transcript-worker" style={button} disabled={!!phase} onClick={onCancel}>CANCEL</button>
|
|
86
|
+
<button type="button" data-help="composer.transcript-worker-preview" style={button} disabled={!!phase || !connected || prefaceBytes > 4096} onClick={() => void readPreview()}>PREVIEW</button>
|
|
87
|
+
<button type="button" data-help="composer.transcript-worker-send" style={button} disabled={!!phase || !preview || previewInput !== inputKey || !connected || !directory.trim() || !model || !providers.includes(provider)} onClick={() => void create()}>SEND TO NEW WORKER</button>
|
|
88
|
+
</>}>
|
|
89
|
+
<p>Source: {job.config.name}. Copy exact operator and agent text. Tools and attachments become receipts; attachment files are not copied.</p>
|
|
90
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px', alignItems: 'end' }}>
|
|
91
|
+
<label>Last turns<input className="arco-field" data-help="composer.transcript-worker-preview" aria-label="Turns to copy" type="number" min={1} max={50} value={turns} disabled={!!phase} onChange={event => { setTurns(Math.max(1, Math.min(50, Number(event.target.value) || 1))); invalidate(); }} style={{ ...field, width: '80px' }} /></label>
|
|
92
|
+
<label><input type="checkbox" data-help="composer.transcript-worker-preview" checked={includePartial} disabled={!!phase || !job.busy} onChange={event => { setIncludePartial(event.target.checked); invalidate(); }} /> Include the current partial turn</label>
|
|
93
|
+
</div>
|
|
94
|
+
<label>Preface, placed before the copied turns<textarea className="arco-field" data-help="composer.transcript-worker-preview" aria-label="New worker preface" rows={3} value={preface} disabled={!!phase} onChange={event => { setPreface(event.target.value); invalidate(); }} style={{ ...field, resize: 'vertical' }} /></label>
|
|
95
|
+
<div style={{ color: prefaceBytes > 4096 ? 'var(--color-warning)' : 'var(--color-fg-muted)' }}>{prefaceBytes} / 4096 preface bytes; the whole seed must fit 32768 bytes. Content is never silently clipped.</div>
|
|
96
|
+
<label>New worker name<input className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker name" value={name} maxLength={120} disabled={!!phase} onChange={event => setName(event.target.value)} style={field} /></label>
|
|
97
|
+
<label>Working directory<input className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker working directory" value={directory} disabled={!!phase} onChange={event => setDirectory(event.target.value)} style={field} /></label>
|
|
98
|
+
<button type="button" data-help="composer.transcript-worker-target" style={{ ...button, justifySelf: 'start' }} disabled={!!phase} onClick={() => setBrowse(value => !value)}>BROWSE</button>
|
|
99
|
+
{browse && <DirectoryBrowser inline withFilename={false} initialPath={directory} roots={settings?.projectRoots} title="New worker folder" confirmLabel="Use this folder" onDone={result => { if (result) setDirectory(result.dir); setBrowse(false); }} />}
|
|
100
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px' }}>
|
|
101
|
+
<label style={{ flex: '1 1 150px', minWidth: 0 }}>Provider<select className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker provider" value={provider} disabled={!!phase} onChange={event => {
|
|
102
|
+
const next = event.target.value as ProviderName; setProvider(next); setModel(defaultModelForProvider(next, catalogs)); setAccount('');
|
|
103
|
+
}} style={field}>{!providers.includes(provider) && <option value={provider} disabled>{labels[provider] ?? provider} (not ready)</option>}{providers.map(value => <option key={value} value={value}>{labels[value]}</option>)}</select></label>
|
|
104
|
+
<label style={{ flex: '2 1 200px', minWidth: 0 }}>Model<select className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker model" value={model} disabled={!!phase} onChange={event => setModel(event.target.value)} style={field}>{models.map(value => <option key={value} value={value}>{value}</option>)}</select></label>
|
|
105
|
+
<label>Effort<select className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker effort" value={effort} disabled={!!phase} onChange={event => setEffort(event.target.value as EffortLevel)} style={field}>{offeredEfforts.map(value => <option key={value} value={value}>{value.toUpperCase()}</option>)}</select></label>
|
|
106
|
+
</div>
|
|
107
|
+
{!providers.includes(provider) && <p role="status">{providers.length ? `${labels[provider] ?? provider} is not ready. Choose a connected provider.` : 'No connected provider is enabled. Connect or enable one in Settings before sending.'}</p>}
|
|
108
|
+
{!models.length && <p role="status">No models are available for this provider. Choose another provider or configure it in Settings.</p>}
|
|
109
|
+
{provider === 'codex' && <label>Account<select className="arco-field" data-help="composer.transcript-worker-target" aria-label="New worker account" value={account} disabled={!!phase} onChange={event => setAccount(event.target.value)} style={field}>
|
|
110
|
+
<option value="">Default account</option><option value={TERMINAL_CODEX_ACCOUNT}>Terminal Codex account</option>{(settings?.providerAccounts?.codex ?? []).map(value => <option key={value.id} value={value.id}>{value.label}</option>)}
|
|
111
|
+
</select></label>}
|
|
112
|
+
<label><input type="checkbox" data-help="composer.transcript-worker-target" checked={skipPermissions} disabled={!!phase} onChange={event => setSkipPermissions(event.target.checked)} /> Skip permission prompts in the new worker</label>
|
|
113
|
+
<p>The new worker starts a fresh provider conversation in the chosen folder. It inherits no source pins or cluster membership. The destination's own project settings apply.</p>
|
|
114
|
+
{preview ? <>
|
|
115
|
+
<div role="status">{preview.selectedTurns} of {preview.availableTurns} available turns selected; {preview.bytes} / 32768 seed bytes{preview.partialIncluded ? '; includes a partial-turn snapshot' : ''}.</div>
|
|
116
|
+
<textarea className="arco-field" aria-label="New worker seed preview" data-help="composer.transcript-worker-preview" readOnly value={preview.seed} rows={9} style={{ ...field, fontFamily: 'var(--font-code)', resize: 'vertical' }} />
|
|
117
|
+
</> : <p>PREVIEW reads the stored conversation. Review the exact seed before sending. Editing turns or preface requires a new preview.</p>}
|
|
118
|
+
</DialogShell>;
|
|
119
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CodexLateCommandLine } from './CodexLateCommand';
|
|
1
2
|
import { useVoicePanelOpener } from '../voice/panels';
|
|
2
3
|
import { ContextMeter } from './ContextMeter';
|
|
3
4
|
import { PrimaryStatus } from './PrimaryStatus';
|
|
@@ -221,6 +222,7 @@ export function WorkflowView({ job, onRenameWorkflow, onSend, onCancel, onCompac
|
|
|
221
222
|
}}
|
|
222
223
|
>
|
|
223
224
|
<div className="display-font" data-testid="conversation-header" style={{ display: 'flex', alignItems: 'center', gap: '8px', minWidth: 0, padding: '8px 12px', borderBottom: '1px solid var(--color-border-hairline)', fontSize: '10px' }}>{job.busy && <PrimaryStatus job={job} />}<span data-help="worker.header.ctx" style={{ marginLeft: 'auto', flexShrink: 0 }}><ContextMeter job={job} onRecalibrate={onRecalibrate} /></span></div>
|
|
225
|
+
<CodexLateCommandLine job={job} header />
|
|
224
226
|
{/* `no-frost`: the chat column is a transparent transcript scaffold,
|
|
225
227
|
not a glass content panel. Under frosted-glass mode the generic
|
|
226
228
|
`.arco-panel` backdrop-filter blur would soften the ambient
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Badge semantics are covered by clusterNeedsYou.test.ts. The existing
|
|
3
3
|
// scripts/smoke/task-board.ts checks the board and operator-accept contracts.
|
|
4
4
|
|
|
5
|
-
import type { LedgerTask
|
|
5
|
+
import type { LedgerTask } from '@arco/shared';
|
|
6
6
|
|
|
7
7
|
export const REVIEW_OLDER_MS = 7 * 24 * 60 * 60 * 1000;
|
|
8
8
|
|
|
@@ -10,13 +10,12 @@ export const REVIEW_OLDER_MS = 7 * 24 * 60 * 60 * 1000;
|
|
|
10
10
|
const OPERATOR_BLOCKED =
|
|
11
11
|
/\b(operator|human|you\b|your\s+(?:decision|input|approval|go)|needs?\s+(?:you|operator|human)|awaiting\s+(?:you|operator)|approve|accept|confirm)\b/i;
|
|
12
12
|
|
|
13
|
-
export type NeedsYouKind = '
|
|
13
|
+
export type NeedsYouKind = 'blocked' | 'question' | 'asked';
|
|
14
14
|
|
|
15
15
|
export const NEEDS_YOU_KIND: Record<NeedsYouKind, { label: string; stopped: boolean; description: string }> = {
|
|
16
16
|
question: { label: 'WAITING', stopped: true, description: 'An agent is waiting for an answer before it can continue.' },
|
|
17
17
|
blocked: { label: 'BLOCKED', stopped: true, description: 'A task is blocked on the operator.' },
|
|
18
18
|
asked: { label: 'ASKED', stopped: false, description: 'An agent asked a question and can continue without an answer.' },
|
|
19
|
-
review: { label: 'TO ACCEPT', stopped: false, description: 'Finished and signed off. Accepting is optional; nothing waits on it.' },
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
export interface NeedsYouItem {
|
|
@@ -32,10 +31,6 @@ export function isOperatorBlockedReason(reason: string | undefined | null): bool
|
|
|
32
31
|
return Boolean(reason && OPERATOR_BLOCKED.test(reason.trim()));
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
export function reviewNeedsOperator(task: Pick<LedgerTask, 'status' | 'signoff'>): boolean {
|
|
36
|
-
return task.status === 'review' && Boolean(task.signoff);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
34
|
export function blockedNeedsOperator(task: Pick<LedgerTask, 'status' | 'blockedReason'>): boolean {
|
|
40
35
|
return task.status === 'blocked' && isOperatorBlockedReason(task.blockedReason);
|
|
41
36
|
}
|
|
@@ -59,6 +54,13 @@ export function namedCommitsForTask(task: Pick<LedgerTask, 'notes' | 'signoff'>)
|
|
|
59
54
|
return namedCommitsInText([task.notes ?? '', task.signoff?.summary ?? ''].join('\n'));
|
|
60
55
|
}
|
|
61
56
|
|
|
57
|
+
export function plainSignoffSummary(signoff?: LedgerTask['signoff']): string | undefined {
|
|
58
|
+
const summary = signoff?.summary?.trim();
|
|
59
|
+
if (!signoff || !summary) return undefined;
|
|
60
|
+
if (signoff.state === 'met') return summary;
|
|
61
|
+
return `Not finished: ${summary.replace(/^(?:partial|not[_ -]met)\s*:\s*/i, '')}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
62
64
|
export function reviewTasksWithMetSignoff(tasks: readonly LedgerTask[]): LedgerTask[] {
|
|
63
65
|
return tasks.filter((t) => t.status === 'review' && t.signoff?.state === 'met');
|
|
64
66
|
}
|
|
@@ -129,16 +131,7 @@ export function buildNeedsYouItems(input: {
|
|
|
129
131
|
}): NeedsYouItem[] {
|
|
130
132
|
const items: NeedsYouItem[] = [];
|
|
131
133
|
for (const t of input.tasks) {
|
|
132
|
-
if (
|
|
133
|
-
const so = t.signoff as TaskSignoff;
|
|
134
|
-
items.push({
|
|
135
|
-
kind: 'review',
|
|
136
|
-
id: `review:${t.id}`,
|
|
137
|
-
title: t.title,
|
|
138
|
-
detail: `${so.state}${so.summary ? `: ${so.summary}` : ''}`,
|
|
139
|
-
taskId: t.id,
|
|
140
|
-
});
|
|
141
|
-
} else if (blockedNeedsOperator(t)) {
|
|
134
|
+
if (blockedNeedsOperator(t)) {
|
|
142
135
|
items.push({
|
|
143
136
|
kind: 'blocked',
|
|
144
137
|
id: `blocked:${t.id}`,
|
|
@@ -162,7 +155,7 @@ export function buildNeedsYouItems(input: {
|
|
|
162
155
|
}
|
|
163
156
|
|
|
164
157
|
export function needsYouSummary(items: readonly NeedsYouItem[]) {
|
|
165
|
-
const groups = (['question', 'blocked', 'asked'
|
|
158
|
+
const groups = (['question', 'blocked', 'asked'] as const)
|
|
166
159
|
.map((kind) => ({ kind, count: items.filter((item) => item.kind === kind).length, ...NEEDS_YOU_KIND[kind] }))
|
|
167
160
|
.filter((group) => group.count > 0);
|
|
168
161
|
const stopped = groups.reduce((count, group) => count + (group.stopped ? group.count : 0), 0);
|