arco-workbench 0.1.9 → 0.2.0
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 +14 -12
- package/README.md +5 -3
- package/client/dist/THIRD_PARTY_LICENSES.txt +3912 -0
- package/client/dist/assets/{PhosphorBackdrop-DRu16-Is.js → PhosphorBackdrop-9jNRO1ZM.js} +1 -1
- package/client/dist/assets/{ThemedBackgroundShaderImpl-BLdwwQ4D.js → ThemedBackgroundShaderImpl-tUi3k54Y.js} +1 -1
- package/client/dist/assets/XtermView-B7BOSnVo.js +10 -0
- package/client/dist/assets/{galleryEditor-CI8ClzBa.js → galleryEditor-Ohc2h9cD.js} +1 -1
- package/client/dist/assets/index-CVJVD2Vn.css +1 -0
- package/client/dist/assets/index-ILGXWriO.js +638 -0
- package/client/dist/index.html +3 -3
- package/client/src/App.tsx +42 -9
- package/client/src/components/AskUserQuestionNotice.tsx +37 -10
- package/client/src/components/AttachmentPill.tsx +3 -2
- package/client/src/components/AuthReloginNotice.tsx +25 -6
- package/client/src/components/AutomaticMessage.tsx +3 -1
- package/client/src/components/CatchMeUp.tsx +4 -1
- package/client/src/components/ChatMessage.tsx +43 -5
- package/client/src/components/ChatModeView.tsx +20 -4
- package/client/src/components/ChatPanel.tsx +5 -0
- package/client/src/components/ClusterActivityTab.tsx +9 -3
- package/client/src/components/ClusterComposerButtons.tsx +5 -3
- package/client/src/components/ClusterPlanTab.tsx +55 -8
- package/client/src/components/ClusterRightPanel/AddWorkerSection.tsx +38 -99
- package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +36 -12
- package/client/src/components/ClusterRightPanel/MailboxModal.tsx +61 -8
- package/client/src/components/ClusterRightPanel/MemberRow.tsx +46 -14
- package/client/src/components/ClusterRightPanel/PhoneMemberList.tsx +56 -0
- package/client/src/components/ClusterRightPanel/ReplaceMemberDialog.tsx +38 -9
- package/client/src/components/ClusterRightPanel/SkillsControl.tsx +6 -5
- package/client/src/components/ClusterRightPanel/index.tsx +188 -39
- package/client/src/components/ClusterRightPanel/memberSettings.ts +2 -2
- package/client/src/components/ClusterRightPanel/panels.ts +1 -0
- package/client/src/components/ClusterRightPanel/types.ts +5 -1
- package/client/src/components/ClusterRightPanel/useFreshMemberPicker.ts +82 -0
- package/client/src/components/ClusterTab.tsx +76 -23
- package/client/src/components/ClusterTaskBoardTab.tsx +35 -6
- package/client/src/components/Connections/Connections.tsx +5 -8
- package/client/src/components/Connections/model.ts +2 -2
- package/client/src/components/DialogShell.tsx +4 -0
- package/client/src/components/DirectorContinuePrompt.tsx +56 -0
- package/client/src/components/FileExplorer.tsx +54 -1
- package/client/src/components/FileViewerModal.tsx +39 -7
- package/client/src/components/FirstRun.tsx +3 -2
- package/client/src/components/ForwardMessages.tsx +6 -3
- package/client/src/components/GateApprovalNotice.tsx +7 -4
- package/client/src/components/GeminiSkillNotice.tsx +12 -0
- package/client/src/components/GeminiSubagentLine.tsx +5 -0
- package/client/src/components/GitDialog.tsx +15 -6
- package/client/src/components/GitOtherWork.tsx +2 -1
- package/client/src/components/HandoffDialog.tsx +3 -2
- package/client/src/components/HeaderVersionBox.tsx +6 -2
- package/client/src/components/HistoryTab.tsx +127 -108
- package/client/src/components/Home/HomeView.tsx +14 -3
- package/client/src/components/Home/ResearchLibrary.tsx +107 -0
- package/client/src/components/Home/home.css +6 -0
- package/client/src/components/LoginFlow.tsx +12 -5
- package/client/src/components/MemberCard.tsx +8 -2
- package/client/src/components/MemberPane.tsx +12 -4
- package/client/src/components/MobileNotices.tsx +26 -0
- package/client/src/components/MobileQuestionBar.tsx +35 -0
- package/client/src/components/MobileShell.tsx +811 -0
- package/client/src/components/MobileTextSize.tsx +27 -0
- package/client/src/components/NativeSubagentControls.tsx +12 -1
- package/client/src/components/NorthStarBar.tsx +2 -0
- package/client/src/components/NotificationToasts.tsx +6 -2
- package/client/src/components/OperatorQuestionNotice.tsx +2 -2
- package/client/src/components/PendingQuestionsButton.tsx +44 -5
- package/client/src/components/PhoneUpload.tsx +4 -2
- package/client/src/components/PlanComposerDialog.tsx +7 -7
- package/client/src/components/ProjectsSettings.tsx +3 -0
- package/client/src/components/ProvidersPopover.tsx +9 -6
- package/client/src/components/PurgeConversationModal.tsx +1 -1
- package/client/src/components/QueuedMessagesIndicator.tsx +1 -1
- package/client/src/components/Recall/RecallView.tsx +31 -8
- package/client/src/components/ResearchFolderSetting.tsx +64 -0
- package/client/src/components/RightPanel/ActivityTab.tsx +9 -4
- package/client/src/components/RightPanel/BlastRadiusTab.tsx +6 -8
- package/client/src/components/RightPanel/ConfigTab.tsx +18 -10
- package/client/src/components/RightPanel/FilesTab.tsx +34 -19
- package/client/src/components/RightPanel/PlanTab.tsx +67 -24
- package/client/src/components/RightPanel/UsageTab.tsx +30 -3
- package/client/src/components/RightPanel/index.tsx +42 -3
- package/client/src/components/RuntimeStateBanner.tsx +8 -0
- package/client/src/components/ScratchCloseDialog.tsx +124 -0
- package/client/src/components/SettingsPanel.tsx +181 -69
- package/client/src/components/SkillActivityIndicator.tsx +93 -0
- package/client/src/components/SystemHeader.tsx +2 -7
- package/client/src/components/SystemModal.tsx +37 -45
- package/client/src/components/TabBar.tsx +52 -8
- package/client/src/components/TabContextMenu.tsx +12 -102
- package/client/src/components/TaskCard.tsx +13 -17
- package/client/src/components/TaskChildComposer.tsx +24 -0
- package/client/src/components/TasksPanel.tsx +7 -17
- package/client/src/components/Terminal/FloatingTerminalWindow.tsx +11 -3
- package/client/src/components/Terminal/FloatingWindow.tsx +36 -14
- package/client/src/components/Terminal/XtermView.tsx +19 -2
- package/client/src/components/Terminal/phoneKeys.ts +9 -0
- package/client/src/components/TerminalInput.tsx +149 -32
- package/client/src/components/TranscriptWorkerDialog.tsx +2 -2
- package/client/src/components/UpdateAction.tsx +9 -6
- package/client/src/components/UsageBar.tsx +118 -10
- package/client/src/components/UserManual/MobileManualContent.tsx +58 -0
- package/client/src/components/WorkflowCreator/ClusterMembersSection.tsx +8 -5
- package/client/src/components/WorkflowCreator/PastChatsList.tsx +3 -1
- package/client/src/components/WorkflowCreator/ProjectPicker.tsx +3 -3
- package/client/src/components/WorkflowCreator/ResearchStartForm.tsx +335 -0
- package/client/src/components/WorkflowCreator/index.tsx +124 -36
- package/client/src/components/WorkflowCreator/memberProviders.ts +20 -5
- package/client/src/components/WorkflowCreator/pendingTemplateApply.ts +20 -0
- package/client/src/components/WorkflowCreator/types.ts +18 -0
- package/client/src/components/WorkflowStatusChip.tsx +1 -0
- package/client/src/components/WorkflowView.tsx +51 -13
- package/client/src/components/chatMessageLabel.ts +4 -0
- package/client/src/components/clusterActivity.helpers.ts +5 -1
- package/client/src/components/clusterNeedsYou.ts +3 -8
- package/client/src/components/clusterSurface.helpers.ts +6 -1
- package/client/src/components/composer/submitComposer.ts +7 -1
- package/client/src/components/help/HelpBanner.tsx +10 -5
- package/client/src/components/help/HelpPopover.tsx +5 -0
- package/client/src/components/media/MediaModalHost.tsx +13 -8
- package/client/src/components/plans/PhonePlanView.tsx +66 -0
- package/client/src/components/plans/phonePlanChecklist.ts +45 -0
- package/client/src/components/providerIndicator.ts +83 -0
- package/client/src/components/research/AddResearcherSection.tsx +50 -0
- package/client/src/components/research/ExportResearchDialog.tsx +52 -0
- package/client/src/components/research/QuickResearchOverview.tsx +92 -0
- package/client/src/components/research/RerunResearchDialog.tsx +61 -0
- package/client/src/components/research/ResearchCloseDialog.tsx +98 -0
- package/client/src/components/research/ResearchRemoveDialog.tsx +37 -0
- package/client/src/components/research/ResearchReopenDialog.tsx +160 -0
- package/client/src/components/research/ResearchResultsTab.css +289 -0
- package/client/src/components/research/ResearchResultsTab.tsx +207 -0
- package/client/src/components/research/ResearchRoundsStrip.tsx +127 -0
- package/client/src/components/research/SavedQuickKeep.tsx +58 -0
- package/client/src/components/research/SendResearchDialog.tsx +126 -0
- package/client/src/components/research/StartResearchProjectDialog.tsx +108 -0
- package/client/src/components/research/researchExports.ts +26 -0
- package/client/src/components/research/researchLinks.tsx +30 -0
- package/client/src/components/research/researchView.ts +64 -0
- package/client/src/components/research/researcherRow.tsx +104 -0
- package/client/src/components/settings/AppVersionSection.tsx +2 -0
- package/client/src/components/settings/SettingsLayout.tsx +23 -4
- package/client/src/components/settings/navigation.ts +4 -4
- package/client/src/components/settings/settings.css +18 -0
- package/client/src/components/usageVisibility.ts +4 -6
- package/client/src/components/workSurface/WorkSurfaceControls.tsx +7 -0
- package/client/src/explorer/StorageLens.tsx +10 -3
- package/client/src/help/content/chat.tsx +5 -8
- package/client/src/help/content/cluster.tsx +70 -30
- package/client/src/help/content/composer.tsx +13 -8
- package/client/src/help/content/header.tsx +17 -24
- package/client/src/help/content/media.tsx +2 -2
- package/client/src/help/content/misc.tsx +174 -38
- package/client/src/help/content/recall.tsx +2 -2
- package/client/src/help/content/rightPanel.tsx +8 -8
- package/client/src/help/content/settings.tsx +48 -14
- package/client/src/help/content/tabbar.tsx +6 -2
- package/client/src/help/manualSections/actions.tsx +7 -2
- package/client/src/help/manualSections/chat.tsx +16 -15
- package/client/src/help/manualSections/clusters.tsx +348 -69
- package/client/src/help/manualSections/configuration.tsx +25 -18
- package/client/src/help/manualSections/deepseek.tsx +4 -5
- package/client/src/help/manualSections/gettingStarted.tsx +30 -26
- package/client/src/help/manualSections/maintenance.tsx +9 -5
- package/client/src/help/manualSections/plans.tsx +4 -4
- package/client/src/help/manualSections/powerFeatures.tsx +51 -18
- package/client/src/help/manualSections/providers.tsx +56 -21
- package/client/src/help/manualSections/reference.tsx +6 -6
- package/client/src/help/manualSections/strata.tsx +8 -8
- package/client/src/help/manualSections/workflows.tsx +3 -3
- package/client/src/help/manualSections/workspace.tsx +115 -39
- package/client/src/hooks/useWebSocket.ts +21 -4
- package/client/src/layout/PhoneBottomSheet.tsx +71 -0
- package/client/src/layout/PhonePage.tsx +71 -0
- package/client/src/layout/SlideOut.tsx +36 -9
- package/client/src/layout/layoutRange.ts +41 -4
- package/client/src/layout/phoneChip.ts +14 -0
- package/client/src/layout/phoneOverlay.ts +81 -0
- package/client/src/layout/phonePageActions.ts +40 -0
- package/client/src/stores/appStore.ts +36 -10
- package/client/src/stores/appStore.types.ts +29 -3
- package/client/src/stores/directorContinueStore.ts +22 -0
- package/client/src/stores/draftStore.ts +56 -2
- package/client/src/stores/phoneStore.ts +196 -0
- package/client/src/stores/terminalStore.ts +8 -0
- package/client/src/styles/contextual-help.css +10 -0
- package/client/src/styles/global.css +293 -0
- package/client/src/themes/apply.ts +9 -1
- package/client/src/themes/bootstrap.ts +21 -1
- package/client/src/themes/providerThemes.ts +1 -0
- package/client/src/utils/codexAccountHome.ts +9 -0
- package/client/src/utils/format.ts +8 -2
- package/client/src/utils/gitBranchMark.ts +3 -0
- package/client/src/utils/homeModel.ts +7 -0
- package/client/src/utils/longPress.ts +64 -0
- package/client/src/utils/modelCatalog.ts +4 -0
- package/client/src/utils/providerStatusCheck.ts +30 -0
- package/client/src/utils/startupGate.ts +6 -0
- package/client/src/ws/handleServerMessage.ts +106 -7
- package/docs/ARCHITECTURE.md +63 -37
- package/docs/ARCHITECTURE_REVIEW.md +1 -1
- package/docs/BACKUP.md +60 -9
- package/docs/CHAT.md +15 -11
- package/docs/CHECKPOINTS.md +2 -0
- package/docs/CLIENT.md +70 -36
- package/docs/DEEPSEEK.md +9 -10
- package/docs/DIAGNOSTICS.md +8 -7
- package/docs/DOCKER.md +16 -2
- package/docs/EXTENDING.md +10 -26
- package/docs/FEATURES.md +23 -15
- package/docs/GENESIS.md +3 -1
- package/docs/GETTING_STARTED.md +82 -16
- package/docs/GIT_WORKBENCH.md +5 -5
- package/docs/GLOSSARY.md +36 -23
- package/docs/GOTCHAS.md +102 -67
- package/docs/HTTP_API.md +182 -86
- package/docs/INDEX.md +1 -0
- package/docs/KNOWLEDGE.md +2 -2
- package/docs/LOCAL_SERVICES.md +9 -8
- package/docs/MCP_REGISTRY.md +18 -13
- package/docs/MEDIA_STUDIO.md +7 -11
- package/docs/OPERATIONS.md +101 -24
- package/docs/OPERATOR_ACTIONS.md +24 -22
- package/docs/PERSISTENCE.md +65 -24
- package/docs/PHOSPHOR_DEMO.md +1 -4
- package/docs/PLAN_OR_BOARD.md +2 -2
- package/docs/PRIMITIVES.md +17 -17
- package/docs/PROTOCOL.md +60 -9
- package/docs/PROTOCOL_CLUSTER.md +92 -22
- package/docs/PROTOCOL_PRIMITIVES.md +10 -4
- package/docs/PROVIDERS.md +291 -145
- package/docs/RECALL.md +40 -31
- package/docs/REMOTE_MANAGEMENT.md +27 -51
- package/docs/REPO_LAYOUT.md +4 -3
- package/docs/RESEARCH.md +189 -0
- package/docs/RESUME_INDEX.md +10 -19
- package/docs/SERVICE_MODE.md +11 -5
- package/docs/SETTINGS.md +18 -13
- package/docs/STORAGE_PLAN.md +3 -3
- package/docs/STRATA.md +14 -11
- package/docs/TASK_LEDGER.md +19 -8
- package/docs/TERMINAL.md +14 -10
- package/docs/THIRD_PARTY.md +21 -4
- package/docs/VOICE.md +16 -28
- package/native/linux-arm64/manifest.json +1 -1
- package/node_modules/@arco/shared/dist/clusterCoordination.d.ts +1 -0
- package/node_modules/@arco/shared/dist/clusterCoordination.js +9 -1
- package/node_modules/@arco/shared/dist/clusterRolePresets.js +13 -4
- package/node_modules/@arco/shared/dist/index.d.ts +1 -0
- package/node_modules/@arco/shared/dist/index.js +1 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +7 -0
- package/node_modules/@arco/shared/dist/protocol/autoPickup.js +22 -11
- package/node_modules/@arco/shared/dist/protocol/chat.d.ts +1 -1
- package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +18 -3
- package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +177 -4
- package/node_modules/@arco/shared/dist/protocol/clusters.js +48 -2
- package/node_modules/@arco/shared/dist/protocol/handoffs.d.ts +1 -0
- package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -1
- package/node_modules/@arco/shared/dist/protocol/models.js +4 -3
- package/node_modules/@arco/shared/dist/protocol/providers.d.ts +3 -2
- package/node_modules/@arco/shared/dist/protocol/providers.js +1 -1
- package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +28 -3
- package/node_modules/@arco/shared/dist/protocol/settings.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/settings.js +3 -1
- package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +42 -0
- package/node_modules/@arco/shared/dist/protocol/tasks.js +17 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +4 -0
- package/node_modules/@arco/shared/dist/protocol/workflows.js +2 -0
- package/node_modules/@arco/shared/dist/researchActivity.d.ts +4 -0
- package/node_modules/@arco/shared/dist/researchActivity.js +29 -0
- package/node_modules/@arco/shared/package.json +1 -1
- package/package.json +3 -2
- package/scripts/packaging/services.mjs +19 -2
- package/scripts/packaging/update.mjs +9 -0
- package/server/dist/arcoHome.js +19 -3
- package/server/dist/auth.d.ts +4 -2
- package/server/dist/auth.js +42 -4
- package/server/dist/authLoginSession.d.ts +2 -1
- package/server/dist/authLoginSession.js +13 -3
- package/server/dist/capabilities.d.ts +2 -2
- package/server/dist/capabilities.js +11 -6
- package/server/dist/chatMode.d.ts +3 -0
- package/server/dist/chatMode.js +25 -2
- package/server/dist/checkedFile.d.ts +1 -1
- package/server/dist/checkedFile.js +48 -41
- package/server/dist/cliUpdateDecision.js +1 -1
- package/server/dist/clusterAutoTurn.d.ts +4 -1
- package/server/dist/clusterAutoTurn.js +25 -4
- package/server/dist/clusterBusyReminder.js +2 -1
- package/server/dist/clusterDirector.js +5 -2
- package/server/dist/clusterMailTally.d.ts +11 -0
- package/server/dist/clusterMailTally.js +29 -0
- package/server/dist/clusterMailbox.d.ts +8 -1
- package/server/dist/clusterMailbox.js +53 -4
- package/server/dist/clusterOpenWork.d.ts +22 -0
- package/server/dist/clusterOpenWork.js +85 -0
- package/server/dist/clusterPeerOps.d.ts +32 -5
- package/server/dist/clusterPeerOps.js +253 -49
- package/server/dist/clusterPlanBridge.d.ts +7 -1
- package/server/dist/clusterPlanBridge.js +58 -0
- package/server/dist/clusterPlanStore.d.ts +6 -0
- package/server/dist/clusterPlanStore.js +58 -0
- package/server/dist/clusterPresets.js +23 -3
- package/server/dist/clusterProgress.js +2 -2
- package/server/dist/clusterSkills.js +2 -2
- package/server/dist/clusterSnapshots.d.ts +1 -0
- package/server/dist/clusterSnapshots.js +7 -1
- package/server/dist/clusterStore.d.ts +34 -1
- package/server/dist/clusterStore.js +194 -21
- package/server/dist/clusterTurnOrigin.d.ts +2 -0
- package/server/dist/clusterTurnOrigin.js +19 -0
- package/server/dist/connectionCatalog.js +1 -0
- package/server/dist/cursorUsage.js +3 -3
- package/server/dist/defaults/models.md +11 -14
- package/server/dist/directorContinue.d.ts +47 -0
- package/server/dist/directorContinue.js +311 -0
- package/server/dist/directorContinueHook.d.ts +3 -0
- package/server/dist/directorContinueHook.js +16 -0
- package/server/dist/effortValidation.d.ts +3 -0
- package/server/dist/effortValidation.js +34 -0
- package/server/dist/fileAccessPolicy.js +1 -0
- package/server/dist/fileFetch.d.ts +7 -1
- package/server/dist/fileFetch.js +50 -29
- package/server/dist/geminiMembers.d.ts +8 -0
- package/server/dist/geminiMembers.js +113 -0
- package/server/dist/git.d.ts +3 -0
- package/server/dist/git.js +17 -24
- package/server/dist/gitOtherWork.js +5 -4
- package/server/dist/gitSnapshots.js +66 -5
- package/server/dist/http/authLoginRoutes.js +1 -1
- package/server/dist/http/clusterRoutes.js +466 -4
- package/server/dist/http/diagnosticsRoutes.js +8 -0
- package/server/dist/http/fileWriteRoutes.js +11 -3
- package/server/dist/http/phoneUploadRoutes.js +2 -1
- package/server/dist/http/readConfinement.d.ts +11 -0
- package/server/dist/http/readConfinement.js +30 -0
- package/server/dist/http/recallRoutes.js +1 -1
- package/server/dist/http/router.js +48 -11
- package/server/dist/http/storageRoutes.js +114 -7
- package/server/dist/http/workflowDataRoutes.js +20 -0
- package/server/dist/http/writeConfinement.js +12 -1
- package/server/dist/index.d.ts +13 -0
- package/server/dist/index.js +353 -56
- package/server/dist/initialProviders.js +1 -1
- package/server/dist/manualCompactCapability.js +1 -1
- package/server/dist/mcp/clusterMcpLoopback.d.ts +1 -0
- package/server/dist/mcp/clusterMcpLoopback.js +1 -0
- package/server/dist/mcp/clusterMcpServer.js +3 -2
- package/server/dist/mcp/clusterMcpTools.d.ts +3 -0
- package/server/dist/mcp/clusterMcpTools.js +79 -25
- package/server/dist/mcp/mcpConfigWriter.d.ts +1 -0
- package/server/dist/mcp/mcpConfigWriter.js +2 -0
- package/server/dist/mcp/workerMailBridge.d.ts +17 -0
- package/server/dist/mcp/workerMailBridge.js +104 -0
- package/server/dist/planStore.js +1 -0
- package/server/dist/primitives/seedWorker.d.ts +10 -1
- package/server/dist/primitives/seedWorker.js +14 -15
- package/server/dist/project/taskLedger.d.ts +3 -0
- package/server/dist/project/taskLedger.js +16 -0
- package/server/dist/providers/{cursor → acp}/acpJsonRpc.js +1 -1
- package/server/dist/providers/acp/permissionGate.d.ts +3 -0
- package/server/dist/providers/acp/permissionGate.js +46 -0
- package/server/dist/providers/antigravity/index.d.ts +15 -0
- package/server/dist/providers/antigravity/index.js +251 -0
- package/server/dist/providers/antigravity/researchSignIn.d.ts +24 -0
- package/server/dist/providers/antigravity/researchSignIn.js +93 -0
- package/server/dist/providers/antigravity/status.d.ts +18 -0
- package/server/dist/providers/antigravity/status.js +28 -0
- package/server/dist/providers/antigravity/usage.d.ts +7 -0
- package/server/dist/providers/antigravity/usage.js +35 -0
- package/server/dist/providers/claude/researcherFence.d.ts +7 -0
- package/server/dist/providers/claude/researcherFence.js +27 -0
- package/server/dist/providers/claude-native/catalog.d.ts +2 -1
- package/server/dist/providers/claude-native/catalog.js +4 -0
- package/server/dist/providers/claude-native/index.d.ts +1 -0
- package/server/dist/providers/claude-native/index.js +9 -1
- package/server/dist/providers/claude-native/peerTools.d.ts +1 -0
- package/server/dist/providers/claude-native/peerTools.js +26 -4
- package/server/dist/providers/claude-native/taskAdmission.d.ts +7 -1
- package/server/dist/providers/claude-native/taskAdmission.js +30 -8
- package/server/dist/providers/claude-native/tools.d.ts +1 -0
- package/server/dist/providers/claude-native/tools.js +47 -18
- package/server/dist/providers/claude-native/worker.d.ts +22 -1
- package/server/dist/providers/claude-native/worker.js +281 -51
- package/server/dist/providers/claude-native/workerHelpers.d.ts +5 -0
- package/server/dist/providers/claude-native/workerHelpers.js +95 -5
- package/server/dist/providers/claude.d.ts +2 -0
- package/server/dist/providers/claude.js +194 -22
- package/server/dist/providers/clusterTaskToolDefinitions.js +2 -1
- package/server/dist/providers/codex-appserver/heldCommands.d.ts +2 -2
- package/server/dist/providers/codex-appserver/heldCommands.js +9 -3
- package/server/dist/providers/codex-appserver/index.d.ts +9 -0
- package/server/dist/providers/codex-appserver/index.js +106 -5
- package/server/dist/providers/codex-appserver/lateCommands.js +1 -0
- package/server/dist/providers/codex-appserver/modelAvailability.d.ts +20 -0
- package/server/dist/providers/codex-appserver/modelAvailability.js +34 -0
- package/server/dist/providers/codex-appserver/worker.d.ts +11 -0
- package/server/dist/providers/codex-appserver/worker.js +199 -25
- package/server/dist/providers/codex.js +1 -0
- package/server/dist/providers/codexVersion.d.ts +2 -0
- package/server/dist/providers/codexVersion.js +8 -0
- package/server/dist/providers/codexWebSearch.js +1 -1
- package/server/dist/providers/cursor/agentEnv.d.ts +20 -0
- package/server/dist/providers/cursor/agentEnv.js +93 -0
- package/server/dist/providers/cursor/authState.js +2 -1
- package/server/dist/providers/cursor/authToken.d.ts +25 -2
- package/server/dist/providers/cursor/authToken.js +118 -27
- package/server/dist/providers/cursor/catalog.d.ts +6 -0
- package/server/dist/providers/cursor/catalog.js +91 -1
- package/server/dist/providers/cursor/chatSandbox.d.ts +3 -1
- package/server/dist/providers/cursor/chatSandbox.js +24 -8
- package/server/dist/providers/cursor/isolated.d.ts +6 -0
- package/server/dist/providers/cursor/isolated.js +313 -0
- package/server/dist/providers/cursor/isolatedVersion.d.ts +6 -0
- package/server/dist/providers/cursor/isolatedVersion.js +35 -0
- package/server/dist/providers/cursor/modelMap.js +9 -5
- package/server/dist/providers/cursor/print.js +10 -8
- package/server/dist/providers/cursor/worker.js +8 -3
- package/server/dist/providers/index.js +10 -2
- package/server/dist/providers/llamacpp.js +3 -2
- package/server/dist/providers/ollama.d.ts +3 -2
- package/server/dist/providers/ollama.js +29 -10
- package/server/dist/providers/ollamaTools.d.ts +3 -0
- package/server/dist/providers/ollamaTools.js +31 -29
- package/server/dist/research/exportResults.d.ts +15 -0
- package/server/dist/research/exportResults.js +60 -0
- package/server/dist/research/isolatedArtifact.d.ts +4 -0
- package/server/dist/research/isolatedArtifact.js +56 -0
- package/server/dist/research/quickPromotion.d.ts +27 -0
- package/server/dist/research/quickPromotion.js +402 -0
- package/server/dist/research/quickResearchChat.d.ts +4 -0
- package/server/dist/research/quickResearchChat.js +187 -0
- package/server/dist/research/researchClose.d.ts +31 -0
- package/server/dist/research/researchClose.js +373 -0
- package/server/dist/research/researchCopy.d.ts +16 -0
- package/server/dist/research/researchCopy.js +180 -0
- package/server/dist/research/researchCreate.d.ts +40 -0
- package/server/dist/research/researchCreate.js +334 -0
- package/server/dist/research/researchDoctrine.d.ts +2 -0
- package/server/dist/research/researchDoctrine.js +26 -0
- package/server/dist/research/researchFolder.d.ts +23 -0
- package/server/dist/research/researchFolder.js +191 -0
- package/server/dist/research/researchLibrary.d.ts +54 -0
- package/server/dist/research/researchLibrary.js +281 -0
- package/server/dist/research/researchRetry.d.ts +25 -0
- package/server/dist/research/researchRetry.js +96 -0
- package/server/dist/research/researchRounds.d.ts +108 -0
- package/server/dist/research/researchRounds.js +996 -0
- package/server/dist/research/researchState.d.ts +112 -0
- package/server/dist/research/researchState.js +191 -0
- package/server/dist/research/researchTools.d.ts +57 -0
- package/server/dist/research/researchTools.js +57 -0
- package/server/dist/research/researchTripwires.d.ts +18 -0
- package/server/dist/research/researchTripwires.js +196 -0
- package/server/dist/research/resultSelection.d.ts +27 -0
- package/server/dist/research/resultSelection.js +161 -0
- package/server/dist/research/savedQuickPromotion.d.ts +19 -0
- package/server/dist/research/savedQuickPromotion.js +259 -0
- package/server/dist/research/sendToProject.d.ts +36 -0
- package/server/dist/research/sendToProject.js +293 -0
- package/server/dist/server/broadcast.d.ts +5 -1
- package/server/dist/server/broadcast.js +45 -5
- package/server/dist/server/updateCheck.js +1 -0
- package/server/dist/settings.js +27 -3
- package/server/dist/skillActivity.d.ts +11 -0
- package/server/dist/skillActivity.js +33 -0
- package/server/dist/smartPickup.d.ts +1 -0
- package/server/dist/smartPickup.js +12 -4
- package/server/dist/smartPickupAdapters.js +3 -2
- package/server/dist/smartPickupEvaluator.d.ts +1 -0
- package/server/dist/smartPickupObserver.js +47 -14
- package/server/dist/storageActions.d.ts +9 -0
- package/server/dist/storageActions.js +5 -0
- package/server/dist/storageOverview.d.ts +1 -0
- package/server/dist/storageOverview.js +12 -5
- package/server/dist/taskDispatcher.js +3 -2
- package/server/dist/toolboxWorkflow.js +2 -1
- package/server/dist/updateCheck.d.ts +3 -2
- package/server/dist/updateCheck.js +39 -1
- package/server/dist/workers/StreamParser.d.ts +1 -0
- package/server/dist/workers/StreamParser.js +23 -1
- package/server/dist/workers/WorkerManager.d.ts +4 -0
- package/server/dist/workers/WorkerManager.js +5 -1
- package/server/dist/workers/antigravityIsolatedLaunch.d.ts +25 -0
- package/server/dist/workers/antigravityIsolatedLaunch.js +88 -0
- package/server/dist/workers/checkedLinuxWorker.d.ts +38 -0
- package/server/dist/workers/checkedLinuxWorker.js +192 -0
- package/server/dist/workers/claudeAccessLease.d.ts +24 -0
- package/server/dist/workers/claudeAccessLease.js +157 -0
- package/server/dist/workers/claudeAccessSource.d.ts +2 -0
- package/server/dist/workers/claudeAccessSource.js +27 -0
- package/server/dist/workers/claudeIsolatedLaunch.d.ts +19 -0
- package/server/dist/workers/claudeIsolatedLaunch.js +104 -0
- package/server/dist/workers/cliResearcherDoctrine.d.ts +4 -0
- package/server/dist/workers/cliResearcherDoctrine.js +20 -0
- package/server/dist/workers/codexAccessLease.d.ts +26 -0
- package/server/dist/workers/codexAccessLease.js +208 -0
- package/server/dist/workers/codexIsolatedLaunch.d.ts +21 -0
- package/server/dist/workers/codexIsolatedLaunch.js +95 -0
- package/server/dist/workers/codexIsolatedPolicy.d.ts +5 -0
- package/server/dist/workers/codexIsolatedPolicy.js +49 -0
- package/server/dist/workers/cursorIsolatedLaunch.d.ts +37 -0
- package/server/dist/workers/cursorIsolatedLaunch.js +178 -0
- package/server/dist/workers/isolatedCliHome.d.ts +4 -0
- package/server/dist/workers/isolatedCliHome.js +107 -0
- package/server/dist/workers/limits.js +1 -1
- package/server/dist/workers/linuxWorkerSandbox.d.ts +48 -0
- package/server/dist/workers/linuxWorkerSandbox.js +192 -0
- package/server/dist/workers/processKill.d.ts +2 -0
- package/server/dist/workers/processKill.js +28 -2
- package/server/dist/workers/providerRuntimeDiscovery.d.ts +13 -0
- package/server/dist/workers/providerRuntimeDiscovery.js +126 -0
- package/server/dist/workers/researchSandboxAvailability.d.ts +3 -0
- package/server/dist/workers/researchSandboxAvailability.js +78 -0
- package/server/dist/workers/workerAccessPass.d.ts +12 -0
- package/server/dist/workers/workerAccessPass.js +123 -0
- package/server/dist/workers/workerHiddenDirectories.d.ts +3 -0
- package/server/dist/workers/workerHiddenDirectories.js +16 -0
- package/server/dist/workers/workerSocketDirectory.d.ts +2 -0
- package/server/dist/workers/workerSocketDirectory.js +16 -0
- package/server/dist/workers/workerWebProxy.d.ts +28 -0
- package/server/dist/workers/workerWebProxy.js +206 -0
- package/server/dist/workflowMeta.d.ts +5 -0
- package/server/dist/workflowMeta.js +7 -3
- package/server/dist/workflowStore.js +43 -25
- package/server/dist/workflows/purgeWorkflow.js +15 -0
- package/server/dist/workflows/types.d.ts +6 -0
- package/server/dist/workspace.d.ts +1 -0
- package/server/dist/workspace.js +8 -0
- package/server/dist/ws/clusterHandlers.d.ts +5 -0
- package/server/dist/ws/clusterHandlers.js +373 -26
- package/server/dist/ws/clusterMembers.d.ts +5 -0
- package/server/dist/ws/clusterMembers.js +15 -5
- package/server/dist/ws/compactHandlers.js +43 -8
- package/server/dist/ws/compareHandlers.d.ts +12 -0
- package/server/dist/ws/compareHandlers.js +32 -14
- package/server/dist/ws/handoffHandlers.js +39 -3
- package/server/dist/ws/operatorQuestionHandlers.d.ts +5 -0
- package/server/dist/ws/operatorQuestionHandlers.js +17 -2
- package/server/dist/ws/taskLedgerHandlers.js +1 -0
- package/server/dist/ws/taskLifecycle.d.ts +25 -1
- package/server/dist/ws/taskLifecycle.js +53 -1
- package/server/dist/ws/turnEngine.d.ts +18 -1
- package/server/dist/ws/turnEngine.js +281 -52
- package/server/dist/ws/turnPrompt.js +3 -1
- package/server/dist/ws/updatePrimaryConfig.js +11 -3
- package/server/dist/ws/workflowHandlers.js +17 -4
- package/server/package.json +1 -1
- package/server/src/arcoHome.ts +16 -3
- package/server/src/auth.ts +50 -6
- package/server/src/authLoginSession.ts +10 -5
- package/server/src/capabilities.ts +13 -8
- package/server/src/chatMode.ts +24 -2
- package/server/src/checkedFile.ts +42 -31
- package/server/src/cliUpdateDecision.ts +1 -1
- package/server/src/clusterAutoTurn.ts +29 -5
- package/server/src/clusterBusyReminder.ts +2 -1
- package/server/src/clusterDirector.ts +5 -2
- package/server/src/clusterMailTally.ts +28 -0
- package/server/src/clusterMailbox.ts +49 -4
- package/server/src/clusterOpenWork.ts +94 -0
- package/server/src/clusterPeerOps.ts +238 -52
- package/server/src/clusterPlanBridge.ts +54 -1
- package/server/src/clusterPlanStore.ts +59 -0
- package/server/src/clusterPresets.ts +17 -3
- package/server/src/clusterProgress.ts +2 -2
- package/server/src/clusterSkills.ts +2 -2
- package/server/src/clusterSnapshots.ts +7 -1
- package/server/src/clusterStore.ts +192 -20
- package/server/src/clusterTurnOrigin.ts +19 -0
- package/server/src/connectionCatalog.ts +1 -0
- package/server/src/cursorUsage.ts +3 -3
- package/server/src/defaults/models.md +11 -14
- package/server/src/directorContinue.ts +309 -0
- package/server/src/directorContinueHook.ts +15 -0
- package/server/src/effortValidation.ts +31 -0
- package/server/src/fileAccessPolicy.ts +1 -0
- package/server/src/fileFetch.ts +47 -29
- package/server/src/geminiMembers.ts +116 -0
- package/server/src/git.ts +20 -22
- package/server/src/gitOtherWork.ts +5 -4
- package/server/src/gitSnapshots.ts +53 -5
- package/server/src/http/authLoginRoutes.ts +2 -2
- package/server/src/http/clusterRoutes.ts +314 -6
- package/server/src/http/diagnosticsRoutes.ts +9 -0
- package/server/src/http/fileWriteRoutes.ts +13 -5
- package/server/src/http/phoneUploadRoutes.ts +2 -1
- package/server/src/http/readConfinement.ts +30 -0
- package/server/src/http/recallRoutes.ts +1 -1
- package/server/src/http/router.ts +43 -10
- package/server/src/http/storageRoutes.ts +86 -7
- package/server/src/http/workflowDataRoutes.ts +20 -0
- package/server/src/http/writeConfinement.ts +10 -1
- package/server/src/index.ts +295 -18
- package/server/src/initialProviders.ts +1 -1
- package/server/src/manualCompactCapability.ts +1 -1
- package/server/src/mcp/clusterMcpLoopback.ts +2 -0
- package/server/src/mcp/clusterMcpServer.ts +3 -2
- package/server/src/mcp/clusterMcpTools.ts +83 -27
- package/server/src/mcp/mcpConfigWriter.ts +4 -0
- package/server/src/mcp/workerMailBridge.ts +99 -0
- package/server/src/planStore.ts +1 -0
- package/server/src/primitives/seedWorker.ts +19 -14
- package/server/src/project/taskLedger.ts +23 -0
- package/server/src/providers/{cursor → acp}/acpJsonRpc.ts +3 -3
- package/server/src/providers/acp/permissionGate.ts +47 -0
- package/server/src/providers/antigravity/index.ts +187 -0
- package/server/src/providers/antigravity/researchSignIn.ts +76 -0
- package/server/src/providers/antigravity/status.ts +24 -0
- package/server/src/providers/antigravity/usage.ts +29 -0
- package/server/src/providers/claude/researcherFence.ts +25 -0
- package/server/src/providers/claude-native/catalog.ts +5 -0
- package/server/src/providers/claude-native/index.ts +8 -1
- package/server/src/providers/claude-native/peerTools.ts +24 -4
- package/server/src/providers/claude-native/taskAdmission.ts +35 -9
- package/server/src/providers/claude-native/tools.ts +39 -19
- package/server/src/providers/claude-native/worker.ts +270 -52
- package/server/src/providers/claude-native/workerHelpers.ts +88 -5
- package/server/src/providers/claude.ts +160 -22
- package/server/src/providers/clusterTaskToolDefinitions.ts +2 -1
- package/server/src/providers/codex-appserver/heldCommands.ts +7 -3
- package/server/src/providers/codex-appserver/index.ts +87 -3
- package/server/src/providers/codex-appserver/lateCommands.ts +1 -0
- package/server/src/providers/codex-appserver/modelAvailability.ts +40 -0
- package/server/src/providers/codex-appserver/worker.ts +155 -25
- package/server/src/providers/codex.ts +1 -0
- package/server/src/providers/codexVersion.ts +9 -0
- package/server/src/providers/codexWebSearch.ts +1 -1
- package/server/src/providers/cursor/agentEnv.ts +103 -0
- package/server/src/providers/cursor/authState.ts +2 -1
- package/server/src/providers/cursor/authToken.ts +137 -31
- package/server/src/providers/cursor/catalog.ts +89 -1
- package/server/src/providers/cursor/chatSandbox.ts +20 -8
- package/server/src/providers/cursor/isolated.ts +282 -0
- package/server/src/providers/cursor/isolatedVersion.ts +33 -0
- package/server/src/providers/cursor/modelMap.ts +9 -5
- package/server/src/providers/cursor/print.ts +10 -8
- package/server/src/providers/cursor/worker.ts +8 -3
- package/server/src/providers/index.ts +10 -2
- package/server/src/providers/llamacpp.ts +3 -1
- package/server/src/providers/ollama.ts +30 -11
- package/server/src/providers/ollamaTools.ts +33 -27
- package/server/src/research/exportResults.ts +47 -0
- package/server/src/research/isolatedArtifact.ts +48 -0
- package/server/src/research/quickPromotion.ts +325 -0
- package/server/src/research/quickResearchChat.ts +147 -0
- package/server/src/research/researchClose.ts +340 -0
- package/server/src/research/researchCopy.ts +170 -0
- package/server/src/research/researchCreate.ts +306 -0
- package/server/src/research/researchDoctrine.ts +27 -0
- package/server/src/research/researchFolder.ts +202 -0
- package/server/src/research/researchLibrary.ts +306 -0
- package/server/src/research/researchRetry.ts +86 -0
- package/server/src/research/researchRounds.ts +891 -0
- package/server/src/research/researchState.ts +309 -0
- package/server/src/research/researchTools.ts +59 -0
- package/server/src/research/researchTripwires.ts +158 -0
- package/server/src/research/resultSelection.ts +127 -0
- package/server/src/research/savedQuickPromotion.ts +174 -0
- package/server/src/research/sendToProject.ts +220 -0
- package/server/src/server/broadcast.ts +39 -5
- package/server/src/server/updateCheck.ts +1 -0
- package/server/src/settings.ts +22 -5
- package/server/src/skillActivity.ts +35 -0
- package/server/src/smartPickup.ts +14 -4
- package/server/src/smartPickupAdapters.ts +3 -2
- package/server/src/smartPickupEvaluator.ts +3 -0
- package/server/src/smartPickupObserver.ts +38 -12
- package/server/src/storageActions.ts +6 -0
- package/server/src/storageOverview.ts +13 -6
- package/server/src/taskDispatcher.ts +3 -1
- package/server/src/toolboxWorkflow.ts +2 -1
- package/server/src/updateCheck.ts +31 -3
- package/server/src/workers/StreamParser.ts +20 -1
- package/server/src/workers/WorkerManager.ts +10 -1
- package/server/src/workers/antigravityIsolatedLaunch.ts +82 -0
- package/server/src/workers/checkedLinuxWorker.ts +212 -0
- package/server/src/workers/claudeAccessLease.ts +122 -0
- package/server/src/workers/claudeAccessSource.ts +20 -0
- package/server/src/workers/claudeIsolatedLaunch.ts +91 -0
- package/server/src/workers/cliResearcherDoctrine.ts +20 -0
- package/server/src/workers/codexAccessLease.ts +146 -0
- package/server/src/workers/codexIsolatedLaunch.ts +72 -0
- package/server/src/workers/codexIsolatedPolicy.ts +38 -0
- package/server/src/workers/cursorIsolatedLaunch.ts +159 -0
- package/server/src/workers/isolatedCliHome.ts +75 -0
- package/server/src/workers/limits.ts +1 -1
- package/server/src/workers/linuxWorkerSandbox.ts +193 -0
- package/server/src/workers/processKill.ts +34 -2
- package/server/src/workers/providerRuntimeDiscovery.ts +108 -0
- package/server/src/workers/researchSandboxAvailability.ts +68 -0
- package/server/src/workers/workerAccessPass.ts +96 -0
- package/server/src/workers/workerHiddenDirectories.ts +16 -0
- package/server/src/workers/workerSocketDirectory.ts +13 -0
- package/server/src/workers/workerWebProxy.ts +194 -0
- package/server/src/workflowMeta.ts +10 -3
- package/server/src/workflowStore.ts +39 -26
- package/server/src/workflows/purgeWorkflow.ts +18 -0
- package/server/src/workflows/types.ts +13 -0
- package/server/src/workspace.ts +8 -0
- package/server/src/ws/clusterHandlers.ts +302 -26
- package/server/src/ws/clusterMembers.ts +15 -5
- package/server/src/ws/compactHandlers.ts +37 -5
- package/server/src/ws/compareHandlers.ts +34 -11
- package/server/src/ws/handoffHandlers.ts +36 -3
- package/server/src/ws/operatorQuestionHandlers.ts +14 -2
- package/server/src/ws/taskLedgerHandlers.ts +1 -0
- package/server/src/ws/taskLifecycle.ts +58 -4
- package/server/src/ws/turnEngine.ts +265 -49
- package/server/src/ws/turnPrompt.ts +3 -1
- package/server/src/ws/updatePrimaryConfig.ts +10 -3
- package/server/src/ws/workflowHandlers.ts +15 -4
- package/shared/dist/clusterCoordination.d.ts +1 -0
- package/shared/dist/clusterCoordination.js +9 -1
- package/shared/dist/clusterRolePresets.js +13 -4
- package/shared/dist/index.d.ts +1 -0
- package/shared/dist/index.js +1 -0
- package/shared/dist/protocol/autoPickup.d.ts +7 -0
- package/shared/dist/protocol/autoPickup.js +22 -11
- package/shared/dist/protocol/chat.d.ts +1 -1
- package/shared/dist/protocol/checkpoints.d.ts +1 -0
- package/shared/dist/protocol/clientMessages.d.ts +18 -3
- package/shared/dist/protocol/clusters.d.ts +177 -4
- package/shared/dist/protocol/clusters.js +48 -2
- package/shared/dist/protocol/handoffs.d.ts +1 -0
- package/shared/dist/protocol/models.d.ts +6 -1
- package/shared/dist/protocol/models.js +4 -3
- package/shared/dist/protocol/providers.d.ts +3 -2
- package/shared/dist/protocol/providers.js +1 -1
- package/shared/dist/protocol/serverMessages.d.ts +28 -3
- package/shared/dist/protocol/settings.d.ts +4 -0
- package/shared/dist/protocol/settings.js +3 -1
- package/shared/dist/protocol/tasks.d.ts +42 -0
- package/shared/dist/protocol/tasks.js +17 -0
- package/shared/dist/protocol/workflows.d.ts +4 -0
- package/shared/dist/protocol/workflows.js +2 -0
- package/shared/dist/researchActivity.d.ts +4 -0
- package/shared/dist/researchActivity.js +29 -0
- package/shared/src/clusterCoordination.ts +12 -1
- package/shared/src/clusterRolePresets.ts +13 -4
- package/shared/src/index.ts +2 -0
- package/shared/src/protocol/autoPickup.ts +28 -11
- package/shared/src/protocol/chat.ts +1 -1
- package/shared/src/protocol/checkpoints.ts +1 -0
- package/shared/src/protocol/clientMessages.ts +14 -0
- package/shared/src/protocol/clusters.ts +231 -5
- package/shared/src/protocol/handoffs.ts +1 -0
- package/shared/src/protocol/models.ts +11 -4
- package/shared/src/protocol/providers.ts +6 -3
- package/shared/src/protocol/reviews.ts +2 -2
- package/shared/src/protocol/serverMessages.ts +28 -3
- package/shared/src/protocol/settings.ts +14 -1
- package/shared/src/protocol/tasks.ts +73 -0
- package/shared/src/protocol/workflows.ts +8 -0
- package/shared/src/researchActivity.ts +23 -0
- package/client/dist/assets/XtermView-Xk7_9JaH.js +0 -10
- package/client/dist/assets/index-BEFgrUJJ.css +0 -1
- package/client/dist/assets/index-C7WzZfsr.js +0 -614
- package/client/src/components/HeaderAuthChip.tsx +0 -207
- /package/server/dist/providers/{cursor → acp}/acpJsonRpc.d.ts +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { promisify } from 'node:util';
|
|
3
|
+
import { commandArgs } from '../../windowsCommand.js';
|
|
4
|
+
const exec = promisify(execFile);
|
|
5
|
+
export function parseAntigravityUsage(text) {
|
|
6
|
+
try {
|
|
7
|
+
const value = JSON.parse(text);
|
|
8
|
+
if (value.status !== 'SUCCESS' || value.command?.name !== 'usage' || !Array.isArray(value.command.data?.groups))
|
|
9
|
+
return null;
|
|
10
|
+
const pools = [];
|
|
11
|
+
for (const group of value.command.data.groups) {
|
|
12
|
+
if (typeof group.name !== 'string' || !Array.isArray(group.buckets))
|
|
13
|
+
return null;
|
|
14
|
+
for (const bucket of group.buckets) {
|
|
15
|
+
if (typeof bucket.name !== 'string' || typeof bucket.remaining_fraction !== 'number' || !Number.isFinite(bucket.remaining_fraction) || bucket.remaining_fraction < 0 || bucket.remaining_fraction > 1 || typeof bucket.reset_time !== 'string' || Number.isNaN(Date.parse(bucket.reset_time)))
|
|
16
|
+
return null;
|
|
17
|
+
pools.push({ name: `${group.name} · ${bucket.name}`, percentLeft: Math.round(bucket.remaining_fraction * 100), reset: bucket.reset_time });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return pools.length ? pools : null;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export async function getAntigravityUsage() {
|
|
27
|
+
try {
|
|
28
|
+
const { stdout } = await exec(...commandArgs('agy', ['-p', '/usage', '--output-format', 'json']), { timeout: 5000, killSignal: 'SIGKILL', maxBuffer: 256 * 1024, windowsHide: true });
|
|
29
|
+
return parseAntigravityUsage(stdout);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** CLI-only policy; callers must also apply and verify the outer OS sandbox. */
|
|
2
|
+
export function claudeResearcherFence(options) {
|
|
3
|
+
if (!Number.isInteger(options.webProxyPort) || options.webProxyPort < 1 || options.webProxyPort > 65535) {
|
|
4
|
+
throw new Error('A valid sandbox proxy port is required.');
|
|
5
|
+
}
|
|
6
|
+
const tools = ['Bash', 'Read', 'Write', 'Edit', 'Glob', 'Grep'];
|
|
7
|
+
if (options.webAccess)
|
|
8
|
+
tools.push('WebSearch', 'WebFetch');
|
|
9
|
+
const settings = {
|
|
10
|
+
permissions: {
|
|
11
|
+
blockReadsOutsideWorkingDirectories: true,
|
|
12
|
+
blockWritesOutsideWorkingDirectories: true,
|
|
13
|
+
denyInsteadOfPrompting: true,
|
|
14
|
+
allow: ['Bash(*)', 'Read(//work/**)', 'Edit(//work/**)', 'mcp__arco-cluster__peer_read', 'mcp__arco-cluster__peer_send'],
|
|
15
|
+
deny: ['Read(//home/**)', 'Edit(//home/**)', 'Read(//run/arco-access.json)', 'Read(//run/arco-check.json)'],
|
|
16
|
+
},
|
|
17
|
+
sandbox: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
failIfUnavailable: true,
|
|
20
|
+
allowUnsandboxedCommands: false,
|
|
21
|
+
filesystem: { denyRead: ['/home/worker', '/run/arco-access.json', '/run/arco-check.json'], allowRead: ['/work'] },
|
|
22
|
+
network: { httpProxyPort: options.webProxyPort, allowUnixSockets: ['/run/arco-mail.sock'] },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
return { args: ['--permission-mode', 'dontAsk', '--tools', tools.join(','), '--settings', JSON.stringify(settings), '--strict-mcp-config'] };
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=researcherFence.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClaudeCatalogSnapshot } from '@arco/shared';
|
|
1
|
+
import { type ClaudeCatalogModel, type ClaudeCatalogSnapshot } from '@arco/shared';
|
|
2
2
|
export interface AnthropicModel {
|
|
3
3
|
type: 'model';
|
|
4
4
|
id: string;
|
|
@@ -61,6 +61,7 @@ export declare function getCachedModelCapabilities(modelId: string): {
|
|
|
61
61
|
supportsClearToolUses: boolean;
|
|
62
62
|
supportsCompact: boolean;
|
|
63
63
|
} | null;
|
|
64
|
+
export declare function getCachedClaudeModelEfforts(modelId: string): ClaudeCatalogModel['supportedEfforts'] | undefined;
|
|
64
65
|
export declare function hasCatalogCache(): boolean;
|
|
65
66
|
export declare function resolveClaudeAliasFromCatalog(modelId: string): string;
|
|
66
67
|
export declare function getCatalog(force?: boolean): Promise<ClaudeCatalogSnapshot>;
|
|
@@ -37,6 +37,10 @@ export function getCachedModelCapabilities(modelId) {
|
|
|
37
37
|
supportsCompact: m.supportsCompact,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
+
// The picker uses the same cached model efforts when a catalog is available.
|
|
41
|
+
export function getCachedClaudeModelEfforts(modelId) {
|
|
42
|
+
return cache?.models.find((model) => model.id === modelId)?.supportedEfforts;
|
|
43
|
+
}
|
|
40
44
|
// True once a non-empty catalog has been fetched in this process. Callers use
|
|
41
45
|
// it to decide whether an alias resolution is catalog-backed or a static guess.
|
|
42
46
|
export function hasCatalogCache() {
|
|
@@ -5,6 +5,7 @@ import type { Todo } from './tools.js';
|
|
|
5
5
|
export declare function setClaudeNativeTodosBroadcast(fn: (workflowId: string, todos: Todo[]) => void): void;
|
|
6
6
|
export declare function setClaudeNativePlanBroadcast(fn: (workflowId: string) => PlanBroadcast): void;
|
|
7
7
|
export declare function setClaudeNativeTaskHandler(fn: TaskSpawnHandler): void;
|
|
8
|
+
export declare function setClaudeNativeTaskNoticeHandler(fn: (workflowId: string, text: string) => void): void;
|
|
8
9
|
export declare function setClaudeNativeHookWakeHandler(fn: (workflowId: string, text: string) => void): void;
|
|
9
10
|
export declare function setClaudeNativeWorkflowEventBroadcast(fn: (workflowId: string, msg: ServerMessage) => void): void;
|
|
10
11
|
export declare function setClaudeNativeClusterEventBroadcast(fn: (clusterId: string, msg: ServerMessage) => void): void;
|
|
@@ -35,6 +35,11 @@ export function setClaudeNativeTaskHandler(fn) {
|
|
|
35
35
|
// An asyncRewake hook that exits 2 while the tab is idle starts a turn with
|
|
36
36
|
// its report. Server wires this to the workflow's follow-up queue.
|
|
37
37
|
let hookWakeFn = null;
|
|
38
|
+
let taskNoticeFn = null;
|
|
39
|
+
// docs/PROVIDERS.md "Background sub-agents": finished children reach the parent.
|
|
40
|
+
export function setClaudeNativeTaskNoticeHandler(fn) {
|
|
41
|
+
taskNoticeFn = fn;
|
|
42
|
+
}
|
|
38
43
|
export function setClaudeNativeHookWakeHandler(fn) {
|
|
39
44
|
hookWakeFn = fn;
|
|
40
45
|
}
|
|
@@ -114,7 +119,9 @@ class ClaudeNativeTurn extends EventEmitter {
|
|
|
114
119
|
});
|
|
115
120
|
}
|
|
116
121
|
async interrupt() {
|
|
117
|
-
|
|
122
|
+
// INTERRUPT & SEND: background sub-agents keep running.
|
|
123
|
+
if (!this.settled)
|
|
124
|
+
this.worker.cancel({ keepBackground: true });
|
|
118
125
|
await this.running;
|
|
119
126
|
return this.worker.turnInputAccepted;
|
|
120
127
|
}
|
|
@@ -243,6 +250,7 @@ function acquireWorker(workflowId, config) {
|
|
|
243
250
|
if (taskHandlerFn)
|
|
244
251
|
fresh.setTaskHandler(taskHandlerFn);
|
|
245
252
|
fresh.setHookWakeHandler((text) => hookWakeFn?.(workflowId, text));
|
|
253
|
+
fresh.setTaskNoticeHandler((text) => taskNoticeFn?.(workflowId, text));
|
|
246
254
|
if (workflowEventBroadcast) {
|
|
247
255
|
const wfid = workflowId;
|
|
248
256
|
fresh.setWorkflowEventBroadcast((msg) => { workflowEventBroadcast?.(wfid, msg); });
|
|
@@ -13,5 +13,6 @@ export declare function isPeerTool(name: string): boolean;
|
|
|
13
13
|
export declare function getPeerToolDefinitions(opts?: {
|
|
14
14
|
taskBoardAttached?: boolean;
|
|
15
15
|
accessMode?: ClusterMemberAccessMode;
|
|
16
|
+
researchDirector?: boolean;
|
|
16
17
|
}): ClaudeToolDef[];
|
|
17
18
|
export declare function executePeerTool(name: string, args: Record<string, unknown>, ctx: PeerToolContext): Promise<string>;
|
|
@@ -2,10 +2,14 @@ import { PEER_SEND_GUARD_DESCRIPTION } from '@arco/shared';
|
|
|
2
2
|
import { CLUSTER_TASK_TOOL_DEFINITIONS } from '../clusterTaskToolDefinitions.js';
|
|
3
3
|
import * as peerOps from '../../clusterPeerOps.js';
|
|
4
4
|
import { formatBoardForModel } from '../../project/taskLedger.js';
|
|
5
|
+
import { formatResearchRoundResult, RESEARCH_ROUND_TOOL, RESEARCH_SEND_TOOL, proposeResearchSend, researchHeldNote } from '../../research/researchTools.js';
|
|
6
|
+
import { startRound } from '../../research/researchRounds.js';
|
|
5
7
|
const PEER_TOOL_NAMES = new Set([
|
|
6
8
|
'peer_list',
|
|
7
9
|
'peer_send',
|
|
8
10
|
'peer_read',
|
|
11
|
+
'research_round',
|
|
12
|
+
'research_send_to_project',
|
|
9
13
|
'cluster_plan_read',
|
|
10
14
|
'cluster_plan_tick',
|
|
11
15
|
'cluster_plan_write',
|
|
@@ -58,6 +62,7 @@ export function getPeerToolDefinitions(opts) {
|
|
|
58
62
|
to: { type: 'string', description: 'Peer 8-char display name or full workflowId.' },
|
|
59
63
|
content: { type: 'string', description: 'Message body (≤ 16 KB UTF-8).' },
|
|
60
64
|
confirm: { type: 'boolean', description: 'Deliver a status-only message after the first send asks for confirmation.' },
|
|
65
|
+
task_id: { type: 'string', description: "When this message hands a board task to the recipient, the task's full id from cluster_task_list. Arco records the handoff on the task so it can tell the operator the task reached that member. An id not on this cluster's board is refused and nothing is sent." },
|
|
61
66
|
artifact_paths: {
|
|
62
67
|
type: 'array',
|
|
63
68
|
items: { type: 'string' },
|
|
@@ -77,7 +82,7 @@ export function getPeerToolDefinitions(opts) {
|
|
|
77
82
|
},
|
|
78
83
|
{
|
|
79
84
|
name: 'cluster_plan_read',
|
|
80
|
-
description: 'Read the full shared cluster plan (markdown body + title + updatedAt). The plan copy injected into your context at turn start may be an OUTLINE (headings, checkbox lines, and labelled standing-directive sections; other prose omitted) when the full plan is large — call this whenever you need the complete text, e.g. before cluster_plan_write or when an outline item needs its surrounding detail. Read-only; cluster mode only.',
|
|
85
|
+
description: 'Read the full shared cluster plan (plan ID + revision + markdown body + title + updatedAt). The plan copy injected into your context at turn start may be an OUTLINE (headings, checkbox lines, and labelled standing-directive sections; other prose omitted) when the full plan is large — call this whenever you need the complete text, e.g. before cluster_plan_write or when an outline item needs its surrounding detail. Read-only; cluster mode only.',
|
|
81
86
|
input_schema: {
|
|
82
87
|
type: 'object',
|
|
83
88
|
properties: {},
|
|
@@ -102,7 +107,7 @@ export function getPeerToolDefinitions(opts) {
|
|
|
102
107
|
},
|
|
103
108
|
{
|
|
104
109
|
name: 'cluster_plan_write',
|
|
105
|
-
description: "Write the shared cluster plan body (markdown). Use this to author the initial plan or append/restructure its tasks as scope evolves. Do not write testing, gate or CI standing rules unless the operator asked for them. The plan holds standing rules and tasks only: never write progress/status notes, evidence, commit hashes, CI ids, test counts, or dates into it (those belong on board tasks or in artifacts).
|
|
110
|
+
description: "Write the shared cluster plan body (markdown). Use this to author the initial plan or append/restructure its tasks as scope evolves. Do not write testing, gate or CI standing rules unless the operator asked for them. The plan holds standing rules and tasks only: never write progress/status notes, evidence, commit hashes, CI ids, test counts, or dates into it (those belong on board tasks or in artifacts). Keep each new or lengthened checkbox summary within 240 characters, excluding the item ID and reference links. Put assignment and evidence on the board and specifications in reference docs. Existing numbered items can be shortened when the ID is unique. Model-driven writes cannot remove existing tasks or change their `[ ]`/`[x]` status. Use cluster_plan_tick for status changes, and ask the operator to replace/clear the plan from the PLAN tab for destructive edits. Body cannot be empty and is capped at 32768 chars.\n\nConvention: only the cluster director should call this. Other members should propose plan changes via peer_send to the director rather than writing directly.\n\nIMPORTANT: if the plan copy in your context is marked as an outline (prose omitted), call cluster_plan_read FIRST and base your rewrite on the full body — rewriting from the outline would silently delete the plan's prose.",
|
|
106
111
|
input_schema: {
|
|
107
112
|
type: 'object',
|
|
108
113
|
properties: {
|
|
@@ -116,6 +121,8 @@ export function getPeerToolDefinitions(opts) {
|
|
|
116
121
|
if (opts?.accessMode && opts.accessMode !== 'standard') {
|
|
117
122
|
return defs.filter((def) => def.name === 'peer_send' || def.name === 'peer_read');
|
|
118
123
|
}
|
|
124
|
+
if (opts?.researchDirector)
|
|
125
|
+
defs.push(RESEARCH_ROUND_TOOL, RESEARCH_SEND_TOOL);
|
|
119
126
|
return opts?.taskBoardAttached === true ? defs : defs.filter((def) => !TASK_TOOL_NAMES.has(def.name));
|
|
120
127
|
}
|
|
121
128
|
function asString(v, name) {
|
|
@@ -158,23 +165,37 @@ export async function executePeerTool(name, args, ctx) {
|
|
|
158
165
|
to,
|
|
159
166
|
content,
|
|
160
167
|
confirm: args.confirm === true,
|
|
168
|
+
...(typeof args.task_id === 'string' ? { taskId: args.task_id } : {}),
|
|
161
169
|
...(Array.isArray(args.artifact_paths)
|
|
162
170
|
? { artifactPaths: args.artifact_paths.filter((p) => typeof p === 'string') }
|
|
163
171
|
: {}),
|
|
164
172
|
});
|
|
165
173
|
if (!result.ok)
|
|
166
174
|
return `[error] ${result.message}`;
|
|
167
|
-
return JSON.stringify({ msgId: result.msgId, to: result.to, deliveredImmediately: result.deliveredImmediately, ...(result.recipientContext ? { recipientContext: result.recipientContext } : {}), ...(result.guard ? { guard: result.guard } : {}) }, null, 2);
|
|
175
|
+
return JSON.stringify({ msgId: result.msgId, to: result.to, deliveredImmediately: result.deliveredImmediately, ...(result.heldForRound !== undefined ? { heldForRound: Math.max(1, result.heldForRound), note: researchHeldNote(result.heldForRound) } : {}), ...(result.replaced ? { replaced: result.replaced } : {}), ...(result.recipientContext ? { recipientContext: result.recipientContext } : {}), ...(result.guard ? { guard: result.guard } : {}) }, null, 2);
|
|
168
176
|
}
|
|
169
177
|
case 'peer_read': {
|
|
170
178
|
const projected = await peerOps.peerRead(opsCtx);
|
|
171
179
|
return JSON.stringify(projected, null, 2);
|
|
172
180
|
}
|
|
181
|
+
case 'research_round': {
|
|
182
|
+
const result = await startRound(ctx.clusterId, ctx.workflowId, typeof args.text === 'string' ? args.text : '');
|
|
183
|
+
return formatResearchRoundResult(result);
|
|
184
|
+
}
|
|
185
|
+
case 'research_send_to_project': {
|
|
186
|
+
try {
|
|
187
|
+
await proposeResearchSend(ctx.clusterId, ctx.workflowId, args);
|
|
188
|
+
return 'The proposal is in RESULTS. The operator chooses a destination and sends it.';
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
return `[error] ${error instanceof Error ? error.message : String(error)}`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
173
194
|
case 'cluster_plan_read': {
|
|
174
195
|
const result = await peerOps.peerPlanRead(opsCtx);
|
|
175
196
|
if (!result.ok)
|
|
176
197
|
return `[error] ${result.code}: ${result.message}`;
|
|
177
|
-
return JSON.stringify({ title: result.title, body: result.body, updatedAt: result.updatedAt, byteLength: result.byteLength }, null, 2);
|
|
198
|
+
return JSON.stringify({ planId: result.planId, revision: result.revision, title: result.title, body: result.body, updatedAt: result.updatedAt, byteLength: result.byteLength }, null, 2);
|
|
178
199
|
}
|
|
179
200
|
case 'cluster_plan_tick': {
|
|
180
201
|
// The model may pass either field; validate without throwing so the
|
|
@@ -313,6 +334,7 @@ export async function executePeerTool(name, args, ctx) {
|
|
|
313
334
|
...(typeof args.release === 'string' ? { release: args.release } : {}),
|
|
314
335
|
// §D3 — advisory sign-off; peerTaskUpdate validates state + stamps author.
|
|
315
336
|
...(args.signoff !== undefined ? { signoff: args.signoff } : {}),
|
|
337
|
+
...(args.completePlan !== undefined ? { completePlan: args.completePlan } : {}),
|
|
316
338
|
}, bcastCluster);
|
|
317
339
|
if (!result.ok)
|
|
318
340
|
return `[error] ${result.code}: ${result.message}`;
|
|
@@ -2,6 +2,12 @@ export interface NativeTaskLimits {
|
|
|
2
2
|
maxRunning: number;
|
|
3
3
|
maxStarts: number;
|
|
4
4
|
}
|
|
5
|
+
export declare function nativeTaskBatchApprovalReasons(input: {
|
|
6
|
+
starts: number;
|
|
7
|
+
parentModel: string;
|
|
8
|
+
effectiveModels: string[];
|
|
9
|
+
requestedModels?: string[];
|
|
10
|
+
}): Array<'count' | 'cost' | 'unknown_cost'>;
|
|
5
11
|
export declare function assertNativeTaskAllowed(context: {
|
|
6
12
|
interactionMode?: string;
|
|
7
13
|
inCluster?: boolean;
|
|
@@ -13,7 +19,7 @@ export declare class NativeTaskAdmission {
|
|
|
13
19
|
private reserved;
|
|
14
20
|
private active;
|
|
15
21
|
private queue;
|
|
16
|
-
acquire(turn: AbortSignal, limits: NativeTaskLimits, request?: AbortSignal): Promise<{
|
|
22
|
+
acquire(turn: AbortSignal, limits: NativeTaskLimits, request?: AbortSignal, lifetime?: AbortSignal): Promise<{
|
|
17
23
|
started(): void;
|
|
18
24
|
release(): void;
|
|
19
25
|
}>;
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
// Different models are conservatively unknown unless a maintained price
|
|
2
|
+
// source can establish their relative cost for the actual versions.
|
|
3
|
+
export function nativeTaskBatchApprovalReasons(input) {
|
|
4
|
+
const reasons = new Set();
|
|
5
|
+
if (input.starts + input.effectiveModels.length > 4)
|
|
6
|
+
reasons.add('count');
|
|
7
|
+
const parent = input.parentModel.trim().toLowerCase();
|
|
8
|
+
// Consider a requested model even when an operator override changes the
|
|
9
|
+
// effective model: the request is still part of the approval decision.
|
|
10
|
+
for (const name of [...input.effectiveModels, ...(input.requestedModels ?? [])]) {
|
|
11
|
+
const model = name.trim().toLowerCase();
|
|
12
|
+
if (model && model === parent)
|
|
13
|
+
continue;
|
|
14
|
+
reasons.add('unknown_cost');
|
|
15
|
+
}
|
|
16
|
+
return [...reasons];
|
|
17
|
+
}
|
|
1
18
|
export function assertNativeTaskAllowed(context) {
|
|
2
19
|
if (context.interactionMode === 'chat' || context.inCluster || context.taskDisabled) {
|
|
3
20
|
throw new Error('Task not available in Chat, cluster members or depth-capped children.');
|
|
@@ -10,12 +27,17 @@ export class NativeTaskAdmission {
|
|
|
10
27
|
reserved = 0;
|
|
11
28
|
active = 0;
|
|
12
29
|
queue = [];
|
|
13
|
-
|
|
14
|
-
|
|
30
|
+
// `turn` counts starts. A background request (docs/PROVIDERS.md "Background
|
|
31
|
+
// sub-agents") passes the parent tab's `lifetime`: it survives the end of
|
|
32
|
+
// the turn and a new turn, and still occupies a running place until it ends.
|
|
33
|
+
async acquire(turn, limits, request = turn, lifetime) {
|
|
34
|
+
const life = lifetime ?? turn;
|
|
35
|
+
const background = life !== turn;
|
|
36
|
+
if (turn.aborted || request.aborted || life.aborted)
|
|
15
37
|
throw aborted();
|
|
16
38
|
if (this.turn !== turn) {
|
|
17
39
|
this.turn = turn;
|
|
18
|
-
for (const queued of
|
|
40
|
+
for (const queued of this.queue.filter((q) => !q.background))
|
|
19
41
|
queued.cancel();
|
|
20
42
|
this.limits = { ...limits };
|
|
21
43
|
this.reserved = 0;
|
|
@@ -26,7 +48,7 @@ export class NativeTaskAdmission {
|
|
|
26
48
|
this.reserved++;
|
|
27
49
|
return await new Promise((resolve, reject) => {
|
|
28
50
|
let finished = false;
|
|
29
|
-
const cleanup = () => {
|
|
51
|
+
const cleanup = () => { life.removeEventListener('abort', cancel); request.removeEventListener('abort', cancel); };
|
|
30
52
|
const cancel = () => {
|
|
31
53
|
if (finished)
|
|
32
54
|
return;
|
|
@@ -38,10 +60,10 @@ export class NativeTaskAdmission {
|
|
|
38
60
|
reject(aborted());
|
|
39
61
|
this.drain();
|
|
40
62
|
};
|
|
41
|
-
const waiter = { cancel, enter: () => {
|
|
63
|
+
const waiter = { background, cancel, enter: () => {
|
|
42
64
|
if (finished)
|
|
43
65
|
return;
|
|
44
|
-
if (
|
|
66
|
+
if (life.aborted || request.aborted || (!background && this.turn !== turn)) {
|
|
45
67
|
cancel();
|
|
46
68
|
return;
|
|
47
69
|
}
|
|
@@ -60,8 +82,8 @@ export class NativeTaskAdmission {
|
|
|
60
82
|
this.drain();
|
|
61
83
|
} });
|
|
62
84
|
} };
|
|
63
|
-
|
|
64
|
-
if (request !==
|
|
85
|
+
life.addEventListener('abort', cancel, { once: true });
|
|
86
|
+
if (request !== life)
|
|
65
87
|
request.addEventListener('abort', cancel, { once: true });
|
|
66
88
|
this.queue.push(waiter);
|
|
67
89
|
this.drain();
|
|
@@ -40,6 +40,7 @@ const BASH_TIMEOUT_MIN_MS = 1_000;
|
|
|
40
40
|
const BASH_TAIL_MAX_LINES = 2_000;
|
|
41
41
|
// DD2 — grace period between SIGTERM and the SIGKILL escalation in killTree.
|
|
42
42
|
const KILL_GRACE_MS = 2_000;
|
|
43
|
+
const SHELL_CLOSE_GRACE_MS = 2_500;
|
|
43
44
|
// JS-walker fallback only — `rg` path is unbounded.
|
|
44
45
|
const GREP_WALK_FILE_CAP = 5000;
|
|
45
46
|
// Detect ripgrep once at module load. CLI shells to rg (multi-threaded, Rust,
|
|
@@ -592,30 +593,51 @@ function spawnShell(command, cwd) {
|
|
|
592
593
|
env: { ...process.env },
|
|
593
594
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
594
595
|
});
|
|
595
|
-
|
|
596
|
+
let startCloseGrace = () => { };
|
|
597
|
+
const completion = new Promise((resolve) => {
|
|
598
|
+
let code = null;
|
|
599
|
+
let signal = null;
|
|
600
|
+
let timer;
|
|
601
|
+
let settled = false;
|
|
602
|
+
const finish = (leftOpen, error) => {
|
|
603
|
+
if (settled)
|
|
604
|
+
return;
|
|
605
|
+
settled = true;
|
|
606
|
+
if (timer)
|
|
607
|
+
clearTimeout(timer);
|
|
608
|
+
if (leftOpen) {
|
|
609
|
+
child.stdout?.destroy();
|
|
610
|
+
child.stderr?.destroy();
|
|
611
|
+
}
|
|
612
|
+
run.cleanup();
|
|
613
|
+
resolve({ code, signal, error, leftOpen });
|
|
614
|
+
};
|
|
615
|
+
startCloseGrace = () => { if (!timer && !settled)
|
|
616
|
+
timer = setTimeout(() => finish(true), SHELL_CLOSE_GRACE_MS); };
|
|
617
|
+
child.once('exit', (exitCode, exitSignal) => { code = exitCode; signal = exitSignal; startCloseGrace(); });
|
|
618
|
+
child.once('close', (exitCode, exitSignal) => { code = exitCode; signal = exitSignal; finish(false); });
|
|
619
|
+
child.once('error', (error) => finish(false, error));
|
|
620
|
+
});
|
|
596
621
|
// DD2 — terminate gracefully (SIGTERM) then escalate to SIGKILL after a grace
|
|
597
622
|
// period if the tree is still alive. A flat SIGKILL gives the child no chance
|
|
598
623
|
// to flush/clean up (orphaned lockfiles, half-written output); SIGTERM-first
|
|
599
624
|
// matches how a shell's Ctrl-C behaves. The escalation timer is unref'd so it
|
|
600
625
|
// never keeps the server process alive on its own.
|
|
601
626
|
const kills = [];
|
|
602
|
-
const exited = new Promise((resolve) => {
|
|
603
|
-
child.once('close', () => resolve());
|
|
604
|
-
child.once('error', () => resolve());
|
|
605
|
-
});
|
|
606
627
|
const killTree = () => {
|
|
628
|
+
startCloseGrace();
|
|
607
629
|
const signalTree = (sig) => { kills.push(signalChildTree(child, sig)); };
|
|
608
630
|
signalTree('SIGTERM');
|
|
609
631
|
const t = setTimeout(() => signalTree('SIGKILL'), KILL_GRACE_MS);
|
|
610
632
|
if (typeof t.unref === 'function')
|
|
611
633
|
t.unref();
|
|
612
634
|
};
|
|
613
|
-
//
|
|
614
|
-
const ended =
|
|
615
|
-
return { child, killTree, ended };
|
|
635
|
+
// Completion and any signals sent by then have finished.
|
|
636
|
+
const ended = completion.then(() => Promise.all(kills)).then(() => undefined, () => undefined);
|
|
637
|
+
return { child, killTree, ended, completion };
|
|
616
638
|
}
|
|
617
639
|
async function runBashForeground(command, timeoutMs, ctx) {
|
|
618
|
-
const { child, killTree, ended } = spawnShell(command, ctx.cwd);
|
|
640
|
+
const { child, killTree, ended, completion } = spawnShell(command, ctx.cwd);
|
|
619
641
|
const shellId = ctx.shells.mintId();
|
|
620
642
|
ctx.shells.byId.set(shellId, { kill: killTree, backgrounded: false, ended });
|
|
621
643
|
return new Promise((resolveResult) => {
|
|
@@ -656,7 +678,7 @@ async function runBashForeground(command, timeoutMs, ctx) {
|
|
|
656
678
|
ctx.abortSignal.addEventListener('abort', onAbort, { once: true });
|
|
657
679
|
child.stdout?.on('data', (b) => acc.push(b));
|
|
658
680
|
child.stderr?.on('data', (b) => acc.push(b));
|
|
659
|
-
const finish = (exitDescription, exitCode, signal, spawnError = false) => {
|
|
681
|
+
const finish = (exitDescription, exitCode, signal, spawnError = false, leftOpen = false) => {
|
|
660
682
|
if (finished)
|
|
661
683
|
return;
|
|
662
684
|
finished = true;
|
|
@@ -675,6 +697,8 @@ async function runBashForeground(command, timeoutMs, ctx) {
|
|
|
675
697
|
parts.push(`[timed out after ${timeoutMs}ms]`);
|
|
676
698
|
if (aborted)
|
|
677
699
|
parts.push('[aborted]');
|
|
700
|
+
if (leftOpen)
|
|
701
|
+
parts.push('[A background process still holds the command output and was left running.]');
|
|
678
702
|
if (r.truncated) {
|
|
679
703
|
const total = r.truncatedBy === 'lines' ? `${r.totalLines} lines` : `${r.totalBytes.toLocaleString()} bytes`;
|
|
680
704
|
const tailKb = Math.round(MAX_TOOL_OUTPUT_BYTES / 1024);
|
|
@@ -691,20 +715,23 @@ async function runBashForeground(command, timeoutMs, ctx) {
|
|
|
691
715
|
parts.push('(no output)');
|
|
692
716
|
resolveResult({ text: parts.join('\n'), isError: spawnError || timedOut || aborted || exitCode !== 0, exitCode, signal, timedOut, aborted });
|
|
693
717
|
};
|
|
694
|
-
|
|
695
|
-
|
|
718
|
+
void completion.then(({ code, signal, error, leftOpen }) => {
|
|
719
|
+
if (error) {
|
|
720
|
+
finish(`[error] failed to spawn shell: ${error.message}`, null, null, true);
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
696
723
|
const desc = code === null ? `exit signal: ${signal ?? 'unknown'}` : `exit code: ${code}`;
|
|
697
|
-
finish(desc, code, signal);
|
|
724
|
+
finish(desc, code, signal, false, leftOpen);
|
|
698
725
|
});
|
|
699
726
|
});
|
|
700
727
|
}
|
|
701
728
|
function runBashBackground(command, ctx) {
|
|
702
|
-
const { child, killTree, ended } = spawnShell(command, ctx.cwd);
|
|
729
|
+
const { child, killTree, ended, completion } = spawnShell(command, ctx.cwd);
|
|
703
730
|
const shellId = ctx.shells.mintId();
|
|
704
731
|
ctx.shells.byId.set(shellId, { kill: killTree, backgrounded: true, ended });
|
|
705
732
|
// Auto-deregister on natural exit so KillShell on a finished bg job
|
|
706
733
|
// returns the "no such shell" message rather than reporting success.
|
|
707
|
-
|
|
734
|
+
void completion.then(() => { ctx.shells.byId.delete(shellId); });
|
|
708
735
|
// Don't accumulate output for background — the caller asked for a
|
|
709
736
|
// detached shell. Drain to /dev/null so the pipe buffer doesn't
|
|
710
737
|
// back-pressure the child.
|
|
@@ -715,7 +742,7 @@ function runBashBackground(command, ctx) {
|
|
|
715
742
|
const BashTool = {
|
|
716
743
|
def: {
|
|
717
744
|
name: 'Bash',
|
|
718
|
-
description: 'Run a shell command in the workflow cwd via sh -c. Foreground: returns stdout+stderr (combined cap 64 KB) + exit code. Default timeout 60s; max 600s. With run_in_background:true, returns a shellId immediately — the command keeps running until it finishes or KillShell terminates it.',
|
|
745
|
+
description: 'Run a shell command in the workflow cwd via sh -c. Foreground: returns stdout+stderr (combined cap 64 KB) + exit code. If a background process keeps output open after the shell exits, the result warns that it was left running. Default timeout 60s; max 600s. With run_in_background:true, returns a shellId immediately — the command keeps running until it finishes or KillShell terminates it.',
|
|
719
746
|
input_schema: {
|
|
720
747
|
type: 'object',
|
|
721
748
|
properties: {
|
|
@@ -896,7 +923,7 @@ const AskUserQuestionTool = {
|
|
|
896
923
|
const TaskTool = {
|
|
897
924
|
def: {
|
|
898
925
|
name: 'Task',
|
|
899
|
-
description: 'Spawn a child agent in a new tab to handle a self-contained sub-task. The child runs with the operator\'s visibility (its own tab) and inherits the parent\'s transport. Returns the child\'s final assistant reply when it settles. Depth-1 only — a child cannot itself call Task.
|
|
926
|
+
description: 'Spawn a child agent in a new tab to handle a self-contained sub-task. The child runs with the operator\'s visibility (its own tab) and inherits the parent\'s transport. Returns the child\'s final assistant reply when it settles. With run_in_background true, returns at once with the taskId; the result arrives later as a notice, and TaskOutput reads its progress meanwhile. Depth-1 only — a child cannot itself call Task. Stopping the parent cancels the child. Instruct the child to END with a concise, verifiable self-report: what it changed (files/paths), what it ran to verify (commands + outcome), and anything left undone or uncertain — so you can trust the result without re-deriving it.',
|
|
900
927
|
input_schema: {
|
|
901
928
|
type: 'object',
|
|
902
929
|
properties: {
|
|
@@ -904,6 +931,7 @@ const TaskTool = {
|
|
|
904
931
|
prompt: { type: 'string', description: 'The seed prompt for the child agent.' },
|
|
905
932
|
subagent_type: { type: 'string', description: 'Optional subagent label (informational; child still runs as the parent\'s configured provider).' },
|
|
906
933
|
model: { type: 'string', description: 'Optional child model. The operator\'s Sub-agent model setting overrides this when set; otherwise an omitted model inherits the parent.' },
|
|
934
|
+
run_in_background: { type: 'boolean', description: 'Run the child in the background and continue working; its result arrives as a notice when it finishes. Default false waits for the result.' },
|
|
907
935
|
},
|
|
908
936
|
required: ['description', 'prompt'],
|
|
909
937
|
},
|
|
@@ -917,7 +945,8 @@ const TaskTool = {
|
|
|
917
945
|
const prompt = asString(args.prompt, 'prompt');
|
|
918
946
|
const subagentType = asOptString(args.subagent_type, 'subagent_type');
|
|
919
947
|
const model = asOptString(args.model, 'model');
|
|
920
|
-
|
|
948
|
+
const runInBackground = args.run_in_background === true;
|
|
949
|
+
return await ctx.spawnTask({ description, prompt, subagentType, model, runInBackground });
|
|
921
950
|
},
|
|
922
951
|
};
|
|
923
952
|
// ── TaskOutput (7b) ──
|
|
@@ -20,10 +20,12 @@ export interface TaskSpawnArgs {
|
|
|
20
20
|
parentWorkflowId: string;
|
|
21
21
|
taskId?: string;
|
|
22
22
|
turnSignal?: AbortSignal;
|
|
23
|
+
lifetimeSignal?: AbortSignal;
|
|
23
24
|
signal?: AbortSignal;
|
|
24
25
|
policy?: NativeSubagentPolicy;
|
|
25
26
|
onQueued?: (model: string) => void;
|
|
26
27
|
onModel?: (model: string) => void;
|
|
28
|
+
onStarted?: () => void;
|
|
27
29
|
description: string;
|
|
28
30
|
prompt: string;
|
|
29
31
|
subagentType?: string;
|
|
@@ -112,8 +114,17 @@ export declare class ClaudeNativeWorker extends EventEmitter {
|
|
|
112
114
|
private planBroadcast;
|
|
113
115
|
private taskHandler;
|
|
114
116
|
private taskTurn;
|
|
117
|
+
private taskStartsThisTurn;
|
|
118
|
+
private approvedTaskModels;
|
|
119
|
+
private taskBatchRefusal;
|
|
115
120
|
private taskPolicy;
|
|
116
121
|
private taskRequests;
|
|
122
|
+
private backgroundLife;
|
|
123
|
+
private backgroundTaskIds;
|
|
124
|
+
private backgroundNotices;
|
|
125
|
+
private backgroundNoticeTimer;
|
|
126
|
+
private taskNoticeHandler;
|
|
127
|
+
private backgroundNoticeGatherMs;
|
|
117
128
|
private workflowEventBroadcast;
|
|
118
129
|
private clusterEventBroadcast;
|
|
119
130
|
private toolCallCountSinceCompact;
|
|
@@ -129,6 +140,7 @@ export declare class ClaudeNativeWorker extends EventEmitter {
|
|
|
129
140
|
setTodosBroadcast(fn: (todos: Todo[]) => void): void;
|
|
130
141
|
setPlanBroadcast(fn: PlanBroadcast): void;
|
|
131
142
|
setTaskHandler(fn: TaskSpawnHandler): void;
|
|
143
|
+
setTaskNoticeHandler(fn: (text: string) => void): void;
|
|
132
144
|
setHookWakeHandler(fn: (text: string) => void): void;
|
|
133
145
|
setWorkflowEventBroadcast(fn: (msg: ServerMessage) => void): void;
|
|
134
146
|
setClusterEventBroadcast(fn: (msg: ServerMessage) => void): void;
|
|
@@ -214,8 +226,14 @@ export declare class ClaudeNativeWorker extends EventEmitter {
|
|
|
214
226
|
private reportHooks;
|
|
215
227
|
private onBackgroundHook;
|
|
216
228
|
private takeHookContext;
|
|
217
|
-
cancel(
|
|
229
|
+
cancel(opts?: {
|
|
230
|
+
keepBackground?: boolean;
|
|
231
|
+
}): void;
|
|
218
232
|
private cancelPendingTasks;
|
|
233
|
+
private emitTaskEvent;
|
|
234
|
+
private noteBackgroundSettled;
|
|
235
|
+
private flushBackgroundNotices;
|
|
236
|
+
private startBackgroundTask;
|
|
219
237
|
dispose(): Promise<void>;
|
|
220
238
|
private pruneOrphanToolUse;
|
|
221
239
|
private scrubServerToolEvidenceOnAbort;
|
|
@@ -241,6 +259,9 @@ export declare class ClaudeNativeWorker extends EventEmitter {
|
|
|
241
259
|
private filterToolOutput;
|
|
242
260
|
private handleEnterPlanMode;
|
|
243
261
|
private handleExitPlanMode;
|
|
262
|
+
private batchMarkerPath;
|
|
263
|
+
private batchCatalog;
|
|
264
|
+
private approveTaskBatch;
|
|
244
265
|
private handleAskUserQuestion;
|
|
245
266
|
private handleSpawnTask;
|
|
246
267
|
hasActiveTask(taskId: string): boolean;
|