@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,164 +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 { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
9
|
-
import { trackIdleOnPrompt, waitForIdle } from './executeStrategy.js';
|
|
10
|
-
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
11
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
12
|
-
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
13
|
-
|
|
14
|
-
let BasicExecuteStrategy = class BasicExecuteStrategy extends Disposable {
|
|
15
|
-
constructor(
|
|
16
|
-
_instance,
|
|
17
|
-
_hasReceivedUserInput,
|
|
18
|
-
_commandDetection,
|
|
19
|
-
_configurationService,
|
|
20
|
-
_logService
|
|
21
|
-
) {
|
|
22
|
-
super();
|
|
23
|
-
this._instance = _instance;
|
|
24
|
-
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
25
|
-
this._commandDetection = _commandDetection;
|
|
26
|
-
this._configurationService = _configurationService;
|
|
27
|
-
this._logService = _logService;
|
|
28
|
-
this.type = "basic";
|
|
29
|
-
this._startMarker = this._register(( new MutableDisposable()));
|
|
30
|
-
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
31
|
-
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
32
|
-
}
|
|
33
|
-
async execute(commandLine, token, commandId) {
|
|
34
|
-
const store = ( new DisposableStore());
|
|
35
|
-
try {
|
|
36
|
-
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
37
|
-
const idlePromptPromise = trackIdleOnPrompt(this._instance, idlePollInterval, store, idlePollInterval);
|
|
38
|
-
const onDone = Promise.race([
|
|
39
|
-
Event.toPromise(this._commandDetection.onCommandFinished, store).then(e => {
|
|
40
|
-
this._log("onDone 1 of 2 via end event, waiting for short idle prompt");
|
|
41
|
-
return idlePromptPromise.then(() => {
|
|
42
|
-
this._log("onDone 2 of 2 via short idle prompt");
|
|
43
|
-
return {
|
|
44
|
-
"type": "success",
|
|
45
|
-
command: e
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
}),
|
|
49
|
-
Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
50
|
-
this._log("onDone via cancellation");
|
|
51
|
-
}),
|
|
52
|
-
Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
53
|
-
this._log("onDone via terminal disposal");
|
|
54
|
-
return {
|
|
55
|
-
type: "disposal"
|
|
56
|
-
};
|
|
57
|
-
}),
|
|
58
|
-
trackIdleOnPrompt(this._instance, idlePollInterval * 3, store, idlePollInterval).then(() => {
|
|
59
|
-
this._log("onDone long idle prompt");
|
|
60
|
-
})
|
|
61
|
-
]);
|
|
62
|
-
this._log("Waiting for xterm");
|
|
63
|
-
const xterm = await this._instance.xtermReadyPromise;
|
|
64
|
-
if (!xterm) {
|
|
65
|
-
throw ( new Error("Xterm is not available"));
|
|
66
|
-
}
|
|
67
|
-
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
68
|
-
this._log("Waiting for idle");
|
|
69
|
-
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
70
|
-
const markerRecreation = setupRecreatingStartMarker(
|
|
71
|
-
xterm,
|
|
72
|
-
this._startMarker,
|
|
73
|
-
m => this._onDidCreateStartMarker.fire(m),
|
|
74
|
-
store,
|
|
75
|
-
this._log.bind(this)
|
|
76
|
-
);
|
|
77
|
-
if (this._hasReceivedUserInput()) {
|
|
78
|
-
this._log("Command timed out, sending SIGINT and retrying");
|
|
79
|
-
await this._instance.sendText("\u0003", false);
|
|
80
|
-
await waitForIdle(this._instance.onData, 100);
|
|
81
|
-
}
|
|
82
|
-
if (commandId) {
|
|
83
|
-
this._log(
|
|
84
|
-
`In basic execute strategy: skipping pre-bound command id ${commandId} because basic shell integration executes via sendText`
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
this._log(`Executing command line \`${commandLine}\``);
|
|
88
|
-
markerRecreation.dispose();
|
|
89
|
-
const forceBracketedPasteMode = isMacintosh;
|
|
90
|
-
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
91
|
-
this._log("Waiting for done event");
|
|
92
|
-
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
93
|
-
type: "alternateBuffer"
|
|
94
|
-
}))]);
|
|
95
|
-
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
96
|
-
throw ( new Error("The terminal was closed"));
|
|
97
|
-
}
|
|
98
|
-
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
99
|
-
this._log("Detected alternate buffer entry, skipping output capture");
|
|
100
|
-
return {
|
|
101
|
-
output: undefined,
|
|
102
|
-
exitCode: undefined,
|
|
103
|
-
error: "alternateBuffer",
|
|
104
|
-
didEnterAltBuffer: true
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
108
|
-
if (finishedCommand) {
|
|
109
|
-
this._log(
|
|
110
|
-
`Finished command id=${finishedCommand.id ?? "none"} for requested=${commandId ?? "none"}`
|
|
111
|
-
);
|
|
112
|
-
} else if (commandId) {
|
|
113
|
-
this._log(`No finished command surfaced for requested=${commandId}`);
|
|
114
|
-
}
|
|
115
|
-
this._log("Waiting for idle");
|
|
116
|
-
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
117
|
-
if (token.isCancellationRequested) {
|
|
118
|
-
throw ( new CancellationError());
|
|
119
|
-
}
|
|
120
|
-
const endMarker = store.add(xterm.raw.registerMarker());
|
|
121
|
-
let output;
|
|
122
|
-
const additionalInformationLines = [];
|
|
123
|
-
if (finishedCommand) {
|
|
124
|
-
const commandOutput = finishedCommand?.getOutput();
|
|
125
|
-
if (commandOutput !== undefined) {
|
|
126
|
-
this._log("Fetched output via finished command");
|
|
127
|
-
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (output === undefined) {
|
|
131
|
-
try {
|
|
132
|
-
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
133
|
-
this._log("Fetched output via markers");
|
|
134
|
-
if (output !== undefined) {
|
|
135
|
-
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
136
|
-
}
|
|
137
|
-
} catch {
|
|
138
|
-
this._log("Failed to fetch output via markers");
|
|
139
|
-
additionalInformationLines.push("Failed to retrieve command output");
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (output !== undefined && output.trim().length === 0) {
|
|
143
|
-
additionalInformationLines.push("Command produced no output");
|
|
144
|
-
}
|
|
145
|
-
const exitCode = finishedCommand?.exitCode;
|
|
146
|
-
if (isNumber(exitCode) && exitCode > 0) {
|
|
147
|
-
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
output,
|
|
151
|
-
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
152
|
-
exitCode
|
|
153
|
-
};
|
|
154
|
-
} finally {
|
|
155
|
-
store.dispose();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
_log(message) {
|
|
159
|
-
this._logService.debug(`RunInTerminalTool#Basic: ${message}`);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
BasicExecuteStrategy = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, ITerminalLogService))], BasicExecuteStrategy));
|
|
163
|
-
|
|
164
|
-
export { BasicExecuteStrategy };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import type { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import { DisposableStore, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
-
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
5
|
-
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
6
|
-
export interface ITerminalExecuteStrategy extends IDisposable {
|
|
7
|
-
readonly type: "rich" | "basic" | "none";
|
|
8
|
-
/**
|
|
9
|
-
* Executes a command line and gets a result designed to be passed directly to an LLM. The
|
|
10
|
-
* result will include information about the exit code.
|
|
11
|
-
* @param commandLine The command line to execute
|
|
12
|
-
* @param token Cancellation token
|
|
13
|
-
* @param commandId Optional predefined command ID to link the command
|
|
14
|
-
*/
|
|
15
|
-
execute(commandLine: string, token: CancellationToken, commandId?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
16
|
-
readonly onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
17
|
-
}
|
|
18
|
-
export interface ITerminalExecuteStrategyResult {
|
|
19
|
-
output: string | undefined;
|
|
20
|
-
additionalInformation?: string;
|
|
21
|
-
exitCode?: number;
|
|
22
|
-
error?: string;
|
|
23
|
-
didEnterAltBuffer?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare function waitForIdle(onData: Event<unknown>, idleDurationMs: number): Promise<void>;
|
|
26
|
-
export interface IPromptDetectionResult {
|
|
27
|
-
/**
|
|
28
|
-
* Whether a prompt was detected.
|
|
29
|
-
*/
|
|
30
|
-
detected: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* The reason for logging.
|
|
33
|
-
*/
|
|
34
|
-
reason?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Detects if the given text content appears to end with a common prompt pattern.
|
|
38
|
-
*/
|
|
39
|
-
export declare function detectsCommonPromptPattern(cursorLine: string): IPromptDetectionResult;
|
|
40
|
-
/**
|
|
41
|
-
* Enhanced version of {@link waitForIdle} that uses prompt detection heuristics. After the terminal
|
|
42
|
-
* idles for the specified period, checks if the terminal's cursor line looks like a common prompt.
|
|
43
|
-
* If not, extends the timeout to give the command more time to complete.
|
|
44
|
-
*/
|
|
45
|
-
export declare function waitForIdleWithPromptHeuristics(onData: Event<unknown>, instance: ITerminalInstance, idlePollIntervalMs: number, extendedTimeoutMs: number): Promise<IPromptDetectionResult>;
|
|
46
|
-
/**
|
|
47
|
-
* Tracks the terminal for being idle on a prompt input. This must be called before `executeCommand`
|
|
48
|
-
* is called.
|
|
49
|
-
*/
|
|
50
|
-
export declare function trackIdleOnPrompt(instance: ITerminalInstance, idleDurationMs: number, store: DisposableStore, promptFallbackMs?: number): Promise<void>;
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { DeferredPromise, RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
3
|
-
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
|
|
5
|
-
async function waitForIdle(onData, idleDurationMs) {
|
|
6
|
-
const store = ( new DisposableStore());
|
|
7
|
-
const deferred = ( new DeferredPromise());
|
|
8
|
-
const scheduler = store.add(( new RunOnceScheduler(() => deferred.complete(), idleDurationMs)));
|
|
9
|
-
store.add(onData(() => scheduler.schedule()));
|
|
10
|
-
scheduler.schedule();
|
|
11
|
-
return deferred.p.finally(() => store.dispose());
|
|
12
|
-
}
|
|
13
|
-
function detectsCommonPromptPattern(cursorLine) {
|
|
14
|
-
if (cursorLine.trim().length === 0) {
|
|
15
|
-
return {
|
|
16
|
-
detected: false,
|
|
17
|
-
reason: "Content is empty or contains only whitespace"
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
if (/PS\s+[A-Z]:\\.*>\s*$/.test(cursorLine)) {
|
|
21
|
-
return {
|
|
22
|
-
detected: true,
|
|
23
|
-
reason: `PowerShell prompt pattern detected: "${cursorLine}"`
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (/^[A-Z]:\\.*>\s*$/.test(cursorLine)) {
|
|
27
|
-
return {
|
|
28
|
-
detected: true,
|
|
29
|
-
reason: `Command Prompt pattern detected: "${cursorLine}"`
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
if (/\$\s*$/.test(cursorLine)) {
|
|
33
|
-
return {
|
|
34
|
-
detected: true,
|
|
35
|
-
reason: `Bash-style prompt pattern detected: "${cursorLine}"`
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
if (/#\s*$/.test(cursorLine)) {
|
|
39
|
-
return {
|
|
40
|
-
detected: true,
|
|
41
|
-
reason: `Root prompt pattern detected: "${cursorLine}"`
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if (/^>>>\s*$/.test(cursorLine)) {
|
|
45
|
-
return {
|
|
46
|
-
detected: true,
|
|
47
|
-
reason: `Python REPL prompt pattern detected: "${cursorLine}"`
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
if (/\u276f\s*$/.test(cursorLine)) {
|
|
51
|
-
return {
|
|
52
|
-
detected: true,
|
|
53
|
-
reason: `Starship prompt pattern detected: "${cursorLine}"`
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (/[>%]\s*$/.test(cursorLine)) {
|
|
57
|
-
return {
|
|
58
|
-
detected: true,
|
|
59
|
-
reason: `Generic prompt pattern detected: "${cursorLine}"`
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
detected: false,
|
|
64
|
-
reason: `No common prompt pattern found in last line: "${cursorLine}"`
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
async function waitForIdleWithPromptHeuristics(onData, instance, idlePollIntervalMs, extendedTimeoutMs) {
|
|
68
|
-
await waitForIdle(onData, idlePollIntervalMs);
|
|
69
|
-
const xterm = await instance.xtermReadyPromise;
|
|
70
|
-
if (!xterm) {
|
|
71
|
-
return {
|
|
72
|
-
detected: false,
|
|
73
|
-
reason: `Xterm not available, using ${idlePollIntervalMs}ms timeout`
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
const startTime = Date.now();
|
|
77
|
-
while (Date.now() - startTime < extendedTimeoutMs) {
|
|
78
|
-
try {
|
|
79
|
-
let content = "";
|
|
80
|
-
const buffer = xterm.raw.buffer.active;
|
|
81
|
-
const line = buffer.getLine(buffer.baseY + buffer.cursorY);
|
|
82
|
-
if (line) {
|
|
83
|
-
content = line.translateToString(true);
|
|
84
|
-
}
|
|
85
|
-
const promptResult = detectsCommonPromptPattern(content);
|
|
86
|
-
if (promptResult.detected) {
|
|
87
|
-
return promptResult;
|
|
88
|
-
}
|
|
89
|
-
} catch (error) {}
|
|
90
|
-
await waitForIdle(
|
|
91
|
-
onData,
|
|
92
|
-
Math.min(idlePollIntervalMs, extendedTimeoutMs - (Date.now() - startTime))
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
try {
|
|
96
|
-
let content = "";
|
|
97
|
-
const buffer = xterm.raw.buffer.active;
|
|
98
|
-
const line = buffer.getLine(buffer.baseY + buffer.cursorY);
|
|
99
|
-
if (line) {
|
|
100
|
-
content = line.translateToString(true) + "\n";
|
|
101
|
-
}
|
|
102
|
-
return {
|
|
103
|
-
detected: false,
|
|
104
|
-
reason: `Extended timeout reached without prompt detection. Last line: "${content.trim()}"`
|
|
105
|
-
};
|
|
106
|
-
} catch (error) {
|
|
107
|
-
return {
|
|
108
|
-
detected: false,
|
|
109
|
-
reason: `Extended timeout reached. Error reading terminal content: ${error}`
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async function trackIdleOnPrompt(instance, idleDurationMs, store, promptFallbackMs) {
|
|
114
|
-
const idleOnPrompt = ( new DeferredPromise());
|
|
115
|
-
const onData = instance.onData;
|
|
116
|
-
const scheduler = store.add(( new RunOnceScheduler(() => {
|
|
117
|
-
idleOnPrompt.complete();
|
|
118
|
-
}, idleDurationMs)));
|
|
119
|
-
let state = 0 ;
|
|
120
|
-
const promptFallbackScheduler = store.add(( new RunOnceScheduler(() => {
|
|
121
|
-
if (state === 2 || state === 3 ) {
|
|
122
|
-
promptFallbackScheduler.cancel();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
state = 3 ;
|
|
126
|
-
scheduler.schedule();
|
|
127
|
-
}, promptFallbackMs ?? 1000)));
|
|
128
|
-
let TerminalState;
|
|
129
|
-
(function(TerminalState) {
|
|
130
|
-
TerminalState[TerminalState["Initial"] = 0] = "Initial";
|
|
131
|
-
TerminalState[TerminalState["Prompt"] = 1] = "Prompt";
|
|
132
|
-
TerminalState[TerminalState["Executing"] = 2] = "Executing";
|
|
133
|
-
TerminalState[TerminalState["PromptAfterExecuting"] = 3] = "PromptAfterExecuting";
|
|
134
|
-
})(TerminalState || (TerminalState = {}));
|
|
135
|
-
store.add(onData(e => {
|
|
136
|
-
const matches = e.matchAll(/(?:\x1b\]|\x9d)[16]33;(?<type>[ACD])(?:;.*)?(?:\x1b\\|\x07|\x9c)/g);
|
|
137
|
-
for (const match of matches) {
|
|
138
|
-
if (match.groups?.type === "A") {
|
|
139
|
-
if (state === 0 ) {
|
|
140
|
-
state = 1 ;
|
|
141
|
-
} else if (state === 2 ) {
|
|
142
|
-
state = 3 ;
|
|
143
|
-
}
|
|
144
|
-
} else if (match.groups?.type === "C" || match.groups?.type === "D") {
|
|
145
|
-
state = 2 ;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (state === 3 ) {
|
|
149
|
-
promptFallbackScheduler.cancel();
|
|
150
|
-
scheduler.schedule();
|
|
151
|
-
} else {
|
|
152
|
-
scheduler.cancel();
|
|
153
|
-
if (state === 0 || state === 1 ) {
|
|
154
|
-
promptFallbackScheduler.schedule();
|
|
155
|
-
} else {
|
|
156
|
-
promptFallbackScheduler.cancel();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}));
|
|
160
|
-
return idleOnPrompt.p;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export { detectsCommonPromptPattern, trackIdleOnPrompt, waitForIdle, waitForIdleWithPromptHeuristics };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
6
|
-
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
7
|
-
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
8
|
-
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
9
|
-
/**
|
|
10
|
-
* This strategy is used when no shell integration is available. There are very few extension APIs
|
|
11
|
-
* available in this case. This uses similar strategies to the basic integration strategy, but
|
|
12
|
-
* with `sendText` instead of `shellIntegration.executeCommand` and relying on idle events instead
|
|
13
|
-
* of execution events.
|
|
14
|
-
*/
|
|
15
|
-
export declare class NoneExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
16
|
-
private readonly _instance;
|
|
17
|
-
private readonly _hasReceivedUserInput;
|
|
18
|
-
private readonly _configurationService;
|
|
19
|
-
private readonly _logService;
|
|
20
|
-
readonly type = "none";
|
|
21
|
-
private readonly _startMarker;
|
|
22
|
-
private readonly _onDidCreateStartMarker;
|
|
23
|
-
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
24
|
-
constructor(_instance: ITerminalInstance, _hasReceivedUserInput: () => boolean, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
25
|
-
execute(commandLine: string, token: CancellationToken, commandId?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
26
|
-
private _log;
|
|
27
|
-
}
|
|
@@ -1,142 +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 } 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 { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
-
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
8
|
-
import { waitForIdle, waitForIdleWithPromptHeuristics } from './executeStrategy.js';
|
|
9
|
-
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
10
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
11
|
-
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
12
|
-
|
|
13
|
-
let NoneExecuteStrategy = class NoneExecuteStrategy extends Disposable {
|
|
14
|
-
constructor(_instance, _hasReceivedUserInput, _configurationService, _logService) {
|
|
15
|
-
super();
|
|
16
|
-
this._instance = _instance;
|
|
17
|
-
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
18
|
-
this._configurationService = _configurationService;
|
|
19
|
-
this._logService = _logService;
|
|
20
|
-
this.type = "none";
|
|
21
|
-
this._startMarker = this._register(( new MutableDisposable()));
|
|
22
|
-
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
23
|
-
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
24
|
-
}
|
|
25
|
-
async execute(commandLine, token, commandId) {
|
|
26
|
-
const store = ( new DisposableStore());
|
|
27
|
-
try {
|
|
28
|
-
if (token.isCancellationRequested) {
|
|
29
|
-
throw ( new CancellationError());
|
|
30
|
-
}
|
|
31
|
-
this._log("Waiting for xterm");
|
|
32
|
-
const xterm = await this._instance.xtermReadyPromise;
|
|
33
|
-
if (!xterm) {
|
|
34
|
-
throw ( new Error("Xterm is not available"));
|
|
35
|
-
}
|
|
36
|
-
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
37
|
-
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
38
|
-
this._log("Waiting for idle");
|
|
39
|
-
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
40
|
-
if (token.isCancellationRequested) {
|
|
41
|
-
throw ( new CancellationError());
|
|
42
|
-
}
|
|
43
|
-
const markerRecreation = setupRecreatingStartMarker(
|
|
44
|
-
xterm,
|
|
45
|
-
this._startMarker,
|
|
46
|
-
m => this._onDidCreateStartMarker.fire(m),
|
|
47
|
-
store,
|
|
48
|
-
this._log.bind(this)
|
|
49
|
-
);
|
|
50
|
-
if (this._hasReceivedUserInput()) {
|
|
51
|
-
this._log("Command timed out, sending SIGINT and retrying");
|
|
52
|
-
await this._instance.sendText("\u0003", false);
|
|
53
|
-
await waitForIdle(this._instance.onData, 100);
|
|
54
|
-
}
|
|
55
|
-
this._log(`Executing command line \`${commandLine}\``);
|
|
56
|
-
markerRecreation.dispose();
|
|
57
|
-
const startLine = this._startMarker.value?.line;
|
|
58
|
-
const forceBracketedPasteMode = isMacintosh;
|
|
59
|
-
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
60
|
-
if (startLine !== undefined) {
|
|
61
|
-
this._log("Waiting for cursor to move past start line");
|
|
62
|
-
const cursorMovedPromise = ( new Promise(resolve => {
|
|
63
|
-
const check = () => {
|
|
64
|
-
const buffer = xterm.raw.buffer.active;
|
|
65
|
-
const cursorLine = buffer.baseY + buffer.cursorY;
|
|
66
|
-
if (cursorLine > startLine) {
|
|
67
|
-
resolve();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const listener = this._instance.onData(() => check());
|
|
71
|
-
store.add(listener);
|
|
72
|
-
check();
|
|
73
|
-
}));
|
|
74
|
-
const cursorMoveTimeout = ( new Promise(resolve => {
|
|
75
|
-
const handle = setTimeout(() => resolve("timeout"), 1000);
|
|
76
|
-
store.add({
|
|
77
|
-
dispose: () => clearTimeout(handle)
|
|
78
|
-
});
|
|
79
|
-
}));
|
|
80
|
-
const raceResult = await Promise.race([cursorMovedPromise, cursorMoveTimeout]);
|
|
81
|
-
if (raceResult === "timeout") {
|
|
82
|
-
this._log(
|
|
83
|
-
"Cursor did not move past start line before timeout, proceeding with idle detection"
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
this._log("Waiting for idle with prompt heuristics");
|
|
88
|
-
const promptResultOrAltBuffer = await Promise.race([waitForIdleWithPromptHeuristics(
|
|
89
|
-
this._instance.onData,
|
|
90
|
-
this._instance,
|
|
91
|
-
idlePollInterval,
|
|
92
|
-
idlePollInterval * 10
|
|
93
|
-
), alternateBufferPromise.then(() => "alternateBuffer")]);
|
|
94
|
-
if (promptResultOrAltBuffer === "alternateBuffer") {
|
|
95
|
-
this._log("Detected alternate buffer entry, skipping output capture");
|
|
96
|
-
return {
|
|
97
|
-
output: undefined,
|
|
98
|
-
additionalInformation: undefined,
|
|
99
|
-
exitCode: undefined,
|
|
100
|
-
error: "alternateBuffer",
|
|
101
|
-
didEnterAltBuffer: true
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
const promptResult = promptResultOrAltBuffer;
|
|
105
|
-
this._log(
|
|
106
|
-
`Prompt detection result: ${promptResult.detected ? "detected" : "not detected"} - ${promptResult.reason}`
|
|
107
|
-
);
|
|
108
|
-
if (token.isCancellationRequested) {
|
|
109
|
-
throw ( new CancellationError());
|
|
110
|
-
}
|
|
111
|
-
const endMarker = store.add(xterm.raw.registerMarker());
|
|
112
|
-
let output;
|
|
113
|
-
const additionalInformationLines = [];
|
|
114
|
-
try {
|
|
115
|
-
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
116
|
-
this._log("Fetched output via markers");
|
|
117
|
-
if (output !== undefined) {
|
|
118
|
-
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
119
|
-
}
|
|
120
|
-
} catch {
|
|
121
|
-
this._log("Failed to fetch output via markers");
|
|
122
|
-
additionalInformationLines.push("Failed to retrieve command output");
|
|
123
|
-
}
|
|
124
|
-
if (output !== undefined && output.trim().length === 0) {
|
|
125
|
-
additionalInformationLines.push("Command produced no output");
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
output,
|
|
129
|
-
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
130
|
-
exitCode: undefined
|
|
131
|
-
};
|
|
132
|
-
} finally {
|
|
133
|
-
store.dispose();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
_log(message) {
|
|
137
|
-
this._logService.debug(`RunInTerminalTool#None: ${message}`);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
NoneExecuteStrategy = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ITerminalLogService))], NoneExecuteStrategy));
|
|
141
|
-
|
|
142
|
-
export { NoneExecuteStrategy };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
6
|
-
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
7
|
-
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
8
|
-
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
9
|
-
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
10
|
-
/**
|
|
11
|
-
* This strategy is used when the terminal has rich shell integration/command detection is
|
|
12
|
-
* available, meaning every sequence we rely upon should be exactly where we expect it to be. In
|
|
13
|
-
* particular (`633;`) `A, B, E, C, D` all happen in exactly that order. While things still could go
|
|
14
|
-
* wrong in this state, minimal verification is done in this mode since rich command detection is a
|
|
15
|
-
* strong signal that it's behaving correctly.
|
|
16
|
-
*/
|
|
17
|
-
export declare class RichExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
18
|
-
private readonly _instance;
|
|
19
|
-
private readonly _commandDetection;
|
|
20
|
-
private readonly _configurationService;
|
|
21
|
-
private readonly _logService;
|
|
22
|
-
readonly type = "rich";
|
|
23
|
-
private readonly _startMarker;
|
|
24
|
-
private readonly _onDidCreateStartMarker;
|
|
25
|
-
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
26
|
-
constructor(_instance: ITerminalInstance, _commandDetection: ICommandDetectionCapability, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
27
|
-
execute(commandLine: string, token: CancellationToken, commandId?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
28
|
-
private _log;
|
|
29
|
-
}
|