arco-workbench 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +52 -12
- package/README.md +20 -13
- package/client/dist/assets/{PhosphorBackdrop-BR-TgB5x.js → PhosphorBackdrop-D7jdAV_G.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-DgcFj6JN.js → ThemedBackgroundShaderImpl-DrDm60h8.js} +1 -1
- package/client/dist/assets/{XtermView-CflVBQgC.js → XtermView-BGFujb1e.js} +1 -1
- package/client/dist/assets/{galleryEditor-BB-emfmi.js → galleryEditor-D951A2sE.js} +1 -1
- package/client/dist/assets/{index-B_EqHDz3.js → index-CsVy3eZm.js} +248 -248
- package/client/dist/index.html +1 -1
- package/client/src/buildCheck.ts +3 -1
- package/client/src/components/AppUpdateNotice.tsx +2 -1
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +24 -12
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +65 -15
- package/client/src/components/ClusterRightPanel/SkillsControl.tsx +107 -0
- package/client/src/components/ClusterRightPanel/index.tsx +6 -1
- package/client/src/components/ClusterTaskBoardTab.tsx +9 -22
- package/client/src/components/HeaderVersionBox.tsx +7 -4
- package/client/src/components/NeedsYouBadge.tsx +3 -3
- package/client/src/components/ProviderReleasesModal.tsx +8 -4
- package/client/src/components/ProvidersPopover.tsx +28 -23
- package/client/src/components/SettingsPanel.tsx +2 -2
- package/client/src/components/SkillsSettings.tsx +5 -0
- package/client/src/components/TabBar.tsx +91 -9
- package/client/src/components/TerminalInput.tsx +12 -10
- package/client/src/components/TranscriptSendDialog.tsx +12 -8
- package/client/src/components/TranscriptWorkerDialog.tsx +119 -0
- package/client/src/components/UpdateAction.tsx +18 -4
- package/client/src/components/UpdateResultNotice.tsx +3 -1
- package/client/src/components/clusterNeedsYou.ts +11 -18
- package/client/src/help/content/cluster.tsx +54 -22
- package/client/src/help/content/composer.tsx +22 -0
- package/client/src/help/content/header.tsx +19 -1
- package/client/src/help/content/misc.tsx +8 -0
- package/client/src/help/content/rightPanel.tsx +1 -1
- package/client/src/help/content/settings.tsx +19 -5
- package/client/src/help/content/tabbar.tsx +5 -0
- package/client/src/help/manualSections/actions.tsx +31 -0
- package/client/src/help/manualSections/clusters.tsx +58 -21
- package/client/src/help/manualSections/configuration.tsx +38 -4
- package/client/src/help/manualSections/maintenance.tsx +30 -0
- package/client/src/help/manualSections/plans.tsx +5 -1
- package/client/src/help/manualSections/providers.tsx +32 -8
- package/client/src/help/manualSections/troubleshooting.tsx +2 -1
- package/client/src/help/manualSections/workflows.tsx +19 -0
- package/client/src/help/manualSections/workspace.tsx +6 -0
- package/client/src/stores/appUpdateStore.ts +29 -8
- package/client/src/utils/transcriptWorkerRequest.ts +24 -0
- package/client/src/utils/wsSession.ts +2 -1
- package/client/src/ws/handleServerMessage.ts +8 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLIENT.md +9 -8
- package/docs/FEATURES.md +8 -5
- package/docs/GETTING_STARTED.md +9 -4
- package/docs/GOTCHAS.md +2 -1
- package/docs/OPERATIONS.md +37 -4
- package/docs/PERSISTENCE.md +25 -3
- package/docs/PRIMITIVES.md +42 -0
- package/docs/PROTOCOL_CLUSTER.md +51 -5
- package/docs/PROTOCOL_PRIMITIVES.md +39 -0
- package/docs/PROVIDERS.md +50 -13
- package/docs/SETTINGS.md +27 -3
- package/docs/TASK_LEDGER.md +7 -15
- package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +2 -0
- package/node_modules/@arco/shared/dist/clusterCoordination.js +5 -1
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +13 -1
- package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +4 -3
- package/node_modules/@arco/shared/dist/protocol/models.js +26 -2
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/transcriptWorker.d.ts +47 -0
- package/node_modules/@arco/shared/dist/protocol/transcriptWorker.js +2 -0
- package/node_modules/@arco/shared/dist/runtimeVersions.d.ts +1 -0
- package/node_modules/@arco/shared/dist/runtimeVersions.js +14 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +2 -2
- package/scripts/packaging/arco.mjs +1 -1
- package/scripts/packaging/native-repair.mjs +78 -12
- package/scripts/packaging/update.mjs +5 -1
- package/server/dist/atomicFile.js +1 -2
- package/server/dist/capabilities.d.ts +5 -2
- package/server/dist/capabilities.js +59 -9
- package/server/dist/cliUpdateDecision.d.ts +1 -1
- package/server/dist/cliUpdateDecision.js +5 -3
- package/server/dist/clusterAutoTurn.d.ts +4 -0
- package/server/dist/clusterAutoTurn.js +29 -25
- package/server/dist/clusterBusyReminder.js +1 -1
- package/server/dist/clusterDirector.js +1 -1
- package/server/dist/clusterPeerOps.js +10 -7
- package/server/dist/clusterProgress.js +1 -1
- package/server/dist/clusterSkills.d.ts +13 -0
- package/server/dist/clusterSkills.js +81 -0
- package/server/dist/clusterSnapshots.js +2 -0
- package/server/dist/clusterStore.d.ts +10 -2
- package/server/dist/clusterStore.js +64 -1
- package/server/dist/diagnostics/codeSkew.js +1 -0
- package/server/dist/eventLog.d.ts +7 -0
- package/server/dist/eventLog.js +70 -13
- package/server/dist/historyLimits.d.ts +1 -0
- package/server/dist/historyLimits.js +3 -0
- package/server/dist/http/router.js +1 -1
- package/server/dist/index.js +24 -1
- package/server/dist/jsonlLines.d.ts +4 -0
- package/server/dist/jsonlLines.js +53 -0
- package/server/dist/management/identity.js +1 -0
- package/server/dist/mcp/clusterMcpTools.js +4 -4
- package/server/dist/project/taskLedger.d.ts +4 -0
- package/server/dist/project/taskLedger.js +7 -4
- package/server/dist/providerConversation.d.ts +1 -0
- package/server/dist/providerConversation.js +17 -0
- package/server/dist/providers/claude-native/resumeSummary.d.ts +9 -0
- package/server/dist/providers/claude-native/resumeSummary.js +102 -49
- package/server/dist/providers/claude-native/worker.js +8 -4
- package/server/dist/providers/claude.js +2 -1
- package/server/dist/providers/clusterTaskToolDefinitions.js +4 -4
- package/server/dist/providers/codex-appserver/catalog.js +16 -1
- package/server/dist/providers/codex.js +2 -1
- package/server/dist/providers/codexCodeMode.d.ts +1 -1
- package/server/dist/providers/codexCodeMode.js +4 -3
- package/server/dist/providers/cursor/print.js +2 -1
- package/server/dist/providers/cursor/worker.js +2 -1
- package/server/dist/providers/llamacpp.js +17 -8
- package/server/dist/providers/ollamaRecovery.js +6 -6
- package/server/dist/providers/ollamaResilience.js +3 -3
- package/server/dist/providers/ollamaTokens.js +1 -1
- package/server/dist/quota.d.ts +0 -18
- package/server/dist/quota.js +0 -44
- package/server/dist/replacementHistory.d.ts +19 -0
- package/server/dist/replacementHistory.js +49 -0
- package/server/dist/server/broadcast.d.ts +2 -1
- package/server/dist/server/broadcast.js +1 -0
- package/server/dist/server/prompts.d.ts +1 -0
- package/server/dist/server/prompts.js +6 -1
- package/server/dist/sessionJsonl.d.ts +1 -1
- package/server/dist/sessionJsonl.js +115 -40
- package/server/dist/smartPickup.d.ts +2 -1
- package/server/dist/smartPickup.js +28 -1
- package/server/dist/smartPickupAdapters.js +15 -2
- package/server/dist/smartPickupLedger.js +6 -4
- package/server/dist/smartPickupObserver.d.ts +1 -0
- package/server/dist/smartPickupObserver.js +24 -15
- package/server/dist/transcriptWorker.d.ts +34 -0
- package/server/dist/transcriptWorker.js +201 -0
- package/server/dist/workflowStore.d.ts +1 -0
- package/server/dist/workflowStore.js +31 -0
- package/server/dist/ws/clusterHandlers.d.ts +2 -0
- package/server/dist/ws/clusterHandlers.js +64 -27
- package/server/dist/ws/handoffHandlers.js +5 -2
- package/server/dist/ws/transcriptWorkerHandlers.d.ts +25 -0
- package/server/dist/ws/transcriptWorkerHandlers.js +139 -0
- package/server/dist/ws/turnEngine.js +23 -9
- package/server/dist/ws/updatePrimaryConfig.js +27 -8
- package/server/dist/ws/workflowHandlers.d.ts +4 -1
- package/server/dist/ws/workflowHandlers.js +3 -1
- package/server/package.json +1 -1
- package/server/src/atomicFile.ts +1 -2
- package/server/src/capabilities.ts +58 -17
- package/server/src/cliUpdateDecision.ts +5 -4
- package/server/src/clusterAutoTurn.ts +26 -21
- package/server/src/clusterBusyReminder.ts +1 -1
- package/server/src/clusterDirector.ts +1 -1
- package/server/src/clusterPeerOps.ts +11 -8
- package/server/src/clusterProgress.ts +1 -1
- package/server/src/clusterSkills.ts +79 -0
- package/server/src/clusterSnapshots.ts +1 -0
- package/server/src/clusterStore.ts +64 -1
- package/server/src/diagnostics/codeSkew.ts +1 -0
- package/server/src/eventLog.ts +73 -13
- package/server/src/historyLimits.ts +2 -0
- package/server/src/http/router.ts +1 -1
- package/server/src/index.ts +23 -0
- package/server/src/jsonlLines.ts +52 -0
- package/server/src/management/identity.ts +1 -0
- package/server/src/mcp/clusterMcpTools.ts +4 -4
- package/server/src/project/taskLedger.ts +7 -5
- package/server/src/providerConversation.ts +15 -0
- package/server/src/providers/claude-native/resumeSummary.ts +98 -50
- package/server/src/providers/claude-native/worker.ts +8 -4
- package/server/src/providers/claude.ts +2 -1
- package/server/src/providers/clusterTaskToolDefinitions.ts +4 -4
- package/server/src/providers/codex-appserver/catalog.ts +14 -1
- package/server/src/providers/codex.ts +2 -1
- package/server/src/providers/codexCodeMode.ts +4 -4
- package/server/src/providers/cursor/print.ts +2 -1
- package/server/src/providers/cursor/worker.ts +2 -1
- package/server/src/providers/llamacpp.ts +18 -7
- package/server/src/providers/llamacppRecovery.ts +2 -0
- package/server/src/providers/ollamaRecovery.ts +6 -6
- package/server/src/providers/ollamaResilience.ts +3 -3
- package/server/src/providers/ollamaTokens.ts +1 -1
- package/server/src/providers/ollamaToolSubset.ts +3 -3
- package/server/src/quota.ts +0 -50
- package/server/src/replacementHistory.ts +44 -0
- package/server/src/server/broadcast.ts +2 -0
- package/server/src/server/prompts.ts +8 -1
- package/server/src/sessionJsonl.ts +92 -32
- package/server/src/smartPickup.ts +27 -3
- package/server/src/smartPickupAdapters.ts +17 -3
- package/server/src/smartPickupLedger.ts +6 -4
- package/server/src/smartPickupObserver.ts +20 -11
- package/server/src/transcriptWorker.ts +182 -0
- package/server/src/workflowStore.ts +21 -0
- package/server/src/ws/clusterHandlers.ts +46 -27
- package/server/src/ws/handoffHandlers.ts +5 -1
- package/server/src/ws/transcriptWorkerHandlers.ts +126 -0
- package/server/src/ws/turnEngine.ts +20 -8
- package/server/src/ws/updatePrimaryConfig.ts +25 -6
- package/server/src/ws/workflowHandlers.ts +3 -1
- package/shared/dist/clusterCoordination.d.ts +2 -0
- package/shared/dist/clusterCoordination.js +5 -1
- package/shared/dist/protocol/autoPickup.d.ts +3 -0
- package/shared/dist/protocol/clientMessages.d.ts +3 -2
- package/shared/dist/protocol/clusters.d.ts +13 -1
- package/shared/dist/protocol/index.d.ts +1 -0
- package/shared/dist/protocol/index.js +1 -0
- package/shared/dist/protocol/models.d.ts +4 -3
- package/shared/dist/protocol/models.js +26 -2
- package/shared/dist/protocol/serverMessages.d.ts +2 -1
- package/shared/dist/protocol/tasks.d.ts +4 -0
- package/shared/dist/protocol/transcriptWorker.d.ts +47 -0
- package/shared/dist/protocol/transcriptWorker.js +2 -0
- package/shared/dist/runtimeVersions.d.ts +1 -0
- package/shared/dist/runtimeVersions.js +14 -0
- package/shared/src/clusterCoordination.ts +7 -1
- package/shared/src/protocol/autoPickup.ts +5 -0
- package/shared/src/protocol/clientMessages.ts +5 -0
- package/shared/src/protocol/clusters.ts +16 -1
- package/shared/src/protocol/index.ts +1 -0
- package/shared/src/protocol/models.ts +31 -5
- package/shared/src/protocol/serverMessages.ts +2 -0
- package/shared/src/protocol/settings.ts +2 -3
- package/shared/src/protocol/tasks.ts +4 -7
- package/shared/src/protocol/transcriptWorker.ts +49 -0
- package/shared/src/runtimeVersions.ts +14 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EffortLevel, ModelName } from './providers.js';
|
|
2
2
|
export declare const CLAUDE_MODELS: readonly ["haiku", "sonnet", "opus", "claude-fable-5-2", "claude-fable-5-1", "claude-fable-5", "claude-sonnet-5", "claude-opus-5-5", "claude-opus-5", "claude-opus-4-8", "claude-opus-4-7", "claude-opus-4-6", "opus[1m]"];
|
|
3
3
|
export declare const CLAUDE_MODEL_LABELS: Record<string, string>;
|
|
4
|
-
export declare const CODEX_MODELS: readonly ["gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna", "gpt-5.5", "gpt-5.3-codex", "gpt-5.2-codex", "gpt-5.1-codex-max", "gpt-5.4-mini", "gpt-5.2", "gpt-5.1-codex-mini"];
|
|
4
|
+
export declare const CODEX_MODELS: readonly ["gpt-6.2-sol", "gpt-6.2-astra", "gpt-6-astra", "gpt-6.1-sol", "gpt-6-sol", "gpt-6-luna", "gpt-5.5", "gpt-5.3-codex", "gpt-5.2-codex", "gpt-5.1-codex-max", "gpt-5.4-mini", "gpt-5.2", "gpt-5.1-codex-mini"];
|
|
5
5
|
export interface CodexModelInfo {
|
|
6
6
|
id: string;
|
|
7
7
|
label: string;
|
|
@@ -13,8 +13,8 @@ export interface CodexModelInfo {
|
|
|
13
13
|
supportedEfforts?: EffortLevel[];
|
|
14
14
|
}
|
|
15
15
|
export declare const CODEX_MODEL_INFO: Record<string, CodexModelInfo>;
|
|
16
|
-
export declare const CODEX_PICKER_MODELS: ("gpt-6-astra" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.3-codex" | "gpt-5.2-codex" | "gpt-5.1-codex-max" | "gpt-5.4-mini" | "gpt-5.2" | "gpt-5.1-codex-mini")[];
|
|
17
|
-
export declare const DEFAULT_CODEX_MODEL: "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.3-codex" | "gpt-5.2-codex" | "gpt-5.1-codex-max" | "gpt-5.4-mini" | "gpt-5.2" | "gpt-5.1-codex-mini";
|
|
16
|
+
export declare const CODEX_PICKER_MODELS: ("gpt-6.2-sol" | "gpt-6.2-astra" | "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.3-codex" | "gpt-5.2-codex" | "gpt-5.1-codex-max" | "gpt-5.4-mini" | "gpt-5.2" | "gpt-5.1-codex-mini")[];
|
|
17
|
+
export declare const DEFAULT_CODEX_MODEL: "gpt-6.2-sol" | "gpt-6.2-astra" | "gpt-6-astra" | "gpt-6.1-sol" | "gpt-6-sol" | "gpt-6-luna" | "gpt-5.5" | "gpt-5.3-codex" | "gpt-5.2-codex" | "gpt-5.1-codex-max" | "gpt-5.4-mini" | "gpt-5.2" | "gpt-5.1-codex-mini";
|
|
18
18
|
export interface ClaudeCatalogModel {
|
|
19
19
|
id: string;
|
|
20
20
|
displayName: string;
|
|
@@ -169,6 +169,7 @@ export interface Capabilities {
|
|
|
169
169
|
latestVersions?: {
|
|
170
170
|
claude?: string;
|
|
171
171
|
codex?: string;
|
|
172
|
+
cursor?: string;
|
|
172
173
|
ollama?: string;
|
|
173
174
|
strata?: string;
|
|
174
175
|
xolotl?: string;
|
|
@@ -37,6 +37,8 @@ export const CLAUDE_MODEL_LABELS = {
|
|
|
37
37
|
// re-pin the naming to a single generation, and don't assume a single-dash
|
|
38
38
|
// `gpt-<major>-<name>` shape: 6.1 brought the dotted minor back.
|
|
39
39
|
export const CODEX_MODELS = [
|
|
40
|
+
'gpt-6.2-sol',
|
|
41
|
+
'gpt-6.2-astra',
|
|
40
42
|
'gpt-6-astra',
|
|
41
43
|
'gpt-6.1-sol',
|
|
42
44
|
'gpt-6-sol',
|
|
@@ -50,8 +52,31 @@ export const CODEX_MODELS = [
|
|
|
50
52
|
'gpt-5.1-codex-mini',
|
|
51
53
|
];
|
|
52
54
|
export const CODEX_MODEL_INFO = {
|
|
55
|
+
// GPT-6.2 cold-catalog fallback. The live catalog is authoritative for
|
|
56
|
+
// availability, default choice, efforts and images. Both entries use the
|
|
57
|
+
// observed 872K catalog maximum with its 95% effective margin; the 128K
|
|
58
|
+
// output fallback is retained, not a newly advertised provider output cap.
|
|
59
|
+
'gpt-6.2-sol': {
|
|
60
|
+
id: 'gpt-6.2-sol',
|
|
61
|
+
label: '6.2 SOL',
|
|
62
|
+
picker: true,
|
|
63
|
+
defaultForCodex: true,
|
|
64
|
+
publishedContextWindow: 872_000,
|
|
65
|
+
publishedMaxOutput: 128_000,
|
|
66
|
+
fallbackOperationalWindow: 828_400,
|
|
67
|
+
supportedEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultra'],
|
|
68
|
+
},
|
|
69
|
+
'gpt-6.2-astra': {
|
|
70
|
+
id: 'gpt-6.2-astra',
|
|
71
|
+
label: '6.2 ASTRA',
|
|
72
|
+
picker: true,
|
|
73
|
+
publishedContextWindow: 872_000,
|
|
74
|
+
publishedMaxOutput: 128_000,
|
|
75
|
+
fallbackOperationalWindow: 828_400,
|
|
76
|
+
supportedEfforts: ['low', 'medium', 'high', 'xhigh', 'max', 'ultra'],
|
|
77
|
+
},
|
|
53
78
|
// GPT-6 Astra (2026-09-03). Codex's own catalog reports isDefault:true for it,
|
|
54
|
-
// so it
|
|
79
|
+
// so it was Arco's default then. Two things here are unlike every 5.x entry:
|
|
55
80
|
// Arco asks for the live catalog maximum by default. This fallback is the
|
|
56
81
|
// current 872K max after Codex's 95% effective-window margin. Its effort
|
|
57
82
|
// surface runs all the way to 'ultra'.
|
|
@@ -59,7 +84,6 @@ export const CODEX_MODEL_INFO = {
|
|
|
59
84
|
id: 'gpt-6-astra',
|
|
60
85
|
label: '6 ASTRA',
|
|
61
86
|
picker: true,
|
|
62
|
-
defaultForCodex: true,
|
|
63
87
|
publishedContextWindow: 1_050_000,
|
|
64
88
|
publishedMaxOutput: 128_000,
|
|
65
89
|
fallbackOperationalWindow: 828_400,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OutputSavedMessage } from '../outputs.js';
|
|
2
|
+
import type { TranscriptWorkerResultMessage } from './transcriptWorker.js';
|
|
2
3
|
import type { OperatorQuestionMessage, OperatorQuestionReplyResultMessage, OperatorQuestionDismissResultMessage, OperatorQuestionState } from './operatorQuestions.js';
|
|
3
4
|
import type { VoiceToolCallMessage, ComputerContextUpdatedMessage, ComputerActivityChangedMessage } from './voiceOperator.js';
|
|
4
5
|
import type { HubLinkStatusMessage } from './remoteManagement.js';
|
|
@@ -824,7 +825,7 @@ export interface TurnMessagesDeliveredMessage {
|
|
|
824
825
|
workflowId: string;
|
|
825
826
|
clientMessageIds: string[];
|
|
826
827
|
}
|
|
827
|
-
export type ServerMessage = StorageWarningMessage | TurnMessagesDeliveredMessage | AppUpdateAvailableMessage | ComputerActivityChangedMessage | ComputerContextUpdatedMessage | ConnectedMessage | WorkflowCreatedMessage | WorkspaceSnapshotMessage | WorkflowConfigSyncedMessage | PrimaryTextMessage | PrimaryCompleteMessage | PrimaryTurnTokenUsageMessage | HookRewroteInputMessage | ToolGateTriggeredMessage | GateRequiredMessage | GateResolvedMessage | GateStandingMessage | ToolLoopWarningMessage | WorkerStuckMessage | ToolPostureSetMessage | GoalSetMessage | GoalRunStateMessage | PinnedSkillsSetMessage | ProjectTrustPromptMessage | ProjectTrustSetMessage | FileMutationQueuedMessage | ModelResolvedMessage | PrimaryRefusalMessage | CtxActionMessage | NativeCompactingMessage | ContextFoldedMessage | NativeCompactedMessage | PrimaryToolCounterMessage | SandboxChunkAddedMessage | SandboxDbClearedMessage | ToolFilteredMessage | ToolEvictedMessage | PeerMessageSentMessage | PeerMessageReceivedMessage | PeerSendRejectedMessage | PrimaryModelMessage | PrimaryThinkingMessage | PrimaryToolUseMessage | PrimaryTurnStartedMessage | PrimaryTurnEndedMessage | WorkerSpawnedMessage | WorkerTextMessage | WorkerThinkingMessage | WorkerToolUseMessage | WorkerFileContextMessage | FileContextMessage | WorkerCompleteMessage | WorkerActivityMessage | WorkerModelMessage | WorkerErrorMessage | FileUploadedMessage | CapabilitiesUpdatedMessage | CapabilitiesChangedMessage | SettingsUpdatedMessage | ConversationChangedMessage | PrimaryArtifactMessage | QuotaStatusMessage | TurnCancelledMessage | WorkflowStateSnapshotMessage | ProviderConversationStateMessage | WorkflowSessionMetadataMessage | ReplayBatchMessage | ShutdownMessage | SystemErrorMessage | UserMessageEchoMessage | ReviewStartedMessage | ReviewArtifactReadyMessage | ResearchStartedMessage | ResearchProgressMessage | ResearchCompleteMessage | CompareStartedMessage | CompareLegDeltaMessage | CompareLegCompleteMessage | CompareCompleteMessage | CompareVoteRecordedMessage | ProviderFellBackMessage | DiagnosticsMessage | DocEditStartedMessage | DocEditProposedMessage | MdTuneupStartedMessage | MdTuneupProposedMessage | MdTuneupAppliedMessage | MdTuneupCandidatesMessage | MdTuneupUndoneMessage | KnowledgeDistillStartedMessage | KnowledgeDistillProposedMessage | RecallSummaryReadyMessage | HandoffStartedMessage | HandoffArtifactReadyMessage | HandoffCompleteMessage | HandoffLockSnapshotMessage | SpawnFromHereCompleteMessage | CheckpointCreatedMessage | TurnChangesMessage | CheckpointRevertedMessage | LiveChangesSnapshotMessage | GitOpResultMessage | BakeoffListResultMessage | BakeoffStateMessage | BakeoffErrorMessage | BakeoffAttemptsRemovedMessage | OutputSavedMessage | MediaOpResultMessage | MediaStemsResultMessage | SessionEntryMessage | ContextUsageMessage | UltracodeFleetProgressMessage | ContextBudgetMessage | OperatorQuestionMessage | OperatorQuestionDismissResultMessage | OperatorQuestionReplyResultMessage | VoiceToolCallMessage | SystemNoticeMessage | ClaudeNativeQuestionSettledMessage | QueuedMessageCancelledMessage | QueuedMessageEditResultMessage | QueuedMessagesDrainedMessage | PrimaryActivityMessage | SessionHistoryStatusMessage | PlanAttachedMessage | PlanDetachedMessage | CodexTokenSnapshotMessage | PreviewSetMessage | PreviewClearedMessage | PreviewHistoryMessage | OperatorLabelMessage | LeafMoveMessage | QueueUpdateMessage | TodosUpdatedMessage | PlanSetMessage | PlanExitedMessage | PlanCandidateReadyMessage | TaskStartedMessage | TaskStatusMessage | BranchSummaryMessage | ClusterStateMessage | ClusterNotFoundMessage | ClusterCreatedMessage | ClusterCreationFinishedMessage | ClusterDeletedMessage | ClusterMemberAddedMessage | ClusterMemberRemovedMessage | ClusterMemberReplacedMessage | ClusterBroadcastDispatchedMessage | ClusterDispatchResultMessage | ClusterSwarmCreatedMessage | ClusterOrchestrationAssistStartedMessage | ClusterOrchestrationProposalStartedMessage | ClusterOrchestrationProposalSnapshotMessage | ClusterOrchestrationProposalProposedMessage | ClusterOrchestrationProposalRejectedMessage | ClusterOrchestrationProposalAppliedMessage | ClusterPlanChangedMessage | ClusterMemberNudgedMessage | WorkflowRenamedMessage | WorkflowRenameResultMessage | CodebaseMemoryStateMessage | ClusterAutoTurnFiredMessage | ClusterSnapshotListResultMessage | ClusterSnapshotSavedMessage | ClusterSnapshotConflictMessage | ClusterSnapshotErrorMessage | TerminalOpenedMessage | TerminalKilledMessage | TerminalCommandLoggedMessage | TerminalSessionsMessage | TaskLedgerSnapshotMessage | TaskLedgerEventMessage | McpRegistrySnapshotMessage | McpProbeResultMessage | McpAllowSnapshotMessage | McpMalwareWarningMessage | GenesisSeedUpdatedMessage | WorkflowCwdBoundMessage | GenesisScaffoldedMessage | GenesisPlanSavedMessage | GenesisCreativeArmedMessage | GenesisAssistStartedMessage | GenesisAssistProposedMessage | PreviewCaptureStartedMessage | PreviewCaptureReadyMessage | WorkbenchNoticeMessage | NotificationMutesMessage | AttentionEventMessage | AttentionQuestionClosedMessage | HubLinkStatusMessage;
|
|
828
|
+
export type ServerMessage = TranscriptWorkerResultMessage | StorageWarningMessage | TurnMessagesDeliveredMessage | AppUpdateAvailableMessage | ComputerActivityChangedMessage | ComputerContextUpdatedMessage | ConnectedMessage | WorkflowCreatedMessage | WorkspaceSnapshotMessage | WorkflowConfigSyncedMessage | PrimaryTextMessage | PrimaryCompleteMessage | PrimaryTurnTokenUsageMessage | HookRewroteInputMessage | ToolGateTriggeredMessage | GateRequiredMessage | GateResolvedMessage | GateStandingMessage | ToolLoopWarningMessage | WorkerStuckMessage | ToolPostureSetMessage | GoalSetMessage | GoalRunStateMessage | PinnedSkillsSetMessage | ProjectTrustPromptMessage | ProjectTrustSetMessage | FileMutationQueuedMessage | ModelResolvedMessage | PrimaryRefusalMessage | CtxActionMessage | NativeCompactingMessage | ContextFoldedMessage | NativeCompactedMessage | PrimaryToolCounterMessage | SandboxChunkAddedMessage | SandboxDbClearedMessage | ToolFilteredMessage | ToolEvictedMessage | PeerMessageSentMessage | PeerMessageReceivedMessage | PeerSendRejectedMessage | PrimaryModelMessage | PrimaryThinkingMessage | PrimaryToolUseMessage | PrimaryTurnStartedMessage | PrimaryTurnEndedMessage | WorkerSpawnedMessage | WorkerTextMessage | WorkerThinkingMessage | WorkerToolUseMessage | WorkerFileContextMessage | FileContextMessage | WorkerCompleteMessage | WorkerActivityMessage | WorkerModelMessage | WorkerErrorMessage | FileUploadedMessage | CapabilitiesUpdatedMessage | CapabilitiesChangedMessage | SettingsUpdatedMessage | ConversationChangedMessage | PrimaryArtifactMessage | QuotaStatusMessage | TurnCancelledMessage | WorkflowStateSnapshotMessage | ProviderConversationStateMessage | WorkflowSessionMetadataMessage | ReplayBatchMessage | ShutdownMessage | SystemErrorMessage | UserMessageEchoMessage | ReviewStartedMessage | ReviewArtifactReadyMessage | ResearchStartedMessage | ResearchProgressMessage | ResearchCompleteMessage | CompareStartedMessage | CompareLegDeltaMessage | CompareLegCompleteMessage | CompareCompleteMessage | CompareVoteRecordedMessage | ProviderFellBackMessage | DiagnosticsMessage | DocEditStartedMessage | DocEditProposedMessage | MdTuneupStartedMessage | MdTuneupProposedMessage | MdTuneupAppliedMessage | MdTuneupCandidatesMessage | MdTuneupUndoneMessage | KnowledgeDistillStartedMessage | KnowledgeDistillProposedMessage | RecallSummaryReadyMessage | HandoffStartedMessage | HandoffArtifactReadyMessage | HandoffCompleteMessage | HandoffLockSnapshotMessage | SpawnFromHereCompleteMessage | CheckpointCreatedMessage | TurnChangesMessage | CheckpointRevertedMessage | LiveChangesSnapshotMessage | GitOpResultMessage | BakeoffListResultMessage | BakeoffStateMessage | BakeoffErrorMessage | BakeoffAttemptsRemovedMessage | OutputSavedMessage | MediaOpResultMessage | MediaStemsResultMessage | SessionEntryMessage | ContextUsageMessage | UltracodeFleetProgressMessage | ContextBudgetMessage | OperatorQuestionMessage | OperatorQuestionDismissResultMessage | OperatorQuestionReplyResultMessage | VoiceToolCallMessage | SystemNoticeMessage | ClaudeNativeQuestionSettledMessage | QueuedMessageCancelledMessage | QueuedMessageEditResultMessage | QueuedMessagesDrainedMessage | PrimaryActivityMessage | SessionHistoryStatusMessage | PlanAttachedMessage | PlanDetachedMessage | CodexTokenSnapshotMessage | PreviewSetMessage | PreviewClearedMessage | PreviewHistoryMessage | OperatorLabelMessage | LeafMoveMessage | QueueUpdateMessage | TodosUpdatedMessage | PlanSetMessage | PlanExitedMessage | PlanCandidateReadyMessage | TaskStartedMessage | TaskStatusMessage | BranchSummaryMessage | ClusterStateMessage | ClusterNotFoundMessage | ClusterCreatedMessage | ClusterCreationFinishedMessage | ClusterDeletedMessage | ClusterMemberAddedMessage | ClusterMemberRemovedMessage | ClusterMemberReplacedMessage | ClusterBroadcastDispatchedMessage | ClusterDispatchResultMessage | ClusterSwarmCreatedMessage | ClusterOrchestrationAssistStartedMessage | ClusterOrchestrationProposalStartedMessage | ClusterOrchestrationProposalSnapshotMessage | ClusterOrchestrationProposalProposedMessage | ClusterOrchestrationProposalRejectedMessage | ClusterOrchestrationProposalAppliedMessage | ClusterPlanChangedMessage | ClusterMemberNudgedMessage | WorkflowRenamedMessage | WorkflowRenameResultMessage | CodebaseMemoryStateMessage | ClusterAutoTurnFiredMessage | ClusterSnapshotListResultMessage | ClusterSnapshotSavedMessage | ClusterSnapshotConflictMessage | ClusterSnapshotErrorMessage | TerminalOpenedMessage | TerminalKilledMessage | TerminalCommandLoggedMessage | TerminalSessionsMessage | TaskLedgerSnapshotMessage | TaskLedgerEventMessage | McpRegistrySnapshotMessage | McpProbeResultMessage | McpAllowSnapshotMessage | McpMalwareWarningMessage | GenesisSeedUpdatedMessage | WorkflowCwdBoundMessage | GenesisScaffoldedMessage | GenesisPlanSavedMessage | GenesisCreativeArmedMessage | GenesisAssistStartedMessage | GenesisAssistProposedMessage | PreviewCaptureStartedMessage | PreviewCaptureReadyMessage | WorkbenchNoticeMessage | NotificationMutesMessage | AttentionEventMessage | AttentionQuestionClosedMessage | HubLinkStatusMessage;
|
|
828
829
|
export type WorkflowEvent<M extends ServerMessage = ServerMessage> = M & {
|
|
829
830
|
seq: number;
|
|
830
831
|
parentEventSeq?: number;
|
|
@@ -33,6 +33,10 @@ export interface LedgerTask {
|
|
|
33
33
|
worktreeRequired?: boolean;
|
|
34
34
|
release?: string;
|
|
35
35
|
signoff?: TaskSignoff;
|
|
36
|
+
directorClosure?: {
|
|
37
|
+
byWorkflowId: string;
|
|
38
|
+
at: number;
|
|
39
|
+
};
|
|
36
40
|
}
|
|
37
41
|
export type TaskSignoffState = 'met' | 'not_met' | 'partial';
|
|
38
42
|
export interface TaskSignoff {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { EffortLevel, ProviderName } from './providers.js';
|
|
2
|
+
export interface TranscriptWorkerPreview {
|
|
3
|
+
token: string;
|
|
4
|
+
seed: string;
|
|
5
|
+
bytes: number;
|
|
6
|
+
availableTurns: number;
|
|
7
|
+
selectedTurns: number;
|
|
8
|
+
partialIncluded: boolean;
|
|
9
|
+
cutoffSeq: number;
|
|
10
|
+
historyMode?: 'recent' | 'full';
|
|
11
|
+
requestedTurns?: number;
|
|
12
|
+
truncated?: boolean;
|
|
13
|
+
historyFallback?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface TranscriptWorkerPreviewMessage {
|
|
16
|
+
type: 'transcript_worker_preview';
|
|
17
|
+
requestId: string;
|
|
18
|
+
workflowId: string;
|
|
19
|
+
turns: number;
|
|
20
|
+
includePartial: boolean;
|
|
21
|
+
preface: string;
|
|
22
|
+
replacement?: {
|
|
23
|
+
clusterId: string;
|
|
24
|
+
mode: 'recent' | 'full';
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface TranscriptWorkerCreateMessage {
|
|
28
|
+
type: 'transcript_worker_create';
|
|
29
|
+
requestId: string;
|
|
30
|
+
token: string;
|
|
31
|
+
destination: {
|
|
32
|
+
workingDirectory: string;
|
|
33
|
+
name: string;
|
|
34
|
+
provider: ProviderName;
|
|
35
|
+
model: string;
|
|
36
|
+
effort: EffortLevel;
|
|
37
|
+
providerAccountRef?: string;
|
|
38
|
+
skipPermissions?: boolean;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface TranscriptWorkerResultMessage {
|
|
42
|
+
type: 'transcript_worker_result';
|
|
43
|
+
requestId: string;
|
|
44
|
+
preview?: TranscriptWorkerPreview;
|
|
45
|
+
newWorkflowId?: string;
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function strataEngineReleaseVersion(feed: unknown, release: unknown): string | undefined;
|
|
2
2
|
export declare function llamacppBuild(version: string): number | undefined;
|
|
3
3
|
export declare function compareLlamacppBuild(a: string, b: string): number | undefined;
|
|
4
|
+
export declare function compareCursorVersions(a: string, b: string): number | undefined;
|
|
@@ -39,4 +39,18 @@ export function compareLlamacppBuild(a, b) {
|
|
|
39
39
|
const aa = llamacppBuild(a), bb = llamacppBuild(b);
|
|
40
40
|
return aa === undefined || bb === undefined ? undefined : aa < bb ? -1 : aa > bb ? 1 : 0;
|
|
41
41
|
}
|
|
42
|
+
// Cursor uses a date plus a build hash, not semver. A different hash on the
|
|
43
|
+
// same date has no reliable ordering; leave that comparison unknown.
|
|
44
|
+
export function compareCursorVersions(a, b) {
|
|
45
|
+
const date = (value) => {
|
|
46
|
+
const stamp = /^(\d{4}\.\d{2}\.\d{2})-[a-f0-9]{6,40}$/i.exec(value)?.[1];
|
|
47
|
+
if (!stamp)
|
|
48
|
+
return undefined;
|
|
49
|
+
const iso = stamp.replaceAll('.', '-');
|
|
50
|
+
const parsed = new Date(`${iso}T00:00:00Z`);
|
|
51
|
+
return Number.isFinite(parsed.getTime()) && parsed.toISOString().startsWith(iso) ? stamp : undefined;
|
|
52
|
+
};
|
|
53
|
+
const aa = date(a), bb = date(b);
|
|
54
|
+
return !aa || !bb ? undefined : aa < bb ? -1 : aa > bb ? 1 : a === b ? 0 : undefined;
|
|
55
|
+
}
|
|
42
56
|
//# sourceMappingURL=runtimeVersions.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"node-pty": "1.1.0"
|
|
5
5
|
},
|
|
6
6
|
"name": "arco-workbench",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.8",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/ghreprimand/arco.git"
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"word-extractor": "1.0.4",
|
|
67
67
|
"ws": "8.22.0",
|
|
68
68
|
"xlsx": "0.20.3",
|
|
69
|
-
"@arco/shared": "0.1.
|
|
69
|
+
"@arco/shared": "0.1.8"
|
|
70
70
|
},
|
|
71
71
|
"bundleDependencies": [
|
|
72
72
|
"@arco/shared",
|
|
@@ -71,7 +71,7 @@ async function main() {
|
|
|
71
71
|
console.log(`Arco v${manifest.version}`);
|
|
72
72
|
requireSupportedNode();
|
|
73
73
|
if (args.length && (args.length !== 1 || args[0] !== '--repair-native')) throw new Error('Unknown setup option.');
|
|
74
|
-
if (args.includes('--repair-native')) { repairNative(manifest); console.log('Native modules repaired. Restart Arco.'); return; }
|
|
74
|
+
if (args.includes('--repair-native')) { await repairNative(manifest); console.log('Native modules repaired. Restart Arco.'); return; }
|
|
75
75
|
if (!process.stdin.isTTY) throw new Error('Run arco setup in an interactive terminal.');
|
|
76
76
|
const prompt = createInterface({ input: process.stdin, output: process.stdout });
|
|
77
77
|
let answer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { chmodSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { chmodSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
|
-
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { basename, delimiter, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
|
|
@@ -10,12 +10,50 @@ export function supportedNodeVersion(version = process.versions.node) {
|
|
|
10
10
|
return !!match && [24, 26].includes(Number(match[1]));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export function npmCliPath(env = process.env, executable = process.execPath) {
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
export function npmCliPath(env = process.env, executable = process.execPath, options = {}) {
|
|
14
|
+
const { argv0 = process.argv0, argv = process.argv, packageRoot = fileURLToPath(new URL('../..', import.meta.url)) } = options;
|
|
15
|
+
const path = (env.PATH || env.Path || '').split(delimiter).filter(Boolean);
|
|
16
|
+
const candidates = [env.npm_execpath];
|
|
17
|
+
const beside = (bin) => {
|
|
18
|
+
candidates.push(join(bin, 'node_modules', 'npm', 'bin', 'npm-cli.js'), join(bin, '..', 'lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'));
|
|
19
|
+
// Homebrew also keeps npm under the versioned keg's libexec directory.
|
|
20
|
+
candidates.push(join(bin, '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'npm-cli.js'));
|
|
21
|
+
};
|
|
22
|
+
for (const command of [executable, env.npm_node_execpath, argv0, ...argv.slice(0, 2)]) {
|
|
23
|
+
if (!command) continue;
|
|
24
|
+
const locations = isAbsolute(command) || /[/\\]/.test(command) ? [resolve(command)] : path.map((bin) => join(bin, command));
|
|
25
|
+
for (const location of locations) {
|
|
26
|
+
beside(dirname(location));
|
|
27
|
+
let real = location;
|
|
28
|
+
try { real = realpathSync(location); } catch { /* an argv path may no longer exist */ }
|
|
29
|
+
if (real !== location) beside(dirname(real));
|
|
30
|
+
// A service can retain only the real Cellar executable and a short PATH.
|
|
31
|
+
// Derive the Homebrew prefix from that executable, without fixed prefixes.
|
|
32
|
+
for (let dir = dirname(real); dirname(dir) !== dir; dir = dirname(dir)) {
|
|
33
|
+
if (basename(dir) === 'Cellar') { beside(join(dirname(dir), 'bin')); break; }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// A custom npm prefix can differ from the Node installation. The installed
|
|
38
|
+
// package provides this location even when launchd/systemd strips PATH.
|
|
39
|
+
if (packageRoot) {
|
|
40
|
+
for (let dir = resolve(packageRoot); dirname(dir) !== dir; dir = dirname(dir)) {
|
|
41
|
+
if (basename(dir) === 'node_modules') { candidates.push(join(dir, 'npm', 'bin', 'npm-cli.js')); break; }
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const bin of path) {
|
|
45
|
+
candidates.push(join(bin, 'npm'));
|
|
46
|
+
beside(bin);
|
|
47
|
+
}
|
|
48
|
+
for (const candidate of new Set(candidates)) {
|
|
49
|
+
if (!candidate) continue;
|
|
50
|
+
try {
|
|
51
|
+
const cli = realpathSync(candidate);
|
|
52
|
+
// The caller invokes this file with Node, never a shell shim or executable.
|
|
53
|
+
if (/\.[cm]?js$/i.test(cli) && statSync(cli).isFile()) return cli;
|
|
54
|
+
} catch { /* try the next installation layout */ }
|
|
55
|
+
}
|
|
56
|
+
throw new Error("Cannot locate npm-cli.js beside Node.js, in Arco's global package directory, or through npm on PATH. Check npm --version in a terminal.");
|
|
19
57
|
}
|
|
20
58
|
export function repairedNativeDir(env = process.env) {
|
|
21
59
|
const home = resolve(env.ARCO_HOME?.trim() || join(homedir(), '.arco'));
|
|
@@ -52,7 +90,36 @@ export function activateRepairedTerminal(env = process.env) {
|
|
|
52
90
|
return { dir: pty, module: require(file) };
|
|
53
91
|
};
|
|
54
92
|
}
|
|
55
|
-
|
|
93
|
+
function buildFailure(output, error, code, signal) {
|
|
94
|
+
const lines = output.replace(/\x1b\[[0-9;]*m/g, '').split(/\r?\n/)
|
|
95
|
+
.map((line) => line.replace(/^npm (?:error|ERR!)\s*/i, '').trim()).filter(Boolean);
|
|
96
|
+
// Prefer the compiler/linker diagnosis over npm and node-gyp's exit summary.
|
|
97
|
+
const decisive = [...lines].reverse().find((line) =>
|
|
98
|
+
!/^(?:gyp ERR!|make:|ninja:|collect2:)|linker command failed/i.test(line)
|
|
99
|
+
&& /\b(?:ld(?:\.lld)?|lld-link|link\.exe):|\berror LNK\d+|\bfatal error\b|\berror:|unknown architecture|undefined symbols/i.test(line));
|
|
100
|
+
const detail = decisive || error?.message || lines.at(-1) || (signal ? `build command stopped by ${signal}` : `build command exited with status ${code}`);
|
|
101
|
+
const step = /\b(?:ld(?:\.lld)?|lld-link|link\.exe):|\berror LNK\d+|unknown architecture|undefined symbols/i.test(decisive || '') ? 'link'
|
|
102
|
+
: /\bfatal error\b|\berror:/i.test(decisive || '') ? 'compile' : 'build';
|
|
103
|
+
return `Native ${step} failed: ${detail.replace(/[.\s]+$/, '')}. The platform build tools may be missing, out of date or broken. Installed native parts were left unchanged and keep working. Repair is only needed when Arco reports that a native part will not load.`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function buildNative(command, args, options) {
|
|
107
|
+
await new Promise((resolve, reject) => {
|
|
108
|
+
const child = spawn(command, args, { ...options, stdio: ['inherit', 'pipe', 'pipe'] });
|
|
109
|
+
let tail = '';
|
|
110
|
+
// Forward progress while retaining only a bounded tail for the closing line.
|
|
111
|
+
const forward = (stream) => (chunk) => {
|
|
112
|
+
tail = (tail + chunk.toString()).slice(-64 * 1024);
|
|
113
|
+
stream.write(chunk);
|
|
114
|
+
};
|
|
115
|
+
child.stdout.on('data', forward(process.stdout));
|
|
116
|
+
child.stderr.on('data', forward(process.stderr));
|
|
117
|
+
child.once('error', (error) => reject(new Error(buildFailure(tail, error))));
|
|
118
|
+
child.once('close', (code, signal) => code === 0 ? resolve() : reject(new Error(buildFailure(tail, undefined, code, signal))));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export async function repairNative(manifest, env = process.env) {
|
|
56
123
|
const versions = manifest.arcoNativeDependencies;
|
|
57
124
|
if (!versions || !['node-pty', 'better-sqlite3'].every((name) => /^\d+\.\d+\.\d+$/.test(versions[name] || ''))) throw new Error('Native dependency versions are missing from this package.');
|
|
58
125
|
const target = repairedNativeDir(env), parent = dirname(target);
|
|
@@ -62,8 +129,7 @@ export function repairNative(manifest, env = process.env) {
|
|
|
62
129
|
const dependencies = Object.fromEntries(Object.entries(versions));
|
|
63
130
|
const allowScripts = Object.fromEntries(Object.entries(versions).map(([name, version]) => [`${name}@${version}`, true]));
|
|
64
131
|
writeFileSync(join(scratch, 'package.json'), JSON.stringify({ name: 'arco-native-repair', version: '1.0.0', private: true, dependencies, allowScripts }, null, 2));
|
|
65
|
-
|
|
66
|
-
if (result.error || result.status !== 0) throw new Error('Native build failed. Install the platform build tools, then run arco setup --repair-native.');
|
|
132
|
+
await buildNative(process.execPath, [npmCliPath(env), 'install', '--no-audit', '--no-fund'], { cwd: scratch, env: { ...env, npm_config_build_from_source: 'true', npm_config_cache: env.npm_config_cache || join(parent, '..', 'cache', 'npm'), npm_config_devdir: env.npm_config_devdir || join(parent, '..', 'cache', 'node-gyp') } });
|
|
67
133
|
const modules = join(scratch, 'node_modules');
|
|
68
134
|
const require = createRequire(join(scratch, 'package.json'));
|
|
69
135
|
const sqliteRoot = join(modules, 'better-sqlite3');
|
|
@@ -41,7 +41,11 @@ export async function updatePackage(manifest, root, deps = {}) {
|
|
|
41
41
|
const env = deps.env ?? process.env, platform = deps.platform ?? process.platform;
|
|
42
42
|
const home = deps.home ?? servicePaths(platform, env).home;
|
|
43
43
|
const prefix = deps.prefix ?? globalPrefix(root, platform);
|
|
44
|
-
|
|
44
|
+
let npm = deps.npm;
|
|
45
|
+
if (!npm) {
|
|
46
|
+
try { npm = npmCliPath(env, process.execPath, { packageRoot: root }); }
|
|
47
|
+
catch (error) { throw new Error(`${error.message} To update manually, stop Arco, run npm install -g arco-workbench, then start Arco again.`); }
|
|
48
|
+
}
|
|
45
49
|
const run = deps.run ?? ((command, args, options = {}) => spawnSync(command, args, { encoding: 'utf8', env: { ...env, npm_config_cache: env.npm_config_cache || join(home, 'cache', 'npm') }, ...options }));
|
|
46
50
|
const service = deps.service ?? ((action) => serviceAction(action));
|
|
47
51
|
const rootStat = lstatSync(root);
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Before this module, ~20 call sites hand-rolled `write tmp -> rename`, 11 of
|
|
4
4
|
// them via byte-identical private `atomicWrite` helpers. They shared three
|
|
5
|
-
// defects (
|
|
6
|
-
// writes):
|
|
5
|
+
// defects (see docs/PERSISTENCE.md, Atomic writes):
|
|
7
6
|
//
|
|
8
7
|
// 1. NO fsync. `rename` is atomic for the directory entry, but the bytes may
|
|
9
8
|
// still be in the page cache. A crash between write and flush can leave a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Capabilities, CliUpdateOutcome } from '@arco/shared';
|
|
2
2
|
import { type CliUpdateDecision, type UpdateCommandResult } from './cliUpdateDecision.js';
|
|
3
|
-
export type CliProvider = 'claude' | 'codex';
|
|
3
|
+
export type CliProvider = 'claude' | 'codex' | 'cursor';
|
|
4
4
|
export declare function probeVersion(bin: string, flags?: string[], timeoutMs?: number): Promise<string>;
|
|
5
5
|
export declare function probeCapabilities(): Promise<Capabilities>;
|
|
6
6
|
export declare function refreshRuntimeVersions(previous: Capabilities): Promise<Capabilities>;
|
|
@@ -20,11 +20,13 @@ export interface UpdateResult {
|
|
|
20
20
|
/**
|
|
21
21
|
* Run the updater for the installation Arco actually launches. Claude uses its
|
|
22
22
|
* built-in updater; Codex shares one installation decision with its version flag.
|
|
23
|
+
* Cursor also uses its own updater, with no installer or npm fallback.
|
|
23
24
|
* Re-probe afterwards: a successful command alone does not prove a working CLI.
|
|
24
25
|
*/
|
|
25
26
|
export declare function runCliUpdate(previous: Capabilities, provider?: CliProvider, runCommand?: (cmd: string, args: string[]) => Promise<UpdateCommandResult>): Promise<UpdateResult>;
|
|
27
|
+
type HelpProvider = Exclude<CliProvider, 'cursor'>;
|
|
26
28
|
export interface CliChange {
|
|
27
|
-
provider:
|
|
29
|
+
provider: HelpProvider;
|
|
28
30
|
fromVersion: string;
|
|
29
31
|
toVersion: string;
|
|
30
32
|
newFlags: string[];
|
|
@@ -40,3 +42,4 @@ export interface CliChange {
|
|
|
40
42
|
*/
|
|
41
43
|
export declare function detectCliChanges(caps: Capabilities): Promise<CliChange[]>;
|
|
42
44
|
export declare function cliSnapshotDir(): string;
|
|
45
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { promisify } from 'util';
|
|
|
3
3
|
import { promises as fs } from 'fs';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
import { createHash } from 'crypto';
|
|
6
|
-
import { CLAUDE_MODELS } from '@arco/shared';
|
|
6
|
+
import { CLAUDE_MODELS, compareCursorVersions } from '@arco/shared';
|
|
7
7
|
import { getStrataBase } from './providers/strata.js';
|
|
8
8
|
import { getDeepSeekBase } from './providers/deepseek.js';
|
|
9
9
|
import { probeStrataVersion, installedXolotlRevision, strataEngineReleaseVersion } from './providers/runtimeVersions.js';
|
|
@@ -20,6 +20,7 @@ const CLI_PROBE_OPTIONS = {
|
|
|
20
20
|
};
|
|
21
21
|
const FALLBACK_EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
22
22
|
const MODELS = [...CLAUDE_MODELS];
|
|
23
|
+
const cliBinary = (provider) => provider === 'cursor' ? 'cursor-agent' : provider;
|
|
23
24
|
// 'unknown' = the CLI isn't installed (the PROVIDERS popover hides those rows).
|
|
24
25
|
// 'broken' = it IS installed but the version probe failed. Keeping them distinct
|
|
25
26
|
// is load-bearing: 2026-09-03 `npm install -g @openai/codex@latest` (the popover's
|
|
@@ -85,7 +86,8 @@ export async function probeCapabilities() {
|
|
|
85
86
|
//
|
|
86
87
|
// Source of truth for "is the operator running the latest CLI?" Claude reads
|
|
87
88
|
// npm; Codex uses its installation decision and npm publication metadata;
|
|
88
|
-
// Ollama
|
|
89
|
+
// Ollama and llama.cpp query GitHub Releases since they are not npm-installed.
|
|
90
|
+
// Cursor reads the version embedded in its public installer as text. All are best-effort: any
|
|
89
91
|
// failure (offline, rate-limited, schema drift) leaves that key undefined
|
|
90
92
|
// and the UI falls back to displaying the installed version with no
|
|
91
93
|
// outdated indicator. Caller decides cadence — boot + the existing 4h
|
|
@@ -118,6 +120,51 @@ async function ollamaLatestRelease() {
|
|
|
118
120
|
return tag.replace(/^v/, '');
|
|
119
121
|
return undefined;
|
|
120
122
|
}
|
|
123
|
+
async function llamacppLatestRelease() {
|
|
124
|
+
// /releases/latest can be a semantic milestone older than the daily builds.
|
|
125
|
+
// Only numeric build tags can be compared to the installed binary's build.
|
|
126
|
+
const data = await fetchJson('https://api.github.com/repos/ggml-org/llama.cpp/releases?per_page=20');
|
|
127
|
+
if (!Array.isArray(data))
|
|
128
|
+
return undefined;
|
|
129
|
+
const builds = data.filter((release) => release && !release.draft)
|
|
130
|
+
.map((release) => typeof release.tag_name === 'string' && /^b[1-9]\d*$/.test(release.tag_name) ? Number(release.tag_name.slice(1)) : NaN)
|
|
131
|
+
.filter(Number.isSafeInteger);
|
|
132
|
+
return builds.length ? `b${Math.max(...builds)}` : undefined;
|
|
133
|
+
}
|
|
134
|
+
async function cursorLatestRelease() {
|
|
135
|
+
try {
|
|
136
|
+
// Read the installer as bounded metadata only; never run fetched shell text.
|
|
137
|
+
const response = await fetch('https://cursor.com/install', { signal: AbortSignal.timeout(REGISTRY_TIMEOUT_MS) });
|
|
138
|
+
if (!response.ok || !response.body)
|
|
139
|
+
return undefined;
|
|
140
|
+
const reader = response.body.getReader();
|
|
141
|
+
const chunks = [];
|
|
142
|
+
let size = 0;
|
|
143
|
+
try {
|
|
144
|
+
while (true) {
|
|
145
|
+
const { done, value } = await reader.read();
|
|
146
|
+
if (done)
|
|
147
|
+
break;
|
|
148
|
+
size += value.byteLength;
|
|
149
|
+
if (size > 64 * 1024) {
|
|
150
|
+
await reader.cancel();
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
chunks.push(value);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
reader.releaseLock();
|
|
158
|
+
}
|
|
159
|
+
const script = Buffer.concat(chunks).toString('utf8');
|
|
160
|
+
const versions = new Set([...script.matchAll(/https:\/\/downloads\.cursor\.com\/(?:lab|stable)\/(\d{4}\.\d{2}\.\d{2}-[a-f0-9]{6,40})\//gi)].map(match => match[1]));
|
|
161
|
+
const version = versions.size === 1 ? [...versions][0] : undefined;
|
|
162
|
+
return version && compareCursorVersions(version, version) === 0 ? version : undefined;
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
121
168
|
export async function refreshRuntimeVersions(previous) {
|
|
122
169
|
// Installed runtimes can change outside Arco. Refresh on demand without
|
|
123
170
|
// probing every CLI/upstream registry or starting an inference service.
|
|
@@ -135,7 +182,7 @@ async function strataLatestRelease() {
|
|
|
135
182
|
return strataEngineReleaseVersion(feed, release);
|
|
136
183
|
}
|
|
137
184
|
export async function probeLatestVersions(codexDecision = npmLatest('@openai/codex').then(probeCodexUpdate)) {
|
|
138
|
-
const [claude, codex, ollama, strata, xolotl] = await Promise.all([
|
|
185
|
+
const [claude, codex, ollama, strata, xolotl, llamacpp, cursor] = await Promise.all([
|
|
139
186
|
npmLatest('@anthropic-ai/claude-code'),
|
|
140
187
|
codexDecision.then((decision) => decision.targetVersion),
|
|
141
188
|
ollamaLatestRelease(),
|
|
@@ -144,19 +191,22 @@ export async function probeLatestVersions(codexDecision = npmLatest('@openai/cod
|
|
|
144
191
|
const sha = data?.sha;
|
|
145
192
|
return typeof sha === 'string' && /^[a-f0-9]{40}$/.test(sha) ? sha : undefined;
|
|
146
193
|
}),
|
|
194
|
+
llamacppLatestRelease(),
|
|
195
|
+
cursorLatestRelease(),
|
|
147
196
|
]);
|
|
148
|
-
return { claude, codex, ollama, strata, xolotl };
|
|
197
|
+
return { claude, codex, ollama, strata, xolotl, llamacpp, cursor };
|
|
149
198
|
}
|
|
150
199
|
function versionForProvider(caps, provider) {
|
|
151
|
-
return provider === 'claude' ? caps.cliVersion : caps.codexVersion ?? 'unknown';
|
|
200
|
+
return provider === 'claude' ? caps.cliVersion : provider === 'cursor' ? caps.cursorVersion ?? 'unknown' : caps.codexVersion ?? 'unknown';
|
|
152
201
|
}
|
|
153
202
|
/**
|
|
154
203
|
* Run the updater for the installation Arco actually launches. Claude uses its
|
|
155
204
|
* built-in updater; Codex shares one installation decision with its version flag.
|
|
205
|
+
* Cursor also uses its own updater, with no installer or npm fallback.
|
|
156
206
|
* Re-probe afterwards: a successful command alone does not prove a working CLI.
|
|
157
207
|
*/
|
|
158
208
|
export async function runCliUpdate(previous, provider = 'claude', runCommand = (cmd, args) => runUpdateCommand(cmd, args, provider)) {
|
|
159
|
-
const previousVersion = provider === '
|
|
209
|
+
const previousVersion = provider === 'claude' ? versionForProvider(previous, provider) : await probeVersion(cliBinary(provider));
|
|
160
210
|
// Pre-flight: for npm-installed CLIs, work out which version can actually run
|
|
161
211
|
// on this machine before installing anything. `@latest` is not automatically
|
|
162
212
|
// installable — a package whose binary ships as a platform-specific
|
|
@@ -165,7 +215,7 @@ export async function runCliUpdate(previous, provider = 'claude', runCommand = (
|
|
|
165
215
|
// and npm reports that as success. See npmPlatformResolve.ts.
|
|
166
216
|
const decision = provider === 'codex'
|
|
167
217
|
? await probeCodexUpdate(await npmLatest('@openai/codex'))
|
|
168
|
-
: { kind: 'unknown', command: { cmd:
|
|
218
|
+
: { kind: 'unknown', command: { cmd: cliBinary(provider), args: ['update'] }, targetVersion: previous.latestVersions?.[provider] };
|
|
169
219
|
const notice = decision.notice;
|
|
170
220
|
const capabilities = provider === 'codex'
|
|
171
221
|
? { ...previous, codexVersion: previousVersion, latestVersions: { ...previous.latestVersions, codex: decision.targetVersion }, codexUpdate: { kind: decision.kind, updateAvailable: !!decision.targetVersion && (compareVersions(previousVersion, decision.targetVersion) ?? 0) < 0, instruction: decision.message ?? decision.notice } }
|
|
@@ -205,7 +255,7 @@ export async function runCliUpdate(previous, provider = 'claude', runCommand = (
|
|
|
205
255
|
// the previous executable still runs and reports the same version.
|
|
206
256
|
const report = describeCliUpdate(provider, previousVersion, currentVersion, next.latestVersions?.[provider], commandResult, notice);
|
|
207
257
|
if (report.outcome === 'failed' && commandResult.exitCode === 0) {
|
|
208
|
-
const reason = await probeFailureReason(provider);
|
|
258
|
+
const reason = await probeFailureReason(cliBinary(provider));
|
|
209
259
|
if (reason) {
|
|
210
260
|
report.error = reason;
|
|
211
261
|
report.message = reason;
|
|
@@ -246,7 +296,7 @@ const HELP_PROBES = {
|
|
|
246
296
|
};
|
|
247
297
|
async function runHelpProbe(bin, args) {
|
|
248
298
|
try {
|
|
249
|
-
const { stdout } = await execFileAsync(...commandArgs(bin, args), CLI_PROBE_OPTIONS);
|
|
299
|
+
const { stdout } = await execFileAsync(...commandArgs(cliBinary(bin), args), CLI_PROBE_OPTIONS);
|
|
250
300
|
return stdout;
|
|
251
301
|
}
|
|
252
302
|
catch {
|
|
@@ -3,6 +3,7 @@ import { promises as fs, constants, statSync } from 'node:fs';
|
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
|
+
import { compareCursorVersions } from '@arco/shared';
|
|
6
7
|
import { commandArgs, findWindowsCommand, npmShimTarget } from './windowsCommand.js';
|
|
7
8
|
import { resolveInstallableVersion } from './npmPlatformResolve.js';
|
|
8
9
|
import { compareVersions } from './updateCheck.js';
|
|
@@ -128,7 +129,8 @@ export async function probeCodexUpdate(published) {
|
|
|
128
129
|
return decideCodexUpdate(installation, published, resolved);
|
|
129
130
|
}
|
|
130
131
|
export function describeCliUpdate(provider, previous, current, target, command, notice) {
|
|
131
|
-
const name = provider === 'codex' ? 'Codex' : 'Claude CLI';
|
|
132
|
+
const name = provider === 'codex' ? 'Codex' : provider === 'cursor' ? 'Cursor' : 'Claude CLI';
|
|
133
|
+
const compare = provider === 'cursor' ? (a, b) => compareCursorVersions(a, b) ?? null : compareVersions;
|
|
132
134
|
if (command.exitCode !== 0) {
|
|
133
135
|
const error = `${name} update failed: ${command.output.trim().slice(0, 2000) || `exit code ${command.exitCode}`}`;
|
|
134
136
|
return { outcome: 'failed', message: error, updated: false, error };
|
|
@@ -137,12 +139,12 @@ export function describeCliUpdate(provider, previous, current, target, command,
|
|
|
137
139
|
const error = `${name} did not run after the update.`;
|
|
138
140
|
return { outcome: 'failed', message: error, updated: false, error };
|
|
139
141
|
}
|
|
140
|
-
if (previous !== current && (
|
|
142
|
+
if (previous !== current && (compare(current, previous) ?? 1) > 0) {
|
|
141
143
|
return { outcome: 'updated', message: `Updated ${name} from v${previous} to v${current}.${notice ? ` ${notice}` : ''}`, updated: true };
|
|
142
144
|
}
|
|
143
145
|
if (notice)
|
|
144
146
|
return { outcome: 'deferred', message: notice, updated: false };
|
|
145
|
-
const comparison = target ?
|
|
147
|
+
const comparison = target ? compare(current, target) : null;
|
|
146
148
|
if (comparison !== null && comparison >= 0)
|
|
147
149
|
return { outcome: 'current', message: `${name} v${current} is up to date for this installation.`, updated: false };
|
|
148
150
|
return { outcome: 'unchanged', updated: false, message: comparison !== null
|
|
@@ -28,6 +28,10 @@ export declare function configure(opts: {
|
|
|
28
28
|
}): void;
|
|
29
29
|
export declare function start(): void;
|
|
30
30
|
export declare function stop(): void;
|
|
31
|
+
export declare function pickupWaitingMail(clusterId: string, liveMembers?: {
|
|
32
|
+
workflowId: string;
|
|
33
|
+
busy: boolean;
|
|
34
|
+
}[] | undefined): Promise<void>;
|
|
31
35
|
export declare function currentAutoTurnDepth(workflowId: string): number;
|
|
32
36
|
export declare function clearAutoTurnDepth(workflowId: string): void;
|
|
33
37
|
export declare function dropMember(workflowId: string): void;
|