arco-workbench 0.2.2 → 0.2.5
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 +1 -1
- package/THIRD_PARTY_NOTICES +2 -2
- package/client/dist/assets/{PhosphorBackdrop-BbR3xmfD.js → PhosphorBackdrop-CLILIwOQ.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-UMjbs9ZN.js → ThemedBackgroundShaderImpl-B87chcb5.js} +1 -1
- package/client/dist/assets/{XtermView-n135qz-f.js → XtermView-BP_j7WSN.js} +1 -1
- package/client/dist/assets/{galleryEditor-CFSke4by.js → galleryEditor-B90phoBI.js} +1 -1
- package/client/dist/assets/{index-DeoJbjI3.js → index-BfPp1Oup.js} +270 -270
- package/client/dist/index.html +1 -1
- package/client/dist/manifest-mobile.webmanifest +1 -0
- package/client/src/App.tsx +2 -2
- package/client/src/components/AuthReloginNotice.tsx +7 -6
- package/client/src/components/ChatMessage.tsx +41 -29
- package/client/src/components/ChatPanel.tsx +17 -4
- package/client/src/components/ClaudeNativeAccountPicker.tsx +32 -0
- package/client/src/components/ClaudeNativeAuthRow.tsx +71 -19
- package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +11 -281
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +1 -1
- package/client/src/components/ClusterRightPanel/FreshMemberForm.tsx +315 -0
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +17 -7
- package/client/src/components/ClusterRightPanel/index.tsx +1 -1
- package/client/src/components/ClusterRightPanel/useFreshMemberPicker.ts +6 -4
- package/client/src/components/ClusterTab.tsx +2 -2
- package/client/src/components/Connections/Connections.tsx +7 -11
- package/client/src/components/Connections/model.ts +3 -1
- package/client/src/components/FileViewerModal.tsx +54 -17
- package/client/src/components/GitHubPanel/index.tsx +9 -5
- package/client/src/components/HandoffDialog.tsx +5 -3
- package/client/src/components/MobileShell.tsx +1 -33
- package/client/src/components/OperatorQuestionNotice.tsx +5 -4
- package/client/src/components/ProvidersPopover.tsx +6 -2
- package/client/src/components/RightPanel/ActivityTab.tsx +2 -1
- package/client/src/components/RightPanel/ConfigTab.tsx +23 -5
- package/client/src/components/RightPanel/OutputsPanel.tsx +21 -9
- package/client/src/components/RightPanel/outputsReconcile.ts +31 -0
- package/client/src/components/SettingsPanel.tsx +7 -10
- package/client/src/components/SpawnDialog.tsx +14 -3
- package/client/src/components/TabBar.tsx +2 -2
- package/client/src/components/TabContextMenu.tsx +73 -133
- package/client/src/components/TerminalInput.tsx +4 -3
- package/client/src/components/TranscriptWorkerDialog.tsx +14 -4
- package/client/src/components/UsageBar.tsx +37 -18
- package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +29 -3
- package/client/src/components/WorkflowCreator/index.tsx +29 -15
- package/client/src/components/WorkflowView.tsx +1 -1
- package/client/src/components/providerIndicator.ts +7 -3
- package/client/src/components/research/QuickResearchOverview.tsx +7 -3
- package/client/src/components/research/SavedQuickKeep.tsx +7 -3
- package/client/src/components/settings/GitHubAuthRow.tsx +34 -0
- package/client/src/explorer/ArtifactsLens.tsx +17 -8
- package/client/src/explorer/ExplorerApp.tsx +3 -3
- package/client/src/explorer/types.ts +3 -1
- package/client/src/help/content/cluster.tsx +10 -4
- package/client/src/help/content/composer.tsx +3 -2
- package/client/src/help/content/header.tsx +6 -3
- package/client/src/help/content/misc.tsx +9 -7
- package/client/src/help/content/rightPanel.tsx +11 -6
- package/client/src/help/content/settings.tsx +14 -3
- package/client/src/help/content/tabbar.tsx +1 -1
- package/client/src/help/manualSections/actions.tsx +5 -1
- package/client/src/help/manualSections/clusters.tsx +21 -15
- package/client/src/help/manualSections/configuration.tsx +6 -4
- package/client/src/help/manualSections/gettingStarted.tsx +4 -2
- package/client/src/help/manualSections/maintenance.tsx +24 -0
- package/client/src/help/manualSections/powerFeatures.tsx +4 -2
- package/client/src/help/manualSections/providers.tsx +11 -4
- package/client/src/help/manualSections/workspace.tsx +3 -3
- package/client/src/hooks/useClaudeNativeCatalog.ts +26 -0
- package/client/src/hooks/useClaudeNativeLogin.ts +16 -11
- package/client/src/hooks/useWebSocket.ts +4 -2
- package/client/src/layout/layoutRange.ts +14 -5
- package/client/src/main.tsx +2 -0
- package/client/src/questions/waitingQuestion.ts +2 -0
- package/client/src/stores/appStore.ts +5 -1
- package/client/src/stores/appStore.types.ts +2 -0
- package/client/src/stores/replayContext.ts +20 -0
- package/client/src/utils/chatFileLinks.ts +34 -3
- package/client/src/utils/claudeAuth.ts +9 -1
- package/client/src/ws/handleServerMessage.ts +11 -3
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/BACKUP.md +1 -1
- package/docs/CHECKPOINTS.md +67 -3
- package/docs/CLIENT.md +11 -6
- package/docs/EXTENDING.md +1 -1
- package/docs/FEATURES.md +3 -3
- package/docs/GETTING_STARTED.md +5 -4
- package/docs/GIT_WORKBENCH.md +8 -0
- package/docs/GLOSSARY.md +2 -2
- package/docs/GOTCHAS.md +4 -4
- package/docs/HTTP_API.md +63 -30
- package/docs/OPERATIONS.md +11 -0
- package/docs/OPERATOR_ACTIONS.md +2 -2
- package/docs/OUTPUTS.md +48 -6
- package/docs/PERSISTENCE.md +1 -1
- package/docs/PRIMITIVES.md +4 -2
- package/docs/PROTOCOL_CLUSTER.md +12 -6
- package/docs/PROTOCOL_PRIMITIVES.md +1 -1
- package/docs/PROVIDERS.md +47 -10
- package/docs/RESEARCH.md +3 -3
- package/docs/SETTINGS.md +9 -4
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +15 -3
- package/node_modules/@arco/shared/dist/protocol/clusters.js +1 -1
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
- package/node_modules/@arco/shared/dist/protocol/operatorQuestions.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/settings.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/settings.js +5 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.js +0 -2
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +2 -2
- package/scripts/packaging/services.mjs +20 -1
- package/scripts/packaging/update.mjs +37 -2
- package/server/dist/attention.d.ts +6 -0
- package/server/dist/attention.js +6 -0
- package/server/dist/auth.d.ts +5 -0
- package/server/dist/auth.js +31 -20
- package/server/dist/clusterAutoTurn.d.ts +5 -1
- package/server/dist/clusterAutoTurn.js +31 -9
- package/server/dist/clusterPresets.js +3 -3
- package/server/dist/effortValidation.d.ts +2 -2
- package/server/dist/effortValidation.js +4 -4
- package/server/dist/explorerArtifacts.d.ts +1 -0
- package/server/dist/explorerArtifacts.js +12 -1
- package/server/dist/explorerDocs.d.ts +1 -0
- package/server/dist/explorerDocs.js +4 -4
- package/server/dist/geminiMembers.d.ts +7 -1
- package/server/dist/geminiMembers.js +28 -14
- package/server/dist/gitSnapshots.d.ts +1 -0
- package/server/dist/gitSnapshots.js +547 -83
- package/server/dist/http/clusterRoutes.js +9 -3
- package/server/dist/http/conversationFiles.d.ts +36 -0
- package/server/dist/http/conversationFiles.js +222 -0
- package/server/dist/http/fileBytes.d.ts +3 -0
- package/server/dist/http/fileBytes.js +33 -0
- package/server/dist/http/fileContentRoute.d.ts +2 -0
- package/server/dist/http/fileContentRoute.js +139 -0
- package/server/dist/http/fileRead.d.ts +54 -2
- package/server/dist/http/fileRead.js +31 -24
- package/server/dist/http/outputRoutes.js +14 -21
- package/server/dist/http/readConfinement.d.ts +0 -11
- package/server/dist/http/readConfinement.js +4 -30
- package/server/dist/http/router.js +41 -66
- package/server/dist/index.js +26 -12
- package/server/dist/management/initHubLink.js +1 -1
- package/server/dist/outputs.js +8 -0
- package/server/dist/primitives/exportContext.d.ts +2 -0
- package/server/dist/primitives/exportContext.js +13 -2
- package/server/dist/primitives/runCompare.d.ts +7 -1
- package/server/dist/primitives/runCompare.js +44 -20
- package/server/dist/project/taskLedger.js +46 -34
- package/server/dist/providerAccounts.d.ts +4 -0
- package/server/dist/providerAccounts.js +20 -1
- package/server/dist/providers/antigravity/artifacts.d.ts +23 -0
- package/server/dist/providers/antigravity/artifacts.js +140 -0
- package/server/dist/providers/antigravity/index.js +85 -7
- package/server/dist/providers/antigravity/questions.d.ts +2 -0
- package/server/dist/providers/antigravity/questions.js +58 -0
- package/server/dist/providers/claude-native/auth.d.ts +9 -8
- package/server/dist/providers/claude-native/auth.js +50 -58
- package/server/dist/providers/claude-native/authStatus.d.ts +2 -2
- package/server/dist/providers/claude-native/authStatus.js +9 -7
- package/server/dist/providers/claude-native/catalog.d.ts +6 -5
- package/server/dist/providers/claude-native/catalog.js +50 -39
- package/server/dist/providers/claude-native/oauth.d.ts +10 -9
- package/server/dist/providers/claude-native/oauth.js +120 -96
- package/server/dist/providers/claude-native/worker.d.ts +1 -0
- package/server/dist/providers/claude-native/worker.js +38 -23
- package/server/dist/providers/codex-appserver/operatorQuestions.d.ts +5 -3
- package/server/dist/providers/codex-appserver/operatorQuestions.js +27 -13
- package/server/dist/providers/codexChatBoundary.js +6 -1
- package/server/dist/research/quickPromotion.d.ts +3 -0
- package/server/dist/research/quickPromotion.js +26 -9
- package/server/dist/research/savedQuickPromotion.js +2 -11
- package/server/dist/server/broadcast.js +6 -0
- package/server/dist/settings.d.ts +1 -0
- package/server/dist/settings.js +39 -7
- package/server/dist/skills.js +1 -1
- package/server/dist/smartPickupAdapters.d.ts +1 -0
- package/server/dist/smartPickupAdapters.js +2 -2
- package/server/dist/smartPickupObserver.js +8 -5
- package/server/dist/thirdPartySkills.js +11 -5
- package/server/dist/turnChanges.d.ts +1 -1
- package/server/dist/turnChanges.js +5 -4
- package/server/dist/usage.d.ts +1 -1
- package/server/dist/usage.js +39 -27
- package/server/dist/workers/WorkerManager.d.ts +1 -0
- package/server/dist/workers/WorkerManager.js +1 -0
- package/server/dist/workers/processKill.js +37 -24
- package/server/dist/workflowMeta.js +2 -2
- package/server/dist/ws/clusterHandlers.d.ts +2 -2
- package/server/dist/ws/clusterHandlers.js +127 -113
- package/server/dist/ws/clusterMembers.d.ts +1 -1
- package/server/dist/ws/clusterMembers.js +34 -4
- package/server/dist/ws/compactHandlers.js +30 -14
- package/server/dist/ws/compareHandlers.js +53 -21
- package/server/dist/ws/gateHandlers.js +2 -0
- package/server/dist/ws/genesisHandlers.js +5 -3
- package/server/dist/ws/handoffHandlers.d.ts +1 -1
- package/server/dist/ws/handoffHandlers.js +115 -39
- package/server/dist/ws/transcriptWorkerHandlers.js +7 -2
- package/server/dist/ws/turnEngine.js +37 -19
- package/server/dist/ws/updatePrimaryConfig.d.ts +3 -2
- package/server/dist/ws/updatePrimaryConfig.js +236 -133
- package/server/dist/ws/workflowHandlers.js +21 -4
- package/server/package.json +1 -1
- package/server/src/attention.ts +7 -0
- package/server/src/auth.ts +33 -20
- package/server/src/clusterAutoTurn.ts +31 -11
- package/server/src/clusterPresets.ts +2 -2
- package/server/src/effortValidation.ts +4 -4
- package/server/src/explorerArtifacts.ts +12 -1
- package/server/src/explorerDocs.ts +5 -5
- package/server/src/geminiMembers.ts +26 -15
- package/server/src/gitSnapshots.ts +538 -82
- package/server/src/http/clusterRoutes.ts +10 -3
- package/server/src/http/conversationFiles.ts +231 -0
- package/server/src/http/fileBytes.ts +34 -0
- package/server/src/http/fileContentRoute.ts +123 -0
- package/server/src/http/fileRead.ts +30 -25
- package/server/src/http/outputRoutes.ts +13 -13
- package/server/src/http/readConfinement.ts +3 -30
- package/server/src/http/router.ts +39 -62
- package/server/src/index.ts +27 -18
- package/server/src/management/initHubLink.ts +1 -1
- package/server/src/outputs.ts +8 -0
- package/server/src/primitives/exportContext.ts +14 -2
- package/server/src/primitives/runCompare.ts +73 -46
- package/server/src/project/taskLedger.ts +47 -30
- package/server/src/providerAccounts.ts +20 -1
- package/server/src/providers/antigravity/artifacts.ts +121 -0
- package/server/src/providers/antigravity/index.ts +64 -6
- package/server/src/providers/antigravity/questions.ts +52 -0
- package/server/src/providers/claude-native/auth.ts +45 -60
- package/server/src/providers/claude-native/authStatus.ts +9 -8
- package/server/src/providers/claude-native/catalog.ts +52 -35
- package/server/src/providers/claude-native/oauth.ts +101 -77
- package/server/src/providers/claude-native/worker.ts +38 -22
- package/server/src/providers/codex-appserver/operatorQuestions.ts +26 -12
- package/server/src/providers/codexChatBoundary.ts +6 -1
- package/server/src/research/quickPromotion.ts +24 -6
- package/server/src/research/savedQuickPromotion.ts +2 -8
- package/server/src/server/broadcast.ts +4 -0
- package/server/src/settings.ts +36 -8
- package/server/src/skills.ts +1 -1
- package/server/src/smartPickupAdapters.ts +3 -2
- package/server/src/smartPickupObserver.ts +8 -5
- package/server/src/thirdPartySkills.ts +11 -5
- package/server/src/turnChanges.ts +5 -4
- package/server/src/usage.ts +30 -22
- package/server/src/workers/WorkerManager.ts +2 -0
- package/server/src/workers/processKill.ts +37 -23
- package/server/src/workflowMeta.ts +2 -2
- package/server/src/ws/clusterHandlers.ts +107 -104
- package/server/src/ws/clusterMembers.ts +25 -6
- package/server/src/ws/compactHandlers.ts +29 -15
- package/server/src/ws/compareHandlers.ts +59 -25
- package/server/src/ws/gateHandlers.ts +2 -0
- package/server/src/ws/genesisHandlers.ts +5 -4
- package/server/src/ws/handoffHandlers.ts +105 -37
- package/server/src/ws/transcriptWorkerHandlers.ts +6 -2
- package/server/src/ws/turnEngine.ts +36 -18
- package/server/src/ws/updatePrimaryConfig.ts +230 -132
- package/server/src/ws/workflowHandlers.ts +20 -4
- package/shared/dist/protocol/clusters.d.ts +15 -3
- package/shared/dist/protocol/clusters.js +1 -1
- package/shared/dist/protocol/models.d.ts +6 -1
- package/shared/dist/protocol/operatorQuestions.d.ts +2 -1
- package/shared/dist/protocol/settings.d.ts +3 -0
- package/shared/dist/protocol/settings.js +5 -0
- package/shared/dist/protocol/workflows.d.ts +1 -0
- package/shared/dist/protocol/workflows.js +0 -2
- package/shared/src/protocol/clusters.ts +23 -5
- package/shared/src/protocol/compare.ts +2 -2
- package/shared/src/protocol/models.ts +8 -4
- package/shared/src/protocol/operatorQuestions.ts +2 -1
- package/shared/src/protocol/settings.ts +8 -1
- package/shared/src/protocol/workflows.ts +1 -1
|
@@ -2,11 +2,12 @@ import { codexProfileHomeLabel } from '../utils/codexAccountHome';
|
|
|
2
2
|
import { NativeSubagentDefaults } from './NativeSubagentControls';
|
|
3
3
|
import { ProvidersPopover } from './ProvidersPopover';
|
|
4
4
|
import { PreviewPortsSection } from './settings/PreviewPortsSection';
|
|
5
|
+
import { GitHubAuthRow } from './settings/GitHubAuthRow';
|
|
5
6
|
import { readSavedSettings } from '../utils/settingsRequests';
|
|
6
7
|
import { NotificationChannelsSettings } from './NotificationChannelsSettings';
|
|
7
8
|
import { UtilityAgentPicker } from './UtilityAgentPicker';
|
|
8
9
|
import { MESSAGE_BOX_SIZES, setMessageBoxSize, useMessageBoxSize } from '../utils/messageBoxSize';
|
|
9
|
-
import { LAYOUT_MODES, setLayoutMode, useLayout } from '../layout/layoutRange';
|
|
10
|
+
import { AUTOMATIC_LAYOUT_DESCRIPTION, LAYOUT_MODES, setLayoutMode, useLayout } from '../layout/layoutRange';
|
|
10
11
|
import { UI_SCALES, DEFAULT_UI_SCALE, AUTO_HANDOFF_MAX_COMPACTIONS, AUTO_HANDOFF_MIN_COMPACTIONS, clampAutoHandoffCompactions } from '@arco/shared';
|
|
11
12
|
import { AppVersionSection } from './settings/AppVersionSection';
|
|
12
13
|
import { AppWindowBrowserSection } from './settings/AppWindowBrowserSection';
|
|
@@ -19,7 +20,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
19
20
|
import { useAppStore } from '../stores/appStore';
|
|
20
21
|
import { useStartupStore } from '../stores/startupStore';
|
|
21
22
|
import { useRecallStore } from '../stores/recallStore';
|
|
22
|
-
import {
|
|
23
|
+
import { ClaudeNativeAccounts } from './ClaudeNativeAuthRow';
|
|
23
24
|
import type { AuthStatus, AuthStatusByProvider, AuthLoginTarget, LoginSessionTarget, AuthLoginResult, ArcoSettings, ProviderName, ModelName, EffortLevel, ProviderAccountProfile, DiscoveredEndpoint, EndpointDiscoverResponse } from '@arco/shared';
|
|
24
25
|
import { activeProjectCwd } from '../utils/activeProject';
|
|
25
26
|
import { RunAsPicker, type RunAsSelection } from './RunAsPicker';
|
|
@@ -618,7 +619,7 @@ export function SettingsPanel({ onClose }: Props) {
|
|
|
618
619
|
<div role="radiogroup" aria-label="Layout" style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', marginBottom: '6px' }}>
|
|
619
620
|
{LAYOUT_MODES.map((m) => <button key={m.id} type="button" role="radio" aria-checked={layoutMode === m.id} data-testid={`layout-mode-${m.id}`} title={m.hint} style={{ padding: '5px 8px', color: 'var(--color-accent-primary)', background: 'var(--color-bg-sunken)', border: `1px solid ${layoutMode === m.id ? 'var(--color-accent-primary)' : 'var(--color-border-hairline)'}`, cursor: 'pointer' }} onClick={() => setLayoutMode(m.id)}>{m.label.toUpperCase()}</button>)}
|
|
620
621
|
</div>
|
|
621
|
-
<div style={{ fontSize: '10px', color: 'var(--color-fg-muted)', fontFamily: 'var(--font-body)', marginBottom: '14px', lineHeight: 1.5 }}>
|
|
622
|
+
<div style={{ fontSize: '10px', color: 'var(--color-fg-muted)', fontFamily: 'var(--font-body)', marginBottom: '14px', lineHeight: 1.5 }}>{AUTOMATIC_LAYOUT_DESCRIPTION} Standard, Compact and Narrow stay fixed at every width. Saved in this browser only.</div>
|
|
622
623
|
</div>
|
|
623
624
|
</SettingsSection>
|
|
624
625
|
<SettingsSection id="message-box-size">
|
|
@@ -899,7 +900,7 @@ export function SettingsPanel({ onClose }: Props) {
|
|
|
899
900
|
<span style={{ fontSize: '10px', color: 'var(--color-fg-muted)', fontFamily: 'var(--font-body)' }}>
|
|
900
901
|
Native and CLI are separate sign-ins. Native is the default transport for new work and needs its own sign-in.
|
|
901
902
|
</span>
|
|
902
|
-
<
|
|
903
|
+
<ClaudeNativeAccounts />
|
|
903
904
|
<ProviderRow
|
|
904
905
|
label="CLAUDE CLI (ANTHROPIC)"
|
|
905
906
|
provider="claude"
|
|
@@ -1284,8 +1285,7 @@ export function SettingsPanel({ onClose }: Props) {
|
|
|
1284
1285
|
variant="strata"
|
|
1285
1286
|
/>
|
|
1286
1287
|
</>)}
|
|
1287
|
-
<
|
|
1288
|
-
label="GITHUB (gh CLI)"
|
|
1288
|
+
<GitHubAuthRow
|
|
1289
1289
|
status={authStatus?.github}
|
|
1290
1290
|
loginPending={loginPending === 'github'}
|
|
1291
1291
|
onLogin={() => startLogin('github')}
|
|
@@ -2150,10 +2150,7 @@ function CodexProfilesSection() {
|
|
|
2150
2150
|
method: 'POST',
|
|
2151
2151
|
headers: { 'Content-Type': 'application/json' },
|
|
2152
2152
|
body: JSON.stringify({
|
|
2153
|
-
providerAccounts: {
|
|
2154
|
-
...(settings?.providerAccounts ?? {}),
|
|
2155
|
-
codex,
|
|
2156
|
-
},
|
|
2153
|
+
providerAccounts: { codex },
|
|
2157
2154
|
}),
|
|
2158
2155
|
});
|
|
2159
2156
|
if (!res.ok) {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ClaudeNativeAccountPicker } from './ClaudeNativeAccountPicker';
|
|
2
|
+
import { useClaudeNativeCatalogFor } from '../hooks/useClaudeNativeCatalog';
|
|
3
|
+
import { selectedClaudeTransport } from '../utils/claudeAuth';
|
|
1
4
|
import { useEffect, useState, type CSSProperties } from 'react';
|
|
2
5
|
import type { WorkflowConfig, ProviderName, ModelName, EffortLevel, ClusterMemberAccessMode, MemberTier, SpawnMemberIdentity } from '@arco/shared';
|
|
3
6
|
import { MEMBER_FOCUS_MAX, MEMBER_TIERS, ROLE_PRESETS, clusterDirectorProblem, isClusterDirector, presetForText } from '@arco/shared';
|
|
@@ -66,7 +69,8 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
66
69
|
const [providerAccountRef, setProviderAccountRef] = useState<string | undefined>(parentConfig.providerAccountRef);
|
|
67
70
|
// Account-scoped so the model list follows the selected Codex profile.
|
|
68
71
|
const codexCatalog = useCodexCatalogFor(providerAccountRef);
|
|
69
|
-
const
|
|
72
|
+
const claude = useClaudeNativeCatalogFor(provider === 'claude' ? providerAccountRef : undefined);
|
|
73
|
+
const catalogs = useModelCatalogs({ codex: codexCatalog, claude });
|
|
70
74
|
const { claude: claudeNativeCatalog, cursor: cursorCatalog } = catalogs;
|
|
71
75
|
const codexAccounts = settings?.providerAccounts?.codex ?? [];
|
|
72
76
|
const clusterState = useAppStore((s) => (clusterContext ? s.clusters[clusterContext.clusterId] : undefined));
|
|
@@ -99,6 +103,7 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
99
103
|
const roleProblem = asMember && isClusterDirector(role) && hasDirector ? clusterDirectorProblem(['Director', 'Director']) : null;
|
|
100
104
|
const effectiveName = asMember && !nameTouched ? nextMemberName(role, existingNames) : name;
|
|
101
105
|
useEffect(() => {
|
|
106
|
+
if (provider === 'claude') return;
|
|
102
107
|
if (provider !== 'codex') {
|
|
103
108
|
setProviderAccountRef(undefined);
|
|
104
109
|
return;
|
|
@@ -132,6 +137,9 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
132
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
138
|
}, [provider, model, catalogs]);
|
|
134
139
|
|
|
140
|
+
const native = provider === 'claude' && (accessMode === 'isolated' || selectedClaudeTransport(
|
|
141
|
+
parentConfig.claudeTransport, settings?.claude?.transport, parentConfig.ultracode,
|
|
142
|
+
) === 'native');
|
|
135
143
|
const submit = () => {
|
|
136
144
|
const newConfig: WorkflowConfig = {
|
|
137
145
|
...parentConfig,
|
|
@@ -142,7 +150,7 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
142
150
|
...(provider !== 'claude' ? { primaryProvider: provider } : { primaryProvider: undefined }),
|
|
143
151
|
primaryModel: model,
|
|
144
152
|
primaryEffort: effort,
|
|
145
|
-
providerAccountRef: provider === 'codex' ? providerAccountRef : undefined,
|
|
153
|
+
providerAccountRef: provider === 'codex' || native ? providerAccountRef : undefined,
|
|
146
154
|
resumeSessionId: undefined,
|
|
147
155
|
resumeWorkflowId: undefined,
|
|
148
156
|
...(asMember && accessMode === 'isolated' ? { primaryProvider: undefined, claudeTransport: 'native' as const, ultracode: false } : {}),
|
|
@@ -215,6 +223,8 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
215
223
|
}
|
|
216
224
|
if (p === 'codex') {
|
|
217
225
|
setProviderAccountRef(parentConfig.primaryProvider === 'codex' ? parentConfig.providerAccountRef : codexAccounts[0]?.id);
|
|
226
|
+
} else if (p === 'claude') {
|
|
227
|
+
setProviderAccountRef((parentConfig.primaryProvider ?? 'claude') === 'claude' ? parentConfig.providerAccountRef : undefined);
|
|
218
228
|
} else {
|
|
219
229
|
setProviderAccountRef(undefined);
|
|
220
230
|
}
|
|
@@ -227,7 +237,8 @@ export function SpawnDialog({ parentConfig, parentPlanTitle, initialDirection, i
|
|
|
227
237
|
</Row>
|
|
228
238
|
</Field>
|
|
229
239
|
|
|
230
|
-
{
|
|
240
|
+
{native && <ClaudeNativeAccountPicker value={providerAccountRef} onChange={setProviderAccountRef} />}
|
|
241
|
+
{provider === 'codex' && codexAccounts.length > 0 && (
|
|
231
242
|
<Field label="ACCOUNT" helpKey="spawn.account">
|
|
232
243
|
<Row>
|
|
233
244
|
{codexAccounts.map((account) => {
|
|
@@ -26,7 +26,7 @@ import { closeSummaryPlan } from '../recall/closeSummary';
|
|
|
26
26
|
import { TabContextMenu } from './TabContextMenu';
|
|
27
27
|
import { ScratchCloseDialog, type ScratchCloseTarget } from './ScratchCloseDialog';
|
|
28
28
|
import { ResearchCloseDialog } from './research/ResearchCloseDialog';
|
|
29
|
-
import type { ClusterMemberProvider, ClusterStatePayload, ArcoSettings, ProviderName } from '@arco/shared';
|
|
29
|
+
import type { ClusterMemberProvider, ClusterFreshMemberSpec, ClusterStatePayload, ArcoSettings, ProviderName } from '@arco/shared';
|
|
30
30
|
|
|
31
31
|
interface Props {
|
|
32
32
|
// Server-side lifecycle: tells the server to tear down the WorkflowState +
|
|
@@ -51,7 +51,7 @@ interface Props {
|
|
|
51
51
|
onCreateClusterWithFreshWorkers: (
|
|
52
52
|
sourceWorkflowId: string,
|
|
53
53
|
additionalCount: number,
|
|
54
|
-
opts?: { name?: string;
|
|
54
|
+
opts?: { name?: string; members?: ClusterFreshMemberSpec[] },
|
|
55
55
|
) => void;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
// ADD TO EXISTING — when at least one cluster shares the anchor's cwd,
|
|
10
10
|
// pick which cluster to join. Submit dispatches cluster_member_add. Only
|
|
11
11
|
// available when the anchor isn't already in a cluster.
|
|
12
|
-
// CREATE WITH FRESH —
|
|
13
|
-
//
|
|
14
|
-
//
|
|
12
|
+
// CREATE WITH FRESH — the default. Pick N (1–4) new workers, each with its
|
|
13
|
+
// own + ADD FRESH choices (FreshMemberForm), and an optional cluster name.
|
|
14
|
+
// Submit dispatches cluster_create_with_fresh_workers with one `members`
|
|
15
|
+
// entry per worker; the server creates N new workflows from the anchor's
|
|
16
|
+
// cwd and settings, applies each entry, then creates the cluster.
|
|
15
17
|
//
|
|
16
18
|
// The Native-only fence (every member must be Native Claude) is enforced
|
|
17
19
|
// server-side in all three paths; the UI scopes candidates so the operator
|
|
@@ -20,10 +22,9 @@
|
|
|
20
22
|
import { useEffect, useMemo, useState } from 'react';
|
|
21
23
|
import { useAppStore } from '../stores/appStore';
|
|
22
24
|
import { clusterDisplayName } from './TabBar';
|
|
23
|
-
import {
|
|
24
|
-
import type {
|
|
25
|
-
import {
|
|
26
|
-
import { CursorModelSelect } from './CursorModelSelect';
|
|
25
|
+
import { isClusterDirector, isClusterMemberProvider } from '@arco/shared';
|
|
26
|
+
import type { ClusterFreshMemberSpec } from '@arco/shared';
|
|
27
|
+
import { FreshMemberForm, type FreshMemberValue } from './ClusterRightPanel/FreshMemberForm';
|
|
27
28
|
|
|
28
29
|
type Mode = 'create-existing' | 'add-existing' | 'create-fresh';
|
|
29
30
|
|
|
@@ -44,7 +45,7 @@ interface Props {
|
|
|
44
45
|
onCreateClusterWithFreshWorkers: (
|
|
45
46
|
sourceWorkflowId: string,
|
|
46
47
|
additionalCount: number,
|
|
47
|
-
opts?: { name?: string;
|
|
48
|
+
opts?: { name?: string; members?: ClusterFreshMemberSpec[] },
|
|
48
49
|
) => void;
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -110,17 +111,17 @@ export function TabContextMenu({
|
|
|
110
111
|
});
|
|
111
112
|
}, [clusters, anchor]);
|
|
112
113
|
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
|
|
116
|
-
const initialMode: Mode = addCandidates.length > 0 ? 'add-existing' : 'create-existing';
|
|
117
|
-
const [mode, setMode] = useState<Mode>(initialMode);
|
|
114
|
+
// The menu opens on CREATE WITH FRESH with one fresh worker; the other modes
|
|
115
|
+
// stay one click away.
|
|
116
|
+
const [mode, setMode] = useState<Mode>('create-fresh');
|
|
118
117
|
const [selected, setSelected] = useState<Set<string>>(new Set());
|
|
119
118
|
const [pickedClusterId, setPickedClusterId] = useState<string>(addCandidates[0]?.clusterId ?? '');
|
|
120
|
-
const [freshCount, setFreshCount] = useState<number>(
|
|
119
|
+
const [freshCount, setFreshCount] = useState<number>(1);
|
|
121
120
|
const [freshName, setFreshName] = useState<string>('');
|
|
122
|
-
|
|
123
|
-
const
|
|
121
|
+
// One value per worker card; cards past freshCount are ignored.
|
|
122
|
+
const [freshValues, setFreshValues] = useState<FreshMemberValue[]>([]);
|
|
123
|
+
const freshShown = freshValues.slice(0, freshCount);
|
|
124
|
+
const directorAt = freshShown.findIndex((v) => isClusterDirector(v?.opts.role));
|
|
124
125
|
|
|
125
126
|
if (!anchor) {
|
|
126
127
|
onClose();
|
|
@@ -153,24 +154,18 @@ export function TabContextMenu({
|
|
|
153
154
|
onClose();
|
|
154
155
|
return;
|
|
155
156
|
}
|
|
156
|
-
// create-fresh —
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
if (freshProvider !== (anchor.config.primaryProvider ?? 'claude')) opts.provider = freshProvider;
|
|
162
|
-
if (freshModel && freshModel !== anchorModel) opts.model = freshModel;
|
|
163
|
-
if (freshEffort && freshEffort !== anchorEffort) opts.effort = freshEffort;
|
|
164
|
-
if (freshProvider === 'codex' && freshAccountRef && freshAccountRef !== anchorAccountRef) opts.providerAccountRef = freshAccountRef;
|
|
165
|
-
onCreateClusterWithFreshWorkers(anchor.id, freshCount, Object.keys(opts).length > 0 ? opts : undefined);
|
|
157
|
+
// create-fresh — one entry per worker card. Fields a card leaves at the
|
|
158
|
+
// anchor's value are not sent, so the server keeps the anchor's.
|
|
159
|
+
if (freshSubmitBlocked) return;
|
|
160
|
+
const name = freshName.trim();
|
|
161
|
+
onCreateClusterWithFreshWorkers(anchor.id, freshCount, { ...(name ? { name } : {}), members: freshShown.map((v) => v.opts) });
|
|
166
162
|
onClose();
|
|
167
163
|
};
|
|
168
164
|
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
// SPAWN action so the rejection path is reserved for protocol bugs).
|
|
165
|
+
// Every card must be ready (a model, an available provider and sandbox) and
|
|
166
|
+
// at most one card may be the Director. The server checks the same.
|
|
172
167
|
const freshSubmitBlocked = mode === 'create-fresh'
|
|
173
|
-
&& (
|
|
168
|
+
&& (freshShown.length < freshCount || freshShown.some((v) => !v?.ready) || freshShown.filter((v) => isClusterDirector(v?.opts.role)).length > 1);
|
|
174
169
|
|
|
175
170
|
const submitDisabled =
|
|
176
171
|
!anchorIsNative
|
|
@@ -332,97 +327,35 @@ export function TabContextMenu({
|
|
|
332
327
|
) : (
|
|
333
328
|
// create-fresh
|
|
334
329
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
|
335
|
-
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
</div>
|
|
345
|
-
{freshProvider === 'antigravity-cli' && <div role="note">{GEMINI_MEMBER_CHOICE_NOTE}</div>}
|
|
346
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)' }}>
|
|
347
|
-
<span style={{ minWidth: '90px' }}>MODEL</span>
|
|
348
|
-
{freshProvider === 'cursor' && cursorCatalog?.models?.length ? <CursorModelSelect value={freshModel} onChange={setFreshModel} selectStyle={{ background: 'var(--color-bg-sunken)', color: 'var(--color-fg)', minWidth: 120 }} /> : <select
|
|
349
|
-
data-help="cluster.fresh.model"
|
|
350
|
-
value={freshModel}
|
|
351
|
-
onChange={(e) => setFreshModel(e.target.value)}
|
|
352
|
-
className="display-font"
|
|
330
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)', flexWrap: 'wrap' }}>
|
|
331
|
+
<span data-help="cluster.fresh.cluster-name">CLUSTER NAME</span>
|
|
332
|
+
<input
|
|
333
|
+
value={freshName}
|
|
334
|
+
onChange={(e) => setFreshName(e.target.value)}
|
|
335
|
+
placeholder={`(default: ${anchor.config.workingDirectory.split(/[/\\]/).filter(Boolean).pop() ?? ''} · <id>)`}
|
|
336
|
+
maxLength={64}
|
|
337
|
+
aria-label="Cluster name"
|
|
338
|
+
data-help="cluster.fresh.cluster-name"
|
|
353
339
|
style={{
|
|
354
340
|
flex: 1,
|
|
341
|
+
minWidth: '140px',
|
|
355
342
|
background: 'var(--color-bg-sunken)',
|
|
356
343
|
border: '1px solid var(--color-border-hairline)',
|
|
357
344
|
color: 'var(--color-fg)',
|
|
358
|
-
padding: '
|
|
359
|
-
fontSize: '
|
|
360
|
-
fontFamily: 'var(--font-code)',
|
|
345
|
+
padding: '6px 10px',
|
|
346
|
+
fontSize: '12px',
|
|
361
347
|
}}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
</select>}
|
|
368
|
-
</div>
|
|
369
|
-
{freshProvider === 'codex' && codexAccounts.length > 0 && (
|
|
370
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)' }}>
|
|
371
|
-
<span style={{ minWidth: '90px' }}>ACCOUNT</span>
|
|
372
|
-
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap' }}>
|
|
373
|
-
{codexAccounts.map((acct) => {
|
|
374
|
-
const short = (acct.shortLabel || acct.label || acct.id).slice(0, 4).toUpperCase();
|
|
375
|
-
return (
|
|
376
|
-
<button
|
|
377
|
-
key={acct.id}
|
|
378
|
-
onClick={() => setFreshAccountRef(acct.id)}
|
|
379
|
-
className="display-font"
|
|
380
|
-
style={{
|
|
381
|
-
padding: '4px 10px',
|
|
382
|
-
background: freshAccountRef === acct.id ? 'var(--color-accent-primary-a10)' : 'transparent',
|
|
383
|
-
border: `1px solid ${freshAccountRef === acct.id ? 'var(--color-accent-primary)' : 'var(--color-border-hairline)'}`,
|
|
384
|
-
color: freshAccountRef === acct.id ? 'var(--color-accent-primary)' : 'var(--color-fg-muted)',
|
|
385
|
-
cursor: 'pointer',
|
|
386
|
-
fontSize: '11px',
|
|
387
|
-
}}
|
|
388
|
-
>
|
|
389
|
-
{acct.label.toUpperCase()} [{short}]
|
|
390
|
-
</button>
|
|
391
|
-
);
|
|
392
|
-
})}
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
|
-
)}
|
|
396
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)' }}>
|
|
397
|
-
<span style={{ minWidth: '90px' }}>EFFORT</span>
|
|
398
|
-
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap' }}>
|
|
399
|
-
{freshEffortOptions.length === 0 && <span>{freshProvider === 'cursor' ? 'BAKED INTO MODEL' : 'LOCAL MODEL'}</span>}
|
|
400
|
-
{freshEffortOptions.map((e) => (
|
|
401
|
-
<button
|
|
402
|
-
key={e}
|
|
403
|
-
data-help="cluster.fresh.effort"
|
|
404
|
-
onClick={() => setFreshEffort(e)}
|
|
405
|
-
className="display-font"
|
|
406
|
-
style={{
|
|
407
|
-
padding: '4px 10px',
|
|
408
|
-
background: freshEffort === e ? 'var(--color-accent-primary-a10)' : 'transparent',
|
|
409
|
-
border: `1px solid ${freshEffort === e ? 'var(--color-accent-primary)' : 'var(--color-border-hairline)'}`,
|
|
410
|
-
color: freshEffort === e ? 'var(--color-accent-primary)' : 'var(--color-fg-muted)',
|
|
411
|
-
cursor: 'pointer',
|
|
412
|
-
fontSize: '11px',
|
|
413
|
-
}}
|
|
414
|
-
>
|
|
415
|
-
{e.toUpperCase()}
|
|
416
|
-
</button>
|
|
417
|
-
))}
|
|
418
|
-
</div>
|
|
419
|
-
</div>
|
|
420
|
-
<label style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)' }}>
|
|
421
|
-
FRESH WORKERS
|
|
422
|
-
<div style={{ display: 'flex', gap: '6px' }}>
|
|
348
|
+
/>
|
|
349
|
+
</label>
|
|
350
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', fontSize: '11px', color: 'var(--color-fg-muted)', flexWrap: 'wrap' }}>
|
|
351
|
+
<span data-help="cluster.fresh.count">FRESH WORKERS</span>
|
|
352
|
+
<div role="group" aria-label="Fresh workers" style={{ display: 'flex', gap: '6px' }}>
|
|
423
353
|
{[1, 2, 3, 4].map((n) => (
|
|
424
354
|
<button
|
|
425
355
|
key={n}
|
|
356
|
+
type="button"
|
|
357
|
+
aria-pressed={freshCount === n}
|
|
358
|
+
data-help="cluster.fresh.count"
|
|
426
359
|
onClick={() => setFreshCount(n)}
|
|
427
360
|
className="display-font"
|
|
428
361
|
style={{
|
|
@@ -441,28 +374,35 @@ export function TabContextMenu({
|
|
|
441
374
|
<span style={{ marginLeft: 'auto', color: 'var(--color-fg-muted)', fontSize: '10px' }}>
|
|
442
375
|
{`${freshCount + 1} members total (1 anchor + ${freshCount} fresh)`}
|
|
443
376
|
</span>
|
|
444
|
-
</
|
|
445
|
-
<
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
377
|
+
</div>
|
|
378
|
+
<div data-testid="create-fresh-anchor" style={{ padding: '6px 8px', border: '1px dashed var(--color-border-hairline)', fontSize: '11px', color: 'var(--color-fg-muted)' }}>
|
|
379
|
+
ANCHOR <span style={{ color: 'var(--color-fg)' }}>{anchor.config.name.toUpperCase()}</span> joins as it is and keeps its conversation.
|
|
380
|
+
</div>
|
|
381
|
+
{Array.from({ length: freshCount }, (_, i) => (
|
|
382
|
+
<section
|
|
383
|
+
key={i}
|
|
384
|
+
aria-label={`Fresh worker ${i + 1}`}
|
|
385
|
+
data-testid={`create-fresh-worker-${i + 1}`}
|
|
386
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '6px', padding: '8px', border: '1px solid var(--color-border-hairline)', fontSize: '11px' }}
|
|
387
|
+
>
|
|
388
|
+
<div className="display-font" style={{ fontSize: '10px', letterSpacing: '1px', color: 'var(--color-accent-primary)' }}>
|
|
389
|
+
FRESH WORKER {i + 1}
|
|
390
|
+
</div>
|
|
391
|
+
<FreshMemberForm
|
|
392
|
+
templateConfig={anchor.config}
|
|
393
|
+
clusterDefault={null}
|
|
394
|
+
testId={`create-fresh-${i + 1}`}
|
|
395
|
+
directorBlocked={directorAt >= 0 && directorAt !== i}
|
|
396
|
+
nameMaxLength={64}
|
|
397
|
+
namePlaceholder={`default: ${(anchor.config.name || 'Worker')} #${i + 2}`}
|
|
398
|
+
onChange={(value) => setFreshValues((prev) => { const next = [...prev]; next[i] = value; return next; })}
|
|
399
|
+
/>
|
|
400
|
+
</section>
|
|
401
|
+
))}
|
|
462
402
|
<div style={{ fontSize: '10px', color: 'var(--color-fg-muted)' }}>
|
|
463
|
-
Each fresh worker
|
|
464
|
-
|
|
465
|
-
|
|
403
|
+
Each fresh worker starts from the anchor's folder and settings.
|
|
404
|
+
Change any worker's choices above; the cluster name is separate
|
|
405
|
+
from the worker names.
|
|
466
406
|
</div>
|
|
467
407
|
</div>
|
|
468
408
|
)}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useClaudeNativeCatalogFor } from '../hooks/useClaudeNativeCatalog';
|
|
1
2
|
import { MobileQuestionBar } from './MobileQuestionBar';
|
|
2
3
|
import { DirectorContinuePrompt } from './DirectorContinuePrompt';
|
|
3
4
|
import { PhoneUploadButton } from './PhoneUpload';
|
|
@@ -53,8 +54,8 @@ import { useLayout, useLayoutRange } from '../layout/layoutRange';
|
|
|
53
54
|
import { ToolbarMore, useToolbarOverflow } from '../layout/ToolbarOverflow';
|
|
54
55
|
import { useKeepInWindow } from '../layout/keepInWindow';
|
|
55
56
|
|
|
56
|
-
// FILE, PLAN and
|
|
57
|
-
const TOOLBAR_KEEP: ReadonlySet<string> = new Set(['composer.attach', 'composer.upload-from-phone', 'composer.plan', 'composer.brief']);
|
|
57
|
+
// FILE, PLAN, BRIEF and pending questions stay on the composer line in every layout.
|
|
58
|
+
const TOOLBAR_KEEP: ReadonlySet<string> = new Set(['composer.attach', 'composer.upload-from-phone', 'composer.plan', 'composer.brief', 'composer.questions']);
|
|
58
59
|
|
|
59
60
|
export interface Props {
|
|
60
61
|
job: JobState;
|
|
@@ -643,7 +644,7 @@ export function TerminalInput({ job, researchProject = false, onSend, onCancel,
|
|
|
643
644
|
// see whether the next turn will hit a cold-start (~20-30s for a fresh
|
|
644
645
|
// GGUF load) or fast-path against an already-loaded model.
|
|
645
646
|
const llamacppLive = useAppStore((s) => s.llamacppLive);
|
|
646
|
-
const claudeNativeCatalog =
|
|
647
|
+
const claudeNativeCatalog = useClaudeNativeCatalogFor((job.config.primaryProvider ?? 'claude') === 'claude' ? job.config.providerAccountRef : undefined);
|
|
647
648
|
// Account-scoped so the composer MODEL picker shows this tab's Codex
|
|
648
649
|
// profile's entitlements (HOME vs WORK).
|
|
649
650
|
const codexCatalog = useCodexCatalogFor(job.config.providerAccountRef);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ClaudeNativeAccountPicker } from './ClaudeNativeAccountPicker';
|
|
2
|
+
import { useClaudeNativeCatalogFor } from '../hooks/useClaudeNativeCatalog';
|
|
3
|
+
import { selectedClaudeTransport } from '../utils/claudeAuth';
|
|
1
4
|
import { useEffect, useRef, useState, type CSSProperties } from 'react';
|
|
2
5
|
import { PRIMARY_PROVIDERS, TERMINAL_CODEX_ACCOUNT, type EffortLevel, type ProviderName, type TranscriptWorkerPreview } from '@arco/shared';
|
|
3
6
|
import { useAppStore } from '../stores/appStore';
|
|
@@ -29,7 +32,7 @@ export function TranscriptWorkerDialog({ workflowId, onCancel, onMembers }: { wo
|
|
|
29
32
|
const [provider, setProvider] = useState<ProviderName>(sourceProvider);
|
|
30
33
|
const [model, setModel] = useState(String(job?.config.primaryModel ?? ''));
|
|
31
34
|
const [effort, setEffort] = useState<EffortLevel>(capDefaultEffort(job?.config.primaryEffort ?? 'medium'));
|
|
32
|
-
const [account, setAccount] = useState(sourceProvider === 'codex' ? job?.config.providerAccountRef ?? '' : '');
|
|
35
|
+
const [account, setAccount] = useState(sourceProvider === 'codex' || sourceProvider === 'claude' ? job?.config.providerAccountRef ?? '' : '');
|
|
33
36
|
const [skipPermissions, setSkipPermissions] = useState(false);
|
|
34
37
|
const [preview, setPreview] = useState<TranscriptWorkerPreview | null>(null);
|
|
35
38
|
const [previewInput, setPreviewInput] = useState('');
|
|
@@ -38,7 +41,13 @@ export function TranscriptWorkerDialog({ workflowId, onCancel, onMembers }: { wo
|
|
|
38
41
|
const alive = useRef(true);
|
|
39
42
|
useEffect(() => { alive.current = true; return () => { alive.current = false; }; }, []);
|
|
40
43
|
const codexCatalog = useCodexCatalogFor(account || undefined);
|
|
41
|
-
const
|
|
44
|
+
const native = provider === 'claude' && selectedClaudeTransport(
|
|
45
|
+
sourceProvider === 'claude' ? job?.config.claudeTransport : undefined,
|
|
46
|
+
settings?.claude?.transport,
|
|
47
|
+
sourceProvider === 'claude' && job?.config.ultracode,
|
|
48
|
+
) === 'native';
|
|
49
|
+
const claude = useClaudeNativeCatalogFor(native ? account || undefined : undefined);
|
|
50
|
+
const catalogs = useModelCatalogs({ codex: codexCatalog, claude });
|
|
42
51
|
const models = modelsForProvider(provider, catalogs).map(String);
|
|
43
52
|
if (provider === sourceProvider && job?.config.primaryModel && !models.includes(String(job.config.primaryModel))) models.unshift(String(job.config.primaryModel));
|
|
44
53
|
const effortOptions = effortsForModel(provider, model, catalogs.claude, codexCatalog);
|
|
@@ -68,7 +77,7 @@ export function TranscriptWorkerDialog({ workflowId, onCancel, onMembers }: { wo
|
|
|
68
77
|
setPhase('create'); setError('');
|
|
69
78
|
try {
|
|
70
79
|
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 } });
|
|
80
|
+
destination: { workingDirectory: directory, name, provider, model, effort, ...((provider === 'codex' || native) && account ? { providerAccountRef: account } : {}), skipPermissions } });
|
|
72
81
|
if (alive.current) {
|
|
73
82
|
if (!result.newWorkflowId) throw new Error('The worker could not be created. Refresh the preview.');
|
|
74
83
|
useAppStore.getState().setActiveJob(result.newWorkflowId);
|
|
@@ -99,13 +108,14 @@ export function TranscriptWorkerDialog({ workflowId, onCancel, onMembers }: { wo
|
|
|
99
108
|
{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
109
|
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '10px' }}>
|
|
101
110
|
<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('');
|
|
111
|
+
const next = event.target.value as ProviderName; setProvider(next); setModel(defaultModelForProvider(next, catalogs)); setAccount(next === sourceProvider ? job?.config.providerAccountRef ?? '' : '');
|
|
103
112
|
}} 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
113
|
<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
114
|
<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
115
|
</div>
|
|
107
116
|
{!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
117
|
{!models.length && <p role="status">No models are available for this provider. Choose another provider or configure it in Settings.</p>}
|
|
118
|
+
{native && <ClaudeNativeAccountPicker value={account || undefined} onChange={setAccount} disabled={!!phase} style={field} />}
|
|
109
119
|
{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
120
|
<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
121
|
</select></label>}
|
|
@@ -4,8 +4,8 @@ import { useAppStore } from '../stores/appStore';
|
|
|
4
4
|
import { formatTokens } from './RightPanel/format';
|
|
5
5
|
import { CursorIncludedGauge } from './CursorIncludedGauge';
|
|
6
6
|
import { formatResetLabel, formatResetText } from '../utils/usageFormat';
|
|
7
|
-
import type
|
|
8
|
-
import { claudeAuthPresentation, selectedClaudeTransport } from '../utils/claudeAuth';
|
|
7
|
+
import { DEFAULT_CLAUDE_NATIVE_ACCOUNT, type CodexUsageInfo, type CursorUsageInfo, type UsageInfo } from '@arco/shared';
|
|
8
|
+
import { claudeAuthPresentation, nativeAccountStatus, selectedClaudeTransport } from '../utils/claudeAuth';
|
|
9
9
|
import { refreshClaudeAllowance } from '../utils/claudeAllowance';
|
|
10
10
|
import { dismissProviderHovers, useProviderHover } from './providerPanelState';
|
|
11
11
|
import { useKeepInWindow } from '../layout/keepInWindow';
|
|
@@ -29,16 +29,15 @@ export function UsageBar({ usage }: Props) {
|
|
|
29
29
|
const cursorUsage = useAppStore((s) => s.cursorUsage);
|
|
30
30
|
const settings = useAppStore((s) => s.settings);
|
|
31
31
|
const capabilities = useAppStore((s) => s.capabilities);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return (config?.primaryProvider ?? 'claude') === 'claude' && config?.ultracode === true;
|
|
36
|
-
});
|
|
37
|
-
const codexAccount = useAppStore(s => {
|
|
38
|
-
const config = s.activeJobId ? s.jobs[s.activeJobId]?.config : undefined;
|
|
39
|
-
return config?.primaryProvider === 'codex' ? config.providerAccountRef : undefined;
|
|
32
|
+
const activeConfig = useAppStore(s => {
|
|
33
|
+
const id = s.activeJobId ?? (s.activeClusterId ? s.clusterFocusedMember[s.activeClusterId] : undefined);
|
|
34
|
+
return id ? s.jobs[id]?.config : undefined;
|
|
40
35
|
});
|
|
41
|
-
const
|
|
36
|
+
const claudeConfig = (activeConfig?.primaryProvider ?? 'claude') === 'claude' ? activeConfig : undefined;
|
|
37
|
+
const claudeTransport = selectedClaudeTransport(claudeConfig?.claudeTransport, settings?.claude?.transport, claudeConfig?.ultracode);
|
|
38
|
+
const codexAccount = activeConfig?.primaryProvider === 'codex' ? activeConfig.providerAccountRef : undefined;
|
|
39
|
+
const claudeAccount = claudeTransport === 'native' ? claudeConfig?.providerAccountRef : undefined;
|
|
40
|
+
const input = { auth: authStatus, capabilities, claudeTransport, codexAccount, claudeAccount };
|
|
42
41
|
// An enabled provider keeps its slot whatever its state; a disabled one
|
|
43
42
|
// disappears, as in the Versions list. Only a ready provider shows usage.
|
|
44
43
|
const slot = (provider: 'claude' | 'codex' | 'cursor' | 'antigravity-cli', ready: () => ReactElement) => {
|
|
@@ -49,7 +48,7 @@ export function UsageBar({ usage }: Props) {
|
|
|
49
48
|
|
|
50
49
|
return (
|
|
51
50
|
<div data-help="header.live-status" style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
|
52
|
-
{slot('claude', () => <ClaudeStatus usage={usage} />)}
|
|
51
|
+
{slot('claude', () => <ClaudeStatus key={claudeAccount ?? 'global'} usage={claudeAccount ? null : usage} account={claudeAccount} />)}
|
|
53
52
|
{slot('codex', () => <CodexStatus usage={codexUsage} />)}
|
|
54
53
|
{slot('cursor', () => <CursorStatus usage={cursorUsage} />)}
|
|
55
54
|
{slot('antigravity-cli', () => <AntigravityStatus />)}
|
|
@@ -445,7 +444,14 @@ function parseCodexUsageValue(value: string): { usedPercent: number | null; rese
|
|
|
445
444
|
|
|
446
445
|
// Claude's dot opens session + weekly utilization bars with reset times on
|
|
447
446
|
// hover — same content the old boxed pill carried, now behind the compact dot.
|
|
448
|
-
function ClaudeStatus({ usage }: { usage: UsageInfo | null }) {
|
|
447
|
+
function ClaudeStatus({ usage: globalUsage, account }: { usage: UsageInfo | null; account?: string }) {
|
|
448
|
+
const [profileUsage, setProfileUsage] = useState<UsageInfo | null>(null);
|
|
449
|
+
const nativeStatus = useAppStore(s => nativeAccountStatus(s.authStatus?.claude, account));
|
|
450
|
+
const usage = account
|
|
451
|
+
? profileUsage?.binding?.revision === nativeStatus?.binding.revision || !profileUsage?.binding ? profileUsage : null
|
|
452
|
+
: globalUsage;
|
|
453
|
+
const accountLabel = useAppStore(s => account === DEFAULT_CLAUDE_NATIVE_ACCOUNT ? 'Default'
|
|
454
|
+
: s.settings?.providerAccounts?.claudeNative?.find(p => p.id === account)?.label);
|
|
449
455
|
const [open, setOpen] = useProviderHover();
|
|
450
456
|
const placeRef = useKeepInWindow();
|
|
451
457
|
const [checking, setChecking] = useState(false);
|
|
@@ -456,7 +462,16 @@ function ClaudeStatus({ usage }: { usage: UsageInfo | null }) {
|
|
|
456
462
|
if (checkingRef.current) return;
|
|
457
463
|
checkingRef.current = true;
|
|
458
464
|
setChecking(true); setCheckError(false);
|
|
459
|
-
try {
|
|
465
|
+
try {
|
|
466
|
+
if (account) {
|
|
467
|
+
const response = await fetch(`/api/usage?force=1&account=${encodeURIComponent(account)}`, { cache: 'no-store' });
|
|
468
|
+
if (!response.ok) throw new Error('Allowance check failed');
|
|
469
|
+
setProfileUsage(await response.json() as UsageInfo);
|
|
470
|
+
} else {
|
|
471
|
+
const next = await refreshClaudeAllowance(true);
|
|
472
|
+
if (next) setUsage(next);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
460
475
|
catch { setCheckError(true); }
|
|
461
476
|
finally { checkingRef.current = false; setChecking(false); }
|
|
462
477
|
};
|
|
@@ -464,11 +479,15 @@ function ClaudeStatus({ usage }: { usage: UsageInfo | null }) {
|
|
|
464
479
|
const tabTransport = useAppStore(s => s.activeJobId ? s.jobs[s.activeJobId]?.config.claudeTransport : undefined);
|
|
465
480
|
const settingTransport = useAppStore(s => s.settings?.claude?.transport);
|
|
466
481
|
const forceCli = useAppStore(s => {
|
|
467
|
-
const
|
|
482
|
+
const id = s.activeJobId ?? (s.activeClusterId ? s.clusterFocusedMember[s.activeClusterId] : undefined);
|
|
483
|
+
const config = id ? s.jobs[id]?.config : undefined;
|
|
468
484
|
return (config?.primaryProvider ?? 'claude') === 'claude' && config?.ultracode === true;
|
|
469
485
|
});
|
|
470
|
-
const transport = selectedClaudeTransport(tabTransport, settingTransport, forceCli);
|
|
471
|
-
const status = claudeAuthPresentation(auth, transport);
|
|
486
|
+
const transport = account ? 'native' : selectedClaudeTransport(tabTransport, settingTransport, forceCli);
|
|
487
|
+
const status = claudeAuthPresentation(account && auth ? { ...auth, native: nativeStatus } : auth, transport);
|
|
488
|
+
useEffect(() => {
|
|
489
|
+
if (open && account) void refresh();
|
|
490
|
+
}, [open, account, nativeStatus?.binding.revision]);
|
|
472
491
|
const showUsage = !!(usage && (!usage.error || usage.stale) && (usage.session || usage.weekly));
|
|
473
492
|
const sessionPct = usage?.session ? Math.round(Math.min(Math.max(usage.session.utilization, 0), 100)) : null;
|
|
474
493
|
return (
|
|
@@ -506,7 +525,7 @@ function ClaudeStatus({ usage }: { usage: UsageInfo | null }) {
|
|
|
506
525
|
}}
|
|
507
526
|
>
|
|
508
527
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '6px', fontSize: '11px' }}>
|
|
509
|
-
<UsageTitle name=
|
|
528
|
+
<UsageTitle name={accountLabel ? `Claude Native - ${accountLabel}` : 'Claude'} onRefresh={refresh} busy={checking} failed={checkError} />
|
|
510
529
|
{showUsage && usage ? (
|
|
511
530
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
512
531
|
{usage.session && (
|