@codingame/monaco-vscode-chat-service-override 33.0.8 → 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,392 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { structuralEquals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/equals';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { regExpLeadsToEndlessLoop, escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
6
|
+
import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
+
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
8
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
11
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
12
|
+
import { isPowerShell } from '../../../runInTerminalHelpers.js';
|
|
13
|
+
import { NpmScriptAutoApprover } from './npmScriptAutoApprover.js';
|
|
14
|
+
|
|
15
|
+
const neverMatchRegex = /(?!.*)/;
|
|
16
|
+
const transientEnvVarRegex = /^[A-Z_][A-Z0-9_]*=/i;
|
|
17
|
+
let CommandLineAutoApprover = class CommandLineAutoApprover extends Disposable {
|
|
18
|
+
constructor(_configurationService, instantiationService, _terminalChatService) {
|
|
19
|
+
super();
|
|
20
|
+
this._configurationService = _configurationService;
|
|
21
|
+
this._terminalChatService = _terminalChatService;
|
|
22
|
+
this._denyListRules = [];
|
|
23
|
+
this._allowListRules = [];
|
|
24
|
+
this._allowListCommandLineRules = [];
|
|
25
|
+
this._denyListCommandLineRules = [];
|
|
26
|
+
this._npmScriptAutoApprover = this._register(instantiationService.createInstance(NpmScriptAutoApprover));
|
|
27
|
+
this.updateConfiguration();
|
|
28
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
29
|
+
if (e.affectsConfiguration(TerminalChatAgentToolsSettingId.AutoApprove) || e.affectsConfiguration(TerminalChatAgentToolsSettingId.IgnoreDefaultAutoApproveRules) || e.affectsConfiguration(TerminalChatAgentToolsSettingId.DeprecatedAutoApproveCompatible)) {
|
|
30
|
+
this.updateConfiguration();
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
updateConfiguration() {
|
|
35
|
+
let configValue = this._configurationService.getValue(TerminalChatAgentToolsSettingId.AutoApprove);
|
|
36
|
+
const configInspectValue = this._configurationService.inspect(TerminalChatAgentToolsSettingId.AutoApprove);
|
|
37
|
+
const deprecatedValue = this._configurationService.getValue(TerminalChatAgentToolsSettingId.DeprecatedAutoApproveCompatible);
|
|
38
|
+
if (deprecatedValue && typeof deprecatedValue === "object" && configValue && typeof configValue === "object") {
|
|
39
|
+
configValue = {
|
|
40
|
+
...configValue,
|
|
41
|
+
...deprecatedValue
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const {
|
|
45
|
+
denyListRules,
|
|
46
|
+
allowListRules,
|
|
47
|
+
allowListCommandLineRules,
|
|
48
|
+
denyListCommandLineRules
|
|
49
|
+
} = this._mapAutoApproveConfigToRules(configValue, configInspectValue);
|
|
50
|
+
this._allowListRules = allowListRules;
|
|
51
|
+
this._denyListRules = denyListRules;
|
|
52
|
+
this._allowListCommandLineRules = allowListCommandLineRules;
|
|
53
|
+
this._denyListCommandLineRules = denyListCommandLineRules;
|
|
54
|
+
}
|
|
55
|
+
async isCommandAutoApproved(command, shell, os, cwd, chatSessionResource) {
|
|
56
|
+
if (transientEnvVarRegex.test(command)) {
|
|
57
|
+
return {
|
|
58
|
+
result: "denied",
|
|
59
|
+
reason: `Command '${command}' is denied because it contains transient environment variables`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
for (const rule of this._denyListRules) {
|
|
63
|
+
if (this._commandMatchesRule(rule, command, shell, os)) {
|
|
64
|
+
return {
|
|
65
|
+
result: "denied",
|
|
66
|
+
rule,
|
|
67
|
+
reason: `Command '${command}' is denied by deny list rule: ${rule.sourceText}`
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (const rule of this._getSessionRules(chatSessionResource).allowListRules) {
|
|
72
|
+
if (this._commandMatchesRule(rule, command, shell, os)) {
|
|
73
|
+
return {
|
|
74
|
+
result: "approved",
|
|
75
|
+
rule,
|
|
76
|
+
reason: `Command '${command}' is approved by session allow list rule: ${rule.sourceText}`
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const rule of this._allowListRules) {
|
|
81
|
+
if (this._commandMatchesRule(rule, command, shell, os)) {
|
|
82
|
+
return {
|
|
83
|
+
result: "approved",
|
|
84
|
+
rule,
|
|
85
|
+
reason: `Command '${command}' is approved by allow list rule: ${rule.sourceText}`
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const npmScriptResult = await this._npmScriptAutoApprover.isCommandAutoApproved(command, cwd);
|
|
90
|
+
if (npmScriptResult.isAutoApproved) {
|
|
91
|
+
return {
|
|
92
|
+
result: "approved",
|
|
93
|
+
rule: {
|
|
94
|
+
type: "npmScript",
|
|
95
|
+
npmScriptResult
|
|
96
|
+
},
|
|
97
|
+
reason: `Command '${command}' is approved as npm script '${npmScriptResult.scriptName}' is defined in package.json`
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
result: "noMatch",
|
|
102
|
+
reason: `Command '${command}' has no matching auto approve entries`
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
isCommandLineAutoApproved(commandLine, chatSessionResource) {
|
|
106
|
+
for (const rule of this._denyListCommandLineRules) {
|
|
107
|
+
if (rule.regex.test(commandLine)) {
|
|
108
|
+
return {
|
|
109
|
+
result: "denied",
|
|
110
|
+
rule,
|
|
111
|
+
reason: `Command line '${commandLine}' is denied by deny list rule: ${rule.sourceText}`
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
for (const rule of this._getSessionRules(chatSessionResource).allowListCommandLineRules) {
|
|
116
|
+
if (rule.regex.test(commandLine)) {
|
|
117
|
+
return {
|
|
118
|
+
result: "approved",
|
|
119
|
+
rule,
|
|
120
|
+
reason: `Command line '${commandLine}' is approved by session allow list rule: ${rule.sourceText}`
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (const rule of this._allowListCommandLineRules) {
|
|
125
|
+
if (rule.regex.test(commandLine)) {
|
|
126
|
+
return {
|
|
127
|
+
result: "approved",
|
|
128
|
+
rule,
|
|
129
|
+
reason: `Command line '${commandLine}' is approved by allow list rule: ${rule.sourceText}`
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
result: "noMatch",
|
|
135
|
+
reason: `Command line '${commandLine}' has no matching auto approve entries`
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
_getSessionRules(chatSessionResource) {
|
|
139
|
+
const denyListRules = [];
|
|
140
|
+
const allowListRules = [];
|
|
141
|
+
const allowListCommandLineRules = [];
|
|
142
|
+
const denyListCommandLineRules = [];
|
|
143
|
+
if (!chatSessionResource) {
|
|
144
|
+
return {
|
|
145
|
+
denyListRules,
|
|
146
|
+
allowListRules,
|
|
147
|
+
allowListCommandLineRules,
|
|
148
|
+
denyListCommandLineRules
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
const sessionRulesConfig = this._terminalChatService.getSessionAutoApproveRules(chatSessionResource);
|
|
152
|
+
for (const [key, value] of Object.entries(sessionRulesConfig)) {
|
|
153
|
+
if (typeof value === "boolean") {
|
|
154
|
+
const {
|
|
155
|
+
regex,
|
|
156
|
+
regexCaseInsensitive
|
|
157
|
+
} = this._convertAutoApproveEntryToRegex(key);
|
|
158
|
+
if (value === true) {
|
|
159
|
+
allowListRules.push({
|
|
160
|
+
regex,
|
|
161
|
+
regexCaseInsensitive,
|
|
162
|
+
sourceText: key,
|
|
163
|
+
sourceTarget: "session",
|
|
164
|
+
isDefaultRule: false
|
|
165
|
+
});
|
|
166
|
+
} else if (value === false) {
|
|
167
|
+
denyListRules.push({
|
|
168
|
+
regex,
|
|
169
|
+
regexCaseInsensitive,
|
|
170
|
+
sourceText: key,
|
|
171
|
+
sourceTarget: "session",
|
|
172
|
+
isDefaultRule: false
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
} else if (typeof value === "object" && value !== null) {
|
|
176
|
+
const objectValue = value;
|
|
177
|
+
if (typeof objectValue.approve === "boolean") {
|
|
178
|
+
const {
|
|
179
|
+
regex,
|
|
180
|
+
regexCaseInsensitive
|
|
181
|
+
} = this._convertAutoApproveEntryToRegex(key);
|
|
182
|
+
if (objectValue.approve === true) {
|
|
183
|
+
if (objectValue.matchCommandLine === true) {
|
|
184
|
+
allowListCommandLineRules.push({
|
|
185
|
+
regex,
|
|
186
|
+
regexCaseInsensitive,
|
|
187
|
+
sourceText: key,
|
|
188
|
+
sourceTarget: "session",
|
|
189
|
+
isDefaultRule: false
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
allowListRules.push({
|
|
193
|
+
regex,
|
|
194
|
+
regexCaseInsensitive,
|
|
195
|
+
sourceText: key,
|
|
196
|
+
sourceTarget: "session",
|
|
197
|
+
isDefaultRule: false
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
} else if (objectValue.approve === false) {
|
|
201
|
+
if (objectValue.matchCommandLine === true) {
|
|
202
|
+
denyListCommandLineRules.push({
|
|
203
|
+
regex,
|
|
204
|
+
regexCaseInsensitive,
|
|
205
|
+
sourceText: key,
|
|
206
|
+
sourceTarget: "session",
|
|
207
|
+
isDefaultRule: false
|
|
208
|
+
});
|
|
209
|
+
} else {
|
|
210
|
+
denyListRules.push({
|
|
211
|
+
regex,
|
|
212
|
+
regexCaseInsensitive,
|
|
213
|
+
sourceText: key,
|
|
214
|
+
sourceTarget: "session",
|
|
215
|
+
isDefaultRule: false
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
denyListRules,
|
|
224
|
+
allowListRules,
|
|
225
|
+
allowListCommandLineRules,
|
|
226
|
+
denyListCommandLineRules
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
_commandMatchesRule(rule, command, shell, os) {
|
|
230
|
+
const isPwsh = isPowerShell(shell, os);
|
|
231
|
+
if ((isPwsh ? rule.regexCaseInsensitive : rule.regex).test(command)) {
|
|
232
|
+
return true;
|
|
233
|
+
} else if (isPwsh && command.startsWith("(")) {
|
|
234
|
+
if (rule.regexCaseInsensitive.test(command.slice(1))) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
_mapAutoApproveConfigToRules(config, configInspectValue) {
|
|
241
|
+
if (!config || typeof config !== "object") {
|
|
242
|
+
return {
|
|
243
|
+
denyListRules: [],
|
|
244
|
+
allowListRules: [],
|
|
245
|
+
allowListCommandLineRules: [],
|
|
246
|
+
denyListCommandLineRules: []
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const denyListRules = [];
|
|
250
|
+
const allowListRules = [];
|
|
251
|
+
const allowListCommandLineRules = [];
|
|
252
|
+
const denyListCommandLineRules = [];
|
|
253
|
+
const ignoreDefaults = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IgnoreDefaultAutoApproveRules) === true;
|
|
254
|
+
for (const [key, value] of Object.entries(config)) {
|
|
255
|
+
const defaultValue = configInspectValue?.default?.value;
|
|
256
|
+
const isDefaultRule = !!(isObject(defaultValue) && Object.prototype.hasOwnProperty.call(defaultValue, key) && structuralEquals(defaultValue[key], value));
|
|
257
|
+
function checkTarget(inspectValue) {
|
|
258
|
+
return (isObject(inspectValue) && Object.prototype.hasOwnProperty.call(inspectValue, key) && structuralEquals(inspectValue[key], value));
|
|
259
|
+
}
|
|
260
|
+
const sourceTarget = (checkTarget(configInspectValue.workspaceFolderValue) ? ConfigurationTarget.WORKSPACE_FOLDER : checkTarget(configInspectValue.workspaceValue) ? ConfigurationTarget.WORKSPACE : checkTarget(configInspectValue.userRemoteValue) ? ConfigurationTarget.USER_REMOTE : checkTarget(configInspectValue.userLocalValue) ? ConfigurationTarget.USER_LOCAL : checkTarget(configInspectValue.userValue) ? ConfigurationTarget.USER : checkTarget(configInspectValue.applicationValue) ? ConfigurationTarget.APPLICATION : ConfigurationTarget.DEFAULT);
|
|
261
|
+
if (ignoreDefaults && isDefaultRule && sourceTarget === ConfigurationTarget.DEFAULT) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (typeof value === "boolean") {
|
|
265
|
+
const {
|
|
266
|
+
regex,
|
|
267
|
+
regexCaseInsensitive
|
|
268
|
+
} = this._convertAutoApproveEntryToRegex(key);
|
|
269
|
+
if (value === true) {
|
|
270
|
+
allowListRules.push({
|
|
271
|
+
regex,
|
|
272
|
+
regexCaseInsensitive,
|
|
273
|
+
sourceText: key,
|
|
274
|
+
sourceTarget,
|
|
275
|
+
isDefaultRule
|
|
276
|
+
});
|
|
277
|
+
} else if (value === false) {
|
|
278
|
+
denyListRules.push({
|
|
279
|
+
regex,
|
|
280
|
+
regexCaseInsensitive,
|
|
281
|
+
sourceText: key,
|
|
282
|
+
sourceTarget,
|
|
283
|
+
isDefaultRule
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
} else if (typeof value === "object" && value !== null) {
|
|
287
|
+
const objectValue = value;
|
|
288
|
+
if (typeof objectValue.approve === "boolean") {
|
|
289
|
+
const {
|
|
290
|
+
regex,
|
|
291
|
+
regexCaseInsensitive
|
|
292
|
+
} = this._convertAutoApproveEntryToRegex(key);
|
|
293
|
+
if (objectValue.approve === true) {
|
|
294
|
+
if (objectValue.matchCommandLine === true) {
|
|
295
|
+
allowListCommandLineRules.push({
|
|
296
|
+
regex,
|
|
297
|
+
regexCaseInsensitive,
|
|
298
|
+
sourceText: key,
|
|
299
|
+
sourceTarget,
|
|
300
|
+
isDefaultRule
|
|
301
|
+
});
|
|
302
|
+
} else {
|
|
303
|
+
allowListRules.push({
|
|
304
|
+
regex,
|
|
305
|
+
regexCaseInsensitive,
|
|
306
|
+
sourceText: key,
|
|
307
|
+
sourceTarget,
|
|
308
|
+
isDefaultRule
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
} else if (objectValue.approve === false) {
|
|
312
|
+
if (objectValue.matchCommandLine === true) {
|
|
313
|
+
denyListCommandLineRules.push({
|
|
314
|
+
regex,
|
|
315
|
+
regexCaseInsensitive,
|
|
316
|
+
sourceText: key,
|
|
317
|
+
sourceTarget,
|
|
318
|
+
isDefaultRule
|
|
319
|
+
});
|
|
320
|
+
} else {
|
|
321
|
+
denyListRules.push({
|
|
322
|
+
regex,
|
|
323
|
+
regexCaseInsensitive,
|
|
324
|
+
sourceText: key,
|
|
325
|
+
sourceTarget,
|
|
326
|
+
isDefaultRule
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
denyListRules,
|
|
335
|
+
allowListRules,
|
|
336
|
+
allowListCommandLineRules,
|
|
337
|
+
denyListCommandLineRules
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
_convertAutoApproveEntryToRegex(value) {
|
|
341
|
+
const regex = this._doConvertAutoApproveEntryToRegex(value);
|
|
342
|
+
if (regex.flags.includes("i")) {
|
|
343
|
+
return {
|
|
344
|
+
regex,
|
|
345
|
+
regexCaseInsensitive: regex
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
regex,
|
|
350
|
+
regexCaseInsensitive: ( new RegExp(regex.source, regex.flags + "i"))
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
_doConvertAutoApproveEntryToRegex(value) {
|
|
354
|
+
const regexMatch = value.match(/^\/(?<pattern>.+)\/(?<flags>[dgimsuvy]*)$/);
|
|
355
|
+
const regexPattern = regexMatch?.groups?.pattern;
|
|
356
|
+
if (regexPattern) {
|
|
357
|
+
let flags = regexMatch.groups?.flags;
|
|
358
|
+
if (flags) {
|
|
359
|
+
flags = flags.replaceAll("g", "");
|
|
360
|
+
}
|
|
361
|
+
if (regexPattern === ".*") {
|
|
362
|
+
return ( new RegExp(regexPattern));
|
|
363
|
+
}
|
|
364
|
+
try {
|
|
365
|
+
const regex = ( new RegExp(regexPattern, flags || undefined));
|
|
366
|
+
if (regExpLeadsToEndlessLoop(regex)) {
|
|
367
|
+
return neverMatchRegex;
|
|
368
|
+
}
|
|
369
|
+
return regex;
|
|
370
|
+
} catch (error) {
|
|
371
|
+
return neverMatchRegex;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (value === "") {
|
|
375
|
+
return neverMatchRegex;
|
|
376
|
+
}
|
|
377
|
+
let sanitizedValue;
|
|
378
|
+
if (value.includes("/") || value.includes("\\")) {
|
|
379
|
+
let pattern = value.replace(/[/\\]/g, "%%PATH_SEP%%");
|
|
380
|
+
pattern = escapeRegExpCharacters(pattern);
|
|
381
|
+
pattern = pattern.replace(/%%PATH_SEP%%*/g, "[/\\\\]");
|
|
382
|
+
sanitizedValue = `^(?:\\.[/\\\\])?${pattern}`;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
sanitizedValue = escapeRegExpCharacters(value);
|
|
386
|
+
}
|
|
387
|
+
return ( new RegExp(`^${sanitizedValue}\\b`));
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
CommandLineAutoApprover = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IInstantiationService)), ( __param(2, ITerminalChatService))], CommandLineAutoApprover));
|
|
391
|
+
|
|
392
|
+
export { CommandLineAutoApprover };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
|
|
5
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
6
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
7
|
+
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
8
|
+
export interface INpmScriptAutoApproveResult {
|
|
9
|
+
isAutoApproved: boolean;
|
|
10
|
+
scriptName?: string;
|
|
11
|
+
autoApproveInfo?: IMarkdownString;
|
|
12
|
+
}
|
|
13
|
+
export declare class NpmScriptAutoApprover extends Disposable {
|
|
14
|
+
private readonly _configurationService;
|
|
15
|
+
private readonly _fileService;
|
|
16
|
+
private readonly _uriIdentityService;
|
|
17
|
+
private readonly _workspaceContextService;
|
|
18
|
+
constructor(_configurationService: IConfigurationService, _fileService: IFileService, _uriIdentityService: IUriIdentityService, _workspaceContextService: IWorkspaceContextService);
|
|
19
|
+
/**
|
|
20
|
+
* Checks if a single command is an npm/yarn/pnpm script that exists in package.json.
|
|
21
|
+
* Returns auto-approve result if the command is a valid script.
|
|
22
|
+
*/
|
|
23
|
+
isCommandAutoApproved(command: string, cwd: URI | undefined): Promise<INpmScriptAutoApproveResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Extracts script name from an npm/yarn/pnpm run command.
|
|
26
|
+
*/
|
|
27
|
+
private _extractScriptName;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if a URI is within any workspace folder.
|
|
30
|
+
*/
|
|
31
|
+
private _isWithinWorkspace;
|
|
32
|
+
/**
|
|
33
|
+
* Finds and parses package.json to get the scripts section.
|
|
34
|
+
* Only looks within the workspace for security.
|
|
35
|
+
*/
|
|
36
|
+
private _getPackageJsonScripts;
|
|
37
|
+
/**
|
|
38
|
+
* Reads and parses the scripts section from a package.json file.
|
|
39
|
+
*/
|
|
40
|
+
private _readPackageJsonScripts;
|
|
41
|
+
/**
|
|
42
|
+
* Parses the scripts section from package.json content using jsonc-parser.
|
|
43
|
+
*/
|
|
44
|
+
private _parsePackageJsonScripts;
|
|
45
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
4
|
+
import { visit } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
5
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
|
+
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
8
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
11
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
12
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
13
|
+
|
|
14
|
+
const npmRunPatterns = [
|
|
15
|
+
/^(?<command>npm)\s+(?:run(?:-script)?)\s+(?<scriptName>[^\s&|;]+)/i,
|
|
16
|
+
/^(?<command>npm)\s+(?<scriptName>test|start|stop|restart)\b/i,
|
|
17
|
+
/^(?<command>yarn)\s+(?:run\s+)?(?<scriptName>[^\s&|;]+)/i,
|
|
18
|
+
/^(?<command>pnpm)\s+(?:run\s+)?(?<scriptName>[^\s&|;]+)/i];
|
|
19
|
+
const yarnBuiltinCommands = ( new Set([
|
|
20
|
+
"add",
|
|
21
|
+
"audit",
|
|
22
|
+
"autoclean",
|
|
23
|
+
"bin",
|
|
24
|
+
"cache",
|
|
25
|
+
"check",
|
|
26
|
+
"config",
|
|
27
|
+
"create",
|
|
28
|
+
"dedupe",
|
|
29
|
+
"dlx",
|
|
30
|
+
"exec",
|
|
31
|
+
"explain",
|
|
32
|
+
"generate-lock-entry",
|
|
33
|
+
"global",
|
|
34
|
+
"help",
|
|
35
|
+
"import",
|
|
36
|
+
"info",
|
|
37
|
+
"init",
|
|
38
|
+
"install",
|
|
39
|
+
"licenses",
|
|
40
|
+
"link",
|
|
41
|
+
"list",
|
|
42
|
+
"login",
|
|
43
|
+
"logout",
|
|
44
|
+
"node",
|
|
45
|
+
"outdated",
|
|
46
|
+
"owner",
|
|
47
|
+
"pack",
|
|
48
|
+
"patch",
|
|
49
|
+
"patch-commit",
|
|
50
|
+
"plugin",
|
|
51
|
+
"policies",
|
|
52
|
+
"publish",
|
|
53
|
+
"rebuild",
|
|
54
|
+
"remove",
|
|
55
|
+
"run",
|
|
56
|
+
"search",
|
|
57
|
+
"set",
|
|
58
|
+
"stage",
|
|
59
|
+
"tag",
|
|
60
|
+
"team",
|
|
61
|
+
"unlink",
|
|
62
|
+
"unplug",
|
|
63
|
+
"up",
|
|
64
|
+
"upgrade",
|
|
65
|
+
"upgrade-interactive",
|
|
66
|
+
"version",
|
|
67
|
+
"versions",
|
|
68
|
+
"why",
|
|
69
|
+
"workspace",
|
|
70
|
+
"workspaces"
|
|
71
|
+
]));
|
|
72
|
+
const pnpmBuiltinCommands = ( new Set([
|
|
73
|
+
"add",
|
|
74
|
+
"audit",
|
|
75
|
+
"bin",
|
|
76
|
+
"config",
|
|
77
|
+
"dedupe",
|
|
78
|
+
"deploy",
|
|
79
|
+
"dlx",
|
|
80
|
+
"doctor",
|
|
81
|
+
"env",
|
|
82
|
+
"exec",
|
|
83
|
+
"fetch",
|
|
84
|
+
"import",
|
|
85
|
+
"init",
|
|
86
|
+
"install",
|
|
87
|
+
"install-test",
|
|
88
|
+
"licenses",
|
|
89
|
+
"link",
|
|
90
|
+
"list",
|
|
91
|
+
"ln",
|
|
92
|
+
"ls",
|
|
93
|
+
"outdated",
|
|
94
|
+
"pack",
|
|
95
|
+
"patch",
|
|
96
|
+
"patch-commit",
|
|
97
|
+
"patch-remove",
|
|
98
|
+
"prune",
|
|
99
|
+
"publish",
|
|
100
|
+
"rb",
|
|
101
|
+
"rebuild",
|
|
102
|
+
"remove",
|
|
103
|
+
"rm",
|
|
104
|
+
"root",
|
|
105
|
+
"run",
|
|
106
|
+
"server",
|
|
107
|
+
"setup",
|
|
108
|
+
"store",
|
|
109
|
+
"un",
|
|
110
|
+
"uninstall",
|
|
111
|
+
"unlink",
|
|
112
|
+
"up",
|
|
113
|
+
"update",
|
|
114
|
+
"why"
|
|
115
|
+
]));
|
|
116
|
+
let NpmScriptAutoApprover = class NpmScriptAutoApprover extends Disposable {
|
|
117
|
+
constructor(
|
|
118
|
+
_configurationService,
|
|
119
|
+
_fileService,
|
|
120
|
+
_uriIdentityService,
|
|
121
|
+
_workspaceContextService
|
|
122
|
+
) {
|
|
123
|
+
super();
|
|
124
|
+
this._configurationService = _configurationService;
|
|
125
|
+
this._fileService = _fileService;
|
|
126
|
+
this._uriIdentityService = _uriIdentityService;
|
|
127
|
+
this._workspaceContextService = _workspaceContextService;
|
|
128
|
+
}
|
|
129
|
+
async isCommandAutoApproved(command, cwd) {
|
|
130
|
+
const isNpmScriptAutoApproveEnabled = this._configurationService.getValue(TerminalChatAgentToolsSettingId.AutoApproveWorkspaceNpmScripts) === true;
|
|
131
|
+
if (!isNpmScriptAutoApproveEnabled) {
|
|
132
|
+
return {
|
|
133
|
+
isAutoApproved: false
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const scriptName = this._extractScriptName(command);
|
|
137
|
+
if (!scriptName) {
|
|
138
|
+
return {
|
|
139
|
+
isAutoApproved: false
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const packageJsonScripts = await this._getPackageJsonScripts(cwd);
|
|
143
|
+
if (!packageJsonScripts) {
|
|
144
|
+
return {
|
|
145
|
+
isAutoApproved: false
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (!( packageJsonScripts.scripts.has(scriptName))) {
|
|
149
|
+
return {
|
|
150
|
+
isAutoApproved: false
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
isAutoApproved: true,
|
|
155
|
+
scriptName,
|
|
156
|
+
autoApproveInfo: ( new MarkdownString(( localize(
|
|
157
|
+
14638,
|
|
158
|
+
"Auto approved as {0} is defined in package.json",
|
|
159
|
+
`\`${scriptName}\``
|
|
160
|
+
))))
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
_extractScriptName(command) {
|
|
164
|
+
const trimmedCommand = command.trim();
|
|
165
|
+
for (const pattern of npmRunPatterns) {
|
|
166
|
+
const match = trimmedCommand.match(pattern);
|
|
167
|
+
if (match?.groups?.scriptName) {
|
|
168
|
+
const {
|
|
169
|
+
command: pkgManager,
|
|
170
|
+
scriptName
|
|
171
|
+
} = match.groups;
|
|
172
|
+
if (pkgManager.toLowerCase() === "yarn" && ( yarnBuiltinCommands.has(scriptName.toLowerCase()))) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (pkgManager.toLowerCase() === "pnpm" && ( pnpmBuiltinCommands.has(scriptName.toLowerCase()))) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
return scriptName;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
_isWithinWorkspace(uri) {
|
|
184
|
+
const workspaceFolders = this._workspaceContextService.getWorkspace().folders;
|
|
185
|
+
return ( workspaceFolders.some(folder => this._uriIdentityService.extUri.isEqualOrParent(uri, folder.uri)));
|
|
186
|
+
}
|
|
187
|
+
async _getPackageJsonScripts(cwd) {
|
|
188
|
+
if (!cwd || !this._isWithinWorkspace(cwd)) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
const packageJsonUri = URI.joinPath(cwd, "package.json");
|
|
192
|
+
const scripts = await this._readPackageJsonScripts(packageJsonUri);
|
|
193
|
+
if (scripts) {
|
|
194
|
+
return {
|
|
195
|
+
uri: packageJsonUri,
|
|
196
|
+
scripts
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
return undefined;
|
|
200
|
+
}
|
|
201
|
+
async _readPackageJsonScripts(packageJsonUri) {
|
|
202
|
+
try {
|
|
203
|
+
const exists = await this._fileService.exists(packageJsonUri);
|
|
204
|
+
if (!exists) {
|
|
205
|
+
return undefined;
|
|
206
|
+
}
|
|
207
|
+
const content = await this._fileService.readFile(packageJsonUri);
|
|
208
|
+
const text = ( content.value.toString());
|
|
209
|
+
return this._parsePackageJsonScripts(text);
|
|
210
|
+
} catch {
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
_parsePackageJsonScripts(content) {
|
|
215
|
+
const scripts = ( new Set());
|
|
216
|
+
let inScripts = false;
|
|
217
|
+
let level = 0;
|
|
218
|
+
const visitor = {
|
|
219
|
+
onError() {},
|
|
220
|
+
onObjectBegin() {
|
|
221
|
+
level++;
|
|
222
|
+
},
|
|
223
|
+
onObjectEnd() {
|
|
224
|
+
if (inScripts && level === 2) {
|
|
225
|
+
inScripts = false;
|
|
226
|
+
}
|
|
227
|
+
level--;
|
|
228
|
+
},
|
|
229
|
+
onObjectProperty(property) {
|
|
230
|
+
if (level === 1 && property === "scripts") {
|
|
231
|
+
inScripts = true;
|
|
232
|
+
} else if (inScripts && level === 2) {
|
|
233
|
+
scripts.add(property);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
visit(content, visitor);
|
|
238
|
+
return scripts.size > 0 ? scripts : undefined;
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
NpmScriptAutoApprover = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IFileService)), ( __param(2, IUriIdentityService)), ( __param(3, IWorkspaceContextService))], NpmScriptAutoApprover));
|
|
242
|
+
|
|
243
|
+
export { NpmScriptAutoApprover };
|