@codingame/monaco-vscode-chat-service-override 30.0.0 → 31.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 +21 -3
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +125 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +393 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +65 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +453 -0
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +28 -0
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +81 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +75 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +180 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +202 -51
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +182 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +282 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +303 -32
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +30 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +662 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +12 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +17 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +5 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +5 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +42 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +7 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +118 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +551 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +22 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +83 -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 +59 -59
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +113 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +81 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +47 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +58 -23
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +24 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +29 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +65 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +28 -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 +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +80 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +20 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +30 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +363 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +31 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +374 -764
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +222 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +269 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +249 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +113 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +202 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +246 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +162 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +306 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +581 -257
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +245 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +25 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +3 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +103 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +80 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +20 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +128 -65
- 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 +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- 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.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -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 +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +10 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +4 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +4 -310
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +3 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +61 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +46 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +96 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +21 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +315 -263
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +196 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +26 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +48 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +2 -2
- 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.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +226 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +108 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
- 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/chatStatusWidget.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +9 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +21 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +26 -59
- 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 +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +46 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +32 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +152 -26
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +5 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +265 -261
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +28 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +75 -7
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +9 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +32 -4
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +10 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +7 -52
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +58 -466
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +36 -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.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +168 -182
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +491 -462
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +16 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +18 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +145 -68
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +25 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +19 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +5 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +77 -157
- 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 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +29 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
- 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 +12 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +49 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +9 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +13 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +319 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
- 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/services/agentHost/common/agentHostFileSystemService.d.ts +21 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +35 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +0 -94
- package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +0 -16
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +0 -578
- package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +0 -206
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -114
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +0 -860
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -27
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +0 -58
- package/vscode/src/vs/platform/browserElements/common/browserElements.js +0 -16
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +0 -443
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +0 -132
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +0 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -66
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +0 -158
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -164
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -163
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -137
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -39
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -249
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -92
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -209
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +0 -106
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -168
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -1019
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -150
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -1619
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -130
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -122
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -482
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
-
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
-
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { isNumber } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
-
import { isMacintosh, isCI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
9
|
-
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
10
|
-
import { trackIdleOnPrompt } from './executeStrategy.js';
|
|
11
|
-
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
12
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
13
|
-
|
|
14
|
-
let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
|
|
15
|
-
constructor(_instance, _commandDetection, _configurationService, _logService) {
|
|
16
|
-
super();
|
|
17
|
-
this._instance = _instance;
|
|
18
|
-
this._commandDetection = _commandDetection;
|
|
19
|
-
this._configurationService = _configurationService;
|
|
20
|
-
this._logService = _logService;
|
|
21
|
-
this.type = "rich";
|
|
22
|
-
this._startMarker = this._register(( new MutableDisposable()));
|
|
23
|
-
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
24
|
-
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
25
|
-
}
|
|
26
|
-
async execute(commandLine, token, commandId) {
|
|
27
|
-
const store = ( new DisposableStore());
|
|
28
|
-
try {
|
|
29
|
-
this._log("Waiting for xterm");
|
|
30
|
-
const xterm = await this._instance.xtermReadyPromise;
|
|
31
|
-
if (!xterm) {
|
|
32
|
-
throw ( new Error("Xterm is not available"));
|
|
33
|
-
}
|
|
34
|
-
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
35
|
-
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
36
|
-
const onDone = Promise.race([
|
|
37
|
-
Event.toPromise(this._commandDetection.onCommandFinished, store).then(e => {
|
|
38
|
-
this._log("onDone via end event");
|
|
39
|
-
return {
|
|
40
|
-
"type": "success",
|
|
41
|
-
command: e
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
45
|
-
this._log("onDone via cancellation");
|
|
46
|
-
}),
|
|
47
|
-
Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
48
|
-
this._log("onDone via terminal disposal");
|
|
49
|
-
return {
|
|
50
|
-
type: "disposal"
|
|
51
|
-
};
|
|
52
|
-
}),
|
|
53
|
-
trackIdleOnPrompt(this._instance, idlePollInterval, store, idlePollInterval).then(() => {
|
|
54
|
-
this._log("onDone via idle prompt");
|
|
55
|
-
})
|
|
56
|
-
]);
|
|
57
|
-
const markerRecreation = setupRecreatingStartMarker(
|
|
58
|
-
xterm,
|
|
59
|
-
this._startMarker,
|
|
60
|
-
m => this._onDidCreateStartMarker.fire(m),
|
|
61
|
-
store,
|
|
62
|
-
this._log.bind(this)
|
|
63
|
-
);
|
|
64
|
-
this._log(`Executing command line \`${commandLine}\``);
|
|
65
|
-
markerRecreation.dispose();
|
|
66
|
-
const forceBracketedPasteMode = isMacintosh;
|
|
67
|
-
this._instance.runCommand(commandLine, true, commandId, forceBracketedPasteMode);
|
|
68
|
-
this._log("Waiting for done event");
|
|
69
|
-
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
70
|
-
type: "alternateBuffer"
|
|
71
|
-
}))]);
|
|
72
|
-
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
73
|
-
throw ( new Error("The terminal was closed"));
|
|
74
|
-
}
|
|
75
|
-
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
76
|
-
this._log("Detected alternate buffer entry, skipping output capture");
|
|
77
|
-
return {
|
|
78
|
-
output: undefined,
|
|
79
|
-
exitCode: undefined,
|
|
80
|
-
error: "alternateBuffer",
|
|
81
|
-
didEnterAltBuffer: true
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
85
|
-
if (token.isCancellationRequested) {
|
|
86
|
-
throw ( new CancellationError());
|
|
87
|
-
}
|
|
88
|
-
const endMarker = store.add(xterm.raw.registerMarker());
|
|
89
|
-
let output;
|
|
90
|
-
const additionalInformationLines = [];
|
|
91
|
-
if (finishedCommand) {
|
|
92
|
-
const commandOutput = finishedCommand?.getOutput();
|
|
93
|
-
if (commandOutput !== undefined) {
|
|
94
|
-
this._log("Fetched output via finished command");
|
|
95
|
-
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (output === undefined) {
|
|
99
|
-
try {
|
|
100
|
-
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
101
|
-
this._log("Fetched output via markers");
|
|
102
|
-
if (output !== undefined) {
|
|
103
|
-
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
104
|
-
}
|
|
105
|
-
} catch {
|
|
106
|
-
this._log("Failed to fetch output via markers");
|
|
107
|
-
additionalInformationLines.push("Failed to retrieve command output");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (output !== undefined && output.trim().length === 0) {
|
|
111
|
-
additionalInformationLines.push("Command produced no output");
|
|
112
|
-
}
|
|
113
|
-
const exitCode = finishedCommand?.exitCode;
|
|
114
|
-
if (isNumber(exitCode) && exitCode > 0) {
|
|
115
|
-
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
output,
|
|
119
|
-
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
120
|
-
exitCode
|
|
121
|
-
};
|
|
122
|
-
} finally {
|
|
123
|
-
store.dispose();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
_log(message) {
|
|
127
|
-
const msg = `RunInTerminalTool#Rich: ${message}`;
|
|
128
|
-
if (isCI) {
|
|
129
|
-
this._logService.info(msg);
|
|
130
|
-
} else {
|
|
131
|
-
this._logService.debug(msg);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
RichExecuteStrategy = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ITerminalLogService))], RichExecuteStrategy));
|
|
136
|
-
|
|
137
|
-
export { RichExecuteStrategy };
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,174 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
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 declare function getOutput(instance: ITerminalInstance, startMarker?: IXtermMarker): string;
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { truncateOutputKeepingTail } from './runInTerminalHelpers.js';
|
|
3
|
-
|
|
4
|
-
const MAX_OUTPUT_LENGTH = 16000;
|
|
5
|
-
function getOutput(instance, startMarker) {
|
|
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
|
-
let output = lines.join('\n');
|
|
33
|
-
if (output.length > MAX_OUTPUT_LENGTH) {
|
|
34
|
-
output = truncateOutputKeepingTail(output, MAX_OUTPUT_LENGTH);
|
|
35
|
-
}
|
|
36
|
-
return output;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { getOutput };
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
export declare function sanitizeTerminalOutput(output: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Normalizes command text for UI display by removing unnecessary quote and forward slash
|
|
14
|
-
* escaping artifacts (for example: \" \' \/) commonly produced in streamed tool-call JSON.
|
|
15
|
-
*/
|
|
16
|
-
export declare function normalizeTerminalCommandForDisplay(commandLine: string): string;
|
|
17
|
-
export declare function generateAutoApproveActions(commandLine: string, subCommands: string[], autoApproveResult: {
|
|
18
|
-
subCommandResults: ICommandApprovalResultWithReason[];
|
|
19
|
-
commandLineResult: ICommandApprovalResultWithReason;
|
|
20
|
-
}): ToolConfirmationAction[];
|
|
21
|
-
export declare function dedupeRules(rules: ICommandApprovalResultWithReason[]): ICommandApprovalResultWithReason[];
|
|
22
|
-
export interface IExtractedCdPrefix {
|
|
23
|
-
/** The directory path that was extracted from the cd command */
|
|
24
|
-
directory: string;
|
|
25
|
-
/** The command to run after the cd */
|
|
26
|
-
command: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Extracts a cd prefix from a command line, returning the directory and remaining command.
|
|
30
|
-
* Does not check if the directory matches the current cwd - just extracts the pattern.
|
|
31
|
-
*/
|
|
32
|
-
export declare function extractCdPrefix(commandLine: string, shell: string, os: OperatingSystem): IExtractedCdPrefix | undefined;
|
|
@@ -1,249 +0,0 @@
|
|
|
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 generateAutoApproveActions(commandLine, subCommands, autoApproveResult) {
|
|
54
|
-
const actions = [];
|
|
55
|
-
const canCreateAutoApproval = (autoApproveResult.subCommandResults.every(e => e.result !== "denied") && autoApproveResult.commandLineResult.result !== "denied");
|
|
56
|
-
if (canCreateAutoApproval) {
|
|
57
|
-
const unapprovedSubCommands = subCommands.filter((_, index) => {
|
|
58
|
-
return autoApproveResult.subCommandResults[index].result !== "approved";
|
|
59
|
-
});
|
|
60
|
-
const neverAutoApproveCommands = ( new Set([
|
|
61
|
-
"bash", "sh", "zsh", "fish", "ksh", "csh", "tcsh", "dash", "pwsh", "powershell", "powershell.exe", "cmd", "cmd.exe",
|
|
62
|
-
"python", "python3", "node", "ruby", "perl", "php", "lua",
|
|
63
|
-
"eval", "exec", "source", "sudo", "su", "doas",
|
|
64
|
-
"curl", "wget", "invoke-restmethod", "invoke-webrequest", "irm", "iwr"]));
|
|
65
|
-
const commandsWithSubcommands = ( new Set([
|
|
66
|
-
"git",
|
|
67
|
-
"npm",
|
|
68
|
-
"npx",
|
|
69
|
-
"yarn",
|
|
70
|
-
"docker",
|
|
71
|
-
"kubectl",
|
|
72
|
-
"cargo",
|
|
73
|
-
"dotnet",
|
|
74
|
-
"mvn",
|
|
75
|
-
"gradle"
|
|
76
|
-
]));
|
|
77
|
-
const commandsWithSubSubCommands = ( new Set(["npm run", "yarn run"]));
|
|
78
|
-
const findNextNonFlagArg = (parts, startIndex) => {
|
|
79
|
-
for (let i = startIndex; i < parts.length; i++) {
|
|
80
|
-
if (!parts[i].startsWith("-")) {
|
|
81
|
-
return i;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
};
|
|
86
|
-
const subCommandsToSuggest = Array.from(( new Set(coalesce(( unapprovedSubCommands.map(command => {
|
|
87
|
-
const parts = command.trim().split(/\s+/);
|
|
88
|
-
const baseCommand = parts[0].toLowerCase();
|
|
89
|
-
if (( neverAutoApproveCommands.has(baseCommand))) {
|
|
90
|
-
return undefined;
|
|
91
|
-
}
|
|
92
|
-
if (( commandsWithSubcommands.has(baseCommand))) {
|
|
93
|
-
const subCommandIndex = findNextNonFlagArg(parts, 1);
|
|
94
|
-
if (subCommandIndex !== undefined) {
|
|
95
|
-
const baseSubCommand = `${parts[0]} ${parts[subCommandIndex]}`.toLowerCase();
|
|
96
|
-
if (( commandsWithSubSubCommands.has(baseSubCommand))) {
|
|
97
|
-
const subSubCommandIndex = findNextNonFlagArg(parts, subCommandIndex + 1);
|
|
98
|
-
if (subSubCommandIndex !== undefined) {
|
|
99
|
-
return parts.slice(0, subSubCommandIndex + 1).join(" ");
|
|
100
|
-
}
|
|
101
|
-
return undefined;
|
|
102
|
-
} else {
|
|
103
|
-
return parts.slice(0, subCommandIndex + 1).join(" ");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return undefined;
|
|
107
|
-
} else {
|
|
108
|
-
return parts[0];
|
|
109
|
-
}
|
|
110
|
-
}))))));
|
|
111
|
-
if (subCommandsToSuggest.length > 0) {
|
|
112
|
-
let subCommandLabel;
|
|
113
|
-
if (subCommandsToSuggest.length === 1) {
|
|
114
|
-
subCommandLabel = `\`${subCommandsToSuggest[0]} \u2026\``;
|
|
115
|
-
} else {
|
|
116
|
-
subCommandLabel = `Commands ${( subCommandsToSuggest.map(e => `\`${e} \u2026\``)).join(", ")}`;
|
|
117
|
-
}
|
|
118
|
-
actions.push({
|
|
119
|
-
label: `Allow ${subCommandLabel} in this Session`,
|
|
120
|
-
data: {
|
|
121
|
-
type: "newRule",
|
|
122
|
-
rule: ( subCommandsToSuggest.map(key => ({
|
|
123
|
-
key,
|
|
124
|
-
value: true,
|
|
125
|
-
scope: "session"
|
|
126
|
-
})))
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
actions.push({
|
|
130
|
-
label: `Allow ${subCommandLabel} in this Workspace`,
|
|
131
|
-
data: {
|
|
132
|
-
type: "newRule",
|
|
133
|
-
rule: ( subCommandsToSuggest.map(key => ({
|
|
134
|
-
key,
|
|
135
|
-
value: true,
|
|
136
|
-
scope: "workspace"
|
|
137
|
-
})))
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
actions.push({
|
|
141
|
-
label: `Always Allow ${subCommandLabel}`,
|
|
142
|
-
data: {
|
|
143
|
-
type: "newRule",
|
|
144
|
-
rule: ( subCommandsToSuggest.map(key => ({
|
|
145
|
-
key,
|
|
146
|
-
value: true,
|
|
147
|
-
scope: "user"
|
|
148
|
-
})))
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
if (actions.length > 0) {
|
|
153
|
-
actions.push(( new Separator()));
|
|
154
|
-
}
|
|
155
|
-
const firstSubcommandFirstWord = unapprovedSubCommands.length > 0 ? unapprovedSubCommands[0].split(" ")[0] : "";
|
|
156
|
-
if (firstSubcommandFirstWord !== commandLine && !( commandsWithSubcommands.has(commandLine)) && !( commandsWithSubSubCommands.has(commandLine))) {
|
|
157
|
-
actions.push({
|
|
158
|
-
label: ( localize(13856, "Allow Exact Command Line in this Session")),
|
|
159
|
-
data: {
|
|
160
|
-
type: "newRule",
|
|
161
|
-
rule: {
|
|
162
|
-
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
163
|
-
value: {
|
|
164
|
-
approve: true,
|
|
165
|
-
matchCommandLine: true
|
|
166
|
-
},
|
|
167
|
-
scope: "session"
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
actions.push({
|
|
172
|
-
label: ( localize(13857, "Allow Exact Command Line in this Workspace")),
|
|
173
|
-
data: {
|
|
174
|
-
type: "newRule",
|
|
175
|
-
rule: {
|
|
176
|
-
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
177
|
-
value: {
|
|
178
|
-
approve: true,
|
|
179
|
-
matchCommandLine: true
|
|
180
|
-
},
|
|
181
|
-
scope: "workspace"
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
actions.push({
|
|
186
|
-
label: ( localize(13858, "Always Allow Exact Command Line")),
|
|
187
|
-
data: {
|
|
188
|
-
type: "newRule",
|
|
189
|
-
rule: {
|
|
190
|
-
key: `/^${escapeRegExpCharacters(commandLine)}$/`,
|
|
191
|
-
value: {
|
|
192
|
-
approve: true,
|
|
193
|
-
matchCommandLine: true
|
|
194
|
-
},
|
|
195
|
-
scope: "user"
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
if (actions.length > 0) {
|
|
202
|
-
actions.push(( new Separator()));
|
|
203
|
-
}
|
|
204
|
-
actions.push({
|
|
205
|
-
label: ( localize(13859, "Allow All Commands in this Session")),
|
|
206
|
-
tooltip: ( localize(13860, "Allow this tool to run in this session without confirmation.")),
|
|
207
|
-
data: {
|
|
208
|
-
type: "sessionApproval"
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
actions.push(( new Separator()));
|
|
212
|
-
actions.push({
|
|
213
|
-
label: ( localize(13861, "Configure Auto Approve...")),
|
|
214
|
-
data: {
|
|
215
|
-
type: "configure"
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
return actions;
|
|
219
|
-
}
|
|
220
|
-
function dedupeRules(rules) {
|
|
221
|
-
return rules.filter((result, index, array) => {
|
|
222
|
-
if (!isAutoApproveRule(result.rule)) {
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
const sourceText = result.rule.sourceText;
|
|
226
|
-
return array.findIndex(r => isAutoApproveRule(r.rule) && r.rule.sourceText === sourceText) === index;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function extractCdPrefix(commandLine, shell, os) {
|
|
230
|
-
const isPwsh = isPowerShell(shell, os);
|
|
231
|
-
const cdPrefixMatch = commandLine.match(
|
|
232
|
-
isPwsh ? /^(?:cd(?: \/d)?|Set-Location(?: -Path)?) (?<dir>[^\s]+) ?(?:&&|;)\s+(?<suffix>.+)$/i : /^cd (?<dir>[^\s]+) &&\s+(?<suffix>.+)$/
|
|
233
|
-
);
|
|
234
|
-
const cdDir = cdPrefixMatch?.groups?.dir;
|
|
235
|
-
const cdSuffix = cdPrefixMatch?.groups?.suffix;
|
|
236
|
-
if (cdDir && cdSuffix) {
|
|
237
|
-
let cdDirPath = cdDir;
|
|
238
|
-
if (cdDirPath.startsWith("\"") && cdDirPath.endsWith("\"")) {
|
|
239
|
-
cdDirPath = cdDirPath.slice(1, -1);
|
|
240
|
-
}
|
|
241
|
-
return {
|
|
242
|
-
directory: cdDirPath,
|
|
243
|
-
command: cdSuffix
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
return undefined;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export { TRUNCATION_MESSAGE, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isPowerShell, isWindowsPowerShell, isZsh, normalizeTerminalCommandForDisplay, truncateOutputKeepingTail };
|