@codingame/monaco-vscode-chat-service-override 34.1.2 → 35.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +38 -0
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +40 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +27 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +91 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +20 -4
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +148 -15
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +9 -1
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +57 -3
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +10 -14
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +29 -8
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +109 -2
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +207 -21
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +362 -37
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +698 -91
- package/vscode/src/vs/platform/agentHost/common/agentService.js +46 -3
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +1 -0
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +26 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +5 -5
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +17 -17
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +96 -12
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +226 -19
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +18 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +89 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +10 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +400 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +129 -446
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +35 -25
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +7 -1
- package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.d.ts +4 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +1 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +0 -6
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +5 -18
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +52 -3
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +212 -34
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +3 -4
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +11 -10
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +13 -6
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +6 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +399 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +85 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +177 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +898 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +204 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +338 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +57 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +98 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +149 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +116 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +226 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +138 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +25 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +108 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +63 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +322 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +15 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.js +26 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +132 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +237 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +32 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +71 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +19 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +66 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +128 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +58 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +15 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +64 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +45 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +25 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +143 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +7 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +163 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +26 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +106 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +44 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +11 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +9 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +143 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +107 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +46 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +19 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +244 -190
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +47 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +772 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +24 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +421 -201
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +1426 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +107 -127
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +331 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +898 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +581 -336
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +567 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +168 -84
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +183 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +897 -251
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.d.ts +213 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +720 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +354 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +11 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +55 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +192 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +37 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +40 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +230 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +35 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +26 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +56 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +109 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +38 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +175 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +32 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +183 -84
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +20 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +40 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +169 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +399 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +198 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +504 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +321 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +2117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +367 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +16 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +68 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +11 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +23 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +320 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +80 -4
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +226 -88
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +177 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +78 -136
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +1 -17
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +16 -5
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +24 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +113 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +227 -152
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +98 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +7 -6
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +11 -12
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +7 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +32 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +23 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +37 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +29 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +7 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +10 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +26 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +416 -252
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +25 -8
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +8 -3
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +0 -82
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -47
- /package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.js +0 -0
|
@@ -19,7 +19,8 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
|
19
19
|
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
20
20
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
21
21
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
|
|
22
|
-
import
|
|
22
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
|
|
23
|
+
import { ConfirmationOptionKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
|
|
23
24
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
|
|
24
25
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
|
|
25
26
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
|
|
@@ -53,12 +54,13 @@ import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/
|
|
|
53
54
|
import { ITerminalChatService, ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
54
55
|
import { ITerminalProfileResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
|
|
55
56
|
import { TerminalChatCommandId } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
|
|
56
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
57
|
+
import { TerminalChatAgentToolsSettingId, DEFAULT_IDLE_SILENCE_TIMEOUT_MS } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
57
58
|
import '../../common/terminalSandboxService.js';
|
|
58
59
|
import { getRecommendedToolsOverRunInTerminal } from '../alternativeRecommendation.js';
|
|
59
60
|
import { BasicExecuteStrategy } from '../executeStrategy/basicExecuteStrategy.js';
|
|
60
61
|
import { NoneExecuteStrategy } from '../executeStrategy/noneExecuteStrategy.js';
|
|
61
62
|
import { RichExecuteStrategy } from '../executeStrategy/richExecuteStrategy.js';
|
|
63
|
+
import { LargeOutputFileWriter } from '../largeOutputFileWriter.js';
|
|
62
64
|
import { getOutput } from '../outputHelpers.js';
|
|
63
65
|
import { isWindowsPowerShell, isPowerShell, isZsh, isFish, normalizeTerminalCommandForDisplay, buildCommandDisplayText, extractCdPrefix } from '../runInTerminalHelpers.js';
|
|
64
66
|
import { RunInTerminalToolTelemetry } from '../runInTerminalToolTelemetry.js';
|
|
@@ -82,23 +84,17 @@ import { outputLooksSandboxBlocked, outputLooksSandboxNetworkBlocked, SandboxOut
|
|
|
82
84
|
import { TerminalCommandArtifactCollector } from './terminalCommandArtifactCollector.js';
|
|
83
85
|
import { isToolEligibleForTerminalAutoApproval, isTerminalAutoApproveAllowed, isSessionAutoApproveLevel } from './terminalToolAutoApprove.js';
|
|
84
86
|
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
85
|
-
import { TerminalSandboxPrerequisiteCheck } from '../../../../../../platform/sandbox/common/terminalSandboxService.js';
|
|
87
|
+
import { TerminalSandboxPrerequisiteCheck, TerminalSandboxPreCheckRemediation } from '../../../../../../platform/sandbox/common/terminalSandboxService.js';
|
|
86
88
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
87
89
|
import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
|
|
88
90
|
import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
|
|
89
91
|
|
|
90
|
-
var RunInTerminalTool_1;
|
|
92
|
+
var RunInTerminalTool_1, TerminalProfileFetcher_1;
|
|
91
93
|
const TERMINAL_SANDBOX_DOCUMENTATION_URL = "https://aka.ms/vscode-sandboxing";
|
|
92
94
|
const TOOL_REFERENCE_NAME = "runInTerminal";
|
|
93
95
|
const LEGACY_TOOL_REFERENCE_FULL_NAMES = ["runCommands/runInTerminal"];
|
|
94
96
|
const INPUT_NEEDED_NOTIFICATION_THROTTLE_MS = 5000;
|
|
95
|
-
function createPowerShellModelDescription(
|
|
96
|
-
shell,
|
|
97
|
-
isSandboxEnabled,
|
|
98
|
-
allowToRunUnsandboxedCommands,
|
|
99
|
-
retryWithAllowNetworkRequests,
|
|
100
|
-
networkDomains
|
|
101
|
-
) {
|
|
97
|
+
function createPowerShellModelDescription(shell, sandboxingOptions) {
|
|
102
98
|
const isWinPwsh = isWindowsPowerShell(shell);
|
|
103
99
|
const parts = [
|
|
104
100
|
`This tool allows you to execute ${isWinPwsh ? "Windows PowerShell 5.1" : "PowerShell"} commands in a persistent terminal session, preserving environment variables, working directory, and other context across multiple commands.`,
|
|
@@ -119,25 +115,22 @@ function createPowerShellModelDescription(
|
|
|
119
115
|
"- Install modules via Install-Module, Install-Package",
|
|
120
116
|
"- Use Get-Command to verify cmdlet/function availability",
|
|
121
117
|
"",
|
|
122
|
-
"
|
|
123
|
-
"-
|
|
124
|
-
|
|
118
|
+
"Execution Mode:",
|
|
119
|
+
"- For ALL one-shot commands (builds, tests, installs, compilation, linting, downloads, scripts), use mode=sync and omit timeout. The tool waits for the command to complete and returns full output inline. This is the default and strongly preferred mode.",
|
|
120
|
+
`- Use mode=async ONLY for processes that must keep running indefinitely while you do other work (servers, watchers, dev daemons). Async waits for an initial idle/output signal, then returns a terminal ID and output snapshot while the process continues running.`,
|
|
121
|
+
`- In sync mode, the full output is returned when the command completes — you do NOT need to call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly says the command was moved to background, timed out, or needs input.`,
|
|
125
122
|
"- Returns a terminal ID for checking status and runtime later",
|
|
126
123
|
"- Use Start-Job for background PowerShell jobs",
|
|
127
124
|
"",
|
|
128
125
|
`Use ${TerminalToolId.SendToTerminal} to send commands or input to a terminal session.`
|
|
129
126
|
];
|
|
130
|
-
if (
|
|
131
|
-
parts.push(...createSandboxLines(
|
|
132
|
-
allowToRunUnsandboxedCommands,
|
|
133
|
-
retryWithAllowNetworkRequests,
|
|
134
|
-
networkDomains
|
|
135
|
-
));
|
|
127
|
+
if (sandboxingOptions.sandboxMode !== "off") {
|
|
128
|
+
parts.push(...createSandboxLines(sandboxingOptions));
|
|
136
129
|
}
|
|
137
130
|
parts.push(
|
|
138
131
|
"",
|
|
139
132
|
"Output Management:",
|
|
140
|
-
"- Output is
|
|
133
|
+
"- Output exceeding 20KB is saved to a temp file; the result includes the file path so you can read the full output with readFile or search it with grep",
|
|
141
134
|
"- Use Select-Object, Where-Object, Format-Table to filter output",
|
|
142
135
|
"- Use -First/-Last parameters to limit results",
|
|
143
136
|
"- For pager commands, add | Out-String or | Format-List",
|
|
@@ -151,6 +144,7 @@ function createPowerShellModelDescription(
|
|
|
151
144
|
"- Be specific with Select-Object properties to avoid excessive output",
|
|
152
145
|
"- Avoid printing credentials unless absolutely required",
|
|
153
146
|
`- NEVER run Start-Sleep or similar wait commands. You will be automatically notified on your next turn when async terminal commands or timed-out sync commands complete or need input. Do NOT poll for completion.`,
|
|
147
|
+
"- NEVER pipe interactive commands through Select-Object, Where-Object, or other filters — this hides prompts and prevents the terminal from detecting when input is needed. Run interactive commands without pipes.",
|
|
154
148
|
"",
|
|
155
149
|
"Interactive Input Handling:",
|
|
156
150
|
"- When a terminal command is waiting for interactive input, do NOT suggest alternatives or ask the user whether to proceed. Instead, use the vscode_askQuestions tool to collect the needed values from the user, then send them.",
|
|
@@ -161,60 +155,97 @@ function createPowerShellModelDescription(
|
|
|
161
155
|
);
|
|
162
156
|
return parts.join("\n");
|
|
163
157
|
}
|
|
164
|
-
function createSandboxLines(
|
|
165
|
-
|
|
166
|
-
retryWithAllowNetworkRequests,
|
|
167
|
-
networkDomains
|
|
168
|
-
) {
|
|
158
|
+
function createSandboxLines(sandboxingOptions) {
|
|
159
|
+
const isNetworkAvailable = sandboxingOptions.sandboxMode === "on-network-available";
|
|
169
160
|
const lines = [
|
|
170
161
|
"",
|
|
171
162
|
"Sandboxing:",
|
|
172
|
-
"-
|
|
173
|
-
"-
|
|
174
|
-
"-
|
|
163
|
+
isNetworkAvailable ? "- Commands run inside a sandbox by default. The sandbox keeps the filesystem mostly read-only." : "- Commands run inside a sandbox by default. The sandbox restricts two things independently: the filesystem and the network.",
|
|
164
|
+
"- Filesystem: read-only outside the workspace and $TMPDIR, which stay read-write. Parts of $HOME are hidden for privacy, but common developer tools (git, package managers, language toolchains) still work because their $HOME config and cache paths are automatically made readable.",
|
|
165
|
+
"- Use $TMPDIR for temporary files; /tmp may not be writable. On macOS and Linux the TMPDIR env var is set to a writable path.",
|
|
166
|
+
"- If a command needs sandboxed write access to specific file paths outside workspace, pass requestFileValidationCheck with those paths. VS Code checks sandbox access before execution and returns Access Denied without running the command when access is unavailable."
|
|
175
167
|
];
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
168
|
+
if (!isNetworkAvailable) {
|
|
169
|
+
const deniedDomains = sandboxingOptions.networkDomains?.deniedDomains ?? [];
|
|
170
|
+
const allowedDomains = sandboxingOptions.networkDomains?.allowedDomains ?? [];
|
|
171
|
+
const deniedSet = ( new Set(deniedDomains));
|
|
172
|
+
const effectiveAllowed = allowedDomains.filter(d => !( deniedSet.has(d)));
|
|
173
|
+
const retrySuffix = sandboxingOptions.retryWithAllowNetworkRequests ? " unless requestAllowNetwork=true is set" : "";
|
|
174
|
+
if (effectiveAllowed.length === 0) {
|
|
175
|
+
lines.push(
|
|
176
|
+
`- Network: blocked in the sandbox; commands that need the network fail${retrySuffix}.`
|
|
177
|
+
);
|
|
178
|
+
} else {
|
|
179
|
+
lines.push(
|
|
180
|
+
`- Network: only these domains are reachable in the sandbox: ${effectiveAllowed.join(", ")}. Other domains fail${retrySuffix}.`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
if (deniedDomains.length > 0) {
|
|
184
|
+
lines.push(
|
|
185
|
+
`- These domains are explicitly blocked in the sandbox: ${deniedDomains.join(", ")}`
|
|
186
|
+
);
|
|
187
|
+
}
|
|
182
188
|
}
|
|
183
|
-
if (allowToRunUnsandboxedCommands) {
|
|
189
|
+
if (sandboxingOptions.retryWithAllowNetworkRequests || sandboxingOptions.allowToRunUnsandboxedCommands) {
|
|
184
190
|
lines.push(
|
|
185
|
-
"-
|
|
186
|
-
"- Only set requestUnsandboxedExecution=true when there is evidence of failures caused by the sandbox, e.g. 'Operation not permitted' errors, network failures, or file access errors, etc",
|
|
187
|
-
"- When setting requestUnsandboxedExecution=true, also provide requestUnsandboxedExecutionReason explaining why the command needs unsandboxed access"
|
|
191
|
+
"- To get more access (each prompts the user — never ask the user for permission yourself):"
|
|
188
192
|
);
|
|
189
|
-
|
|
190
|
-
lines.push(
|
|
191
|
-
"- Running commands outside the sandbox is disabled by the current chat.agent.sandbox.allowUnsandboxedCommands setting. Do not set requestUnsandboxedExecution=true."
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
if (networkDomains) {
|
|
195
|
-
const deniedSet = ( new Set(networkDomains.deniedDomains));
|
|
196
|
-
const effectiveAllowed = networkDomains.allowedDomains.filter(d => !( deniedSet.has(d)));
|
|
197
|
-
if (effectiveAllowed.length === 0) {
|
|
198
|
-
lines.push("- All network access is blocked in the sandbox");
|
|
199
|
-
} else {
|
|
193
|
+
if (sandboxingOptions.retryWithAllowNetworkRequests) {
|
|
200
194
|
lines.push(
|
|
201
|
-
|
|
195
|
+
" - Need a blocked domain? Set requestAllowNetwork=true and provide requestAllowNetworkReason. This keeps the filesystem sandbox in place and only relaxes the network, so prefer it for network-only needs. Do this proactively when network use is obvious (git fetch/pull/push/clone; npm/yarn/pnpm/pip/cargo/go/brew installs; curl; wget), or reactively after a network failure (e.g. 'Network request failed', HTTP code 403)."
|
|
202
196
|
);
|
|
203
197
|
}
|
|
204
|
-
if (
|
|
198
|
+
if (sandboxingOptions.allowToRunUnsandboxedCommands) {
|
|
199
|
+
const removesAllClause = sandboxingOptions.retryWithAllowNetworkRequests ? "This grants full filesystem AND network access by removing all sandbox protection, so for network-only needs prefer requestAllowNetwork and use this only when filesystem (or other non-network) access is also blocked." : "This grants full filesystem and network access by removing all sandbox protection, so use it only when the command truly needs it.";
|
|
205
200
|
lines.push(
|
|
206
|
-
|
|
201
|
+
` - Need filesystem or other access the sandbox blocks? Set requestUnsandboxedExecution=true and provide requestUnsandboxedExecutionReason. ${removesAllClause} Do this proactively when it clearly needs it (writing/deleting files outside the workspace and $TMPDIR like $HOME, /usr, /etc; installing to system locations; elevated privileges), or reactively after a sandbox failure (e.g. \'Operation not permitted\').`
|
|
207
202
|
);
|
|
208
203
|
}
|
|
209
204
|
}
|
|
205
|
+
if (!sandboxingOptions.allowToRunUnsandboxedCommands) {
|
|
206
|
+
lines.push(
|
|
207
|
+
"- Running commands outside the sandbox is disabled by chat.agent.sandbox.allowUnsandboxedCommands. Do not set requestUnsandboxedExecution=true."
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
210
|
return lines;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
function createSandboxProperties(sandboxingOptions) {
|
|
213
|
+
const isNetworkAvailable = sandboxingOptions.sandboxMode === "on-network-available";
|
|
214
|
+
return {
|
|
215
|
+
...(sandboxingOptions.allowToRunUnsandboxedCommands ? {
|
|
216
|
+
requestUnsandboxedExecution: {
|
|
217
|
+
type: "boolean",
|
|
218
|
+
description: "Request that this command run outside the terminal sandbox. Only set this when the command clearly needs unsandboxed access. The user will be prompted before the command runs unsandboxed."
|
|
219
|
+
},
|
|
220
|
+
requestUnsandboxedExecutionReason: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "A short explanation of why this command must run outside the terminal sandbox. Only provide this when requestUnsandboxedExecution is true."
|
|
223
|
+
}
|
|
224
|
+
} : {}),
|
|
225
|
+
...(isNetworkAvailable || !sandboxingOptions.retryWithAllowNetworkRequests ? {} : {
|
|
226
|
+
requestAllowNetwork: {
|
|
227
|
+
type: "boolean",
|
|
228
|
+
description: "Request that this command remain in the terminal sandbox but run with unrestricted network access. Only set this when the command clearly needs network access but the required network access was blocked. The user will be prompted before network restrictions are relaxed."
|
|
229
|
+
},
|
|
230
|
+
requestAllowNetworkReason: {
|
|
231
|
+
type: "string",
|
|
232
|
+
description: "A short explanation of why this sandboxed command needs unrestricted network access. Only provide this when requestAllowNetwork is true."
|
|
233
|
+
}
|
|
234
|
+
}),
|
|
235
|
+
requestFileValidationCheck: {
|
|
236
|
+
type: "array",
|
|
237
|
+
description: "Sandbox write access checks to perform before running the command. Provide the file paths that the command needs to write.",
|
|
238
|
+
items: {
|
|
239
|
+
type: "string"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
requestFileValidationCheckReason: {
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "A short explanation of why this sandboxed command needs these file paths. Only provide this when requestFileValidationCheck is not empty."
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
function createGenericDescription(sandboxingOptions) {
|
|
218
249
|
const parts = [`
|
|
219
250
|
Command Execution:
|
|
220
251
|
- Use && to chain simple commands on one line
|
|
@@ -233,23 +264,19 @@ Program Execution:
|
|
|
233
264
|
- Install packages via package managers (brew, apt, etc.)
|
|
234
265
|
- Use which or command -v to verify command availability
|
|
235
266
|
|
|
236
|
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
267
|
+
Execution Mode:
|
|
268
|
+
- For ALL one-shot commands (builds, tests, installs, compilation, linting, downloads, scripts), use mode='sync' and omit timeout. The tool waits for the command to complete and returns full output inline. This is the default and strongly preferred mode.
|
|
269
|
+
- Use mode='async' ONLY for processes that must keep running indefinitely while you do other work (servers, watchers, dev daemons). Async waits for an initial idle/output signal, then returns a terminal ID and output snapshot while the process continues running.
|
|
270
|
+
- In sync mode, the full output is returned when the command completes — you do NOT need to call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly says the command was moved to background, timed out, or needs input.
|
|
240
271
|
|
|
241
272
|
Use ${TerminalToolId.SendToTerminal} to send commands or input to a terminal session.`];
|
|
242
|
-
if (
|
|
243
|
-
parts.push(createSandboxLines(
|
|
244
|
-
allowToRunUnsandboxedCommands,
|
|
245
|
-
retryWithAllowNetworkRequests,
|
|
246
|
-
networkDomains
|
|
247
|
-
).join("\n"));
|
|
273
|
+
if (sandboxingOptions.sandboxMode !== "off") {
|
|
274
|
+
parts.push(createSandboxLines(sandboxingOptions).join("\n"));
|
|
248
275
|
}
|
|
249
276
|
parts.push(`
|
|
250
277
|
|
|
251
278
|
Output Management:
|
|
252
|
-
- Output is
|
|
279
|
+
- Output exceeding 20KB is saved to a temp file; the result includes the file path so you can read the full output with readFile or search it with grep
|
|
253
280
|
- Use head, tail, grep, awk to filter and limit output size
|
|
254
281
|
- For pager commands, disable paging: git --no-pager or add | cat
|
|
255
282
|
- Use wc -l to count lines before displaying large outputs
|
|
@@ -260,6 +287,7 @@ Best Practices:
|
|
|
260
287
|
- Be specific with commands to avoid excessive output
|
|
261
288
|
- Avoid printing credentials unless absolutely required
|
|
262
289
|
- NEVER run sleep or similar wait commands in a terminal. You will be automatically notified on your next turn when async terminal commands or timed-out sync commands complete or need input. Do NOT poll for completion.
|
|
290
|
+
- NEVER pipe interactive commands through tail, head, grep, or other filters — this hides prompts and prevents the terminal from detecting when input is needed. Run interactive commands without pipes.
|
|
263
291
|
|
|
264
292
|
Interactive Input Handling:
|
|
265
293
|
- When a terminal command is waiting for interactive input, do NOT suggest alternatives or ask the user whether to proceed. Instead, use the vscode_askQuestions tool to collect the needed values from the user, then send them.
|
|
@@ -269,38 +297,18 @@ Interactive Input Handling:
|
|
|
269
297
|
- Continue one prompt at a time until the command finishes.`);
|
|
270
298
|
return parts.join("");
|
|
271
299
|
}
|
|
272
|
-
function createBashModelDescription(
|
|
273
|
-
isSandboxEnabled,
|
|
274
|
-
allowToRunUnsandboxedCommands,
|
|
275
|
-
retryWithAllowNetworkRequests,
|
|
276
|
-
networkDomains
|
|
277
|
-
) {
|
|
300
|
+
function createBashModelDescription(sandboxingOptions) {
|
|
278
301
|
return [
|
|
279
302
|
"This tool allows you to execute shell commands in a persistent bash terminal session, preserving environment variables, working directory, and other context across multiple commands.",
|
|
280
|
-
createGenericDescription(
|
|
281
|
-
isSandboxEnabled,
|
|
282
|
-
allowToRunUnsandboxedCommands,
|
|
283
|
-
retryWithAllowNetworkRequests,
|
|
284
|
-
networkDomains
|
|
285
|
-
),
|
|
303
|
+
createGenericDescription(sandboxingOptions),
|
|
286
304
|
"- Use [[ ]] for conditional tests instead of [ ]",
|
|
287
305
|
"- Prefer $() over backticks for command substitution"
|
|
288
306
|
].join("\n");
|
|
289
307
|
}
|
|
290
|
-
function createZshModelDescription(
|
|
291
|
-
isSandboxEnabled,
|
|
292
|
-
allowToRunUnsandboxedCommands,
|
|
293
|
-
retryWithAllowNetworkRequests,
|
|
294
|
-
networkDomains
|
|
295
|
-
) {
|
|
308
|
+
function createZshModelDescription(sandboxingOptions) {
|
|
296
309
|
return [
|
|
297
310
|
"This tool allows you to execute shell commands in a persistent zsh terminal session, preserving environment variables, working directory, and other context across multiple commands.",
|
|
298
|
-
createGenericDescription(
|
|
299
|
-
isSandboxEnabled,
|
|
300
|
-
allowToRunUnsandboxedCommands,
|
|
301
|
-
retryWithAllowNetworkRequests,
|
|
302
|
-
networkDomains
|
|
303
|
-
),
|
|
311
|
+
createGenericDescription(sandboxingOptions),
|
|
304
312
|
"- Use type to check command type (builtin, function, alias)",
|
|
305
313
|
"- Use jobs, fg, bg for job control",
|
|
306
314
|
"- Use [[ ]] for conditional tests instead of [ ]",
|
|
@@ -312,20 +320,10 @@ function createZshModelDescription(
|
|
|
312
320
|
"- NEVER use status as a variable name (it is read-only in zsh). Use exit_code or ret instead"
|
|
313
321
|
].join("\n");
|
|
314
322
|
}
|
|
315
|
-
function createFishModelDescription(
|
|
316
|
-
isSandboxEnabled,
|
|
317
|
-
allowToRunUnsandboxedCommands,
|
|
318
|
-
retryWithAllowNetworkRequests,
|
|
319
|
-
networkDomains
|
|
320
|
-
) {
|
|
323
|
+
function createFishModelDescription(sandboxingOptions) {
|
|
321
324
|
return [
|
|
322
325
|
"This tool allows you to execute shell commands in a persistent fish terminal session, preserving environment variables, working directory, and other context across multiple commands.",
|
|
323
|
-
createGenericDescription(
|
|
324
|
-
isSandboxEnabled,
|
|
325
|
-
allowToRunUnsandboxedCommands,
|
|
326
|
-
retryWithAllowNetworkRequests,
|
|
327
|
-
networkDomains
|
|
328
|
-
),
|
|
326
|
+
createGenericDescription(sandboxingOptions),
|
|
329
327
|
"- Use type to check command type (builtin, function, alias)",
|
|
330
328
|
"- Use jobs, fg, bg for job control",
|
|
331
329
|
"- Use test expressions for conditionals (no [[ ]] syntax)",
|
|
@@ -347,38 +345,28 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
347
345
|
terminalSandboxService.isEnabled(),
|
|
348
346
|
terminalSandboxService.isSandboxAllowNetworkEnabled()
|
|
349
347
|
]);
|
|
350
|
-
const
|
|
351
|
-
|
|
348
|
+
const sandboxingOptions = (isSandboxEnabled ? (isSandboxAllowNetworkEnabled ? {
|
|
349
|
+
sandboxMode: "on-network-available",
|
|
350
|
+
allowToRunUnsandboxedCommands,
|
|
351
|
+
retryWithAllowNetworkRequests: false,
|
|
352
|
+
networkDomains: undefined
|
|
353
|
+
} : {
|
|
354
|
+
sandboxMode: "on-network-restricted",
|
|
355
|
+
allowToRunUnsandboxedCommands,
|
|
356
|
+
retryWithAllowNetworkRequests: retryWithAllowNetworkRequestsSetting,
|
|
357
|
+
networkDomains: terminalSandboxService.getResolvedNetworkDomains()
|
|
358
|
+
}) : {
|
|
359
|
+
sandboxMode: "off"
|
|
360
|
+
});
|
|
352
361
|
let modelDescription;
|
|
353
362
|
if (shell && os && isPowerShell(shell, os)) {
|
|
354
|
-
modelDescription = createPowerShellModelDescription(
|
|
355
|
-
shell,
|
|
356
|
-
isSandboxEnabled,
|
|
357
|
-
allowToRunUnsandboxedCommands,
|
|
358
|
-
retryWithAllowNetworkRequests,
|
|
359
|
-
networkDomains
|
|
360
|
-
);
|
|
363
|
+
modelDescription = createPowerShellModelDescription(shell, sandboxingOptions);
|
|
361
364
|
} else if (shell && os && isZsh(shell, os)) {
|
|
362
|
-
modelDescription = createZshModelDescription(
|
|
363
|
-
isSandboxEnabled,
|
|
364
|
-
allowToRunUnsandboxedCommands,
|
|
365
|
-
retryWithAllowNetworkRequests,
|
|
366
|
-
networkDomains
|
|
367
|
-
);
|
|
365
|
+
modelDescription = createZshModelDescription(sandboxingOptions);
|
|
368
366
|
} else if (shell && os && isFish(shell, os)) {
|
|
369
|
-
modelDescription = createFishModelDescription(
|
|
370
|
-
isSandboxEnabled,
|
|
371
|
-
allowToRunUnsandboxedCommands,
|
|
372
|
-
retryWithAllowNetworkRequests,
|
|
373
|
-
networkDomains
|
|
374
|
-
);
|
|
367
|
+
modelDescription = createFishModelDescription(sandboxingOptions);
|
|
375
368
|
} else {
|
|
376
|
-
modelDescription = createBashModelDescription(
|
|
377
|
-
isSandboxEnabled,
|
|
378
|
-
allowToRunUnsandboxedCommands,
|
|
379
|
-
retryWithAllowNetworkRequests,
|
|
380
|
-
networkDomains
|
|
381
|
-
);
|
|
369
|
+
modelDescription = createBashModelDescription(sandboxingOptions);
|
|
382
370
|
}
|
|
383
371
|
const sharedProperties = {
|
|
384
372
|
command: {
|
|
@@ -394,37 +382,14 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
394
382
|
description: "A short description of the goal or purpose of the command (e.g., \"Install dependencies\", \"Start development server\")."
|
|
395
383
|
}
|
|
396
384
|
};
|
|
397
|
-
const sandboxProperties =
|
|
398
|
-
allowToRunUnsandboxedCommands: {
|
|
399
|
-
type: "boolean",
|
|
400
|
-
const: allowToRunUnsandboxedCommands,
|
|
401
|
-
default: allowToRunUnsandboxedCommands,
|
|
402
|
-
description: "Whether this tool invocation is allowed to run commands outside the terminal sandbox. This value is set by VS Code based on chat.agent.sandbox.allowUnsandboxedCommands."
|
|
403
|
-
},
|
|
404
|
-
requestUnsandboxedExecution: {
|
|
405
|
-
type: "boolean",
|
|
406
|
-
description: "Request that this command run outside the terminal sandbox. Only set this when the command clearly needs unsandboxed access. The user will be prompted before the command runs unsandboxed."
|
|
407
|
-
},
|
|
408
|
-
requestUnsandboxedExecutionReason: {
|
|
409
|
-
type: "string",
|
|
410
|
-
description: "A short explanation of why this command must run outside the terminal sandbox. Only provide this when requestUnsandboxedExecution is true."
|
|
411
|
-
},
|
|
412
|
-
requestAllowNetwork: {
|
|
413
|
-
type: "boolean",
|
|
414
|
-
description: "Request that this command remain in the terminal sandbox but run with unrestricted network access. Only set this when the command clearly needs network access but the required network access was blocked. The user will be prompted before network restrictions are relaxed."
|
|
415
|
-
},
|
|
416
|
-
requestAllowNetworkReason: {
|
|
417
|
-
type: "string",
|
|
418
|
-
description: "A short explanation of why this sandboxed command needs unrestricted network access. Only provide this when requestAllowNetwork is true."
|
|
419
|
-
}
|
|
420
|
-
} : {};
|
|
385
|
+
const sandboxProperties = sandboxingOptions.sandboxMode === "off" ? {} : createSandboxProperties(sandboxingOptions);
|
|
421
386
|
return {
|
|
422
387
|
id: TerminalToolId.RunInTerminal,
|
|
423
388
|
toolReferenceName: TOOL_REFERENCE_NAME,
|
|
424
389
|
legacyToolReferenceFullNames: LEGACY_TOOL_REFERENCE_FULL_NAMES,
|
|
425
|
-
displayName: ( localize(
|
|
426
|
-
modelDescription: `${modelDescription}\n\nExecution mode:\n- mode='sync':
|
|
427
|
-
userDescription: ( localize(
|
|
390
|
+
displayName: ( localize(15318, "Run in Terminal")),
|
|
391
|
+
modelDescription: `${modelDescription}\n\nExecution mode:\n- mode='sync' (strongly preferred): waits for the command to complete and returns full output inline. Use for ALL one-shot commands (builds, tests, installs, compilation, scripts). Omit timeout to let the command run to completion — the tool handles idle detection and input prompts automatically.\n- mode='async': waits for an initial idle/output signal from the command, then returns a terminal ID and output snapshot while the process continues running. Use ONLY for processes that must keep running indefinitely (servers, watchers, daemons). Timeout caps how long to wait for the initial idle/output signal.\n\nTimeout parameter: Usually omit timeout entirely for sync commands — the tool returns automatically on completion, input-needed, or cancellation. Only set a timeout as a safety net for commands you suspect might hang. Use 0 to explicitly indicate no timeout.\n\nSync output is final: When a sync command completes, the full output is returned inline — do NOT call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly indicates the command was moved to background, timed out, or needs input. Do NOT tell the user to check the terminal panel — all command output is already included in the tool result.\n\nTerminal notifications: When an async command finishes or a sync command times out, you will be automatically notified on your next turn with the exit code and terminal output. You will also be notified if the terminal needs input. Do NOT poll or sleep to wait for completion.`,
|
|
392
|
+
userDescription: ( localize(15319, "Run commands in the terminal")),
|
|
428
393
|
source: ToolDataSource.Internal,
|
|
429
394
|
icon: Codicon.terminal,
|
|
430
395
|
inputSchema: {
|
|
@@ -436,10 +401,10 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
436
401
|
type: "string",
|
|
437
402
|
enum: ["sync", "async"],
|
|
438
403
|
enumDescriptions: [
|
|
439
|
-
"Wait for completion
|
|
440
|
-
"Wait for an initial idle/output signal, then return
|
|
404
|
+
"Wait for command completion and return full output inline. Strongly preferred for all one-shot commands (builds, tests, installs, scripts).",
|
|
405
|
+
"Wait for an initial idle/output signal, then return a terminal ID and output snapshot while the process continues running. Timeout caps how long to wait for the initial signal. Use ONLY for processes that must keep running indefinitely (servers, watchers, daemons)."
|
|
441
406
|
],
|
|
442
|
-
description: "Execution mode for this command."
|
|
407
|
+
description: "Execution mode for this command. Use sync (default) for nearly all commands."
|
|
443
408
|
},
|
|
444
409
|
isBackground: {
|
|
445
410
|
type: "boolean",
|
|
@@ -447,7 +412,7 @@ async function createRunInTerminalToolData(accessor) {
|
|
|
447
412
|
},
|
|
448
413
|
timeout: {
|
|
449
414
|
type: "number",
|
|
450
|
-
description: "Optional.
|
|
415
|
+
description: "Optional. Usually omit entirely for sync commands — the tool waits for completion automatically. Only set a timeout (in milliseconds) as a safety net if you suspect the command might hang. If the timeout elapses, the command continues in the background and you get a terminal ID to check output later. Use 0 to explicitly indicate no timeout."
|
|
451
416
|
}
|
|
452
417
|
},
|
|
453
418
|
required: ["command", "explanation", "goal", "mode"]
|
|
@@ -490,7 +455,7 @@ function shouldAutomaticallyRetryAllowNetworkInSandboxed(options) {
|
|
|
490
455
|
const telemetryIgnoredSequences = [
|
|
491
456
|
"\u001b[I",
|
|
492
457
|
"\u001b[O"];
|
|
493
|
-
const altBufferMessage = "\n" + ( localize(
|
|
458
|
+
const altBufferMessage = "\n" + ( localize(15320, "The command opened the alternate buffer."));
|
|
494
459
|
function buildCompletionNotificationCommand(command) {
|
|
495
460
|
const firstNewline = command.search(/\r|\n/);
|
|
496
461
|
const hasMoreLines = firstNewline !== -1;
|
|
@@ -565,9 +530,6 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
565
530
|
get _allowUnsandboxedCommands() {
|
|
566
531
|
return this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxAllowUnsandboxedCommands) === true;
|
|
567
532
|
}
|
|
568
|
-
get _autoApproveUnsandboxedCommands() {
|
|
569
|
-
return this._allowUnsandboxedCommands && this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxAutoApproveUnsandboxedCommands) === true;
|
|
570
|
-
}
|
|
571
533
|
get _retryWithAllowNetworkRequests() {
|
|
572
534
|
return this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxRetryWithAllowNetworkRequests) === true;
|
|
573
535
|
}
|
|
@@ -585,16 +547,31 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
585
547
|
}
|
|
586
548
|
_getUnsandboxedExecutionDisabledMessage() {
|
|
587
549
|
return localize(
|
|
588
|
-
|
|
550
|
+
15321,
|
|
589
551
|
"The command was not executed because it requested to run outside the terminal sandbox, but running commands outside the sandbox is disabled by chat.agent.sandbox.allowUnsandboxedCommands. Run the command in the sandbox instead, or enable the setting to allow unsandboxed execution."
|
|
590
552
|
);
|
|
591
553
|
}
|
|
592
554
|
_getAllowNetworkRequestDisabledMessage() {
|
|
593
555
|
return localize(
|
|
594
|
-
|
|
556
|
+
15322,
|
|
595
557
|
"The command was not executed because it requested unrestricted network access in the terminal sandbox, but per-command network access is disabled by chat.agent.sandbox.retryWithAllowNetworkRequests. Run the command with restricted network access instead, or enable the setting to allow network access requests."
|
|
596
558
|
);
|
|
597
559
|
}
|
|
560
|
+
async _getDeniedSandboxFileAccess(paths, sandboxPrecheckInputs) {
|
|
561
|
+
if (!paths?.length) {
|
|
562
|
+
return [];
|
|
563
|
+
}
|
|
564
|
+
const result = await this._terminalSandboxService.checkFileAccess("write", paths, sandboxPrecheckInputs);
|
|
565
|
+
return result.denied;
|
|
566
|
+
}
|
|
567
|
+
_buildSandboxFileAccessDeniedMessage(deniedPaths) {
|
|
568
|
+
const deniedPathsMessage = ( deniedPaths.map(path => `write: ${path}`)).join("\n");
|
|
569
|
+
return localize(
|
|
570
|
+
15323,
|
|
571
|
+
"Access Denied: The command was not executed because the terminal sandbox does not allow access to the requested file paths:\n{0}",
|
|
572
|
+
deniedPathsMessage
|
|
573
|
+
);
|
|
574
|
+
}
|
|
598
575
|
get _enableCommandLineSandboxRewriting() {
|
|
599
576
|
return true;
|
|
600
577
|
}
|
|
@@ -650,6 +627,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
650
627
|
this._telemetry = this._instantiationService.createInstance(RunInTerminalToolTelemetry);
|
|
651
628
|
this._commandArtifactCollector = this._instantiationService.createInstance(TerminalCommandArtifactCollector);
|
|
652
629
|
this._profileFetcher = this._instantiationService.createInstance(TerminalProfileFetcher);
|
|
630
|
+
this._largeOutputFileWriter = this._register(this._instantiationService.createInstance(LargeOutputFileWriter));
|
|
653
631
|
this._commandLineRewriters = [
|
|
654
632
|
this._register(this._instantiationService.createInstance(CommandLineCdPrefixRewriter)),
|
|
655
633
|
this._register(
|
|
@@ -711,19 +689,20 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
711
689
|
for (const resource of e.sessionResources) {
|
|
712
690
|
this._cleanupSessionTerminals(resource);
|
|
713
691
|
}
|
|
692
|
+
this._largeOutputFileWriter.cleanup();
|
|
714
693
|
}));
|
|
715
694
|
}
|
|
716
695
|
async handleToolStream(context, _token) {
|
|
717
696
|
const partialInput = context.rawInput;
|
|
718
697
|
if (partialInput && typeof partialInput === "object" && partialInput.command) {
|
|
719
698
|
const truncatedCommand = buildCommandDisplayText(partialInput.command);
|
|
720
|
-
const invocationMessage = ( new MarkdownString(( localize(
|
|
699
|
+
const invocationMessage = ( new MarkdownString(( localize(15324, "Running `{0}`", escapeMarkdownSyntaxTokens(truncatedCommand)))));
|
|
721
700
|
return {
|
|
722
701
|
invocationMessage
|
|
723
702
|
};
|
|
724
703
|
}
|
|
725
704
|
return {
|
|
726
|
-
invocationMessage: ( localize(
|
|
705
|
+
invocationMessage: ( localize(15325, "Running command"))
|
|
727
706
|
};
|
|
728
707
|
}
|
|
729
708
|
async prepareToolInvocation(context, token) {
|
|
@@ -763,13 +742,18 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
763
742
|
let requiresAllowNetworkConfirmation = explicitAllowNetworkRequest;
|
|
764
743
|
let requestAllowNetworkReason = explicitAllowNetworkRequest ? args.requestAllowNetworkReason : undefined;
|
|
765
744
|
const missingDependencies = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Dependencies && sandboxPrereqs.missingDependencies?.length ? sandboxPrereqs.missingDependencies : undefined;
|
|
745
|
+
const sandboxRemediations = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && sandboxPrereqs.remediations?.length ? [...sandboxPrereqs.remediations] : undefined;
|
|
746
|
+
const sandboxPrerequisiteFailure = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && !sandboxRemediations ? ( localize(
|
|
747
|
+
15326,
|
|
748
|
+
"Bubblewrap is installed but cannot create the required sandbox namespace on this system. The command was not executed."
|
|
749
|
+
)) : undefined;
|
|
766
750
|
const terminalToolSessionId = generateUuid();
|
|
767
751
|
const terminalCommandId = `tool-${generateUuid()}`;
|
|
768
752
|
if (this._shouldRejectUnsandboxedExecutionRequest(isSandboxEnabled, allowUnsandboxedCommands, args)) {
|
|
769
753
|
const commandToDisplay = normalizeTerminalCommandForDisplay(args.command);
|
|
770
754
|
return {
|
|
771
755
|
invocationMessage: ( new MarkdownString(( localize(
|
|
772
|
-
|
|
756
|
+
15327,
|
|
773
757
|
"Not running `{0}` because unsandboxed execution is disabled",
|
|
774
758
|
escapeMarkdownSyntaxTokens(buildCommandDisplayText(commandToDisplay))
|
|
775
759
|
)))),
|
|
@@ -795,7 +779,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
795
779
|
const commandToDisplay = normalizeTerminalCommandForDisplay(args.command);
|
|
796
780
|
return {
|
|
797
781
|
invocationMessage: ( new MarkdownString(( localize(
|
|
798
|
-
|
|
782
|
+
15328,
|
|
799
783
|
"Not running `{0}` because unrestricted network access in the sandbox is disabled",
|
|
800
784
|
escapeMarkdownSyntaxTokens(buildCommandDisplayText(commandToDisplay))
|
|
801
785
|
)))),
|
|
@@ -853,28 +837,51 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
853
837
|
requestUnsandboxedExecutionReason,
|
|
854
838
|
requestAllowNetwork: requiresAllowNetworkConfirmation,
|
|
855
839
|
requestAllowNetworkReason,
|
|
856
|
-
missingSandboxDependencies: missingDependencies
|
|
840
|
+
missingSandboxDependencies: missingDependencies,
|
|
841
|
+
sandboxRemediations,
|
|
842
|
+
sandboxPrerequisiteFailure
|
|
857
843
|
};
|
|
858
|
-
let
|
|
844
|
+
let sandboxPrerequisiteConfirmation = undefined;
|
|
859
845
|
if (missingDependencies) {
|
|
860
846
|
const depsList = missingDependencies.join(", ");
|
|
861
|
-
|
|
862
|
-
title: ( localize(
|
|
847
|
+
sandboxPrerequisiteConfirmation = {
|
|
848
|
+
title: ( localize(15329, "Missing Sandbox Dependencies")),
|
|
863
849
|
message: ( new MarkdownString(( localize(
|
|
864
|
-
|
|
850
|
+
15330,
|
|
865
851
|
"The following dependencies required for sandboxed execution are not installed: {0}. Would you like to install them?",
|
|
866
852
|
depsList
|
|
867
853
|
)))),
|
|
868
854
|
customOptions: [{
|
|
869
855
|
id: "install",
|
|
870
|
-
label: ( localize(
|
|
856
|
+
label: ( localize(15331, "Install")),
|
|
871
857
|
kind: ConfirmationOptionKind.Approve
|
|
872
858
|
}, {
|
|
873
859
|
id: "cancel",
|
|
874
|
-
label: ( localize(
|
|
860
|
+
label: ( localize(15332, "Cancel")),
|
|
875
861
|
kind: ConfirmationOptionKind.Deny
|
|
876
862
|
}]
|
|
877
863
|
};
|
|
864
|
+
} else if (sandboxRemediations) {
|
|
865
|
+
const customOptions = [];
|
|
866
|
+
if (sandboxRemediations.includes(
|
|
867
|
+
TerminalSandboxPreCheckRemediation.DisableUnprivilagedusernamespaceRestriction
|
|
868
|
+
)) {
|
|
869
|
+
customOptions.push({
|
|
870
|
+
id: TerminalSandboxPreCheckRemediation.DisableUnprivilagedusernamespaceRestriction,
|
|
871
|
+
label: ( localize(15333, "Apply Fix and Retry")),
|
|
872
|
+
kind: ConfirmationOptionKind.Approve
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
customOptions.push({
|
|
876
|
+
id: "cancel",
|
|
877
|
+
label: ( localize(15334, "Cancel")),
|
|
878
|
+
kind: ConfirmationOptionKind.Deny
|
|
879
|
+
});
|
|
880
|
+
sandboxPrerequisiteConfirmation = {
|
|
881
|
+
title: ( localize(15335, "Repair Bubblewrap Sandbox")),
|
|
882
|
+
message: ( new MarkdownString(( localize(15336, "Bubblewrap cannot create the sandbox environment.")))),
|
|
883
|
+
customOptions
|
|
884
|
+
};
|
|
878
885
|
}
|
|
879
886
|
const alternativeRecommendation = getRecommendedToolsOverRunInTerminal(args.command, this._languageModelToolsService);
|
|
880
887
|
if (alternativeRecommendation) {
|
|
@@ -946,9 +953,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
946
953
|
const isAutoApprovedByRules =
|
|
947
954
|
(isAutoApproveAllowed &&
|
|
948
955
|
wouldBeAutoApproved);
|
|
949
|
-
const isUnsandboxedAutoApproved = isSandboxEnabled && requiresUnsandboxConfirmation === true && this._autoApproveUnsandboxedCommands;
|
|
950
956
|
const isSandboxAutoApproved = isSandboxEnabled && toolSpecificData.commandLine.isSandboxWrapped === true && !requiresAllowNetworkConfirmation && this._allowSandboxAutoApprove;
|
|
951
|
-
const isFinalAutoApproved =
|
|
957
|
+
const isFinalAutoApproved = isSandboxAutoApproved || isAutoApprovedByRules || ( commandLineAnalyzerResults.some(e => e.forceAutoApproval));
|
|
952
958
|
if (isFinalAutoApproved || (isAutoApproveEnabled && ( commandLineAnalyzerResults.some(e => e.autoApproveInfo)))) {
|
|
953
959
|
toolSpecificData.autoApproveInfo = commandLineAnalyzerResults.find(e => e.autoApproveInfo)?.autoApproveInfo;
|
|
954
960
|
}
|
|
@@ -969,12 +975,12 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
969
975
|
cwdLabel: directoryLabel,
|
|
970
976
|
cdPrefix
|
|
971
977
|
};
|
|
972
|
-
confirmationTitle = ( localize(
|
|
978
|
+
confirmationTitle = ( localize(15337, "Run `{0}` command within `{1}`?", shellType, directoryLabel));
|
|
973
979
|
} else {
|
|
974
980
|
toolSpecificData.confirmation = {
|
|
975
981
|
commandLine: commandToDisplay
|
|
976
982
|
};
|
|
977
|
-
confirmationTitle = ( localize(
|
|
983
|
+
confirmationTitle = ( localize(15338, "Run `{0}` command?", shellType));
|
|
978
984
|
}
|
|
979
985
|
const commandForPresenter = extractedCd?.command ?? commandToDisplay;
|
|
980
986
|
let presenterInput = commandForPresenter;
|
|
@@ -995,7 +1001,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
995
1001
|
if (extractedCd && toolSpecificData.confirmation?.cwdLabel) {
|
|
996
1002
|
if (presenterResult.languageDisplayName) {
|
|
997
1003
|
confirmationTitle = ( localize(
|
|
998
|
-
|
|
1004
|
+
15339,
|
|
999
1005
|
"Run `{0}` command in `{1}` within `{2}`?",
|
|
1000
1006
|
presenterResult.languageDisplayName,
|
|
1001
1007
|
shellType,
|
|
@@ -1003,7 +1009,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1003
1009
|
));
|
|
1004
1010
|
} else {
|
|
1005
1011
|
confirmationTitle = ( localize(
|
|
1006
|
-
|
|
1012
|
+
15340,
|
|
1007
1013
|
"Run command in `{0}` within `{1}`?",
|
|
1008
1014
|
shellType,
|
|
1009
1015
|
toolSpecificData.confirmation.cwdLabel
|
|
@@ -1012,13 +1018,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1012
1018
|
} else {
|
|
1013
1019
|
if (presenterResult.languageDisplayName) {
|
|
1014
1020
|
confirmationTitle = ( localize(
|
|
1015
|
-
|
|
1021
|
+
15341,
|
|
1016
1022
|
"Run `{0}` command in `{1}`?",
|
|
1017
1023
|
presenterResult.languageDisplayName,
|
|
1018
1024
|
shellType
|
|
1019
1025
|
));
|
|
1020
1026
|
} else {
|
|
1021
|
-
confirmationTitle = ( localize(
|
|
1027
|
+
confirmationTitle = ( localize(15342, "Run command in `{0}`?", shellType));
|
|
1022
1028
|
}
|
|
1023
1029
|
}
|
|
1024
1030
|
if (!presenterResult.processOtherPresenters) {
|
|
@@ -1029,43 +1035,43 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1029
1035
|
}
|
|
1030
1036
|
if (requiresUnsandboxConfirmation) {
|
|
1031
1037
|
confirmationTitle = blockedDomains?.length ? ( localize(
|
|
1032
|
-
|
|
1038
|
+
15343,
|
|
1033
1039
|
"Run `{0}` command outside the [sandbox]({1}) to access {2}?",
|
|
1034
1040
|
shellType,
|
|
1035
1041
|
TERMINAL_SANDBOX_DOCUMENTATION_URL,
|
|
1036
1042
|
this._formatBlockedDomainsForTitle(blockedDomains)
|
|
1037
1043
|
)) : ( localize(
|
|
1038
|
-
|
|
1044
|
+
15344,
|
|
1039
1045
|
"Run `{0}` command outside the [sandbox]({1})?",
|
|
1040
1046
|
shellType,
|
|
1041
1047
|
TERMINAL_SANDBOX_DOCUMENTATION_URL
|
|
1042
1048
|
));
|
|
1043
1049
|
} else if (requiresAllowNetworkConfirmation) {
|
|
1044
1050
|
confirmationTitle = ( localize(
|
|
1045
|
-
|
|
1051
|
+
15345,
|
|
1046
1052
|
"Allow the sandbox to run `{0}` command with unrestricted network access.",
|
|
1047
1053
|
shellType
|
|
1048
1054
|
));
|
|
1049
1055
|
}
|
|
1050
1056
|
const shouldShowConfirmation = (!isFinalAutoApproved && (!isSessionAutoApproved || requiresAllowNetworkConfirmation)) || context.forceConfirmationReason !== undefined;
|
|
1051
|
-
const explanation = args.explanation || ( localize(
|
|
1052
|
-
const goal = args.goal || ( localize(
|
|
1057
|
+
const explanation = args.explanation || ( localize(15346, "No explanation provided"));
|
|
1058
|
+
const goal = args.goal || ( localize(15347, "No goal provided"));
|
|
1053
1059
|
const confirmationMessage = requiresUnsandboxConfirmation ? ( new MarkdownString(( localize(
|
|
1054
|
-
|
|
1060
|
+
15348,
|
|
1055
1061
|
"Explanation: {0}\n\nGoal: {1}\n\nReason for leaving the sandbox: {2}",
|
|
1056
1062
|
explanation,
|
|
1057
1063
|
goal,
|
|
1058
|
-
requestUnsandboxedExecutionReason || ( localize(
|
|
1064
|
+
requestUnsandboxedExecutionReason || ( localize(15349, "The model indicated that this command needs unsandboxed access."))
|
|
1059
1065
|
)))) : requiresAllowNetworkConfirmation ? ( new MarkdownString(( localize(
|
|
1060
|
-
|
|
1066
|
+
15350,
|
|
1061
1067
|
"Explanation: {0}\n\nGoal: {1}\n\nReason for allowing unrestricted network access in the sandbox: {2}",
|
|
1062
1068
|
explanation,
|
|
1063
1069
|
goal,
|
|
1064
1070
|
requestAllowNetworkReason || ( localize(
|
|
1065
|
-
|
|
1071
|
+
15351,
|
|
1066
1072
|
"The model indicated that this sandboxed command needs unrestricted network access."
|
|
1067
1073
|
))
|
|
1068
|
-
)))) : ( new MarkdownString(( localize(
|
|
1074
|
+
)))) : ( new MarkdownString(( localize(15352, "Explanation: {0}\n\nGoal: {1}", explanation, goal))));
|
|
1069
1075
|
const confirmationMessages = shouldShowConfirmation ? {
|
|
1070
1076
|
title: confirmationTitle,
|
|
1071
1077
|
message: confirmationMessage,
|
|
@@ -1076,14 +1082,14 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1076
1082
|
const rawDisplayCommand = toolSpecificData.commandLine.forDisplay ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original;
|
|
1077
1083
|
const displayCommand = rawDisplayCommand.length > 80 ? rawDisplayCommand.substring(0, 77) + "..." : rawDisplayCommand;
|
|
1078
1084
|
const invocationMessage = toolSpecificData.commandLine.isSandboxWrapped ? ( new MarkdownString(( localize(
|
|
1079
|
-
|
|
1085
|
+
15353,
|
|
1080
1086
|
"Running `{0}` in sandbox",
|
|
1081
1087
|
escapeMarkdownSyntaxTokens(displayCommand)
|
|
1082
|
-
)))) : ( new MarkdownString(( localize(
|
|
1088
|
+
)))) : ( new MarkdownString(( localize(15354, "Running `{0}`", escapeMarkdownSyntaxTokens(displayCommand)))));
|
|
1083
1089
|
return {
|
|
1084
1090
|
invocationMessage,
|
|
1085
1091
|
icon: toolSpecificData.commandLine.isSandboxWrapped ? Codicon.terminalSecure : Codicon.terminal,
|
|
1086
|
-
confirmationMessages:
|
|
1092
|
+
confirmationMessages: sandboxPrerequisiteConfirmation ?? confirmationMessages,
|
|
1087
1093
|
toolSpecificData
|
|
1088
1094
|
};
|
|
1089
1095
|
}
|
|
@@ -1092,7 +1098,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1092
1098
|
return `\`${blockedDomains[0]}\``;
|
|
1093
1099
|
}
|
|
1094
1100
|
return localize(
|
|
1095
|
-
|
|
1101
|
+
15355,
|
|
1096
1102
|
"`{0}` and {1} more domains",
|
|
1097
1103
|
blockedDomains[0],
|
|
1098
1104
|
blockedDomains.length - 1
|
|
@@ -1102,13 +1108,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1102
1108
|
if (deniedDomains.length === blockedDomains.length && deniedDomains.length > 0) {
|
|
1103
1109
|
if (blockedDomains.length === 1) {
|
|
1104
1110
|
return localize(
|
|
1105
|
-
|
|
1111
|
+
15356,
|
|
1106
1112
|
"This command accesses {0}, which is blocked by chat.agent.deniedNetworkDomains.",
|
|
1107
1113
|
blockedDomains[0]
|
|
1108
1114
|
);
|
|
1109
1115
|
}
|
|
1110
1116
|
return localize(
|
|
1111
|
-
|
|
1117
|
+
15357,
|
|
1112
1118
|
"This command accesses {0} and {1} more domains that are blocked by chat.agent.deniedNetworkDomains.",
|
|
1113
1119
|
blockedDomains[0],
|
|
1114
1120
|
blockedDomains.length - 1
|
|
@@ -1117,13 +1123,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1117
1123
|
if (deniedDomains.length > 0) {
|
|
1118
1124
|
if (blockedDomains.length === 1) {
|
|
1119
1125
|
return localize(
|
|
1120
|
-
|
|
1126
|
+
15358,
|
|
1121
1127
|
"This command accesses {0}, which is blocked by chat.agent.deniedNetworkDomains or not added to chat.agent.allowedNetworkDomains.",
|
|
1122
1128
|
blockedDomains[0]
|
|
1123
1129
|
);
|
|
1124
1130
|
}
|
|
1125
1131
|
return localize(
|
|
1126
|
-
|
|
1132
|
+
15359,
|
|
1127
1133
|
"This command accesses {0} and {1} more domains that are blocked by chat.agent.deniedNetworkDomains or not added to chat.agent.allowedNetworkDomains.",
|
|
1128
1134
|
blockedDomains[0],
|
|
1129
1135
|
blockedDomains.length - 1
|
|
@@ -1131,13 +1137,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1131
1137
|
}
|
|
1132
1138
|
if (blockedDomains.length === 1) {
|
|
1133
1139
|
return localize(
|
|
1134
|
-
|
|
1140
|
+
15360,
|
|
1135
1141
|
"This command accesses {0}, which is not permitted by the current chat.agent.sandbox configuration.",
|
|
1136
1142
|
blockedDomains[0]
|
|
1137
1143
|
);
|
|
1138
1144
|
}
|
|
1139
1145
|
return localize(
|
|
1140
|
-
|
|
1146
|
+
15361,
|
|
1141
1147
|
"This command accesses {0} and {1} more domains that are not permitted by the current chat.agent.sandbox configuration.",
|
|
1142
1148
|
blockedDomains[0],
|
|
1143
1149
|
blockedDomains.length - 1
|
|
@@ -1219,9 +1225,6 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1219
1225
|
riskAssessment,
|
|
1220
1226
|
token
|
|
1221
1227
|
) {
|
|
1222
|
-
if (retryKind === "unsandboxed" && this._autoApproveUnsandboxedCommands) {
|
|
1223
|
-
return true;
|
|
1224
|
-
}
|
|
1225
1228
|
const chatModel = sessionResource && this._chatService.getSession(sessionResource);
|
|
1226
1229
|
if (!(chatModel instanceof ChatModel)) {
|
|
1227
1230
|
return false;
|
|
@@ -1254,11 +1257,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1254
1257
|
resolve(value);
|
|
1255
1258
|
};
|
|
1256
1259
|
const confirmationMessage = retryKind === "allowNetwork" ? ( new MarkdownString(( localize(
|
|
1257
|
-
|
|
1260
|
+
15362,
|
|
1258
1261
|
"`{0}`",
|
|
1259
1262
|
escapeMarkdownSyntaxTokens(buildCommandDisplayText(command))
|
|
1260
1263
|
)))) : ( new MarkdownString(( localize(
|
|
1261
|
-
|
|
1264
|
+
15363,
|
|
1262
1265
|
"`{0}`",
|
|
1263
1266
|
escapeMarkdownSyntaxTokens(buildCommandDisplayText(command))
|
|
1264
1267
|
))));
|
|
@@ -1266,8 +1269,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1266
1269
|
this._getAutomaticSandboxRetryTitle(retryKind, shellType, blockedDomains),
|
|
1267
1270
|
confirmationMessage,
|
|
1268
1271
|
"",
|
|
1269
|
-
( localize(
|
|
1270
|
-
( localize(
|
|
1272
|
+
( localize(15364, "Allow")),
|
|
1273
|
+
( localize(15365, "Skip")),
|
|
1271
1274
|
async () => {
|
|
1272
1275
|
resolveOnce(true);
|
|
1273
1276
|
part.hide();
|
|
@@ -1293,22 +1296,22 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1293
1296
|
_getAutomaticSandboxRetryTitle(retryKind, shellType, blockedDomains) {
|
|
1294
1297
|
if (retryKind === "allowNetwork") {
|
|
1295
1298
|
return blockedDomains?.length ? ( new MarkdownString(( localize(
|
|
1296
|
-
|
|
1299
|
+
15366,
|
|
1297
1300
|
"Retry `{0}` command in the sandbox by allowing network access to {1}?",
|
|
1298
1301
|
shellType,
|
|
1299
1302
|
this._formatBlockedDomainsForTitle(blockedDomains)
|
|
1300
1303
|
)))) : ( new MarkdownString(( localize(
|
|
1301
|
-
|
|
1304
|
+
15367,
|
|
1302
1305
|
"Retry `{0}` command in the sandbox by allowing network access?",
|
|
1303
1306
|
shellType
|
|
1304
1307
|
))));
|
|
1305
1308
|
}
|
|
1306
1309
|
return blockedDomains?.length ? ( new MarkdownString(( localize(
|
|
1307
|
-
|
|
1310
|
+
15368,
|
|
1308
1311
|
"Run `{0}` command outside the sandbox to access {1}?",
|
|
1309
1312
|
shellType,
|
|
1310
1313
|
this._formatBlockedDomainsForTitle(blockedDomains)
|
|
1311
|
-
)))) : ( new MarkdownString(( localize(
|
|
1314
|
+
)))) : ( new MarkdownString(( localize(15369, "Run `{0}` command outside the sandbox?", shellType))));
|
|
1312
1315
|
}
|
|
1313
1316
|
_registerSensitiveInputElicitation(
|
|
1314
1317
|
chatSessionResource,
|
|
@@ -1336,10 +1339,10 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1336
1339
|
if (chatModel instanceof ChatModel) {
|
|
1337
1340
|
const request = chatModel.getRequests().at(-1);
|
|
1338
1341
|
if (request) {
|
|
1339
|
-
const infoPart = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(
|
|
1340
|
-
|
|
1342
|
+
const infoPart = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(15370, "Terminal command cancelled — sensitive input required")))), ( new MarkdownString(( localize(
|
|
1343
|
+
15371,
|
|
1341
1344
|
"The terminal command was prompting for a password or other secret. Auto-approve / autopilot mode cannot safely supply secrets, so the command was cancelled. Run the command interactively if you want to provide the secret."
|
|
1342
|
-
)))), "", ( localize(
|
|
1345
|
+
)))), "", ( localize(15372, "Dismiss")), "", async () => {
|
|
1343
1346
|
infoPart.hide();
|
|
1344
1347
|
return ElicitationState.Accepted;
|
|
1345
1348
|
}, async () => {
|
|
@@ -1363,10 +1366,10 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1363
1366
|
if (!request) {
|
|
1364
1367
|
return;
|
|
1365
1368
|
}
|
|
1366
|
-
const part = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(
|
|
1367
|
-
|
|
1369
|
+
const part = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(15373, "Terminal is waiting for sensitive input")))), ( new MarkdownString(( localize(
|
|
1370
|
+
15374,
|
|
1368
1371
|
"The terminal command appears to be prompting for a password or other sensitive value. Focus the terminal to type it directly — secrets must not be sent through chat."
|
|
1369
|
-
)))), "", ( localize(
|
|
1372
|
+
)))), "", ( localize(15375, "Focus Terminal")), ( localize(15376, "Cancel Command")), async () => {
|
|
1370
1373
|
pending = undefined;
|
|
1371
1374
|
part.hide();
|
|
1372
1375
|
try {
|
|
@@ -1412,14 +1415,14 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1412
1415
|
const progress = {
|
|
1413
1416
|
kind: "externalToolInvocationUpdate",
|
|
1414
1417
|
toolCallId,
|
|
1415
|
-
toolName: ( localize(
|
|
1418
|
+
toolName: ( localize(15318, "Run in Terminal")),
|
|
1416
1419
|
isComplete,
|
|
1417
1420
|
invocationMessage: retryKind === "allowNetwork" ? ( new MarkdownString(( localize(
|
|
1418
|
-
|
|
1421
|
+
15377,
|
|
1419
1422
|
"Running `{0}` in the sandbox with unrestricted network access",
|
|
1420
1423
|
escapeMarkdownSyntaxTokens(displayCommand)
|
|
1421
1424
|
)))) : ( new MarkdownString(( localize(
|
|
1422
|
-
|
|
1425
|
+
15378,
|
|
1423
1426
|
"Running `{0}` outside the sandbox",
|
|
1424
1427
|
escapeMarkdownSyntaxTokens(displayCommand)
|
|
1425
1428
|
)))),
|
|
@@ -1545,6 +1548,22 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1545
1548
|
}]
|
|
1546
1549
|
};
|
|
1547
1550
|
}
|
|
1551
|
+
const sandboxPrerequisiteTerminalOptions = {
|
|
1552
|
+
createTerminal: async () => this._terminalService.createTerminal({}),
|
|
1553
|
+
focusTerminal: async terminal => {
|
|
1554
|
+
this._terminalService.setActiveInstance(terminal);
|
|
1555
|
+
await this._terminalService.revealTerminal(terminal, true);
|
|
1556
|
+
terminal.focus();
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
if (toolSpecificData.sandboxPrerequisiteFailure) {
|
|
1560
|
+
return {
|
|
1561
|
+
content: [{
|
|
1562
|
+
kind: "text",
|
|
1563
|
+
value: toolSpecificData.sandboxPrerequisiteFailure
|
|
1564
|
+
}]
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1548
1567
|
const isSandboxAllowNetworkEnabled = isSandboxEnabled && (await this._terminalSandboxService.isSandboxAllowNetworkEnabled());
|
|
1549
1568
|
if (this._shouldRejectAllowNetworkRequest(isSandboxEnabled, isSandboxAllowNetworkEnabled, args)) {
|
|
1550
1569
|
const message = this._getAllowNetworkRequestDisabledMessage();
|
|
@@ -1570,20 +1589,18 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1570
1589
|
const sessionResource = invocation.context.sessionResource;
|
|
1571
1590
|
const {
|
|
1572
1591
|
exitCode
|
|
1573
|
-
} = await this._terminalSandboxService.installMissingSandboxDependencies(
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
}
|
|
1580
|
-
});
|
|
1592
|
+
} = await this._terminalSandboxService.installMissingSandboxDependencies(
|
|
1593
|
+
toolSpecificData.missingSandboxDependencies,
|
|
1594
|
+
sessionResource,
|
|
1595
|
+
token,
|
|
1596
|
+
sandboxPrerequisiteTerminalOptions
|
|
1597
|
+
);
|
|
1581
1598
|
if (exitCode !== undefined && exitCode !== 0) {
|
|
1582
1599
|
return {
|
|
1583
1600
|
content: [{
|
|
1584
1601
|
kind: "text",
|
|
1585
1602
|
value: ( localize(
|
|
1586
|
-
|
|
1603
|
+
15379,
|
|
1587
1604
|
"Sandbox dependency installation failed (exit code {0}). The command was not executed.",
|
|
1588
1605
|
exitCode
|
|
1589
1606
|
))
|
|
@@ -1595,12 +1612,30 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1595
1612
|
content: [{
|
|
1596
1613
|
kind: "text",
|
|
1597
1614
|
value: ( localize(
|
|
1598
|
-
|
|
1615
|
+
15380,
|
|
1599
1616
|
"Could not determine whether sandbox dependency installation succeeded. The command was not executed."
|
|
1600
1617
|
))
|
|
1601
1618
|
}]
|
|
1602
1619
|
};
|
|
1603
1620
|
}
|
|
1621
|
+
const refreshedPrereqs = await this._terminalSandboxService.checkForSandboxingPrereqs(true, sandboxPrecheckInputs);
|
|
1622
|
+
if (refreshedPrereqs.failedCheck !== undefined) {
|
|
1623
|
+
return {
|
|
1624
|
+
content: [{
|
|
1625
|
+
kind: "text",
|
|
1626
|
+
value: refreshedPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && refreshedPrereqs.remediations?.length ? ( localize(
|
|
1627
|
+
15381,
|
|
1628
|
+
"Sandbox dependencies were installed, but bubblewrap cannot create the required sandbox namespace. Run the command again to choose an available repair option."
|
|
1629
|
+
)) : refreshedPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap ? ( localize(
|
|
1630
|
+
15382,
|
|
1631
|
+
"Sandbox dependencies were installed, but bubblewrap cannot create the required sandbox namespace on this system. The command was not executed."
|
|
1632
|
+
)) : ( localize(
|
|
1633
|
+
15383,
|
|
1634
|
+
"Sandbox prerequisites are still not satisfied after installation. The command was not executed."
|
|
1635
|
+
))
|
|
1636
|
+
}]
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1604
1639
|
this._logService.info(
|
|
1605
1640
|
"RunInTerminalTool: Sandbox dependency installation succeeded, proceeding with command execution"
|
|
1606
1641
|
);
|
|
@@ -1609,11 +1644,60 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1609
1644
|
return {
|
|
1610
1645
|
content: [{
|
|
1611
1646
|
kind: "text",
|
|
1612
|
-
value: ( localize(
|
|
1647
|
+
value: ( localize(15384, "Sandbox dependency installation was cancelled by the user."))
|
|
1613
1648
|
}]
|
|
1614
1649
|
};
|
|
1615
1650
|
}
|
|
1616
1651
|
}
|
|
1652
|
+
if (toolSpecificData.sandboxRemediations?.length) {
|
|
1653
|
+
const selectedRemediation = invocation.selectedCustomButton;
|
|
1654
|
+
if (!selectedRemediation || !toolSpecificData.sandboxRemediations.includes(selectedRemediation)) {
|
|
1655
|
+
return {
|
|
1656
|
+
content: [{
|
|
1657
|
+
kind: "text",
|
|
1658
|
+
value: ( localize(15385, "Bubblewrap sandbox repair was cancelled by the user."))
|
|
1659
|
+
}]
|
|
1660
|
+
};
|
|
1661
|
+
}
|
|
1662
|
+
const {
|
|
1663
|
+
exitCode
|
|
1664
|
+
} = await this._terminalSandboxService.runSandboxRemediation(
|
|
1665
|
+
selectedRemediation,
|
|
1666
|
+
invocation.context.sessionResource,
|
|
1667
|
+
token,
|
|
1668
|
+
sandboxPrerequisiteTerminalOptions
|
|
1669
|
+
);
|
|
1670
|
+
if (exitCode !== 0) {
|
|
1671
|
+
return {
|
|
1672
|
+
content: [{
|
|
1673
|
+
kind: "text",
|
|
1674
|
+
value: exitCode === undefined ? ( localize(
|
|
1675
|
+
15386,
|
|
1676
|
+
"Could not determine whether the bubblewrap repair succeeded. The command was not executed."
|
|
1677
|
+
)) : ( localize(
|
|
1678
|
+
15387,
|
|
1679
|
+
"Bubblewrap repair failed (exit code {0}). The command was not executed.",
|
|
1680
|
+
exitCode
|
|
1681
|
+
))
|
|
1682
|
+
}]
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
const refreshedPrereqs = await this._terminalSandboxService.checkForSandboxingPrereqs(true, sandboxPrecheckInputs);
|
|
1686
|
+
if (refreshedPrereqs.failedCheck !== undefined) {
|
|
1687
|
+
return {
|
|
1688
|
+
content: [{
|
|
1689
|
+
kind: "text",
|
|
1690
|
+
value: ( localize(
|
|
1691
|
+
15388,
|
|
1692
|
+
"Bubblewrap still cannot create the required sandbox namespace after remediation. The command was not executed."
|
|
1693
|
+
))
|
|
1694
|
+
}]
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
this._logService.info(
|
|
1698
|
+
"RunInTerminalTool: Bubblewrap remediation succeeded, proceeding with command execution"
|
|
1699
|
+
);
|
|
1700
|
+
}
|
|
1617
1701
|
const executionOptions = this._resolveExecutionOptions(args);
|
|
1618
1702
|
this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`);
|
|
1619
1703
|
let toolResultMessage;
|
|
@@ -1639,13 +1723,35 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1639
1723
|
if (token.isCancellationRequested) {
|
|
1640
1724
|
throw ( new CancellationError());
|
|
1641
1725
|
}
|
|
1726
|
+
if (didSandboxWrapCommand) {
|
|
1727
|
+
const deniedAccess = await this._getDeniedSandboxFileAccess(args.requestFileValidationCheck, sandboxPrecheckInputs);
|
|
1728
|
+
if (deniedAccess.length > 0) {
|
|
1729
|
+
const message = this._buildSandboxFileAccessDeniedMessage(deniedAccess);
|
|
1730
|
+
return {
|
|
1731
|
+
toolResultError: message,
|
|
1732
|
+
toolResultDetails: {
|
|
1733
|
+
input: args.command,
|
|
1734
|
+
output: [{
|
|
1735
|
+
type: "embed",
|
|
1736
|
+
isText: true,
|
|
1737
|
+
value: message
|
|
1738
|
+
}],
|
|
1739
|
+
isError: true
|
|
1740
|
+
},
|
|
1741
|
+
content: [{
|
|
1742
|
+
kind: "text",
|
|
1743
|
+
value: message
|
|
1744
|
+
}]
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1642
1748
|
let error;
|
|
1643
1749
|
const automaticUnsandboxRetryReason = ( localize(
|
|
1644
|
-
|
|
1750
|
+
15389,
|
|
1645
1751
|
"The sandboxed execution output indicated the sandbox blocked the command."
|
|
1646
1752
|
));
|
|
1647
1753
|
const automaticAllowNetworkRetryReason = ( localize(
|
|
1648
|
-
|
|
1754
|
+
15390,
|
|
1649
1755
|
"The sandboxed execution output indicated the sandbox blocked required network access."
|
|
1650
1756
|
));
|
|
1651
1757
|
const isNewSession = !executionOptions.persistentSession && !( this._sessionTerminalAssociations.has(chatSessionResource));
|
|
@@ -1847,7 +1953,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
1847
1953
|
if (timeoutRacePromise) {
|
|
1848
1954
|
raceCandidates.push(timeoutRacePromise);
|
|
1849
1955
|
}
|
|
1850
|
-
const idleSilenceMs = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdleSilenceTimeoutMs) ??
|
|
1956
|
+
const idleSilenceMs = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdleSilenceTimeoutMs) ?? DEFAULT_IDLE_SILENCE_TIMEOUT_MS;
|
|
1851
1957
|
if (idleSilenceMs > 0) {
|
|
1852
1958
|
const idleSilenceDeferred = ( new DeferredPromise());
|
|
1853
1959
|
const idleSilenceScheduler = raceCleanup.add(( new RunOnceScheduler(() => idleSilenceDeferred.complete({
|
|
@@ -2158,7 +2264,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2158
2264
|
if (outputAnalyzerMessage) {
|
|
2159
2265
|
resultText.push(`${outputAnalyzerMessage}\n`);
|
|
2160
2266
|
}
|
|
2161
|
-
|
|
2267
|
+
const processedOutput = await this._largeOutputFileWriter.processOutput(terminalResult);
|
|
2268
|
+
resultText.push(processedOutput);
|
|
2162
2269
|
const isError = exitCode !== undefined && exitCode !== 0;
|
|
2163
2270
|
const endCwd = await toolTerminal.instance.getCwdResource();
|
|
2164
2271
|
const imageContent = await this._extractImagesFromOutput(terminalResult, endCwd);
|
|
@@ -2459,18 +2566,28 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2459
2566
|
if (!terminalsToDispose || terminalsToDispose.size === 0) {
|
|
2460
2567
|
return;
|
|
2461
2568
|
}
|
|
2569
|
+
const shouldPreserveTerminalsForOutputLocation = this._configurationService.getValue(TerminalChatAgentToolsSettingId.OutputLocation) === "terminal";
|
|
2462
2570
|
this._logService.debug(
|
|
2463
2571
|
`RunInTerminalTool: Cleaning up ${terminalsToDispose.size} terminal(s) for ended chat session ${chatSessionResource}`
|
|
2464
2572
|
);
|
|
2465
2573
|
this._sessionTerminalAssociations.delete(chatSessionResource);
|
|
2466
2574
|
this._sessionTerminalInstances.delete(chatSessionResource);
|
|
2467
2575
|
for (const terminal of terminalsToDispose) {
|
|
2576
|
+
if (this._terminalService.foregroundInstances.includes(terminal) || shouldPreserveTerminalsForOutputLocation) {
|
|
2577
|
+
this._logService.debug(
|
|
2578
|
+
`RunInTerminalTool: Skipping disposal of preserved terminal ${terminal.instanceId} for session ${chatSessionResource}`
|
|
2579
|
+
);
|
|
2580
|
+
continue;
|
|
2581
|
+
}
|
|
2468
2582
|
this._terminalsBeingDisposedBySessionCleanup.add(terminal);
|
|
2469
2583
|
terminal.dispose();
|
|
2470
2584
|
}
|
|
2471
2585
|
const terminalToRemove = [];
|
|
2472
2586
|
for (const [termId, execution] of RunInTerminalTool_1._activeExecutions.entries()) {
|
|
2473
2587
|
if (( terminalsToDispose.has(execution.instance))) {
|
|
2588
|
+
if (this._terminalService.foregroundInstances.includes(execution.instance) || shouldPreserveTerminalsForOutputLocation) {
|
|
2589
|
+
continue;
|
|
2590
|
+
}
|
|
2474
2591
|
execution.dispose();
|
|
2475
2592
|
terminalToRemove.push(termId);
|
|
2476
2593
|
}
|
|
@@ -2642,7 +2759,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2642
2759
|
...sendOptions,
|
|
2643
2760
|
queue: ChatRequestQueueKind.Steering,
|
|
2644
2761
|
isSystemInitiated: true,
|
|
2645
|
-
systemInitiatedLabel: ( localize(
|
|
2762
|
+
systemInitiatedLabel: ( localize(15391, "{0} may need input", commandDisplay)),
|
|
2646
2763
|
terminalExecutionId: termId
|
|
2647
2764
|
}).catch(e => {
|
|
2648
2765
|
this._logService.warn(
|
|
@@ -2671,7 +2788,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2671
2788
|
}
|
|
2672
2789
|
disposeNotification();
|
|
2673
2790
|
const exitCode = command.exitCode;
|
|
2674
|
-
const exitCodeText = exitCode !== undefined ? ` with exit code ${exitCode}` : "";
|
|
2791
|
+
const exitCodeText = exitCode !== undefined && exitCode !== 0 ? ` with exit code ${exitCode}` : "";
|
|
2675
2792
|
const currentOutput = execution.getOutput();
|
|
2676
2793
|
const isUserVisible = this._terminalService.foregroundInstances.includes(terminalInstance);
|
|
2677
2794
|
const message = isUserVisible ? `[Terminal ${termId} notification: command completed${exitCodeText}. Use send_to_terminal to send another command or kill_terminal to stop it.]\nTerminal output:\n${currentOutput}` : `[Terminal ${termId} notification: command completed${exitCodeText}. The terminal has been cleaned up.]\nTerminal output:\n${currentOutput}`;
|
|
@@ -2682,7 +2799,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2682
2799
|
...sendOptions,
|
|
2683
2800
|
queue: ChatRequestQueueKind.Steering,
|
|
2684
2801
|
isSystemInitiated: true,
|
|
2685
|
-
systemInitiatedLabel: ( localize(
|
|
2802
|
+
systemInitiatedLabel: ( localize(15392, "{0} completed", commandDisplay)),
|
|
2686
2803
|
terminalExecutionId: termId
|
|
2687
2804
|
}).catch(e => {
|
|
2688
2805
|
this._logService.warn(
|
|
@@ -2726,7 +2843,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2726
2843
|
}
|
|
2727
2844
|
const currentOutput = executionForDisposal?.getOutput() ?? "";
|
|
2728
2845
|
const exitCode = terminalInstance.exitCode;
|
|
2729
|
-
const exitCodeText = exitCode !== undefined ? ` with exit code ${exitCode}` : "";
|
|
2846
|
+
const exitCodeText = exitCode !== undefined && exitCode !== 0 ? ` with exit code ${exitCode}` : "";
|
|
2730
2847
|
disposeNotification();
|
|
2731
2848
|
const message = `[Terminal ${termId} notification: terminal exited${exitCodeText}. The terminal process ended before the command could complete normally; further commands cannot be sent to this terminal ID.]\nTerminal output:\n${currentOutput}`;
|
|
2732
2849
|
this._logService.debug(
|
|
@@ -2736,7 +2853,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
|
|
|
2736
2853
|
...sendOptions,
|
|
2737
2854
|
queue: ChatRequestQueueKind.Steering,
|
|
2738
2855
|
isSystemInitiated: true,
|
|
2739
|
-
systemInitiatedLabel: ( localize(
|
|
2856
|
+
systemInitiatedLabel: ( localize(15393, "{0} terminal exited", commandDisplay)),
|
|
2740
2857
|
terminalExecutionId: termId
|
|
2741
2858
|
}).catch(e => {
|
|
2742
2859
|
this._logService.warn(
|
|
@@ -2884,14 +3001,24 @@ class RestoredTerminalExecution extends Disposable {
|
|
|
2884
3001
|
}
|
|
2885
3002
|
}
|
|
2886
3003
|
let TerminalProfileFetcher = class TerminalProfileFetcher {
|
|
3004
|
+
static {
|
|
3005
|
+
TerminalProfileFetcher_1 = this;
|
|
3006
|
+
}
|
|
3007
|
+
static {
|
|
3008
|
+
this._posixShellFallbacks = ["/bin/bash", "/usr/bin/bash", "/bin/sh"];
|
|
3009
|
+
}
|
|
2887
3010
|
constructor(
|
|
2888
3011
|
_configurationService,
|
|
2889
3012
|
_terminalProfileResolverService,
|
|
2890
|
-
_remoteAgentService
|
|
3013
|
+
_remoteAgentService,
|
|
3014
|
+
_fileService,
|
|
3015
|
+
_logService
|
|
2891
3016
|
) {
|
|
2892
3017
|
this._configurationService = _configurationService;
|
|
2893
3018
|
this._terminalProfileResolverService = _terminalProfileResolverService;
|
|
2894
3019
|
this._remoteAgentService = _remoteAgentService;
|
|
3020
|
+
this._fileService = _fileService;
|
|
3021
|
+
this._logService = _logService;
|
|
2895
3022
|
this.osBackend = this._remoteAgentService.getEnvironment().then(remoteEnv => remoteEnv?.os ?? OS);
|
|
2896
3023
|
}
|
|
2897
3024
|
async getCopilotProfile() {
|
|
@@ -2918,11 +3045,48 @@ let TerminalProfileFetcher = class TerminalProfileFetcher {
|
|
|
2918
3045
|
profileName: "bash"
|
|
2919
3046
|
};
|
|
2920
3047
|
}
|
|
3048
|
+
if (os !== OperatingSystem.Windows) {
|
|
3049
|
+
const shellExists = await this._shellExists(defaultProfile.path);
|
|
3050
|
+
if (!shellExists) {
|
|
3051
|
+
const fallbackPath = await this._findFallbackShell();
|
|
3052
|
+
if (fallbackPath) {
|
|
3053
|
+
this._logService.warn(
|
|
3054
|
+
`TerminalProfileFetcher: resolved shell "${defaultProfile.path}" does not exist, falling back to "${fallbackPath}"`
|
|
3055
|
+
);
|
|
3056
|
+
return {
|
|
3057
|
+
...defaultProfile,
|
|
3058
|
+
path: fallbackPath,
|
|
3059
|
+
profileName: basename(fallbackPath),
|
|
3060
|
+
icon: undefined
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
2921
3065
|
return {
|
|
2922
3066
|
...defaultProfile,
|
|
2923
3067
|
icon: undefined
|
|
2924
3068
|
};
|
|
2925
3069
|
}
|
|
3070
|
+
async _shellExists(shellPath) {
|
|
3071
|
+
try {
|
|
3072
|
+
const remoteAuthority = this._remoteAgentService.getConnection()?.remoteAuthority;
|
|
3073
|
+
const resource = remoteAuthority ? URI.file(shellPath).with({
|
|
3074
|
+
scheme: "vscode-remote",
|
|
3075
|
+
authority: remoteAuthority
|
|
3076
|
+
}) : URI.file(shellPath);
|
|
3077
|
+
return await this._fileService.exists(resource);
|
|
3078
|
+
} catch {
|
|
3079
|
+
return false;
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
async _findFallbackShell() {
|
|
3083
|
+
for (const candidate of TerminalProfileFetcher_1._posixShellFallbacks) {
|
|
3084
|
+
if (await this._shellExists(candidate)) {
|
|
3085
|
+
return candidate;
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
return undefined;
|
|
3089
|
+
}
|
|
2926
3090
|
async getCopilotShell() {
|
|
2927
3091
|
return (await this.getCopilotProfile()).path;
|
|
2928
3092
|
}
|
|
@@ -2956,6 +3120,6 @@ let TerminalProfileFetcher = class TerminalProfileFetcher {
|
|
|
2956
3120
|
return false;
|
|
2957
3121
|
}
|
|
2958
3122
|
};
|
|
2959
|
-
TerminalProfileFetcher = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ITerminalProfileResolverService)), ( __param(2, IRemoteAgentService))], TerminalProfileFetcher));
|
|
3123
|
+
TerminalProfileFetcher = TerminalProfileFetcher_1 = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ITerminalProfileResolverService)), ( __param(2, IRemoteAgentService)), ( __param(3, IFileService)), ( __param(4, ITerminalLogService))], TerminalProfileFetcher));
|
|
2960
3124
|
|
|
2961
|
-
export { RunInTerminalTool, TerminalProfileFetcher, buildCompletionNotificationCommand, createRunInTerminalToolData, shouldAutomaticallyRetryAllowNetworkInSandboxed, shouldAutomaticallyRetryUnsandboxed };
|
|
3125
|
+
export { RunInTerminalTool, TerminalProfileFetcher, buildCompletionNotificationCommand, createRunInTerminalToolData, createSandboxLines, createSandboxProperties, shouldAutomaticallyRetryAllowNetworkInSandboxed, shouldAutomaticallyRetryUnsandboxed };
|