arco-workbench 0.2.4 → 0.2.6
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-CHXVFLGT.js → PhosphorBackdrop-YsHTmZJh.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-Bhs4I9jA.js → ThemedBackgroundShaderImpl-BEjpgoBW.js} +1 -1
- package/client/dist/assets/{XtermView-CdfurwFx.js → XtermView-wh7jNKvk.js} +1 -1
- package/client/dist/assets/{galleryEditor-DYjZZ4cf.js → galleryEditor-CaOS2mmM.js} +1 -1
- package/client/dist/assets/{index-BjDmFvqG.js → index-j68SfA-l.js} +271 -271
- package/client/dist/index.html +1 -1
- 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 +5 -9
- 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/UpdateAction.tsx +30 -7
- 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/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 +11 -4
- package/client/src/help/content/misc.tsx +7 -5
- package/client/src/help/content/rightPanel.tsx +8 -4
- package/client/src/help/content/settings.tsx +15 -4
- 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 +20 -14
- 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 +31 -0
- package/client/src/help/manualSections/powerFeatures.tsx +1 -0
- 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 +4 -5
- 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/CLIENT.md +10 -5
- 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 +54 -23
- package/docs/OPERATIONS.md +17 -1
- 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 +46 -9
- package/docs/RESEARCH.md +1 -1
- 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/geminiMembers.d.ts +7 -1
- package/server/dist/geminiMembers.js +28 -14
- 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 +40 -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/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/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 +33 -18
- 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/geminiMembers.ts +26 -15
- 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 +38 -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/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/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 +32 -17
- 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
|
@@ -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 && (
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ClaudeNativeAccountPicker } from '../ClaudeNativeAccountPicker';
|
|
2
|
+
import { useClaudeNativeCatalogFor } from '../../hooks/useClaudeNativeCatalog';
|
|
3
|
+
import { selectedClaudeTransport } from '../../utils/claudeAuth';
|
|
1
4
|
import { DEFAULT_CODEX_MODEL, MEMBER_TIERS, OUTPUT_STYLES, ROLE_PRESETS, presetForText, isClusterDirector, clusterDirectorProblem } from '@arco/shared';
|
|
2
5
|
import type { ModelName, MemberTier, ClusterMemberProvider } from '@arco/shared';
|
|
3
6
|
import { effortsForModel } from '../../utils/format';
|
|
@@ -38,6 +41,7 @@ export function ClusterMembersSection({
|
|
|
38
41
|
inputStyle,
|
|
39
42
|
hintStyle,
|
|
40
43
|
}: ClusterMembersSectionProps) {
|
|
44
|
+
const settings = useAppStore(s => s.settings);
|
|
41
45
|
const cursorCatalog = useAppStore((s) => s.cursorCatalog);
|
|
42
46
|
const authStatus = useAppStore((s) => s.authStatus);
|
|
43
47
|
const isProviderEnabled = useAppStore((s) => s.isProviderEnabled);
|
|
@@ -109,7 +113,9 @@ export function ClusterMembersSection({
|
|
|
109
113
|
const modelLabel = String(m.model).trim() ? String(m.model).toUpperCase() : 'No model chosen';
|
|
110
114
|
const effortLabel = m.effort ? `${m.effort} effort` : 'default effort';
|
|
111
115
|
const providerLabel = `${MEMBER_PROVIDER_NAMES[m.provider] ?? m.provider}${available(m.provider) ? '' : ' (not connected)'}`;
|
|
112
|
-
const
|
|
116
|
+
const native = m.provider === 'claude' && selectedClaudeTransport(m.claudeTransport, m.accessMode === 'isolated' ? 'native' : settings?.claude?.transport) === 'native';
|
|
117
|
+
const account = m.provider === 'codex' ? codexAccounts.find((a) => a.id === m.providerAccountRef)
|
|
118
|
+
: native ? settings?.providerAccounts?.claudeNative?.find(a => a.id === m.providerAccountRef) : undefined;
|
|
113
119
|
const accountLabel = account ? (account.shortLabel || account.label || account.id).toUpperCase() : undefined;
|
|
114
120
|
return (
|
|
115
121
|
<div
|
|
@@ -262,7 +268,7 @@ export function ClusterMembersSection({
|
|
|
262
268
|
onUpdateMember(m.key, {
|
|
263
269
|
provider: p,
|
|
264
270
|
model: nextModel,
|
|
265
|
-
providerAccountRef: p === 'codex' ?
|
|
271
|
+
providerAccountRef: p === 'codex' ? codexAccounts[0]?.id : undefined,
|
|
266
272
|
});
|
|
267
273
|
}}
|
|
268
274
|
style={{ ...selectStyle(m.provider === p), flex: 1, textAlign: 'center', padding: '6px 8px' }}
|
|
@@ -298,10 +304,16 @@ export function ClusterMembersSection({
|
|
|
298
304
|
</div>
|
|
299
305
|
)}
|
|
300
306
|
|
|
307
|
+
{native && <ClaudeNativeAccountPicker value={m.providerAccountRef} labelStyle={labelStyle} style={inputStyle}
|
|
308
|
+
onChange={providerAccountRef => onUpdateMember(m.key, { providerAccountRef, model: 'sonnet', claudeTransport: 'native' })} />}
|
|
309
|
+
|
|
301
310
|
{/* MODEL */}
|
|
302
311
|
<div>
|
|
303
312
|
<label className="display-font" style={labelStyle}>MODEL</label>
|
|
304
|
-
{
|
|
313
|
+
{native && m.providerAccountRef ? (
|
|
314
|
+
<ClaudeNativeMemberModel accountRef={m.providerAccountRef} model={m.model} style={inputStyle}
|
|
315
|
+
onChange={model => onUpdateMember(m.key, { model })} />
|
|
316
|
+
) : m.provider === 'cursor' && cursorCatalog?.models?.length ? (
|
|
305
317
|
// Cursor: family × effort × flags (effort baked into the id).
|
|
306
318
|
<CursorModelSelect
|
|
307
319
|
value={String(m.model)}
|
|
@@ -498,3 +510,17 @@ export function ClusterMembersSection({
|
|
|
498
510
|
</div>
|
|
499
511
|
);
|
|
500
512
|
}
|
|
513
|
+
|
|
514
|
+
function ClaudeNativeMemberModel({ accountRef, model, onChange, style }: {
|
|
515
|
+
accountRef: string;
|
|
516
|
+
model: ModelName;
|
|
517
|
+
onChange: (model: ModelName) => void;
|
|
518
|
+
style: React.CSSProperties;
|
|
519
|
+
}) {
|
|
520
|
+
const catalog = useClaudeNativeCatalogFor(accountRef);
|
|
521
|
+
const entries = catalog?.models ?? [];
|
|
522
|
+
return <select aria-label="Model" style={style} value={model} onChange={event => onChange(event.target.value as ModelName)}>
|
|
523
|
+
{!entries.some(entry => entry.id === model) && <option value={model}>{model}</option>}
|
|
524
|
+
{entries.map(entry => <option key={entry.id} value={entry.id}>{entry.displayName || entry.id}</option>)}
|
|
525
|
+
</select>;
|
|
526
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ClaudeNativeAccountPicker } from '../ClaudeNativeAccountPicker';
|
|
2
|
+
import { useClaudeNativeCatalogFor } from '../../hooks/useClaudeNativeCatalog';
|
|
3
|
+
import { selectedClaudeTransport } from '../../utils/claudeAuth';
|
|
1
4
|
import { submitClusterCreation } from '../../utils/clusterCreation';
|
|
2
5
|
import { ResearchStartForm, isResearchPanel } from './ResearchStartForm';
|
|
3
6
|
import { readSavedSettings } from '../../utils/settingsRequests';
|
|
4
7
|
import { TerminalSessions } from '../TerminalSessions';
|
|
5
8
|
import { MessageGuardControl } from '../ClusterRightPanel/MessageGuardControl';
|
|
6
|
-
import { TERMINAL_CODEX_ACCOUNT, DEFAULT_OUTPUT_STYLE, OUTPUT_STYLES, resolveOutputStyle, CLUSTER_EFFICIENCY_CREATE_DEFAULT, CLUSTER_MESSAGE_GUARD_CREATE_DEFAULT, newFolderNameError, type ClusterMessageGuard, type ClusterTaskBoardMode, type ClusterProgressMode } from '@arco/shared';
|
|
9
|
+
import { TERMINAL_CODEX_ACCOUNT, DEFAULT_CLAUDE_NATIVE_ACCOUNT, isClaudeNativeProfileId, DEFAULT_OUTPUT_STYLE, OUTPUT_STYLES, resolveOutputStyle, CLUSTER_EFFICIENCY_CREATE_DEFAULT, CLUSTER_MESSAGE_GUARD_CREATE_DEFAULT, newFolderNameError, type ClusterMessageGuard, type ClusterTaskBoardMode, type ClusterProgressMode } from '@arco/shared';
|
|
7
10
|
import { useState, useEffect, useRef } from 'react';
|
|
8
11
|
import { useAppStore } from '../../stores/appStore';
|
|
9
12
|
import { useCodexCatalogFor } from '../../hooks/useCodexCatalog';
|
|
@@ -64,11 +67,11 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
64
67
|
const isProviderEnabled = useAppStore((s) => s.isProviderEnabled);
|
|
65
68
|
const settings = useAppStore((s) => s.settings);
|
|
66
69
|
const setSettings = useAppStore((s) => s.setSettings);
|
|
67
|
-
const claudeNativeCatalog = useAppStore((s) => s.claudeNativeCatalog);
|
|
68
70
|
// Hoisted above the Codex picker list (built at render-top) so that list is
|
|
69
71
|
// scoped to the selected account profile's entitlements (HOME vs WORK).
|
|
70
72
|
const wd = settings?.workflowDefaults;
|
|
71
73
|
const [providerAccountRef, setProviderAccountRef] = useState<string | undefined>(wd?.providerAccountRef);
|
|
74
|
+
const claudeNativeCatalog = useClaudeNativeCatalogFor(isClaudeNativeProfileId(providerAccountRef) ? providerAccountRef : undefined);
|
|
72
75
|
const [codexLoginCommand, setCodexLoginCommand] = useState<string | null>(null);
|
|
73
76
|
const codexCatalog = useCodexCatalogFor(providerAccountRef);
|
|
74
77
|
const cursorCatalog = useAppStore((s) => s.cursorCatalog);
|
|
@@ -203,10 +206,12 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
203
206
|
});
|
|
204
207
|
}, [primaryProvider, model, claudeNativeCatalog]);
|
|
205
208
|
|
|
206
|
-
const
|
|
207
|
-
const
|
|
209
|
+
const claudeNative = primaryProvider === 'claude' && selectedClaudeTransport(undefined, settings?.claude?.transport, ultracode) === 'native';
|
|
210
|
+
const chosenAccount = primaryProvider === 'codex' || claudeNative ? providerAccountRef : undefined;
|
|
208
211
|
const codexAccounts = settings?.providerAccounts?.codex ?? [];
|
|
212
|
+
const visibleProviderAccounts = primaryProvider === 'codex' ? codexAccounts : [];
|
|
209
213
|
useEffect(() => {
|
|
214
|
+
if (primaryProvider === 'claude') return;
|
|
210
215
|
if (primaryProvider !== 'codex') {
|
|
211
216
|
setProviderAccountRef(undefined);
|
|
212
217
|
return;
|
|
@@ -294,7 +299,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
294
299
|
primaryProvider,
|
|
295
300
|
primaryModel: model,
|
|
296
301
|
primaryEffort: savedEffort,
|
|
297
|
-
...(
|
|
302
|
+
...(chosenAccount ? { providerAccountRef: chosenAccount } : {}),
|
|
298
303
|
skipPermissions,
|
|
299
304
|
fastMode,
|
|
300
305
|
efficiencyToolFilter,
|
|
@@ -583,7 +588,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
583
588
|
provider,
|
|
584
589
|
model: m,
|
|
585
590
|
effort: effortClamped,
|
|
586
|
-
providerAccountRef: provider ===
|
|
591
|
+
providerAccountRef: provider === primaryProvider ? chosenAccount : undefined,
|
|
587
592
|
displayName: '',
|
|
588
593
|
role: '',
|
|
589
594
|
tier: '',
|
|
@@ -615,7 +620,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
615
620
|
provider: c.provider,
|
|
616
621
|
model: c.model,
|
|
617
622
|
effort: c.effort,
|
|
618
|
-
providerAccountRef: c.provider === 'codex' ? (providerAccountRef
|
|
623
|
+
providerAccountRef: c.provider === 'codex' ? (primaryProvider === 'codex' ? providerAccountRef : codexAccounts[0]?.id) : c.provider === 'claude' && claudeNative ? chosenAccount : undefined,
|
|
619
624
|
displayName: '',
|
|
620
625
|
role: c.role,
|
|
621
626
|
tier: c.tier ?? '',
|
|
@@ -653,6 +658,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
653
658
|
|
|
654
659
|
// Switch the primary provider and reset model and effort to what it offers.
|
|
655
660
|
function selectPrimaryProvider(p: ProviderName) {
|
|
661
|
+
if (p !== primaryProvider) setProviderAccountRef(undefined);
|
|
656
662
|
setPrimaryProvider(p);
|
|
657
663
|
// Newest catalog model, not the `opus` family alias: the alias
|
|
658
664
|
// isn't in the picker's option list, so hard-coding it here
|
|
@@ -730,7 +736,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
730
736
|
provider: m.provider,
|
|
731
737
|
model: m.model as ModelName,
|
|
732
738
|
effort: capDefaultEffort((m.effort as EffortLevel | undefined) ?? 'medium', m.provider, m.model as ModelName, claudeNativeCatalog, codexCatalog),
|
|
733
|
-
providerAccountRef: m.provider === 'codex' ? m.providerAccountRef : undefined,
|
|
739
|
+
providerAccountRef: m.provider === 'codex' || m.provider === 'claude' ? m.providerAccountRef : undefined,
|
|
734
740
|
...memberAccessOptions(m),
|
|
735
741
|
displayName: m.displayName ?? '',
|
|
736
742
|
role: m.role ?? '',
|
|
@@ -778,7 +784,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
778
784
|
provider: m.provider,
|
|
779
785
|
model: String(m.model),
|
|
780
786
|
...(m.effort ? { effort: m.effort } : {}),
|
|
781
|
-
...(m.provider === 'codex' && m.providerAccountRef ? { providerAccountRef: m.providerAccountRef } : {}),
|
|
787
|
+
...((m.provider === 'codex' || m.provider === 'claude') && m.providerAccountRef ? { providerAccountRef: m.providerAccountRef } : {}),
|
|
782
788
|
...memberAccessOptions(m),
|
|
783
789
|
displayName: derived[i]!,
|
|
784
790
|
...(m.role.trim().length > 0 ? { role: m.role.trim() } : {}),
|
|
@@ -820,7 +826,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
820
826
|
setModel(c.primaryModel);
|
|
821
827
|
effortExplicitRef.current = false;
|
|
822
828
|
setEffort(capDefaultEffort(c.primaryEffort, provider, c.primaryModel, claudeNativeCatalog, codexCatalog));
|
|
823
|
-
setProviderAccountRef(provider === 'codex' ? c.providerAccountRef : undefined);
|
|
829
|
+
setProviderAccountRef(provider === 'codex' || provider === 'claude' ? c.providerAccountRef : undefined);
|
|
824
830
|
setSkipPermissions(c.skipPermissions);
|
|
825
831
|
setFastMode(c.fastMode ?? false);
|
|
826
832
|
setEfficiencyToolFilter(c.efficiencyToolFilter ?? 'off');
|
|
@@ -861,7 +867,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
861
867
|
primaryEffort: effort,
|
|
862
868
|
skipPermissions,
|
|
863
869
|
...(workDir ? { workingDirectory: workDir } : {}),
|
|
864
|
-
...(
|
|
870
|
+
...(chosenAccount ? { providerAccountRef: chosenAccount } : {}),
|
|
865
871
|
...(fastMode ? { fastMode: true } : {}),
|
|
866
872
|
...(efficiencyToolFilter !== 'off' ? { efficiencyToolFilter } : {}),
|
|
867
873
|
...(outputStyle !== DEFAULT_OUTPUT_STYLE ? { outputStyle } : {}),
|
|
@@ -922,7 +928,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
922
928
|
provider: m.provider,
|
|
923
929
|
model: String(m.model),
|
|
924
930
|
...(m.effort ? { effort: m.effort } : {}),
|
|
925
|
-
...(m.provider === 'codex' && m.providerAccountRef ? { providerAccountRef: m.providerAccountRef } : {}),
|
|
931
|
+
...((m.provider === 'codex' || m.provider === 'claude') && m.providerAccountRef ? { providerAccountRef: m.providerAccountRef } : {}),
|
|
926
932
|
...memberAccessOptions(m),
|
|
927
933
|
displayName: derived[i]!,
|
|
928
934
|
...(m.role.trim().length > 0 ? { role: m.role.trim() } : {}),
|
|
@@ -950,7 +956,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
950
956
|
workingDirectory: '',
|
|
951
957
|
genesisSeed: { title: name.trim(), spark: spark.trim(), concept: '', theCase: '', buildDirection: '' },
|
|
952
958
|
...(fastMode && { fastMode: true }),
|
|
953
|
-
...(
|
|
959
|
+
...(chosenAccount ? { providerAccountRef: chosenAccount } : {}),
|
|
954
960
|
...(efficiencyToolFilter !== 'off' && { efficiencyToolFilter }),
|
|
955
961
|
...(outputStyle !== DEFAULT_OUTPUT_STYLE && { outputStyle }),
|
|
956
962
|
});
|
|
@@ -970,7 +976,7 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
970
976
|
skipPermissions: primaryProvider === 'antigravity-cli' ? skipPermissions : false,
|
|
971
977
|
workingDirectory: '',
|
|
972
978
|
...(incognito ? { incognito: true } : {}),
|
|
973
|
-
...(
|
|
979
|
+
...(chosenAccount ? { providerAccountRef: chosenAccount } : {}),
|
|
974
980
|
...(outputStyle !== DEFAULT_OUTPUT_STYLE && { outputStyle }),
|
|
975
981
|
});
|
|
976
982
|
return;
|
|
@@ -1017,7 +1023,9 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
1017
1023
|
resumeSessionId: selectedSession && !selectedSession.arcoInternal ? selectedSession.sessionId : undefined,
|
|
1018
1024
|
resumeWorkflowId: selectedSession?.arcoInternal ? selectedSession.arcoWorkflowId : undefined,
|
|
1019
1025
|
...(fastMode && { fastMode: true }),
|
|
1020
|
-
...(
|
|
1026
|
+
...(selectedSession && !selectedSession.arcoInternal && primaryProvider === 'claude'
|
|
1027
|
+
? { claudeTransport: 'cli' as const }
|
|
1028
|
+
: chosenAccount ? { providerAccountRef: chosenAccount } : {}),
|
|
1021
1029
|
// Efficiency/style knobs — only stamp on the new workflow when
|
|
1022
1030
|
// non-default (so a default output style / `off` pick stays absent
|
|
1023
1031
|
// from meta.json and the server's defaults apply). Stored regardless of
|
|
@@ -1566,6 +1574,12 @@ export function WorkflowCreator({ onCreate, onCreateCluster, onReopenCluster, in
|
|
|
1566
1574
|
})}
|
|
1567
1575
|
</select>
|
|
1568
1576
|
|
|
1577
|
+
{claudeNative && (mode !== 'single' || conversationMode !== 'resume') && (
|
|
1578
|
+
<div style={{ marginTop: 12 }}>
|
|
1579
|
+
<ClaudeNativeAccountPicker value={providerAccountRef} labelStyle={labelStyle} style={inputStyle}
|
|
1580
|
+
onChange={ref => { setProviderAccountRef(ref); if (ref !== (providerAccountRef ?? DEFAULT_CLAUDE_NATIVE_ACCOUNT)) setModel('sonnet'); }} />
|
|
1581
|
+
</div>
|
|
1582
|
+
)}
|
|
1569
1583
|
{visibleProviderAccounts.length > 0 && (
|
|
1570
1584
|
<div style={{ marginTop: '12px' }}>
|
|
1571
1585
|
<label className="display-font" style={labelStyle}>ACCOUNT PROFILE</label>
|
|
@@ -50,7 +50,7 @@ interface Props {
|
|
|
50
50
|
summarizer?: { provider: ProviderName; model: ModelName; effort: EffortLevel },
|
|
51
51
|
) => void;
|
|
52
52
|
onSpawn?: (newConfig: WorkflowConfig, newDirection: string, includePlan: boolean) => void;
|
|
53
|
-
onUpdatePrimary?: (update: { model?: ModelName; effort?: EffortLevel; autoHandoff?: import('@arco/shared').AutoHandoffConfig; autoFold?: { enabled: boolean; foldAt: number; tailBudget?: number }; autoCompaction?: import('@arco/shared').AutoCompactionPolicy | null; codexTransport?: 'exec' | 'appserver'; codexContextPolicy?: 'max' | 'standard'; claudeTransport?: 'cli' | 'native'; ultracode?: boolean; webSearchMaxUses?: number; claudeNativeCompact?: boolean; claudeNativeForceInterleavedThinkingBeta?: boolean; claudeNativeThinkingDisplay?: 'omitted' | 'summarized' | 'updates'; nativeSubagents?: import('@arco/shared').NativeSubagentPolicy | null; nativeCompactAutoContinue?: boolean; efficiencyToolFilter?: 'off' | 'conservative' | 'aggressive'; efficiencyFactForce?: 'on' | 'off'; efficiencyConfigProtection?: 'on' | 'off'; efficiencySandbox?: 'off' | 'on'; outputStyle?: import('@arco/shared').OutputStyle; goalRun?: { enabled: boolean; total?: number; tokenBudget?: number }; goal?: string; pinnedSkills?: ArcoSkillRef[]; ollamaParams?: Record<string, unknown> }) => void;
|
|
53
|
+
onUpdatePrimary?: (update: { model?: ModelName; effort?: EffortLevel; providerAccountRef?: string; autoHandoff?: import('@arco/shared').AutoHandoffConfig; autoFold?: { enabled: boolean; foldAt: number; tailBudget?: number }; autoCompaction?: import('@arco/shared').AutoCompactionPolicy | null; codexTransport?: 'exec' | 'appserver'; codexContextPolicy?: 'max' | 'standard'; claudeTransport?: 'cli' | 'native'; ultracode?: boolean; webSearchMaxUses?: number; claudeNativeCompact?: boolean; claudeNativeForceInterleavedThinkingBeta?: boolean; claudeNativeThinkingDisplay?: 'omitted' | 'summarized' | 'updates'; nativeSubagents?: import('@arco/shared').NativeSubagentPolicy | null; nativeCompactAutoContinue?: boolean; efficiencyToolFilter?: 'off' | 'conservative' | 'aggressive'; efficiencyFactForce?: 'on' | 'off'; efficiencyConfigProtection?: 'on' | 'off'; efficiencySandbox?: 'off' | 'on'; outputStyle?: import('@arco/shared').OutputStyle; goalRun?: { enabled: boolean; total?: number; tokenBudget?: number }; goal?: string; pinnedSkills?: ArcoSkillRef[]; ollamaParams?: Record<string, unknown> }) => void;
|
|
54
54
|
onLoadEarlier?: () => void;
|
|
55
55
|
onRecalibrate?: () => void;
|
|
56
56
|
onAttachPlan?: (planId: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArcoSettings, AuthStatus, AuthStatusByProvider, Capabilities, ProviderName } from '@arco/shared';
|
|
2
|
-
import { claudeAuthPresentation } from '../utils/claudeAuth';
|
|
2
|
+
import { claudeAuthPresentation, nativeAccountStatus } from '../utils/claudeAuth';
|
|
3
3
|
|
|
4
4
|
// One rule for which providers the top bar and the Versions list show: an
|
|
5
5
|
// enabled provider stays, a disabled one disappears. `null` settings (still
|
|
@@ -42,6 +42,7 @@ export interface IndicatorInput {
|
|
|
42
42
|
claudeTransport: 'native' | 'cli';
|
|
43
43
|
// The active tab's Codex profile, when it uses one.
|
|
44
44
|
codexAccount?: string;
|
|
45
|
+
claudeAccount?: string;
|
|
45
46
|
now?: number;
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -58,9 +59,12 @@ export function providerIndicator(provider: 'claude' | 'codex' | 'cursor' | 'ant
|
|
|
58
59
|
if (runtime === 'broken') return { ...base, state: 'runtime', attention: true, text: 'CLI installed but does not run. Open Connections to repair it.' };
|
|
59
60
|
if (!input.auth) return { ...base, state: 'checking', attention: false, text: 'Checking status' };
|
|
60
61
|
if (provider === 'claude') {
|
|
61
|
-
const
|
|
62
|
+
const status = input.auth.claude;
|
|
63
|
+
const native = nativeAccountStatus(status, input.claudeAccount);
|
|
64
|
+
if (input.claudeAccount && !native && status?.native) return { ...base, state: 'sign-in', attention: true, text: 'Saved Native account unavailable. Choose an account in CONFIG.' };
|
|
65
|
+
const view = claudeAuthPresentation(input.claudeAccount && status ? { ...status, native } : status, input.claudeTransport, input.now);
|
|
62
66
|
if (view.attention === 'native') {
|
|
63
|
-
const rejected =
|
|
67
|
+
const rejected = native?.state === 'needs-attention';
|
|
64
68
|
return { ...base, state: rejected ? 'rejected' : 'sign-in', attention: true, text: `Native ${rejected ? 'sign-in needs attention' : 'sign-in needed'}. Open Connections to sign in.` };
|
|
65
69
|
}
|
|
66
70
|
if (view.attention === 'cli') return { ...base, state: 'sign-in', attention: true, text: 'CLI signed out. Open Connections to sign in.' };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { AuthStatus } from '@arco/shared';
|
|
3
|
+
import { checkProviderStatus } from '../../utils/providerStatusCheck';
|
|
4
|
+
|
|
5
|
+
const buttonStyle = { padding: '6px 10px', background: 'var(--color-accent-primary-a10)', border: '1px solid var(--color-accent-primary)', borderRadius: 3, color: 'var(--color-accent-primary)', cursor: 'pointer', fontSize: 10 };
|
|
6
|
+
|
|
7
|
+
export function GitHubAuthRow({ status, loginPending, onLogin }: { status?: AuthStatus; loginPending: boolean; onLogin: () => void }) {
|
|
8
|
+
const [checking, setChecking] = useState(false);
|
|
9
|
+
const [checkFailed, setCheckFailed] = useState(false);
|
|
10
|
+
const refresh = async () => {
|
|
11
|
+
setChecking(true);
|
|
12
|
+
const result = await checkProviderStatus('github');
|
|
13
|
+
setCheckFailed(!result);
|
|
14
|
+
setChecking(false);
|
|
15
|
+
};
|
|
16
|
+
const connected = status?.loggedIn === true;
|
|
17
|
+
const missing = status?.githubState === 'missing';
|
|
18
|
+
const signedOut = status?.githubState === 'signed-out';
|
|
19
|
+
const message = status?.error || (connected ? status.email || 'authenticated' : status ? 'GitHub CLI status is unknown.' : 'Checking GitHub CLI status...');
|
|
20
|
+
return <div data-testid="github-auth-row" style={{ display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap', padding: '10px 14px', border: '1px solid var(--color-border-hairline)', borderRadius: 4, background: connected ? 'var(--color-accent-primary-a05)' : 'var(--color-bg-sunken)' }}>
|
|
21
|
+
<div style={{ flex: '1 1 240px', minWidth: 0, display: 'flex', flexDirection: 'column', gap: 3 }}>
|
|
22
|
+
<span className="display-font" style={{ fontSize: 12, letterSpacing: 2, color: connected ? 'var(--color-accent-primary)' : 'var(--color-fg-muted)' }}>GITHUB (gh CLI)</span>
|
|
23
|
+
<span style={{ fontSize: 10, color: connected ? 'var(--color-accent-primary-dim)' : 'var(--color-warning-dim)', overflowWrap: 'anywhere' }}>{message}</span>
|
|
24
|
+
<span style={{ fontSize: 10, color: 'var(--color-fg-muted)' }}>Recommended on Windows: install Git for Windows for local repositories and Git Bash, and GitHub CLI (gh) to connect Arco to GitHub.</span>
|
|
25
|
+
{missing && <a href="https://cli.github.com/" target="_blank" rel="noreferrer">Install GitHub CLI</a>}
|
|
26
|
+
{status && !connected && !missing && !signedOut && !/gh auth status/i.test(message) && <span style={{ fontSize: 10, color: 'var(--color-fg-muted)' }}>Run <code>gh auth status</code> in the Arco server environment, then check again.</span>}
|
|
27
|
+
{checkFailed && <span role="alert">Could not check GitHub CLI status. Check the server connection and try again.</span>}
|
|
28
|
+
</div>
|
|
29
|
+
{connected ? <span className="display-font" style={{ fontSize: 10, letterSpacing: 1, color: 'var(--color-accent-primary)', padding: '4px 10px', border: '1px solid var(--color-accent-primary)', borderRadius: 3 }}>LIVE</span> : <div style={{ display: 'flex', gap: 6, flexWrap: 'wrap' }}>
|
|
30
|
+
{signedOut && <button type="button" className="display-font" style={buttonStyle} disabled={loginPending} onClick={onLogin}>{loginPending ? 'WAITING...' : 'LOG IN'}</button>}
|
|
31
|
+
<button type="button" className="display-font" style={buttonStyle} disabled={checking} onClick={() => void refresh()}>{checking ? 'CHECKING...' : 'CHECK CONNECTION'}</button>
|
|
32
|
+
</div>}
|
|
33
|
+
</div>;
|
|
34
|
+
}
|
|
@@ -20,7 +20,7 @@ import { mergeItems, rollupProjects, type ArtifactEntry, type DocEntry, type Pro
|
|
|
20
20
|
interface Props {
|
|
21
21
|
focusTick: number;
|
|
22
22
|
treeRoot?: string | null;
|
|
23
|
-
onOpen: (path: string, project?: string) => void;
|
|
23
|
+
onOpen: (path: string, project?: string, readUrl?: string) => void;
|
|
24
24
|
onRevealInTree: (path: string) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -51,6 +51,13 @@ async function loadEntries<T>(url: string, label: string): Promise<LoadedEntries
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// A refresh replaces the list only when it succeeds. A failed refresh keeps the
|
|
55
|
+
// rows of the last successful load, through any number of failures in a row,
|
|
56
|
+
// and shows the error beside them; there is no list to keep the first time.
|
|
57
|
+
export function keepOnFailure<T>(previous: LoadedEntries<T> | null, next: LoadedEntries<T>): LoadedEntries<T> {
|
|
58
|
+
return next.error && previous ? { ...previous, error: next.error } : next;
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
export function ArtifactsLens({ focusTick, treeRoot, onOpen, onRevealInTree }: Props) {
|
|
55
62
|
const [docs, setDocs] = useState<LoadedEntries<DocEntry> | null>(null);
|
|
56
63
|
const [artifacts, setArtifacts] = useState<LoadedEntries<ArtifactEntry> | null>(null);
|
|
@@ -59,20 +66,22 @@ export function ArtifactsLens({ focusTick, treeRoot, onOpen, onRevealInTree }: P
|
|
|
59
66
|
const [filter, setFilter] = useState('');
|
|
60
67
|
|
|
61
68
|
useEffect(() => {
|
|
69
|
+
// Refocus and REFRESH update in place: the current lists stay on screen
|
|
70
|
+
// until the new ones arrive, so scroll position and the open project stay.
|
|
62
71
|
let cancelled = false;
|
|
63
|
-
setDocs(null); setArtifacts(null);
|
|
64
72
|
loadEntries<DocEntry>('/api/explorer/docs', 'Project documents')
|
|
65
|
-
.then(result => { if (!cancelled) setDocs(result); });
|
|
73
|
+
.then(result => { if (!cancelled) setDocs(previous => keepOnFailure(previous, result)); });
|
|
66
74
|
loadEntries<ArtifactEntry>('/api/explorer/artifacts', 'Workflow artifacts')
|
|
67
|
-
.then(result => { if (!cancelled) setArtifacts(result); });
|
|
75
|
+
.then(result => { if (!cancelled) setArtifacts(previous => keepOnFailure(previous, result)); });
|
|
68
76
|
return () => { cancelled = true; };
|
|
69
77
|
}, [focusTick]);
|
|
70
78
|
|
|
79
|
+
// Opening another project starts its list afresh; a refresh keeps it.
|
|
80
|
+
useEffect(() => { setProjectDocs(null); }, [selectedCwd]);
|
|
71
81
|
useEffect(() => {
|
|
72
82
|
let cancelled = false;
|
|
73
|
-
setProjectDocs(null);
|
|
74
83
|
if (selectedCwd) loadEntries<DocEntry>(`/api/explorer/docs?project=${encodeURIComponent(selectedCwd)}`, 'Project documents')
|
|
75
|
-
.then(result => { if (!cancelled) setProjectDocs(result); });
|
|
84
|
+
.then(result => { if (!cancelled) setProjectDocs(previous => keepOnFailure(previous, result)); });
|
|
76
85
|
return () => { cancelled = true; };
|
|
77
86
|
}, [selectedCwd, focusTick]);
|
|
78
87
|
const items = useMemo(() => mergeItems(artifacts?.entries ?? [], docs?.entries ?? []), [artifacts, docs]);
|
|
@@ -177,7 +186,7 @@ function ItemRow({ item, treeRoot, onOpen, onRevealInTree, showProject }: { item
|
|
|
177
186
|
].filter(Boolean).join(' · ');
|
|
178
187
|
return (
|
|
179
188
|
<div className="archive-row" style={rowStyle} title={item.path}>
|
|
180
|
-
<button onClick={() => onOpen(item.path, item.branch ? item.cwd : undefined)} style={rowMainBtn}>
|
|
189
|
+
<button onClick={() => onOpen(item.path, item.branch ? item.cwd : undefined, item.readUrl)} style={rowMainBtn}>
|
|
181
190
|
<span style={{ width: '18px', flexShrink: 0, color: item.kind === 'doc' ? 'var(--color-accent-primary-dim)' : 'var(--color-accent-secondary-dim)', fontSize: '12px' }}>
|
|
182
191
|
{item.kind === 'doc' ? '▤' : '⌸'}
|
|
183
192
|
</span>
|
|
@@ -187,7 +196,7 @@ function ItemRow({ item, treeRoot, onOpen, onRevealInTree, showProject }: { item
|
|
|
187
196
|
{meta}
|
|
188
197
|
</span>
|
|
189
198
|
</button>
|
|
190
|
-
{!item.branch && canRevealInTree(item.path, treeRoot) && (
|
|
199
|
+
{!item.readUrl && !item.branch && canRevealInTree(item.path, treeRoot) && (
|
|
191
200
|
<button data-help="header.archive" onClick={() => onRevealInTree(item.path)} className="display-font" title="Reveal in the file tree" style={revealBtn}>⊞</button>
|
|
192
201
|
)}
|
|
193
202
|
</div>
|
|
@@ -37,7 +37,7 @@ const INITIAL_LENS: LensId = (() => {
|
|
|
37
37
|
export function ExplorerApp() {
|
|
38
38
|
const [lens, setLens] = useState<LensId>(INITIAL_LENS);
|
|
39
39
|
const [root, setRoot] = useState<string | null>(null);
|
|
40
|
-
const [viewerFile, setViewerFile] = useState<{ path: string; project?: string } | null>(null);
|
|
40
|
+
const [viewerFile, setViewerFile] = useState<{ path: string; project?: string; readUrl?: string } | null>(null);
|
|
41
41
|
// Reveal-in-tree (§4.3): switch to TREE with a target path. `.arco`
|
|
42
42
|
// artifacts are hidden, so only real project files (CHANGED FILES) trigger this.
|
|
43
43
|
const [reveal, setReveal] = useState<{ path: string; nonce: number } | null>(null);
|
|
@@ -144,7 +144,7 @@ export function ExplorerApp() {
|
|
|
144
144
|
|
|
145
145
|
<main style={{ flex: 1, minHeight: 0, display: 'flex', overflow: 'hidden' }}>
|
|
146
146
|
{activeLens.id === 'artifacts' && (
|
|
147
|
-
<ArtifactsLens focusTick={focusTick} treeRoot={root} onOpen={(path, project) => setViewerFile({ path, project })} onRevealInTree={revealInTree} />
|
|
147
|
+
<ArtifactsLens focusTick={focusTick} treeRoot={root} onOpen={(path, project, readUrl) => setViewerFile({ path, project, readUrl })} onRevealInTree={revealInTree} />
|
|
148
148
|
)}
|
|
149
149
|
{activeLens.id === 'recents' && (
|
|
150
150
|
<RecentsLens focusTick={focusTick} treeRoot={root} onOpen={(path) => setViewerFile({ path })} onRevealInTree={revealInTree} />
|
|
@@ -164,7 +164,7 @@ export function ExplorerApp() {
|
|
|
164
164
|
{/* Shared viewer for the ARTIFACTS/CHANGED FILES lenses. The TREE lens
|
|
165
165
|
(FileExplorer) opens its own modal internally. */}
|
|
166
166
|
{viewerFile && <FileViewerModal path={viewerFile.path} onClose={() => setViewerFile(null)}
|
|
167
|
-
readUrl={viewerFile.project ? '/api/file-content?' + new URLSearchParams({ path: viewerFile.path, cwd: viewerFile.project }) : undefined} />}
|
|
167
|
+
readUrl={viewerFile.readUrl ?? (viewerFile.project ? '/api/file-content?' + new URLSearchParams({ path: viewerFile.path, cwd: viewerFile.project }) : undefined)} />}
|
|
168
168
|
</div>
|
|
169
169
|
);
|
|
170
170
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// protocol imports beyond what it needs).
|
|
4
4
|
|
|
5
5
|
export interface ArtifactEntry {
|
|
6
|
+
id?: string;
|
|
6
7
|
path: string;
|
|
7
8
|
name: string;
|
|
8
9
|
size: number;
|
|
@@ -42,6 +43,7 @@ export interface DocEntry {
|
|
|
42
43
|
// One unified item the ARTIFACTS lens renders — a project document OR a workflow
|
|
43
44
|
// artifact, merged newest-first.
|
|
44
45
|
export interface ProjectItem {
|
|
46
|
+
readUrl?: string;
|
|
45
47
|
path: string;
|
|
46
48
|
name: string;
|
|
47
49
|
mtime: number;
|
|
@@ -117,7 +119,7 @@ export function mergeItems(artifacts: ArtifactEntry[], docs: DocEntry[]): Projec
|
|
|
117
119
|
const out: ProjectItem[] = [];
|
|
118
120
|
const push = (it: ProjectItem) => { if (!seen.has(it.path)) { seen.add(it.path); out.push(it); } };
|
|
119
121
|
for (const d of docs) push({ path: d.path, name: d.name, mtime: d.mtime, project: d.project, cwd: d.cwd, kind: 'doc', rel: d.rel, branch: d.branch });
|
|
120
|
-
for (const a of artifacts) push({ path: a.path, name: a.name, mtime: a.mtime, project: a.project, cwd: a.cwd, kind: 'artifact', tabTitle: a.tabTitle, provider: a.provider });
|
|
122
|
+
for (const a of artifacts) push({ path: a.path, name: a.name, mtime: a.mtime, project: a.project, cwd: a.cwd, kind: 'artifact', readUrl: a.id ? '/api/outputs/content?' + new URLSearchParams({ cwd: a.cwd, workflowId: a.workflowId, id: a.id }) : undefined, tabTitle: a.tabTitle, provider: a.provider });
|
|
121
123
|
out.sort((x, y) => y.mtime - x.mtime);
|
|
122
124
|
return out;
|
|
123
125
|
}
|
|
@@ -4,7 +4,7 @@ import type { HelpEntry } from './shared';
|
|
|
4
4
|
export const clusterHelp: Record<string, HelpEntry> = {
|
|
5
5
|
'cluster.peer-message': {
|
|
6
6
|
title: 'Read peer mail',
|
|
7
|
-
body: <p>The card shows a short preview. Open it to read the full available message, sender, recipient and time. Older sent messages may contain only a saved preview. Close the dialog to return to the conversation.</p>,
|
|
7
|
+
body: <p>The card shows a short preview. Open it to read the full available message, sender, recipient and time. Older sent messages may contain only a saved preview. Open a file link to see the resolved path and preview the file. Choose a path if several match, or use DOWNLOAD FILE when the browser cannot display it. Close the dialog to return to the conversation.</p>,
|
|
8
8
|
manualSection: 'cluster-peer-messaging',
|
|
9
9
|
},
|
|
10
10
|
'cluster.skills': {
|
|
@@ -334,6 +334,7 @@ export const clusterHelp: Record<string, HelpEntry> = {
|
|
|
334
334
|
<>
|
|
335
335
|
<p>Chooses whether idle members start a turn on their own when mail arrives. The chip shows the current mode; click it to change it. <strong>Off</strong> is the default, and clusters armed before the modes existed are Rule-based.</p>
|
|
336
336
|
<p><strong>Rule-based (recommended)</strong> wakes an idle member for mail that asks for something and leaves plain acknowledgements waiting. Limits stop two members waking each other back and forth and cap wakes per member and per arming. <C>RESET BUDGET</C> starts a fresh allowance after the arming total is reached.</p>
|
|
337
|
+
<p>If the provider rejects a member's conversation as too large, pickup holds its unread mail. Use HANDOFF, FOLD where available, or REPLACE to recover. Other members can still wake.</p>
|
|
337
338
|
<p><C>PAUSE</C> stops automatic pickup and busy reminders while keeping the mode, session and wake counts. <C>RESUME</C> checks idle members with waiting mail through the same limits, without resetting the budget. NUDGE still works while paused. The Smart session clock freezes, including across a restart; hourly rate limits keep real time.</p>
|
|
338
339
|
<p><strong>Smart</strong> modes ask a model you choose whether to wake the member, wait, or ask you. <strong>Observe-only</strong> only records the answers. <strong>Automatic</strong> may start the member's normal turn, but only after Arco checks again that the member is idle, the mail is unchanged and every limit allows it. <C>STOP</C> on a member holds its current mail until new mail arrives. A Smart session ends at its time limit, or after a restart when its limit record cannot be read, and must then be armed again.</p>
|
|
339
340
|
<p>In Automatic, an evaluator error or invalid answer attempts ordinary pickup once through the same guards and budget. Valid wait/ask answers and STOP or expiry never permit fallback. Observe-only never wakes. The last decision, chip hover and accessible description explain failures and fallback.</p>
|
|
@@ -392,7 +393,12 @@ export const clusterHelp: Record<string, HelpEntry> = {
|
|
|
392
393
|
},
|
|
393
394
|
'cluster.fresh.count': {
|
|
394
395
|
title: 'How many',
|
|
395
|
-
body: <p>How many
|
|
396
|
+
body: <p>How many workers to create at once, from 1 to 4. In + ADD FRESH every choice above applies to all of them. In CREATE WITH FRESH each worker gets its own card with its own choices; the default is 1 worker.</p>,
|
|
397
|
+
manualSection: 'cluster-tab',
|
|
398
|
+
},
|
|
399
|
+
'cluster.fresh.cluster-name': {
|
|
400
|
+
title: 'Cluster name',
|
|
401
|
+
body: <p>Optional name for the new cluster. It names the cluster only; each worker's NAME is set on its own card. Empty uses the folder name and a short id.</p>,
|
|
396
402
|
manualSection: 'cluster-tab',
|
|
397
403
|
},
|
|
398
404
|
'cluster.fresh.name': {
|
|
@@ -423,7 +429,7 @@ export const clusterHelp: Record<string, HelpEntry> = {
|
|
|
423
429
|
},
|
|
424
430
|
'cluster.fresh.provider': {
|
|
425
431
|
title: 'Fresh provider',
|
|
426
|
-
body: <p>Choose an enabled and connected provider for the new workers, including Cursor and Gemini. Changing provider resets the model. Gemini members wait for your NUDGE. CREATE WITH FRESH in the tab menu
|
|
432
|
+
body: <p>Choose an enabled and connected provider for the new workers, including Cursor and Gemini. Changing provider resets the model. Gemini members wait for your NUDGE. CREATE WITH FRESH in the tab menu offers the same choices on each worker's card.</p>,
|
|
427
433
|
manualSection: 'cluster-tab',
|
|
428
434
|
},
|
|
429
435
|
'cluster.fresh.model': {
|
|
@@ -1189,7 +1195,7 @@ export const clusterHelp: Record<string, HelpEntry> = {
|
|
|
1189
1195
|
},
|
|
1190
1196
|
'cluster.gemini-members': {
|
|
1191
1197
|
title: 'Gemini members',
|
|
1192
|
-
body: <><p>The notice above the conversation names the Gemini members.
|
|
1198
|
+
body: <><p>The notice above the conversation names the Gemini members. Use COMPACT in a Gemini member's conversation to send <code>/compact</code>. An enabled worker or cluster policy sends the same command after a Gemini turn finishes at or above the threshold. Isolated Gemini researchers use manual COMPACT. Off leaves Gemini's usual automatic compaction enabled.</p><p>AUTO-PICKUP can wake a Gemini member for eligible incoming mail in an ordinary cluster. SAFE can still ask before Gemini runs peer_read. Mail from Gemini and mail in Research wait for NUDGE. Review, edit or cancel waiting mail in MAILBOX.</p><p>A message you type in a Gemini member's own composer also starts its turn. Its first turn includes its role and cluster instructions. REPLACE with RECENT HISTORY or FULL HISTORY sends the selected history as that opening turn. Every NUDGE asks it to read the current plan and mail before acting.</p></>,
|
|
1193
1199
|
manualSection: 'cluster-gemini-members',
|
|
1194
1200
|
},
|
|
1195
1201
|
'cluster.mailbox-edit': {
|