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
|
@@ -10,7 +10,7 @@ import { workflows } from '../server/state.js';
|
|
|
10
10
|
import { safeDirectory } from '../fileAccessPolicy.js';
|
|
11
11
|
import { readSettings } from '../settings.js';
|
|
12
12
|
import { isKnownProvider } from '../providers/index.js';
|
|
13
|
-
import { configuredAccounts } from '../providerAccounts.js';
|
|
13
|
+
import { configuredAccounts, requireClaudeNativeAccount } from '../providerAccounts.js';
|
|
14
14
|
import { buildTranscriptWorkerSlice, type TranscriptSliceOptions } from '../transcriptWorker.js';
|
|
15
15
|
import { TERMINAL_CODEX_ACCOUNT } from '@arco/shared';
|
|
16
16
|
|
|
@@ -74,11 +74,15 @@ async function destinationConfig(message: TranscriptWorkerCreateMessage): Promis
|
|
|
74
74
|
if (target.skipPermissions !== undefined && typeof target.skipPermissions !== 'boolean') throw new Error('Choose the new worker permission setting.');
|
|
75
75
|
const settings = await readSettings(workingDirectory);
|
|
76
76
|
if (settings.enabledProviders?.[target.provider] === false) throw new Error('That provider is turned off. Enable it or choose another provider.');
|
|
77
|
-
|
|
77
|
+
let nativeAccount: string | undefined;
|
|
78
|
+
if (target.provider === 'claude' && target.providerAccountRef !== undefined) {
|
|
79
|
+
nativeAccount = await requireClaudeNativeAccount(target.providerAccountRef);
|
|
80
|
+
} else if (target.providerAccountRef && !(target.provider === 'codex' && target.providerAccountRef === TERMINAL_CODEX_ACCOUNT)) {
|
|
78
81
|
if (target.provider !== 'codex' || !(await configuredAccounts('codex', workingDirectory)).some(account => account.id === target.providerAccountRef)) throw new Error('Choose an available account for the new worker.');
|
|
79
82
|
}
|
|
80
83
|
return { kind: 'workflow', name: typeof target.name === 'string' && target.name.trim() ? target.name.trim().slice(0, 120) : 'Transcript worker', workingDirectory,
|
|
81
84
|
primaryProvider: target.provider, primaryModel: target.model.trim(), primaryEffort: target.effort,
|
|
85
|
+
...(nativeAccount ? { providerAccountRef: nativeAccount, claudeTransport: 'native' as const } : {}),
|
|
82
86
|
...(target.provider === 'codex' && target.providerAccountRef ? { providerAccountRef: target.providerAccountRef } : {}), skipPermissions: target.skipPermissions === true };
|
|
83
87
|
}
|
|
84
88
|
|
|
@@ -36,7 +36,8 @@ import { createCheckpoint } from '../gitSnapshots.js';
|
|
|
36
36
|
import { summarizeTurnChanges, timelyCheckpoint, shouldCaptureTurn } from '../turnChanges.js';
|
|
37
37
|
import { isManagedBakeoffWorktree } from '../gitBakeoff.js';
|
|
38
38
|
import * as clusterMailbox from '../clusterMailbox.js';
|
|
39
|
-
import
|
|
39
|
+
import * as clusterAutoTurn from '../clusterAutoTurn.js';
|
|
40
|
+
import { consumeGeminiSend, geminiClusterInstructions, geminiPickupAllowed, geminiSendValid, GEMINI_OPERATOR_ONLY_REFUSAL, isGeminiMember } from '../geminiMembers.js';
|
|
40
41
|
import { setTurnOrigin } from '../clusterTurnOrigin.js';
|
|
41
42
|
import * as clusterPlanBridge from '../clusterPlanBridge.js';
|
|
42
43
|
import { clusterToolsPending, CLUSTER_TOOLS_PENDING_NOTICE, CLUSTER_TOOLS_PENDING_AGENT } from '../clusterTurnTools.js';
|
|
@@ -409,7 +410,7 @@ export function startSessionWatcher(workflowId: string, wf: WorkflowState, cwd:
|
|
|
409
410
|
}
|
|
410
411
|
|
|
411
412
|
export function derivePrimaryConfig(config: WorkflowConfig): PrimaryConfig {
|
|
412
|
-
config.primaryEffort = normalizedWorkflowEffort(config.primaryProvider, config.primaryModel, config.primaryEffort);
|
|
413
|
+
config.primaryEffort = normalizedWorkflowEffort(config.primaryProvider, config.primaryModel, config.primaryEffort, config.providerAccountRef);
|
|
413
414
|
return {
|
|
414
415
|
provider: config.primaryProvider ?? 'claude',
|
|
415
416
|
model: config.primaryModel,
|
|
@@ -917,7 +918,7 @@ export async function autoHandoffAvailableFor(workflowId: string, wf: WorkflowSt
|
|
|
917
918
|
}
|
|
918
919
|
|
|
919
920
|
export function freshAutoCompactionPercent(provider: string, transport: string, outcome: { error?: string; lastPromptTokens?: number; modelContextWindow?: number; freshContextWindow?: number }): number | undefined {
|
|
920
|
-
if (outcome.error || !((provider === 'claude' && transport === 'native') || (provider === 'codex' && transport === 'appserver'))) return undefined;
|
|
921
|
+
if (outcome.error || !(provider === 'antigravity-cli' || (provider === 'claude' && transport === 'native') || (provider === 'codex' && transport === 'appserver'))) return undefined;
|
|
921
922
|
const numerator = outcome.lastPromptTokens;
|
|
922
923
|
const denominator = provider === 'codex' ? outcome.freshContextWindow : outcome.modelContextWindow;
|
|
923
924
|
if (typeof numerator !== 'number' || !Number.isFinite(numerator) || numerator <= 0 || typeof denominator !== 'number' || !Number.isFinite(denominator) || denominator <= 0) return undefined;
|
|
@@ -936,8 +937,14 @@ export async function maybeAutoCompactPolicy(
|
|
|
936
937
|
if (lastBusyClaim.get(wf) !== expectedClaim) return true;
|
|
937
938
|
if (!policy.enabled || !reading || !Number.isFinite(reading.percent) || reading.percent < 0 || wf.busy || isChatWorkflow(wf.config)) return false;
|
|
938
939
|
if (reading.provider !== wf.primary.provider || reading.sessionId !== wf.primarySessionId) return false;
|
|
939
|
-
|
|
940
|
-
if (reading.provider
|
|
940
|
+
const gemini = reading.provider === 'antigravity-cli';
|
|
941
|
+
if (reading.provider !== 'claude' && reading.provider !== 'codex' && !gemini) return false;
|
|
942
|
+
if ((reading.provider === 'codex' || gemini) && !reading.sessionId) return false;
|
|
943
|
+
const isFencedGemini = () => {
|
|
944
|
+
const clusterId = clusterStore.getClusterIdForWorkflow(workflowId);
|
|
945
|
+
return gemini && !!clusterId && isIsolatedAccessMode(clusterStore.getMemberAccessMode(clusterId, workflowId));
|
|
946
|
+
};
|
|
947
|
+
if (isFencedGemini()) return false;
|
|
941
948
|
let state = policyAttempts.get(wf);
|
|
942
949
|
if (!state || state.sessionId !== reading.sessionId || state.provider !== reading.provider) {
|
|
943
950
|
state = { sessionId: reading.sessionId, provider: reading.provider, fired: false, awaitingReading: false, highAfterSuccess: 0 };
|
|
@@ -968,10 +975,12 @@ export async function maybeAutoCompactPolicy(
|
|
|
968
975
|
const clusterId = clusterStore.getClusterIdForWorkflow(workflowId);
|
|
969
976
|
if (reading.provider === 'claude' && reading.transport && await resolveClaudeTransport(wf, cwd) !== reading.transport) return false;
|
|
970
977
|
const current = resolveProviderAutoCompaction(wf.config.autoCompaction, clusterId ? clusterStore.getAutoCompaction(clusterId) : undefined, wf.primary.provider, reading.transport ?? (wf.primary.provider === 'claude' ? 'native' : ''), wf.config.claudeNativeCompact === true);
|
|
971
|
-
if (wf.busy || lastBusyClaim.get(wf) !== observedClaim || wf.primarySessionId !== reading.sessionId || wf.primary.provider !== reading.provider || !current?.enabled || current.thresholdPercent !== policy.thresholdPercent) return false;
|
|
978
|
+
if (isFencedGemini() || wf.busy || lastBusyClaim.get(wf) !== observedClaim || wf.primarySessionId !== reading.sessionId || wf.primary.provider !== reading.provider || !current?.enabled || current.thresholdPercent !== policy.thresholdPercent) return false;
|
|
972
979
|
return claim();
|
|
973
980
|
}, `context ${reading.percent}% >= ${policy.thresholdPercent}%`, () => {
|
|
974
|
-
|
|
981
|
+
// The CLI may accept /compact without confirming a smaller retained
|
|
982
|
+
// context. Require a fresh drop before another Gemini attempt.
|
|
983
|
+
if (!gemini && policyAttempts.get(wf) === state) { state.fired = false; state.awaitingReading = true; }
|
|
975
984
|
});
|
|
976
985
|
return true;
|
|
977
986
|
}
|
|
@@ -1449,14 +1458,16 @@ export async function handleUserMessage(
|
|
|
1449
1458
|
return;
|
|
1450
1459
|
}
|
|
1451
1460
|
// docs/PROTOCOL_CLUSTER.md "Gemini members": a Gemini member turn needs the
|
|
1452
|
-
// single-use ticket
|
|
1453
|
-
//
|
|
1454
|
-
//
|
|
1461
|
+
// single-use ticket for this member and this exact text, checked here and
|
|
1462
|
+
// again when queued input is taken. Other Antigravity turns accept only
|
|
1463
|
+
// operator messages.
|
|
1455
1464
|
const geminiMember = wf.primary.provider === 'antigravity-cli' && isGeminiMember(workflowId);
|
|
1456
1465
|
const antigravityInputOk = (item: { operatorInitiated?: boolean; automaticKind?: string; geminiSend?: string; content: string }, check: typeof geminiSendValid): boolean =>
|
|
1457
|
-
|
|
1458
|
-
? (!item.automaticKind || item.automaticKind === 'nudge')
|
|
1459
|
-
|
|
1466
|
+
geminiMember
|
|
1467
|
+
? ((item.operatorInitiated === true && (!item.automaticKind || item.automaticKind === 'nudge'))
|
|
1468
|
+
|| (item.automaticKind === 'auto-pickup' && geminiPickupAllowed(workflowId)))
|
|
1469
|
+
&& check(item.geminiSend, workflowId, item.content)
|
|
1470
|
+
: item.operatorInitiated === true && !item.automaticKind;
|
|
1460
1471
|
const queuedOperatorInput = fromQueue && [...wf.queue.steering, ...wf.queue.followUp].length > 0
|
|
1461
1472
|
&& [...wf.queue.steering, ...wf.queue.followUp].every(item => antigravityInputOk(item, geminiSendValid));
|
|
1462
1473
|
const directOperatorInput = !fromQueue && antigravityInputOk({ operatorInitiated: opts?.operatorInitiated, automaticKind: opts?.automaticKind, geminiSend: opts?.geminiSend, content }, geminiSendValid);
|
|
@@ -2729,6 +2740,10 @@ export async function handleUserMessage(
|
|
|
2729
2740
|
// (Claude CLI / Native, Codex exec) read the model copy too — they call
|
|
2730
2741
|
// the sync modelImagePath() and can't wait themselves.
|
|
2731
2742
|
if (promptAttachments && promptAttachments.length > 0) await awaitModelImages(promptAttachments);
|
|
2743
|
+
const geminiWake = opts?.automaticKind === 'nudge' || opts?.automaticKind === 'auto-pickup';
|
|
2744
|
+
const firstMemberRole = geminiMember && memberClusterId && !wf.primarySessionId && !geminiWake
|
|
2745
|
+
&& clusterStore.getMemberAccessMode(memberClusterId, workflowId) === 'standard'
|
|
2746
|
+
? await geminiClusterInstructions(memberClusterId, workflowId) : '';
|
|
2732
2747
|
// STOP landed during the pre-spawn awaits above (killAll had nothing to
|
|
2733
2748
|
// kill yet). Spawning now would run a turn nobody owns.
|
|
2734
2749
|
if (!ownsBusy(wf, busyToken)) break;
|
|
@@ -2749,7 +2764,10 @@ export async function handleUserMessage(
|
|
|
2749
2764
|
if (!(firstIteration && primitive === 'plan-review') && shouldCaptureTurn({ chatMode, planMode: armPlanMode, isolated: isolatedMember, provider: wf.primary.provider, tools: wf.primary.tools })) {
|
|
2750
2765
|
checkpointGuardSeq = currentWorkflowSeq(cwd, workflowId);
|
|
2751
2766
|
activeTurnObservation = observeCheckoutWriters(workflowWritePaths(wf), wf.manager);
|
|
2752
|
-
|
|
2767
|
+
// A capture that misses the cutoff is cancelled, so it neither keeps
|
|
2768
|
+
// working in the background nor publishes an undo point later.
|
|
2769
|
+
const lateCapture = new AbortController();
|
|
2770
|
+
checkpoint = await timelyCheckpoint((deps.captureCheckpoint ?? createCheckpoint)({ cwd, workflowId, seq: checkpointGuardSeq, onSkipped: onCheckpointSkipped, signal: lateCapture.signal }), 2000, () => lateCapture.abort());
|
|
2753
2771
|
if (!checkpoint || !ownsBusy(wf, busyToken)) {
|
|
2754
2772
|
activeTurnObservation.stop(); activeTurnObservation = undefined;
|
|
2755
2773
|
checkpoint = null;
|
|
@@ -2786,8 +2804,8 @@ export async function handleUserMessage(
|
|
|
2786
2804
|
}
|
|
2787
2805
|
});
|
|
2788
2806
|
const dispatchCurrent = () => workflows.get(workflowId) === wf && ownsBusy(wf, busyToken) && (dispatchedWorkerId === undefined || primaryTurn.workerId === dispatchedWorkerId);
|
|
2789
|
-
const geminiSkills = wf.primary.provider === 'antigravity-cli' && (!memberClusterId ||
|
|
2790
|
-
const geminiAdditions = [visibleGeminiPlan, geminiSkills].filter(Boolean).join('\n\n');
|
|
2807
|
+
const geminiSkills = wf.primary.provider === 'antigravity-cli' && (!memberClusterId || !geminiWake) && !wf.primarySessionId ? primarySkillsManifest : '';
|
|
2808
|
+
const geminiAdditions = [firstMemberRole, visibleGeminiPlan, geminiSkills].filter(Boolean).join('\n\n');
|
|
2791
2809
|
if (geminiAdditions && dispatchCurrent()) broadcastWorkflow(workflowId, { type: 'system_notice', workflowId, content: geminiAdditions });
|
|
2792
2810
|
const turn = runPrimaryTurn(
|
|
2793
2811
|
{
|
|
@@ -2854,7 +2872,7 @@ export async function handleUserMessage(
|
|
|
2854
2872
|
},
|
|
2855
2873
|
codexTransport,
|
|
2856
2874
|
codexContextPolicy: wf.config.codexContextPolicy,
|
|
2857
|
-
providerAccountRef: providerAccount?.profile.id,
|
|
2875
|
+
providerAccountRef: claudeTransport === 'native' ? wf.config.providerAccountRef : providerAccount?.profile.id,
|
|
2858
2876
|
codexHome: providerAccount?.codexHome,
|
|
2859
2877
|
claudeTransport,
|
|
2860
2878
|
ultracode,
|
|
@@ -3006,6 +3024,7 @@ export async function handleUserMessage(
|
|
|
3006
3024
|
}).catch((error) => console.warn('[arco] scratch reminder could not be cleared:', error));
|
|
3007
3025
|
}
|
|
3008
3026
|
lastTurnErrored = !!outcome.error;
|
|
3027
|
+
clusterAutoTurn.noteTurnOutcome(workflowId, outcome.error);
|
|
3009
3028
|
watchHadError ||= lastTurnErrored;
|
|
3010
3029
|
if (firstIteration && opts?.backgroundEvent) opts.onBackgroundSettled?.(outcome.error ?? undefined);
|
|
3011
3030
|
clearComputerBackgroundClaim(workflowId, busyToken);
|
|
@@ -3213,7 +3232,6 @@ export async function handleUserMessage(
|
|
|
3213
3232
|
// replaces any fold or compaction of this boundary; otherwise the cheap
|
|
3214
3233
|
// deterministic Fold, then the auto-compaction policy.
|
|
3215
3234
|
context: async () => {
|
|
3216
|
-
if (wf.primary.provider === 'antigravity-cli') return 'continue';
|
|
3217
3235
|
const clusterIdForPolicy = clusterStore.getClusterIdForWorkflow(workflowId);
|
|
3218
3236
|
const explicitPolicy = resolveProviderAutoCompaction(wf.config.autoCompaction, clusterIdForPolicy ? clusterStore.getAutoCompaction(clusterIdForPolicy) : undefined, wf.primary.provider, claudeTransport, wf.config.claudeNativeCompact === true, cascade?.ollama?.compaction?.enabled !== undefined || cascade?.ollama?.compaction?.threshold !== undefined);
|
|
3219
3237
|
if (explicitPolicy) {
|