@codingame/monaco-vscode-chat-service-override 33.0.9 → 34.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 +19 -5
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +32 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +77 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +84 -17
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +235 -190
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +3 -2
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +23 -4
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +22 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +107 -8
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +272 -49
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +2 -2
- package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.d.ts → agentHostResourceService.d.ts} +26 -0
- package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +11 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +13 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +26 -18
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +119 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +135 -19
- package/vscode/src/vs/platform/agentHost/common/agentService.js +8 -2
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +5 -1
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +85 -22
- package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +36 -0
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +12 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +81 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +103 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +86 -10
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +129 -37
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +12 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +72 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +30 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{reducers.js → channels-session/reducer.js} +99 -168
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +110 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.d.ts → common/errors.d.ts} +13 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.js → common/errors.js} +1 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +17 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +33 -8
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +2 -3
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +36 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +6 -3
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +4 -1
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +9 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +21 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +28 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +31 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +49 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +182 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +784 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +305 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +120 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +100 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +60 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- 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 +106 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +22 -36
- 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 +21 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +38 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- 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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +40 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +23 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +119 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +104 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +177 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +44 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +9 -7
- 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 +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +38 -28
- 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/aiCustomization/aiCustomizationDebugPanel.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +22 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +8 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +112 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +62 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +149 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +15 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +78 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +140 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +11 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +59 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +440 -357
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +99 -99
- 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/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.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 +2 -2
- 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 +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.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/chatGoalSummaryService.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +5 -2
- 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/chatModelsViewModel.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +28 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +187 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +41 -0
- 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 +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +346 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +72 -29
- 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 +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +144 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +126 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +32 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +40 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +25 -24
- 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/githubRepoFetcher.js +1 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.d.ts +12 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +56 -18
- 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 +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +33 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +31 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +16 -13
- 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.d.ts +1 -1
- 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/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/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +22 -13
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +14 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +55 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +54 -12
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +40 -4
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +30 -8
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +205 -46
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +153 -38
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +70 -37
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +6 -28
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- 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.js +150 -150
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- 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 +17 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +21 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +122 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +232 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +225 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +143 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +205 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +260 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +98 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +226 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +177 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +102 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +55 -0
- 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.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +31 -9
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +177 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +518 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +297 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2961 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +63 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +14 -14
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +223 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +81 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +63 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +349 -0
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +75 -0
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +192 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +89 -0
- package/vscode/src/vs/workbench/services/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +226 -9
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +0 -30
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +0 -119
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +0 -552
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +0 -83
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DisposableStore, MutableDisposable, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
3
|
+
/**
|
|
4
|
+
* Sets up a recreating start marker which is resilient to prompts that clear/re-render (eg. transient
|
|
5
|
+
* or powerlevel10k style prompts). The marker is recreated at the cursor position whenever the
|
|
6
|
+
* existing marker is disposed. The caller is responsible for adding the startMarker to the store.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setupRecreatingStartMarker(xterm: {
|
|
9
|
+
raw: {
|
|
10
|
+
registerMarker(): IXtermMarker | undefined;
|
|
11
|
+
};
|
|
12
|
+
}, startMarker: MutableDisposable<IXtermMarker>, fire: (marker: IXtermMarker | undefined) => void, store: DisposableStore, log?: (message: string) => void): IDisposable;
|
|
13
|
+
export declare function createAltBufferPromise(xterm: {
|
|
14
|
+
raw: {
|
|
15
|
+
buffer: {
|
|
16
|
+
active: unknown;
|
|
17
|
+
alternate: unknown;
|
|
18
|
+
onBufferChange: (callback: () => void) => IDisposable;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
}, store: DisposableStore, log?: (message: string) => void): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Strips the command echo and trailing prompt lines from marker-based terminal output.
|
|
24
|
+
* Without shell integration (or when `getOutput()` is unavailable), `getContentsAsText`
|
|
25
|
+
* captures the entire terminal buffer between the start and end markers, which includes:
|
|
26
|
+
* 1. The command echo line (what `sendText` wrote)
|
|
27
|
+
* 2. The actual command output
|
|
28
|
+
* 3. The next shell prompt line(s)
|
|
29
|
+
*
|
|
30
|
+
* This function removes (1) and (3) to isolate the actual output.
|
|
31
|
+
*/
|
|
32
|
+
export declare function stripCommandEchoAndPrompt(output: string, commandLine: string, log?: (message: string) => void): string;
|
|
33
|
+
export declare function findCommandEcho(output: string, commandLine: string, allowSuffixMatch?: boolean): {
|
|
34
|
+
contentBefore: string;
|
|
35
|
+
linesAfter: string[];
|
|
36
|
+
} | undefined;
|
|
37
|
+
export declare function stripNewLinesAndBuildMapping(output: string): {
|
|
38
|
+
strippedOutput: string;
|
|
39
|
+
indexMapping: number[];
|
|
40
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
|
|
2
|
+
import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
+
import { MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
|
|
5
|
+
function setupRecreatingStartMarker(xterm, startMarker, fire, store, log) {
|
|
6
|
+
const markerListener = ( new MutableDisposable());
|
|
7
|
+
const recreateStartMarker = () => {
|
|
8
|
+
if (store.isDisposed) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const marker = xterm.raw.registerMarker();
|
|
12
|
+
startMarker.value = marker ?? undefined;
|
|
13
|
+
fire(marker);
|
|
14
|
+
if (!marker) {
|
|
15
|
+
markerListener.clear();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
markerListener.value = marker.onDispose(() => {
|
|
19
|
+
log?.("Start marker was disposed, recreating");
|
|
20
|
+
recreateStartMarker();
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
recreateStartMarker();
|
|
24
|
+
store.add(toDisposable(() => {
|
|
25
|
+
markerListener.dispose();
|
|
26
|
+
startMarker.clear();
|
|
27
|
+
fire(undefined);
|
|
28
|
+
}));
|
|
29
|
+
store.add(startMarker);
|
|
30
|
+
return toDisposable(() => markerListener.dispose());
|
|
31
|
+
}
|
|
32
|
+
function createAltBufferPromise(xterm, store, log) {
|
|
33
|
+
const deferred = ( new DeferredPromise());
|
|
34
|
+
const complete = () => {
|
|
35
|
+
if (!deferred.isSettled) {
|
|
36
|
+
log?.("Detected alternate buffer entry");
|
|
37
|
+
deferred.complete();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
if (xterm.raw.buffer.active === xterm.raw.buffer.alternate) {
|
|
41
|
+
complete();
|
|
42
|
+
} else {
|
|
43
|
+
store.add(xterm.raw.buffer.onBufferChange(() => {
|
|
44
|
+
if (xterm.raw.buffer.active === xterm.raw.buffer.alternate) {
|
|
45
|
+
complete();
|
|
46
|
+
}
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
return deferred.p;
|
|
50
|
+
}
|
|
51
|
+
function stripCommandEchoAndPrompt(output, commandLine, log) {
|
|
52
|
+
log?.(
|
|
53
|
+
`stripCommandEchoAndPrompt input: output length=${output.length}, commandLine length=${commandLine.length}`
|
|
54
|
+
);
|
|
55
|
+
const result = _stripCommandEchoAndPromptOnce(output, commandLine, log);
|
|
56
|
+
if (result.trim().length > 0 && findCommandEcho(result, commandLine)) {
|
|
57
|
+
return _stripCommandEchoAndPromptOnce(result, commandLine, log);
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
function _stripCommandEchoAndPromptOnce(output, commandLine, log) {
|
|
62
|
+
const echoResult = findCommandEcho(output, commandLine, true);
|
|
63
|
+
const lines = echoResult ? echoResult.linesAfter : output.split("\n");
|
|
64
|
+
const startIndex = 0;
|
|
65
|
+
const promptBefore = echoResult?.contentBefore ?? "";
|
|
66
|
+
const isUnixAt = /\w+@[\w.-]+:/.test(promptBefore);
|
|
67
|
+
const isUnixHost = !isUnixAt && /[\w.-]+:\S/.test(promptBefore);
|
|
68
|
+
const isUnix = isUnixAt || isUnixHost;
|
|
69
|
+
const isPowerShell = /^PS\s/i.test(promptBefore);
|
|
70
|
+
const isCmd = !isPowerShell && /^[A-Z]:\\/.test(promptBefore);
|
|
71
|
+
const isStarship = /\u276f/.test(promptBefore);
|
|
72
|
+
const isPython = />>>/.test(promptBefore);
|
|
73
|
+
const knownPrompt = isUnix || isPowerShell || isCmd || isStarship || isPython;
|
|
74
|
+
let endIndex = lines.length;
|
|
75
|
+
let trailingStrippedCount = 0;
|
|
76
|
+
const maxTrailingPromptLines = 2;
|
|
77
|
+
while (endIndex > startIndex) {
|
|
78
|
+
const line = lines[endIndex - 1].trimEnd();
|
|
79
|
+
if (line.length === 0) {
|
|
80
|
+
endIndex--;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (trailingStrippedCount >= maxTrailingPromptLines) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
const isCompletePrompt =
|
|
87
|
+
((!knownPrompt || isUnixAt) && /^\s*\w+@[\w.-]+:.*[#$]\s*$/.test(line)) || ((!knownPrompt || isUnixHost) && /^\s*[\w.-]+:\S.*\s\w+[#$]\s*$/.test(line)) || ((!knownPrompt || isPowerShell) && /^PS\s+[A-Z]:\\.*>\s*$/.test(line)) || ((!knownPrompt || isCmd) && /^[A-Z]:\\.*>\s*$/.test(line)) || ((!knownPrompt || isStarship) && /\u276f\s*$/.test(line)) || ((!knownPrompt || isPython) && /^>>>\s*$/.test(line));
|
|
88
|
+
const isPromptFragment =
|
|
89
|
+
((!knownPrompt || isUnix) && /^\s*[\w/.-]+[#$]\s*$/.test(line)) || ((!knownPrompt || isUnix) && /^\[\s*[\w.-]+(@[\w.-]+)?:[~\/]/.test(line)) || ((!knownPrompt || isUnix) && trailingStrippedCount > 0 && /^\s*[\w][-\w.]*(@[\w.-]+)?:\S/.test(line)) || ((!knownPrompt || isUnix) && /\]\s*[#$]\s*$/.test(line));
|
|
90
|
+
if (isCompletePrompt) {
|
|
91
|
+
endIndex--;
|
|
92
|
+
trailingStrippedCount++;
|
|
93
|
+
break;
|
|
94
|
+
} else if (isPromptFragment) {
|
|
95
|
+
endIndex--;
|
|
96
|
+
trailingStrippedCount++;
|
|
97
|
+
} else {
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const result = lines.slice(startIndex, endIndex).join("\n");
|
|
102
|
+
log?.(
|
|
103
|
+
`stripCommandEchoAndPrompt result: length=${result.length} (startIndex=${startIndex}, endIndex=${endIndex}, totalLines=${lines.length})`
|
|
104
|
+
);
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
function findCommandEcho(output, commandLine, allowSuffixMatch) {
|
|
108
|
+
const trimmedCommand = commandLine.trim();
|
|
109
|
+
if (trimmedCommand.length === 0) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const {
|
|
113
|
+
strippedOutput,
|
|
114
|
+
indexMapping
|
|
115
|
+
} = stripNewLinesAndBuildMapping(output);
|
|
116
|
+
const matchIndex = strippedOutput.indexOf(trimmedCommand);
|
|
117
|
+
let matchEndInStripped;
|
|
118
|
+
let contentBefore;
|
|
119
|
+
if (matchIndex !== -1) {
|
|
120
|
+
contentBefore = strippedOutput.substring(0, matchIndex).trim();
|
|
121
|
+
matchEndInStripped = matchIndex + trimmedCommand.length - 1;
|
|
122
|
+
} else if (allowSuffixMatch) {
|
|
123
|
+
let suffixLen = 0;
|
|
124
|
+
for (let len = trimmedCommand.length - 1; len >= 1; len--) {
|
|
125
|
+
const suffix = trimmedCommand.substring(trimmedCommand.length - len);
|
|
126
|
+
if (strippedOutput.startsWith(suffix)) {
|
|
127
|
+
const charBefore = trimmedCommand[trimmedCommand.length - len - 1];
|
|
128
|
+
if (charBefore !== undefined && charBefore !== " " && charBefore !== "\t") {
|
|
129
|
+
suffixLen = len;
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (suffixLen === 0) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
contentBefore = "";
|
|
138
|
+
matchEndInStripped = suffixLen - 1;
|
|
139
|
+
} else {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
const originalEnd = indexMapping[matchEndInStripped];
|
|
143
|
+
const lines = output.split("\n");
|
|
144
|
+
let echoEndLine = 0;
|
|
145
|
+
let offset = 0;
|
|
146
|
+
for (let i = 0; i < lines.length; i++) {
|
|
147
|
+
const lineEnd = offset + lines[i].length;
|
|
148
|
+
if (offset <= originalEnd && originalEnd <= lineEnd) {
|
|
149
|
+
echoEndLine = i + 1;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
offset = lineEnd + 1;
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
contentBefore,
|
|
156
|
+
linesAfter: lines.slice(echoEndLine)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function stripNewLinesAndBuildMapping(output) {
|
|
160
|
+
const indexMapping = [];
|
|
161
|
+
const strippedChars = [];
|
|
162
|
+
for (let i = 0; i < output.length; i++) {
|
|
163
|
+
if (output[i] !== "\n") {
|
|
164
|
+
strippedChars.push(output[i]);
|
|
165
|
+
indexMapping.push(i);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
strippedOutput: strippedChars.join(""),
|
|
170
|
+
indexMapping
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { createAltBufferPromise, findCommandEcho, setupRecreatingStartMarker, stripCommandEchoAndPrompt, stripNewLinesAndBuildMapping };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
2
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
3
|
+
export interface IGetOutputOptions {
|
|
4
|
+
/** When set, only return the last N non-empty lines from the bottom of the buffer. */
|
|
5
|
+
lastNLines?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function getOutput(instance: ITerminalInstance, startMarker?: IXtermMarker, options?: IGetOutputOptions): string;
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import { truncateOutputKeepingTail } from './runInTerminalHelpers.js';
|
|
3
|
+
|
|
4
|
+
const MAX_OUTPUT_LENGTH = 60000;
|
|
5
|
+
function getOutput(instance, startMarker, options) {
|
|
6
|
+
if (!instance.xterm || !instance.xterm.raw) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
const buffer = instance.xterm.raw.buffer.active;
|
|
10
|
+
let startLine = Math.max(startMarker?.line ?? 0, 0);
|
|
11
|
+
while (startLine > 0 && buffer.getLine(startLine)?.isWrapped) {
|
|
12
|
+
startLine--;
|
|
13
|
+
}
|
|
14
|
+
const endLine = buffer.length;
|
|
15
|
+
const lines = [];
|
|
16
|
+
let currentLine = '';
|
|
17
|
+
for (let y = startLine; y < endLine; y++) {
|
|
18
|
+
const line = buffer.getLine(y);
|
|
19
|
+
if (!line) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const isWrapped = !!buffer.getLine(y + 1)?.isWrapped;
|
|
23
|
+
currentLine += line.translateToString(!isWrapped);
|
|
24
|
+
if (!isWrapped) {
|
|
25
|
+
lines.push(currentLine);
|
|
26
|
+
currentLine = '';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (currentLine) {
|
|
30
|
+
lines.push(currentLine);
|
|
31
|
+
}
|
|
32
|
+
if (options?.lastNLines !== undefined) {
|
|
33
|
+
const nonEmpty = lines.filter(l => l.trim().length > 0);
|
|
34
|
+
return nonEmpty.slice(-options.lastNLines).join('\n');
|
|
35
|
+
}
|
|
36
|
+
let output = lines.join('\n');
|
|
37
|
+
if (output.length > MAX_OUTPUT_LENGTH) {
|
|
38
|
+
output = truncateOutputKeepingTail(output, MAX_OUTPUT_LENGTH);
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { getOutput };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
+
import type { ToolConfirmationAction } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
3
|
+
import type { ICommandApprovalResultWithReason } from "./tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js";
|
|
4
|
+
export declare function isPowerShell(envShell: string, os: OperatingSystem): boolean;
|
|
5
|
+
export declare function isWindowsPowerShell(envShell: string): boolean;
|
|
6
|
+
export declare function isZsh(envShell: string, os: OperatingSystem): boolean;
|
|
7
|
+
export declare function isBash(envShell: string, os: OperatingSystem): boolean;
|
|
8
|
+
export declare function isFish(envShell: string, os: OperatingSystem): boolean;
|
|
9
|
+
export declare const TRUNCATION_MESSAGE = "\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n";
|
|
10
|
+
export declare function truncateOutputKeepingTail(output: string, maxLength: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes command text for UI display by removing unnecessary quote and forward slash
|
|
13
|
+
* escaping artifacts (for example: \" \' \/) commonly produced in streamed tool-call JSON.
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeTerminalCommandForDisplay(commandLine: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Builds a single-line display string for a terminal command, suitable for UI messages.
|
|
18
|
+
* Normalizes escape artifacts, collapses newlines to spaces, and truncates to 80 characters.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildCommandDisplayText(command: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Normalizes a terminal command for execution by collapsing newlines to spaces.
|
|
23
|
+
* This prevents multi-line input from being sent as multiple commands via sendText.
|
|
24
|
+
*/
|
|
25
|
+
export declare function normalizeCommandForExecution(command: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether a command spans multiple lines (heredoc, multi-statement block, etc.).
|
|
28
|
+
* Multi-line commands must be sent verbatim through bracketed paste mode so the
|
|
29
|
+
* shell treats them as a single paste instead of executing each line as it
|
|
30
|
+
* arrives.
|
|
31
|
+
*
|
|
32
|
+
* Bare line continuations (`\` immediately before a newline) are **not**
|
|
33
|
+
* considered multi-line because the shell joins them into a single logical
|
|
34
|
+
* line. Only newlines that are *not* preceded by a backslash count.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isMultilineCommand(command: string): boolean;
|
|
37
|
+
export declare function generateAutoApproveActions(commandLine: string, subCommands: string[], autoApproveResult: {
|
|
38
|
+
subCommandResults: ICommandApprovalResultWithReason[];
|
|
39
|
+
commandLineResult: ICommandApprovalResultWithReason;
|
|
40
|
+
}): ToolConfirmationAction[];
|
|
41
|
+
export declare function dedupeRules(rules: ICommandApprovalResultWithReason[]): ICommandApprovalResultWithReason[];
|
|
42
|
+
export interface IExtractedCdPrefix {
|
|
43
|
+
/** The directory path that was extracted from the cd command */
|
|
44
|
+
directory: string;
|
|
45
|
+
/** The command to run after the cd */
|
|
46
|
+
command: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Extracts a cd prefix from a command line, returning the directory and remaining command.
|
|
50
|
+
* Does not check if the directory matches the current cwd - just extracts the pattern.
|
|
51
|
+
*/
|
|
52
|
+
export declare function extractCdPrefix(commandLine: string, shell: string, os: OperatingSystem): IExtractedCdPrefix | undefined;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
|
|
2
|
+
import { Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
3
|
+
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
4
|
+
import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
5
|
+
import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
6
|
+
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
7
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
+
import { isAutoApproveRule } from './tools/commandLineAnalyzer/commandLineAnalyzer.js';
|
|
9
|
+
|
|
10
|
+
function isPowerShell(envShell, os) {
|
|
11
|
+
if (os === OperatingSystem.Windows) {
|
|
12
|
+
return /^(?:powershell|pwsh)(?:-preview)?$/i.test(win32.basename(envShell).replace(/\.exe$/i, ""));
|
|
13
|
+
}
|
|
14
|
+
return /^(?:powershell|pwsh)(?:-preview)?$/.test(posix.basename(envShell));
|
|
15
|
+
}
|
|
16
|
+
function isWindowsPowerShell(envShell) {
|
|
17
|
+
return envShell.endsWith("System32\\WindowsPowerShell\\v1.0\\powershell.exe");
|
|
18
|
+
}
|
|
19
|
+
function isZsh(envShell, os) {
|
|
20
|
+
if (os === OperatingSystem.Windows) {
|
|
21
|
+
return /^zsh(?:\.exe)?$/i.test(win32.basename(envShell));
|
|
22
|
+
}
|
|
23
|
+
return /^zsh$/.test(posix.basename(envShell));
|
|
24
|
+
}
|
|
25
|
+
function isBash(envShell, os) {
|
|
26
|
+
if (os === OperatingSystem.Windows) {
|
|
27
|
+
return /^bash(?:\.exe)?$/i.test(win32.basename(envShell));
|
|
28
|
+
}
|
|
29
|
+
return /^bash$/.test(posix.basename(envShell));
|
|
30
|
+
}
|
|
31
|
+
function isFish(envShell, os) {
|
|
32
|
+
if (os === OperatingSystem.Windows) {
|
|
33
|
+
return /^fish(?:\.exe)?$/i.test(win32.basename(envShell));
|
|
34
|
+
}
|
|
35
|
+
return /^fish$/.test(posix.basename(envShell));
|
|
36
|
+
}
|
|
37
|
+
const TRUNCATION_MESSAGE = "\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n";
|
|
38
|
+
function truncateOutputKeepingTail(output, maxLength) {
|
|
39
|
+
if (output.length <= maxLength) {
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
const truncationMessageLength = TRUNCATION_MESSAGE.length;
|
|
43
|
+
if (truncationMessageLength >= maxLength) {
|
|
44
|
+
return TRUNCATION_MESSAGE.slice(TRUNCATION_MESSAGE.length - maxLength);
|
|
45
|
+
}
|
|
46
|
+
const availableLength = maxLength - truncationMessageLength;
|
|
47
|
+
const endPortion = output.slice(-availableLength);
|
|
48
|
+
return TRUNCATION_MESSAGE + endPortion;
|
|
49
|
+
}
|
|
50
|
+
function normalizeTerminalCommandForDisplay(commandLine) {
|
|
51
|
+
return commandLine.replace(/\\(["'\/])/g, "$1");
|
|
52
|
+
}
|
|
53
|
+
function buildCommandDisplayText(command) {
|
|
54
|
+
const normalized = normalizeTerminalCommandForDisplay(command).replace(/\r\n|\r|\n/g, " ");
|
|
55
|
+
return normalized.length > 80 ? normalized.substring(0, 77) + "..." : normalized;
|
|
56
|
+
}
|
|
57
|
+
function normalizeCommandForExecution(command) {
|
|
58
|
+
return command.replace(/\r\n|\r|\n/g, " ").trim();
|
|
59
|
+
}
|
|
60
|
+
function isMultilineCommand(command) {
|
|
61
|
+
const normalized = command.replace(/\r\n|\r/g, "\n");
|
|
62
|
+
return /(?<!\\)\n/.test(normalized);
|
|
63
|
+
}
|
|
64
|
+
function generateAutoApproveActions(commandLine, subCommands, autoApproveResult) {
|
|
65
|
+
const actions = [];
|
|
66
|
+
const canCreateAutoApproval = (autoApproveResult.subCommandResults.every(e => e.result !== "denied") && autoApproveResult.commandLineResult.result !== "denied");
|
|
67
|
+
if (canCreateAutoApproval) {
|
|
68
|
+
const unapprovedSubCommands = subCommands.filter((_, index) => {
|
|
69
|
+
return autoApproveResult.subCommandResults[index].result !== "approved";
|
|
70
|
+
});
|
|
71
|
+
const neverAutoApproveCommands = ( new Set([
|
|
72
|
+
"bash", "sh", "zsh", "fish", "ksh", "csh", "tcsh", "dash", "pwsh", "powershell", "powershell.exe", "cmd", "cmd.exe",
|
|
73
|
+
"python", "python3", "node", "ruby", "perl", "php", "lua",
|
|
74
|
+
"eval", "exec", "source", "sudo", "su", "doas",
|
|
75
|
+
"curl", "wget", "invoke-restmethod", "invoke-webrequest", "irm", "iwr"]));
|
|
76
|
+
const commandsWithSubcommands = ( new Set([
|
|
77
|
+
"git",
|
|
78
|
+
"npm",
|
|
79
|
+
"npx",
|
|
80
|
+
"yarn",
|
|
81
|
+
"docker",
|
|
82
|
+
"kubectl",
|
|
83
|
+
"cargo",
|
|
84
|
+
"dotnet",
|
|
85
|
+
"mvn",
|
|
86
|
+
"gradle"
|
|
87
|
+
]));
|
|
88
|
+
const commandsWithSubSubCommands = ( new Set(["npm run", "yarn run"]));
|
|
89
|
+
const findNextNonFlagArg = (parts, startIndex) => {
|
|
90
|
+
for (let i = startIndex; i < parts.length; i++) {
|
|
91
|
+
if (!parts[i].startsWith("-")) {
|
|
92
|
+
return i;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
};
|
|
97
|
+
const subCommandsToSuggest = Array.from(( new Set(coalesce(( unapprovedSubCommands.map(command => {
|
|
98
|
+
const parts = command.trim().split(/\s+/);
|
|
99
|
+
const baseCommand = parts[0].toLowerCase();
|
|
100
|
+
if (( neverAutoApproveCommands.has(baseCommand))) {
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
if (( commandsWithSubcommands.has(baseCommand))) {
|
|
104
|
+
const subCommandIndex = findNextNonFlagArg(parts, 1);
|
|
105
|
+
if (subCommandIndex !== undefined) {
|
|
106
|
+
const baseSubCommand = `${parts[0]} ${parts[subCommandIndex]}`.toLowerCase();
|
|
107
|
+
if (( commandsWithSubSubCommands.has(baseSubCommand))) {
|
|
108
|
+
const subSubCommandIndex = findNextNonFlagArg(parts, subCommandIndex + 1);
|
|
109
|
+
if (subSubCommandIndex !== undefined) {
|
|
110
|
+
return parts.slice(0, subSubCommandIndex + 1).join(" ");
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
} else {
|
|
114
|
+
return parts.slice(0, subCommandIndex + 1).join(" ");
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
} else {
|
|
119
|
+
return parts[0];
|
|
120
|
+
}
|
|
121
|
+
}))))));
|
|
122
|
+
if (subCommandsToSuggest.length > 0) {
|
|
123
|
+
let subCommandLabel;
|
|
124
|
+
if (subCommandsToSuggest.length === 1) {
|
|
125
|
+
subCommandLabel = `\`${subCommandsToSuggest[0]} \u2026\``;
|
|
126
|
+
} else {
|
|
127
|
+
subCommandLabel = `Commands ${( subCommandsToSuggest.map(e => `\`${e} \u2026\``)).join(", ")}`;
|
|
128
|
+
}
|
|
129
|
+
actions.push({
|
|
130
|
+
label: `Allow ${subCommandLabel} in this Session`,
|
|
131
|
+
data: {
|
|
132
|
+
type: "newRule",
|
|
133
|
+
rule: ( subCommandsToSuggest.map(key => ({
|
|
134
|
+
key,
|
|
135
|
+
value: true,
|
|
136
|
+
scope: "session"
|
|
137
|
+
})))
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
actions.push({
|
|
141
|
+
label: `Allow ${subCommandLabel} in this Workspace`,
|
|
142
|
+
data: {
|
|
143
|
+
type: "newRule",
|
|
144
|
+
rule: ( subCommandsToSuggest.map(key => ({
|
|
145
|
+
key,
|
|
146
|
+
value: true,
|
|
147
|
+
scope: "workspace"
|
|
148
|
+
})))
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
actions.push({
|
|
152
|
+
label: `Always Allow ${subCommandLabel}`,
|
|
153
|
+
data: {
|
|
154
|
+
type: "newRule",
|
|
155
|
+
rule: ( subCommandsToSuggest.map(key => ({
|
|
156
|
+
key,
|
|
157
|
+
value: true,
|
|
158
|
+
scope: "user"
|
|
159
|
+
})))
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (actions.length > 0) {
|
|
164
|
+
actions.push(( new Separator()));
|
|
165
|
+
}
|
|
166
|
+
const firstSubcommandFirstWord = unapprovedSubCommands.length > 0 ? unapprovedSubCommands[0].split(" ")[0] : "";
|
|
167
|
+
if (firstSubcommandFirstWord !== commandLine && !( commandsWithSubcommands.has(commandLine)) && !( commandsWithSubSubCommands.has(commandLine))) {
|
|
168
|
+
actions.push({
|
|
169
|
+
label: ( localize(14630, "Allow Exact Command Line in this Session")),
|
|
170
|
+
data: {
|
|
171
|
+
type: "newRule",
|
|
172
|
+
rule: {
|
|
173
|
+
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
174
|
+
value: {
|
|
175
|
+
approve: true,
|
|
176
|
+
matchCommandLine: true
|
|
177
|
+
},
|
|
178
|
+
scope: "session"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
actions.push({
|
|
183
|
+
label: ( localize(14631, "Allow Exact Command Line in this Workspace")),
|
|
184
|
+
data: {
|
|
185
|
+
type: "newRule",
|
|
186
|
+
rule: {
|
|
187
|
+
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
188
|
+
value: {
|
|
189
|
+
approve: true,
|
|
190
|
+
matchCommandLine: true
|
|
191
|
+
},
|
|
192
|
+
scope: "workspace"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
actions.push({
|
|
197
|
+
label: ( localize(14632, "Always Allow Exact Command Line")),
|
|
198
|
+
data: {
|
|
199
|
+
type: "newRule",
|
|
200
|
+
rule: {
|
|
201
|
+
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
202
|
+
value: {
|
|
203
|
+
approve: true,
|
|
204
|
+
matchCommandLine: true
|
|
205
|
+
},
|
|
206
|
+
scope: "user"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (actions.length > 0) {
|
|
213
|
+
actions.push(( new Separator()));
|
|
214
|
+
}
|
|
215
|
+
actions.push({
|
|
216
|
+
label: ( localize(14633, "Allow All Commands in this Session")),
|
|
217
|
+
tooltip: ( localize(14634, "Allow this tool to run in this session without confirmation.")),
|
|
218
|
+
data: {
|
|
219
|
+
type: "sessionApproval"
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
actions.push(( new Separator()));
|
|
223
|
+
actions.push({
|
|
224
|
+
label: ( localize(14635, "Configure Auto Approve...")),
|
|
225
|
+
data: {
|
|
226
|
+
type: "configure"
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
return actions;
|
|
230
|
+
}
|
|
231
|
+
function dedupeRules(rules) {
|
|
232
|
+
return rules.filter((result, index, array) => {
|
|
233
|
+
if (!isAutoApproveRule(result.rule)) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
const sourceText = result.rule.sourceText;
|
|
237
|
+
return array.findIndex(r => isAutoApproveRule(r.rule) && r.rule.sourceText === sourceText) === index;
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function extractCdPrefix(commandLine, shell, os) {
|
|
241
|
+
const isPwsh = isPowerShell(shell, os);
|
|
242
|
+
const cdPrefixMatch = commandLine.match(
|
|
243
|
+
isPwsh ? /^(?:cd(?: \/d)?|Set-Location(?: -Path)?) (?<dir>[^\s]+) ?(?:&&|;)\s+(?<suffix>.+)$/i : /^cd (?<dir>[^\s]+) &&\s+(?<suffix>.+)$/
|
|
244
|
+
);
|
|
245
|
+
const cdDir = cdPrefixMatch?.groups?.dir;
|
|
246
|
+
const cdSuffix = cdPrefixMatch?.groups?.suffix;
|
|
247
|
+
if (cdDir && cdSuffix) {
|
|
248
|
+
let cdDirPath = cdDir;
|
|
249
|
+
if (cdDirPath.startsWith("\"") && cdDirPath.endsWith("\"")) {
|
|
250
|
+
cdDirPath = cdDirPath.slice(1, -1);
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
directory: cdDirPath,
|
|
254
|
+
command: cdSuffix
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export { TRUNCATION_MESSAGE, buildCommandDisplayText, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isMultilineCommand, isPowerShell, isWindowsPowerShell, isZsh, normalizeCommandForExecution, normalizeTerminalCommandForDisplay, truncateOutputKeepingTail };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
2
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
3
|
+
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
4
|
+
import { ShellIntegrationQuality } from "./toolTerminalCreator.js";
|
|
5
|
+
export declare class RunInTerminalToolTelemetry {
|
|
6
|
+
private readonly _telemetryService;
|
|
7
|
+
private readonly _configurationService;
|
|
8
|
+
constructor(_telemetryService: ITelemetryService, _configurationService: IConfigurationService);
|
|
9
|
+
logPrepare(state: {
|
|
10
|
+
terminalToolSessionId: string | undefined;
|
|
11
|
+
subCommands: string[];
|
|
12
|
+
autoApproveAllowed: "allowed" | "needsOptIn" | "off";
|
|
13
|
+
autoApproveResult: "approved" | "denied" | "manual";
|
|
14
|
+
autoApproveReason: "subCommand" | "commandLine" | undefined;
|
|
15
|
+
autoApproveDefault: boolean | undefined;
|
|
16
|
+
}): void;
|
|
17
|
+
logInvoke(instance: ITerminalInstance, state: {
|
|
18
|
+
terminalToolSessionId: string | undefined;
|
|
19
|
+
didUserEditCommand: boolean;
|
|
20
|
+
didToolEditCommand: boolean;
|
|
21
|
+
error: string | undefined;
|
|
22
|
+
isBackground: boolean;
|
|
23
|
+
isNewSession: boolean;
|
|
24
|
+
isSandboxWrapped: boolean;
|
|
25
|
+
requestUnsandboxedExecutionReason: string | undefined;
|
|
26
|
+
shellIntegrationQuality: ShellIntegrationQuality;
|
|
27
|
+
outputLineCount: number;
|
|
28
|
+
timingConnectMs: number;
|
|
29
|
+
timingExecuteMs: number;
|
|
30
|
+
pollDurationMs: number | undefined;
|
|
31
|
+
terminalExecutionIdleBeforeTimeout: boolean | undefined;
|
|
32
|
+
exitCode: number | undefined;
|
|
33
|
+
inputUserChars: number;
|
|
34
|
+
inputUserSigint: boolean;
|
|
35
|
+
inputToolManualAcceptCount: number | undefined;
|
|
36
|
+
inputToolManualRejectCount: number | undefined;
|
|
37
|
+
inputToolManualChars: number | undefined;
|
|
38
|
+
inputToolAutoAcceptCount: number | undefined;
|
|
39
|
+
inputToolAutoChars: number | undefined;
|
|
40
|
+
inputToolManualShownCount: number | undefined;
|
|
41
|
+
inputToolFreeFormInputShownCount: number | undefined;
|
|
42
|
+
inputToolFreeFormInputCount: number | undefined;
|
|
43
|
+
}): void;
|
|
44
|
+
}
|