@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,17 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
2
3
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
4
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
5
7
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
+
import { getOutput } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers';
|
|
9
|
+
import { RunInTerminalTool } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool';
|
|
10
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
8
11
|
|
|
9
12
|
const GetTerminalOutputToolData = {
|
|
10
13
|
id: TerminalToolId.GetTerminalOutput,
|
|
11
14
|
toolReferenceName: "getTerminalOutput",
|
|
12
15
|
legacyToolReferenceFullNames: ["runCommands/getTerminalOutput"],
|
|
13
|
-
displayName: ( localize(
|
|
14
|
-
modelDescription: `Get
|
|
16
|
+
displayName: ( localize(14022, "Get Terminal Output")),
|
|
17
|
+
modelDescription: `Get output from a terminal session. This can target either a persistent terminal started with ${TerminalToolId.RunInTerminal} in async mode (using 'id') or any foreground terminal visible in the terminal panel (using 'terminalId'). For the 'id' parameter, this must be the exact opaque UUID returned by ${TerminalToolId.RunInTerminal}; terminal names, labels, and integers are not valid for 'id'.`,
|
|
15
18
|
icon: Codicon.terminal,
|
|
16
19
|
source: ToolDataSource.Internal,
|
|
17
20
|
inputSchema: {
|
|
@@ -19,28 +22,61 @@ const GetTerminalOutputToolData = {
|
|
|
19
22
|
properties: {
|
|
20
23
|
id: {
|
|
21
24
|
type: "string",
|
|
22
|
-
description: `The ID of
|
|
25
|
+
description: `The ID of a persistent terminal session to check (returned by ${TerminalToolId.RunInTerminal} in async mode). This must be the exact opaque ID returned by that tool; terminal names, labels, or integers are invalid. Provide either 'id' or 'terminalId', not both.`,
|
|
23
26
|
pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
27
|
+
},
|
|
28
|
+
terminalId: {
|
|
29
|
+
type: "number",
|
|
30
|
+
description: "The numeric instanceId of a terminal. Use this to get output from terminals not started by the agent (e.g., user-created terminals or foreground terminals). Provide either 'id' or 'terminalId', not both."
|
|
24
31
|
}
|
|
25
|
-
}
|
|
26
|
-
required: ["id"]
|
|
32
|
+
}
|
|
27
33
|
}
|
|
28
34
|
};
|
|
29
|
-
class GetTerminalOutputTool extends Disposable {
|
|
35
|
+
let GetTerminalOutputTool = class GetTerminalOutputTool extends Disposable {
|
|
36
|
+
constructor(_terminalService) {
|
|
37
|
+
super();
|
|
38
|
+
this._terminalService = _terminalService;
|
|
39
|
+
}
|
|
30
40
|
async prepareToolInvocation(context, token) {
|
|
31
41
|
return {
|
|
32
|
-
invocationMessage: ( localize(
|
|
33
|
-
pastTenseMessage: ( localize(
|
|
42
|
+
invocationMessage: ( localize(14023, "Checking terminal output")),
|
|
43
|
+
pastTenseMessage: ( localize(14024, "Checked terminal output"))
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
46
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
37
47
|
const args = invocation.parameters;
|
|
48
|
+
if (!args.id && args.terminalId === undefined) {
|
|
49
|
+
return {
|
|
50
|
+
content: [{
|
|
51
|
+
kind: "text",
|
|
52
|
+
value: "Error: Either 'id' (persistent terminal UUID) or 'terminalId' (foreground terminal instanceId) must be provided."
|
|
53
|
+
}]
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (args.terminalId !== undefined && !args.id) {
|
|
57
|
+
const instance = this._terminalService.getInstanceFromId(args.terminalId);
|
|
58
|
+
if (!instance) {
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
kind: "text",
|
|
62
|
+
value: `Error: No terminal found with instanceId ${args.terminalId}. The terminal may have been closed.`
|
|
63
|
+
}]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const output = getOutput(instance);
|
|
67
|
+
return {
|
|
68
|
+
content: [{
|
|
69
|
+
kind: "text",
|
|
70
|
+
value: `Output of terminal ${args.terminalId}:\n${output}`
|
|
71
|
+
}]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
38
74
|
const execution = RunInTerminalTool.getExecution(args.id);
|
|
39
75
|
if (!execution) {
|
|
40
76
|
return {
|
|
41
77
|
content: [{
|
|
42
78
|
kind: "text",
|
|
43
|
-
value: `Error: No active terminal execution found with ID ${args.id}. The ID must be the exact value returned by ${TerminalToolId.RunInTerminal}
|
|
79
|
+
value: `Error: No active terminal execution found with ID ${args.id}. The ID must be the exact value returned by ${TerminalToolId.RunInTerminal} in async mode.`
|
|
44
80
|
}]
|
|
45
81
|
};
|
|
46
82
|
}
|
|
@@ -51,6 +87,7 @@ class GetTerminalOutputTool extends Disposable {
|
|
|
51
87
|
}]
|
|
52
88
|
};
|
|
53
89
|
}
|
|
54
|
-
}
|
|
90
|
+
};
|
|
91
|
+
GetTerminalOutputTool = ( __decorate([( __param(0, ITerminalService))], GetTerminalOutputTool));
|
|
55
92
|
|
|
56
93
|
export { GetTerminalOutputTool, GetTerminalOutputToolData };
|
|
@@ -5,13 +5,13 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
5
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
6
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
7
7
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
8
|
-
import { TerminalToolId } from '
|
|
8
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
9
9
|
|
|
10
10
|
const GetTerminalSelectionToolData = {
|
|
11
11
|
id: TerminalToolId.TerminalSelection,
|
|
12
12
|
toolReferenceName: "terminalSelection",
|
|
13
13
|
legacyToolReferenceFullNames: ["runCommands/terminalSelection"],
|
|
14
|
-
displayName: ( localize(
|
|
14
|
+
displayName: ( localize(14025, "Get Terminal Selection")),
|
|
15
15
|
modelDescription: "Get the current selection in the active terminal.",
|
|
16
16
|
source: ToolDataSource.Internal,
|
|
17
17
|
icon: Codicon.terminal
|
|
@@ -23,8 +23,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
23
23
|
}
|
|
24
24
|
async prepareToolInvocation(context, token) {
|
|
25
25
|
return {
|
|
26
|
-
invocationMessage: ( localize(
|
|
27
|
-
pastTenseMessage: ( localize(
|
|
26
|
+
invocationMessage: ( localize(14026, "Reading terminal selection")),
|
|
27
|
+
pastTenseMessage: ( localize(14027, "Read terminal selection"))
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -3,14 +3,14 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
3
3
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
5
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
6
|
-
import { RunInTerminalTool } from '
|
|
7
|
-
import { TerminalToolId } from '
|
|
6
|
+
import { RunInTerminalTool } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool';
|
|
7
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
8
8
|
|
|
9
9
|
const KillTerminalToolData = {
|
|
10
10
|
id: TerminalToolId.KillTerminal,
|
|
11
11
|
toolReferenceName: "killTerminal",
|
|
12
|
-
displayName: ( localize(
|
|
13
|
-
modelDescription: `Kill a terminal by its ID. Use this to clean up terminals that are no longer needed (e.g., after stopping a server or when a long-running task completes). The terminal ID is returned by ${TerminalToolId.RunInTerminal}
|
|
12
|
+
displayName: ( localize(14028, "Kill Terminal")),
|
|
13
|
+
modelDescription: `Kill a terminal by its ID. Use this to clean up terminals that are no longer needed (e.g., after stopping a server or when a long-running task completes). The terminal ID is returned by ${TerminalToolId.RunInTerminal} in async mode (legacy: isBackground=true).`,
|
|
14
14
|
icon: Codicon.terminal,
|
|
15
15
|
source: ToolDataSource.Internal,
|
|
16
16
|
inputSchema: {
|
|
@@ -18,7 +18,8 @@ const KillTerminalToolData = {
|
|
|
18
18
|
properties: {
|
|
19
19
|
id: {
|
|
20
20
|
type: "string",
|
|
21
|
-
description: `The ID of the
|
|
21
|
+
description: `The ID of the persistent terminal to kill (returned by ${TerminalToolId.RunInTerminal} in async mode).`,
|
|
22
|
+
pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
required: ["id"]
|
|
@@ -27,8 +28,8 @@ const KillTerminalToolData = {
|
|
|
27
28
|
class KillTerminalTool extends Disposable {
|
|
28
29
|
async prepareToolInvocation(_context, _token) {
|
|
29
30
|
return {
|
|
30
|
-
invocationMessage: ( localize(
|
|
31
|
-
pastTenseMessage: ( localize(
|
|
31
|
+
invocationMessage: ( localize(14029, "Killing terminal")),
|
|
32
|
+
pastTenseMessage: ( localize(14030, "Killed terminal"))
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
async invoke(invocation, _countTokens, _progress, _token) {
|
|
@@ -49,7 +50,7 @@ class KillTerminalTool extends Disposable {
|
|
|
49
50
|
return {
|
|
50
51
|
content: [{
|
|
51
52
|
kind: "text",
|
|
52
|
-
value: `Successfully killed
|
|
53
|
+
value: `Successfully killed persistent terminal ${args.id}. ${outputSummary}`
|
|
53
54
|
}]
|
|
54
55
|
};
|
|
55
56
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
2
|
import { CountTokensCallback, IPreparedToolInvocation, IToolData, IToolInvocation, IToolInvocationPreparationContext, IToolResult, ToolProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
3
|
-
import { RunInTerminalTool } from "
|
|
3
|
+
import { RunInTerminalTool } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool";
|
|
4
4
|
export declare const ConfirmTerminalCommandToolData: IToolData;
|
|
5
5
|
export declare class ConfirmTerminalCommandTool extends RunInTerminalTool {
|
|
6
|
-
get _enableCommandLineSandboxRewriting(): boolean;
|
|
6
|
+
protected get _enableCommandLineSandboxRewriting(): boolean;
|
|
7
7
|
prepareToolInvocation(context: IToolInvocationPreparationContext, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
|
|
8
8
|
invoke(invocation: IToolInvocation, countTokens: CountTokensCallback, progress: ToolProgress, token: CancellationToken): Promise<IToolResult>;
|
|
9
9
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
3
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { ToolDataSource, ToolInvocationPresentation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
5
|
-
import { RunInTerminalTool } from '
|
|
6
|
-
import { TerminalToolId } from '
|
|
5
|
+
import { RunInTerminalTool } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool';
|
|
6
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
7
7
|
|
|
8
8
|
const ConfirmTerminalCommandToolData = {
|
|
9
9
|
id: TerminalToolId.ConfirmTerminalCommand,
|
|
10
|
-
displayName: ( localize(
|
|
10
|
+
displayName: ( localize(14036, "Confirm Terminal Command")),
|
|
11
11
|
modelDescription: [
|
|
12
12
|
"This tool allows you to get explicit user confirmation for a terminal command without executing it.",
|
|
13
13
|
"",
|
|
@@ -25,7 +25,7 @@ const ConfirmTerminalCommandToolData = {
|
|
|
25
25
|
"",
|
|
26
26
|
"After confirmation, use a tool to actually execute the command."
|
|
27
27
|
].join("\n"),
|
|
28
|
-
userDescription: ( localize(
|
|
28
|
+
userDescription: ( localize(14037, "Tool for confirming terminal commands")),
|
|
29
29
|
source: ToolDataSource.Internal,
|
|
30
30
|
icon: Codicon.shield,
|
|
31
31
|
inputSchema: {
|
|
@@ -39,12 +39,17 @@ const ConfirmTerminalCommandToolData = {
|
|
|
39
39
|
type: "string",
|
|
40
40
|
description: "A one-sentence description of what the command does. This will be shown to the user in the confirmation dialog."
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
type: "
|
|
44
|
-
description: "
|
|
42
|
+
goal: {
|
|
43
|
+
type: "string",
|
|
44
|
+
description: "A short description of the goal or purpose of the command."
|
|
45
|
+
},
|
|
46
|
+
mode: {
|
|
47
|
+
type: "string",
|
|
48
|
+
enum: ["sync", "async"],
|
|
49
|
+
description: "Execution mode this command would use if run."
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
|
-
required: ["command", "explanation", "
|
|
52
|
+
required: ["command", "explanation", "goal", "mode"]
|
|
48
53
|
}
|
|
49
54
|
};
|
|
50
55
|
class ConfirmTerminalCommandTool extends RunInTerminalTool {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
+
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
5
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
6
|
+
import { type CountTokensCallback, type IPreparedToolInvocation, type IToolData, type IToolImpl, type IToolInvocation, type IToolInvocationPreparationContext, type IToolResult, type ToolProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
7
|
+
import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
8
|
+
import { ITerminalService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
9
|
+
export declare const SendToTerminalToolData: IToolData;
|
|
10
|
+
export interface ISendToTerminalInputParams {
|
|
11
|
+
id?: string;
|
|
12
|
+
terminalId?: number;
|
|
13
|
+
command: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class SendToTerminalTool extends Disposable implements IToolImpl {
|
|
16
|
+
private readonly _configurationService;
|
|
17
|
+
private readonly _chatService;
|
|
18
|
+
private readonly _chatWidgetService;
|
|
19
|
+
private readonly _terminalChatService;
|
|
20
|
+
private readonly _terminalService;
|
|
21
|
+
constructor(_configurationService: IConfigurationService, _chatService: IChatService, _chatWidgetService: IChatWidgetService, _terminalChatService: ITerminalChatService, _terminalService: ITerminalService);
|
|
22
|
+
prepareToolInvocation(context: IToolInvocationPreparationContext, _token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns a human-friendly label for the target terminal, using the
|
|
25
|
+
* terminal instance title (which reflects the running process) instead
|
|
26
|
+
* of the raw UUID or numeric id.
|
|
27
|
+
*/
|
|
28
|
+
private _getTerminalLabel;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the numeric terminal instanceId for the target terminal, used
|
|
31
|
+
* to build command URIs for the "Focus Terminal" link.
|
|
32
|
+
*/
|
|
33
|
+
private _getTerminalInstanceId;
|
|
34
|
+
/**
|
|
35
|
+
* Searches the current session's responses for the most recent question
|
|
36
|
+
* carousel associated with the target terminal, then uses positional
|
|
37
|
+
* matching to return the specific question that this send_to_terminal
|
|
38
|
+
* call is answering.
|
|
39
|
+
*
|
|
40
|
+
* When a carousel contains multiple questions, the model calls
|
|
41
|
+
* send_to_terminal once per answer in order. This method counts prior
|
|
42
|
+
* send_to_terminal invocations since the carousel to determine the
|
|
43
|
+
* current question index, then verifies the command matches the answer
|
|
44
|
+
* at that position.
|
|
45
|
+
*/
|
|
46
|
+
private _getQuestionContextForTerminal;
|
|
47
|
+
private _getQuestionText;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether a carousel answer value matches the command text being sent.
|
|
50
|
+
*/
|
|
51
|
+
private _answerMatchesCommand;
|
|
52
|
+
invoke(invocation: IToolInvocation, _countTokens: CountTokensCallback, _progress: ToolProgress, _token: CancellationToken): Promise<IToolResult>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
+
import { MarkdownString, appendEscapedMarkdownInlineCode, createCommandUri, isMarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
+
import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
|
|
9
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
|
+
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
11
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
12
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
13
|
+
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
14
|
+
import { ITerminalService, ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
15
|
+
import { getOutput } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers';
|
|
16
|
+
import { buildCommandDisplayText, normalizeCommandForExecution } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers';
|
|
17
|
+
import { RunInTerminalTool } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool';
|
|
18
|
+
import { isSessionAutoApproveLevel } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove';
|
|
19
|
+
import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
|
|
20
|
+
|
|
21
|
+
const SendToTerminalToolData = {
|
|
22
|
+
id: TerminalToolId.SendToTerminal,
|
|
23
|
+
toolReferenceName: "sendToTerminal",
|
|
24
|
+
displayName: ( localize(14081, "Send to Terminal")),
|
|
25
|
+
modelDescription: `Send input text to a terminal session. This can target either a persistent terminal started with ${TerminalToolId.RunInTerminal} in async mode (using 'id') or any foreground terminal visible in the terminal panel (using 'terminalId'). The 'command' field may be empty or whitespace to press Enter (useful for interactive prompts). The result includes the last few lines of terminal output captured shortly after sending.`,
|
|
26
|
+
icon: Codicon.terminal,
|
|
27
|
+
source: ToolDataSource.Internal,
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
id: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: `The ID of a persistent terminal session to send a command to (returned by ${TerminalToolId.RunInTerminal} in async mode). Provide either 'id' or 'terminalId', not both.`,
|
|
34
|
+
pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
35
|
+
},
|
|
36
|
+
terminalId: {
|
|
37
|
+
type: "number",
|
|
38
|
+
description: "The numeric instanceId of a terminal. Use this to send input to terminals not started by the agent (e.g., user-created terminals or terminals that need interactive input). Provide either 'id' or 'terminalId', not both."
|
|
39
|
+
},
|
|
40
|
+
command: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "The input text to send to the terminal. The text is sent followed by Enter. Provide an empty or whitespace string to send just Enter (for interactive prompts)."
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
required: ["command"]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const FocusTerminalByIdCommandId = "workbench.action.terminal.chat.focusTerminalById";
|
|
49
|
+
CommandsRegistry.registerCommand(FocusTerminalByIdCommandId, async (accessor, instanceId) => {
|
|
50
|
+
const terminalService = accessor.get(ITerminalService);
|
|
51
|
+
const instance = terminalService.getInstanceFromId(instanceId);
|
|
52
|
+
if (instance) {
|
|
53
|
+
terminalService.setActiveInstance(instance);
|
|
54
|
+
await terminalService.revealActiveTerminal();
|
|
55
|
+
instance.focus();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const FocusTerminalByExecutionIdCommandId = "workbench.action.terminal.chat.focusTerminalByExecutionId";
|
|
59
|
+
CommandsRegistry.registerCommand(FocusTerminalByExecutionIdCommandId, async (accessor, executionId) => {
|
|
60
|
+
const execution = RunInTerminalTool.getExecution(executionId);
|
|
61
|
+
if (execution) {
|
|
62
|
+
const terminalService = accessor.get(ITerminalService);
|
|
63
|
+
terminalService.setActiveInstance(execution.instance);
|
|
64
|
+
await terminalService.revealActiveTerminal();
|
|
65
|
+
execution.instance.focus();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
let SendToTerminalTool = class SendToTerminalTool extends Disposable {
|
|
69
|
+
constructor(
|
|
70
|
+
_configurationService,
|
|
71
|
+
_chatService,
|
|
72
|
+
_chatWidgetService,
|
|
73
|
+
_terminalChatService,
|
|
74
|
+
_terminalService
|
|
75
|
+
) {
|
|
76
|
+
super();
|
|
77
|
+
this._configurationService = _configurationService;
|
|
78
|
+
this._chatService = _chatService;
|
|
79
|
+
this._chatWidgetService = _chatWidgetService;
|
|
80
|
+
this._terminalChatService = _terminalChatService;
|
|
81
|
+
this._terminalService = _terminalService;
|
|
82
|
+
}
|
|
83
|
+
async prepareToolInvocation(context, _token) {
|
|
84
|
+
const args = context.parameters;
|
|
85
|
+
const isEmptyInput = !args.command || !args.command.trim();
|
|
86
|
+
const terminalLabel = this._getTerminalLabel(args);
|
|
87
|
+
const invocationMessage = ( new MarkdownString());
|
|
88
|
+
const pastTenseMessage = ( new MarkdownString());
|
|
89
|
+
const questionText = this._getQuestionContextForTerminal(context.chatSessionResource, args);
|
|
90
|
+
if (isEmptyInput) {
|
|
91
|
+
invocationMessage.appendMarkdown(( localize(14082, "Pressing `Enter` in terminal")));
|
|
92
|
+
pastTenseMessage.appendMarkdown(( localize(14083, "Pressed `Enter` in terminal")));
|
|
93
|
+
} else {
|
|
94
|
+
const displayCommand = buildCommandDisplayText(args.command);
|
|
95
|
+
const safeInlineCode = appendEscapedMarkdownInlineCode(displayCommand);
|
|
96
|
+
invocationMessage.appendMarkdown(( localize(14084, "Sending {0} to terminal", safeInlineCode)));
|
|
97
|
+
pastTenseMessage.appendMarkdown(( localize(14085, "Sent {0} to terminal", safeInlineCode)));
|
|
98
|
+
}
|
|
99
|
+
if (questionText) {
|
|
100
|
+
const replyPrefix = ` (${( localize(14086, "replying to: "))}`;
|
|
101
|
+
invocationMessage.appendMarkdown(replyPrefix);
|
|
102
|
+
invocationMessage.appendText(questionText);
|
|
103
|
+
invocationMessage.appendMarkdown(")");
|
|
104
|
+
pastTenseMessage.appendMarkdown(replyPrefix);
|
|
105
|
+
pastTenseMessage.appendText(questionText);
|
|
106
|
+
pastTenseMessage.appendMarkdown(")");
|
|
107
|
+
}
|
|
108
|
+
const instanceId = this._getTerminalInstanceId(args);
|
|
109
|
+
const confirmationMessage = ( new MarkdownString("", {
|
|
110
|
+
isTrusted: {
|
|
111
|
+
enabledCommands: [FocusTerminalByIdCommandId]
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
const safeTerminalLabel = appendEscapedMarkdownInlineCode(terminalLabel);
|
|
115
|
+
const baseMessage = isEmptyInput ? ( localize(14087, "Press `Enter` in terminal {0}", safeTerminalLabel)) : ( localize(
|
|
116
|
+
14088,
|
|
117
|
+
"Run {0} in terminal {1}",
|
|
118
|
+
appendEscapedMarkdownInlineCode(buildCommandDisplayText(args.command)),
|
|
119
|
+
safeTerminalLabel
|
|
120
|
+
));
|
|
121
|
+
if (instanceId !== undefined) {
|
|
122
|
+
const focusUri = createCommandUri(FocusTerminalByIdCommandId, instanceId);
|
|
123
|
+
confirmationMessage.appendMarkdown(`${baseMessage} — [${( localize(14089, "Focus Terminal"))}](${focusUri})`);
|
|
124
|
+
} else {
|
|
125
|
+
confirmationMessage.appendMarkdown(baseMessage);
|
|
126
|
+
}
|
|
127
|
+
const chatSessionResource = context.chatSessionResource;
|
|
128
|
+
const isSessionAutoApproved = chatSessionResource && (isSessionAutoApproveLevel(
|
|
129
|
+
chatSessionResource,
|
|
130
|
+
this._configurationService,
|
|
131
|
+
this._chatWidgetService,
|
|
132
|
+
this._chatService
|
|
133
|
+
) || this._terminalChatService.hasChatSessionAutoApproval(chatSessionResource));
|
|
134
|
+
const isAnsweringQuestion = questionText !== undefined;
|
|
135
|
+
const shouldShowConfirmation = (!isSessionAutoApproved && !isAnsweringQuestion) || context.forceConfirmationReason !== undefined;
|
|
136
|
+
const confirmationMessages = shouldShowConfirmation ? {
|
|
137
|
+
title: ( localize(14090, "Send to Terminal")),
|
|
138
|
+
message: confirmationMessage,
|
|
139
|
+
allowAutoConfirm: undefined
|
|
140
|
+
} : undefined;
|
|
141
|
+
return {
|
|
142
|
+
invocationMessage,
|
|
143
|
+
pastTenseMessage,
|
|
144
|
+
confirmationMessages
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
_getTerminalLabel(args) {
|
|
148
|
+
if (args.id) {
|
|
149
|
+
const execution = RunInTerminalTool.getExecution(args.id);
|
|
150
|
+
if (execution) {
|
|
151
|
+
return execution.instance.title;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (args.terminalId !== undefined) {
|
|
155
|
+
const instance = this._terminalService.getInstanceFromId(args.terminalId);
|
|
156
|
+
if (instance) {
|
|
157
|
+
return instance.title;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return args.id ?? String(args.terminalId ?? "");
|
|
161
|
+
}
|
|
162
|
+
_getTerminalInstanceId(args) {
|
|
163
|
+
if (args.terminalId !== undefined) {
|
|
164
|
+
return args.terminalId;
|
|
165
|
+
}
|
|
166
|
+
if (args.id) {
|
|
167
|
+
const execution = RunInTerminalTool.getExecution(args.id);
|
|
168
|
+
if (execution) {
|
|
169
|
+
return execution.instance.instanceId;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
_getQuestionContextForTerminal(chatSessionResource, args) {
|
|
175
|
+
if (!chatSessionResource) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
const model = this._chatService.getSession(chatSessionResource);
|
|
179
|
+
if (!model) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
if (!args.id && args.terminalId === undefined) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
const commandText = args.command?.trim();
|
|
186
|
+
const requests = model.getRequests();
|
|
187
|
+
for (let i = requests.length - 1; i >= 0; i--) {
|
|
188
|
+
const response = requests[i].response;
|
|
189
|
+
if (!response) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
const parts = response.response.value;
|
|
193
|
+
let carouselIndex = -1;
|
|
194
|
+
let carousel;
|
|
195
|
+
for (let j = parts.length - 1; j >= 0; j--) {
|
|
196
|
+
const part = parts[j];
|
|
197
|
+
if (part.kind === "questionCarousel") {
|
|
198
|
+
const candidate = part;
|
|
199
|
+
if (!candidate.terminalId || candidate.questions.length === 0) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const matchesById = !!args.id && candidate.terminalId === args.id;
|
|
203
|
+
const matchesByInstanceId = args.terminalId !== undefined && RunInTerminalTool.getExecution(candidate.terminalId)?.instance.instanceId === args.terminalId;
|
|
204
|
+
if (matchesById || matchesByInstanceId) {
|
|
205
|
+
carouselIndex = j;
|
|
206
|
+
carousel = candidate;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (!carousel || carouselIndex === -1) {
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
let sendCount = 0;
|
|
215
|
+
for (let j = carouselIndex + 1; j < parts.length; j++) {
|
|
216
|
+
if (parts[j].kind === "toolInvocation" && parts[j].toolId === TerminalToolId.SendToTerminal) {
|
|
217
|
+
sendCount++;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const questionIndex = sendCount;
|
|
221
|
+
if (questionIndex >= carousel.questions.length) {
|
|
222
|
+
return undefined;
|
|
223
|
+
}
|
|
224
|
+
const question = carousel.questions[questionIndex];
|
|
225
|
+
if (carousel.data) {
|
|
226
|
+
const answer = carousel.data[question.id];
|
|
227
|
+
if (this._answerMatchesCommand(answer, commandText)) {
|
|
228
|
+
return this._getQuestionText(question);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
return undefined;
|
|
234
|
+
}
|
|
235
|
+
_getQuestionText(question) {
|
|
236
|
+
const text = question.message ?? question.title;
|
|
237
|
+
return isMarkdownString(text) ? text.value : text;
|
|
238
|
+
}
|
|
239
|
+
_answerMatchesCommand(answer, commandText) {
|
|
240
|
+
if (answer === undefined) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
if (typeof answer === "string") {
|
|
244
|
+
return answer.trim() === commandText;
|
|
245
|
+
}
|
|
246
|
+
if (hasKey(answer, {
|
|
247
|
+
selectedValues: true
|
|
248
|
+
})) {
|
|
249
|
+
const multi = answer;
|
|
250
|
+
if (( multi.selectedValues.some(v => v.trim() === commandText))) {
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
return multi.freeformValue?.trim() === commandText;
|
|
254
|
+
}
|
|
255
|
+
if (hasKey(answer, {
|
|
256
|
+
selectedValue: true
|
|
257
|
+
})) {
|
|
258
|
+
const single = answer;
|
|
259
|
+
return single.selectedValue?.trim() === commandText || single.freeformValue?.trim() === commandText;
|
|
260
|
+
}
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
async invoke(invocation, _countTokens, _progress, _token) {
|
|
264
|
+
const args = invocation.parameters;
|
|
265
|
+
if (!args.id && args.terminalId === undefined) {
|
|
266
|
+
return {
|
|
267
|
+
content: [{
|
|
268
|
+
kind: "text",
|
|
269
|
+
value: "Error: Either 'id' (persistent terminal UUID) or 'terminalId' (foreground terminal instanceId) must be provided."
|
|
270
|
+
}]
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
if (args.terminalId !== undefined && !args.id) {
|
|
274
|
+
const instance = this._terminalService.getInstanceFromId(args.terminalId);
|
|
275
|
+
if (!instance) {
|
|
276
|
+
return {
|
|
277
|
+
content: [{
|
|
278
|
+
kind: "text",
|
|
279
|
+
value: `Error: No terminal found with instanceId ${args.terminalId}. The terminal may have been closed.`
|
|
280
|
+
}]
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
await instance.sendText(normalizeCommandForExecution(args.command), true);
|
|
284
|
+
await timeout(100);
|
|
285
|
+
const recentOutput = getOutput(instance, undefined, {
|
|
286
|
+
lastNLines: 5
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
content: [{
|
|
290
|
+
kind: "text",
|
|
291
|
+
value: `Successfully sent command to foreground terminal ${args.terminalId}.${recentOutput ? `\n\nTerminal output (last 5 lines):\n${recentOutput}` : ""}`
|
|
292
|
+
}]
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const execution = RunInTerminalTool.getExecution(args.id);
|
|
296
|
+
if (!execution) {
|
|
297
|
+
return {
|
|
298
|
+
content: [{
|
|
299
|
+
kind: "text",
|
|
300
|
+
value: `Error: No active terminal execution found with ID ${args.id}. The terminal may have already been killed or the ID is invalid. The ID must be the exact value returned by ${TerminalToolId.RunInTerminal}.`
|
|
301
|
+
}]
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
await execution.instance.sendText(normalizeCommandForExecution(args.command), true);
|
|
305
|
+
await timeout(100);
|
|
306
|
+
const recentOutput = getOutput(execution.instance, undefined, {
|
|
307
|
+
lastNLines: 5
|
|
308
|
+
});
|
|
309
|
+
return {
|
|
310
|
+
content: [{
|
|
311
|
+
kind: "text",
|
|
312
|
+
value: `Successfully sent command to terminal ${args.id}.${recentOutput ? `\n\nTerminal output (last 5 lines):\n${recentOutput}` : ""}`
|
|
313
|
+
}]
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
SendToTerminalTool = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IChatService)), ( __param(2, IChatWidgetService)), ( __param(3, ITerminalChatService)), ( __param(4, ITerminalService))], SendToTerminalTool));
|
|
318
|
+
|
|
319
|
+
export { SendToTerminalTool, SendToTerminalToolData };
|