thaddeus 1.0.26 → 1.0.28
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/package.json +14 -5
- package/src/QueryEngine.js +926 -0
- package/src/Task.js +49 -0
- package/src/Tool.js +61 -0
- package/src/assistant/gate.js +5 -0
- package/src/assistant/index.js +106 -0
- package/src/assistant/sessionHistory.js +145 -0
- package/src/bootstrap/state.js +1163 -0
- package/src/bridge/bridgeApi.js +304 -0
- package/src/bridge/bridgeConfig.js +39 -0
- package/src/bridge/bridgeDebug.js +73 -0
- package/src/bridge/bridgeEnabled.js +185 -0
- package/src/bridge/bridgeMain.js +2289 -0
- package/src/bridge/bridgeMessaging.js +353 -0
- package/src/bridge/bridgePermissionCallbacks.js +10 -0
- package/src/bridge/bridgePointer.js +175 -0
- package/src/bridge/bridgeStatusUtil.js +105 -0
- package/src/bridge/bridgeUI.js +411 -0
- package/src/bridge/capacityWake.js +35 -0
- package/src/bridge/codeSessionApi.js +111 -0
- package/src/bridge/createSession.js +273 -0
- package/src/bridge/debugUtils.js +115 -0
- package/src/bridge/envLessBridgeConfig.js +120 -0
- package/src/bridge/flushGate.js +65 -0
- package/src/bridge/inboundAttachments.js +152 -0
- package/src/bridge/inboundMessages.js +63 -0
- package/src/bridge/initReplBridge.js +431 -0
- package/src/bridge/jwtUtils.js +185 -0
- package/src/bridge/peerSessions.js +5 -0
- package/src/bridge/pollConfig.js +85 -0
- package/src/bridge/pollConfigDefaults.js +62 -0
- package/src/bridge/remoteBridgeCore.js +712 -0
- package/src/bridge/replBridge.js +1719 -0
- package/src/bridge/replBridgeHandle.js +30 -0
- package/src/bridge/replBridgeTransport.js +236 -0
- package/src/bridge/sessionIdCompat.js +56 -0
- package/src/bridge/sessionRunner.js +421 -0
- package/src/bridge/trustedDevice.js +170 -0
- package/src/bridge/types.js +9 -0
- package/src/bridge/webhookSanitizer.js +6 -0
- package/src/bridge/workSecret.js +99 -0
- package/src/buddy/CompanionSprite.js +348 -0
- package/src/buddy/companion.js +107 -0
- package/src/buddy/prompt.js +33 -0
- package/src/buddy/sprites.js +488 -0
- package/src/buddy/types.js +90 -0
- package/src/buddy/useBuddyNotification.js +85 -0
- package/src/cli/bg.js +17 -0
- package/src/cli/exit.js +30 -0
- package/src/cli/handlers/agents.js +55 -0
- package/src/cli/handlers/auth.js +249 -0
- package/src/cli/handlers/autoMode.js +128 -0
- package/src/cli/handlers/mcp.js +335 -0
- package/src/cli/handlers/plugins.js +634 -0
- package/src/cli/handlers/templateJobs.js +19 -0
- package/src/cli/handlers/util.js +76 -0
- package/src/cli/ndjsonSafeStringify.js +27 -0
- package/src/cli/print.js +4294 -0
- package/src/cli/remoteIO.js +208 -0
- package/src/cli/structuredIO.js +644 -0
- package/src/cli/transports/HybridTransport.js +233 -0
- package/src/cli/transports/SSETransport.js +538 -0
- package/src/cli/transports/SerialBatchEventUploader.js +224 -0
- package/src/cli/transports/WebSocketTransport.js +613 -0
- package/src/cli/transports/WorkerStateUploader.js +88 -0
- package/src/cli/transports/ccrClient.js +711 -0
- package/src/cli/transports/transportUtils.js +39 -0
- package/src/cli/update.js +314 -0
- package/src/commandCenter/launch.js +39 -0
- package/src/commandCenter/phoneApi.js +168 -0
- package/src/commandCenter/phoneStore.js +159 -0
- package/src/commandCenter/reactorBus.js +130 -0
- package/src/commandCenter/server.js +288 -0
- package/src/commandCenter/server.ts +42 -7
- package/src/commandCenter/tunnel.js +199 -0
- package/src/commands/add-dir/add-dir.js +121 -0
- package/src/commands/add-dir/index.js +8 -0
- package/src/commands/add-dir/validation.js +76 -0
- package/src/commands/advisor.js +88 -0
- package/src/commands/agents/agents.js +10 -0
- package/src/commands/agents/index.js +7 -0
- package/src/commands/agents-platform/index.js +2 -0
- package/src/commands/assistant/index.js +86 -0
- package/src/commands/backup/index.js +31 -0
- package/src/commands/branch/branch.js +205 -0
- package/src/commands/branch/index.js +11 -0
- package/src/commands/bridge/bridge.js +513 -0
- package/src/commands/bridge/index.js +22 -0
- package/src/commands/bridge-kick.js +179 -0
- package/src/commands/brief.js +89 -0
- package/src/commands/btw/btw.js +235 -0
- package/src/commands/btw/index.js +9 -0
- package/src/commands/buddy/buddy.js +100 -0
- package/src/commands/buddy/index.js +11 -0
- package/src/commands/chrome/chrome.js +291 -0
- package/src/commands/chrome/index.js +10 -0
- package/src/commands/clear/caches.js +116 -0
- package/src/commands/clear/clear.js +5 -0
- package/src/commands/clear/conversation.js +189 -0
- package/src/commands/clear/index.js +9 -0
- package/src/commands/color/color.js +58 -0
- package/src/commands/color/index.js +9 -0
- package/src/commands/commit-push-pr.js +137 -0
- package/src/commands/commit.js +80 -0
- package/src/commands/compact/compact.js +194 -0
- package/src/commands/compact/index.js +11 -0
- package/src/commands/config/config.js +6 -0
- package/src/commands/config/index.js +8 -0
- package/src/commands/context/context-noninteractive.js +219 -0
- package/src/commands/context/context.js +45 -0
- package/src/commands/context/index.js +21 -0
- package/src/commands/coordinator.js +34 -0
- package/src/commands/copy/copy.js +366 -0
- package/src/commands/copy/index.js +7 -0
- package/src/commands/cost/cost.js +21 -0
- package/src/commands/cost/index.js +16 -0
- package/src/commands/createMovedToPluginCommand.js +33 -0
- package/src/commands/desktop/desktop.js +6 -0
- package/src/commands/desktop/index.js +22 -0
- package/src/commands/diff/diff.js +6 -0
- package/src/commands/diff/index.js +6 -0
- package/src/commands/doctor/doctor.js +6 -0
- package/src/commands/doctor/index.js +9 -0
- package/src/commands/effort/effort.js +166 -0
- package/src/commands/effort/index.js +11 -0
- package/src/commands/exit/exit.js +32 -0
- package/src/commands/exit/index.js +9 -0
- package/src/commands/export/export.js +87 -0
- package/src/commands/export/index.js +8 -0
- package/src/commands/extra-usage/extra-usage-core.js +99 -0
- package/src/commands/extra-usage/extra-usage-noninteractive.js +13 -0
- package/src/commands/extra-usage/extra-usage.js +15 -0
- package/src/commands/extra-usage/index.js +29 -0
- package/src/commands/fast/fast.js +276 -0
- package/src/commands/fast/index.js +19 -0
- package/src/commands/feedback/feedback.js +11 -0
- package/src/commands/feedback/index.js +20 -0
- package/src/commands/files/files.js +11 -0
- package/src/commands/files/index.js +9 -0
- package/src/commands/force-snip.js +19 -0
- package/src/commands/fork/index.js +67 -0
- package/src/commands/heapdump/heapdump.js +14 -0
- package/src/commands/heapdump/index.js +9 -0
- package/src/commands/help/help.js +6 -0
- package/src/commands/help/index.js +7 -0
- package/src/commands/hooks/hooks.js +12 -0
- package/src/commands/hooks/index.js +8 -0
- package/src/commands/ide/ide.js +615 -0
- package/src/commands/ide/index.js +8 -0
- package/src/commands/init-verifiers.js +258 -0
- package/src/commands/init.js +248 -0
- package/src/commands/insights.js +2554 -0
- package/src/commands/install-github-app/ApiKeyStep.js +230 -0
- package/src/commands/install-github-app/CheckExistingSecretStep.js +194 -0
- package/src/commands/install-github-app/CheckGitHubStep.js +16 -0
- package/src/commands/install-github-app/ChooseRepoStep.js +211 -0
- package/src/commands/install-github-app/CreatingStep.js +53 -0
- package/src/commands/install-github-app/ErrorStep.js +84 -0
- package/src/commands/install-github-app/ExistingWorkflowStep.js +105 -0
- package/src/commands/install-github-app/InstallAppStep.js +97 -0
- package/src/commands/install-github-app/OAuthFlowStep.js +190 -0
- package/src/commands/install-github-app/SuccessStep.js +94 -0
- package/src/commands/install-github-app/WarningsStep.js +71 -0
- package/src/commands/install-github-app/index.js +10 -0
- package/src/commands/install-github-app/install-github-app.js +593 -0
- package/src/commands/install-github-app/setupGitHubActions.js +227 -0
- package/src/commands/install-slack-app/index.js +9 -0
- package/src/commands/install-slack-app/install-slack-app.js +25 -0
- package/src/commands/install.js +198 -0
- package/src/commands/keybindings/index.js +10 -0
- package/src/commands/keybindings/keybindings.js +47 -0
- package/src/commands/login/index.js +21 -0
- package/src/commands/login/login.js +135 -0
- package/src/commands/logout/index.js +11 -0
- package/src/commands/logout/logout.js +75 -0
- package/src/commands/mcp/addCommand.js +183 -0
- package/src/commands/mcp/index.js +9 -0
- package/src/commands/mcp/mcp.js +78 -0
- package/src/commands/mcp/xaaIdpCommand.js +193 -0
- package/src/commands/memories/index.js +9 -0
- package/src/commands/memories/index.ts +12 -0
- package/src/commands/memories/memories.tsx +949 -0
- package/src/commands/memory/index.js +7 -0
- package/src/commands/memory/memory.js +71 -0
- package/src/commands/mobile/index.js +9 -0
- package/src/commands/mobile/mobile.js +279 -0
- package/src/commands/model/index.js +14 -0
- package/src/commands/model/model.js +284 -0
- package/src/commands/output-style/index.js +8 -0
- package/src/commands/output-style/output-style.js +6 -0
- package/src/commands/passes/index.js +17 -0
- package/src/commands/passes/passes.js +23 -0
- package/src/commands/peers/index.js +68 -0
- package/src/commands/permissions/index.js +8 -0
- package/src/commands/permissions/permissions.js +9 -0
- package/src/commands/plan/index.js +8 -0
- package/src/commands/plan/plan.js +116 -0
- package/src/commands/plugin/AddMarketplace.js +96 -0
- package/src/commands/plugin/BrowseMarketplace.js +582 -0
- package/src/commands/plugin/DiscoverPlugins.js +613 -0
- package/src/commands/plugin/ManageMarketplaces.js +583 -0
- package/src/commands/plugin/ManagePlugins.js +1783 -0
- package/src/commands/plugin/PluginErrors.js +124 -0
- package/src/commands/plugin/PluginOptionsDialog.js +367 -0
- package/src/commands/plugin/PluginOptionsFlow.js +97 -0
- package/src/commands/plugin/PluginSettings.js +1041 -0
- package/src/commands/plugin/PluginTrustWarning.js +35 -0
- package/src/commands/plugin/UnifiedInstalledCell.js +616 -0
- package/src/commands/plugin/ValidatePlugin.js +96 -0
- package/src/commands/plugin/index.js +10 -0
- package/src/commands/plugin/parseArgs.js +71 -0
- package/src/commands/plugin/plugin.js +6 -0
- package/src/commands/plugin/pluginDetailsHelpers.js +95 -0
- package/src/commands/plugin/usePagination.js +89 -0
- package/src/commands/pr_comments/index.js +49 -0
- package/src/commands/privacy-settings/index.js +11 -0
- package/src/commands/privacy-settings/privacy-settings.js +55 -0
- package/src/commands/proactive.js +29 -0
- package/src/commands/rate-limit-options/index.js +15 -0
- package/src/commands/rate-limit-options/rate-limit-options.js +213 -0
- package/src/commands/release-notes/index.js +8 -0
- package/src/commands/release-notes/release-notes.js +38 -0
- package/src/commands/reload-plugins/index.js +11 -0
- package/src/commands/reload-plugins/reload-plugins.js +52 -0
- package/src/commands/remote-env/index.js +12 -0
- package/src/commands/remote-env/remote-env.js +6 -0
- package/src/commands/remote-setup/api.js +155 -0
- package/src/commands/remote-setup/index.js +15 -0
- package/src/commands/remote-setup/remote-setup.js +150 -0
- package/src/commands/remoteControlServer/index.js +58 -0
- package/src/commands/rename/generateSessionName.js +58 -0
- package/src/commands/rename/index.js +9 -0
- package/src/commands/rename/rename.js +52 -0
- package/src/commands/resume/index.js +9 -0
- package/src/commands/resume/resume.js +239 -0
- package/src/commands/review/UltrareviewOverageDialog.js +97 -0
- package/src/commands/review/reviewRemote.js +259 -0
- package/src/commands/review/ultrareviewCommand.js +58 -0
- package/src/commands/review/ultrareviewEnabled.js +10 -0
- package/src/commands/review.js +53 -0
- package/src/commands/rewind/index.js +10 -0
- package/src/commands/rewind/rewind.js +7 -0
- package/src/commands/sandbox-toggle/index.js +41 -0
- package/src/commands/sandbox-toggle/sandbox-toggle.js +73 -0
- package/src/commands/security-review.js +231 -0
- package/src/commands/session/index.js +13 -0
- package/src/commands/session/session.js +143 -0
- package/src/commands/skills/index.js +7 -0
- package/src/commands/skills/skills.js +6 -0
- package/src/commands/speak.js +21 -0
- package/src/commands/start-business.js +1575 -0
- package/src/commands/start-business.ts +1581 -0
- package/src/commands/stats/index.js +7 -0
- package/src/commands/stats/stats.js +6 -0
- package/src/commands/status/index.js +8 -0
- package/src/commands/status/status.js +6 -0
- package/src/commands/statusline.js +22 -0
- package/src/commands/stickers/index.js +8 -0
- package/src/commands/stickers/stickers.js +14 -0
- package/src/commands/subscribe-pr.js +131 -0
- package/src/commands/tag/index.js +9 -0
- package/src/commands/tag/tag.js +215 -0
- package/src/commands/tasks/index.js +8 -0
- package/src/commands/tasks/tasks.js +6 -0
- package/src/commands/terminalSetup/index.js +18 -0
- package/src/commands/terminalSetup/terminalSetup.js +491 -0
- package/src/commands/thaddeus-usage/index.js +17 -0
- package/src/commands/theme/index.js +7 -0
- package/src/commands/theme/theme.js +51 -0
- package/src/commands/thinkback/index.js +9 -0
- package/src/commands/thinkback/thinkback.js +528 -0
- package/src/commands/thinkback-play/index.js +13 -0
- package/src/commands/thinkback-play/thinkback-play.js +34 -0
- package/src/commands/torch.js +122 -0
- package/src/commands/ultraplan.js +416 -0
- package/src/commands/upgrade/index.js +12 -0
- package/src/commands/upgrade/upgrade.js +38 -0
- package/src/commands/usage/index.js +7 -0
- package/src/commands/usage/usage.js +6 -0
- package/src/commands/version.js +17 -0
- package/src/commands/vim/index.js +8 -0
- package/src/commands/vim/vim.js +25 -0
- package/src/commands/voice/index.js +13 -0
- package/src/commands/voice/voice.js +44 -0
- package/src/commands/workflows/index.js +123 -0
- package/src/commands.js +614 -0
- package/src/commands.ts +4 -0
- package/src/components/AgentProgressLine.js +112 -0
- package/src/components/AntModelSwitchCallout.js +8 -0
- package/src/components/App.js +46 -0
- package/src/components/ApproveApiKey.js +125 -0
- package/src/components/AutoModeOptInDialog.js +140 -0
- package/src/components/AutoUpdater.js +156 -0
- package/src/components/AutoUpdaterWrapper.js +78 -0
- package/src/components/AwsAuthStatusBox.js +88 -0
- package/src/components/BaseTextInput.js +105 -0
- package/src/components/BashModeProgress.js +49 -0
- package/src/components/BridgeDialog.js +415 -0
- package/src/components/BypassPermissionsModeDialog.js +87 -0
- package/src/components/ChannelDowngradeDialog.js +101 -0
- package/src/components/ClaudeInChromeOnboarding.js +126 -0
- package/src/components/ClaudeMdExternalIncludesDialog.js +137 -0
- package/src/components/ClickableImageRef.js +65 -0
- package/src/components/CompactSummary.js +120 -0
- package/src/components/ConfigurableShortcutHint.js +35 -0
- package/src/components/ConsoleOAuthFlow.js +554 -0
- package/src/components/ContextSuggestions.js +44 -0
- package/src/components/ContextVisualization.js +482 -0
- package/src/components/CoordinatorAgentStatus.js +261 -0
- package/src/components/CostThresholdDialog.js +49 -0
- package/src/components/CtrlOToExpand.js +50 -0
- package/src/components/CustomSelect/SelectMulti.js +150 -0
- package/src/components/CustomSelect/index.js +2 -0
- package/src/components/CustomSelect/option-map.js +32 -0
- package/src/components/CustomSelect/select-input-option.js +426 -0
- package/src/components/CustomSelect/select-option.js +24 -0
- package/src/components/CustomSelect/select.js +518 -0
- package/src/components/CustomSelect/use-multi-select-state.js +214 -0
- package/src/components/CustomSelect/use-select-input.js +170 -0
- package/src/components/CustomSelect/use-select-navigation.js +366 -0
- package/src/components/CustomSelect/use-select-state.js +22 -0
- package/src/components/DesktopHandoff.js +195 -0
- package/src/components/DesktopUpsell/DesktopUpsellStartup.js +174 -0
- package/src/components/DevBar.js +51 -0
- package/src/components/DevChannelsDialog.js +104 -0
- package/src/components/DiagnosticsDisplay.js +91 -0
- package/src/components/EffortCallout.js +264 -0
- package/src/components/EffortIndicator.js +28 -0
- package/src/components/ExitFlow.js +41 -0
- package/src/components/ExportDialog.js +101 -0
- package/src/components/FallbackToolUseErrorMessage.js +116 -0
- package/src/components/FallbackToolUseRejectedMessage.js +17 -0
- package/src/components/FastIcon.js +43 -0
- package/src/components/Feedback.js +369 -0
- package/src/components/FeedbackSurvey/FeedbackSurvey.js +151 -0
- package/src/components/FeedbackSurvey/FeedbackSurveyView.js +104 -0
- package/src/components/FeedbackSurvey/TranscriptSharePrompt.js +84 -0
- package/src/components/FeedbackSurvey/submitTranscriptShare.js +10 -0
- package/src/components/FeedbackSurvey/useDebouncedDigitInput.js +51 -0
- package/src/components/FeedbackSurvey/useFeedbackSurvey.js +258 -0
- package/src/components/FeedbackSurvey/useFrustrationDetection.js +8 -0
- package/src/components/FeedbackSurvey/useMemorySurvey.js +191 -0
- package/src/components/FeedbackSurvey/usePostCompactSurvey.js +202 -0
- package/src/components/FeedbackSurvey/useSurveyState.js +80 -0
- package/src/components/FileEditToolDiff.js +167 -0
- package/src/components/FileEditToolUpdatedMessage.js +112 -0
- package/src/components/FileEditToolUseRejectedMessage.js +158 -0
- package/src/components/FilePathLink.js +35 -0
- package/src/components/FullscreenLayout.js +578 -0
- package/src/components/GlobalSearchDialog.js +340 -0
- package/src/components/HelpV2/Commands.js +66 -0
- package/src/components/HelpV2/General.js +25 -0
- package/src/components/HelpV2/HelpV2.js +186 -0
- package/src/components/HighlightedCode/Fallback.js +193 -0
- package/src/components/HighlightedCode.js +185 -0
- package/src/components/HistorySearchDialog.js +93 -0
- package/src/components/IdeAutoConnectDialog.js +154 -0
- package/src/components/IdeOnboardingDialog.js +175 -0
- package/src/components/IdeStatusIndicator.js +50 -0
- package/src/components/IdleReturnDialog.js +117 -0
- package/src/components/InterruptedByUser.js +16 -0
- package/src/components/InvalidConfigDialog.js +135 -0
- package/src/components/InvalidSettingsDialog.js +85 -0
- package/src/components/KeybindingWarnings.js +55 -0
- package/src/components/LanguagePicker.js +84 -0
- package/src/components/LogSelector.js +1579 -0
- package/src/components/LogoV2/AnimatedAsterisk.js +43 -0
- package/src/components/LogoV2/AnimatedClawd.js +64 -0
- package/src/components/LogoV2/ChannelsNotice.js +262 -0
- package/src/components/LogoV2/Clawd.js +33 -0
- package/src/components/LogoV2/CondensedLogo.js +160 -0
- package/src/components/LogoV2/EmergencyTip.js +48 -0
- package/src/components/LogoV2/Feed.js +85 -0
- package/src/components/LogoV2/FeedColumn.js +55 -0
- package/src/components/LogoV2/GuestPassesUpsell.js +71 -0
- package/src/components/LogoV2/LogoV2.js +565 -0
- package/src/components/LogoV2/Opus1mMergeNotice.js +57 -0
- package/src/components/LogoV2/OverageCreditUpsell.js +161 -0
- package/src/components/LogoV2/VoiceModeNotice.js +71 -0
- package/src/components/LogoV2/WelcomeV2.js +14 -0
- package/src/components/LogoV2/feedConfigs.js +79 -0
- package/src/components/LspRecommendation/LspRecommendationMenu.js +46 -0
- package/src/components/MCPServerApprovalDialog.js +114 -0
- package/src/components/MCPServerDesktopImportDialog.js +206 -0
- package/src/components/MCPServerDialogCopy.js +16 -0
- package/src/components/MCPServerMultiselectDialog.js +134 -0
- package/src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js +150 -0
- package/src/components/ManagedSettingsSecurityDialog/utils.js +105 -0
- package/src/components/Markdown.js +233 -0
- package/src/components/MarkdownTable.js +280 -0
- package/src/components/MemoryUsageIndicator.js +28 -0
- package/src/components/Message.js +564 -0
- package/src/components/MessageModel.js +37 -0
- package/src/components/MessageResponse.js +73 -0
- package/src/components/MessageRow.js +346 -0
- package/src/components/MessageSelector.js +744 -0
- package/src/components/MessageTimestamp.js +58 -0
- package/src/components/Messages.js +645 -0
- package/src/components/ModelPicker.js +452 -0
- package/src/components/NativeAutoUpdater.js +152 -0
- package/src/components/NotebookEditToolUseRejectedMessage.js +84 -0
- package/src/components/OffscreenFreeze.js +35 -0
- package/src/components/Onboarding.js +174 -0
- package/src/components/OutputStylePicker.js +103 -0
- package/src/components/PackageManagerAutoUpdater.js +99 -0
- package/src/components/Passes/Passes.js +114 -0
- package/src/components/PrBadge.js +91 -0
- package/src/components/PressEnterToContinue.js +16 -0
- package/src/components/PromptInput/HistorySearchInput.js +45 -0
- package/src/components/PromptInput/IssueFlagBanner.js +8 -0
- package/src/components/PromptInput/Notifications.js +220 -0
- package/src/components/PromptInput/PromptInput.js +2014 -0
- package/src/components/PromptInput/PromptInputFooter.js +85 -0
- package/src/components/PromptInput/PromptInputFooterLeftSide.js +408 -0
- package/src/components/PromptInput/PromptInputFooterSuggestions.js +281 -0
- package/src/components/PromptInput/PromptInputHelpMenu.js +380 -0
- package/src/components/PromptInput/PromptInputModeIndicator.js +73 -0
- package/src/components/PromptInput/PromptInputQueuedCommands.js +105 -0
- package/src/components/PromptInput/PromptInputStashNotice.js +21 -0
- package/src/components/PromptInput/SandboxPromptFooterHint.js +66 -0
- package/src/components/PromptInput/ShimmeredInput.js +133 -0
- package/src/components/PromptInput/VoiceIndicator.js +137 -0
- package/src/components/PromptInput/inputModes.js +24 -0
- package/src/components/PromptInput/inputPaste.js +62 -0
- package/src/components/PromptInput/useMaybeTruncateInput.js +33 -0
- package/src/components/PromptInput/usePromptInputPlaceholder.js +53 -0
- package/src/components/PromptInput/useShowFastIconHint.js +23 -0
- package/src/components/PromptInput/useSwarmBanner.js +112 -0
- package/src/components/PromptInput/utils.js +50 -0
- package/src/components/QuickOpenDialog.js +244 -0
- package/src/components/RemoteCallout.js +53 -0
- package/src/components/RemoteEnvironmentDialog.js +346 -0
- package/src/components/ResumeTask.js +173 -0
- package/src/components/SandboxViolationExpandedView.js +106 -0
- package/src/components/ScrollKeybindingHandler.js +982 -0
- package/src/components/SearchBox.js +56 -0
- package/src/components/SentryErrorBoundary.js +16 -0
- package/src/components/SessionBackgroundHint.js +105 -0
- package/src/components/SessionPreview.js +200 -0
- package/src/components/Settings/Config.js +1626 -0
- package/src/components/Settings/Settings.js +131 -0
- package/src/components/Settings/Status.js +230 -0
- package/src/components/Settings/Usage.js +341 -0
- package/src/components/ShowInIDEPrompt.js +152 -0
- package/src/components/SkillImprovementSurvey.js +130 -0
- package/src/components/Spinner/FlashingChar.js +52 -0
- package/src/components/Spinner/GlimmerMessage.js +329 -0
- package/src/components/Spinner/ShimmerChar.js +23 -0
- package/src/components/Spinner/SpinnerAnimationRow.js +170 -0
- package/src/components/Spinner/SpinnerGlyph.js +70 -0
- package/src/components/Spinner/TeammateSpinnerLine.js +171 -0
- package/src/components/Spinner/TeammateSpinnerTree.js +269 -0
- package/src/components/Spinner/index.js +9 -0
- package/src/components/Spinner/teammateSelectHint.js +1 -0
- package/src/components/Spinner/useShimmerAnimation.js +22 -0
- package/src/components/Spinner/useStalledAnimation.js +63 -0
- package/src/components/Spinner/utils.js +78 -0
- package/src/components/Spinner.js +474 -0
- package/src/components/Stats.js +1000 -0
- package/src/components/StatusLine.js +286 -0
- package/src/components/StatusNotices.js +50 -0
- package/src/components/StructuredDiff/Fallback.js +336 -0
- package/src/components/StructuredDiff/colorDiff.js +37 -0
- package/src/components/StructuredDiff.js +153 -0
- package/src/components/StructuredDiffList.js +9 -0
- package/src/components/TagTabs.js +101 -0
- package/src/components/TaskListV2.js +333 -0
- package/src/components/TeammateViewHeader.js +88 -0
- package/src/components/TeleportError.js +191 -0
- package/src/components/TeleportProgress.js +131 -0
- package/src/components/TeleportRepoMismatchDialog.js +98 -0
- package/src/components/TeleportResumeWrapper.js +158 -0
- package/src/components/TeleportStash.js +82 -0
- package/src/components/TextInput.js +108 -0
- package/src/components/ThaddeusHint/PluginHintMenu.js +37 -0
- package/src/components/ThemePicker.js +331 -0
- package/src/components/ThinkingToggle.js +154 -0
- package/src/components/TokenWarning.js +171 -0
- package/src/components/ToolUseLoader.js +35 -0
- package/src/components/TrustDialog/TrustDialog.js +301 -0
- package/src/components/TrustDialog/utils.js +199 -0
- package/src/components/UndercoverAutoCallout.js +5 -0
- package/src/components/ValidationErrorsList.js +147 -0
- package/src/components/VimTextInput.js +136 -0
- package/src/components/VirtualMessageList.js +893 -0
- package/src/components/WorkflowMultiselectDialog.js +118 -0
- package/src/components/WorktreeExitDialog.js +220 -0
- package/src/components/agents/AgentDetail.js +227 -0
- package/src/components/agents/AgentEditor.js +147 -0
- package/src/components/agents/AgentNavigationFooter.js +22 -0
- package/src/components/agents/AgentsList.js +436 -0
- package/src/components/agents/AgentsMenu.js +849 -0
- package/src/components/agents/ColorPicker.js +110 -0
- package/src/components/agents/ModelSelector.js +63 -0
- package/src/components/agents/SnapshotUpdateDialog.js +14 -0
- package/src/components/agents/ToolSelector.js +557 -0
- package/src/components/agents/agentFileUtils.js +179 -0
- package/src/components/agents/generateAgent.js +161 -0
- package/src/components/agents/new-agent-creation/CreateAgentWizard.js +89 -0
- package/src/components/agents/new-agent-creation/wizard-steps/ColorStep.js +81 -0
- package/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.js +387 -0
- package/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.js +63 -0
- package/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.js +126 -0
- package/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.js +118 -0
- package/src/components/agents/new-agent-creation/wizard-steps/LocationStep.js +80 -0
- package/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.js +108 -0
- package/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +80 -0
- package/src/components/agents/new-agent-creation/wizard-steps/ModelStep.js +49 -0
- package/src/components/agents/new-agent-creation/wizard-steps/PromptStep.js +131 -0
- package/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.js +52 -0
- package/src/components/agents/new-agent-creation/wizard-steps/TypeStep.js +100 -0
- package/src/components/agents/types.js +4 -0
- package/src/components/agents/utils.js +14 -0
- package/src/components/agents/validateAgent.js +79 -0
- package/src/components/design-system/Byline.js +72 -0
- package/src/components/design-system/Dialog.js +117 -0
- package/src/components/design-system/Divider.js +110 -0
- package/src/components/design-system/FuzzyPicker.js +191 -0
- package/src/components/design-system/KeyboardShortcutHint.js +68 -0
- package/src/components/design-system/ListItem.js +184 -0
- package/src/components/design-system/LoadingState.js +69 -0
- package/src/components/design-system/Pane.js +69 -0
- package/src/components/design-system/ProgressBar.js +63 -0
- package/src/components/design-system/Ratchet.js +71 -0
- package/src/components/design-system/StatusIcon.js +70 -0
- package/src/components/design-system/Tabs.js +269 -0
- package/src/components/design-system/ThemeProvider.js +137 -0
- package/src/components/design-system/ThemedBox.js +126 -0
- package/src/components/design-system/ThemedText.js +60 -0
- package/src/components/design-system/color.js +22 -0
- package/src/components/diff/DiffDetailView.js +285 -0
- package/src/components/diff/DiffDialog.js +387 -0
- package/src/components/diff/DiffFileList.js +292 -0
- package/src/components/grove/Grove.js +483 -0
- package/src/components/hooks/HooksConfigMenu.js +583 -0
- package/src/components/hooks/PromptDialog.js +82 -0
- package/src/components/hooks/SelectEventMode.js +118 -0
- package/src/components/hooks/SelectHookMode.js +101 -0
- package/src/components/hooks/SelectMatcherMode.js +131 -0
- package/src/components/hooks/ViewHookMode.js +204 -0
- package/src/components/mcp/CapabilitiesSection.js +56 -0
- package/src/components/mcp/ElicitationDialog.js +945 -0
- package/src/components/mcp/MCPAgentServerMenu.js +95 -0
- package/src/components/mcp/MCPListPanel.js +505 -0
- package/src/components/mcp/MCPReconnect.js +168 -0
- package/src/components/mcp/MCPRemoteServerMenu.js +460 -0
- package/src/components/mcp/MCPSettings.js +414 -0
- package/src/components/mcp/MCPStdioServerMenu.js +95 -0
- package/src/components/mcp/MCPToolDetailView.js +219 -0
- package/src/components/mcp/MCPToolListView.js +137 -0
- package/src/components/mcp/McpParsingWarnings.js +212 -0
- package/src/components/mcp/index.js +8 -0
- package/src/components/mcp/utils/reconnectHelpers.js +35 -0
- package/src/components/memory/MemoryFileSelector.js +454 -0
- package/src/components/memory/MemoryUpdateNotification.js +43 -0
- package/src/components/messageActions.js +418 -0
- package/src/components/messages/AdvisorMessage.js +152 -0
- package/src/components/messages/AssistantRedactedThinkingMessage.js +28 -0
- package/src/components/messages/AssistantTextMessage.js +287 -0
- package/src/components/messages/AssistantThinkingMessage.js +70 -0
- package/src/components/messages/AssistantToolUseMessage.js +324 -0
- package/src/components/messages/AttachmentMessage.js +418 -0
- package/src/components/messages/CollapsedReadSearchContent.js +363 -0
- package/src/components/messages/CompactBoundaryMessage.js +19 -0
- package/src/components/messages/GroupedToolUseContent.js +37 -0
- package/src/components/messages/HighlightedThinkingText.js +165 -0
- package/src/components/messages/HookProgressMessage.js +111 -0
- package/src/components/messages/PlanApprovalMessage.js +213 -0
- package/src/components/messages/RateLimitMessage.js +149 -0
- package/src/components/messages/ShutdownMessage.js +124 -0
- package/src/components/messages/SnipBoundaryMessage.js +7 -0
- package/src/components/messages/SystemAPIErrorMessage.js +136 -0
- package/src/components/messages/SystemTextMessage.js +842 -0
- package/src/components/messages/TaskAssignmentMessage.js +72 -0
- package/src/components/messages/UserAgentNotificationMessage.js +78 -0
- package/src/components/messages/UserBashInputMessage.js +52 -0
- package/src/components/messages/UserBashOutputMessage.js +55 -0
- package/src/components/messages/UserChannelMessage.js +130 -0
- package/src/components/messages/UserCommandMessage.js +107 -0
- package/src/components/messages/UserCrossSessionMessage.js +11 -0
- package/src/components/messages/UserForkBoilerplateMessage.js +11 -0
- package/src/components/messages/UserGitHubWebhookMessage.js +12 -0
- package/src/components/messages/UserImageMessage.js +54 -0
- package/src/components/messages/UserLocalCommandOutputMessage.js +170 -0
- package/src/components/messages/UserMemoryInputMessage.js +73 -0
- package/src/components/messages/UserPlanMessage.js +38 -0
- package/src/components/messages/UserPromptMessage.js +63 -0
- package/src/components/messages/UserResourceUpdateMessage.js +102 -0
- package/src/components/messages/UserTeammateMessage.js +156 -0
- package/src/components/messages/UserTextMessage.js +270 -0
- package/src/components/messages/UserToolResultMessage/RejectedPlanMessage.js +28 -0
- package/src/components/messages/UserToolResultMessage/RejectedToolUseMessage.js +17 -0
- package/src/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +17 -0
- package/src/components/messages/UserToolResultMessage/UserToolErrorMessage.js +92 -0
- package/src/components/messages/UserToolResultMessage/UserToolRejectMessage.js +74 -0
- package/src/components/messages/UserToolResultMessage/UserToolResultMessage.js +84 -0
- package/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +58 -0
- package/src/components/messages/UserToolResultMessage/utils.js +43 -0
- package/src/components/messages/nullRenderingAttachments.js +58 -0
- package/src/components/messages/teamMemCollapsed.js +142 -0
- package/src/components/messages/teamMemSaved.js +16 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +659 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.js +219 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.js +227 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.js +175 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.js +444 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.js +137 -0
- package/src/components/permissions/AskUserQuestionPermissionRequest/use-multiple-choice-state.js +100 -0
- package/src/components/permissions/BashPermissionRequest/BashPermissionRequest.js +404 -0
- package/src/components/permissions/BashPermissionRequest/bashToolUseOptions.js +110 -0
- package/src/components/permissions/ComputerUseApproval/ComputerUseApproval.js +449 -0
- package/src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.js +126 -0
- package/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.js +653 -0
- package/src/components/permissions/FallbackPermissionRequest.js +349 -0
- package/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +185 -0
- package/src/components/permissions/FilePermissionDialog/FilePermissionDialog.js +108 -0
- package/src/components/permissions/FilePermissionDialog/ideDiffConfig.js +13 -0
- package/src/components/permissions/FilePermissionDialog/permissionOptions.js +137 -0
- package/src/components/permissions/FilePermissionDialog/useFilePermissionDialog.js +131 -0
- package/src/components/permissions/FilePermissionDialog/usePermissionHandler.js +86 -0
- package/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +164 -0
- package/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +79 -0
- package/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +113 -0
- package/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.js +7 -0
- package/src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.js +164 -0
- package/src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.js +218 -0
- package/src/components/permissions/PermissionDecisionDebugInfo.js +467 -0
- package/src/components/permissions/PermissionDialog.js +55 -0
- package/src/components/permissions/PermissionExplanation.js +269 -0
- package/src/components/permissions/PermissionPrompt.js +316 -0
- package/src/components/permissions/PermissionRequest.js +159 -0
- package/src/components/permissions/PermissionRequestTitle.js +58 -0
- package/src/components/permissions/PermissionRuleExplanation.js +110 -0
- package/src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.js +178 -0
- package/src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.js +73 -0
- package/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.js +7 -0
- package/src/components/permissions/SandboxPermissionRequest.js +162 -0
- package/src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.js +228 -0
- package/src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.js +385 -0
- package/src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.js +259 -0
- package/src/components/permissions/WorkerBadge.js +44 -0
- package/src/components/permissions/WorkerPendingPermission.js +107 -0
- package/src/components/permissions/hooks.js +163 -0
- package/src/components/permissions/rules/AddPermissionRules.js +171 -0
- package/src/components/permissions/rules/AddWorkspaceDirectory.js +335 -0
- package/src/components/permissions/rules/PermissionRuleDescription.js +78 -0
- package/src/components/permissions/rules/PermissionRuleInput.js +136 -0
- package/src/components/permissions/rules/PermissionRuleList.js +1190 -0
- package/src/components/permissions/rules/RecentDenialsTab.js +205 -0
- package/src/components/permissions/rules/RemoveWorkspaceDirectory.js +103 -0
- package/src/components/permissions/rules/WorkspaceTab.js +133 -0
- package/src/components/permissions/shellPermissionHelpers.js +112 -0
- package/src/components/permissions/useShellPermissionFeedback.js +108 -0
- package/src/components/permissions/utils.js +14 -0
- package/src/components/sandbox/SandboxConfigTab.js +48 -0
- package/src/components/sandbox/SandboxDependenciesTab.js +123 -0
- package/src/components/sandbox/SandboxDoctorSection.js +47 -0
- package/src/components/sandbox/SandboxOverridesTab.js +193 -0
- package/src/components/sandbox/SandboxSettings.js +297 -0
- package/src/components/shell/ExpandShellOutputContext.js +33 -0
- package/src/components/shell/OutputLine.js +110 -0
- package/src/components/shell/ShellProgressMessage.js +144 -0
- package/src/components/shell/ShellTimeDisplay.js +72 -0
- package/src/components/skills/SkillsMenu.js +239 -0
- package/src/components/tasks/AsyncAgentDetailDialog.js +235 -0
- package/src/components/tasks/BackgroundTask.js +364 -0
- package/src/components/tasks/BackgroundTaskStatus.js +419 -0
- package/src/components/tasks/BackgroundTasksDialog.js +494 -0
- package/src/components/tasks/DreamDetailDialog.js +251 -0
- package/src/components/tasks/InProcessTeammateDetailDialog.js +275 -0
- package/src/components/tasks/MonitorMcpDetailDialog.js +7 -0
- package/src/components/tasks/RemoteSessionDetailDialog.js +868 -0
- package/src/components/tasks/RemoteSessionProgress.js +249 -0
- package/src/components/tasks/ShellDetailDialog.js +403 -0
- package/src/components/tasks/ShellProgress.js +77 -0
- package/src/components/tasks/WorkflowDetailDialog.js +7 -0
- package/src/components/tasks/renderToolActivity.js +29 -0
- package/src/components/tasks/taskStatusUtils.js +94 -0
- package/src/components/teams/TeamStatus.js +77 -0
- package/src/components/teams/TeamsDialog.js +673 -0
- package/src/components/ui/OrderedList.js +66 -0
- package/src/components/ui/OrderedListItem.js +41 -0
- package/src/components/ui/TreeSelect.js +300 -0
- package/src/components/wizard/WizardDialogLayout.js +48 -0
- package/src/components/wizard/WizardNavigationFooter.js +11 -0
- package/src/components/wizard/WizardProvider.js +217 -0
- package/src/components/wizard/index.js +4 -0
- package/src/components/wizard/useWizard.js +9 -0
- package/src/constants/apiLimits.js +81 -0
- package/src/constants/betas.js +45 -0
- package/src/constants/common.js +29 -0
- package/src/constants/cyberRiskInstruction.js +23 -0
- package/src/constants/errorIds.js +14 -0
- package/src/constants/figures.js +38 -0
- package/src/constants/files.js +150 -0
- package/src/constants/github-app.js +139 -0
- package/src/constants/identity.js +112 -0
- package/src/constants/keys.js +10 -0
- package/src/constants/messages.js +1 -0
- package/src/constants/oauth.js +175 -0
- package/src/constants/outputStyles.js +162 -0
- package/src/constants/product.js +54 -0
- package/src/constants/prompts.js +994 -0
- package/src/constants/spinnerVerbs.js +98 -0
- package/src/constants/system.js +77 -0
- package/src/constants/systemPromptSections.js +39 -0
- package/src/constants/toolLimits.js +50 -0
- package/src/constants/tools.js +103 -0
- package/src/constants/turnCompletionVerbs.js +12 -0
- package/src/constants/xml.js +73 -0
- package/src/context/QueuedMessageContext.js +51 -0
- package/src/context/fpsMetrics.js +22 -0
- package/src/context/mailbox.js +35 -0
- package/src/context/modalContext.js +34 -0
- package/src/context/notifications.js +199 -0
- package/src/context/overlayContext.js +149 -0
- package/src/context/promptOverlayContext.js +118 -0
- package/src/context/stats.js +207 -0
- package/src/context/voice.js +74 -0
- package/src/context.js +146 -0
- package/src/coordinator/coordinatorMode.js +345 -0
- package/src/coordinator/workerAgent.js +24 -0
- package/src/cost-tracker.js +208 -0
- package/src/costHook.js +17 -0
- package/src/daemon/main.js +19 -0
- package/src/dialogLaunchers.js +77 -0
- package/src/entrypoints/agentSdkTypes.js +202 -0
- package/src/entrypoints/cli.js +226 -0
- package/src/entrypoints/init.js +265 -0
- package/src/entrypoints/mcp.js +141 -0
- package/src/entrypoints/sandboxTypes.js +112 -0
- package/src/entrypoints/sdk/controlSchemas.js +452 -0
- package/src/entrypoints/sdk/controlTypes.js +1 -0
- package/src/entrypoints/sdk/coreSchemas.js +1331 -0
- package/src/entrypoints/sdk/coreTypes.generated.js +3 -0
- package/src/entrypoints/sdk/coreTypes.js +49 -0
- package/src/entrypoints/sdk/runtimeTypes.js +1 -0
- package/src/entrypoints/sdk/sdkUtilityTypes.js +1 -0
- package/src/entrypoints/sdk/settingsTypes.generated.js +1 -0
- package/src/entrypoints/sdk/toolTypes.js +1 -0
- package/src/environment-runner/main.js +8 -0
- package/src/history.js +386 -0
- package/src/hooks/fileSuggestions.js +635 -0
- package/src/hooks/notifs/useAntOrgWarningNotification.js +5 -0
- package/src/hooks/notifs/useAutoModeUnavailableNotification.js +47 -0
- package/src/hooks/notifs/useCanSwitchToExistingSubscription.js +58 -0
- package/src/hooks/notifs/useDeprecationWarningNotification.js +43 -0
- package/src/hooks/notifs/useFastModeNotification.js +164 -0
- package/src/hooks/notifs/useIDEStatusIndicator.js +174 -0
- package/src/hooks/notifs/useInstallMessages.js +27 -0
- package/src/hooks/notifs/useLspInitializationNotification.js +144 -0
- package/src/hooks/notifs/useMcpConnectivityStatus.js +81 -0
- package/src/hooks/notifs/useModelMigrationNotifications.js +53 -0
- package/src/hooks/notifs/useNpmDeprecationNotification.js +25 -0
- package/src/hooks/notifs/usePluginAutoupdateNotification.js +83 -0
- package/src/hooks/notifs/usePluginInstallationStatus.js +128 -0
- package/src/hooks/notifs/useRateLimitWarningNotification.js +119 -0
- package/src/hooks/notifs/useSettingsErrors.js +64 -0
- package/src/hooks/notifs/useStartupNotification.js +33 -0
- package/src/hooks/notifs/useTeammateShutdownNotification.js +64 -0
- package/src/hooks/renderPlaceholder.js +26 -0
- package/src/hooks/toolPermission/PermissionContext.js +211 -0
- package/src/hooks/toolPermission/handlers/coordinatorHandler.js +44 -0
- package/src/hooks/toolPermission/handlers/interactiveHandler.js +397 -0
- package/src/hooks/toolPermission/handlers/swarmWorkerHandler.js +108 -0
- package/src/hooks/toolPermission/permissionLogging.js +145 -0
- package/src/hooks/unifiedSuggestions.js +130 -0
- package/src/hooks/useAfterFirstRender.js +12 -0
- package/src/hooks/useApiKeyVerification.js +63 -0
- package/src/hooks/useArrowKeyHistory.js +203 -0
- package/src/hooks/useAssistantHistory.js +193 -0
- package/src/hooks/useAwaySummary.js +105 -0
- package/src/hooks/useBackgroundTaskNavigation.js +204 -0
- package/src/hooks/useBlink.js +28 -0
- package/src/hooks/useCanUseTool.js +193 -0
- package/src/hooks/useCancelRequest.js +195 -0
- package/src/hooks/useChromeExtensionNotification.js +50 -0
- package/src/hooks/useClipboardImageHint.js +59 -0
- package/src/hooks/useCommandKeybindings.js +87 -0
- package/src/hooks/useCommandQueue.js +10 -0
- package/src/hooks/useCopyOnSelect.js +88 -0
- package/src/hooks/useDeferredHookMessages.js +43 -0
- package/src/hooks/useDiffData.js +69 -0
- package/src/hooks/useDiffInIDE.js +252 -0
- package/src/hooks/useDirectConnect.js +150 -0
- package/src/hooks/useDoublePress.js +44 -0
- package/src/hooks/useDynamicConfig.js +17 -0
- package/src/hooks/useElapsedTime.js +25 -0
- package/src/hooks/useExitOnCtrlCD.js +57 -0
- package/src/hooks/useExitOnCtrlCDWithKeybindings.js +17 -0
- package/src/hooks/useFileHistorySnapshotInit.js +14 -0
- package/src/hooks/useGlobalKeybindings.js +213 -0
- package/src/hooks/useHistorySearch.js +241 -0
- package/src/hooks/useIDEIntegration.js +56 -0
- package/src/hooks/useIdeAtMentioned.js +51 -0
- package/src/hooks/useIdeConnectionStatus.js +21 -0
- package/src/hooks/useIdeLogging.js +29 -0
- package/src/hooks/useIdeSelection.js +106 -0
- package/src/hooks/useInboxPoller.js +709 -0
- package/src/hooks/useInputBuffer.js +73 -0
- package/src/hooks/useIssueFlagBanner.js +115 -0
- package/src/hooks/useLogMessages.js +98 -0
- package/src/hooks/useLspPluginRecommendation.js +176 -0
- package/src/hooks/useMailboxBridge.js +15 -0
- package/src/hooks/useMainLoopModel.js +25 -0
- package/src/hooks/useManagePlugins.js +261 -0
- package/src/hooks/useMemoryUsage.js +28 -0
- package/src/hooks/useMergedClients.js +11 -0
- package/src/hooks/useMergedCommands.js +10 -0
- package/src/hooks/useMergedTools.js +32 -0
- package/src/hooks/useMinDisplayTime.js +26 -0
- package/src/hooks/useNotifyAfterTimeout.js +51 -0
- package/src/hooks/useOfficialMarketplaceNotification.js +47 -0
- package/src/hooks/usePasteHandler.js +195 -0
- package/src/hooks/usePluginRecommendationBase.js +101 -0
- package/src/hooks/usePrStatus.js +91 -0
- package/src/hooks/usePromptSuggestion.js +128 -0
- package/src/hooks/usePromptsFromClaudeInChrome.js +66 -0
- package/src/hooks/useQueueProcessor.js +46 -0
- package/src/hooks/useRemoteSession.js +431 -0
- package/src/hooks/useReplBridge.js +715 -0
- package/src/hooks/useSSHSession.js +167 -0
- package/src/hooks/useScheduledTasks.js +104 -0
- package/src/hooks/useSearchInput.js +302 -0
- package/src/hooks/useSessionBackgrounding.js +132 -0
- package/src/hooks/useSettings.js +10 -0
- package/src/hooks/useSettingsChange.js +13 -0
- package/src/hooks/useSkillImprovementSurvey.js +69 -0
- package/src/hooks/useSkillsChange.js +51 -0
- package/src/hooks/useSwarmInitialization.js +67 -0
- package/src/hooks/useSwarmPermissionPoller.js +215 -0
- package/src/hooks/useTaskListWatcher.js +157 -0
- package/src/hooks/useTasksV2.js +220 -0
- package/src/hooks/useTeammateViewAutoExit.js +55 -0
- package/src/hooks/useTeleportResume.js +81 -0
- package/src/hooks/useTerminalSize.js +9 -0
- package/src/hooks/useTextInput.js +397 -0
- package/src/hooks/useThaddeusHintRecommendation.js +117 -0
- package/src/hooks/useTimeout.js +10 -0
- package/src/hooks/useTurnDiffs.js +160 -0
- package/src/hooks/useTypeahead.js +1250 -0
- package/src/hooks/useUpdateNotification.js +21 -0
- package/src/hooks/useVimInput.js +232 -0
- package/src/hooks/useVirtualScroll.js +627 -0
- package/src/hooks/useVoice.js +952 -0
- package/src/hooks/useVoiceEnabled.js +21 -0
- package/src/hooks/useVoiceIntegration.js +629 -0
- package/src/infrastructure/audit.js +210 -0
- package/src/infrastructure/guardrails.js +513 -0
- package/src/infrastructure/index.js +11 -0
- package/src/ink/Ansi.js +269 -0
- package/src/ink/bidi.js +117 -0
- package/src/ink/clearTerminal.js +58 -0
- package/src/ink/colorize.js +198 -0
- package/src/ink/components/AlternateScreen.js +74 -0
- package/src/ink/components/App.js +562 -0
- package/src/ink/components/AppContext.js +11 -0
- package/src/ink/components/Box.js +155 -0
- package/src/ink/components/Button.js +166 -0
- package/src/ink/components/ClockContext.js +108 -0
- package/src/ink/components/CursorDeclarationContext.js +3 -0
- package/src/ink/components/ErrorOverview.js +50 -0
- package/src/ink/components/Link.js +34 -0
- package/src/ink/components/Newline.js +30 -0
- package/src/ink/components/NoSelect.js +57 -0
- package/src/ink/components/RawAnsi.js +46 -0
- package/src/ink/components/ScrollBox.js +171 -0
- package/src/ink/components/Spacer.js +20 -0
- package/src/ink/components/StdinContext.js +16 -0
- package/src/ink/components/TerminalFocusContext.js +45 -0
- package/src/ink/components/TerminalSizeContext.js +3 -0
- package/src/ink/components/Text.js +195 -0
- package/src/ink/constants.js +2 -0
- package/src/ink/dom.js +298 -0
- package/src/ink/events/click-event.js +36 -0
- package/src/ink/events/dispatcher.js +172 -0
- package/src/ink/events/emitter.js +31 -0
- package/src/ink/events/event-handlers.js +30 -0
- package/src/ink/events/event.js +9 -0
- package/src/ink/events/focus-event.js +16 -0
- package/src/ink/events/input-event.js +161 -0
- package/src/ink/events/keyboard-event.js +46 -0
- package/src/ink/events/terminal-event.js +78 -0
- package/src/ink/events/terminal-focus-event.js +15 -0
- package/src/ink/focus.js +158 -0
- package/src/ink/frame.js +30 -0
- package/src/ink/get-max-width.js +23 -0
- package/src/ink/hit-test.js +113 -0
- package/src/ink/hooks/use-animation-frame.js +48 -0
- package/src/ink/hooks/use-app.js +7 -0
- package/src/ink/hooks/use-declared-cursor.js +60 -0
- package/src/ink/hooks/use-input.js +70 -0
- package/src/ink/hooks/use-interval.js +54 -0
- package/src/ink/hooks/use-search-highlight.js +32 -0
- package/src/ink/hooks/use-selection.js +60 -0
- package/src/ink/hooks/use-stdin.js +7 -0
- package/src/ink/hooks/use-tab-status.js +57 -0
- package/src/ink/hooks/use-terminal-focus.js +15 -0
- package/src/ink/hooks/use-terminal-title.js +29 -0
- package/src/ink/hooks/use-terminal-viewport.js +77 -0
- package/src/ink/ink.js +1645 -0
- package/src/ink/instances.js +7 -0
- package/src/ink/layout/engine.js +4 -0
- package/src/ink/layout/geometry.js +61 -0
- package/src/ink/layout/node.js +62 -0
- package/src/ink/layout/yoga.js +237 -0
- package/src/ink/line-width-cache.js +19 -0
- package/src/ink/log-update.js +583 -0
- package/src/ink/measure-element.js +8 -0
- package/src/ink/measure-text.js +35 -0
- package/src/ink/node-cache.js +30 -0
- package/src/ink/optimizer.js +81 -0
- package/src/ink/output.js +556 -0
- package/src/ink/parse-keypress.js +695 -0
- package/src/ink/reconciler.js +384 -0
- package/src/ink/render-border.js +134 -0
- package/src/ink/render-node-to-output.js +1216 -0
- package/src/ink/render-to-screen.js +171 -0
- package/src/ink/renderer.js +129 -0
- package/src/ink/root.js +80 -0
- package/src/ink/screen.js +1132 -0
- package/src/ink/searchHighlight.js +78 -0
- package/src/ink/selection.js +792 -0
- package/src/ink/squash-text-nodes.js +56 -0
- package/src/ink/stringWidth.js +200 -0
- package/src/ink/styles.js +299 -0
- package/src/ink/supports-hyperlinks.js +40 -0
- package/src/ink/tabstops.js +39 -0
- package/src/ink/terminal-focus-state.js +35 -0
- package/src/ink/terminal-querier.js +173 -0
- package/src/ink/terminal.js +208 -0
- package/src/ink/termio/ansi.js +70 -0
- package/src/ink/termio/csi.js +260 -0
- package/src/ink/termio/dec.js +53 -0
- package/src/ink/termio/esc.js +55 -0
- package/src/ink/termio/osc.js +432 -0
- package/src/ink/termio/parser.js +356 -0
- package/src/ink/termio/sgr.js +292 -0
- package/src/ink/termio/tokenize.js +264 -0
- package/src/ink/termio/types.js +55 -0
- package/src/ink/termio.js +24 -0
- package/src/ink/useTerminalNotification.js +57 -0
- package/src/ink/warn.js +10 -0
- package/src/ink/widest-line.js +14 -0
- package/src/ink/wrap-text.js +54 -0
- package/src/ink/wrapAnsi.js +6 -0
- package/src/ink.js +50 -0
- package/src/integrations/credentialStore.js +176 -0
- package/src/integrations/index.js +5 -0
- package/src/integrations/integrationManager.js +180 -0
- package/src/integrations/providers/BaseProvider.js +180 -0
- package/src/integrations/providers/GitHubProvider.js +217 -0
- package/src/integrations/providers/GmailProvider.js +204 -0
- package/src/integrations/providers/GoogleCalendarProvider.js +113 -0
- package/src/integrations/providers/HubSpotProvider.js +159 -0
- package/src/integrations/providers/JiraProvider.js +216 -0
- package/src/integrations/providers/NotionProvider.js +221 -0
- package/src/integrations/providers/QuickBooksProvider.js +176 -0
- package/src/integrations/providers/SlackProvider.js +174 -0
- package/src/integrations/providers/StripeProvider.js +206 -0
- package/src/integrations/providers/TwilioProvider.js +239 -0
- package/src/integrations/providers/_template.js +112 -0
- package/src/integrations/types.js +7 -0
- package/src/interactiveHelpers.js +308 -0
- package/src/jobs/classifier.js +6 -0
- package/src/keybindings/KeybindingContext.js +184 -0
- package/src/keybindings/KeybindingProviderSetup.js +259 -0
- package/src/keybindings/defaultBindings.js +333 -0
- package/src/keybindings/loadUserBindings.js +393 -0
- package/src/keybindings/match.js +111 -0
- package/src/keybindings/parser.js +184 -0
- package/src/keybindings/reservedShortcuts.js +109 -0
- package/src/keybindings/resolver.js +182 -0
- package/src/keybindings/schema.js +205 -0
- package/src/keybindings/shortcutFormat.js +48 -0
- package/src/keybindings/template.js +40 -0
- package/src/keybindings/useKeybinding.js +161 -0
- package/src/keybindings/useShortcutDisplay.js +43 -0
- package/src/keybindings/validate.js +395 -0
- package/src/main.js +4128 -0
- package/src/memdir/findRelevantMemories.js +99 -0
- package/src/memdir/memdir.js +406 -0
- package/src/memdir/memoryAge.js +52 -0
- package/src/memdir/memoryScan.js +65 -0
- package/src/memdir/memoryShapeTelemetry.js +8 -0
- package/src/memdir/memoryTypes.js +260 -0
- package/src/memdir/paths.js +235 -0
- package/src/memdir/teamMemPaths.js +261 -0
- package/src/memdir/teamMemPrompts.js +82 -0
- package/src/migrations/migrateAutoUpdatesToSettings.js +47 -0
- package/src/migrations/migrateBypassPermissionsAcceptedToSettings.js +32 -0
- package/src/migrations/migrateEnableAllProjectMcpServersToSettings.js +83 -0
- package/src/migrations/migrateFennecToOpus.js +39 -0
- package/src/migrations/migrateLegacyOpusToCurrent.js +44 -0
- package/src/migrations/migrateOpusToOpus1m.js +31 -0
- package/src/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.js +23 -0
- package/src/migrations/migrateSonnet1mToSonnet45.js +38 -0
- package/src/migrations/migrateSonnet45ToSonnet46.js +48 -0
- package/src/migrations/resetAutoModeOptInForDefaultOffer.js +47 -0
- package/src/migrations/resetProToOpusDefault.js +46 -0
- package/src/moreright/useMoreRight.js +13 -0
- package/src/native-ts/color-diff/index.js +819 -0
- package/src/native-ts/file-index/index.js +328 -0
- package/src/native-ts/yoga-layout/enums.js +101 -0
- package/src/native-ts/yoga-layout/index.js +2113 -0
- package/src/outputStyles/loadOutputStylesDir.js +71 -0
- package/src/plugins/builtinPlugins.js +132 -0
- package/src/plugins/bundled/index.js +22 -0
- package/src/proactive/index.js +138 -0
- package/src/proactive/useProactive.js +82 -0
- package/src/projectOnboardingState.js +61 -0
- package/src/query/config.js +17 -0
- package/src/query/deps.js +12 -0
- package/src/query/stopHooks.js +332 -0
- package/src/query/tokenBudget.js +49 -0
- package/src/query.js +1264 -0
- package/src/remote/RemoteSessionManager.js +172 -0
- package/src/remote/SessionsWebSocket.js +308 -0
- package/src/remote/remotePermissionBridge.js +70 -0
- package/src/remote/sdkMessageAdapter.js +227 -0
- package/src/replLauncher.js +7 -0
- package/src/schemas/hooks.js +174 -0
- package/src/screens/Doctor.js +580 -0
- package/src/screens/REPL.js +4500 -0
- package/src/screens/ResumeConversation.js +339 -0
- package/src/self-hosted-runner/main.js +8 -0
- package/src/server/backends/dangerousBackend.js +8 -0
- package/src/server/connectHeadless.js +6 -0
- package/src/server/createDirectConnectSession.js +62 -0
- package/src/server/directConnectManager.js +153 -0
- package/src/server/lockfile.js +11 -0
- package/src/server/parseConnectUrl.js +20 -0
- package/src/server/server.js +12 -0
- package/src/server/serverBanner.js +9 -0
- package/src/server/serverLog.js +11 -0
- package/src/server/sessionManager.js +19 -0
- package/src/server/types.js +7 -0
- package/src/services/AgentSummary/agentSummary.js +147 -0
- package/src/services/MagicDocs/magicDocs.js +193 -0
- package/src/services/MagicDocs/prompts.js +110 -0
- package/src/services/PromptSuggestion/promptSuggestion.js +402 -0
- package/src/services/PromptSuggestion/speculation.js +643 -0
- package/src/services/SessionMemory/prompts.js +254 -0
- package/src/services/SessionMemory/sessionMemory.js +358 -0
- package/src/services/SessionMemory/sessionMemoryUtils.js +157 -0
- package/src/services/analytics/config.js +27 -0
- package/src/services/analytics/datadog.js +26 -0
- package/src/services/analytics/firstPartyEventLogger.js +65 -0
- package/src/services/analytics/firstPartyEventLoggingExporter.js +595 -0
- package/src/services/analytics/growthbook.js +103 -0
- package/src/services/analytics/index.js +91 -0
- package/src/services/analytics/metadata.js +696 -0
- package/src/services/analytics/sink.js +19 -0
- package/src/services/analytics/sinkKillswitch.js +19 -0
- package/src/services/api/adminRequests.js +57 -0
- package/src/services/api/bootstrap.js +118 -0
- package/src/services/api/claude.js +2466 -0
- package/src/services/api/client.js +335 -0
- package/src/services/api/dumpPrompts.js +174 -0
- package/src/services/api/emptyUsage.js +20 -0
- package/src/services/api/errorUtils.js +203 -0
- package/src/services/api/errors.js +926 -0
- package/src/services/api/filesApi.js +523 -0
- package/src/services/api/firstTokenDate.js +49 -0
- package/src/services/api/grove.js +44 -0
- package/src/services/api/logging.js +484 -0
- package/src/services/api/metricsOptOut.js +15 -0
- package/src/services/api/overageCreditGrant.js +123 -0
- package/src/services/api/promptCacheBreakDetection.js +510 -0
- package/src/services/api/referral.js +219 -0
- package/src/services/api/sessionIngress.js +358 -0
- package/src/services/api/ultrareviewQuota.js +29 -0
- package/src/services/api/usage.js +31 -0
- package/src/services/api/withRetry.js +587 -0
- package/src/services/api/xai/anthropic-shim.js +885 -0
- package/src/services/api/xai/brightDataSearch.js +161 -0
- package/src/services/api/xai/thaddeus-engine.js +605 -0
- package/src/services/api/xai/xai-client.js +276 -0
- package/src/services/autoDream/autoDream.js +244 -0
- package/src/services/autoDream/config.js +17 -0
- package/src/services/autoDream/consolidationLock.js +122 -0
- package/src/services/autoDream/consolidationPrompt.js +55 -0
- package/src/services/awaySummary.js +61 -0
- package/src/services/claudeAiLimits.js +331 -0
- package/src/services/claudeAiLimitsHook.js +15 -0
- package/src/services/compact/apiMicrocompact.js +97 -0
- package/src/services/compact/autoCompact.js +234 -0
- package/src/services/compact/cachedMCConfig.js +5 -0
- package/src/services/compact/compact.js +1256 -0
- package/src/services/compact/compactWarningHook.js +12 -0
- package/src/services/compact/compactWarningState.js +15 -0
- package/src/services/compact/grouping.js +58 -0
- package/src/services/compact/microCompact.js +414 -0
- package/src/services/compact/postCompactCleanup.js +70 -0
- package/src/services/compact/prompt.js +325 -0
- package/src/services/compact/reactiveCompact.js +20 -0
- package/src/services/compact/sessionMemoryCompact.js +467 -0
- package/src/services/compact/snipCompact.js +23 -0
- package/src/services/compact/snipProjection.js +11 -0
- package/src/services/compact/timeBasedMCConfig.js +11 -0
- package/src/services/contextCollapse/index.js +33 -0
- package/src/services/contextCollapse/operations.js +5 -0
- package/src/services/contextCollapse/persist.js +5 -0
- package/src/services/diagnosticTracking.js +282 -0
- package/src/services/elevenlabsTTS.js +245 -0
- package/src/services/extractMemories/extractMemories.js +442 -0
- package/src/services/extractMemories/prompts.js +129 -0
- package/src/services/internalLogging.js +68 -0
- package/src/services/lsp/LSPClient.js +306 -0
- package/src/services/lsp/LSPDiagnosticRegistry.js +277 -0
- package/src/services/lsp/LSPServerInstance.js +388 -0
- package/src/services/lsp/LSPServerManager.js +305 -0
- package/src/services/lsp/config.js +57 -0
- package/src/services/lsp/manager.js +246 -0
- package/src/services/lsp/passiveFeedback.js +226 -0
- package/src/services/mcp/InProcessTransport.js +54 -0
- package/src/services/mcp/MCPConnectionManager.js +50 -0
- package/src/services/mcp/SdkControlTransport.js +115 -0
- package/src/services/mcp/auth.js +1882 -0
- package/src/services/mcp/channelAllowlist.js +57 -0
- package/src/services/mcp/channelNotification.js +235 -0
- package/src/services/mcp/channelPermissions.js +192 -0
- package/src/services/mcp/claudeai.js +123 -0
- package/src/services/mcp/client.js +2478 -0
- package/src/services/mcp/config.js +1271 -0
- package/src/services/mcp/elicitationHandler.js +192 -0
- package/src/services/mcp/envExpansion.js +30 -0
- package/src/services/mcp/headersHelper.js +93 -0
- package/src/services/mcp/mcpStringUtils.js +85 -0
- package/src/services/mcp/normalization.js +21 -0
- package/src/services/mcp/oauthPort.js +69 -0
- package/src/services/mcp/officialRegistry.js +20 -0
- package/src/services/mcp/types.js +94 -0
- package/src/services/mcp/useManageMCPConnections.js +818 -0
- package/src/services/mcp/utils.js +433 -0
- package/src/services/mcp/vscodeSdkMcp.js +69 -0
- package/src/services/mcp/xaa.js +342 -0
- package/src/services/mcp/xaaIdpLogin.js +377 -0
- package/src/services/mcpServerApproval.js +30 -0
- package/src/services/mockRateLimits.js +666 -0
- package/src/services/notifier.js +114 -0
- package/src/services/oauth/auth-code-listener.js +165 -0
- package/src/services/oauth/client.js +397 -0
- package/src/services/oauth/crypto.js +19 -0
- package/src/services/oauth/getOauthProfile.js +48 -0
- package/src/services/oauth/index.js +133 -0
- package/src/services/plugins/PluginInstallationManager.js +139 -0
- package/src/services/plugins/pluginCliCommands.js +230 -0
- package/src/services/plugins/pluginOperations.js +826 -0
- package/src/services/policyLimits/index.js +547 -0
- package/src/services/policyLimits/types.js +9 -0
- package/src/services/preventSleep.js +143 -0
- package/src/services/rateLimitMessages.js +271 -0
- package/src/services/rateLimitMocking.js +91 -0
- package/src/services/remoteManagedSettings/index.js +534 -0
- package/src/services/remoteManagedSettings/securityCheck.js +60 -0
- package/src/services/remoteManagedSettings/syncCache.js +90 -0
- package/src/services/remoteManagedSettings/syncCacheState.js +89 -0
- package/src/services/remoteManagedSettings/types.js +12 -0
- package/src/services/sessionTranscript/sessionTranscript.js +5 -0
- package/src/services/settingsSync/index.js +478 -0
- package/src/services/settingsSync/types.js +35 -0
- package/src/services/skillSearch/featureCheck.js +8 -0
- package/src/services/skillSearch/localSearch.js +5 -0
- package/src/services/skillSearch/prefetch.js +8 -0
- package/src/services/skillSearch/remoteSkillLoader.js +8 -0
- package/src/services/skillSearch/remoteSkillState.js +11 -0
- package/src/services/skillSearch/signals.js +3 -0
- package/src/services/skillSearch/telemetry.js +8 -0
- package/src/services/teamMemorySync/index.js +976 -0
- package/src/services/teamMemorySync/secretScanner.js +275 -0
- package/src/services/teamMemorySync/teamMemSecretGuard.js +33 -0
- package/src/services/teamMemorySync/types.js +47 -0
- package/src/services/teamMemorySync/watcher.js +326 -0
- package/src/services/thaddeusAuth.js +485 -0
- package/src/services/thaddeusAuthTypes.js +9 -0
- package/src/services/thaddeusLoginFlow.js +236 -0
- package/src/services/tips/tipHistory.js +17 -0
- package/src/services/tips/tipRegistry.js +593 -0
- package/src/services/tips/tipScheduler.js +40 -0
- package/src/services/tokenEstimation.js +365 -0
- package/src/services/toolUseSummary/toolUseSummaryGenerator.js +87 -0
- package/src/services/tools/StreamingToolExecutor.js +413 -0
- package/src/services/tools/toolExecution.js +1309 -0
- package/src/services/tools/toolHooks.js +454 -0
- package/src/services/tools/toolOrchestration.js +110 -0
- package/src/services/vcr.js +291 -0
- package/src/services/voice.js +392 -0
- package/src/services/voiceKeyterms.js +94 -0
- package/src/services/voiceStreamSTT.js +405 -0
- package/src/setup.js +310 -0
- package/src/skills/bundled/batch.js +114 -0
- package/src/skills/bundled/claudeApi.js +145 -0
- package/src/skills/bundled/claudeApiContent.js +71 -0
- package/src/skills/bundled/claudeInChrome.js +27 -0
- package/src/skills/bundled/debug.js +99 -0
- package/src/skills/bundled/dream.js +49 -0
- package/src/skills/bundled/emailSetup.js +196 -0
- package/src/skills/bundled/hunter.js +28 -0
- package/src/skills/bundled/index.js +80 -0
- package/src/skills/bundled/keybindings.js +292 -0
- package/src/skills/bundled/loop.js +81 -0
- package/src/skills/bundled/loremIpsum.js +264 -0
- package/src/skills/bundled/reactor.js +31 -0
- package/src/skills/bundled/remember.js +73 -0
- package/src/skills/bundled/runSkillGenerator.js +12 -0
- package/src/skills/bundled/scheduleRemoteAgents.js +373 -0
- package/src/skills/bundled/simplify.js +66 -0
- package/src/skills/bundled/skillify.js +182 -0
- package/src/skills/bundled/stuck.js +69 -0
- package/src/skills/bundled/updateConfig.js +463 -0
- package/src/skills/bundled/verify.js +23 -0
- package/src/skills/bundled/verifyContent.js +10 -0
- package/src/skills/bundledSkills.js +159 -0
- package/src/skills/loadSkillsDir.js +736 -0
- package/src/skills/mcpSkillBuilders.js +10 -0
- package/src/skills/mcpSkills.js +5 -0
- package/src/state/AppState.js +182 -0
- package/src/state/AppStateStore.js +117 -0
- package/src/state/onChangeAppState.js +132 -0
- package/src/state/selectors.js +51 -0
- package/src/state/store.js +21 -0
- package/src/state/teammateViewHelpers.js +124 -0
- package/src/stubs/ant-chrome-mcp/index.js +4 -0
- package/src/stubs/ant-computer-use-input/index.js +2 -0
- package/src/stubs/ant-computer-use-mcp/index.js +7 -0
- package/src/stubs/ant-computer-use-mcp/sentinelApps.js +2 -0
- package/src/stubs/ant-computer-use-mcp/types.js +3 -0
- package/src/stubs/ant-computer-use-swift/index.js +1 -0
- package/src/stubs/anthropic-sandbox/index.js +34 -0
- package/src/tasks/DreamTask/DreamTask.js +99 -0
- package/src/tasks/InProcessTeammateTask/InProcessTeammateTask.js +116 -0
- package/src/tasks/InProcessTeammateTask/types.js +35 -0
- package/src/tasks/LocalAgentTask/LocalAgentTask.js +507 -0
- package/src/tasks/LocalMainSessionTask.js +338 -0
- package/src/tasks/LocalShellTask/LocalShellTask.js +475 -0
- package/src/tasks/LocalShellTask/guards.js +9 -0
- package/src/tasks/LocalShellTask/killShellTasks.js +59 -0
- package/src/tasks/LocalWorkflowTask/LocalWorkflowTask.js +7 -0
- package/src/tasks/MonitorMcpTask/MonitorMcpTask.js +20 -0
- package/src/tasks/RemoteAgentTask/RemoteAgentTask.js +742 -0
- package/src/tasks/pillLabel.js +69 -0
- package/src/tasks/stopTask.js +67 -0
- package/src/tasks/types.js +18 -0
- package/src/tasks.js +37 -0
- package/src/tools/AIEmployeesTool/AIEmployeesTool.js +674 -0
- package/src/tools/AIEmployeesTool/constants.js +1 -0
- package/src/tools/AIEmployeesTool/prompt.js +56 -0
- package/src/tools/AgentTool/AgentTool.js +1221 -0
- package/src/tools/AgentTool/UI.js +593 -0
- package/src/tools/AgentTool/agentColorManager.js +43 -0
- package/src/tools/AgentTool/agentDisplay.js +72 -0
- package/src/tools/AgentTool/agentMemory.js +125 -0
- package/src/tools/AgentTool/agentMemorySnapshot.js +136 -0
- package/src/tools/AgentTool/agentToolUtils.js +456 -0
- package/src/tools/AgentTool/built-in/exploreAgent.js +76 -0
- package/src/tools/AgentTool/built-in/generalPurposeAgent.js +28 -0
- package/src/tools/AgentTool/built-in/planAgent.js +87 -0
- package/src/tools/AgentTool/built-in/statuslineSetup.js +140 -0
- package/src/tools/AgentTool/built-in/thaddeusGuideAgent.js +174 -0
- package/src/tools/AgentTool/built-in/verificationAgent.js +146 -0
- package/src/tools/AgentTool/builtInAgents.js +56 -0
- package/src/tools/AgentTool/constants.js +11 -0
- package/src/tools/AgentTool/forkSubagent.js +177 -0
- package/src/tools/AgentTool/loadAgentsDir.js +497 -0
- package/src/tools/AgentTool/prompt.js +260 -0
- package/src/tools/AgentTool/resumeAgent.js +182 -0
- package/src/tools/AgentTool/runAgent.js +627 -0
- package/src/tools/AppointmentsTool/AppointmentsTool.js +628 -0
- package/src/tools/AppointmentsTool/constants.js +1 -0
- package/src/tools/AppointmentsTool/prompt.js +15 -0
- package/src/tools/AskUserQuestionTool/AskUserQuestionTool.js +238 -0
- package/src/tools/AskUserQuestionTool/prompt.js +38 -0
- package/src/tools/BashTool/BashTool.js +1009 -0
- package/src/tools/BashTool/BashToolResultMessage.js +169 -0
- package/src/tools/BashTool/UI.js +134 -0
- package/src/tools/BashTool/bashCommandHelpers.js +184 -0
- package/src/tools/BashTool/bashPermissions.js +2023 -0
- package/src/tools/BashTool/bashSecurity.js +2267 -0
- package/src/tools/BashTool/commandSemantics.js +105 -0
- package/src/tools/BashTool/commentLabel.js +14 -0
- package/src/tools/BashTool/destructiveCommandWarning.js +88 -0
- package/src/tools/BashTool/modeValidation.js +86 -0
- package/src/tools/BashTool/pathValidation.js +1079 -0
- package/src/tools/BashTool/prompt.js +333 -0
- package/src/tools/BashTool/readOnlyValidation.js +1794 -0
- package/src/tools/BashTool/sedEditParser.js +282 -0
- package/src/tools/BashTool/sedValidation.js +580 -0
- package/src/tools/BashTool/shouldUseSandbox.js +125 -0
- package/src/tools/BashTool/toolName.js +2 -0
- package/src/tools/BashTool/utils.js +180 -0
- package/src/tools/BriefTool/BriefTool.js +173 -0
- package/src/tools/BriefTool/UI.js +67 -0
- package/src/tools/BriefTool/attachments.js +86 -0
- package/src/tools/BriefTool/prompt.js +19 -0
- package/src/tools/BriefTool/upload.js +136 -0
- package/src/tools/CalendarTool/CalendarTool.js +498 -0
- package/src/tools/CalendarTool/constants.js +1 -0
- package/src/tools/CalendarTool/prompt.js +11 -0
- package/src/tools/ConfigTool/ConfigTool.js +398 -0
- package/src/tools/ConfigTool/UI.js +25 -0
- package/src/tools/ConfigTool/constants.js +1 -0
- package/src/tools/ConfigTool/prompt.js +82 -0
- package/src/tools/ConfigTool/supportedSettings.js +180 -0
- package/src/tools/ContactsTool/ContactsTool.js +648 -0
- package/src/tools/ContactsTool/constants.js +1 -0
- package/src/tools/ContactsTool/prompt.js +15 -0
- package/src/tools/CtxInspectTool/CtxInspectTool.js +44 -0
- package/src/tools/DiscoverSkillsTool/prompt.js +4 -0
- package/src/tools/EmailReadTool/index.js +410 -0
- package/src/tools/EmailSendTool/index.js +178 -0
- package/src/tools/EnterPlanModeTool/EnterPlanModeTool.js +98 -0
- package/src/tools/EnterPlanModeTool/UI.js +14 -0
- package/src/tools/EnterPlanModeTool/constants.js +1 -0
- package/src/tools/EnterPlanModeTool/prompt.js +164 -0
- package/src/tools/EnterWorktreeTool/EnterWorktreeTool.js +104 -0
- package/src/tools/EnterWorktreeTool/UI.js +9 -0
- package/src/tools/EnterWorktreeTool/constants.js +1 -0
- package/src/tools/EnterWorktreeTool/prompt.js +30 -0
- package/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.js +383 -0
- package/src/tools/ExitPlanModeTool/UI.js +32 -0
- package/src/tools/ExitPlanModeTool/constants.js +2 -0
- package/src/tools/ExitPlanModeTool/prompt.js +27 -0
- package/src/tools/ExitWorktreeTool/ExitWorktreeTool.js +257 -0
- package/src/tools/ExitWorktreeTool/UI.js +10 -0
- package/src/tools/ExitWorktreeTool/constants.js +1 -0
- package/src/tools/ExitWorktreeTool/prompt.js +32 -0
- package/src/tools/FileEditTool/FileEditTool.js +480 -0
- package/src/tools/FileEditTool/UI.js +202 -0
- package/src/tools/FileEditTool/constants.js +7 -0
- package/src/tools/FileEditTool/prompt.js +24 -0
- package/src/tools/FileEditTool/types.js +50 -0
- package/src/tools/FileEditTool/utils.js +579 -0
- package/src/tools/FileReadTool/FileReadTool.js +889 -0
- package/src/tools/FileReadTool/UI.js +126 -0
- package/src/tools/FileReadTool/imageProcessor.js +46 -0
- package/src/tools/FileReadTool/limits.js +70 -0
- package/src/tools/FileReadTool/prompt.js +31 -0
- package/src/tools/FileWriteTool/FileWriteTool.js +341 -0
- package/src/tools/FileWriteTool/UI.js +339 -0
- package/src/tools/FileWriteTool/prompt.js +15 -0
- package/src/tools/GlobTool/GlobTool.js +161 -0
- package/src/tools/GlobTool/UI.js +40 -0
- package/src/tools/GlobTool/prompt.js +6 -0
- package/src/tools/GrepTool/GrepTool.js +439 -0
- package/src/tools/GrepTool/UI.js +155 -0
- package/src/tools/GrepTool/prompt.js +16 -0
- package/src/tools/IntegrationsTool/IntegrationsTool.js +217 -0
- package/src/tools/IntegrationsTool/constants.js +1 -0
- package/src/tools/IntegrationsTool/prompt.js +41 -0
- package/src/tools/InteractionsTool/InteractionsTool.js +525 -0
- package/src/tools/InteractionsTool/constants.js +1 -0
- package/src/tools/InteractionsTool/prompt.js +14 -0
- package/src/tools/InvoicesTool/InvoicesTool.js +581 -0
- package/src/tools/InvoicesTool/constants.js +1 -0
- package/src/tools/InvoicesTool/prompt.js +15 -0
- package/src/tools/LSPTool/LSPTool.js +660 -0
- package/src/tools/LSPTool/UI.js +205 -0
- package/src/tools/LSPTool/formatters.js +445 -0
- package/src/tools/LSPTool/prompt.js +20 -0
- package/src/tools/LSPTool/schemas.js +197 -0
- package/src/tools/LSPTool/symbolContext.js +75 -0
- package/src/tools/LeadScorerTool/LeadScorerTool.js +509 -0
- package/src/tools/LeadScorerTool/constants.js +1 -0
- package/src/tools/LeadScorerTool/prompt.js +11 -0
- package/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +100 -0
- package/src/tools/ListMcpResourcesTool/UI.js +17 -0
- package/src/tools/ListMcpResourcesTool/prompt.js +18 -0
- package/src/tools/ListPeersTool/ListPeersTool.js +45 -0
- package/src/tools/MCPTool/MCPTool.js +60 -0
- package/src/tools/MCPTool/UI.js +343 -0
- package/src/tools/MCPTool/classifyForCollapse.js +597 -0
- package/src/tools/MCPTool/prompt.js +3 -0
- package/src/tools/McpAuthTool/McpAuthTool.js +162 -0
- package/src/tools/MonitorTool/MonitorTool.js +55 -0
- package/src/tools/NotebookEditTool/NotebookEditTool.js +421 -0
- package/src/tools/NotebookEditTool/UI.js +41 -0
- package/src/tools/NotebookEditTool/constants.js +2 -0
- package/src/tools/NotebookEditTool/prompt.js +2 -0
- package/src/tools/OverflowTestTool/OverflowTestTool.js +51 -0
- package/src/tools/PhoneBridgeTool/PhoneBridgeTool.js +301 -0
- package/src/tools/PhoneBridgeTool/constants.js +1 -0
- package/src/tools/PhoneBridgeTool/prompt.js +26 -0
- package/src/tools/PowerShellTool/PowerShellTool.js +900 -0
- package/src/tools/PowerShellTool/UI.js +58 -0
- package/src/tools/PowerShellTool/clmTypes.js +207 -0
- package/src/tools/PowerShellTool/commandSemantics.js +115 -0
- package/src/tools/PowerShellTool/commonParameters.js +27 -0
- package/src/tools/PowerShellTool/destructiveCommandWarning.js +92 -0
- package/src/tools/PowerShellTool/gitSafety.js +185 -0
- package/src/tools/PowerShellTool/modeValidation.js +357 -0
- package/src/tools/PowerShellTool/pathValidation.js +1712 -0
- package/src/tools/PowerShellTool/powershellPermissions.js +1351 -0
- package/src/tools/PowerShellTool/powershellSecurity.js +942 -0
- package/src/tools/PowerShellTool/prompt.js +132 -0
- package/src/tools/PowerShellTool/readOnlyValidation.js +1633 -0
- package/src/tools/PowerShellTool/toolName.js +2 -0
- package/src/tools/PushNotificationTool/PushNotificationTool.js +35 -0
- package/src/tools/REPLTool/REPLTool.js +44 -0
- package/src/tools/REPLTool/constants.js +43 -0
- package/src/tools/REPLTool/primitiveTools.js +36 -0
- package/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +112 -0
- package/src/tools/ReadMcpResourceTool/UI.js +24 -0
- package/src/tools/ReadMcpResourceTool/prompt.js +15 -0
- package/src/tools/RemoteTriggerTool/RemoteTriggerTool.js +142 -0
- package/src/tools/RemoteTriggerTool/UI.js +12 -0
- package/src/tools/RemoteTriggerTool/prompt.js +12 -0
- package/src/tools/ReviewArtifactTool/ReviewArtifactTool.js +51 -0
- package/src/tools/ScheduleCronTool/CronCreateTool.js +120 -0
- package/src/tools/ScheduleCronTool/CronDeleteTool.js +74 -0
- package/src/tools/ScheduleCronTool/CronListTool.js +77 -0
- package/src/tools/ScheduleCronTool/UI.js +29 -0
- package/src/tools/ScheduleCronTool/prompt.js +115 -0
- package/src/tools/SendMessageTool/SendMessageTool.js +673 -0
- package/src/tools/SendMessageTool/UI.js +24 -0
- package/src/tools/SendMessageTool/constants.js +1 -0
- package/src/tools/SendMessageTool/prompt.js +47 -0
- package/src/tools/SendUserFileTool/SendUserFileTool.js +35 -0
- package/src/tools/SendUserFileTool/prompt.js +5 -0
- package/src/tools/SkillTool/SkillTool.js +825 -0
- package/src/tools/SkillTool/UI.js +61 -0
- package/src/tools/SkillTool/constants.js +1 -0
- package/src/tools/SkillTool/prompt.js +184 -0
- package/src/tools/SleepTool/SleepTool.js +42 -0
- package/src/tools/SleepTool/prompt.js +14 -0
- package/src/tools/SnipTool/SnipTool.js +47 -0
- package/src/tools/SnipTool/prompt.js +5 -0
- package/src/tools/SubscribePRTool/SubscribePRTool.js +49 -0
- package/src/tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.js +44 -0
- package/src/tools/SyntheticOutputTool/SyntheticOutputTool.js +138 -0
- package/src/tools/SyntheticOutputTool/SyntheticOutputTool.ts +1 -1
- package/src/tools/TaskCreateTool/TaskCreateTool.js +104 -0
- package/src/tools/TaskCreateTool/constants.js +1 -0
- package/src/tools/TaskCreateTool/prompt.js +52 -0
- package/src/tools/TaskGetTool/TaskGetTool.js +106 -0
- package/src/tools/TaskGetTool/constants.js +1 -0
- package/src/tools/TaskGetTool/prompt.js +23 -0
- package/src/tools/TaskListTool/TaskListTool.js +89 -0
- package/src/tools/TaskListTool/constants.js +1 -0
- package/src/tools/TaskListTool/prompt.js +44 -0
- package/src/tools/TaskOutputTool/TaskOutputTool.js +536 -0
- package/src/tools/TaskOutputTool/constants.js +1 -0
- package/src/tools/TaskStopTool/TaskStopTool.js +110 -0
- package/src/tools/TaskStopTool/UI.js +31 -0
- package/src/tools/TaskStopTool/prompt.js +7 -0
- package/src/tools/TaskUpdateTool/TaskUpdateTool.js +301 -0
- package/src/tools/TaskUpdateTool/constants.js +1 -0
- package/src/tools/TaskUpdateTool/prompt.js +76 -0
- package/src/tools/TeamCreateTool/TeamCreateTool.js +177 -0
- package/src/tools/TeamCreateTool/UI.js +4 -0
- package/src/tools/TeamCreateTool/constants.js +1 -0
- package/src/tools/TeamCreateTool/prompt.js +113 -0
- package/src/tools/TeamDeleteTool/TeamDeleteTool.js +102 -0
- package/src/tools/TeamDeleteTool/UI.js +13 -0
- package/src/tools/TeamDeleteTool/constants.js +1 -0
- package/src/tools/TeamDeleteTool/prompt.js +16 -0
- package/src/tools/TerminalCaptureTool/TerminalCaptureTool.js +47 -0
- package/src/tools/TerminalCaptureTool/prompt.js +11 -0
- package/src/tools/TodoWriteTool/TodoWriteTool.js +99 -0
- package/src/tools/TodoWriteTool/constants.js +1 -0
- package/src/tools/TodoWriteTool/prompt.js +181 -0
- package/src/tools/ToolSearchTool/ToolSearchTool.js +357 -0
- package/src/tools/ToolSearchTool/constants.js +1 -0
- package/src/tools/ToolSearchTool/prompt.js +97 -0
- package/src/tools/TungstenTool/TungstenLiveMonitor.js +7 -0
- package/src/tools/TungstenTool/TungstenTool.js +3 -0
- package/src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.js +45 -0
- package/src/tools/VerifyPlanExecutionTool/constants.js +2 -0
- package/src/tools/WebBrowserTool/WebBrowserPanel.js +5 -0
- package/src/tools/WebBrowserTool/WebBrowserTool.js +58 -0
- package/src/tools/WebFetchTool/UI.js +31 -0
- package/src/tools/WebFetchTool/WebFetchTool.js +246 -0
- package/src/tools/WebFetchTool/preapproved.js +154 -0
- package/src/tools/WebFetchTool/prompt.js +39 -0
- package/src/tools/WebFetchTool/utils.js +368 -0
- package/src/tools/WebSearchTool/UI.js +67 -0
- package/src/tools/WebSearchTool/WebSearchTool.js +396 -0
- package/src/tools/WebSearchTool/prompt.js +32 -0
- package/src/tools/WorkflowTool/WorkflowPermissionRequest.js +7 -0
- package/src/tools/WorkflowTool/WorkflowTool.js +51 -0
- package/src/tools/WorkflowTool/bundled/index.js +5 -0
- package/src/tools/WorkflowTool/constants.js +1 -0
- package/src/tools/WorkflowTool/createWorkflowCommand.js +5 -0
- package/src/tools/shared/gitOperationTracking.js +220 -0
- package/src/tools/shared/spawnMultiAgent.js +805 -0
- package/src/tools/testing/TestingPermissionTool.js +72 -0
- package/src/tools/utils.js +24 -0
- package/src/tools.js +365 -0
- package/src/types/command.js +8 -0
- package/src/types/connectorText.js +3 -0
- package/src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.js +673 -0
- package/src/types/generated/events_mono/common/v1/auth.js +49 -0
- package/src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.js +147 -0
- package/src/types/generated/google/protobuf/timestamp.js +38 -0
- package/src/types/hooks.js +153 -0
- package/src/types/ids.js +27 -0
- package/src/types/logs.js +11 -0
- package/src/types/permissions.js +25 -0
- package/src/types/plugin.js +72 -0
- package/src/types/textInputTypes.js +20 -0
- package/src/upstreamproxy/relay.js +346 -0
- package/src/upstreamproxy/upstreamproxy.js +234 -0
- package/src/utils/CircularBuffer.js +75 -0
- package/src/utils/Cursor.js +1229 -0
- package/src/utils/QueryGuard.js +115 -0
- package/src/utils/Shell.js +374 -0
- package/src/utils/ShellCommand.js +336 -0
- package/src/utils/abortController.js +74 -0
- package/src/utils/activityManager.js +127 -0
- package/src/utils/advisor.js +77 -0
- package/src/utils/agentContext.js +91 -0
- package/src/utils/agentId.js +83 -0
- package/src/utils/agentSwarmsEnabled.js +37 -0
- package/src/utils/agenticSessionSearch.js +255 -0
- package/src/utils/analyzeContext.js +846 -0
- package/src/utils/ansiToPng.js +259 -0
- package/src/utils/ansiToSvg.js +207 -0
- package/src/utils/api.js +555 -0
- package/src/utils/apiPreconnect.js +62 -0
- package/src/utils/appleTerminalBackup.js +95 -0
- package/src/utils/argumentSubstitution.js +114 -0
- package/src/utils/array.js +12 -0
- package/src/utils/asciicast.js +200 -0
- package/src/utils/attachments.js +2518 -0
- package/src/utils/attribution.js +308 -0
- package/src/utils/auth.js +1598 -0
- package/src/utils/authFileDescriptor.js +152 -0
- package/src/utils/authPortable.js +14 -0
- package/src/utils/autoModeDenials.js +15 -0
- package/src/utils/autoRunIssue.js +113 -0
- package/src/utils/autoUpdater.js +457 -0
- package/src/utils/aws.js +44 -0
- package/src/utils/awsAuthStatusManager.js +66 -0
- package/src/utils/background/remote/preconditions.js +175 -0
- package/src/utils/background/remote/remoteSession.js +53 -0
- package/src/utils/backgroundHousekeeping.js +64 -0
- package/src/utils/bash/ParsedCommand.js +241 -0
- package/src/utils/bash/ShellSnapshot.js +489 -0
- package/src/utils/bash/ast.js +2590 -0
- package/src/utils/bash/bashParser.js +4355 -0
- package/src/utils/bash/bashPipeCommand.js +249 -0
- package/src/utils/bash/commands.js +1131 -0
- package/src/utils/bash/heredoc.js +647 -0
- package/src/utils/bash/parser.js +195 -0
- package/src/utils/bash/prefix.js +154 -0
- package/src/utils/bash/registry.js +23 -0
- package/src/utils/bash/shellCompletion.js +196 -0
- package/src/utils/bash/shellPrefix.js +25 -0
- package/src/utils/bash/shellQuote.js +253 -0
- package/src/utils/bash/shellQuoting.js +106 -0
- package/src/utils/bash/specs/alias.js +11 -0
- package/src/utils/bash/specs/index.js +16 -0
- package/src/utils/bash/specs/nohup.js +10 -0
- package/src/utils/bash/specs/pyright.js +88 -0
- package/src/utils/bash/specs/sleep.js +10 -0
- package/src/utils/bash/specs/srun.js +28 -0
- package/src/utils/bash/specs/time.js +10 -0
- package/src/utils/bash/specs/timeout.js +17 -0
- package/src/utils/bash/treeSitterAnalysis.js +407 -0
- package/src/utils/betas.js +331 -0
- package/src/utils/billing.js +54 -0
- package/src/utils/binaryCheck.js +40 -0
- package/src/utils/browser.js +58 -0
- package/src/utils/bufferedWriter.js +77 -0
- package/src/utils/bundledMode.js +19 -0
- package/src/utils/businessDb.js +390 -0
- package/src/utils/caCerts.js +91 -0
- package/src/utils/caCertsConfig.js +77 -0
- package/src/utils/cachePaths.js +28 -0
- package/src/utils/classifierApprovals.js +66 -0
- package/src/utils/classifierApprovalsHook.js +10 -0
- package/src/utils/claudeDesktop.js +108 -0
- package/src/utils/claudeInChrome/chromeNativeHost.js +416 -0
- package/src/utils/claudeInChrome/common.js +466 -0
- package/src/utils/claudeInChrome/mcpServer.js +237 -0
- package/src/utils/claudeInChrome/prompt.js +79 -0
- package/src/utils/claudeInChrome/setup.js +304 -0
- package/src/utils/claudeInChrome/setupPortable.js +172 -0
- package/src/utils/claudeInChrome/toolRendering.js +235 -0
- package/src/utils/claudemd.js +1052 -0
- package/src/utils/cleanup.js +514 -0
- package/src/utils/cleanupRegistry.js +22 -0
- package/src/utils/cliArgs.js +53 -0
- package/src/utils/cliHighlight.js +45 -0
- package/src/utils/codeIndexing.js +149 -0
- package/src/utils/collapseBackgroundBashNotifications.js +70 -0
- package/src/utils/collapseHookSummaries.js +48 -0
- package/src/utils/collapseReadSearch.js +869 -0
- package/src/utils/collapseTeammateShutdowns.js +44 -0
- package/src/utils/combinedAbortSignal.js +40 -0
- package/src/utils/commandLifecycle.js +7 -0
- package/src/utils/commitAttribution.js +718 -0
- package/src/utils/completionCache.js +138 -0
- package/src/utils/computerUse/appNames.js +170 -0
- package/src/utils/computerUse/cleanup.js +65 -0
- package/src/utils/computerUse/common.js +56 -0
- package/src/utils/computerUse/computerUseLock.js +183 -0
- package/src/utils/computerUse/drainRunLoop.js +71 -0
- package/src/utils/computerUse/escHotkey.js +53 -0
- package/src/utils/computerUse/executor.js +480 -0
- package/src/utils/computerUse/gates.js +55 -0
- package/src/utils/computerUse/hostAdapter.js +62 -0
- package/src/utils/computerUse/inputLoader.js +25 -0
- package/src/utils/computerUse/mcpServer.js +84 -0
- package/src/utils/computerUse/setup.js +42 -0
- package/src/utils/computerUse/swiftLoader.js +18 -0
- package/src/utils/computerUse/toolRendering.js +101 -0
- package/src/utils/computerUse/wrapper.js +317 -0
- package/src/utils/concurrentSessions.js +179 -0
- package/src/utils/config.js +1078 -0
- package/src/utils/configConstants.js +18 -0
- package/src/utils/contentArray.js +45 -0
- package/src/utils/context.js +185 -0
- package/src/utils/contextAnalysis.js +171 -0
- package/src/utils/contextSuggestions.js +158 -0
- package/src/utils/controlMessageCompat.js +31 -0
- package/src/utils/conversationRecovery.js +434 -0
- package/src/utils/cron.js +260 -0
- package/src/utils/cronJitterConfig.js +62 -0
- package/src/utils/cronScheduler.js +388 -0
- package/src/utils/cronTasks.js +328 -0
- package/src/utils/cronTasksLock.js +159 -0
- package/src/utils/crossProjectResume.js +46 -0
- package/src/utils/crypto.js +13 -0
- package/src/utils/cwd.js +29 -0
- package/src/utils/debug.js +220 -0
- package/src/utils/debugFilter.js +125 -0
- package/src/utils/deepLink/banner.js +103 -0
- package/src/utils/deepLink/parseDeepLink.js +138 -0
- package/src/utils/deepLink/protocolHandler.js +119 -0
- package/src/utils/deepLink/registerProtocol.js +291 -0
- package/src/utils/deepLink/terminalLauncher.js +455 -0
- package/src/utils/deepLink/terminalPreference.js +51 -0
- package/src/utils/desktopDeepLink.js +208 -0
- package/src/utils/detectRepository.js +157 -0
- package/src/utils/diagLogs.js +74 -0
- package/src/utils/diff.js +108 -0
- package/src/utils/directMemberMessage.js +34 -0
- package/src/utils/displayTags.js +46 -0
- package/src/utils/doctorContextWarnings.js +179 -0
- package/src/utils/doctorDiagnostic.js +494 -0
- package/src/utils/dxt/helpers.js +64 -0
- package/src/utils/dxt/zip.js +167 -0
- package/src/utils/earlyInput.js +166 -0
- package/src/utils/editor.js +163 -0
- package/src/utils/effort.js +271 -0
- package/src/utils/embeddedTools.js +26 -0
- package/src/utils/employeeChat.js +271 -0
- package/src/utils/employeeDb.js +326 -0
- package/src/utils/env.js +358 -0
- package/src/utils/envDynamic.js +130 -0
- package/src/utils/envUtils.js +161 -0
- package/src/utils/envValidation.js +26 -0
- package/src/utils/errorLogSink.js +196 -0
- package/src/utils/errors.js +207 -0
- package/src/utils/exampleCommands.js +165 -0
- package/src/utils/execFileNoThrow.js +93 -0
- package/src/utils/execFileNoThrowPortable.js +49 -0
- package/src/utils/execSyncWrapper.js +6 -0
- package/src/utils/exportRenderer.js +71 -0
- package/src/utils/extraUsage.js +19 -0
- package/src/utils/fastMode.js +393 -0
- package/src/utils/file.js +467 -0
- package/src/utils/fileHistory.js +851 -0
- package/src/utils/fileOperationAnalytics.js +45 -0
- package/src/utils/filePersistence/filePersistence.js +212 -0
- package/src/utils/filePersistence/outputsScanner.js +104 -0
- package/src/utils/filePersistence/types.js +4 -0
- package/src/utils/fileRead.js +81 -0
- package/src/utils/fileReadCache.js +78 -0
- package/src/utils/fileStateCache.js +99 -0
- package/src/utils/findExecutable.js +13 -0
- package/src/utils/fingerprint.js +58 -0
- package/src/utils/forkedAgent.js +410 -0
- package/src/utils/format.js +238 -0
- package/src/utils/formatBriefTimestamp.js +72 -0
- package/src/utils/fpsTracker.js +34 -0
- package/src/utils/frontmatterParser.js +260 -0
- package/src/utils/fsOperations.js +555 -0
- package/src/utils/fullscreen.js +194 -0
- package/src/utils/generatedFiles.js +122 -0
- package/src/utils/generators.js +67 -0
- package/src/utils/genericProcessUtils.js +155 -0
- package/src/utils/getWorktreePaths.js +56 -0
- package/src/utils/getWorktreePathsPortable.js +23 -0
- package/src/utils/ghPrStatus.js +71 -0
- package/src/utils/git/gitConfigParser.js +226 -0
- package/src/utils/git/gitFilesystem.js +606 -0
- package/src/utils/git/gitignore.js +84 -0
- package/src/utils/git.js +725 -0
- package/src/utils/gitDiff.js +395 -0
- package/src/utils/gitSettings.js +18 -0
- package/src/utils/github/ghAuthStatus.js +23 -0
- package/src/utils/githubRepoPathMapping.js +135 -0
- package/src/utils/glob.js +90 -0
- package/src/utils/gracefulShutdown.js +447 -0
- package/src/utils/groupToolUses.js +126 -0
- package/src/utils/handlePromptSubmit.js +398 -0
- package/src/utils/hash.js +44 -0
- package/src/utils/headlessProfiler.js +147 -0
- package/src/utils/heapDumpService.js +201 -0
- package/src/utils/heatmap.js +151 -0
- package/src/utils/highlightMatch.js +29 -0
- package/src/utils/hooks/AsyncHookRegistry.js +187 -0
- package/src/utils/hooks/apiQueryHookHelper.js +77 -0
- package/src/utils/hooks/execAgentHook.js +257 -0
- package/src/utils/hooks/execHttpHook.js +184 -0
- package/src/utils/hooks/execPromptHook.js +171 -0
- package/src/utils/hooks/fileChangedWatcher.js +161 -0
- package/src/utils/hooks/hookEvents.js +111 -0
- package/src/utils/hooks/hookHelpers.js +60 -0
- package/src/utils/hooks/hooksConfigManager.js +323 -0
- package/src/utils/hooks/hooksConfigSnapshot.js +114 -0
- package/src/utils/hooks/hooksSettings.js +204 -0
- package/src/utils/hooks/postSamplingHooks.js +39 -0
- package/src/utils/hooks/registerFrontmatterHooks.js +47 -0
- package/src/utils/hooks/registerSkillHooks.js +40 -0
- package/src/utils/hooks/sessionHooks.js +252 -0
- package/src/utils/hooks/skillImprovement.js +211 -0
- package/src/utils/hooks/ssrfGuard.js +258 -0
- package/src/utils/hooks.js +3668 -0
- package/src/utils/horizontalScroll.js +108 -0
- package/src/utils/http.js +120 -0
- package/src/utils/hyperlink.js +28 -0
- package/src/utils/iTermBackup.js +48 -0
- package/src/utils/ide.js +1195 -0
- package/src/utils/idePathConversion.js +66 -0
- package/src/utils/idleTimeout.js +44 -0
- package/src/utils/imagePaste.js +343 -0
- package/src/utils/imageResizer.js +664 -0
- package/src/utils/imageStore.js +150 -0
- package/src/utils/imageValidation.js +92 -0
- package/src/utils/immediateCommand.js +12 -0
- package/src/utils/inProcessTeammateHelpers.js +71 -0
- package/src/utils/ink.js +20 -0
- package/src/utils/intl.js +83 -0
- package/src/utils/jetbrains.js +152 -0
- package/src/utils/json.js +231 -0
- package/src/utils/jsonRead.js +14 -0
- package/src/utils/keyboardShortcuts.js +11 -0
- package/src/utils/lazySchema.js +8 -0
- package/src/utils/listSessionsImpl.js +332 -0
- package/src/utils/localInstaller.js +130 -0
- package/src/utils/lockfile.js +30 -0
- package/src/utils/log.js +280 -0
- package/src/utils/logoV2Utils.js +256 -0
- package/src/utils/mailbox.js +50 -0
- package/src/utils/managedEnv.js +160 -0
- package/src/utils/managedEnvConstants.js +185 -0
- package/src/utils/markdown.js +315 -0
- package/src/utils/markdownConfigLoader.js +480 -0
- package/src/utils/mcp/dateTimeParser.js +102 -0
- package/src/utils/mcp/elicitationValidation.js +259 -0
- package/src/utils/mcpInstructionsDelta.js +97 -0
- package/src/utils/mcpOutputStorage.js +159 -0
- package/src/utils/mcpValidation.js +165 -0
- package/src/utils/mcpWebSocketTransport.js +180 -0
- package/src/utils/memoize.js +205 -0
- package/src/utils/memory/types.js +9 -0
- package/src/utils/memory/versions.js +7 -0
- package/src/utils/memoryFileDetection.js +245 -0
- package/src/utils/messagePredicates.js +6 -0
- package/src/utils/messageQueueManager.js +430 -0
- package/src/utils/messages/mappers.js +240 -0
- package/src/utils/messages/systemInit.js +72 -0
- package/src/utils/messages.js +4286 -0
- package/src/utils/model/agent.js +128 -0
- package/src/utils/model/aliases.js +21 -0
- package/src/utils/model/antModels.js +25 -0
- package/src/utils/model/bedrock.js +220 -0
- package/src/utils/model/check1mAccess.js +64 -0
- package/src/utils/model/configs.js +86 -0
- package/src/utils/model/contextWindowUpgradeCheck.js +41 -0
- package/src/utils/model/deprecation.js +72 -0
- package/src/utils/model/model.js +533 -0
- package/src/utils/model/modelAllowlist.js +148 -0
- package/src/utils/model/modelCapabilities.js +105 -0
- package/src/utils/model/modelOptions.js +450 -0
- package/src/utils/model/modelStrings.js +144 -0
- package/src/utils/model/modelSupportOverrides.js +40 -0
- package/src/utils/model/providers.js +35 -0
- package/src/utils/model/validateModel.js +131 -0
- package/src/utils/modelCost.js +160 -0
- package/src/utils/modifiers.js +39 -0
- package/src/utils/mtls.js +132 -0
- package/src/utils/nativeInstaller/download.js +370 -0
- package/src/utils/nativeInstaller/index.js +8 -0
- package/src/utils/nativeInstaller/installer.js +1395 -0
- package/src/utils/nativeInstaller/packageManagers.js +258 -0
- package/src/utils/nativeInstaller/pidLock.js +347 -0
- package/src/utils/notebook.js +176 -0
- package/src/utils/objectGroupBy.js +15 -0
- package/src/utils/pasteStore.js +93 -0
- package/src/utils/path.js +140 -0
- package/src/utils/pdf.js +236 -0
- package/src/utils/pdfUtils.js +61 -0
- package/src/utils/peerAddress.js +20 -0
- package/src/utils/permissions/PermissionMode.js +95 -0
- package/src/utils/permissions/PermissionPromptToolResultSchema.js +85 -0
- package/src/utils/permissions/PermissionResult.js +11 -0
- package/src/utils/permissions/PermissionRule.js +19 -0
- package/src/utils/permissions/PermissionUpdate.js +268 -0
- package/src/utils/permissions/PermissionUpdateSchema.js +61 -0
- package/src/utils/permissions/autoModeState.js +31 -0
- package/src/utils/permissions/bashClassifier.js +30 -0
- package/src/utils/permissions/bypassPermissionsKillswitch.js +115 -0
- package/src/utils/permissions/classifierDecision.js +86 -0
- package/src/utils/permissions/classifierShared.js +28 -0
- package/src/utils/permissions/dangerousPatterns.js +78 -0
- package/src/utils/permissions/denialTracking.js +34 -0
- package/src/utils/permissions/filesystem.js +1411 -0
- package/src/utils/permissions/getNextPermissionMode.js +74 -0
- package/src/utils/permissions/pathValidation.js +351 -0
- package/src/utils/permissions/permissionExplainer.js +188 -0
- package/src/utils/permissions/permissionRuleParser.js +175 -0
- package/src/utils/permissions/permissionSetup.js +1162 -0
- package/src/utils/permissions/permissions.js +1063 -0
- package/src/utils/permissions/permissionsLoader.js +217 -0
- package/src/utils/permissions/shadowedRuleDetection.js +149 -0
- package/src/utils/permissions/shellRuleMatching.js +174 -0
- package/src/utils/permissions/yoloClassifier.js +1193 -0
- package/src/utils/planModeV2.js +75 -0
- package/src/utils/plans.js +334 -0
- package/src/utils/platform.js +122 -0
- package/src/utils/plugins/addDirPluginSettings.js +53 -0
- package/src/utils/plugins/cacheUtils.js +174 -0
- package/src/utils/plugins/dependencyResolver.js +244 -0
- package/src/utils/plugins/fetchTelemetry.js +108 -0
- package/src/utils/plugins/gitAvailability.js +65 -0
- package/src/utils/plugins/headlessPluginInstall.js +136 -0
- package/src/utils/plugins/hintRecommendation.js +136 -0
- package/src/utils/plugins/installCounts.js +221 -0
- package/src/utils/plugins/installedPluginsManager.js +1003 -0
- package/src/utils/plugins/loadPluginAgents.js +219 -0
- package/src/utils/plugins/loadPluginCommands.js +595 -0
- package/src/utils/plugins/loadPluginHooks.js +239 -0
- package/src/utils/plugins/loadPluginOutputStyles.js +112 -0
- package/src/utils/plugins/lspPluginIntegration.js +293 -0
- package/src/utils/plugins/lspRecommendation.js +278 -0
- package/src/utils/plugins/managedPlugins.js +26 -0
- package/src/utils/plugins/marketplaceHelpers.js +470 -0
- package/src/utils/plugins/marketplaceManager.js +1939 -0
- package/src/utils/plugins/mcpPluginIntegration.js +465 -0
- package/src/utils/plugins/mcpbHandler.js +708 -0
- package/src/utils/plugins/officialMarketplace.js +19 -0
- package/src/utils/plugins/officialMarketplaceGcs.js +202 -0
- package/src/utils/plugins/officialMarketplaceStartupCheck.js +344 -0
- package/src/utils/plugins/orphanedPluginFilter.js +96 -0
- package/src/utils/plugins/parseMarketplaceInput.js +143 -0
- package/src/utils/plugins/performStartupChecks.js +66 -0
- package/src/utils/plugins/pluginAutoupdate.js +210 -0
- package/src/utils/plugins/pluginBlocklist.js +93 -0
- package/src/utils/plugins/pluginDirectories.js +170 -0
- package/src/utils/plugins/pluginFlagging.js +173 -0
- package/src/utils/plugins/pluginIdentifier.js +78 -0
- package/src/utils/plugins/pluginInstallationHelpers.js +400 -0
- package/src/utils/plugins/pluginLoader.js +2426 -0
- package/src/utils/plugins/pluginOptionsStorage.js +311 -0
- package/src/utils/plugins/pluginPolicy.js +18 -0
- package/src/utils/plugins/pluginStartupCheck.js +261 -0
- package/src/utils/plugins/pluginVersioning.js +128 -0
- package/src/utils/plugins/reconciler.js +181 -0
- package/src/utils/plugins/refresh.js +162 -0
- package/src/utils/plugins/schemas.js +1283 -0
- package/src/utils/plugins/validatePlugin.js +765 -0
- package/src/utils/plugins/walkPluginMarkdown.js +49 -0
- package/src/utils/plugins/zipCache.js +346 -0
- package/src/utils/plugins/zipCacheAdapters.js +133 -0
- package/src/utils/powershell/dangerousCmdlets.js +174 -0
- package/src/utils/powershell/parser.js +1357 -0
- package/src/utils/powershell/staticPrefix.js +277 -0
- package/src/utils/preflightChecks.js +147 -0
- package/src/utils/privacyLevel.js +49 -0
- package/src/utils/process.js +56 -0
- package/src/utils/processUserInput/processBashCommand.js +118 -0
- package/src/utils/processUserInput/processSlashCommand.js +845 -0
- package/src/utils/processUserInput/processTextPrompt.js +68 -0
- package/src/utils/processUserInput/processUserInput.js +344 -0
- package/src/utils/profilerBase.js +32 -0
- package/src/utils/promptCategory.js +39 -0
- package/src/utils/promptEditor.js +151 -0
- package/src/utils/promptShellExecution.js +117 -0
- package/src/utils/protectedNamespace.js +4 -0
- package/src/utils/proxy.js +345 -0
- package/src/utils/queryContext.js +110 -0
- package/src/utils/queryHelpers.js +436 -0
- package/src/utils/queryProfiler.js +242 -0
- package/src/utils/queueProcessor.js +70 -0
- package/src/utils/readEditContext.js +176 -0
- package/src/utils/readFileInRange.js +278 -0
- package/src/utils/releaseNotes.js +307 -0
- package/src/utils/renderOptions.js +67 -0
- package/src/utils/ripgrep.js +521 -0
- package/src/utils/sandbox/sandbox-adapter.js +750 -0
- package/src/utils/sandbox/sandbox-ui-utils.js +11 -0
- package/src/utils/sanitization.js +72 -0
- package/src/utils/screenshotClipboard.js +89 -0
- package/src/utils/sdkEventQueue.js +49 -0
- package/src/utils/secureStorage/fallbackStorage.js +59 -0
- package/src/utils/secureStorage/index.js +13 -0
- package/src/utils/secureStorage/keychainPrefetch.js +91 -0
- package/src/utils/secureStorage/macOsKeychainHelpers.js +91 -0
- package/src/utils/secureStorage/macOsKeychainStorage.js +192 -0
- package/src/utils/secureStorage/plainTextStorage.js +81 -0
- package/src/utils/semanticBoolean.js +23 -0
- package/src/utils/semanticNumber.js +34 -0
- package/src/utils/semver.js +51 -0
- package/src/utils/sequential.js +43 -0
- package/src/utils/sessionActivity.js +120 -0
- package/src/utils/sessionEnvVars.js +18 -0
- package/src/utils/sessionEnvironment.js +131 -0
- package/src/utils/sessionFileAccessHooks.js +205 -0
- package/src/utils/sessionIngressAuth.js +113 -0
- package/src/utils/sessionRestore.js +357 -0
- package/src/utils/sessionStart.js +165 -0
- package/src/utils/sessionState.js +76 -0
- package/src/utils/sessionStorage.js +4162 -0
- package/src/utils/sessionStoragePortable.js +665 -0
- package/src/utils/sessionTitle.js +120 -0
- package/src/utils/sessionUrl.js +50 -0
- package/src/utils/set.js +50 -0
- package/src/utils/settings/allErrors.js +29 -0
- package/src/utils/settings/applySettingsChange.js +65 -0
- package/src/utils/settings/changeDetector.js +409 -0
- package/src/utils/settings/constants.js +166 -0
- package/src/utils/settings/internalWrites.js +33 -0
- package/src/utils/settings/managedPath.js +29 -0
- package/src/utils/settings/mdm/constants.js +62 -0
- package/src/utils/settings/mdm/rawRead.js +97 -0
- package/src/utils/settings/mdm/settings.js +254 -0
- package/src/utils/settings/permissionValidation.js +224 -0
- package/src/utils/settings/pluginOnlyPolicy.js +53 -0
- package/src/utils/settings/schemaOutput.js +7 -0
- package/src/utils/settings/settings.js +791 -0
- package/src/utils/settings/settingsCache.js +47 -0
- package/src/utils/settings/toolValidationConfig.js +76 -0
- package/src/utils/settings/types.js +846 -0
- package/src/utils/settings/validateEditTool.js +34 -0
- package/src/utils/settings/validation.js +192 -0
- package/src/utils/settings/validationTips.js +111 -0
- package/src/utils/shell/bashProvider.js +202 -0
- package/src/utils/shell/outputLimits.js +7 -0
- package/src/utils/shell/powershellDetection.js +96 -0
- package/src/utils/shell/powershellProvider.js +104 -0
- package/src/utils/shell/prefix.js +246 -0
- package/src/utils/shell/readOnlyCommandValidation.js +1776 -0
- package/src/utils/shell/resolveDefaultShell.js +13 -0
- package/src/utils/shell/shellProvider.js +2 -0
- package/src/utils/shell/shellToolUtils.js +21 -0
- package/src/utils/shell/specPrefix.js +198 -0
- package/src/utils/shellConfig.js +136 -0
- package/src/utils/sideQuery.js +134 -0
- package/src/utils/sideQuestion.js +121 -0
- package/src/utils/signal.js +34 -0
- package/src/utils/sinks.js +15 -0
- package/src/utils/skills/skillChangeDetector.js +264 -0
- package/src/utils/slashCommandParsing.js +46 -0
- package/src/utils/sleep.js +72 -0
- package/src/utils/sliceAnsi.js +74 -0
- package/src/utils/slowOperations.js +216 -0
- package/src/utils/standaloneAgent.js +20 -0
- package/src/utils/startupProfiler.js +149 -0
- package/src/utils/staticRender.js +104 -0
- package/src/utils/stats.js +802 -0
- package/src/utils/statsCache.js +330 -0
- package/src/utils/status.js +359 -0
- package/src/utils/statusNoticeDefinitions.js +123 -0
- package/src/utils/statusNoticeHelpers.js +15 -0
- package/src/utils/stream.js +73 -0
- package/src/utils/streamJsonStdoutGuard.js +107 -0
- package/src/utils/streamlinedTransform.js +162 -0
- package/src/utils/stringUtils.js +202 -0
- package/src/utils/subprocessEnv.js +87 -0
- package/src/utils/suggestions/commandSuggestions.js +458 -0
- package/src/utils/suggestions/directoryCompletion.js +191 -0
- package/src/utils/suggestions/shellHistoryCompletion.js +95 -0
- package/src/utils/suggestions/skillUsageTracking.js +50 -0
- package/src/utils/suggestions/slackChannelSuggestions.js +169 -0
- package/src/utils/swarm/It2SetupPrompt.js +386 -0
- package/src/utils/swarm/backends/ITermBackend.js +276 -0
- package/src/utils/swarm/backends/InProcessBackend.js +237 -0
- package/src/utils/swarm/backends/PaneBackendExecutor.js +250 -0
- package/src/utils/swarm/backends/TmuxBackend.js +574 -0
- package/src/utils/swarm/backends/detection.js +112 -0
- package/src/utils/swarm/backends/it2Setup.js +185 -0
- package/src/utils/swarm/backends/registry.js +369 -0
- package/src/utils/swarm/backends/teammateModeSnapshot.js +68 -0
- package/src/utils/swarm/backends/types.js +9 -0
- package/src/utils/swarm/constants.js +29 -0
- package/src/utils/swarm/inProcessRunner.js +1021 -0
- package/src/utils/swarm/leaderPermissionBridge.js +31 -0
- package/src/utils/swarm/permissionSync.js +667 -0
- package/src/utils/swarm/reconnection.js +82 -0
- package/src/utils/swarm/spawnInProcess.js +218 -0
- package/src/utils/swarm/spawnUtils.js +123 -0
- package/src/utils/swarm/teamHelpers.js +484 -0
- package/src/utils/swarm/teammateInit.js +87 -0
- package/src/utils/swarm/teammateLayoutManager.js +82 -0
- package/src/utils/swarm/teammateModel.js +9 -0
- package/src/utils/swarm/teammatePromptAddendum.js +17 -0
- package/src/utils/systemDirectories.js +51 -0
- package/src/utils/systemPrompt.js +88 -0
- package/src/utils/systemPromptType.js +9 -0
- package/src/utils/systemTheme.js +108 -0
- package/src/utils/taggedId.js +49 -0
- package/src/utils/task/TaskOutput.js +320 -0
- package/src/utils/task/diskOutput.js +387 -0
- package/src/utils/task/framework.js +236 -0
- package/src/utils/task/outputFormatting.js +24 -0
- package/src/utils/task/sdkProgress.js +24 -0
- package/src/utils/taskSummary.js +3 -0
- package/src/utils/tasks.js +672 -0
- package/src/utils/teamDiscovery.js +48 -0
- package/src/utils/teamMemoryOps.js +67 -0
- package/src/utils/teammate.js +237 -0
- package/src/utils/teammateContext.js +56 -0
- package/src/utils/teammateMailbox.js +793 -0
- package/src/utils/telemetry/betaSessionTracing.js +25 -0
- package/src/utils/telemetry/bigqueryExporter.js +17 -0
- package/src/utils/telemetry/events.js +7 -0
- package/src/utils/telemetry/instrumentation.js +16 -0
- package/src/utils/telemetry/logger.js +25 -0
- package/src/utils/telemetry/perfettoTracing.js +882 -0
- package/src/utils/telemetry/pluginTelemetry.js +76 -0
- package/src/utils/telemetry/sessionTracing.js +62 -0
- package/src/utils/telemetry/skillLoadedEvent.js +4 -0
- package/src/utils/telemetryAttributes.js +56 -0
- package/src/utils/teleport/api.js +299 -0
- package/src/utils/teleport/environmentSelection.js +55 -0
- package/src/utils/teleport/environments.js +84 -0
- package/src/utils/teleport/gitBundle.js +192 -0
- package/src/utils/teleport.js +1047 -0
- package/src/utils/tempfile.js +26 -0
- package/src/utils/terminal.js +105 -0
- package/src/utils/terminalPanel.js +155 -0
- package/src/utils/textHighlighting.js +113 -0
- package/src/utils/thaddeusHints.js +142 -0
- package/src/utils/theme.js +525 -0
- package/src/utils/thinking.js +130 -0
- package/src/utils/timeouts.js +35 -0
- package/src/utils/tmuxSocket.js +373 -0
- package/src/utils/todo/types.js +9 -0
- package/src/utils/tokenBudget.js +62 -0
- package/src/utils/tokens.js +223 -0
- package/src/utils/toolErrors.js +101 -0
- package/src/utils/toolPool.js +61 -0
- package/src/utils/toolResultStorage.js +768 -0
- package/src/utils/toolSchemaCache.js +7 -0
- package/src/utils/toolSearch.js +551 -0
- package/src/utils/transcriptSearch.js +200 -0
- package/src/utils/treeify.js +111 -0
- package/src/utils/truncate.js +164 -0
- package/src/utils/udsClient.js +5 -0
- package/src/utils/udsMessaging.js +23 -0
- package/src/utils/ultraplan/ccrSession.js +264 -0
- package/src/utils/ultraplan/keyword.js +122 -0
- package/src/utils/unaryLogging.js +16 -0
- package/src/utils/undercover.js +89 -0
- package/src/utils/user.js +137 -0
- package/src/utils/userAgent.js +9 -0
- package/src/utils/userPromptKeywords.js +21 -0
- package/src/utils/uuid.js +22 -0
- package/src/utils/warningHandler.js +97 -0
- package/src/utils/which.js +75 -0
- package/src/utils/windowsPaths.js +146 -0
- package/src/utils/withResolvers.js +13 -0
- package/src/utils/words.js +793 -0
- package/src/utils/workforceIntent.js +192 -0
- package/src/utils/workloadContext.js +42 -0
- package/src/utils/worktree.js +1142 -0
- package/src/utils/worktreeModeEnabled.js +11 -0
- package/src/utils/xdg.js +52 -0
- package/src/utils/xml.js +15 -0
- package/src/utils/yaml.js +14 -0
- package/src/utils/zodToJsonSchema.js +19 -0
- package/src/vim/motions.js +73 -0
- package/src/vim/operators.js +401 -0
- package/src/vim/textObjects.js +153 -0
- package/src/vim/transitions.js +340 -0
- package/src/vim/types.js +93 -0
- package/src/voice/voiceModeEnabled.js +20 -0
- package/thaddeus-terminal.ts +401 -3
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
import { feature } from 'bun:bundle';
|
|
2
|
+
import { APIUserAbortError } from '@anthropic-ai/sdk';
|
|
3
|
+
import { getToolNameForPermissionCheck, mcpInfoFromString, } from '../../services/mcp/mcpStringUtils.js';
|
|
4
|
+
import { AGENT_TOOL_NAME } from '../../tools/AgentTool/constants.js';
|
|
5
|
+
import { shouldUseSandbox } from '../../tools/BashTool/shouldUseSandbox.js';
|
|
6
|
+
import { BASH_TOOL_NAME } from '../../tools/BashTool/toolName.js';
|
|
7
|
+
import { POWERSHELL_TOOL_NAME } from '../../tools/PowerShellTool/toolName.js';
|
|
8
|
+
import { REPL_TOOL_NAME } from '../../tools/REPLTool/constants.js';
|
|
9
|
+
import { extractOutputRedirections } from '../bash/commands.js';
|
|
10
|
+
import { logForDebugging } from '../debug.js';
|
|
11
|
+
import { AbortError, toError } from '../errors.js';
|
|
12
|
+
import { logError } from '../log.js';
|
|
13
|
+
import { SandboxManager } from '../sandbox/sandbox-adapter.js';
|
|
14
|
+
import { getSettingSourceDisplayNameLowercase, SETTING_SOURCES, } from '../settings/constants.js';
|
|
15
|
+
import { plural } from '../stringUtils.js';
|
|
16
|
+
import { permissionModeTitle } from './PermissionMode.js';
|
|
17
|
+
import { applyPermissionUpdate, applyPermissionUpdates, persistPermissionUpdates, } from './PermissionUpdate.js';
|
|
18
|
+
import { permissionRuleValueFromString, permissionRuleValueToString, } from './permissionRuleParser.js';
|
|
19
|
+
import { deletePermissionRuleFromSettings, shouldAllowManagedPermissionRulesOnly, } from './permissionsLoader.js';
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
21
|
+
const classifierDecisionModule = feature('TRANSCRIPT_CLASSIFIER')
|
|
22
|
+
? require('./classifierDecision.js')
|
|
23
|
+
: null;
|
|
24
|
+
const autoModeStateModule = feature('TRANSCRIPT_CLASSIFIER')
|
|
25
|
+
? require('./autoModeState.js')
|
|
26
|
+
: null;
|
|
27
|
+
import { addToTurnClassifierDuration, getTotalCacheCreationInputTokens, getTotalCacheReadInputTokens, getTotalInputTokens, getTotalOutputTokens, } from '../../bootstrap/state.js';
|
|
28
|
+
import { getFeatureValue_CACHED_WITH_REFRESH } from '../../services/analytics/growthbook.js';
|
|
29
|
+
import { logEvent, } from '../../services/analytics/index.js';
|
|
30
|
+
import { sanitizeToolNameForAnalytics } from '../../services/analytics/metadata.js';
|
|
31
|
+
import { clearClassifierChecking, setClassifierChecking, } from '../classifierApprovals.js';
|
|
32
|
+
import { isInProtectedNamespace } from '../envUtils.js';
|
|
33
|
+
import { executePermissionRequestHooks } from '../hooks.js';
|
|
34
|
+
import { AUTO_REJECT_MESSAGE, buildClassifierUnavailableMessage, buildYoloRejectionMessage, DONT_ASK_REJECT_MESSAGE, } from '../messages.js';
|
|
35
|
+
import { calculateCostFromTokens } from '../modelCost.js';
|
|
36
|
+
/* eslint-enable @typescript-eslint/no-require-imports */
|
|
37
|
+
import { jsonStringify } from '../slowOperations.js';
|
|
38
|
+
import { createDenialTrackingState, DENIAL_LIMITS, recordDenial, recordSuccess, shouldFallbackToPrompting, } from './denialTracking.js';
|
|
39
|
+
import { classifyYoloAction, formatActionForClassifier, } from './yoloClassifier.js';
|
|
40
|
+
const CLASSIFIER_FAIL_CLOSED_REFRESH_MS = 30 * 60 * 1000; // 30 minutes
|
|
41
|
+
const PERMISSION_RULE_SOURCES = [
|
|
42
|
+
...SETTING_SOURCES,
|
|
43
|
+
'cliArg',
|
|
44
|
+
'command',
|
|
45
|
+
'session',
|
|
46
|
+
];
|
|
47
|
+
export function permissionRuleSourceDisplayString(source) {
|
|
48
|
+
return getSettingSourceDisplayNameLowercase(source);
|
|
49
|
+
}
|
|
50
|
+
export function getAllowRules(context) {
|
|
51
|
+
return PERMISSION_RULE_SOURCES.flatMap(source => (context.alwaysAllowRules[source] || []).map(ruleString => ({
|
|
52
|
+
source,
|
|
53
|
+
ruleBehavior: 'allow',
|
|
54
|
+
ruleValue: permissionRuleValueFromString(ruleString),
|
|
55
|
+
})));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates a permission request message that explain the permission request
|
|
59
|
+
*/
|
|
60
|
+
export function createPermissionRequestMessage(toolName, decisionReason) {
|
|
61
|
+
// Handle different decision reason types
|
|
62
|
+
if (decisionReason) {
|
|
63
|
+
if ((feature('BASH_CLASSIFIER') || feature('TRANSCRIPT_CLASSIFIER')) &&
|
|
64
|
+
decisionReason.type === 'classifier') {
|
|
65
|
+
return `Classifier '${decisionReason.classifier}' requires approval for this ${toolName} command: ${decisionReason.reason}`;
|
|
66
|
+
}
|
|
67
|
+
switch (decisionReason.type) {
|
|
68
|
+
case 'hook': {
|
|
69
|
+
const hookMessage = decisionReason.reason
|
|
70
|
+
? `Hook '${decisionReason.hookName}' blocked this action: ${decisionReason.reason}`
|
|
71
|
+
: `Hook '${decisionReason.hookName}' requires approval for this ${toolName} command`;
|
|
72
|
+
return hookMessage;
|
|
73
|
+
}
|
|
74
|
+
case 'rule': {
|
|
75
|
+
const ruleString = permissionRuleValueToString(decisionReason.rule.ruleValue);
|
|
76
|
+
const sourceString = permissionRuleSourceDisplayString(decisionReason.rule.source);
|
|
77
|
+
return `Permission rule '${ruleString}' from ${sourceString} requires approval for this ${toolName} command`;
|
|
78
|
+
}
|
|
79
|
+
case 'subcommandResults': {
|
|
80
|
+
const needsApproval = [];
|
|
81
|
+
for (const [cmd, result] of decisionReason.reasons) {
|
|
82
|
+
if (result.behavior === 'ask' || result.behavior === 'passthrough') {
|
|
83
|
+
// Strip output redirections for display to avoid showing filenames as commands
|
|
84
|
+
// Only do this for Bash tool to avoid affecting other tools
|
|
85
|
+
if (toolName === 'Bash') {
|
|
86
|
+
const { commandWithoutRedirections, redirections } = extractOutputRedirections(cmd);
|
|
87
|
+
// Only use stripped version if there were actual redirections
|
|
88
|
+
const displayCmd = redirections.length > 0 ? commandWithoutRedirections : cmd;
|
|
89
|
+
needsApproval.push(displayCmd);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
needsApproval.push(cmd);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (needsApproval.length > 0) {
|
|
97
|
+
const n = needsApproval.length;
|
|
98
|
+
return `This ${toolName} command contains multiple operations. The following ${plural(n, 'part')} ${plural(n, 'requires', 'require')} approval: ${needsApproval.join(', ')}`;
|
|
99
|
+
}
|
|
100
|
+
return `This ${toolName} command contains multiple operations that require approval`;
|
|
101
|
+
}
|
|
102
|
+
case 'permissionPromptTool':
|
|
103
|
+
return `Tool '${decisionReason.permissionPromptToolName}' requires approval for this ${toolName} command`;
|
|
104
|
+
case 'sandboxOverride':
|
|
105
|
+
return 'Run outside of the sandbox';
|
|
106
|
+
case 'workingDir':
|
|
107
|
+
return decisionReason.reason;
|
|
108
|
+
case 'safetyCheck':
|
|
109
|
+
case 'other':
|
|
110
|
+
return decisionReason.reason;
|
|
111
|
+
case 'mode': {
|
|
112
|
+
const modeTitle = permissionModeTitle(decisionReason.mode);
|
|
113
|
+
return `Current permission mode (${modeTitle}) requires approval for this ${toolName} command`;
|
|
114
|
+
}
|
|
115
|
+
case 'asyncAgent':
|
|
116
|
+
return decisionReason.reason;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Default message without listing allowed commands
|
|
120
|
+
const message = `Thaddeus requested permissions to use ${toolName}, but you haven't granted it yet.`;
|
|
121
|
+
return message;
|
|
122
|
+
}
|
|
123
|
+
export function getDenyRules(context) {
|
|
124
|
+
return PERMISSION_RULE_SOURCES.flatMap(source => (context.alwaysDenyRules[source] || []).map(ruleString => ({
|
|
125
|
+
source,
|
|
126
|
+
ruleBehavior: 'deny',
|
|
127
|
+
ruleValue: permissionRuleValueFromString(ruleString),
|
|
128
|
+
})));
|
|
129
|
+
}
|
|
130
|
+
export function getAskRules(context) {
|
|
131
|
+
return PERMISSION_RULE_SOURCES.flatMap(source => (context.alwaysAskRules[source] || []).map(ruleString => ({
|
|
132
|
+
source,
|
|
133
|
+
ruleBehavior: 'ask',
|
|
134
|
+
ruleValue: permissionRuleValueFromString(ruleString),
|
|
135
|
+
})));
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check if the entire tool matches a rule
|
|
139
|
+
* For example, this matches "Bash" but not "Bash(prefix:*)" for BashTool
|
|
140
|
+
* This also matches MCP tools with a server name, e.g. the rule "mcp__server1"
|
|
141
|
+
*/
|
|
142
|
+
function toolMatchesRule(tool, rule) {
|
|
143
|
+
// Rule must not have content to match the entire tool
|
|
144
|
+
if (rule.ruleValue.ruleContent !== undefined) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
// MCP tools are matched by their fully qualified mcp__server__tool name. In
|
|
148
|
+
// skip-prefix mode (CLAUDE_AGENT_SDK_MCP_NO_PREFIX), MCP tools have unprefixed
|
|
149
|
+
// display names (e.g., "Write") that collide with builtin names; rules targeting
|
|
150
|
+
// builtins should not match their MCP replacements.
|
|
151
|
+
const nameForRuleMatch = getToolNameForPermissionCheck(tool);
|
|
152
|
+
// Direct tool name match
|
|
153
|
+
if (rule.ruleValue.toolName === nameForRuleMatch) {
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
// MCP server-level permission: rule "mcp__server1" matches tool "mcp__server1__tool1"
|
|
157
|
+
// Also supports wildcard: rule "mcp__server1__*" matches all tools from server1
|
|
158
|
+
const ruleInfo = mcpInfoFromString(rule.ruleValue.toolName);
|
|
159
|
+
const toolInfo = mcpInfoFromString(nameForRuleMatch);
|
|
160
|
+
return (ruleInfo !== null &&
|
|
161
|
+
toolInfo !== null &&
|
|
162
|
+
(ruleInfo.toolName === undefined || ruleInfo.toolName === '*') &&
|
|
163
|
+
ruleInfo.serverName === toolInfo.serverName);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Check if the entire tool is listed in the always allow rules
|
|
167
|
+
* For example, this finds "Bash" but not "Bash(prefix:*)" for BashTool
|
|
168
|
+
*/
|
|
169
|
+
export function toolAlwaysAllowedRule(context, tool) {
|
|
170
|
+
return (getAllowRules(context).find(rule => toolMatchesRule(tool, rule)) || null);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if the tool is listed in the always deny rules
|
|
174
|
+
*/
|
|
175
|
+
export function getDenyRuleForTool(context, tool) {
|
|
176
|
+
return getDenyRules(context).find(rule => toolMatchesRule(tool, rule)) || null;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Check if the tool is listed in the always ask rules
|
|
180
|
+
*/
|
|
181
|
+
export function getAskRuleForTool(context, tool) {
|
|
182
|
+
return getAskRules(context).find(rule => toolMatchesRule(tool, rule)) || null;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Check if a specific agent is denied via Agent(agentType) syntax.
|
|
186
|
+
* For example, Agent(Explore) would deny the Explore agent.
|
|
187
|
+
*/
|
|
188
|
+
export function getDenyRuleForAgent(context, agentToolName, agentType) {
|
|
189
|
+
return (getDenyRules(context).find(rule => rule.ruleValue.toolName === agentToolName &&
|
|
190
|
+
rule.ruleValue.ruleContent === agentType) || null);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Filter agents to exclude those that are denied via Agent(agentType) syntax.
|
|
194
|
+
*/
|
|
195
|
+
export function filterDeniedAgents(agents, context, agentToolName) {
|
|
196
|
+
// Parse deny rules once and collect Agent(x) contents into a Set.
|
|
197
|
+
// Previously this called getDenyRuleForAgent per agent, which re-parsed
|
|
198
|
+
// every deny rule for every agent (O(agents×rules) parse calls).
|
|
199
|
+
const deniedAgentTypes = new Set();
|
|
200
|
+
for (const rule of getDenyRules(context)) {
|
|
201
|
+
if (rule.ruleValue.toolName === agentToolName &&
|
|
202
|
+
rule.ruleValue.ruleContent !== undefined) {
|
|
203
|
+
deniedAgentTypes.add(rule.ruleValue.ruleContent);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return agents.filter(agent => !deniedAgentTypes.has(agent.agentType));
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Map of rule contents to the associated rule for a given tool.
|
|
210
|
+
* e.g. the string key is "prefix:*" from "Bash(prefix:*)" for BashTool
|
|
211
|
+
*/
|
|
212
|
+
export function getRuleByContentsForTool(context, tool, behavior) {
|
|
213
|
+
return getRuleByContentsForToolName(context, getToolNameForPermissionCheck(tool), behavior);
|
|
214
|
+
}
|
|
215
|
+
// Used to break circular dependency where a Tool calls this function
|
|
216
|
+
export function getRuleByContentsForToolName(context, toolName, behavior) {
|
|
217
|
+
const ruleByContents = new Map();
|
|
218
|
+
let rules = [];
|
|
219
|
+
switch (behavior) {
|
|
220
|
+
case 'allow':
|
|
221
|
+
rules = getAllowRules(context);
|
|
222
|
+
break;
|
|
223
|
+
case 'deny':
|
|
224
|
+
rules = getDenyRules(context);
|
|
225
|
+
break;
|
|
226
|
+
case 'ask':
|
|
227
|
+
rules = getAskRules(context);
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
for (const rule of rules) {
|
|
231
|
+
if (rule.ruleValue.toolName === toolName &&
|
|
232
|
+
rule.ruleValue.ruleContent !== undefined &&
|
|
233
|
+
rule.ruleBehavior === behavior) {
|
|
234
|
+
ruleByContents.set(rule.ruleValue.ruleContent, rule);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return ruleByContents;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Runs PermissionRequest hooks for headless/async agents that cannot show
|
|
241
|
+
* permission prompts. This gives hooks an opportunity to allow or deny
|
|
242
|
+
* tool use before the fallback auto-deny kicks in.
|
|
243
|
+
*
|
|
244
|
+
* Returns a PermissionDecision if a hook made a decision, or null if no
|
|
245
|
+
* hook provided a decision (caller should proceed to auto-deny).
|
|
246
|
+
*/
|
|
247
|
+
async function runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context, permissionMode, suggestions) {
|
|
248
|
+
try {
|
|
249
|
+
for await (const hookResult of executePermissionRequestHooks(tool.name, toolUseID, input, context, permissionMode, suggestions, context.abortController.signal)) {
|
|
250
|
+
if (!hookResult.permissionRequestResult) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
const decision = hookResult.permissionRequestResult;
|
|
254
|
+
if (decision.behavior === 'allow') {
|
|
255
|
+
const finalInput = decision.updatedInput ?? input;
|
|
256
|
+
// Persist permission updates if provided
|
|
257
|
+
if (decision.updatedPermissions?.length) {
|
|
258
|
+
persistPermissionUpdates(decision.updatedPermissions);
|
|
259
|
+
context.setAppState(prev => ({
|
|
260
|
+
...prev,
|
|
261
|
+
toolPermissionContext: applyPermissionUpdates(prev.toolPermissionContext, decision.updatedPermissions),
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
behavior: 'allow',
|
|
266
|
+
updatedInput: finalInput,
|
|
267
|
+
decisionReason: {
|
|
268
|
+
type: 'hook',
|
|
269
|
+
hookName: 'PermissionRequest',
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
if (decision.behavior === 'deny') {
|
|
274
|
+
if (decision.interrupt) {
|
|
275
|
+
logForDebugging(`Hook interrupt: tool=${tool.name} hookMessage=${decision.message}`);
|
|
276
|
+
context.abortController.abort();
|
|
277
|
+
}
|
|
278
|
+
return {
|
|
279
|
+
behavior: 'deny',
|
|
280
|
+
message: decision.message || 'Permission denied by hook',
|
|
281
|
+
decisionReason: {
|
|
282
|
+
type: 'hook',
|
|
283
|
+
hookName: 'PermissionRequest',
|
|
284
|
+
reason: decision.message,
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
// If hooks fail, fall through to auto-deny rather than crashing
|
|
292
|
+
logError(new Error('PermissionRequest hook failed for headless agent', {
|
|
293
|
+
cause: toError(error),
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
export const hasPermissionsToUseTool = async (tool, input, context, assistantMessage, toolUseID) => {
|
|
299
|
+
const result = await hasPermissionsToUseToolInner(tool, input, context);
|
|
300
|
+
// Reset consecutive denials on any allowed tool use in auto mode.
|
|
301
|
+
// This ensures that a successful tool use (even one auto-allowed by rules)
|
|
302
|
+
// breaks the consecutive denial streak.
|
|
303
|
+
if (result.behavior === 'allow') {
|
|
304
|
+
const appState = context.getAppState();
|
|
305
|
+
if (feature('TRANSCRIPT_CLASSIFIER')) {
|
|
306
|
+
const currentDenialState = context.localDenialTracking ?? appState.denialTracking;
|
|
307
|
+
if (appState.toolPermissionContext.mode === 'auto' &&
|
|
308
|
+
currentDenialState &&
|
|
309
|
+
currentDenialState.consecutiveDenials > 0) {
|
|
310
|
+
const newDenialState = recordSuccess(currentDenialState);
|
|
311
|
+
persistDenialState(context, newDenialState);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return result;
|
|
315
|
+
}
|
|
316
|
+
// Apply dontAsk mode transformation: convert 'ask' to 'deny'
|
|
317
|
+
// This is done at the end so it can't be bypassed by early returns
|
|
318
|
+
if (result.behavior === 'ask') {
|
|
319
|
+
const appState = context.getAppState();
|
|
320
|
+
if (appState.toolPermissionContext.mode === 'dontAsk') {
|
|
321
|
+
return {
|
|
322
|
+
behavior: 'deny',
|
|
323
|
+
decisionReason: {
|
|
324
|
+
type: 'mode',
|
|
325
|
+
mode: 'dontAsk',
|
|
326
|
+
},
|
|
327
|
+
message: DONT_ASK_REJECT_MESSAGE(tool.name),
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
// Apply auto mode: use AI classifier instead of prompting user
|
|
331
|
+
// Check this BEFORE shouldAvoidPermissionPrompts so classifiers work in headless mode
|
|
332
|
+
if (feature('TRANSCRIPT_CLASSIFIER') &&
|
|
333
|
+
(appState.toolPermissionContext.mode === 'auto' ||
|
|
334
|
+
(appState.toolPermissionContext.mode === 'plan' &&
|
|
335
|
+
(autoModeStateModule?.isAutoModeActive() ?? false)))) {
|
|
336
|
+
// Non-classifier-approvable safetyCheck decisions stay immune to ALL
|
|
337
|
+
// auto-approve paths: the acceptEdits fast-path, the safe-tool allowlist,
|
|
338
|
+
// and the classifier. Step 1g only guards bypassPermissions; this guards
|
|
339
|
+
// auto. classifierApprovable safetyChecks (sensitive-file paths) fall
|
|
340
|
+
// through to the classifier — the fast-paths below naturally don't fire
|
|
341
|
+
// because the tool's own checkPermissions still returns 'ask'.
|
|
342
|
+
if (result.decisionReason?.type === 'safetyCheck' &&
|
|
343
|
+
!result.decisionReason.classifierApprovable) {
|
|
344
|
+
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
345
|
+
return {
|
|
346
|
+
behavior: 'deny',
|
|
347
|
+
message: result.message,
|
|
348
|
+
decisionReason: {
|
|
349
|
+
type: 'asyncAgent',
|
|
350
|
+
reason: 'Safety check requires interactive approval and permission prompts are not available in this context',
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
}
|
|
356
|
+
if (tool.requiresUserInteraction?.() && result.behavior === 'ask') {
|
|
357
|
+
return result;
|
|
358
|
+
}
|
|
359
|
+
// Use local denial tracking for async subagents (whose setAppState
|
|
360
|
+
// is a no-op), otherwise read from appState as before.
|
|
361
|
+
const denialState = context.localDenialTracking ??
|
|
362
|
+
appState.denialTracking ??
|
|
363
|
+
createDenialTrackingState();
|
|
364
|
+
// PowerShell requires explicit user permission in auto mode unless
|
|
365
|
+
// POWERSHELL_AUTO_MODE (ant-only build flag) is on. When disabled, this
|
|
366
|
+
// guard keeps PS out of the classifier and skips the acceptEdits
|
|
367
|
+
// fast-path below. When enabled, PS flows through to the classifier like
|
|
368
|
+
// Bash — the classifier prompt gets POWERSHELL_DENY_GUIDANCE appended so
|
|
369
|
+
// it recognizes `iex (iwr ...)` as download-and-execute, etc.
|
|
370
|
+
// Note: this runs inside the behavior === 'ask' branch, so allow rules
|
|
371
|
+
// that fire earlier (step 2b toolAlwaysAllowedRule, PS prefix allow)
|
|
372
|
+
// return before reaching here. Allow-rule protection is handled by
|
|
373
|
+
// permissionSetup.ts: isOverlyBroadPowerShellAllowRule strips PowerShell(*)
|
|
374
|
+
// and isDangerousPowerShellPermission strips iex/pwsh/Start-Process
|
|
375
|
+
// prefix rules for ant users and auto mode entry.
|
|
376
|
+
if (tool.name === POWERSHELL_TOOL_NAME &&
|
|
377
|
+
!feature('POWERSHELL_AUTO_MODE')) {
|
|
378
|
+
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
379
|
+
return {
|
|
380
|
+
behavior: 'deny',
|
|
381
|
+
message: 'PowerShell tool requires interactive approval',
|
|
382
|
+
decisionReason: {
|
|
383
|
+
type: 'asyncAgent',
|
|
384
|
+
reason: 'PowerShell tool requires interactive approval and permission prompts are not available in this context',
|
|
385
|
+
},
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
logForDebugging(`Skipping auto mode classifier for ${tool.name}: tool requires explicit user permission`);
|
|
389
|
+
return result;
|
|
390
|
+
}
|
|
391
|
+
// Before running the auto mode classifier, check if acceptEdits mode would
|
|
392
|
+
// allow this action. This avoids expensive classifier API calls for safe
|
|
393
|
+
// operations like file edits in the working directory.
|
|
394
|
+
// Skip for Agent and REPL — their checkPermissions returns 'allow' for
|
|
395
|
+
// acceptEdits mode, which would silently bypass the classifier. REPL
|
|
396
|
+
// code can contain VM escapes between inner tool calls; the classifier
|
|
397
|
+
// must see the glue JavaScript, not just the inner tool calls.
|
|
398
|
+
if (result.behavior === 'ask' &&
|
|
399
|
+
tool.name !== AGENT_TOOL_NAME &&
|
|
400
|
+
tool.name !== REPL_TOOL_NAME) {
|
|
401
|
+
try {
|
|
402
|
+
const parsedInput = tool.inputSchema.parse(input);
|
|
403
|
+
const acceptEditsResult = await tool.checkPermissions(parsedInput, {
|
|
404
|
+
...context,
|
|
405
|
+
getAppState: () => {
|
|
406
|
+
const state = context.getAppState();
|
|
407
|
+
return {
|
|
408
|
+
...state,
|
|
409
|
+
toolPermissionContext: {
|
|
410
|
+
...state.toolPermissionContext,
|
|
411
|
+
mode: 'acceptEdits',
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
},
|
|
415
|
+
});
|
|
416
|
+
if (acceptEditsResult.behavior === 'allow') {
|
|
417
|
+
const newDenialState = recordSuccess(denialState);
|
|
418
|
+
persistDenialState(context, newDenialState);
|
|
419
|
+
logForDebugging(`Skipping auto mode classifier for ${tool.name}: would be allowed in acceptEdits mode`);
|
|
420
|
+
logEvent('thaddeus_auto_mode_decision', {
|
|
421
|
+
decision: 'allowed',
|
|
422
|
+
toolName: sanitizeToolNameForAnalytics(tool.name),
|
|
423
|
+
inProtectedNamespace: isInProtectedNamespace(),
|
|
424
|
+
// msg_id of the agent completion that produced this tool_use —
|
|
425
|
+
// the action at the bottom of the classifier transcript. Joins
|
|
426
|
+
// the decision back to the main agent's API response.
|
|
427
|
+
agentMsgId: assistantMessage.message
|
|
428
|
+
.id,
|
|
429
|
+
confidence: 'high',
|
|
430
|
+
fastPath: 'acceptEdits',
|
|
431
|
+
});
|
|
432
|
+
return {
|
|
433
|
+
behavior: 'allow',
|
|
434
|
+
updatedInput: acceptEditsResult.updatedInput ?? input,
|
|
435
|
+
decisionReason: {
|
|
436
|
+
type: 'mode',
|
|
437
|
+
mode: 'auto',
|
|
438
|
+
},
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
catch (e) {
|
|
443
|
+
if (e instanceof AbortError || e instanceof APIUserAbortError) {
|
|
444
|
+
throw e;
|
|
445
|
+
}
|
|
446
|
+
// If the acceptEdits check fails, fall through to the classifier
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
// Allowlisted tools are safe and don't need YOLO classification.
|
|
450
|
+
// This uses the safe-tool allowlist to skip unnecessary classifier API calls.
|
|
451
|
+
if (classifierDecisionModule.isAutoModeAllowlistedTool(tool.name)) {
|
|
452
|
+
const newDenialState = recordSuccess(denialState);
|
|
453
|
+
persistDenialState(context, newDenialState);
|
|
454
|
+
logForDebugging(`Skipping auto mode classifier for ${tool.name}: tool is on the safe allowlist`);
|
|
455
|
+
logEvent('thaddeus_auto_mode_decision', {
|
|
456
|
+
decision: 'allowed',
|
|
457
|
+
toolName: sanitizeToolNameForAnalytics(tool.name),
|
|
458
|
+
inProtectedNamespace: isInProtectedNamespace(),
|
|
459
|
+
agentMsgId: assistantMessage.message
|
|
460
|
+
.id,
|
|
461
|
+
confidence: 'high',
|
|
462
|
+
fastPath: 'allowlist',
|
|
463
|
+
});
|
|
464
|
+
return {
|
|
465
|
+
behavior: 'allow',
|
|
466
|
+
updatedInput: input,
|
|
467
|
+
decisionReason: {
|
|
468
|
+
type: 'mode',
|
|
469
|
+
mode: 'auto',
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
// Run the auto mode classifier
|
|
474
|
+
const action = formatActionForClassifier(tool.name, input);
|
|
475
|
+
setClassifierChecking(toolUseID);
|
|
476
|
+
let classifierResult;
|
|
477
|
+
try {
|
|
478
|
+
classifierResult = await classifyYoloAction(context.messages, action, context.options.tools, appState.toolPermissionContext, context.abortController.signal);
|
|
479
|
+
}
|
|
480
|
+
finally {
|
|
481
|
+
clearClassifierChecking(toolUseID);
|
|
482
|
+
}
|
|
483
|
+
// Notify ants when classifier error dumped prompts (will be in /share)
|
|
484
|
+
if (process.env.USER_TYPE === 'ant' &&
|
|
485
|
+
classifierResult.errorDumpPath &&
|
|
486
|
+
context.addNotification) {
|
|
487
|
+
context.addNotification({
|
|
488
|
+
key: 'auto-mode-error-dump',
|
|
489
|
+
text: `Auto mode classifier error — prompts dumped to ${classifierResult.errorDumpPath} (included in /share)`,
|
|
490
|
+
priority: 'immediate',
|
|
491
|
+
color: 'error',
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
// Log classifier decision for metrics (including overhead telemetry)
|
|
495
|
+
const yoloDecision = classifierResult.unavailable
|
|
496
|
+
? 'unavailable'
|
|
497
|
+
: classifierResult.shouldBlock
|
|
498
|
+
? 'blocked'
|
|
499
|
+
: 'allowed';
|
|
500
|
+
// Compute classifier cost in USD for overhead analysis
|
|
501
|
+
const classifierCostUSD = classifierResult.usage && classifierResult.model
|
|
502
|
+
? calculateCostFromTokens(classifierResult.model, classifierResult.usage)
|
|
503
|
+
: undefined;
|
|
504
|
+
logEvent('thaddeus_auto_mode_decision', {
|
|
505
|
+
decision: yoloDecision,
|
|
506
|
+
toolName: sanitizeToolNameForAnalytics(tool.name),
|
|
507
|
+
inProtectedNamespace: isInProtectedNamespace(),
|
|
508
|
+
// msg_id of the agent completion that produced this tool_use —
|
|
509
|
+
// the action at the bottom of the classifier transcript.
|
|
510
|
+
agentMsgId: assistantMessage.message
|
|
511
|
+
.id,
|
|
512
|
+
classifierModel: classifierResult.model,
|
|
513
|
+
consecutiveDenials: classifierResult.shouldBlock
|
|
514
|
+
? denialState.consecutiveDenials + 1
|
|
515
|
+
: 0,
|
|
516
|
+
totalDenials: classifierResult.shouldBlock
|
|
517
|
+
? denialState.totalDenials + 1
|
|
518
|
+
: denialState.totalDenials,
|
|
519
|
+
// Overhead telemetry: token usage and latency for the classifier API call
|
|
520
|
+
classifierInputTokens: classifierResult.usage?.inputTokens,
|
|
521
|
+
classifierOutputTokens: classifierResult.usage?.outputTokens,
|
|
522
|
+
classifierCacheReadInputTokens: classifierResult.usage?.cacheReadInputTokens,
|
|
523
|
+
classifierCacheCreationInputTokens: classifierResult.usage?.cacheCreationInputTokens,
|
|
524
|
+
classifierDurationMs: classifierResult.durationMs,
|
|
525
|
+
// Character lengths of the prompt components sent to the classifier
|
|
526
|
+
classifierSystemPromptLength: classifierResult.promptLengths?.systemPrompt,
|
|
527
|
+
classifierToolCallsLength: classifierResult.promptLengths?.toolCalls,
|
|
528
|
+
classifierUserPromptsLength: classifierResult.promptLengths?.userPrompts,
|
|
529
|
+
// Session totals at time of classifier call (for computing overhead %).
|
|
530
|
+
// These are main-transcript-only — sideQuery (used by the classifier)
|
|
531
|
+
// does NOT call addToTotalSessionCost, so classifier tokens are excluded.
|
|
532
|
+
sessionInputTokens: getTotalInputTokens(),
|
|
533
|
+
sessionOutputTokens: getTotalOutputTokens(),
|
|
534
|
+
sessionCacheReadInputTokens: getTotalCacheReadInputTokens(),
|
|
535
|
+
sessionCacheCreationInputTokens: getTotalCacheCreationInputTokens(),
|
|
536
|
+
classifierCostUSD,
|
|
537
|
+
classifierStage: classifierResult.stage,
|
|
538
|
+
classifierStage1InputTokens: classifierResult.stage1Usage?.inputTokens,
|
|
539
|
+
classifierStage1OutputTokens: classifierResult.stage1Usage?.outputTokens,
|
|
540
|
+
classifierStage1CacheReadInputTokens: classifierResult.stage1Usage?.cacheReadInputTokens,
|
|
541
|
+
classifierStage1CacheCreationInputTokens: classifierResult.stage1Usage?.cacheCreationInputTokens,
|
|
542
|
+
classifierStage1DurationMs: classifierResult.stage1DurationMs,
|
|
543
|
+
classifierStage1RequestId: classifierResult.stage1RequestId,
|
|
544
|
+
classifierStage1MsgId: classifierResult.stage1MsgId,
|
|
545
|
+
classifierStage1CostUSD: classifierResult.stage1Usage && classifierResult.model
|
|
546
|
+
? calculateCostFromTokens(classifierResult.model, classifierResult.stage1Usage)
|
|
547
|
+
: undefined,
|
|
548
|
+
classifierStage2InputTokens: classifierResult.stage2Usage?.inputTokens,
|
|
549
|
+
classifierStage2OutputTokens: classifierResult.stage2Usage?.outputTokens,
|
|
550
|
+
classifierStage2CacheReadInputTokens: classifierResult.stage2Usage?.cacheReadInputTokens,
|
|
551
|
+
classifierStage2CacheCreationInputTokens: classifierResult.stage2Usage?.cacheCreationInputTokens,
|
|
552
|
+
classifierStage2DurationMs: classifierResult.stage2DurationMs,
|
|
553
|
+
classifierStage2RequestId: classifierResult.stage2RequestId,
|
|
554
|
+
classifierStage2MsgId: classifierResult.stage2MsgId,
|
|
555
|
+
classifierStage2CostUSD: classifierResult.stage2Usage && classifierResult.model
|
|
556
|
+
? calculateCostFromTokens(classifierResult.model, classifierResult.stage2Usage)
|
|
557
|
+
: undefined,
|
|
558
|
+
});
|
|
559
|
+
if (classifierResult.durationMs !== undefined) {
|
|
560
|
+
addToTurnClassifierDuration(classifierResult.durationMs);
|
|
561
|
+
}
|
|
562
|
+
if (classifierResult.shouldBlock) {
|
|
563
|
+
// Transcript exceeded the classifier's context window — deterministic
|
|
564
|
+
// error, won't recover on retry. Skip iron_gate and fall back to
|
|
565
|
+
// normal prompting so the user can approve/deny manually.
|
|
566
|
+
if (classifierResult.transcriptTooLong) {
|
|
567
|
+
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
568
|
+
// Permanent condition (transcript only grows) — deny-retry-deny
|
|
569
|
+
// wastes tokens without ever hitting the denial-limit abort.
|
|
570
|
+
throw new AbortError('Agent aborted: auto mode classifier transcript exceeded context window in headless mode');
|
|
571
|
+
}
|
|
572
|
+
logForDebugging('Auto mode classifier transcript too long, falling back to normal permission handling', { level: 'warn' });
|
|
573
|
+
return {
|
|
574
|
+
...result,
|
|
575
|
+
decisionReason: {
|
|
576
|
+
type: 'other',
|
|
577
|
+
reason: 'Auto mode classifier transcript exceeded context window — falling back to manual approval',
|
|
578
|
+
},
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
// When classifier is unavailable (API error), behavior depends on
|
|
582
|
+
// the thaddeus_iron_gate_closed gate.
|
|
583
|
+
if (classifierResult.unavailable) {
|
|
584
|
+
if (getFeatureValue_CACHED_WITH_REFRESH('thaddeus_iron_gate_closed', true, CLASSIFIER_FAIL_CLOSED_REFRESH_MS)) {
|
|
585
|
+
logForDebugging('Auto mode classifier unavailable, denying with retry guidance (fail closed)', { level: 'warn' });
|
|
586
|
+
return {
|
|
587
|
+
behavior: 'deny',
|
|
588
|
+
decisionReason: {
|
|
589
|
+
type: 'classifier',
|
|
590
|
+
classifier: 'auto-mode',
|
|
591
|
+
reason: 'Classifier unavailable',
|
|
592
|
+
},
|
|
593
|
+
message: buildClassifierUnavailableMessage(tool.name, classifierResult.model),
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
// Fail open: fall back to normal permission handling
|
|
597
|
+
logForDebugging('Auto mode classifier unavailable, falling back to normal permission handling (fail open)', { level: 'warn' });
|
|
598
|
+
return result;
|
|
599
|
+
}
|
|
600
|
+
// Update denial tracking and check limits
|
|
601
|
+
const newDenialState = recordDenial(denialState);
|
|
602
|
+
persistDenialState(context, newDenialState);
|
|
603
|
+
logForDebugging(`Auto mode classifier blocked action: ${classifierResult.reason}`, { level: 'warn' });
|
|
604
|
+
// If denial limit hit, fall back to prompting so the user
|
|
605
|
+
// can review. We check after the classifier so we can include
|
|
606
|
+
// its reason in the prompt.
|
|
607
|
+
const denialLimitResult = handleDenialLimitExceeded(newDenialState, appState, classifierResult.reason, assistantMessage, tool, result, context);
|
|
608
|
+
if (denialLimitResult) {
|
|
609
|
+
return denialLimitResult;
|
|
610
|
+
}
|
|
611
|
+
return {
|
|
612
|
+
behavior: 'deny',
|
|
613
|
+
decisionReason: {
|
|
614
|
+
type: 'classifier',
|
|
615
|
+
classifier: 'auto-mode',
|
|
616
|
+
reason: classifierResult.reason,
|
|
617
|
+
},
|
|
618
|
+
message: buildYoloRejectionMessage(classifierResult.reason),
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
// Reset consecutive denials on success
|
|
622
|
+
const newDenialState = recordSuccess(denialState);
|
|
623
|
+
persistDenialState(context, newDenialState);
|
|
624
|
+
return {
|
|
625
|
+
behavior: 'allow',
|
|
626
|
+
updatedInput: input,
|
|
627
|
+
decisionReason: {
|
|
628
|
+
type: 'classifier',
|
|
629
|
+
classifier: 'auto-mode',
|
|
630
|
+
reason: classifierResult.reason,
|
|
631
|
+
},
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
// When permission prompts should be avoided (e.g., background/headless agents),
|
|
635
|
+
// run PermissionRequest hooks first to give them a chance to allow/deny.
|
|
636
|
+
// Only auto-deny if no hook provides a decision.
|
|
637
|
+
if (appState.toolPermissionContext.shouldAvoidPermissionPrompts) {
|
|
638
|
+
const hookDecision = await runPermissionRequestHooksForHeadlessAgent(tool, input, toolUseID, context, appState.toolPermissionContext.mode, result.suggestions);
|
|
639
|
+
if (hookDecision) {
|
|
640
|
+
return hookDecision;
|
|
641
|
+
}
|
|
642
|
+
return {
|
|
643
|
+
behavior: 'deny',
|
|
644
|
+
decisionReason: {
|
|
645
|
+
type: 'asyncAgent',
|
|
646
|
+
reason: 'Permission prompts are not available in this context',
|
|
647
|
+
},
|
|
648
|
+
message: AUTO_REJECT_MESSAGE(tool.name),
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
return result;
|
|
653
|
+
};
|
|
654
|
+
/**
|
|
655
|
+
* Persist denial tracking state. For async subagents with localDenialTracking,
|
|
656
|
+
* mutate the local state in place (since setAppState is a no-op). Otherwise,
|
|
657
|
+
* write to appState as usual.
|
|
658
|
+
*/
|
|
659
|
+
function persistDenialState(context, newState) {
|
|
660
|
+
if (context.localDenialTracking) {
|
|
661
|
+
Object.assign(context.localDenialTracking, newState);
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
context.setAppState(prev => {
|
|
665
|
+
// recordSuccess returns the same reference when state is
|
|
666
|
+
// unchanged. Returning prev here lets store.setState's Object.is check
|
|
667
|
+
// skip the listener loop entirely.
|
|
668
|
+
if (prev.denialTracking === newState)
|
|
669
|
+
return prev;
|
|
670
|
+
return { ...prev, denialTracking: newState };
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Check if a denial limit was exceeded and return an 'ask' result
|
|
676
|
+
* so the user can review. Returns null if no limit was hit.
|
|
677
|
+
*/
|
|
678
|
+
function handleDenialLimitExceeded(denialState, appState, classifierReason, assistantMessage, tool, result, context) {
|
|
679
|
+
if (!shouldFallbackToPrompting(denialState)) {
|
|
680
|
+
return null;
|
|
681
|
+
}
|
|
682
|
+
const hitTotalLimit = denialState.totalDenials >= DENIAL_LIMITS.maxTotal;
|
|
683
|
+
const isHeadless = appState.toolPermissionContext.shouldAvoidPermissionPrompts;
|
|
684
|
+
// Capture counts before persistDenialState, which may mutate denialState
|
|
685
|
+
// in-place via Object.assign for subagents with localDenialTracking.
|
|
686
|
+
const totalCount = denialState.totalDenials;
|
|
687
|
+
const consecutiveCount = denialState.consecutiveDenials;
|
|
688
|
+
const warning = hitTotalLimit
|
|
689
|
+
? `${totalCount} actions were blocked this session. Please review the transcript before continuing.`
|
|
690
|
+
: `${consecutiveCount} consecutive actions were blocked. Please review the transcript before continuing.`;
|
|
691
|
+
logEvent('thaddeus_auto_mode_denial_limit_exceeded', {
|
|
692
|
+
limit: (hitTotalLimit
|
|
693
|
+
? 'total'
|
|
694
|
+
: 'consecutive'),
|
|
695
|
+
mode: (isHeadless
|
|
696
|
+
? 'headless'
|
|
697
|
+
: 'cli'),
|
|
698
|
+
messageID: assistantMessage.message
|
|
699
|
+
.id,
|
|
700
|
+
consecutiveDenials: consecutiveCount,
|
|
701
|
+
totalDenials: totalCount,
|
|
702
|
+
toolName: sanitizeToolNameForAnalytics(tool.name),
|
|
703
|
+
});
|
|
704
|
+
if (isHeadless) {
|
|
705
|
+
throw new AbortError('Agent aborted: too many classifier denials in headless mode');
|
|
706
|
+
}
|
|
707
|
+
logForDebugging(`Classifier denial limit exceeded, falling back to prompting: ${warning}`, { level: 'warn' });
|
|
708
|
+
if (hitTotalLimit) {
|
|
709
|
+
persistDenialState(context, {
|
|
710
|
+
...denialState,
|
|
711
|
+
totalDenials: 0,
|
|
712
|
+
consecutiveDenials: 0,
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
// Preserve the original classifier value (e.g. 'dangerous-agent-action')
|
|
716
|
+
// so downstream analytics in interactiveHandler can log the correct
|
|
717
|
+
// user override event.
|
|
718
|
+
const originalClassifier = result.decisionReason?.type === 'classifier'
|
|
719
|
+
? result.decisionReason.classifier
|
|
720
|
+
: 'auto-mode';
|
|
721
|
+
return {
|
|
722
|
+
...result,
|
|
723
|
+
decisionReason: {
|
|
724
|
+
type: 'classifier',
|
|
725
|
+
classifier: originalClassifier,
|
|
726
|
+
reason: `${warning}\n\nLatest blocked action: ${classifierReason}`,
|
|
727
|
+
},
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Check only the rule-based steps of the permission pipeline — the subset
|
|
732
|
+
* that bypassPermissions mode respects (everything that fires before step 2a).
|
|
733
|
+
*
|
|
734
|
+
* Returns a deny/ask decision if a rule blocks the tool, or null if no rule
|
|
735
|
+
* objects. Unlike hasPermissionsToUseTool, this does NOT run the auto mode classifier,
|
|
736
|
+
* mode-based transformations (dontAsk/auto/asyncAgent), PermissionRequest hooks,
|
|
737
|
+
* or bypassPermissions / always-allowed checks.
|
|
738
|
+
*
|
|
739
|
+
* Caller must pre-check tool.requiresUserInteraction() — step 1e is not replicated.
|
|
740
|
+
*/
|
|
741
|
+
export async function checkRuleBasedPermissions(tool, input, context) {
|
|
742
|
+
const appState = context.getAppState();
|
|
743
|
+
// 1a. Entire tool is denied by rule
|
|
744
|
+
const denyRule = getDenyRuleForTool(appState.toolPermissionContext, tool);
|
|
745
|
+
if (denyRule) {
|
|
746
|
+
return {
|
|
747
|
+
behavior: 'deny',
|
|
748
|
+
decisionReason: {
|
|
749
|
+
type: 'rule',
|
|
750
|
+
rule: denyRule,
|
|
751
|
+
},
|
|
752
|
+
message: `Permission to use ${tool.name} has been denied.`,
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
// 1b. Entire tool has an ask rule
|
|
756
|
+
const askRule = getAskRuleForTool(appState.toolPermissionContext, tool);
|
|
757
|
+
if (askRule) {
|
|
758
|
+
const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME &&
|
|
759
|
+
SandboxManager.isSandboxingEnabled() &&
|
|
760
|
+
SandboxManager.isAutoAllowBashIfSandboxedEnabled() &&
|
|
761
|
+
shouldUseSandbox(input);
|
|
762
|
+
if (!canSandboxAutoAllow) {
|
|
763
|
+
return {
|
|
764
|
+
behavior: 'ask',
|
|
765
|
+
decisionReason: {
|
|
766
|
+
type: 'rule',
|
|
767
|
+
rule: askRule,
|
|
768
|
+
},
|
|
769
|
+
message: createPermissionRequestMessage(tool.name),
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
// Fall through to let tool.checkPermissions handle command-specific rules
|
|
773
|
+
}
|
|
774
|
+
// 1c. Tool-specific permission check (e.g. bash subcommand rules)
|
|
775
|
+
let toolPermissionResult = {
|
|
776
|
+
behavior: 'passthrough',
|
|
777
|
+
message: createPermissionRequestMessage(tool.name),
|
|
778
|
+
};
|
|
779
|
+
try {
|
|
780
|
+
const parsedInput = tool.inputSchema.parse(input);
|
|
781
|
+
toolPermissionResult = await tool.checkPermissions(parsedInput, context);
|
|
782
|
+
}
|
|
783
|
+
catch (e) {
|
|
784
|
+
if (e instanceof AbortError || e instanceof APIUserAbortError) {
|
|
785
|
+
throw e;
|
|
786
|
+
}
|
|
787
|
+
logError(e);
|
|
788
|
+
}
|
|
789
|
+
// 1d. Tool implementation denied (catches bash subcommand denies wrapped
|
|
790
|
+
// in subcommandResults — no need to inspect decisionReason.type)
|
|
791
|
+
if (toolPermissionResult?.behavior === 'deny') {
|
|
792
|
+
return toolPermissionResult;
|
|
793
|
+
}
|
|
794
|
+
// 1f. Content-specific ask rules from tool.checkPermissions
|
|
795
|
+
// (e.g. Bash(npm publish:*) → {ask, type:'rule', ruleBehavior:'ask'})
|
|
796
|
+
if (toolPermissionResult?.behavior === 'ask' &&
|
|
797
|
+
toolPermissionResult.decisionReason?.type === 'rule' &&
|
|
798
|
+
toolPermissionResult.decisionReason.rule.ruleBehavior === 'ask') {
|
|
799
|
+
return toolPermissionResult;
|
|
800
|
+
}
|
|
801
|
+
// 1g. Safety checks (e.g. .git/, .claude/, .vscode/, shell configs) are
|
|
802
|
+
// bypass-immune — they must prompt even when a PreToolUse hook returned
|
|
803
|
+
// allow. checkPathSafetyForAutoEdit returns {type:'safetyCheck'} for these.
|
|
804
|
+
if (toolPermissionResult?.behavior === 'ask' &&
|
|
805
|
+
toolPermissionResult.decisionReason?.type === 'safetyCheck') {
|
|
806
|
+
return toolPermissionResult;
|
|
807
|
+
}
|
|
808
|
+
// No rule-based objection
|
|
809
|
+
return null;
|
|
810
|
+
}
|
|
811
|
+
async function hasPermissionsToUseToolInner(tool, input, context) {
|
|
812
|
+
if (context.abortController.signal.aborted) {
|
|
813
|
+
throw new AbortError();
|
|
814
|
+
}
|
|
815
|
+
let appState = context.getAppState();
|
|
816
|
+
// 1. Check if the tool is denied
|
|
817
|
+
// 1a. Entire tool is denied
|
|
818
|
+
const denyRule = getDenyRuleForTool(appState.toolPermissionContext, tool);
|
|
819
|
+
if (denyRule) {
|
|
820
|
+
return {
|
|
821
|
+
behavior: 'deny',
|
|
822
|
+
decisionReason: {
|
|
823
|
+
type: 'rule',
|
|
824
|
+
rule: denyRule,
|
|
825
|
+
},
|
|
826
|
+
message: `Permission to use ${tool.name} has been denied.`,
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
// 1b. Check if the entire tool should always ask for permission
|
|
830
|
+
const askRule = getAskRuleForTool(appState.toolPermissionContext, tool);
|
|
831
|
+
if (askRule) {
|
|
832
|
+
// When autoAllowBashIfSandboxed is on, sandboxed commands skip the ask rule and
|
|
833
|
+
// auto-allow via Bash's checkPermissions. Commands that won't be sandboxed (excluded
|
|
834
|
+
// commands, dangerouslyDisableSandbox) still need to respect the ask rule.
|
|
835
|
+
const canSandboxAutoAllow = tool.name === BASH_TOOL_NAME &&
|
|
836
|
+
SandboxManager.isSandboxingEnabled() &&
|
|
837
|
+
SandboxManager.isAutoAllowBashIfSandboxedEnabled() &&
|
|
838
|
+
shouldUseSandbox(input);
|
|
839
|
+
if (!canSandboxAutoAllow) {
|
|
840
|
+
return {
|
|
841
|
+
behavior: 'ask',
|
|
842
|
+
decisionReason: {
|
|
843
|
+
type: 'rule',
|
|
844
|
+
rule: askRule,
|
|
845
|
+
},
|
|
846
|
+
message: createPermissionRequestMessage(tool.name),
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
// Fall through to let Bash's checkPermissions handle command-specific rules
|
|
850
|
+
}
|
|
851
|
+
// 1c. Ask the tool implementation for a permission result
|
|
852
|
+
// Overridden unless tool input schema is not valid
|
|
853
|
+
let toolPermissionResult = {
|
|
854
|
+
behavior: 'passthrough',
|
|
855
|
+
message: createPermissionRequestMessage(tool.name),
|
|
856
|
+
};
|
|
857
|
+
try {
|
|
858
|
+
const parsedInput = tool.inputSchema.parse(input);
|
|
859
|
+
toolPermissionResult = await tool.checkPermissions(parsedInput, context);
|
|
860
|
+
}
|
|
861
|
+
catch (e) {
|
|
862
|
+
// Rethrow abort errors so they propagate properly
|
|
863
|
+
if (e instanceof AbortError || e instanceof APIUserAbortError) {
|
|
864
|
+
throw e;
|
|
865
|
+
}
|
|
866
|
+
logError(e);
|
|
867
|
+
}
|
|
868
|
+
// 1d. Tool implementation denied permission
|
|
869
|
+
if (toolPermissionResult?.behavior === 'deny') {
|
|
870
|
+
return toolPermissionResult;
|
|
871
|
+
}
|
|
872
|
+
// 1e. Tool requires user interaction even in bypass mode
|
|
873
|
+
if (tool.requiresUserInteraction?.() &&
|
|
874
|
+
toolPermissionResult?.behavior === 'ask') {
|
|
875
|
+
return toolPermissionResult;
|
|
876
|
+
}
|
|
877
|
+
// 1f. Content-specific ask rules from tool.checkPermissions take precedence
|
|
878
|
+
// over bypassPermissions mode. When a user explicitly configures a
|
|
879
|
+
// content-specific ask rule (e.g. Bash(npm publish:*)), the tool's
|
|
880
|
+
// checkPermissions returns {behavior:'ask', decisionReason:{type:'rule',
|
|
881
|
+
// rule:{ruleBehavior:'ask'}}}. This must be respected even in bypass mode,
|
|
882
|
+
// just as deny rules are respected at step 1d.
|
|
883
|
+
if (toolPermissionResult?.behavior === 'ask' &&
|
|
884
|
+
toolPermissionResult.decisionReason?.type === 'rule' &&
|
|
885
|
+
toolPermissionResult.decisionReason.rule.ruleBehavior === 'ask') {
|
|
886
|
+
return toolPermissionResult;
|
|
887
|
+
}
|
|
888
|
+
// 1g. Safety checks (e.g. .git/, .claude/, .vscode/, shell configs) are
|
|
889
|
+
// bypass-immune — they must prompt even in bypassPermissions mode.
|
|
890
|
+
// checkPathSafetyForAutoEdit returns {type:'safetyCheck'} for these paths.
|
|
891
|
+
if (toolPermissionResult?.behavior === 'ask' &&
|
|
892
|
+
toolPermissionResult.decisionReason?.type === 'safetyCheck') {
|
|
893
|
+
return toolPermissionResult;
|
|
894
|
+
}
|
|
895
|
+
// 2a. Check if mode allows the tool to run
|
|
896
|
+
// IMPORTANT: Call getAppState() to get the latest value
|
|
897
|
+
appState = context.getAppState();
|
|
898
|
+
// Check if permissions should be bypassed:
|
|
899
|
+
// - Direct bypassPermissions mode
|
|
900
|
+
// - Plan mode when the user originally started with bypass mode (isBypassPermissionsModeAvailable)
|
|
901
|
+
const shouldBypassPermissions = appState.toolPermissionContext.mode === 'bypassPermissions' ||
|
|
902
|
+
(appState.toolPermissionContext.mode === 'plan' &&
|
|
903
|
+
appState.toolPermissionContext.isBypassPermissionsModeAvailable);
|
|
904
|
+
if (shouldBypassPermissions) {
|
|
905
|
+
return {
|
|
906
|
+
behavior: 'allow',
|
|
907
|
+
updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input),
|
|
908
|
+
decisionReason: {
|
|
909
|
+
type: 'mode',
|
|
910
|
+
mode: appState.toolPermissionContext.mode,
|
|
911
|
+
},
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
// 2b. Entire tool is allowed
|
|
915
|
+
const alwaysAllowedRule = toolAlwaysAllowedRule(appState.toolPermissionContext, tool);
|
|
916
|
+
if (alwaysAllowedRule) {
|
|
917
|
+
return {
|
|
918
|
+
behavior: 'allow',
|
|
919
|
+
updatedInput: getUpdatedInputOrFallback(toolPermissionResult, input),
|
|
920
|
+
decisionReason: {
|
|
921
|
+
type: 'rule',
|
|
922
|
+
rule: alwaysAllowedRule,
|
|
923
|
+
},
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
// 3. Convert "passthrough" to "ask"
|
|
927
|
+
const result = toolPermissionResult.behavior === 'passthrough'
|
|
928
|
+
? {
|
|
929
|
+
...toolPermissionResult,
|
|
930
|
+
behavior: 'ask',
|
|
931
|
+
message: createPermissionRequestMessage(tool.name, toolPermissionResult.decisionReason),
|
|
932
|
+
}
|
|
933
|
+
: toolPermissionResult;
|
|
934
|
+
if (result.behavior === 'ask' && result.suggestions) {
|
|
935
|
+
logForDebugging(`Permission suggestions for ${tool.name}: ${jsonStringify(result.suggestions, null, 2)}`);
|
|
936
|
+
}
|
|
937
|
+
return result;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Delete a permission rule from the appropriate destination
|
|
941
|
+
*/
|
|
942
|
+
export async function deletePermissionRule({ rule, initialContext, setToolPermissionContext, }) {
|
|
943
|
+
if (rule.source === 'policySettings' ||
|
|
944
|
+
rule.source === 'flagSettings' ||
|
|
945
|
+
rule.source === 'command') {
|
|
946
|
+
throw new Error('Cannot delete permission rules from read-only settings');
|
|
947
|
+
}
|
|
948
|
+
const updatedContext = applyPermissionUpdate(initialContext, {
|
|
949
|
+
type: 'removeRules',
|
|
950
|
+
rules: [rule.ruleValue],
|
|
951
|
+
behavior: rule.ruleBehavior,
|
|
952
|
+
destination: rule.source,
|
|
953
|
+
});
|
|
954
|
+
// Per-destination logic to delete the rule from settings
|
|
955
|
+
const destination = rule.source;
|
|
956
|
+
switch (destination) {
|
|
957
|
+
case 'localSettings':
|
|
958
|
+
case 'userSettings':
|
|
959
|
+
case 'projectSettings': {
|
|
960
|
+
// Note: Typescript doesn't know that rule conforms to `PermissionRuleFromEditableSettings` even when we switch on `rule.source`
|
|
961
|
+
deletePermissionRuleFromSettings(rule);
|
|
962
|
+
break;
|
|
963
|
+
}
|
|
964
|
+
case 'cliArg':
|
|
965
|
+
case 'session': {
|
|
966
|
+
// No action needed for in-memory sources - not persisted to disk
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
// Update React state with updated context
|
|
971
|
+
setToolPermissionContext(updatedContext);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Helper to convert PermissionRule array to PermissionUpdate array
|
|
975
|
+
*/
|
|
976
|
+
function convertRulesToUpdates(rules, updateType) {
|
|
977
|
+
// Group rules by source and behavior
|
|
978
|
+
const grouped = new Map();
|
|
979
|
+
for (const rule of rules) {
|
|
980
|
+
const key = `${rule.source}:${rule.ruleBehavior}`;
|
|
981
|
+
if (!grouped.has(key)) {
|
|
982
|
+
grouped.set(key, []);
|
|
983
|
+
}
|
|
984
|
+
grouped.get(key).push(rule.ruleValue);
|
|
985
|
+
}
|
|
986
|
+
// Convert to PermissionUpdate array
|
|
987
|
+
const updates = [];
|
|
988
|
+
for (const [key, ruleValues] of grouped) {
|
|
989
|
+
const [source, behavior] = key.split(':');
|
|
990
|
+
updates.push({
|
|
991
|
+
type: updateType,
|
|
992
|
+
rules: ruleValues,
|
|
993
|
+
behavior: behavior,
|
|
994
|
+
destination: source,
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
return updates;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Apply permission rules to context (additive - for initial setup)
|
|
1001
|
+
*/
|
|
1002
|
+
export function applyPermissionRulesToPermissionContext(toolPermissionContext, rules) {
|
|
1003
|
+
const updates = convertRulesToUpdates(rules, 'addRules');
|
|
1004
|
+
return applyPermissionUpdates(toolPermissionContext, updates);
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Sync permission rules from disk (replacement - for settings changes)
|
|
1008
|
+
*/
|
|
1009
|
+
export function syncPermissionRulesFromDisk(toolPermissionContext, rules) {
|
|
1010
|
+
let context = toolPermissionContext;
|
|
1011
|
+
// When allowManagedPermissionRulesOnly is enabled, clear all non-policy sources
|
|
1012
|
+
if (shouldAllowManagedPermissionRulesOnly()) {
|
|
1013
|
+
const sourcesToClear = [
|
|
1014
|
+
'userSettings',
|
|
1015
|
+
'projectSettings',
|
|
1016
|
+
'localSettings',
|
|
1017
|
+
'cliArg',
|
|
1018
|
+
'session',
|
|
1019
|
+
];
|
|
1020
|
+
const behaviors = ['allow', 'deny', 'ask'];
|
|
1021
|
+
for (const source of sourcesToClear) {
|
|
1022
|
+
for (const behavior of behaviors) {
|
|
1023
|
+
context = applyPermissionUpdate(context, {
|
|
1024
|
+
type: 'replaceRules',
|
|
1025
|
+
rules: [],
|
|
1026
|
+
behavior,
|
|
1027
|
+
destination: source,
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
// Clear all disk-based source:behavior combos before applying new rules.
|
|
1033
|
+
// Without this, removing a rule from settings (e.g. deleting a deny entry)
|
|
1034
|
+
// would leave the old rule in the context because convertRulesToUpdates
|
|
1035
|
+
// only generates replaceRules for source:behavior pairs that have rules —
|
|
1036
|
+
// an empty group produces no update, so stale rules persist.
|
|
1037
|
+
const diskSources = [
|
|
1038
|
+
'userSettings',
|
|
1039
|
+
'projectSettings',
|
|
1040
|
+
'localSettings',
|
|
1041
|
+
];
|
|
1042
|
+
for (const diskSource of diskSources) {
|
|
1043
|
+
for (const behavior of ['allow', 'deny', 'ask']) {
|
|
1044
|
+
context = applyPermissionUpdate(context, {
|
|
1045
|
+
type: 'replaceRules',
|
|
1046
|
+
rules: [],
|
|
1047
|
+
behavior,
|
|
1048
|
+
destination: diskSource,
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
const updates = convertRulesToUpdates(rules, 'replaceRules');
|
|
1053
|
+
return applyPermissionUpdates(context, updates);
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Extract updatedInput from a permission result, falling back to the original input.
|
|
1057
|
+
* Handles the case where some PermissionResult variants don't have updatedInput.
|
|
1058
|
+
*/
|
|
1059
|
+
function getUpdatedInputOrFallback(permissionResult, fallback) {
|
|
1060
|
+
return (('updatedInput' in permissionResult
|
|
1061
|
+
? permissionResult.updatedInput
|
|
1062
|
+
: undefined) ?? fallback);
|
|
1063
|
+
}
|