yzcode-cli 1.0.2 → 1.0.4
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/QueryEngine.ts +46 -46
- package/README.md +39 -0
- package/Task.ts +3 -3
- package/Tool.ts +25 -25
- package/assistant/gate.ts +2 -0
- package/assistant/index.ts +2 -0
- package/assistant/sessionHistory.ts +87 -0
- package/bin/yzcode.js +16 -9
- package/bootstrap/state.ts +1769 -0
- package/bridge/bridgeApi.ts +539 -0
- package/bridge/bridgeConfig.ts +48 -0
- package/bridge/bridgeDebug.ts +135 -0
- package/bridge/bridgeEnabled.ts +202 -0
- package/bridge/bridgeMain.ts +2999 -0
- package/bridge/bridgeMessaging.ts +461 -0
- package/bridge/bridgePermissionCallbacks.ts +43 -0
- package/bridge/bridgePointer.ts +210 -0
- package/bridge/bridgeStatusUtil.ts +163 -0
- package/bridge/bridgeUI.ts +530 -0
- package/bridge/capacityWake.ts +56 -0
- package/bridge/codeSessionApi.ts +168 -0
- package/bridge/createSession.ts +384 -0
- package/bridge/debugUtils.ts +141 -0
- package/bridge/envLessBridgeConfig.ts +165 -0
- package/bridge/flushGate.ts +71 -0
- package/bridge/inboundAttachments.ts +175 -0
- package/bridge/inboundMessages.ts +80 -0
- package/bridge/initReplBridge.ts +569 -0
- package/bridge/jwtUtils.ts +256 -0
- package/bridge/pollConfig.ts +110 -0
- package/bridge/pollConfigDefaults.ts +82 -0
- package/bridge/remoteBridgeCore.ts +1008 -0
- package/bridge/replBridge.ts +2406 -0
- package/bridge/replBridgeHandle.ts +36 -0
- package/bridge/replBridgeTransport.ts +370 -0
- package/bridge/sessionIdCompat.ts +57 -0
- package/bridge/sessionRunner.ts +550 -0
- package/bridge/trustedDevice.ts +210 -0
- package/bridge/types.ts +262 -0
- package/bridge/workSecret.ts +127 -0
- package/buddy/CompanionSprite.tsx +371 -0
- package/buddy/companion.ts +133 -0
- package/buddy/prompt.ts +36 -0
- package/buddy/sprites.ts +514 -0
- package/buddy/types.ts +148 -0
- package/buddy/useBuddyNotification.tsx +98 -0
- package/cli/handlers/agents.ts +3 -3
- package/cli/handlers/auth.ts +18 -18
- package/cli/handlers/autoMode.ts +6 -6
- package/cli/handlers/mcp.tsx +16 -16
- package/cli/handlers/plugins.ts +20 -20
- package/cli/handlers/util.tsx +10 -10
- package/cli/ndjsonSafeStringify.ts +1 -1
- package/cli/print.ts +137 -137
- package/cli/remoteIO.ts +21 -21
- package/cli/structuredIO.ts +24 -24
- package/cli/transports/HybridTransport.ts +6 -6
- package/cli/transports/SSETransport.ts +9 -9
- package/cli/transports/SerialBatchEventUploader.ts +1 -1
- package/cli/transports/WebSocketTransport.ts +11 -11
- package/cli/transports/WorkerStateUploader.ts +1 -1
- package/cli/transports/ccrClient.ts +14 -14
- package/cli/transports/transportUtils.ts +5 -5
- package/cli/update.ts +13 -13
- package/commands/add-dir/add-dir.tsx +10 -10
- package/commands/add-dir/index.ts +1 -1
- package/commands/add-dir/validation.ts +4 -4
- package/commands/advisor.ts +6 -6
- package/commands/agents/agents.tsx +4 -4
- package/commands/agents/index.ts +1 -1
- package/commands/branch/branch.ts +9 -9
- package/commands/branch/index.ts +1 -1
- package/commands/bridge/bridge.tsx +15 -15
- package/commands/bridge/index.ts +2 -2
- package/commands/bridge-kick.ts +3 -3
- package/commands/brief.ts +8 -8
- package/commands/btw/btw.tsx +21 -21
- package/commands/btw/index.ts +1 -1
- package/commands/chrome/chrome.tsx +11 -11
- package/commands/chrome/index.ts +2 -2
- package/commands/clear/caches.ts +20 -20
- package/commands/clear/clear.ts +2 -2
- package/commands/clear/conversation.ts +19 -19
- package/commands/clear/index.ts +3 -3
- package/commands/color/color.ts +6 -6
- package/commands/color/index.ts +1 -1
- package/commands/commit-push-pr.ts +5 -5
- package/commands/commit.ts +4 -4
- package/commands/compact/compact.ts +20 -20
- package/commands/compact/index.ts +2 -2
- package/commands/config/config.tsx +2 -2
- package/commands/config/index.ts +1 -1
- package/commands/context/context-noninteractive.ts +10 -10
- package/commands/context/context.tsx +8 -8
- package/commands/context/index.ts +2 -2
- package/commands/copy/copy.tsx +16 -16
- package/commands/copy/index.ts +1 -1
- package/commands/cost/cost.ts +4 -4
- package/commands/cost/index.ts +2 -2
- package/commands/createMovedToPluginCommand.ts +3 -3
- package/commands/desktop/desktop.tsx +2 -2
- package/commands/desktop/index.ts +1 -1
- package/commands/diff/diff.tsx +1 -1
- package/commands/diff/index.ts +1 -1
- package/commands/doctor/doctor.tsx +2 -2
- package/commands/doctor/index.ts +2 -2
- package/commands/effort/effort.tsx +6 -6
- package/commands/effort/index.ts +2 -2
- package/commands/exit/exit.tsx +5 -5
- package/commands/exit/index.ts +1 -1
- package/commands/export/export.tsx +7 -7
- package/commands/export/index.ts +1 -1
- package/commands/extra-usage/extra-usage-core.ts +8 -8
- package/commands/extra-usage/extra-usage-noninteractive.ts +1 -1
- package/commands/extra-usage/extra-usage.tsx +4 -4
- package/commands/extra-usage/index.ts +4 -4
- package/commands/fast/fast.tsx +12 -12
- package/commands/fast/index.ts +3 -3
- package/commands/feedback/feedback.tsx +4 -4
- package/commands/feedback/index.ts +4 -4
- package/commands/files/files.ts +4 -4
- package/commands/files/index.ts +1 -1
- package/commands/heapdump/heapdump.ts +1 -1
- package/commands/heapdump/index.ts +1 -1
- package/commands/help/help.tsx +2 -2
- package/commands/help/index.ts +1 -1
- package/commands/hooks/hooks.tsx +4 -4
- package/commands/hooks/index.ts +1 -1
- package/commands/ide/ide.tsx +13 -13
- package/commands/ide/index.ts +1 -1
- package/commands/init-verifiers.ts +2 -2
- package/commands/init.ts +3 -3
- package/commands/insights.ts +15 -15
- package/commands/install-github-app/ApiKeyStep.tsx +4 -4
- package/commands/install-github-app/CheckExistingSecretStep.tsx +4 -4
- package/commands/install-github-app/CheckGitHubStep.tsx +1 -1
- package/commands/install-github-app/ChooseRepoStep.tsx +4 -4
- package/commands/install-github-app/CreatingStep.tsx +2 -2
- package/commands/install-github-app/ErrorStep.tsx +2 -2
- package/commands/install-github-app/ExistingWorkflowStep.tsx +2 -2
- package/commands/install-github-app/InstallAppStep.tsx +3 -3
- package/commands/install-github-app/OAuthFlowStep.tsx +11 -11
- package/commands/install-github-app/SuccessStep.tsx +1 -1
- package/commands/install-github-app/WarningsStep.tsx +4 -4
- package/commands/install-github-app/index.ts +2 -2
- package/commands/install-github-app/install-github-app.tsx +25 -25
- package/commands/install-github-app/setupGitHubActions.ts +7 -7
- package/commands/install-slack-app/index.ts +1 -1
- package/commands/install-slack-app/install-slack-app.ts +4 -4
- package/commands/install.tsx +9 -9
- package/commands/keybindings/index.ts +2 -2
- package/commands/keybindings/keybindings.ts +4 -4
- package/commands/login/index.ts +3 -3
- package/commands/login/login.tsx +15 -15
- package/commands/logout/index.ts +2 -2
- package/commands/logout/logout.tsx +13 -13
- package/commands/mcp/addCommand.ts +8 -8
- package/commands/mcp/index.ts +1 -1
- package/commands/mcp/mcp.tsx +6 -6
- package/commands/mcp/xaaIdpCommand.ts +4 -4
- package/commands/memory/index.ts +1 -1
- package/commands/memory/memory.tsx +11 -11
- package/commands/mobile/index.ts +1 -1
- package/commands/mobile/mobile.tsx +5 -5
- package/commands/model/index.ts +3 -3
- package/commands/model/model.tsx +14 -14
- package/commands/output-style/index.ts +1 -1
- package/commands/output-style/output-style.tsx +1 -1
- package/commands/passes/index.ts +2 -2
- package/commands/passes/passes.tsx +5 -5
- package/commands/permissions/index.ts +1 -1
- package/commands/permissions/permissions.tsx +3 -3
- package/commands/plan/index.ts +1 -1
- package/commands/plan/plan.tsx +11 -11
- package/commands/plugin/AddMarketplace.tsx +13 -13
- package/commands/plugin/BrowseMarketplace.tsx +24 -24
- package/commands/plugin/DiscoverPlugins.tsx +27 -27
- package/commands/plugin/ManageMarketplaces.tsx +19 -19
- package/commands/plugin/ManagePlugins.tsx +46 -46
- package/commands/plugin/PluginErrors.tsx +1 -1
- package/commands/plugin/PluginOptionsDialog.tsx +6 -6
- package/commands/plugin/PluginOptionsFlow.tsx +7 -7
- package/commands/plugin/PluginSettings.tsx +25 -25
- package/commands/plugin/PluginTrustWarning.tsx +2 -2
- package/commands/plugin/UnifiedInstalledCell.tsx +3 -3
- package/commands/plugin/ValidatePlugin.tsx +5 -5
- package/commands/plugin/index.tsx +1 -1
- package/commands/plugin/plugin.tsx +2 -2
- package/commands/plugin/pluginDetailsHelpers.tsx +4 -4
- package/commands/pr_comments/index.ts +1 -1
- package/commands/privacy-settings/index.ts +2 -2
- package/commands/privacy-settings/privacy-settings.tsx +4 -4
- package/commands/rate-limit-options/index.ts +2 -2
- package/commands/rate-limit-options/rate-limit-options.tsx +14 -14
- package/commands/release-notes/index.ts +1 -1
- package/commands/release-notes/release-notes.ts +2 -2
- package/commands/reload-plugins/index.ts +1 -1
- package/commands/reload-plugins/reload-plugins.ts +7 -7
- package/commands/remote-env/index.ts +3 -3
- package/commands/remote-env/remote-env.tsx +2 -2
- package/commands/remote-setup/api.ts +4 -4
- package/commands/remote-setup/index.ts +3 -3
- package/commands/remote-setup/remote-setup.tsx +9 -9
- package/commands/rename/generateSessionName.ts +8 -8
- package/commands/rename/index.ts +1 -1
- package/commands/rename/rename.ts +8 -8
- package/commands/resume/index.ts +1 -1
- package/commands/resume/resume.tsx +17 -17
- package/commands/review/UltrareviewOverageDialog.tsx +3 -3
- package/commands/review/reviewRemote.ts +12 -12
- package/commands/review/ultrareviewCommand.tsx +4 -4
- package/commands/review/ultrareviewEnabled.ts +1 -1
- package/commands/review.ts +3 -3
- package/commands/rewind/index.ts +1 -1
- package/commands/rewind/rewind.ts +2 -2
- package/commands/sandbox-toggle/index.ts +2 -2
- package/commands/sandbox-toggle/sandbox-toggle.tsx +7 -7
- package/commands/security-review.ts +4 -4
- package/commands/session/index.ts +2 -2
- package/commands/session/session.tsx +6 -6
- package/commands/skills/index.ts +1 -1
- package/commands/skills/skills.tsx +3 -3
- package/commands/stats/index.ts +1 -1
- package/commands/stats/stats.tsx +2 -2
- package/commands/status/index.ts +1 -1
- package/commands/status/status.tsx +3 -3
- package/commands/statusline.tsx +2 -2
- package/commands/stickers/index.ts +1 -1
- package/commands/stickers/stickers.ts +2 -2
- package/commands/tag/index.ts +1 -1
- package/commands/tag/tag.tsx +10 -10
- package/commands/tasks/index.ts +1 -1
- package/commands/tasks/tasks.tsx +3 -3
- package/commands/terminalSetup/index.ts +2 -2
- package/commands/terminalSetup/terminalSetup.tsx +16 -16
- package/commands/theme/index.ts +1 -1
- package/commands/theme/theme.tsx +5 -5
- package/commands/thinkback/index.ts +2 -2
- package/commands/thinkback/thinkback.tsx +20 -20
- package/commands/thinkback-play/index.ts +2 -2
- package/commands/thinkback-play/thinkback-play.ts +4 -4
- package/commands/ultraplan.tsx +17 -17
- package/commands/upgrade/index.ts +3 -3
- package/commands/upgrade/upgrade.tsx +7 -7
- package/commands/usage/index.ts +1 -1
- package/commands/usage/usage.tsx +2 -2
- package/commands/version.ts +1 -1
- package/commands/vim/index.ts +1 -1
- package/commands/vim/vim.ts +3 -3
- package/commands/voice/index.ts +2 -2
- package/commands/voice/voice.ts +9 -9
- package/commands.ts +105 -105
- package/components/AgentProgressLine.tsx +3 -3
- package/components/App.tsx +5 -5
- package/components/ApproveApiKey.tsx +4 -4
- package/components/AutoModeOptInDialog.tsx +5 -5
- package/components/AutoUpdater.tsx +11 -11
- package/components/AutoUpdaterWrapper.tsx +7 -7
- package/components/AwsAuthStatusBox.tsx +2 -2
- package/components/BaseTextInput.tsx +7 -7
- package/components/BashModeProgress.tsx +5 -5
- package/components/BridgeDialog.tsx +10 -10
- package/components/BypassPermissionsModeDialog.tsx +6 -6
- package/components/ChannelDowngradeDialog.tsx +3 -3
- package/components/ClaudeCodeHint/PluginHintMenu.tsx +3 -3
- package/components/ClaudeInChromeOnboarding.tsx +5 -5
- package/components/ClaudeMdExternalIncludesDialog.tsx +6 -6
- package/components/ClickableImageRef.tsx +5 -5
- package/components/CompactSummary.tsx +7 -7
- package/components/ConfigurableShortcutHint.tsx +3 -3
- package/components/ConsoleOAuthFlow.tsx +17 -17
- package/components/ContextSuggestions.tsx +4 -4
- package/components/ContextVisualization.tsx +9 -9
- package/components/CoordinatorAgentStatus.tsx +10 -10
- package/components/CostThresholdDialog.tsx +3 -3
- package/components/CtrlOToExpand.tsx +5 -5
- package/components/CustomSelect/SelectMulti.tsx +7 -7
- package/components/CustomSelect/index.ts +3 -3
- package/components/CustomSelect/option-map.ts +1 -1
- package/components/CustomSelect/select-input-option.tsx +11 -11
- package/components/CustomSelect/select-option.tsx +1 -1
- package/components/CustomSelect/select.tsx +10 -10
- package/components/CustomSelect/use-multi-select-state.ts +6 -6
- package/components/CustomSelect/use-select-input.ts +7 -7
- package/components/CustomSelect/use-select-navigation.ts +2 -2
- package/components/CustomSelect/use-select-state.ts +2 -2
- package/components/DesktopHandoff.tsx +8 -8
- package/components/DesktopUpsell/DesktopUpsellStartup.tsx +7 -7
- package/components/DevBar.tsx +2 -2
- package/components/DevChannelsDialog.tsx +5 -5
- package/components/DiagnosticsDisplay.tsx +6 -6
- package/components/EffortCallout.tsx +11 -11
- package/components/EffortIndicator.ts +2 -2
- package/components/ExitFlow.tsx +2 -2
- package/components/ExportDialog.tsx +13 -13
- package/components/FallbackToolUseErrorMessage.tsx +7 -7
- package/components/FallbackToolUseRejectedMessage.tsx +2 -2
- package/components/FastIcon.tsx +5 -5
- package/components/Feedback.tsx +27 -27
- package/components/FeedbackSurvey/FeedbackSurvey.tsx +7 -7
- package/components/FeedbackSurvey/FeedbackSurveyView.tsx +3 -3
- package/components/FeedbackSurvey/TranscriptSharePrompt.tsx +3 -3
- package/components/FeedbackSurvey/submitTranscriptShare.ts +9 -9
- package/components/FeedbackSurvey/useDebouncedDigitInput.ts +1 -1
- package/components/FeedbackSurvey/useFeedbackSurvey.tsx +15 -15
- package/components/FeedbackSurvey/useMemorySurvey.tsx +16 -16
- package/components/FeedbackSurvey/usePostCompactSurvey.tsx +10 -10
- package/components/FeedbackSurvey/useSurveyState.tsx +2 -2
- package/components/FileEditToolDiff.tsx +9 -9
- package/components/FileEditToolUpdatedMessage.tsx +5 -5
- package/components/FileEditToolUseRejectedMessage.tsx +6 -6
- package/components/FilePathLink.tsx +1 -1
- package/components/FullscreenLayout.tsx +13 -13
- package/components/GlobalSearchDialog.tsx +13 -13
- package/components/HelpV2/Commands.tsx +5 -5
- package/components/HelpV2/General.tsx +2 -2
- package/components/HelpV2/HelpV2.tsx +11 -11
- package/components/HighlightedCode/Fallback.tsx +5 -5
- package/components/HighlightedCode.tsx +7 -7
- package/components/HistorySearchDialog.tsx +10 -10
- package/components/IdeAutoConnectDialog.tsx +5 -5
- package/components/IdeOnboardingDialog.tsx +7 -7
- package/components/IdeStatusIndicator.tsx +4 -4
- package/components/IdleReturnDialog.tsx +4 -4
- package/components/InterruptedByUser.tsx +1 -1
- package/components/InvalidConfigDialog.tsx +9 -9
- package/components/InvalidSettingsDialog.tsx +5 -5
- package/components/KeybindingWarnings.tsx +2 -2
- package/components/LanguagePicker.tsx +3 -3
- package/components/LogSelector.tsx +28 -28
- package/components/LogoV2/AnimatedAsterisk.tsx +4 -4
- package/components/LogoV2/AnimatedClawd.tsx +3 -3
- package/components/LogoV2/ChannelsNotice.tsx +8 -8
- package/components/LogoV2/Clawd.tsx +2 -2
- package/components/LogoV2/CondensedLogo.tsx +15 -15
- package/components/LogoV2/EmergencyTip.tsx +3 -3
- package/components/LogoV2/Feed.tsx +3 -3
- package/components/LogoV2/FeedColumn.tsx +4 -4
- package/components/LogoV2/GuestPassesUpsell.tsx +4 -4
- package/components/LogoV2/LogoV2.tsx +31 -31
- package/components/LogoV2/Opus1mMergeNotice.tsx +5 -5
- package/components/LogoV2/OverageCreditUpsell.tsx +6 -6
- package/components/LogoV2/VoiceModeNotice.tsx +6 -6
- package/components/LogoV2/WelcomeV2.tsx +2 -2
- package/components/LogoV2/feedConfigs.tsx +7 -7
- package/components/LspRecommendation/LspRecommendationMenu.tsx +3 -3
- package/components/MCPServerApprovalDialog.tsx +5 -5
- package/components/MCPServerDesktopImportDialog.tsx +11 -11
- package/components/MCPServerDialogCopy.tsx +1 -1
- package/components/MCPServerMultiselectDialog.tsx +9 -9
- package/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.tsx +7 -7
- package/components/ManagedSettingsSecurityDialog/utils.ts +3 -3
- package/components/Markdown.tsx +7 -7
- package/components/MarkdownTable.tsx +6 -6
- package/components/MemoryUsageIndicator.tsx +3 -3
- package/components/Message.tsx +29 -29
- package/components/MessageModel.tsx +3 -3
- package/components/MessageResponse.tsx +2 -2
- package/components/MessageRow.tsx +12 -12
- package/components/MessageSelector.tsx +20 -20
- package/components/MessageTimestamp.tsx +3 -3
- package/components/Messages.tsx +39 -39
- package/components/ModelPicker.tsx +16 -16
- package/components/NativeAutoUpdater.tsx +11 -11
- package/components/NotebookEditToolUseRejectedMessage.tsx +4 -4
- package/components/OffscreenFreeze.tsx +3 -3
- package/components/Onboarding.tsx +19 -19
- package/components/OutputStylePicker.tsx +7 -7
- package/components/PackageManagerAutoUpdater.tsx +7 -7
- package/components/Passes/Passes.tsx +12 -12
- package/components/PrBadge.tsx +2 -2
- package/components/PressEnterToContinue.tsx +1 -1
- package/components/PromptInput/HistorySearchInput.tsx +3 -3
- package/components/PromptInput/IssueFlagBanner.tsx +2 -2
- package/components/PromptInput/Notifications.tsx +30 -30
- package/components/PromptInput/PromptInput.tsx +117 -117
- package/components/PromptInput/PromptInputFooter.tsx +22 -22
- package/components/PromptInput/PromptInputFooterLeftSide.tsx +33 -33
- package/components/PromptInput/PromptInputFooterSuggestions.tsx +5 -5
- package/components/PromptInput/PromptInputHelpMenu.tsx +7 -7
- package/components/PromptInput/PromptInputModeIndicator.tsx +6 -6
- package/components/PromptInput/PromptInputQueuedCommands.tsx +10 -10
- package/components/PromptInput/PromptInputStashNotice.tsx +1 -1
- package/components/PromptInput/SandboxPromptFooterHint.tsx +3 -3
- package/components/PromptInput/ShimmeredInput.tsx +3 -3
- package/components/PromptInput/VoiceIndicator.tsx +3 -3
- package/components/PromptInput/inputModes.ts +2 -2
- package/components/PromptInput/inputPaste.ts +2 -2
- package/components/PromptInput/useMaybeTruncateInput.ts +2 -2
- package/components/PromptInput/usePromptInputPlaceholder.ts +5 -5
- package/components/PromptInput/useSwarmBanner.ts +10 -10
- package/components/PromptInput/utils.ts +4 -4
- package/components/QuickOpenDialog.tsx +12 -12
- package/components/RemoteCallout.tsx +7 -7
- package/components/RemoteEnvironmentDialog.tsx +14 -14
- package/components/ResumeTask.tsx +14 -14
- package/components/SandboxViolationExpandedView.tsx +4 -4
- package/components/ScrollKeybindingHandler.tsx +10 -10
- package/components/SearchBox.tsx +1 -1
- package/components/SessionBackgroundHint.tsx +10 -10
- package/components/SessionPreview.tsx +11 -11
- package/components/Settings/Config.tsx +43 -43
- package/components/Settings/Settings.tsx +10 -10
- package/components/Settings/Status.tsx +10 -10
- package/components/Settings/Usage.tsx +14 -14
- package/components/ShowInIDEPrompt.tsx +6 -6
- package/components/SkillImprovementSurvey.tsx +6 -6
- package/components/Spinner/FlashingChar.tsx +3 -3
- package/components/Spinner/GlimmerMessage.tsx +6 -6
- package/components/Spinner/ShimmerChar.tsx +2 -2
- package/components/Spinner/SpinnerAnimationRow.tsx +12 -12
- package/components/Spinner/SpinnerGlyph.tsx +3 -3
- package/components/Spinner/TeammateSpinnerLine.tsx +11 -11
- package/components/Spinner/TeammateSpinnerTree.tsx +6 -6
- package/components/Spinner/index.ts +8 -8
- package/components/Spinner/useShimmerAnimation.ts +3 -3
- package/components/Spinner/utils.ts +2 -2
- package/components/Spinner.tsx +32 -32
- package/components/Stats.tsx +18 -18
- package/components/StatusLine.tsx +26 -26
- package/components/StatusNotices.tsx +5 -5
- package/components/StructuredDiff/Fallback.tsx +3 -3
- package/components/StructuredDiff/colorDiff.ts +1 -1
- package/components/StructuredDiff.tsx +6 -6
- package/components/StructuredDiffList.tsx +3 -3
- package/components/TagTabs.tsx +3 -3
- package/components/TaskListV2.tsx +13 -13
- package/components/TeammateViewHeader.tsx +6 -6
- package/components/TeleportError.tsx +7 -7
- package/components/TeleportProgress.tsx +4 -4
- package/components/TeleportRepoMismatchDialog.tsx +6 -6
- package/components/TeleportResumeWrapper.tsx +8 -8
- package/components/TeleportStash.tsx +7 -7
- package/components/TextInput.tsx +10 -10
- package/components/ThemePicker.tsx +16 -16
- package/components/ThinkingToggle.tsx +8 -8
- package/components/TokenWarning.tsx +7 -7
- package/components/ToolUseLoader.tsx +3 -3
- package/components/TrustDialog/TrustDialog.tsx +15 -15
- package/components/TrustDialog/utils.ts +6 -6
- package/components/ValidationErrorsList.tsx +3 -3
- package/components/VimTextInput.tsx +6 -6
- package/components/VirtualMessageList.tsx +12 -12
- package/components/WorkflowMultiselectDialog.tsx +8 -8
- package/components/WorktreeExitDialog.tsx +11 -11
- package/components/agents/AgentDetail.tsx +11 -11
- package/components/agents/AgentEditor.tsx +13 -13
- package/components/agents/AgentNavigationFooter.tsx +2 -2
- package/components/agents/AgentsList.tsx +10 -10
- package/components/agents/AgentsMenu.tsx +20 -20
- package/components/agents/ColorPicker.tsx +4 -4
- package/components/agents/ModelSelector.tsx +3 -3
- package/components/agents/ToolSelector.tsx +27 -27
- package/components/agents/agentFileUtils.ts +9 -9
- package/components/agents/generateAgent.ts +11 -11
- package/components/agents/new-agent-creation/CreateAgentWizard.tsx +17 -17
- package/components/agents/new-agent-creation/wizard-steps/ColorStep.tsx +10 -10
- package/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx +17 -17
- package/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.tsx +10 -10
- package/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsx +10 -10
- package/components/agents/new-agent-creation/wizard-steps/GenerateStep.tsx +13 -13
- package/components/agents/new-agent-creation/wizard-steps/LocationStep.tsx +9 -9
- package/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx +11 -11
- package/components/agents/new-agent-creation/wizard-steps/MethodStep.tsx +8 -8
- package/components/agents/new-agent-creation/wizard-steps/ModelStep.tsx +7 -7
- package/components/agents/new-agent-creation/wizard-steps/PromptStep.tsx +10 -10
- package/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsx +8 -8
- package/components/agents/new-agent-creation/wizard-steps/TypeStep.tsx +11 -11
- package/components/agents/types.ts +2 -2
- package/components/agents/utils.ts +2 -2
- package/components/agents/validateAgent.ts +4 -4
- package/components/design-system/Byline.tsx +1 -1
- package/components/design-system/Dialog.tsx +8 -8
- package/components/design-system/Divider.tsx +4 -4
- package/components/design-system/FuzzyPicker.tsx +10 -10
- package/components/design-system/KeyboardShortcutHint.tsx +1 -1
- package/components/design-system/ListItem.tsx +2 -2
- package/components/design-system/LoadingState.tsx +2 -2
- package/components/design-system/Pane.tsx +4 -4
- package/components/design-system/ProgressBar.tsx +2 -2
- package/components/design-system/Ratchet.tsx +3 -3
- package/components/design-system/StatusIcon.tsx +1 -1
- package/components/design-system/Tabs.tsx +8 -8
- package/components/design-system/ThemeProvider.tsx +4 -4
- package/components/design-system/ThemedBox.tsx +8 -8
- package/components/design-system/ThemedText.tsx +4 -4
- package/components/design-system/color.ts +3 -3
- package/components/diff/DiffDetailView.tsx +6 -6
- package/components/diff/DiffDialog.tsx +13 -13
- package/components/diff/DiffFileList.tsx +5 -5
- package/components/grove/Grove.tsx +7 -7
- package/components/hooks/HooksConfigMenu.tsx +15 -15
- package/components/hooks/PromptDialog.tsx +5 -5
- package/components/hooks/SelectEventMode.tsx +6 -6
- package/components/hooks/SelectHookMode.tsx +6 -6
- package/components/hooks/SelectMatcherMode.tsx +6 -6
- package/components/hooks/ViewHookMode.tsx +3 -3
- package/components/mcp/CapabilitiesSection.tsx +2 -2
- package/components/mcp/ElicitationDialog.tsx +15 -15
- package/components/mcp/MCPAgentServerMenu.tsx +12 -12
- package/components/mcp/MCPListPanel.tsx +13 -13
- package/components/mcp/MCPReconnect.tsx +5 -5
- package/components/mcp/MCPRemoteServerMenu.tsx +27 -27
- package/components/mcp/MCPSettings.tsx +13 -13
- package/components/mcp/MCPStdioServerMenu.tsx +17 -17
- package/components/mcp/MCPToolDetailView.tsx +6 -6
- package/components/mcp/MCPToolListView.tsx +12 -12
- package/components/mcp/McpParsingWarnings.tsx +5 -5
- package/components/mcp/index.ts +9 -9
- package/components/mcp/utils/reconnectHelpers.tsx +3 -3
- package/components/memory/MemoryFileSelector.tsx +19 -19
- package/components/memory/MemoryUpdateNotification.tsx +2 -2
- package/components/messageActions.tsx +5 -5
- package/components/messages/AdvisorMessage.tsx +7 -7
- package/components/messages/AssistantRedactedThinkingMessage.tsx +1 -1
- package/components/messages/AssistantTextMessage.tsx +15 -15
- package/components/messages/AssistantThinkingMessage.tsx +3 -3
- package/components/messages/AssistantToolUseMessage.tsx +17 -17
- package/components/messages/AttachmentMessage.tsx +24 -24
- package/components/messages/CollapsedReadSearchContent.tsx +16 -16
- package/components/messages/CompactBoundaryMessage.tsx +2 -2
- package/components/messages/GroupedToolUseContent.tsx +3 -3
- package/components/messages/HighlightedThinkingText.tsx +5 -5
- package/components/messages/HookProgressMessage.tsx +4 -4
- package/components/messages/PlanApprovalMessage.tsx +6 -6
- package/components/messages/RateLimitMessage.tsx +7 -7
- package/components/messages/ShutdownMessage.tsx +2 -2
- package/components/messages/SystemAPIErrorMessage.tsx +5 -5
- package/components/messages/SystemTextMessage.tsx +18 -18
- package/components/messages/TaskAssignmentMessage.tsx +2 -2
- package/components/messages/UserAgentNotificationMessage.tsx +3 -3
- package/components/messages/UserBashInputMessage.tsx +2 -2
- package/components/messages/UserBashOutputMessage.tsx +2 -2
- package/components/messages/UserChannelMessage.tsx +4 -4
- package/components/messages/UserCommandMessage.tsx +3 -3
- package/components/messages/UserImageMessage.tsx +5 -5
- package/components/messages/UserLocalCommandOutputMessage.tsx +6 -6
- package/components/messages/UserMemoryInputMessage.tsx +3 -3
- package/components/messages/UserPlanMessage.tsx +2 -2
- package/components/messages/UserPromptMessage.tsx +9 -9
- package/components/messages/UserResourceUpdateMessage.tsx +2 -2
- package/components/messages/UserTeammateMessage.tsx +9 -9
- package/components/messages/UserTextMessage.tsx +20 -20
- package/components/messages/UserToolResultMessage/RejectedPlanMessage.tsx +3 -3
- package/components/messages/UserToolResultMessage/RejectedToolUseMessage.tsx +2 -2
- package/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx +2 -2
- package/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx +10 -10
- package/components/messages/UserToolResultMessage/UserToolRejectMessage.tsx +6 -6
- package/components/messages/UserToolResultMessage/UserToolResultMessage.tsx +8 -8
- package/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx +9 -9
- package/components/messages/UserToolResultMessage/utils.tsx +2 -2
- package/components/messages/nullRenderingAttachments.ts +2 -2
- package/components/messages/teamMemCollapsed.tsx +2 -2
- package/components/messages/teamMemSaved.ts +1 -1
- package/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx +22 -22
- package/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.tsx +7 -7
- package/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.tsx +15 -15
- package/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.tsx +5 -5
- package/components/permissions/AskUserQuestionPermissionRequest/QuestionView.tsx +16 -16
- package/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.tsx +8 -8
- package/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx +29 -29
- package/components/permissions/BashPermissionRequest/bashToolUseOptions.tsx +8 -8
- package/components/permissions/ComputerUseApproval/ComputerUseApproval.tsx +6 -6
- package/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.tsx +8 -8
- package/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx +40 -40
- package/components/permissions/FallbackPermissionRequest.tsx +12 -12
- package/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx +7 -7
- package/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx +17 -17
- package/components/permissions/FilePermissionDialog/ideDiffConfig.ts +1 -1
- package/components/permissions/FilePermissionDialog/permissionOptions.tsx +7 -7
- package/components/permissions/FilePermissionDialog/useFilePermissionDialog.ts +9 -9
- package/components/permissions/FilePermissionDialog/usePermissionHandler.ts +10 -10
- package/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx +9 -9
- package/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx +6 -6
- package/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx +5 -5
- package/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx +6 -6
- package/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx +10 -10
- package/components/permissions/PermissionDecisionDebugInfo.tsx +11 -11
- package/components/permissions/PermissionDialog.tsx +4 -4
- package/components/permissions/PermissionExplanation.tsx +7 -7
- package/components/permissions/PermissionPrompt.tsx +6 -6
- package/components/permissions/PermissionRequest.tsx +32 -32
- package/components/permissions/PermissionRequestTitle.tsx +3 -3
- package/components/permissions/PermissionRuleExplanation.tsx +6 -6
- package/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.tsx +20 -20
- package/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.tsx +5 -5
- package/components/permissions/SandboxPermissionRequest.tsx +5 -5
- package/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx +10 -10
- package/components/permissions/SkillPermissionRequest/SkillPermissionRequest.tsx +14 -14
- package/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.tsx +9 -9
- package/components/permissions/WorkerBadge.tsx +3 -3
- package/components/permissions/WorkerPendingPermission.tsx +4 -4
- package/components/permissions/hooks.ts +13 -13
- package/components/permissions/rules/AddPermissionRules.tsx +14 -14
- package/components/permissions/rules/AddWorkspaceDirectory.tsx +13 -13
- package/components/permissions/rules/PermissionRuleDescription.tsx +3 -3
- package/components/permissions/rules/PermissionRuleInput.tsx +9 -9
- package/components/permissions/rules/PermissionRuleList.tsx +27 -27
- package/components/permissions/rules/RecentDenialsTab.tsx +5 -5
- package/components/permissions/rules/RemoveWorkspaceDirectory.tsx +5 -5
- package/components/permissions/rules/WorkspaceTab.tsx +6 -6
- package/components/permissions/shellPermissionHelpers.tsx +4 -4
- package/components/permissions/useShellPermissionFeedback.ts +5 -5
- package/components/permissions/utils.ts +3 -3
- package/components/sandbox/SandboxConfigTab.tsx +2 -2
- package/components/sandbox/SandboxDependenciesTab.tsx +3 -3
- package/components/sandbox/SandboxDoctorSection.tsx +2 -2
- package/components/sandbox/SandboxOverridesTab.tsx +5 -5
- package/components/sandbox/SandboxSettings.tsx +12 -12
- package/components/shell/OutputLine.tsx +8 -8
- package/components/shell/ShellProgressMessage.tsx +5 -5
- package/components/shell/ShellTimeDisplay.tsx +2 -2
- package/components/skills/SkillsMenu.tsx +9 -9
- package/components/tasks/AsyncAgentDetailDialog.tsx +16 -16
- package/components/tasks/BackgroundTask.tsx +10 -10
- package/components/tasks/BackgroundTaskStatus.tsx +13 -13
- package/components/tasks/BackgroundTasksDialog.tsx +37 -37
- package/components/tasks/DreamDetailDialog.tsx +10 -10
- package/components/tasks/InProcessTeammateDetailDialog.tsx +15 -15
- package/components/tasks/RemoteSessionDetailDialog.tsx +26 -26
- package/components/tasks/RemoteSessionProgress.tsx +7 -7
- package/components/tasks/ShellDetailDialog.tsx +13 -13
- package/components/tasks/ShellProgress.tsx +4 -4
- package/components/tasks/renderToolActivity.tsx +5 -5
- package/components/tasks/taskStatusUtils.tsx +6 -6
- package/components/teams/TeamStatus.tsx +2 -2
- package/components/teams/TeamsDialog.tsx +24 -24
- package/components/ui/OrderedList.tsx +2 -2
- package/components/ui/OrderedListItem.tsx +1 -1
- package/components/ui/TreeSelect.tsx +3 -3
- package/components/wizard/WizardDialogLayout.tsx +4 -4
- package/components/wizard/WizardNavigationFooter.tsx +5 -5
- package/components/wizard/WizardProvider.tsx +2 -2
- package/components/wizard/index.ts +5 -5
- package/components/wizard/useWizard.ts +2 -2
- package/constants/figures.ts +1 -1
- package/constants/github-app.ts +1 -1
- package/constants/keys.ts +1 -1
- package/constants/oauth.ts +1 -1
- package/constants/outputStyles.ts +7 -7
- package/constants/prompts.ts +42 -42
- package/constants/spinnerVerbs.ts +1 -1
- package/constants/system.ts +5 -5
- package/constants/systemPromptSections.ts +1 -1
- package/constants/tools.ts +28 -28
- package/context/QueuedMessageContext.tsx +1 -1
- package/context/fpsMetrics.tsx +1 -1
- package/context/mailbox.tsx +1 -1
- package/context/modalContext.tsx +1 -1
- package/context/notifications.tsx +2 -2
- package/context/overlayContext.tsx +2 -2
- package/context/promptOverlayContext.tsx +1 -1
- package/context/stats.tsx +1 -1
- package/context/voice.tsx +1 -1
- package/context.ts +9 -9
- package/coordinator/coordinatorMode.ts +369 -0
- package/cost-tracker.ts +11 -11
- package/costHook.ts +3 -3
- package/dialogLaunchers.tsx +10 -10
- package/entrypoints/agentSdkTypes.ts +8 -8
- package/entrypoints/init.ts +26 -26
- package/entrypoints/mcp.ts +18 -18
- package/entrypoints/sandboxTypes.ts +1 -1
- package/entrypoints/sdk/controlSchemas.ts +2 -2
- package/entrypoints/sdk/coreSchemas.ts +1 -1
- package/entrypoints/sdk/coreTypes.ts +3 -3
- package/entrypoints/sdk/toolTypes.ts +1 -1
- package/history.ts +11 -11
- package/hooks/fileSuggestions.ts +18 -18
- package/hooks/notifs/useAutoModeUnavailableNotification.ts +6 -6
- package/hooks/notifs/useCanSwitchToExistingSubscription.tsx +6 -6
- package/hooks/notifs/useDeprecationWarningNotification.tsx +3 -3
- package/hooks/notifs/useFastModeNotification.tsx +5 -5
- package/hooks/notifs/useIDEStatusIndicator.tsx +8 -8
- package/hooks/notifs/useInstallMessages.tsx +2 -2
- package/hooks/notifs/useLspInitializationNotification.tsx +7 -7
- package/hooks/notifs/useMcpConnectivityStatus.tsx +5 -5
- package/hooks/notifs/useModelMigrationNotifications.tsx +3 -3
- package/hooks/notifs/useNpmDeprecationNotification.tsx +4 -4
- package/hooks/notifs/usePluginAutoupdateNotification.tsx +5 -5
- package/hooks/notifs/usePluginInstallationStatus.tsx +6 -6
- package/hooks/notifs/useRateLimitWarningNotification.tsx +7 -7
- package/hooks/notifs/useSettingsErrors.tsx +5 -5
- package/hooks/notifs/useStartupNotification.ts +3 -3
- package/hooks/notifs/useTeammateShutdownNotification.ts +4 -4
- package/hooks/toolPermission/PermissionContext.ts +16 -16
- package/hooks/toolPermission/handlers/coordinatorHandler.ts +5 -5
- package/hooks/toolPermission/handlers/interactiveHandler.ts +16 -16
- package/hooks/toolPermission/handlers/swarmWorkerHandler.ts +10 -10
- package/hooks/toolPermission/permissionLogging.ts +8 -8
- package/hooks/unifiedSuggestions.ts +9 -9
- package/hooks/useAfterFirstRender.ts +1 -1
- package/hooks/useApiKeyVerification.ts +3 -3
- package/hooks/useArrowKeyHistory.tsx +8 -8
- package/hooks/useAssistantHistory.ts +6 -6
- package/hooks/useAwaySummary.ts +5 -5
- package/hooks/useBackgroundTaskNavigation.ts +7 -7
- package/hooks/useBlink.ts +1 -1
- package/hooks/useCanUseTool.tsx +21 -21
- package/hooks/useCancelRequest.ts +17 -17
- package/hooks/useChromeExtensionNotification.tsx +5 -5
- package/hooks/useClaudeCodeHintRecommendation.tsx +7 -7
- package/hooks/useClipboardImageHint.ts +3 -3
- package/hooks/useCommandKeybindings.tsx +4 -4
- package/hooks/useCommandQueue.ts +2 -2
- package/hooks/useCopyOnSelect.ts +4 -4
- package/hooks/useDeferredHookMessages.ts +1 -1
- package/hooks/useDiffData.ts +1 -1
- package/hooks/useDiffInIDE.ts +15 -15
- package/hooks/useDirectConnect.ts +12 -12
- package/hooks/useDynamicConfig.ts +1 -1
- package/hooks/useElapsedTime.ts +1 -1
- package/hooks/useExitOnCtrlCD.ts +3 -3
- package/hooks/useExitOnCtrlCDWithKeybindings.ts +2 -2
- package/hooks/useFileHistorySnapshotInit.ts +1 -1
- package/hooks/useGlobalKeybindings.tsx +8 -8
- package/hooks/useHistorySearch.ts +7 -7
- package/hooks/useIDEIntegration.tsx +5 -5
- package/hooks/useIdeAtMentioned.ts +4 -4
- package/hooks/useIdeConnectionStatus.ts +1 -1
- package/hooks/useIdeLogging.ts +4 -4
- package/hooks/useIdeSelection.ts +4 -4
- package/hooks/useInboxPoller.ts +27 -27
- package/hooks/useInputBuffer.ts +1 -1
- package/hooks/useIssueFlagBanner.ts +3 -3
- package/hooks/useLogMessages.ts +4 -4
- package/hooks/useLspPluginRecommendation.tsx +10 -10
- package/hooks/useMailboxBridge.ts +1 -1
- package/hooks/useMainLoopModel.ts +3 -3
- package/hooks/useManagePlugins.ts +19 -19
- package/hooks/useMergedClients.ts +1 -1
- package/hooks/useMergedCommands.ts +1 -1
- package/hooks/useMergedTools.ts +4 -4
- package/hooks/useNotifyAfterTimeout.ts +3 -3
- package/hooks/useOfficialMarketplaceNotification.tsx +5 -5
- package/hooks/usePasteHandler.ts +5 -5
- package/hooks/usePluginRecommendationBase.tsx +5 -5
- package/hooks/usePrStatus.ts +2 -2
- package/hooks/usePromptSuggestion.ts +4 -4
- package/hooks/usePromptsFromClaudeInChrome.tsx +7 -7
- package/hooks/useQueueProcessor.ts +4 -4
- package/hooks/useRemoteSession.ts +18 -18
- package/hooks/useReplBridge.tsx +24 -24
- package/hooks/useSSHSession.ts +12 -12
- package/hooks/useScheduledTasks.ts +12 -12
- package/hooks/useSearchInput.ts +4 -4
- package/hooks/useSessionBackgrounding.ts +2 -2
- package/hooks/useSettings.ts +1 -1
- package/hooks/useSettingsChange.ts +4 -4
- package/hooks/useSkillImprovementSurvey.ts +7 -7
- package/hooks/useSkillsChange.ts +5 -5
- package/hooks/useSwarmInitialization.ts +8 -8
- package/hooks/useSwarmPermissionPoller.ts +5 -5
- package/hooks/useTaskListWatcher.ts +2 -2
- package/hooks/useTasksV2.ts +5 -5
- package/hooks/useTeammateViewAutoExit.ts +3 -3
- package/hooks/useTeleportResume.tsx +6 -6
- package/hooks/useTerminalSize.ts +1 -1
- package/hooks/useTextInput.ts +12 -12
- package/hooks/useTurnDiffs.ts +3 -3
- package/hooks/useTypeahead.tsx +27 -27
- package/hooks/useVimInput.ts +8 -8
- package/hooks/useVirtualScroll.ts +2 -2
- package/hooks/useVoice.ts +11 -11
- package/hooks/useVoiceEnabled.ts +2 -2
- package/hooks/useVoiceIntegration.tsx +10 -10
- package/ink/Ansi.tsx +4 -4
- package/ink/clearTerminal.ts +1 -1
- package/ink/colorize.ts +1 -1
- package/ink/components/AlternateScreen.tsx +5 -5
- package/ink/components/App.tsx +24 -24
- package/ink/components/Box.tsx +6 -6
- package/ink/components/Button.tsx +6 -6
- package/ink/components/ClockContext.tsx +2 -2
- package/ink/components/CursorDeclarationContext.ts +1 -1
- package/ink/components/ErrorOverview.tsx +2 -2
- package/ink/components/Link.tsx +2 -2
- package/ink/components/NoSelect.tsx +1 -1
- package/ink/components/ScrollBox.tsx +6 -6
- package/ink/components/Spacer.tsx +1 -1
- package/ink/components/StdinContext.ts +2 -2
- package/ink/components/TerminalFocusContext.tsx +1 -1
- package/ink/components/Text.tsx +1 -1
- package/ink/dom.ts +10 -10
- package/ink/events/click-event.ts +1 -1
- package/ink/events/dispatcher.ts +3 -3
- package/ink/events/emitter.ts +1 -1
- package/ink/events/event-handlers.ts +5 -5
- package/ink/events/focus-event.ts +1 -1
- package/ink/events/input-event.ts +2 -2
- package/ink/events/keyboard-event.ts +2 -2
- package/ink/events/terminal-event.ts +1 -1
- package/ink/events/terminal-focus-event.ts +1 -1
- package/ink/focus.ts +2 -2
- package/ink/frame.ts +4 -4
- package/ink/get-max-width.ts +1 -1
- package/ink/hit-test.ts +4 -4
- package/ink/hooks/use-animation-frame.ts +3 -3
- package/ink/hooks/use-app.ts +1 -1
- package/ink/hooks/use-declared-cursor.ts +2 -2
- package/ink/hooks/use-input.ts +2 -2
- package/ink/hooks/use-interval.ts +1 -1
- package/ink/hooks/use-search-highlight.ts +4 -4
- package/ink/hooks/use-selection.ts +3 -3
- package/ink/hooks/use-stdin.ts +1 -1
- package/ink/hooks/use-tab-status.ts +3 -3
- package/ink/hooks/use-terminal-focus.ts +1 -1
- package/ink/hooks/use-terminal-title.ts +2 -2
- package/ink/hooks/use-terminal-viewport.ts +2 -2
- package/ink/ink.tsx +32 -32
- package/ink/instances.ts +1 -1
- package/ink/layout/engine.ts +2 -2
- package/ink/layout/yoga.ts +2 -2
- package/ink/line-width-cache.ts +1 -1
- package/ink/log-update.ts +6 -6
- package/ink/measure-element.ts +1 -1
- package/ink/measure-text.ts +1 -1
- package/ink/node-cache.ts +2 -2
- package/ink/optimizer.ts +1 -1
- package/ink/output.ts +8 -8
- package/ink/parse-keypress.ts +2 -2
- package/ink/reconciler.ts +8 -8
- package/ink/render-border.ts +5 -5
- package/ink/render-node-to-output.ts +14 -14
- package/ink/render-to-screen.ts +8 -8
- package/ink/renderer.ts +7 -7
- package/ink/root.ts +4 -4
- package/ink/screen.ts +3 -3
- package/ink/searchHighlight.ts +1 -1
- package/ink/selection.ts +3 -3
- package/ink/squash-text-nodes.ts +2 -2
- package/ink/stringWidth.ts +1 -1
- package/ink/styles.ts +2 -2
- package/ink/tabstops.ts +2 -2
- package/ink/terminal-querier.ts +3 -3
- package/ink/terminal.ts +7 -7
- package/ink/termio/csi.ts +1 -1
- package/ink/termio/dec.ts +1 -1
- package/ink/termio/esc.ts +1 -1
- package/ink/termio/osc.ts +4 -4
- package/ink/termio/parser.ts +10 -10
- package/ink/termio/sgr.ts +2 -2
- package/ink/termio/tokenize.ts +2 -2
- package/ink/termio.ts +4 -4
- package/ink/useTerminalNotification.ts +3 -3
- package/ink/warn.ts +1 -1
- package/ink/widest-line.ts +1 -1
- package/ink/wrap-text.ts +4 -4
- package/ink.ts +47 -47
- package/interactiveHelpers.tsx +28 -28
- package/main.tsx +155 -155
- package/memdir/findRelevantMemories.ts +141 -0
- package/memdir/memdir.ts +507 -0
- package/memdir/memoryAge.ts +53 -0
- package/memdir/memoryScan.ts +94 -0
- package/memdir/memoryTypes.ts +271 -0
- package/memdir/paths.ts +278 -0
- package/memdir/teamMemPaths.ts +292 -0
- package/memdir/teamMemPrompts.ts +100 -0
- package/migrations/migrateAutoUpdatesToSettings.ts +61 -0
- package/migrations/migrateBypassPermissionsAcceptedToSettings.ts +40 -0
- package/migrations/migrateEnableAllProjectMcpServersToSettings.ts +118 -0
- package/migrations/migrateFennecToOpus.ts +45 -0
- package/migrations/migrateLegacyOpusToCurrent.ts +57 -0
- package/migrations/migrateOpusToOpus1m.ts +43 -0
- package/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.ts +22 -0
- package/migrations/migrateSonnet1mToSonnet45.ts +48 -0
- package/migrations/migrateSonnet45ToSonnet46.ts +67 -0
- package/migrations/resetAutoModeOptInForDefaultOffer.ts +51 -0
- package/migrations/resetProToOpusDefault.ts +51 -0
- package/native-ts/color-diff/index.ts +999 -0
- package/native-ts/file-index/index.ts +370 -0
- package/native-ts/yoga-layout/enums.ts +134 -0
- package/native-ts/yoga-layout/index.ts +2578 -0
- package/outputStyles/loadOutputStylesDir.ts +98 -0
- package/package.json +21 -5
- package/plugins/builtinPlugins.ts +159 -0
- package/plugins/bundled/index.ts +23 -0
- package/projectOnboardingState.ts +4 -4
- package/query/config.ts +4 -4
- package/query/deps.ts +3 -3
- package/query/stopHooks.ts +20 -20
- package/query/tokenBudget.ts +1 -1
- package/query.ts +41 -41
- package/replLauncher.tsx +5 -5
- package/schemas/hooks.ts +222 -0
- package/screens/Doctor.tsx +575 -0
- package/screens/REPL.tsx +5006 -0
- package/screens/ResumeConversation.tsx +399 -0
- package/server/createDirectConnectSession.ts +88 -0
- package/server/directConnectManager.ts +213 -0
- package/server/types.ts +57 -0
- package/services/AgentSummary/agentSummary.ts +9 -9
- package/services/MagicDocs/magicDocs.ts +11 -11
- package/services/MagicDocs/prompts.ts +2 -2
- package/services/PromptSuggestion/promptSuggestion.ts +17 -17
- package/services/PromptSuggestion/speculation.ts +25 -25
- package/services/SessionMemory/prompts.ts +4 -4
- package/services/SessionMemory/sessionMemory.ts +23 -23
- package/services/SessionMemory/sessionMemoryUtils.ts +5 -5
- package/services/analytics/config.ts +2 -2
- package/services/analytics/datadog.ts +7 -7
- package/services/analytics/firstPartyEventLogger.ts +13 -13
- package/services/analytics/firstPartyEventLoggingExporter.ts +18 -18
- package/services/analytics/growthbook.ts +11 -11
- package/services/analytics/metadata.ts +16 -16
- package/services/analytics/sink.ts +5 -5
- package/services/analytics/sinkKillswitch.ts +1 -1
- package/services/api/adminRequests.ts +2 -2
- package/services/api/bootstrap.ts +10 -10
- package/services/api/claude.ts +70 -70
- package/services/api/client.ts +9 -9
- package/services/api/dumpPrompts.ts +3 -3
- package/services/api/emptyUsage.ts +1 -1
- package/services/api/errors.ts +18 -18
- package/services/api/filesApi.ts +7 -7
- package/services/api/firstTokenDate.ts +5 -5
- package/services/api/grove.ts +11 -11
- package/services/api/logging.ts +19 -19
- package/services/api/metricsOptOut.ts +9 -9
- package/services/api/overageCreditGrant.ts +6 -6
- package/services/api/promptCacheBreakDetection.ts +9 -9
- package/services/api/referral.ts +8 -8
- package/services/api/sessionIngress.ts +11 -11
- package/services/api/ultrareviewQuota.ts +4 -4
- package/services/api/usage.ts +5 -5
- package/services/api/withRetry.ts +20 -20
- package/services/autoDream/autoDream.ts +18 -18
- package/services/autoDream/config.ts +2 -2
- package/services/autoDream/consolidationLock.ts +6 -6
- package/services/autoDream/consolidationPrompt.ts +1 -1
- package/services/awaySummary.ts +8 -8
- package/services/claudeAiLimits.ts +13 -13
- package/services/claudeAiLimitsHook.ts +1 -1
- package/services/compact/apiMicrocompact.ts +10 -10
- package/services/compact/autoCompact.ts +20 -20
- package/services/compact/compact.ts +44 -44
- package/services/compact/compactWarningHook.ts +1 -1
- package/services/compact/compactWarningState.ts +1 -1
- package/services/compact/grouping.ts +1 -1
- package/services/compact/microCompact.ts +19 -19
- package/services/compact/postCompactCleanup.ts +9 -9
- package/services/compact/prompt.ts +1 -1
- package/services/compact/sessionMemoryCompact.ts +19 -19
- package/services/compact/timeBasedMCConfig.ts +1 -1
- package/services/diagnosticTracking.ts +7 -7
- package/services/extractMemories/extractMemories.ts +24 -24
- package/services/extractMemories/prompts.ts +7 -7
- package/services/internalLogging.ts +3 -3
- package/services/lsp/LSPClient.ts +5 -5
- package/services/lsp/LSPDiagnosticRegistry.ts +5 -5
- package/services/lsp/LSPServerInstance.ts +7 -7
- package/services/lsp/LSPServerManager.ts +6 -6
- package/services/lsp/config.ts +7 -7
- package/services/lsp/manager.ts +6 -6
- package/services/lsp/passiveFeedback.ts +7 -7
- package/services/mcp/InProcessTransport.ts +2 -2
- package/services/mcp/MCPConnectionManager.tsx +4 -4
- package/services/mcp/SdkControlTransport.ts +2 -2
- package/services/mcp/auth.ts +23 -23
- package/services/mcp/channelAllowlist.ts +3 -3
- package/services/mcp/channelNotification.ts +9 -9
- package/services/mcp/channelPermissions.ts +2 -2
- package/services/mcp/claudeai.ts +9 -9
- package/services/mcp/client.ts +57 -57
- package/services/mcp/config.ts +25 -25
- package/services/mcp/elicitationHandler.ts +7 -7
- package/services/mcp/headersHelper.ts +9 -9
- package/services/mcp/mcpStringUtils.ts +1 -1
- package/services/mcp/oauthPort.ts +1 -1
- package/services/mcp/officialRegistry.ts +2 -2
- package/services/mcp/types.ts +3 -3
- package/services/mcp/useManageMCPConnections.ts +23 -23
- package/services/mcp/utils.ts +14 -14
- package/services/mcp/vscodeSdkMcp.ts +5 -5
- package/services/mcp/xaa.ts +5 -5
- package/services/mcp/xaaIdpLogin.ts +11 -11
- package/services/mcpServerApproval.tsx +7 -7
- package/services/mockRateLimits.ts +3 -3
- package/services/notifier.ts +7 -7
- package/services/oauth/auth-code-listener.ts +4 -4
- package/services/oauth/client.ts +8 -8
- package/services/oauth/getOauthProfile.ts +5 -5
- package/services/oauth/index.ts +6 -6
- package/services/plugins/PluginInstallationManager.ts +9 -9
- package/services/plugins/pluginCliCommands.ts +10 -10
- package/services/plugins/pluginOperations.ts +21 -21
- package/services/policyLimits/index.ts +14 -14
- package/services/policyLimits/types.ts +1 -1
- package/services/preventSleep.ts +2 -2
- package/services/rateLimitMessages.ts +4 -4
- package/services/rateLimitMocking.ts +1 -1
- package/services/remoteManagedSettings/index.ts +14 -14
- package/services/remoteManagedSettings/securityCheck.tsx +10 -10
- package/services/remoteManagedSettings/syncCache.ts +4 -4
- package/services/remoteManagedSettings/syncCacheState.ts +6 -6
- package/services/remoteManagedSettings/types.ts +2 -2
- package/services/settingsSync/index.ts +18 -18
- package/services/settingsSync/types.ts +1 -1
- package/services/teamMemorySync/index.ts +16 -16
- package/services/teamMemorySync/secretScanner.ts +1 -1
- package/services/teamMemorySync/types.ts +1 -1
- package/services/teamMemorySync/watcher.ts +8 -8
- package/services/tips/tipHistory.ts +1 -1
- package/services/tips/tipRegistry.ts +28 -28
- package/services/tips/tipScheduler.ts +5 -5
- package/services/tokenEstimation.ts +14 -14
- package/services/toolUseSummary/toolUseSummaryGenerator.ts +6 -6
- package/services/tools/StreamingToolExecutor.ts +7 -7
- package/services/tools/toolExecution.ts +41 -41
- package/services/tools/toolHooks.ts +16 -16
- package/services/tools/toolOrchestration.ts +5 -5
- package/services/vcr.ts +9 -9
- package/services/voice.ts +4 -4
- package/services/voiceKeyterms.ts +2 -2
- package/services/voiceStreamSTT.ts +9 -9
- package/setup.ts +32 -32
- package/skills/bundled/batch.ts +124 -0
- package/skills/bundled/claudeApi.ts +196 -0
- package/skills/bundled/claudeApiContent.ts +48 -0
- package/skills/bundled/claudeInChrome.ts +34 -0
- package/skills/bundled/debug.ts +103 -0
- package/skills/bundled/index.ts +79 -0
- package/skills/bundled/keybindings.ts +339 -0
- package/skills/bundled/loop.ts +92 -0
- package/skills/bundled/loremIpsum.ts +282 -0
- package/skills/bundled/remember.ts +82 -0
- package/skills/bundled/scheduleRemoteAgents.ts +447 -0
- package/skills/bundled/simplify.ts +69 -0
- package/skills/bundled/skillify.ts +197 -0
- package/skills/bundled/stuck.ts +79 -0
- package/skills/bundled/updateConfig.ts +475 -0
- package/skills/bundled/verify/SKILL.md +3 -0
- package/skills/bundled/verify/examples/cli.md +3 -0
- package/skills/bundled/verify/examples/server.md +3 -0
- package/skills/bundled/verify.ts +30 -0
- package/skills/bundled/verifyContent.ts +9 -0
- package/skills/bundledSkills.ts +220 -0
- package/skills/loadSkillsDir.ts +1086 -0
- package/skills/mcpSkillBuilders.ts +44 -0
- package/state/AppState.tsx +9 -9
- package/state/AppStateStore.ts +29 -29
- package/state/onChangeAppState.ts +10 -10
- package/state/selectors.ts +4 -4
- package/state/teammateViewHelpers.ts +4 -4
- package/tasks/DreamTask/DreamTask.ts +157 -0
- package/tasks/InProcessTeammateTask/InProcessTeammateTask.tsx +126 -0
- package/tasks/InProcessTeammateTask/types.ts +121 -0
- package/tasks/LocalAgentTask/LocalAgentTask.tsx +683 -0
- package/tasks/LocalMainSessionTask.ts +479 -0
- package/tasks/LocalShellTask/LocalShellTask.tsx +523 -0
- package/tasks/LocalShellTask/guards.ts +41 -0
- package/tasks/LocalShellTask/killShellTasks.ts +76 -0
- package/tasks/RemoteAgentTask/RemoteAgentTask.tsx +856 -0
- package/tasks/pillLabel.ts +82 -0
- package/tasks/stopTask.ts +100 -0
- package/tasks/types.ts +46 -0
- package/tasks.ts +5 -5
- package/tools/AgentTool/AgentTool.tsx +54 -54
- package/tools/AgentTool/UI.tsx +28 -28
- package/tools/AgentTool/agentColorManager.ts +2 -2
- package/tools/AgentTool/agentDisplay.ts +3 -3
- package/tools/AgentTool/agentMemory.ts +6 -6
- package/tools/AgentTool/agentMemorySnapshot.ts +5 -5
- package/tools/AgentTool/agentToolUtils.ts +27 -27
- package/tools/AgentTool/built-in/claudeCodeGuideAgent.ts +12 -12
- package/tools/AgentTool/built-in/exploreAgent.ts +11 -11
- package/tools/AgentTool/built-in/generalPurposeAgent.ts +1 -1
- package/tools/AgentTool/built-in/planAgent.ts +12 -12
- package/tools/AgentTool/built-in/statuslineSetup.ts +1 -1
- package/tools/AgentTool/built-in/verificationAgent.ts +8 -8
- package/tools/AgentTool/builtInAgents.ts +10 -10
- package/tools/AgentTool/forkSubagent.ts +7 -7
- package/tools/AgentTool/loadAgentsDir.ts +23 -23
- package/tools/AgentTool/prompt.ts +13 -13
- package/tools/AgentTool/resumeAgent.ts +26 -26
- package/tools/AgentTool/runAgent.ts +38 -38
- package/tools/AskUserQuestionTool/AskUserQuestionTool.tsx +9 -9
- package/tools/AskUserQuestionTool/prompt.ts +1 -1
- package/tools/BashTool/BashTool.tsx +48 -48
- package/tools/BashTool/BashToolResultMessage.tsx +7 -7
- package/tools/BashTool/UI.tsx +20 -20
- package/tools/BashTool/bashCommandHelpers.ts +8 -8
- package/tools/BashTool/bashPermissions.ts +33 -33
- package/tools/BashTool/bashSecurity.ts +6 -6
- package/tools/BashTool/commandSemantics.ts +1 -1
- package/tools/BashTool/modeValidation.ts +4 -4
- package/tools/BashTool/pathValidation.ts +13 -13
- package/tools/BashTool/prompt.ts +18 -18
- package/tools/BashTool/readOnlyValidation.ts +14 -14
- package/tools/BashTool/sedEditParser.ts +1 -1
- package/tools/BashTool/sedValidation.ts +4 -4
- package/tools/BashTool/shouldUseSandbox.ts +5 -5
- package/tools/BashTool/utils.ts +10 -10
- package/tools/BriefTool/BriefTool.ts +11 -11
- package/tools/BriefTool/UI.tsx +8 -8
- package/tools/BriefTool/attachments.ts +6 -6
- package/tools/BriefTool/upload.ts +5 -5
- package/tools/ConfigTool/ConfigTool.ts +12 -12
- package/tools/ConfigTool/UI.tsx +4 -4
- package/tools/ConfigTool/prompt.ts +3 -3
- package/tools/ConfigTool/supportedSettings.ts +5 -5
- package/tools/EnterPlanModeTool/EnterPlanModeTool.ts +10 -10
- package/tools/EnterPlanModeTool/UI.tsx +7 -7
- package/tools/EnterPlanModeTool/prompt.ts +2 -2
- package/tools/EnterWorktreeTool/EnterWorktreeTool.ts +16 -16
- package/tools/EnterWorktreeTool/UI.tsx +5 -5
- package/tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts +19 -19
- package/tools/ExitPlanModeTool/UI.tsx +12 -12
- package/tools/ExitWorktreeTool/ExitWorktreeTool.ts +17 -17
- package/tools/ExitWorktreeTool/UI.tsx +5 -5
- package/tools/FileEditTool/FileEditTool.ts +34 -34
- package/tools/FileEditTool/UI.tsx +18 -18
- package/tools/FileEditTool/prompt.ts +2 -2
- package/tools/FileEditTool/types.ts +2 -2
- package/tools/FileEditTool/utils.ts +7 -7
- package/tools/FileReadTool/FileReadTool.ts +37 -37
- package/tools/FileReadTool/UI.tsx +10 -10
- package/tools/FileReadTool/imageProcessor.ts +1 -1
- package/tools/FileReadTool/limits.ts +2 -2
- package/tools/FileReadTool/prompt.ts +2 -2
- package/tools/FileWriteTool/FileWriteTool.ts +31 -31
- package/tools/FileWriteTool/UI.tsx +19 -19
- package/tools/FileWriteTool/prompt.ts +1 -1
- package/tools/GlobTool/GlobTool.ts +14 -14
- package/tools/GlobTool/UI.tsx +8 -8
- package/tools/GlobTool/prompt.ts +1 -1
- package/tools/GrepTool/GrepTool.ts +19 -19
- package/tools/GrepTool/UI.tsx +10 -10
- package/tools/GrepTool/prompt.ts +3 -3
- package/tools/LSPTool/LSPTool.ts +18 -18
- package/tools/LSPTool/UI.tsx +8 -8
- package/tools/LSPTool/formatters.ts +3 -3
- package/tools/LSPTool/schemas.ts +1 -1
- package/tools/LSPTool/symbolContext.ts +4 -4
- package/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts +9 -9
- package/tools/ListMcpResourcesTool/UI.tsx +7 -7
- package/tools/MCPTool/MCPTool.ts +7 -7
- package/tools/MCPTool/UI.tsx +13 -13
- package/tools/McpAuthTool/McpAuthTool.ts +9 -9
- package/tools/NotebookEditTool/NotebookEditTool.ts +16 -16
- package/tools/NotebookEditTool/UI.tsx +12 -12
- package/tools/PowerShellTool/PowerShellTool.tsx +42 -42
- package/tools/PowerShellTool/UI.tsx +12 -12
- package/tools/PowerShellTool/gitSafety.ts +2 -2
- package/tools/PowerShellTool/modeValidation.ts +5 -5
- package/tools/PowerShellTool/pathValidation.ts +15 -15
- package/tools/PowerShellTool/powershellPermissions.ts +16 -16
- package/tools/PowerShellTool/powershellSecurity.ts +4 -4
- package/tools/PowerShellTool/prompt.ts +10 -10
- package/tools/PowerShellTool/readOnlyValidation.ts +6 -6
- package/tools/REPLTool/constants.ts +9 -9
- package/tools/REPLTool/primitiveTools.ts +9 -9
- package/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts +9 -9
- package/tools/ReadMcpResourceTool/UI.tsx +7 -7
- package/tools/RemoteTriggerTool/RemoteTriggerTool.ts +11 -11
- package/tools/RemoteTriggerTool/UI.tsx +4 -4
- package/tools/ScheduleCronTool/CronCreateTool.ts +10 -10
- package/tools/ScheduleCronTool/CronDeleteTool.ts +7 -7
- package/tools/ScheduleCronTool/CronListTool.ts +8 -8
- package/tools/ScheduleCronTool/UI.tsx +6 -6
- package/tools/ScheduleCronTool/prompt.ts +3 -3
- package/tools/SendMessageTool/SendMessageTool.ts +27 -27
- package/tools/SendMessageTool/UI.tsx +4 -4
- package/tools/SkillTool/SkillTool.ts +32 -32
- package/tools/SkillTool/UI.tsx +13 -13
- package/tools/SkillTool/prompt.ts +10 -10
- package/tools/SleepTool/prompt.ts +1 -1
- package/tools/SyntheticOutputTool/SyntheticOutputTool.ts +6 -6
- package/tools/TaskCreateTool/TaskCreateTool.ts +7 -7
- package/tools/TaskCreateTool/prompt.ts +1 -1
- package/tools/TaskGetTool/TaskGetTool.ts +5 -5
- package/tools/TaskListTool/TaskListTool.ts +5 -5
- package/tools/TaskListTool/prompt.ts +1 -1
- package/tools/TaskOutputTool/TaskOutputTool.tsx +27 -27
- package/tools/TaskStopTool/TaskStopTool.ts +7 -7
- package/tools/TaskStopTool/UI.tsx +5 -5
- package/tools/TaskUpdateTool/TaskUpdateTool.ts +11 -11
- package/tools/TeamCreateTool/TeamCreateTool.ts +21 -21
- package/tools/TeamCreateTool/UI.tsx +1 -1
- package/tools/TeamDeleteTool/TeamDeleteTool.ts +14 -14
- package/tools/TeamDeleteTool/UI.tsx +2 -2
- package/tools/TodoWriteTool/TodoWriteTool.ts +9 -9
- package/tools/TodoWriteTool/prompt.ts +1 -1
- package/tools/ToolSearchTool/ToolSearchTool.ts +7 -7
- package/tools/ToolSearchTool/prompt.ts +6 -6
- package/tools/WebFetchTool/UI.tsx +7 -7
- package/tools/WebFetchTool/WebFetchTool.ts +10 -10
- package/tools/WebFetchTool/utils.ts +10 -10
- package/tools/WebSearchTool/UI.tsx +6 -6
- package/tools/WebSearchTool/WebSearchTool.ts +15 -15
- package/tools/WebSearchTool/prompt.ts +1 -1
- package/tools/shared/gitOperationTracking.ts +2 -2
- package/tools/shared/spawnMultiAgent.ts +32 -32
- package/tools/testing/TestingPermissionTool.tsx +3 -3
- package/tools/utils.ts +1 -1
- package/tools.ts +43 -43
- package/types/command.ts +12 -12
- package/types/generated/events_mono/claude_code/v1/claude_code_internal_event.ts +2 -2
- package/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.ts +2 -2
- package/types/hooks.ts +9 -9
- package/types/logs.ts +5 -5
- package/types/plugin.ts +5 -5
- package/types/textInputTypes.ts +7 -7
- package/upstreamproxy/relay.ts +455 -0
- package/upstreamproxy/upstreamproxy.ts +285 -0
- package/utils/Cursor.ts +3 -3
- package/utils/QueryGuard.ts +1 -1
- package/utils/Shell.ts +24 -24
- package/utils/ShellCommand.ts +4 -4
- package/utils/activityManager.ts +1 -1
- package/utils/advisor.ts +4 -4
- package/utils/agentContext.ts +2 -2
- package/utils/agentSwarmsEnabled.ts +2 -2
- package/utils/agenticSessionSearch.ts +8 -8
- package/utils/analyzeContext.ts +29 -29
- package/utils/ansiToPng.ts +2 -2
- package/utils/ansiToSvg.ts +1 -1
- package/utils/api.ts +37 -37
- package/utils/apiPreconnect.ts +2 -2
- package/utils/appleTerminalBackup.ts +3 -3
- package/utils/argumentSubstitution.ts +1 -1
- package/utils/asciicast.ts +8 -8
- package/utils/attachments.ts +94 -94
- package/utils/attribution.ts +20 -20
- package/utils/auth.ts +29 -29
- package/utils/authFileDescriptor.ts +5 -5
- package/utils/authPortable.ts +1 -1
- package/utils/autoRunIssue.tsx +3 -3
- package/utils/autoUpdater.ts +15 -15
- package/utils/aws.ts +1 -1
- package/utils/awsAuthStatusManager.ts +1 -1
- package/utils/background/remote/preconditions.ts +11 -11
- package/utils/background/remote/remoteSession.ts +7 -7
- package/utils/backgroundHousekeeping.ts +7 -7
- package/utils/bash/ParsedCommand.ts +3 -3
- package/utils/bash/ShellSnapshot.ts +13 -13
- package/utils/bash/ast.ts +3 -3
- package/utils/bash/bashPipeCommand.ts +1 -1
- package/utils/bash/commands.ts +3 -3
- package/utils/bash/parser.ts +3 -3
- package/utils/bash/prefix.ts +4 -4
- package/utils/bash/registry.ts +2 -2
- package/utils/bash/shellCompletion.ts +5 -5
- package/utils/bash/shellPrefix.ts +1 -1
- package/utils/bash/shellQuote.ts +2 -2
- package/utils/bash/shellQuoting.ts +1 -1
- package/utils/bash/specs/alias.ts +1 -1
- package/utils/bash/specs/index.ts +8 -8
- package/utils/bash/specs/nohup.ts +1 -1
- package/utils/bash/specs/pyright.ts +1 -1
- package/utils/bash/specs/sleep.ts +1 -1
- package/utils/bash/specs/srun.ts +1 -1
- package/utils/bash/specs/time.ts +1 -1
- package/utils/bash/specs/timeout.ts +1 -1
- package/utils/betas.ts +11 -11
- package/utils/billing.ts +3 -3
- package/utils/binaryCheck.ts +2 -2
- package/utils/browser.ts +1 -1
- package/utils/caCerts.ts +3 -3
- package/utils/caCertsConfig.ts +3 -3
- package/utils/cachePaths.ts +2 -2
- package/utils/classifierApprovals.ts +1 -1
- package/utils/classifierApprovalsHook.ts +1 -1
- package/utils/claudeCodeHints.ts +2 -2
- package/utils/claudeDesktop.ts +5 -5
- package/utils/claudeInChrome/chromeNativeHost.ts +3 -3
- package/utils/claudeInChrome/common.ts +8 -8
- package/utils/claudeInChrome/mcpServer.ts +12 -12
- package/utils/claudeInChrome/setup.ts +13 -13
- package/utils/claudeInChrome/setupPortable.ts +1 -1
- package/utils/claudeInChrome/toolRendering.tsx +8 -8
- package/utils/claudemd.ts +21 -21
- package/utils/cleanup.ts +15 -15
- package/utils/collapseBackgroundBashNotifications.ts +5 -5
- package/utils/collapseHookSummaries.ts +1 -1
- package/utils/collapseReadSearch.ts +13 -13
- package/utils/collapseTeammateShutdowns.ts +1 -1
- package/utils/combinedAbortSignal.ts +1 -1
- package/utils/commitAttribution.ts +12 -12
- package/utils/completionCache.ts +7 -7
- package/utils/computerUse/cleanup.ts +6 -6
- package/utils/computerUse/common.ts +2 -2
- package/utils/computerUse/computerUseLock.ts +6 -6
- package/utils/computerUse/drainRunLoop.ts +3 -3
- package/utils/computerUse/escHotkey.ts +3 -3
- package/utils/computerUse/executor.ts +9 -9
- package/utils/computerUse/gates.ts +3 -3
- package/utils/computerUse/hostAdapter.ts +5 -5
- package/utils/computerUse/mcpServer.ts +10 -10
- package/utils/computerUse/setup.ts +5 -5
- package/utils/computerUse/toolRendering.tsx +4 -4
- package/utils/computerUse/wrapper.tsx +9 -9
- package/utils/concurrentSessions.ts +9 -9
- package/utils/config.ts +29 -29
- package/utils/context.ts +5 -5
- package/utils/contextAnalysis.ts +4 -4
- package/utils/contextSuggestions.ts +7 -7
- package/utils/conversationRecovery.ts +14 -14
- package/utils/cronJitterConfig.ts +3 -3
- package/utils/cronScheduler.ts +6 -6
- package/utils/cronTasks.ts +8 -8
- package/utils/cronTasksLock.ts +8 -8
- package/utils/crossProjectResume.ts +4 -4
- package/utils/cwd.ts +1 -1
- package/utils/debug.ts +8 -8
- package/utils/deepLink/banner.ts +3 -3
- package/utils/deepLink/parseDeepLink.ts +1 -1
- package/utils/deepLink/protocolHandler.ts +7 -7
- package/utils/deepLink/registerProtocol.ts +10 -10
- package/utils/deepLink/terminalLauncher.ts +4 -4
- package/utils/deepLink/terminalPreference.ts +2 -2
- package/utils/desktopDeepLink.ts +6 -6
- package/utils/detectRepository.ts +3 -3
- package/utils/diagLogs.ts +2 -2
- package/utils/diff.ts +6 -6
- package/utils/directMemberMessage.ts +1 -1
- package/utils/doctorContextWarnings.ts +11 -11
- package/utils/doctorDiagnostic.ts +17 -17
- package/utils/dxt/helpers.ts +2 -2
- package/utils/dxt/zip.ts +4 -4
- package/utils/earlyInput.ts +1 -1
- package/utils/editor.ts +3 -3
- package/utils/effort.ts +8 -8
- package/utils/embeddedTools.ts +1 -1
- package/utils/env.ts +6 -6
- package/utils/envDynamic.ts +4 -4
- package/utils/envValidation.ts +1 -1
- package/utils/errorLogSink.ts +8 -8
- package/utils/exampleCommands.ts +7 -7
- package/utils/execFileNoThrow.ts +3 -3
- package/utils/execFileNoThrowPortable.ts +2 -2
- package/utils/execSyncWrapper.ts +2 -2
- package/utils/exportRenderer.tsx +8 -8
- package/utils/extraUsage.ts +2 -2
- package/utils/fastMode.ts +14 -14
- package/utils/file.ts +11 -11
- package/utils/fileHistory.ts +11 -11
- package/utils/fileOperationAnalytics.ts +2 -2
- package/utils/filePersistence/filePersistence.ts +7 -7
- package/utils/filePersistence/outputsScanner.ts +2 -2
- package/utils/filePersistence/types.ts +1 -1
- package/utils/fileRead.ts +2 -2
- package/utils/fileReadCache.ts +2 -2
- package/utils/findExecutable.ts +1 -1
- package/utils/fingerprint.ts +1 -1
- package/utils/forkedAgent.ts +22 -22
- package/utils/format.ts +2 -2
- package/utils/frontmatterParser.ts +3 -3
- package/utils/fsOperations.ts +2 -2
- package/utils/fullscreen.ts +4 -4
- package/utils/genericProcessUtils.ts +1 -1
- package/utils/getWorktreePaths.ts +3 -3
- package/utils/ghPrStatus.ts +3 -3
- package/utils/git/gitFilesystem.ts +5 -5
- package/utils/git/gitignore.ts +5 -5
- package/utils/git.ts +10 -10
- package/utils/gitDiff.ts +5 -5
- package/utils/gitSettings.ts +2 -2
- package/utils/github/ghAuthStatus.ts +1 -1
- package/utils/githubRepoPathMapping.ts +7 -7
- package/utils/glob.ts +6 -6
- package/utils/gracefulShutdown.ts +17 -17
- package/utils/groupToolUses.ts +2 -2
- package/utils/handlePromptSubmit.ts +28 -28
- package/utils/headlessProfiler.ts +6 -6
- package/utils/heapDumpService.ts +8 -8
- package/utils/heatmap.ts +2 -2
- package/utils/highlightMatch.tsx +1 -1
- package/utils/hooks/AsyncHookRegistry.ts +6 -6
- package/utils/hooks/apiQueryHookHelper.ts +9 -9
- package/utils/hooks/execAgentHook.ts +25 -25
- package/utils/hooks/execHttpHook.ts +8 -8
- package/utils/hooks/execPromptHook.ts +15 -15
- package/utils/hooks/fileChangedWatcher.ts +6 -6
- package/utils/hooks/hookEvents.ts +2 -2
- package/utils/hooks/hookHelpers.ts +7 -7
- package/utils/hooks/hooksConfigManager.ts +4 -4
- package/utils/hooks/hooksConfigSnapshot.ts +5 -5
- package/utils/hooks/hooksSettings.ts +9 -9
- package/utils/hooks/postSamplingHooks.ts +6 -6
- package/utils/hooks/registerFrontmatterHooks.ts +5 -5
- package/utils/hooks/registerSkillHooks.ts +5 -5
- package/utils/hooks/sessionHooks.ts +7 -7
- package/utils/hooks/skillImprovement.ts +17 -17
- package/utils/hooks.ts +56 -56
- package/utils/http.ts +4 -4
- package/utils/hyperlink.ts +1 -1
- package/utils/iTermBackup.ts +2 -2
- package/utils/ide.ts +22 -22
- package/utils/idleTimeout.ts +2 -2
- package/utils/imagePaste.ts +8 -8
- package/utils/imageResizer.ts +7 -7
- package/utils/imageStore.ts +5 -5
- package/utils/imageValidation.ts +3 -3
- package/utils/immediateCommand.ts +1 -1
- package/utils/inProcessTeammateHelpers.ts +4 -4
- package/utils/ink.ts +2 -2
- package/utils/jetbrains.ts +2 -2
- package/utils/json.ts +5 -5
- package/utils/listSessionsImpl.ts +3 -3
- package/utils/localInstaller.ts +7 -7
- package/utils/log.ts +10 -10
- package/utils/logoV2Utils.ts +11 -11
- package/utils/mailbox.ts +1 -1
- package/utils/managedEnv.ts +9 -9
- package/utils/markdown.ts +9 -9
- package/utils/markdownConfigLoader.ts +14 -14
- package/utils/mcp/dateTimeParser.ts +4 -4
- package/utils/mcp/elicitationValidation.ts +4 -4
- package/utils/mcpInstructionsDelta.ts +5 -5
- package/utils/mcpOutputStorage.ts +6 -6
- package/utils/mcpValidation.ts +4 -4
- package/utils/mcpWebSocketTransport.ts +5 -5
- package/utils/memoize.ts +2 -2
- package/utils/memory/versions.ts +1 -1
- package/utils/memoryFileDetection.ts +4 -4
- package/utils/messagePredicates.ts +1 -1
- package/utils/messageQueueManager.ts +10 -10
- package/utils/messages/mappers.ts +9 -9
- package/utils/messages/systemInit.ts +8 -8
- package/utils/messages.ts +59 -59
- package/utils/model/agent.ts +6 -6
- package/utils/model/antModels.ts +2 -2
- package/utils/model/bedrock.ts +4 -4
- package/utils/model/check1mAccess.ts +4 -4
- package/utils/model/configs.ts +2 -2
- package/utils/model/contextWindowUpgradeCheck.ts +2 -2
- package/utils/model/deprecation.ts +1 -1
- package/utils/model/model.ts +13 -13
- package/utils/model/modelAllowlist.ts +4 -4
- package/utils/model/modelCapabilities.ts +10 -10
- package/utils/model/modelOptions.ts +11 -11
- package/utils/model/modelStrings.ts +7 -7
- package/utils/model/modelSupportOverrides.ts +1 -1
- package/utils/model/providers.ts +2 -2
- package/utils/model/validateModel.ts +5 -5
- package/utils/modelCost.ts +6 -6
- package/utils/mtls.ts +3 -3
- package/utils/nativeInstaller/download.ts +10 -10
- package/utils/nativeInstaller/index.ts +1 -1
- package/utils/nativeInstaller/installer.ts +20 -20
- package/utils/nativeInstaller/packageManagers.ts +3 -3
- package/utils/nativeInstaller/pidLock.ts +8 -8
- package/utils/notebook.ts +6 -6
- package/utils/pasteStore.ts +3 -3
- package/utils/path.ts +5 -5
- package/utils/pdf.ts +6 -6
- package/utils/pdfUtils.ts +1 -1
- package/utils/permissions/PermissionMode.ts +3 -3
- package/utils/permissions/PermissionPromptToolResultSchema.ts +6 -6
- package/utils/permissions/PermissionResult.ts +1 -1
- package/utils/permissions/PermissionRule.ts +2 -2
- package/utils/permissions/PermissionUpdate.ts +11 -11
- package/utils/permissions/PermissionUpdateSchema.ts +4 -4
- package/utils/permissions/bypassPermissionsKillswitch.ts +4 -4
- package/utils/permissions/classifierDecision.ts +21 -21
- package/utils/permissions/classifierShared.ts +1 -1
- package/utils/permissions/filesystem.ts +24 -24
- package/utils/permissions/getNextPermissionMode.ts +4 -4
- package/utils/permissions/pathValidation.ts +8 -8
- package/utils/permissions/permissionExplainer.ts +11 -11
- package/utils/permissions/permissionRuleParser.ts +4 -4
- package/utils/permissions/permissionSetup.ts +27 -27
- package/utils/permissions/permissions.ts +35 -35
- package/utils/permissions/permissionsLoader.ts +9 -9
- package/utils/permissions/shadowedRuleDetection.ts +4 -4
- package/utils/permissions/shellRuleMatching.ts +1 -1
- package/utils/permissions/yoloClassifier.ts +25 -25
- package/utils/planModeV2.ts +3 -3
- package/utils/plans.ts +14 -14
- package/utils/platform.ts +2 -2
- package/utils/plugins/addDirPluginSettings.ts +3 -3
- package/utils/plugins/cacheUtils.ts +16 -16
- package/utils/plugins/dependencyResolver.ts +5 -5
- package/utils/plugins/fetchTelemetry.ts +2 -2
- package/utils/plugins/gitAvailability.ts +1 -1
- package/utils/plugins/headlessPluginInstall.ts +12 -12
- package/utils/plugins/hintRecommendation.ts +9 -9
- package/utils/plugins/installCounts.ts +7 -7
- package/utils/plugins/installedPluginsManager.ts +15 -15
- package/utils/plugins/loadPluginAgents.ts +17 -17
- package/utils/plugins/loadPluginCommands.ts +17 -17
- package/utils/plugins/loadPluginHooks.ts +9 -9
- package/utils/plugins/loadPluginOutputStyles.ts +8 -8
- package/utils/plugins/lspPluginIntegration.ts +10 -10
- package/utils/plugins/lspRecommendation.ts +6 -6
- package/utils/plugins/managedPlugins.ts +1 -1
- package/utils/plugins/marketplaceHelpers.ts +7 -7
- package/utils/plugins/marketplaceManager.ts +22 -22
- package/utils/plugins/mcpPluginIntegration.ts +10 -10
- package/utils/plugins/mcpbHandler.ts +12 -12
- package/utils/plugins/officialMarketplace.ts +1 -1
- package/utils/plugins/officialMarketplaceGcs.ts +6 -6
- package/utils/plugins/officialMarketplaceStartupCheck.ts +12 -12
- package/utils/plugins/orphanedPluginFilter.ts +2 -2
- package/utils/plugins/parseMarketplaceInput.ts +3 -3
- package/utils/plugins/performStartupChecks.tsx +6 -6
- package/utils/plugins/pluginAutoupdate.ts +9 -9
- package/utils/plugins/pluginBlocklist.ts +7 -7
- package/utils/plugins/pluginDirectories.ts +6 -6
- package/utils/plugins/pluginFlagging.ts +5 -5
- package/utils/plugins/pluginIdentifier.ts +2 -2
- package/utils/plugins/pluginInstallationHelpers.ts +18 -18
- package/utils/plugins/pluginLoader.ts +31 -31
- package/utils/plugins/pluginOptionsStorage.ts +7 -7
- package/utils/plugins/pluginPolicy.ts +1 -1
- package/utils/plugins/pluginStartupCheck.ts +11 -11
- package/utils/plugins/pluginVersioning.ts +3 -3
- package/utils/plugins/reconciler.ts +8 -8
- package/utils/plugins/refresh.ts +17 -17
- package/utils/plugins/schemas.ts +3 -3
- package/utils/plugins/validatePlugin.ts +5 -5
- package/utils/plugins/walkPluginMarkdown.ts +2 -2
- package/utils/plugins/zipCache.ts +6 -6
- package/utils/plugins/zipCacheAdapters.ts +5 -5
- package/utils/powershell/dangerousCmdlets.ts +2 -2
- package/utils/powershell/parser.ts +4 -4
- package/utils/powershell/staticPrefix.ts +5 -5
- package/utils/preflightChecks.tsx +8 -8
- package/utils/processUserInput/processBashCommand.tsx +13 -13
- package/utils/processUserInput/processSlashCommand.tsx +45 -45
- package/utils/processUserInput/processTextPrompt.ts +8 -8
- package/utils/processUserInput/processUserInput.ts +22 -22
- package/utils/profilerBase.ts +1 -1
- package/utils/promptCategory.ts +3 -3
- package/utils/promptEditor.ts +9 -9
- package/utils/promptShellExecution.ts +9 -9
- package/utils/proxy.ts +4 -4
- package/utils/queryContext.ts +14 -14
- package/utils/queryHelpers.ts +23 -23
- package/utils/queryProfiler.ts +3 -3
- package/utils/queueProcessor.ts +2 -2
- package/utils/readEditContext.ts +1 -1
- package/utils/readFileInRange.ts +1 -1
- package/utils/releaseNotes.ts +7 -7
- package/utils/renderOptions.ts +3 -3
- package/utils/ripgrep.ts +9 -9
- package/utils/sandbox/sandbox-adapter.ts +17 -17
- package/utils/screenshotClipboard.ts +4 -4
- package/utils/sdkEventQueue.ts +2 -2
- package/utils/secureStorage/fallbackStorage.ts +1 -1
- package/utils/secureStorage/index.ts +4 -4
- package/utils/secureStorage/keychainPrefetch.ts +2 -2
- package/utils/secureStorage/macOsKeychainHelpers.ts +3 -3
- package/utils/secureStorage/macOsKeychainStorage.ts +6 -6
- package/utils/secureStorage/plainTextStorage.ts +5 -5
- package/utils/sessionActivity.ts +3 -3
- package/utils/sessionEnvironment.ts +5 -5
- package/utils/sessionFileAccessHooks.ts +16 -16
- package/utils/sessionIngressAuth.ts +5 -5
- package/utils/sessionRestore.ts +28 -28
- package/utils/sessionStart.ts +11 -11
- package/utils/sessionState.ts +3 -3
- package/utils/sessionStorage.ts +35 -35
- package/utils/sessionStoragePortable.ts +3 -3
- package/utils/sessionTitle.ts +9 -9
- package/utils/sessionUrl.ts +1 -1
- package/utils/settings/allErrors.ts +3 -3
- package/utils/settings/applySettingsChange.ts +8 -8
- package/utils/settings/changeDetector.ts +13 -13
- package/utils/settings/constants.ts +1 -1
- package/utils/settings/managedPath.ts +1 -1
- package/utils/settings/mdm/rawRead.ts +1 -1
- package/utils/settings/mdm/settings.ts +11 -11
- package/utils/settings/permissionValidation.ts +5 -5
- package/utils/settings/pluginOnlyPolicy.ts +2 -2
- package/utils/settings/schemaOutput.ts +2 -2
- package/utils/settings/settings.ts +23 -23
- package/utils/settings/settingsCache.ts +3 -3
- package/utils/settings/types.ts +10 -10
- package/utils/settings/validateEditTool.ts +3 -3
- package/utils/settings/validation.ts +8 -8
- package/utils/shell/bashProvider.ts +12 -12
- package/utils/shell/outputLimits.ts +1 -1
- package/utils/shell/powershellDetection.ts +2 -2
- package/utils/shell/powershellProvider.ts +2 -2
- package/utils/shell/prefix.ts +8 -8
- package/utils/shell/readOnlyCommandValidation.ts +1 -1
- package/utils/shell/resolveDefaultShell.ts +1 -1
- package/utils/shell/shellToolUtils.ts +4 -4
- package/utils/shell/specPrefix.ts +1 -1
- package/utils/shellConfig.ts +2 -2
- package/utils/sideQuery.ts +12 -12
- package/utils/sideQuestion.ts +5 -5
- package/utils/sinks.ts +2 -2
- package/utils/skills/skillChangeDetector.ts +10 -10
- package/utils/sliceAnsi.ts +1 -1
- package/utils/slowOperations.ts +6 -6
- package/utils/standaloneAgent.ts +2 -2
- package/utils/startupProfiler.ts +7 -7
- package/utils/staticRender.tsx +1 -1
- package/utils/stats.ts +11 -11
- package/utils/statsCache.ts +8 -8
- package/utils/status.tsx +19 -19
- package/utils/statusNoticeDefinitions.tsx +10 -10
- package/utils/statusNoticeHelpers.ts +2 -2
- package/utils/streamJsonStdoutGuard.ts +2 -2
- package/utils/streamlinedTransform.ts +15 -15
- package/utils/subprocessEnv.ts +1 -1
- package/utils/suggestions/commandSuggestions.ts +4 -4
- package/utils/suggestions/directoryCompletion.ts +5 -5
- package/utils/suggestions/shellHistoryCompletion.ts +2 -2
- package/utils/suggestions/skillUsageTracking.ts +1 -1
- package/utils/suggestions/slackChannelSuggestions.ts +6 -6
- package/utils/swarm/It2SetupPrompt.tsx +7 -7
- package/utils/swarm/backends/ITermBackend.ts +6 -6
- package/utils/swarm/backends/InProcessBackend.ts +9 -9
- package/utils/swarm/backends/PaneBackendExecutor.ts +12 -12
- package/utils/swarm/backends/TmuxBackend.ts +10 -10
- package/utils/swarm/backends/detection.ts +3 -3
- package/utils/swarm/backends/it2Setup.ts +4 -4
- package/utils/swarm/backends/registry.ts +9 -9
- package/utils/swarm/backends/teammateModeSnapshot.ts +3 -3
- package/utils/swarm/backends/types.ts +1 -1
- package/utils/swarm/inProcessRunner.ts +55 -55
- package/utils/swarm/leaderPermissionBridge.ts +2 -2
- package/utils/swarm/permissionSync.ts +10 -10
- package/utils/swarm/reconnection.ts +5 -5
- package/utils/swarm/spawnInProcess.ts +16 -16
- package/utils/swarm/spawnUtils.ts +6 -6
- package/utils/swarm/teamHelpers.ts +13 -13
- package/utils/swarm/teammateInit.ts +8 -8
- package/utils/swarm/teammateLayoutManager.ts +4 -4
- package/utils/swarm/teammateModel.ts +2 -2
- package/utils/systemDirectories.ts +2 -2
- package/utils/systemPrompt.ts +7 -7
- package/utils/systemTheme.ts +1 -1
- package/utils/task/TaskOutput.ts +6 -6
- package/utils/task/diskOutput.ts +5 -5
- package/utils/task/framework.ts +7 -7
- package/utils/task/outputFormatting.ts +2 -2
- package/utils/task/sdkProgress.ts +2 -2
- package/utils/tasks.ts +12 -12
- package/utils/teamDiscovery.ts +3 -3
- package/utils/teamMemoryOps.ts +3 -3
- package/utils/teammate.ts +4 -4
- package/utils/teammateMailbox.ts +17 -17
- package/utils/telemetry/betaSessionTracing.ts +7 -7
- package/utils/telemetry/bigqueryExporter.ts +10 -10
- package/utils/telemetry/events.ts +4 -4
- package/utils/telemetry/instrumentation.ts +19 -19
- package/utils/telemetry/logger.ts +2 -2
- package/utils/telemetry/perfettoTracing.ts +8 -8
- package/utils/telemetry/pluginTelemetry.ts +3 -3
- package/utils/telemetry/sessionTracing.ts +6 -6
- package/utils/telemetry/skillLoadedEvent.ts +3 -3
- package/utils/telemetryAttributes.ts +6 -6
- package/utils/teleport/api.ts +10 -10
- package/utils/teleport/environmentSelection.ts +3 -3
- package/utils/teleport/environments.ts +6 -6
- package/utils/teleport/gitBundle.ts +8 -8
- package/utils/teleport.tsx +37 -37
- package/utils/terminal.ts +3 -3
- package/utils/terminalPanel.ts +5 -5
- package/utils/textHighlighting.ts +1 -1
- package/utils/theme.ts +1 -1
- package/utils/thinking.ts +6 -6
- package/utils/tmuxSocket.ts +6 -6
- package/utils/todo/types.ts +1 -1
- package/utils/tokens.ts +4 -4
- package/utils/toolErrors.ts +2 -2
- package/utils/toolPool.ts +3 -3
- package/utils/toolResultStorage.ts +12 -12
- package/utils/toolSearch.ts +16 -16
- package/utils/transcriptSearch.ts +2 -2
- package/utils/treeify.ts +2 -2
- package/utils/truncate.ts +2 -2
- package/utils/ultraplan/ccrSession.ts +6 -6
- package/utils/unaryLogging.ts +1 -1
- package/utils/undercover.ts +3 -3
- package/utils/user.ts +6 -6
- package/utils/uuid.ts +1 -1
- package/utils/warningHandler.ts +4 -4
- package/utils/which.ts +1 -1
- package/utils/windowsPaths.ts +5 -5
- package/utils/worktree.ts +14 -14
- package/vim/motions.ts +82 -0
- package/vim/operators.ts +556 -0
- package/vim/textObjects.ts +186 -0
- package/vim/transitions.ts +490 -0
- package/vim/types.ts +199 -0
- package/voice/voiceModeEnabled.ts +54 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
createSkillCommand,
|
|
3
|
+
parseSkillFrontmatterFields,
|
|
4
|
+
} from './loadSkillsDir.ts'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Write-once registry for the two loadSkillsDir functions that MCP skill
|
|
8
|
+
* discovery needs. This module is a dependency-graph leaf: it imports nothing
|
|
9
|
+
* but types, so both mcpSkills.ts and loadSkillsDir.ts can depend on it
|
|
10
|
+
* without forming a cycle (client.ts → mcpSkills.ts → loadSkillsDir.ts → …
|
|
11
|
+
* → client.ts).
|
|
12
|
+
*
|
|
13
|
+
* The non-literal dynamic-import approach ("await import(variable)") fails at
|
|
14
|
+
* runtime in Bun-bundled binaries — the specifier is resolved against the
|
|
15
|
+
* chunk's /$bunfs/root/… path, not the original source tree, yielding "Cannot
|
|
16
|
+
* find module './loadSkillsDir.js'". A literal dynamic import works in bunfs
|
|
17
|
+
* but dependency-cruiser tracks it, and because loadSkillsDir transitively
|
|
18
|
+
* reaches almost everything, the single new edge fans out into many new cycle
|
|
19
|
+
* violations in the diff check.
|
|
20
|
+
*
|
|
21
|
+
* Registration happens at loadSkillsDir.ts module init, which is eagerly
|
|
22
|
+
* evaluated at startup via the static import from commands.ts — long before
|
|
23
|
+
* any MCP server connects.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export type MCPSkillBuilders = {
|
|
27
|
+
createSkillCommand: typeof createSkillCommand
|
|
28
|
+
parseSkillFrontmatterFields: typeof parseSkillFrontmatterFields
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let builders: MCPSkillBuilders | null = null
|
|
32
|
+
|
|
33
|
+
export function registerMCPSkillBuilders(b: MCPSkillBuilders): void {
|
|
34
|
+
builders = b
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function getMCPSkillBuilders(): MCPSkillBuilders {
|
|
38
|
+
if (!builders) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
'MCP skill builders not registered — loadSkillsDir.ts has not been evaluated yet',
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
return builders
|
|
44
|
+
}
|
package/state/AppState.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { feature } from 'bun:bundle';
|
|
3
3
|
import React, { useContext, useEffect, useEffectEvent, useState, useSyncExternalStore } from 'react';
|
|
4
|
-
import { MailboxProvider } from '../context/mailbox.
|
|
5
|
-
import { useSettingsChange } from '../hooks/useSettingsChange.
|
|
6
|
-
import { logForDebugging } from '../utils/debug.
|
|
7
|
-
import { createDisabledBypassPermissionsContext, isBypassPermissionsModeDisabled } from '../utils/permissions/permissionSetup.
|
|
8
|
-
import { applySettingsChange } from '../utils/settings/applySettingsChange.
|
|
9
|
-
import type { SettingSource } from '../utils/settings/constants.
|
|
10
|
-
import { createStore } from './store.
|
|
4
|
+
import { MailboxProvider } from '../context/mailbox.ts';
|
|
5
|
+
import { useSettingsChange } from '../hooks/useSettingsChange.ts';
|
|
6
|
+
import { logForDebugging } from '../utils/debug.ts';
|
|
7
|
+
import { createDisabledBypassPermissionsContext, isBypassPermissionsModeDisabled } from '../utils/permissions/permissionSetup.ts';
|
|
8
|
+
import { applySettingsChange } from '../utils/settings/applySettingsChange.ts';
|
|
9
|
+
import type { SettingSource } from '../utils/settings/constants.ts';
|
|
10
|
+
import { createStore } from './store.ts';
|
|
11
11
|
|
|
12
12
|
// DCE: voice context is ant-only. External builds get a passthrough.
|
|
13
13
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
@@ -18,12 +18,12 @@ const VoiceProvider: (props: {
|
|
|
18
18
|
}) => children;
|
|
19
19
|
|
|
20
20
|
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
21
|
-
import { type AppState, type AppStateStore, getDefaultAppState } from './AppStateStore.
|
|
21
|
+
import { type AppState, type AppStateStore, getDefaultAppState } from './AppStateStore.ts';
|
|
22
22
|
|
|
23
23
|
// TODO: Remove these re-exports once all callers import directly from
|
|
24
24
|
// ./AppStateStore.js. Kept for back-compat during migration so .ts callers
|
|
25
25
|
// can incrementally move off the .tsx import and stop pulling React.
|
|
26
|
-
export { type AppState, type AppStateStore, type CompletionBoundary, getDefaultAppState, IDLE_SPECULATION_STATE, type SpeculationResult, type SpeculationState } from './AppStateStore.
|
|
26
|
+
export { type AppState, type AppStateStore, type CompletionBoundary, getDefaultAppState, IDLE_SPECULATION_STATE, type SpeculationResult, type SpeculationState } from './AppStateStore.ts';
|
|
27
27
|
export const AppStoreContext = React.createContext<AppStateStore | null>(null);
|
|
28
28
|
type Props = {
|
|
29
29
|
children: React.ReactNode;
|
package/state/AppStateStore.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type { Notification } from '
|
|
2
|
-
import type { TodoList } from '
|
|
3
|
-
import type { BridgePermissionCallbacks } from '../bridge/bridgePermissionCallbacks.
|
|
4
|
-
import type { Command } from '../commands.
|
|
5
|
-
import type { ChannelPermissionCallbacks } from '../services/mcp/channelPermissions.
|
|
6
|
-
import type { ElicitationRequestEvent } from '../services/mcp/elicitationHandler.
|
|
1
|
+
import type { Notification } from '../context/notifications.ts'
|
|
2
|
+
import type { TodoList } from '../utils/todo/types.ts'
|
|
3
|
+
import type { BridgePermissionCallbacks } from '../bridge/bridgePermissionCallbacks.ts'
|
|
4
|
+
import type { Command } from '../commands.ts'
|
|
5
|
+
import type { ChannelPermissionCallbacks } from '../services/mcp/channelPermissions.ts'
|
|
6
|
+
import type { ElicitationRequestEvent } from '../services/mcp/elicitationHandler.ts'
|
|
7
7
|
import type {
|
|
8
8
|
MCPServerConnection,
|
|
9
9
|
ServerResource,
|
|
10
|
-
} from '../services/mcp/types.
|
|
11
|
-
import { shouldEnablePromptSuggestion } from '../services/PromptSuggestion/promptSuggestion.
|
|
10
|
+
} from '../services/mcp/types.ts'
|
|
11
|
+
import { shouldEnablePromptSuggestion } from '../services/PromptSuggestion/promptSuggestion.ts'
|
|
12
12
|
import {
|
|
13
13
|
getEmptyToolPermissionContext,
|
|
14
14
|
type Tool,
|
|
15
15
|
type ToolPermissionContext,
|
|
16
|
-
} from '../Tool.
|
|
17
|
-
import type { TaskState } from '../tasks/types.
|
|
18
|
-
import type { AgentColorName } from '../tools/AgentTool/agentColorManager.
|
|
19
|
-
import type { AgentDefinitionsResult } from '../tools/AgentTool/loadAgentsDir.
|
|
20
|
-
import type { AllowedPrompt } from '../tools/ExitPlanModeTool/ExitPlanModeV2Tool.
|
|
21
|
-
import type { AgentId } from '../types/ids.
|
|
22
|
-
import type { Message, UserMessage } from '../types/message.
|
|
23
|
-
import type { LoadedPlugin, PluginError } from '../types/plugin.
|
|
24
|
-
import type { DeepImmutable } from '../types/utils.
|
|
16
|
+
} from '../Tool.ts'
|
|
17
|
+
import type { TaskState } from '../tasks/types.ts'
|
|
18
|
+
import type { AgentColorName } from '../tools/AgentTool/agentColorManager.ts'
|
|
19
|
+
import type { AgentDefinitionsResult } from '../tools/AgentTool/loadAgentsDir.ts'
|
|
20
|
+
import type { AllowedPrompt } from '../tools/ExitPlanModeTool/ExitPlanModeV2Tool.ts'
|
|
21
|
+
import type { AgentId } from '../types/ids.ts'
|
|
22
|
+
import type { Message, UserMessage } from '../types/message.ts'
|
|
23
|
+
import type { LoadedPlugin, PluginError } from '../types/plugin.ts'
|
|
24
|
+
import type { DeepImmutable } from '../types/utils.ts'
|
|
25
25
|
import {
|
|
26
26
|
type AttributionState,
|
|
27
27
|
createEmptyAttributionState,
|
|
28
|
-
} from '../utils/commitAttribution.
|
|
29
|
-
import type { EffortValue } from '../utils/effort.
|
|
30
|
-
import type { FileHistoryState } from '../utils/fileHistory.
|
|
31
|
-
import type { REPLHookContext } from '../utils/hooks/postSamplingHooks.
|
|
32
|
-
import type { SessionHooksState } from '../utils/hooks/sessionHooks.
|
|
33
|
-
import type { ModelSetting } from '../utils/model/model.
|
|
34
|
-
import type { DenialTrackingState } from '../utils/permissions/denialTracking.
|
|
35
|
-
import type { PermissionMode } from '../utils/permissions/PermissionMode.
|
|
36
|
-
import { getInitialSettings } from '../utils/settings/settings.
|
|
37
|
-
import type { SettingsJson } from '../utils/settings/types.
|
|
38
|
-
import { shouldEnableThinkingByDefault } from '../utils/thinking.
|
|
39
|
-
import type { Store } from './store.
|
|
28
|
+
} from '../utils/commitAttribution.ts'
|
|
29
|
+
import type { EffortValue } from '../utils/effort.ts'
|
|
30
|
+
import type { FileHistoryState } from '../utils/fileHistory.ts'
|
|
31
|
+
import type { REPLHookContext } from '../utils/hooks/postSamplingHooks.ts'
|
|
32
|
+
import type { SessionHooksState } from '../utils/hooks/sessionHooks.ts'
|
|
33
|
+
import type { ModelSetting } from '../utils/model/model.ts'
|
|
34
|
+
import type { DenialTrackingState } from '../utils/permissions/denialTracking.ts'
|
|
35
|
+
import type { PermissionMode } from '../utils/permissions/PermissionMode.ts'
|
|
36
|
+
import { getInitialSettings } from '../utils/settings/settings.ts'
|
|
37
|
+
import type { SettingsJson } from '../utils/settings/types.ts'
|
|
38
|
+
import { shouldEnableThinkingByDefault } from '../utils/thinking.ts'
|
|
39
|
+
import type { Store } from './store.ts'
|
|
40
40
|
|
|
41
41
|
export type CompletionBoundary =
|
|
42
42
|
| { type: 'complete'; completedAt: number; outputTokens: number }
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { setMainLoopModelOverride } from '../bootstrap/state.
|
|
1
|
+
import { setMainLoopModelOverride } from '../bootstrap/state.ts'
|
|
2
2
|
import {
|
|
3
3
|
clearApiKeyHelperCache,
|
|
4
4
|
clearAwsCredentialsCache,
|
|
5
5
|
clearGcpCredentialsCache,
|
|
6
|
-
} from '../utils/auth.
|
|
7
|
-
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.
|
|
8
|
-
import { toError } from '../utils/errors.
|
|
9
|
-
import { logError } from '../utils/log.
|
|
10
|
-
import { applyConfigEnvironmentVariables } from '../utils/managedEnv.
|
|
6
|
+
} from '../utils/auth.ts'
|
|
7
|
+
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.ts'
|
|
8
|
+
import { toError } from '../utils/errors.ts'
|
|
9
|
+
import { logError } from '../utils/log.ts'
|
|
10
|
+
import { applyConfigEnvironmentVariables } from '../utils/managedEnv.ts'
|
|
11
11
|
import {
|
|
12
12
|
permissionModeFromString,
|
|
13
13
|
toExternalPermissionMode,
|
|
14
|
-
} from '../utils/permissions/PermissionMode.
|
|
14
|
+
} from '../utils/permissions/PermissionMode.ts'
|
|
15
15
|
import {
|
|
16
16
|
notifyPermissionModeChanged,
|
|
17
17
|
notifySessionMetadataChanged,
|
|
18
18
|
type SessionExternalMetadata,
|
|
19
|
-
} from '../utils/sessionState.
|
|
20
|
-
import { updateSettingsForSource } from '../utils/settings/settings.
|
|
21
|
-
import type { AppState } from './AppStateStore.
|
|
19
|
+
} from '../utils/sessionState.ts'
|
|
20
|
+
import { updateSettingsForSource } from '../utils/settings/settings.ts'
|
|
21
|
+
import type { AppState } from './AppStateStore.ts'
|
|
22
22
|
|
|
23
23
|
// Inverse of the push below — restore on worker restart.
|
|
24
24
|
export function externalMetadataToAppState(
|
package/state/selectors.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Keep selectors pure and simple - just data extraction, no side effects.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { InProcessTeammateTaskState } from '../tasks/InProcessTeammateTask/types.
|
|
7
|
-
import { isInProcessTeammateTask } from '../tasks/InProcessTeammateTask/types.
|
|
8
|
-
import type { LocalAgentTaskState } from '../tasks/LocalAgentTask/LocalAgentTask.
|
|
9
|
-
import type { AppState } from './AppStateStore.
|
|
6
|
+
import type { InProcessTeammateTaskState } from '../tasks/InProcessTeammateTask/types.ts'
|
|
7
|
+
import { isInProcessTeammateTask } from '../tasks/InProcessTeammateTask/types.ts'
|
|
8
|
+
import type { LocalAgentTaskState } from '../tasks/LocalAgentTask/LocalAgentTask.ts'
|
|
9
|
+
import type { AppState } from './AppStateStore.ts'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Get the currently viewed teammate task, if any.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { logEvent } from '../services/analytics/index.
|
|
2
|
-
import { isTerminalTaskStatus } from '../Task.
|
|
3
|
-
import type { LocalAgentTaskState } from '../tasks/LocalAgentTask/LocalAgentTask.
|
|
1
|
+
import { logEvent } from '../services/analytics/index.ts'
|
|
2
|
+
import { isTerminalTaskStatus } from '../Task.ts'
|
|
3
|
+
import type { LocalAgentTaskState } from '../tasks/LocalAgentTask/LocalAgentTask.ts'
|
|
4
4
|
|
|
5
5
|
// Inlined from framework.ts — importing creates a cycle through
|
|
6
6
|
// BackgroundTasksDialog. Keep in sync with PANEL_GRACE_MS there.
|
|
7
7
|
const PANEL_GRACE_MS = 30_000
|
|
8
8
|
|
|
9
|
-
import type { AppState } from './AppState.
|
|
9
|
+
import type { AppState } from './AppState.ts'
|
|
10
10
|
|
|
11
11
|
// Inline type check instead of importing isLocalAgentTask — breaks the
|
|
12
12
|
// teammateViewHelpers → LocalAgentTask runtime edge that creates a cycle
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Background task entry for auto-dream (memory consolidation subagent).
|
|
2
|
+
// Makes the otherwise-invisible forked agent visible in the footer pill and
|
|
3
|
+
// Shift+Down dialog. The dream agent itself is unchanged — this is pure UI
|
|
4
|
+
// surfacing via the existing task registry.
|
|
5
|
+
|
|
6
|
+
import { rollbackConsolidationLock } from '../../services/autoDream/consolidationLock.ts'
|
|
7
|
+
import type { SetAppState, Task, TaskStateBase } from '../../Task.ts'
|
|
8
|
+
import { createTaskStateBase, generateTaskId } from '../../Task.ts'
|
|
9
|
+
import { registerTask, updateTaskState } from '../../utils/task/framework.ts'
|
|
10
|
+
|
|
11
|
+
// Keep only the N most recent turns for live display.
|
|
12
|
+
const MAX_TURNS = 30
|
|
13
|
+
|
|
14
|
+
// A single assistant turn from the dream agent, tool uses collapsed to a count.
|
|
15
|
+
export type DreamTurn = {
|
|
16
|
+
text: string
|
|
17
|
+
toolUseCount: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// No phase detection — the dream prompt has a 4-stage structure
|
|
21
|
+
// (orient/gather/consolidate/prune) but we don't parse it. Just flip from
|
|
22
|
+
// 'starting' to 'updating' when the first Edit/Write tool_use lands.
|
|
23
|
+
export type DreamPhase = 'starting' | 'updating'
|
|
24
|
+
|
|
25
|
+
export type DreamTaskState = TaskStateBase & {
|
|
26
|
+
type: 'dream'
|
|
27
|
+
phase: DreamPhase
|
|
28
|
+
sessionsReviewing: number
|
|
29
|
+
/**
|
|
30
|
+
* Paths observed in Edit/Write tool_use blocks via onMessage. This is an
|
|
31
|
+
* INCOMPLETE reflection of what the dream agent actually changed — it misses
|
|
32
|
+
* any bash-mediated writes and only captures the tool calls we pattern-match.
|
|
33
|
+
* Treat as "at least these were touched", not "only these were touched".
|
|
34
|
+
*/
|
|
35
|
+
filesTouched: string[]
|
|
36
|
+
/** Assistant text responses, tool uses collapsed. Prompt is NOT included. */
|
|
37
|
+
turns: DreamTurn[]
|
|
38
|
+
abortController?: AbortController
|
|
39
|
+
/** Stashed so kill can rewind the lock mtime (same path as fork-failure). */
|
|
40
|
+
priorMtime: number
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isDreamTask(task: unknown): task is DreamTaskState {
|
|
44
|
+
return (
|
|
45
|
+
typeof task === 'object' &&
|
|
46
|
+
task !== null &&
|
|
47
|
+
'type' in task &&
|
|
48
|
+
task.type === 'dream'
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function registerDreamTask(
|
|
53
|
+
setAppState: SetAppState,
|
|
54
|
+
opts: {
|
|
55
|
+
sessionsReviewing: number
|
|
56
|
+
priorMtime: number
|
|
57
|
+
abortController: AbortController
|
|
58
|
+
},
|
|
59
|
+
): string {
|
|
60
|
+
const id = generateTaskId('dream')
|
|
61
|
+
const task: DreamTaskState = {
|
|
62
|
+
...createTaskStateBase(id, 'dream', 'dreaming'),
|
|
63
|
+
type: 'dream',
|
|
64
|
+
status: 'running',
|
|
65
|
+
phase: 'starting',
|
|
66
|
+
sessionsReviewing: opts.sessionsReviewing,
|
|
67
|
+
filesTouched: [],
|
|
68
|
+
turns: [],
|
|
69
|
+
abortController: opts.abortController,
|
|
70
|
+
priorMtime: opts.priorMtime,
|
|
71
|
+
}
|
|
72
|
+
registerTask(task, setAppState)
|
|
73
|
+
return id
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function addDreamTurn(
|
|
77
|
+
taskId: string,
|
|
78
|
+
turn: DreamTurn,
|
|
79
|
+
touchedPaths: string[],
|
|
80
|
+
setAppState: SetAppState,
|
|
81
|
+
): void {
|
|
82
|
+
updateTaskState<DreamTaskState>(taskId, setAppState, task => {
|
|
83
|
+
const seen = new Set(task.filesTouched)
|
|
84
|
+
const newTouched = touchedPaths.filter(p => !seen.has(p) && seen.add(p))
|
|
85
|
+
// Skip the update entirely if the turn is empty AND nothing new was
|
|
86
|
+
// touched. Avoids re-rendering on pure no-ops.
|
|
87
|
+
if (
|
|
88
|
+
turn.text === '' &&
|
|
89
|
+
turn.toolUseCount === 0 &&
|
|
90
|
+
newTouched.length === 0
|
|
91
|
+
) {
|
|
92
|
+
return task
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
...task,
|
|
96
|
+
phase: newTouched.length > 0 ? 'updating' : task.phase,
|
|
97
|
+
filesTouched:
|
|
98
|
+
newTouched.length > 0
|
|
99
|
+
? [...task.filesTouched, ...newTouched]
|
|
100
|
+
: task.filesTouched,
|
|
101
|
+
turns: task.turns.slice(-(MAX_TURNS - 1)).concat(turn),
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function completeDreamTask(
|
|
107
|
+
taskId: string,
|
|
108
|
+
setAppState: SetAppState,
|
|
109
|
+
): void {
|
|
110
|
+
// notified: true immediately — dream has no model-facing notification path
|
|
111
|
+
// (it's UI-only), and eviction requires terminal + notified. The inline
|
|
112
|
+
// appendSystemMessage completion note IS the user surface.
|
|
113
|
+
updateTaskState<DreamTaskState>(taskId, setAppState, task => ({
|
|
114
|
+
...task,
|
|
115
|
+
status: 'completed',
|
|
116
|
+
endTime: Date.now(),
|
|
117
|
+
notified: true,
|
|
118
|
+
abortController: undefined,
|
|
119
|
+
}))
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function failDreamTask(taskId: string, setAppState: SetAppState): void {
|
|
123
|
+
updateTaskState<DreamTaskState>(taskId, setAppState, task => ({
|
|
124
|
+
...task,
|
|
125
|
+
status: 'failed',
|
|
126
|
+
endTime: Date.now(),
|
|
127
|
+
notified: true,
|
|
128
|
+
abortController: undefined,
|
|
129
|
+
}))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const DreamTask: Task = {
|
|
133
|
+
name: 'DreamTask',
|
|
134
|
+
type: 'dream',
|
|
135
|
+
|
|
136
|
+
async kill(taskId, setAppState) {
|
|
137
|
+
let priorMtime: number | undefined
|
|
138
|
+
updateTaskState<DreamTaskState>(taskId, setAppState, task => {
|
|
139
|
+
if (task.status !== 'running') return task
|
|
140
|
+
task.abortController?.abort()
|
|
141
|
+
priorMtime = task.priorMtime
|
|
142
|
+
return {
|
|
143
|
+
...task,
|
|
144
|
+
status: 'killed',
|
|
145
|
+
endTime: Date.now(),
|
|
146
|
+
notified: true,
|
|
147
|
+
abortController: undefined,
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
// Rewind the lock mtime so the next session can retry. Same path as the
|
|
151
|
+
// fork-failure catch in autoDream.ts. If updateTaskState was a no-op
|
|
152
|
+
// (already terminal), priorMtime stays undefined and we skip.
|
|
153
|
+
if (priorMtime !== undefined) {
|
|
154
|
+
await rollbackConsolidationLock(priorMtime)
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InProcessTeammateTask - Manages in-process teammate lifecycle
|
|
3
|
+
*
|
|
4
|
+
* This component implements the Task interface for in-process teammates.
|
|
5
|
+
* Unlike LocalAgentTask (background agents), in-process teammates:
|
|
6
|
+
* 1. Run in the same Node.js process using AsyncLocalStorage for isolation
|
|
7
|
+
* 2. Have team-aware identity (agentName@teamName)
|
|
8
|
+
* 3. Support plan mode approval flow
|
|
9
|
+
* 4. Can be idle (waiting for work) or active (processing)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { isTerminalTaskStatus, type SetAppState, type Task, type TaskStateBase } from '../../Task.ts';
|
|
13
|
+
import type { Message } from '../../types/message.ts';
|
|
14
|
+
import { logForDebugging } from '../../utils/debug.ts';
|
|
15
|
+
import { createUserMessage } from '../../utils/messages.ts';
|
|
16
|
+
import { killInProcessTeammate } from '../../utils/swarm/spawnInProcess.ts';
|
|
17
|
+
import { updateTaskState } from '../../utils/task/framework.ts';
|
|
18
|
+
import type { InProcessTeammateTaskState } from './types.ts';
|
|
19
|
+
import { appendCappedMessage, isInProcessTeammateTask } from './types.ts';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* InProcessTeammateTask - Handles in-process teammate execution.
|
|
23
|
+
*/
|
|
24
|
+
export const InProcessTeammateTask: Task = {
|
|
25
|
+
name: 'InProcessTeammateTask',
|
|
26
|
+
type: 'in_process_teammate',
|
|
27
|
+
async kill(taskId, setAppState) {
|
|
28
|
+
killInProcessTeammate(taskId, setAppState);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Request shutdown for a teammate.
|
|
34
|
+
*/
|
|
35
|
+
export function requestTeammateShutdown(taskId: string, setAppState: SetAppState): void {
|
|
36
|
+
updateTaskState<InProcessTeammateTaskState>(taskId, setAppState, task => {
|
|
37
|
+
if (task.status !== 'running' || task.shutdownRequested) {
|
|
38
|
+
return task;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
...task,
|
|
42
|
+
shutdownRequested: true
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Append a message to a teammate's conversation history.
|
|
49
|
+
* Used for zoomed view to show the teammate's conversation.
|
|
50
|
+
*/
|
|
51
|
+
export function appendTeammateMessage(taskId: string, message: Message, setAppState: SetAppState): void {
|
|
52
|
+
updateTaskState<InProcessTeammateTaskState>(taskId, setAppState, task => {
|
|
53
|
+
if (task.status !== 'running') {
|
|
54
|
+
return task;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
...task,
|
|
58
|
+
messages: appendCappedMessage(task.messages, message)
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Inject a user message to a teammate's pending queue.
|
|
65
|
+
* Used when viewing a teammate's transcript to send typed messages to them.
|
|
66
|
+
* Also adds the message to task.messages so it appears immediately in the transcript.
|
|
67
|
+
*/
|
|
68
|
+
export function injectUserMessageToTeammate(taskId: string, message: string, setAppState: SetAppState): void {
|
|
69
|
+
updateTaskState<InProcessTeammateTaskState>(taskId, setAppState, task => {
|
|
70
|
+
// Allow message injection when teammate is running or idle (waiting for input)
|
|
71
|
+
// Only reject if teammate is in a terminal state
|
|
72
|
+
if (isTerminalTaskStatus(task.status)) {
|
|
73
|
+
logForDebugging(`Dropping message for teammate task ${taskId}: task status is "${task.status}"`);
|
|
74
|
+
return task;
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
...task,
|
|
78
|
+
pendingUserMessages: [...task.pendingUserMessages, message],
|
|
79
|
+
messages: appendCappedMessage(task.messages, createUserMessage({
|
|
80
|
+
content: message
|
|
81
|
+
}))
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get teammate task by agent ID from AppState.
|
|
88
|
+
* Prefers running tasks over killed/completed ones in case multiple tasks
|
|
89
|
+
* with the same agentId exist.
|
|
90
|
+
* Returns undefined if not found.
|
|
91
|
+
*/
|
|
92
|
+
export function findTeammateTaskByAgentId(agentId: string, tasks: Record<string, TaskStateBase>): InProcessTeammateTaskState | undefined {
|
|
93
|
+
let fallback: InProcessTeammateTaskState | undefined;
|
|
94
|
+
for (const task of Object.values(tasks)) {
|
|
95
|
+
if (isInProcessTeammateTask(task) && task.identity.agentId === agentId) {
|
|
96
|
+
// Prefer running tasks in case old killed tasks still exist in AppState
|
|
97
|
+
// alongside new running ones with the same agentId
|
|
98
|
+
if (task.status === 'running') {
|
|
99
|
+
return task;
|
|
100
|
+
}
|
|
101
|
+
// Keep first match as fallback in case no running task exists
|
|
102
|
+
if (!fallback) {
|
|
103
|
+
fallback = task;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return fallback;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Get all in-process teammate tasks from AppState.
|
|
112
|
+
*/
|
|
113
|
+
export function getAllInProcessTeammateTasks(tasks: Record<string, TaskStateBase>): InProcessTeammateTaskState[] {
|
|
114
|
+
return Object.values(tasks).filter(isInProcessTeammateTask);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Get running in-process teammates sorted alphabetically by agentName.
|
|
119
|
+
* Shared between TeammateSpinnerTree display, PromptInput footer selector,
|
|
120
|
+
* and useBackgroundTaskNavigation — selectedIPAgentIndex maps into this
|
|
121
|
+
* array, so all three must agree on sort order.
|
|
122
|
+
*/
|
|
123
|
+
export function getRunningTeammatesSorted(tasks: Record<string, TaskStateBase>): InProcessTeammateTaskState[] {
|
|
124
|
+
return getAllInProcessTeammateTasks(tasks).filter(t => t.status === 'running').sort((a, b) => a.identity.agentName.localeCompare(b.identity.agentName));
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJpc1Rlcm1pbmFsVGFza1N0YXR1cyIsIlNldEFwcFN0YXRlIiwiVGFzayIsIlRhc2tTdGF0ZUJhc2UiLCJNZXNzYWdlIiwibG9nRm9yRGVidWdnaW5nIiwiY3JlYXRlVXNlck1lc3NhZ2UiLCJraWxsSW5Qcm9jZXNzVGVhbW1hdGUiLCJ1cGRhdGVUYXNrU3RhdGUiLCJJblByb2Nlc3NUZWFtbWF0ZVRhc2tTdGF0ZSIsImFwcGVuZENhcHBlZE1lc3NhZ2UiLCJpc0luUHJvY2Vzc1RlYW1tYXRlVGFzayIsIkluUHJvY2Vzc1RlYW1tYXRlVGFzayIsIm5hbWUiLCJ0eXBlIiwia2lsbCIsInRhc2tJZCIsInNldEFwcFN0YXRlIiwicmVxdWVzdFRlYW1tYXRlU2h1dGRvd24iLCJ0YXNrIiwic3RhdHVzIiwic2h1dGRvd25SZXF1ZXN0ZWQiLCJhcHBlbmRUZWFtbWF0ZU1lc3NhZ2UiLCJtZXNzYWdlIiwibWVzc2FnZXMiLCJpbmplY3RVc2VyTWVzc2FnZVRvVGVhbW1hdGUiLCJwZW5kaW5nVXNlck1lc3NhZ2VzIiwiY29udGVudCIsImZpbmRUZWFtbWF0ZVRhc2tCeUFnZW50SWQiLCJhZ2VudElkIiwidGFza3MiLCJSZWNvcmQiLCJmYWxsYmFjayIsIk9iamVjdCIsInZhbHVlcyIsImlkZW50aXR5IiwiZ2V0QWxsSW5Qcm9jZXNzVGVhbW1hdGVUYXNrcyIsImZpbHRlciIsImdldFJ1bm5pbmdUZWFt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MsQ0FBQyxLQUFLRCxDQUFDLENBQUNOLFFBQVEsQ0FBQ1EsU0FBUyxDQUFDQyxhQUFhLENBQUNGLENBQUMsQ0FBQ1AsUUFBUSxDQUFDUSxTQUFTLENBQUMsQ0FBQztBQUM3RSIsImlnbm9yZUxpc3QiOltdfQ==
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { TaskStateBase } from '../../Task.ts'
|
|
2
|
+
import type { AgentToolResult } from '../../tools/AgentTool/agentToolUtils.ts'
|
|
3
|
+
import type { AgentDefinition } from '../../tools/AgentTool/loadAgentsDir.ts'
|
|
4
|
+
import type { Message } from '../../types/message.ts'
|
|
5
|
+
import type { PermissionMode } from '../../utils/permissions/PermissionMode.ts'
|
|
6
|
+
import type { AgentProgress } from '../LocalAgentTask/LocalAgentTask.ts'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Teammate identity stored in task state.
|
|
10
|
+
* Same shape as TeammateContext (runtime) but stored as plain data.
|
|
11
|
+
* TeammateContext is for AsyncLocalStorage; this is for AppState persistence.
|
|
12
|
+
*/
|
|
13
|
+
export type TeammateIdentity = {
|
|
14
|
+
agentId: string // e.g., "researcher@my-team"
|
|
15
|
+
agentName: string // e.g., "researcher"
|
|
16
|
+
teamName: string
|
|
17
|
+
color?: string
|
|
18
|
+
planModeRequired: boolean
|
|
19
|
+
parentSessionId: string // Leader's session ID
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type InProcessTeammateTaskState = TaskStateBase & {
|
|
23
|
+
type: 'in_process_teammate'
|
|
24
|
+
|
|
25
|
+
// Identity as sub-object (matches TeammateContext shape for consistency)
|
|
26
|
+
// Stored as plain data in AppState, NOT a reference to AsyncLocalStorage
|
|
27
|
+
identity: TeammateIdentity
|
|
28
|
+
|
|
29
|
+
// Execution
|
|
30
|
+
prompt: string
|
|
31
|
+
// Optional model override for this teammate
|
|
32
|
+
model?: string
|
|
33
|
+
// Optional: Only set if teammate uses a specific agent definition
|
|
34
|
+
// Many teammates run as general-purpose agents without a predefined definition
|
|
35
|
+
selectedAgent?: AgentDefinition
|
|
36
|
+
abortController?: AbortController // Runtime only, not serialized to disk - kills WHOLE teammate
|
|
37
|
+
currentWorkAbortController?: AbortController // Runtime only - aborts current turn without killing teammate
|
|
38
|
+
unregisterCleanup?: () => void // Runtime only
|
|
39
|
+
|
|
40
|
+
// Plan mode approval tracking (planModeRequired is in identity)
|
|
41
|
+
awaitingPlanApproval: boolean
|
|
42
|
+
|
|
43
|
+
// Permission mode for this teammate (cycled independently via Shift+Tab when viewing)
|
|
44
|
+
permissionMode: PermissionMode
|
|
45
|
+
|
|
46
|
+
// State
|
|
47
|
+
error?: string
|
|
48
|
+
result?: AgentToolResult // Reuse existing type since teammates run via runAgent()
|
|
49
|
+
progress?: AgentProgress
|
|
50
|
+
|
|
51
|
+
// Conversation history for zoomed view (NOT mailbox messages)
|
|
52
|
+
// Mailbox messages are stored separately in teamContext.inProcessMailboxes
|
|
53
|
+
messages?: Message[]
|
|
54
|
+
|
|
55
|
+
// Tool use IDs currently being executed (for animation in transcript view)
|
|
56
|
+
inProgressToolUseIDs?: Set<string>
|
|
57
|
+
|
|
58
|
+
// Queue of user messages to deliver when viewing teammate transcript
|
|
59
|
+
pendingUserMessages: string[]
|
|
60
|
+
|
|
61
|
+
// UI: random spinner verbs (stable across re-renders, shared between components)
|
|
62
|
+
spinnerVerb?: string
|
|
63
|
+
pastTenseVerb?: string
|
|
64
|
+
|
|
65
|
+
// Lifecycle
|
|
66
|
+
isIdle: boolean
|
|
67
|
+
shutdownRequested: boolean
|
|
68
|
+
|
|
69
|
+
// Callbacks to notify when teammate becomes idle (runtime only)
|
|
70
|
+
// Used by leader to efficiently wait without polling
|
|
71
|
+
onIdleCallbacks?: Array<() => void>
|
|
72
|
+
|
|
73
|
+
// Progress tracking (for computing deltas in notifications)
|
|
74
|
+
lastReportedToolCount: number
|
|
75
|
+
lastReportedTokenCount: number
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function isInProcessTeammateTask(
|
|
79
|
+
task: unknown,
|
|
80
|
+
): task is InProcessTeammateTaskState {
|
|
81
|
+
return (
|
|
82
|
+
typeof task === 'object' &&
|
|
83
|
+
task !== null &&
|
|
84
|
+
'type' in task &&
|
|
85
|
+
task.type === 'in_process_teammate'
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Cap on the number of messages kept in task.messages (the AppState UI mirror).
|
|
91
|
+
*
|
|
92
|
+
* task.messages exists purely for the zoomed transcript dialog, which only
|
|
93
|
+
* needs recent context. The full conversation lives in the local allMessages
|
|
94
|
+
* array (inProcessRunner) and on disk at the agent transcript path.
|
|
95
|
+
*
|
|
96
|
+
* BQ analysis (round 9, 2026-03-20) showed ~20MB RSS per agent at 500+ turn
|
|
97
|
+
* sessions and ~125MB per concurrent agent in swarm bursts. Whale session
|
|
98
|
+
* 9a990de8 launched 292 agents in 2 minutes and reached 36.8GB. The dominant
|
|
99
|
+
* cost is this array holding a second full copy of every message.
|
|
100
|
+
*/
|
|
101
|
+
export const TEAMMATE_MESSAGES_UI_CAP = 50
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Append an item to a message array, capping the result at
|
|
105
|
+
* TEAMMATE_MESSAGES_UI_CAP entries by dropping the oldest. Always returns
|
|
106
|
+
* a new array (AppState immutability).
|
|
107
|
+
*/
|
|
108
|
+
export function appendCappedMessage<T>(
|
|
109
|
+
prev: readonly T[] | undefined,
|
|
110
|
+
item: T,
|
|
111
|
+
): T[] {
|
|
112
|
+
if (prev === undefined || prev.length === 0) {
|
|
113
|
+
return [item]
|
|
114
|
+
}
|
|
115
|
+
if (prev.length >= TEAMMATE_MESSAGES_UI_CAP) {
|
|
116
|
+
const next = prev.slice(-(TEAMMATE_MESSAGES_UI_CAP - 1))
|
|
117
|
+
next.push(item)
|
|
118
|
+
return next
|
|
119
|
+
}
|
|
120
|
+
return [...prev, item]
|
|
121
|
+
}
|