@codingame/monaco-vscode-chat-service-override 23.2.2 → 24.1.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 +13 -10
- package/package.json +5 -41
- package/vscode/src/vs/platform/domWidget/browser/domWidget.d.ts +52 -0
- package/vscode/src/vs/platform/domWidget/browser/domWidget.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +61 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +37 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +7 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +12 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +21 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +27 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +6 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +44 -208
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +23 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +358 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +222 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +241 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +11 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +67 -230
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +65 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +186 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +115 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +389 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +22 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +63 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +173 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +66 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +32 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +8 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +15 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +66 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +30 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +13 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +23 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +20 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +47 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +270 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +310 -170
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +42 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +35 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +1 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +22 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +18 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +80 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +2 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +48 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +16 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +257 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatSetup.d.ts → chatSetup/chatSetupContributions.d.ts} +4 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +622 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +359 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +667 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +260 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/chatSetup.css +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatus.js → chatStatus/chatStatusDashboard.js} +193 -325
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatus.d.ts → chatStatus/chatStatusEntry.d.ts} +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +190 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatusItemService.d.ts → chatStatus/chatStatusItemService.d.ts} +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatStatus/media}/chatStatus.css +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusWidget.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusWidget.js +108 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTerminalOutputAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTerminalOutputAccessibleView.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +57 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +478 -146
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewTitleControl.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewTitleControl.js +204 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidgetService.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidgetService.js +187 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +108 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +37 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +37 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +232 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatusWidget.css +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewPane.css +142 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewTitleControl.css +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +51 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +19 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModelStore.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModelStore.js +100 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +41 -15
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +208 -162
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +15 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +61 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +60 -43
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +27 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +37 -47
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +120 -87
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -42
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +293 -187
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +17 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +43 -9
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +48 -29
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +8 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +36 -41
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +142 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +3 -7
- 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 +19 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +78 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +26 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +23 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +26 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +32 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +15 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +10 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +38 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +32 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +5 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +128 -62
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +12 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +68 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +20 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +13 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +20 -19
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +72 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +5 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +0 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +0 -154
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +0 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +0 -216
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +0 -1617
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +0 -313
- /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/apple-dark.svg +0 -0
- /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/apple-light.svg +0 -0
- /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/github.svg +0 -0
- /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/google.svg +0 -0
- /package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatusItemService.js → chatStatus/chatStatusItemService.js} +0 -0
|
@@ -14,19 +14,17 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
14
14
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
15
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
16
16
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
17
|
-
import {
|
|
18
|
-
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
19
|
-
import { showChatView } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
17
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
20
18
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
21
|
-
import { isCellTextEditOperationArray } from '@codingame/monaco-vscode-
|
|
22
|
-
import { ChatMode } from '@codingame/monaco-vscode-
|
|
19
|
+
import { isCellTextEditOperationArray } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
20
|
+
import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
23
21
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
24
22
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
25
|
-
import { InlineChatWidget } from '@codingame/monaco-vscode-
|
|
26
|
-
import { MENU_INLINE_CHAT_WIDGET_SECONDARY } from '@codingame/monaco-vscode-
|
|
27
|
-
import { TerminalStickyScrollContribution } from '@codingame/monaco-vscode-
|
|
23
|
+
import { InlineChatWidget } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatWidget';
|
|
24
|
+
import { MENU_INLINE_CHAT_WIDGET_SECONDARY } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
25
|
+
import { TerminalStickyScrollContribution } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution';
|
|
28
26
|
import * as terminalChatWidget from './media/terminalChatWidget.css';
|
|
29
|
-
import { TerminalChatContextKeys, MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR, TerminalChatCommandId, MENU_TERMINAL_CHAT_WIDGET_STATUS } from '@codingame/monaco-vscode-
|
|
27
|
+
import { TerminalChatContextKeys, MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR, TerminalChatCommandId, MENU_TERMINAL_CHAT_WIDGET_STATUS } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
|
|
30
28
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
31
29
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
32
30
|
|
|
@@ -55,16 +53,15 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
55
53
|
get lastResponseContent() {
|
|
56
54
|
return this._lastResponseContent;
|
|
57
55
|
}
|
|
58
|
-
constructor(_terminalElement, _instance, _xterm, contextKeyService, _chatService, _storageService,
|
|
56
|
+
constructor(_terminalElement, _instance, _xterm, contextKeyService, _chatService, _storageService, instantiationService, _chatAgentService, _chatWidgetService) {
|
|
59
57
|
super();
|
|
60
58
|
this._terminalElement = _terminalElement;
|
|
61
59
|
this._instance = _instance;
|
|
62
60
|
this._xterm = _xterm;
|
|
63
61
|
this._chatService = _chatService;
|
|
64
62
|
this._storageService = _storageService;
|
|
65
|
-
this._viewsService = _viewsService;
|
|
66
63
|
this._chatAgentService = _chatAgentService;
|
|
67
|
-
this.
|
|
64
|
+
this._chatWidgetService = _chatWidgetService;
|
|
68
65
|
this._onDidHide = this._register(( new Emitter()));
|
|
69
66
|
this.onDidHide = this._onDidHide.event;
|
|
70
67
|
this._messages = this._store.add(( new Emitter()));
|
|
@@ -167,10 +164,10 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
167
164
|
}
|
|
168
165
|
_resetPlaceholder() {
|
|
169
166
|
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Terminal);
|
|
170
|
-
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(
|
|
167
|
+
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(11987, 'Ask about commands'));
|
|
171
168
|
}
|
|
172
|
-
async reveal(
|
|
173
|
-
await this._createSession(
|
|
169
|
+
async reveal() {
|
|
170
|
+
await this._createSession();
|
|
174
171
|
this._doLayout();
|
|
175
172
|
this._container.classList.remove('hide');
|
|
176
173
|
this._visibleContextKey.set(true);
|
|
@@ -255,37 +252,23 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
255
252
|
get focusTracker() {
|
|
256
253
|
return this._focusTracker;
|
|
257
254
|
}
|
|
258
|
-
async _createSession(
|
|
255
|
+
async _createSession() {
|
|
259
256
|
this._sessionCtor = createCancelablePromise(async (token) => {
|
|
260
257
|
if (!this._model.value) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
267
|
-
if (!this._model.value) {
|
|
268
|
-
throw ( new Error('Failed to start chat session'));
|
|
269
|
-
}
|
|
258
|
+
const modelRef = this._chatService.startSession(ChatAgentLocation.Terminal);
|
|
259
|
+
this._model.value = modelRef;
|
|
260
|
+
const model = modelRef.object;
|
|
261
|
+
this._inlineChatWidget.setChatModel(model);
|
|
262
|
+
this._resetPlaceholder();
|
|
270
263
|
}
|
|
271
264
|
});
|
|
272
265
|
this._register(toDisposable(() => this._sessionCtor?.cancel()));
|
|
273
266
|
}
|
|
274
|
-
_loadViewState() {
|
|
275
|
-
const rawViewState = this._storageService.get(this._viewStateStorageKey, StorageScope.PROFILE, undefined);
|
|
276
|
-
let viewState;
|
|
277
|
-
if (rawViewState) {
|
|
278
|
-
try {
|
|
279
|
-
viewState = JSON.parse(rawViewState);
|
|
280
|
-
}
|
|
281
|
-
catch {
|
|
282
|
-
viewState = undefined;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
return viewState;
|
|
286
|
-
}
|
|
287
267
|
_saveViewState() {
|
|
288
|
-
|
|
268
|
+
const viewState = this._inlineChatWidget.chatWidget.getViewState();
|
|
269
|
+
if (viewState) {
|
|
270
|
+
this._storageService.store(this._viewStateStorageKey, JSON.stringify(viewState), StorageScope.PROFILE, StorageTarget.USER);
|
|
271
|
+
}
|
|
289
272
|
}
|
|
290
273
|
clear() {
|
|
291
274
|
this.cancel();
|
|
@@ -356,7 +339,7 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
356
339
|
this._chatService.cancelCurrentRequestForSession(model?.sessionResource);
|
|
357
340
|
}
|
|
358
341
|
async viewInChat() {
|
|
359
|
-
const widget = await
|
|
342
|
+
const widget = await this._chatWidgetService.revealWidget();
|
|
360
343
|
const currentRequest = this._inlineChatWidget.chatWidget.viewModel?.model.getRequests().find(r => r.id === this._currentRequestId);
|
|
361
344
|
if (!widget || !currentRequest?.response) {
|
|
362
345
|
return;
|
|
@@ -407,10 +390,9 @@ TerminalChatWidget = ( __decorate([
|
|
|
407
390
|
( __param(3, IContextKeyService)),
|
|
408
391
|
( __param(4, IChatService)),
|
|
409
392
|
( __param(5, IStorageService)),
|
|
410
|
-
( __param(6,
|
|
411
|
-
( __param(7,
|
|
412
|
-
( __param(8,
|
|
413
|
-
( __param(9, IWorkbenchLayoutService))
|
|
393
|
+
( __param(6, IInstantiationService)),
|
|
394
|
+
( __param(7, IChatAgentService)),
|
|
395
|
+
( __param(8, IChatWidgetService))
|
|
414
396
|
], TerminalChatWidget));
|
|
415
397
|
|
|
416
398
|
export { TerminalChatWidget };
|
|
@@ -6,7 +6,7 @@ import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/typ
|
|
|
6
6
|
import { structuralEquals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/equals';
|
|
7
7
|
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
8
8
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-
|
|
9
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
10
10
|
import { isPowerShell } from './runInTerminalHelpers.js';
|
|
11
11
|
|
|
12
12
|
const neverMatchRegex = /(?!.*)/;
|
|
@@ -127,11 +127,11 @@ let CommandLineAutoApprover = class CommandLineAutoApprover extends Disposable {
|
|
|
127
127
|
for (const [key, value] of Object.entries(config)) {
|
|
128
128
|
const defaultValue = configInspectValue?.default?.value;
|
|
129
129
|
const isDefaultRule = !!(isObject(defaultValue) &&
|
|
130
|
-
key
|
|
130
|
+
Object.prototype.hasOwnProperty.call(defaultValue, key) &&
|
|
131
131
|
structuralEquals(defaultValue[key], value));
|
|
132
132
|
function checkTarget(inspectValue) {
|
|
133
133
|
return (isObject(inspectValue) &&
|
|
134
|
-
key
|
|
134
|
+
Object.prototype.hasOwnProperty.call(inspectValue, key) &&
|
|
135
135
|
structuralEquals(inspectValue[key], value));
|
|
136
136
|
}
|
|
137
137
|
const sourceTarget = (checkTarget(configInspectValue.workspaceFolder) ? ConfigurationTarget.WORKSPACE_FOLDER
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
2
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-
|
|
3
|
+
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
4
4
|
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
5
5
|
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
6
6
|
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
@@ -58,6 +58,9 @@ let BasicExecuteStrategy = class BasicExecuteStrategy {
|
|
|
58
58
|
await this._instance.sendText('\x03', false);
|
|
59
59
|
await waitForIdle(this._instance.onData, 100);
|
|
60
60
|
}
|
|
61
|
+
if (commandId) {
|
|
62
|
+
this._log(`In basic execute strategy: skipping pre-bound command id ${commandId} because basic shell integration executes via sendText`);
|
|
63
|
+
}
|
|
61
64
|
this._log(`Executing command line \`${commandLine}\``);
|
|
62
65
|
this._instance.sendText(commandLine, true);
|
|
63
66
|
this._log('Waiting for done event');
|
|
@@ -66,6 +69,12 @@ let BasicExecuteStrategy = class BasicExecuteStrategy {
|
|
|
66
69
|
throw ( new Error('The terminal was closed'));
|
|
67
70
|
}
|
|
68
71
|
const finishedCommand = onDoneResult && onDoneResult.type === 'success' ? onDoneResult.command : undefined;
|
|
72
|
+
if (finishedCommand) {
|
|
73
|
+
this._log(`Finished command id=${finishedCommand.id ?? 'none'} for requested=${commandId ?? 'none'}`);
|
|
74
|
+
}
|
|
75
|
+
else if (commandId) {
|
|
76
|
+
this._log(`No finished command surfaced for requested=${commandId}`);
|
|
77
|
+
}
|
|
69
78
|
this._log('Waiting for idle');
|
|
70
79
|
await waitForIdle(this._instance.onData, 1000);
|
|
71
80
|
if (token.isCancellationRequested) {
|
|
@@ -36,7 +36,6 @@ export interface IPromptDetectionResult {
|
|
|
36
36
|
* Detects if the given text content appears to end with a common prompt pattern.
|
|
37
37
|
*/
|
|
38
38
|
export declare function detectsCommonPromptPattern(cursorLine: string): IPromptDetectionResult;
|
|
39
|
-
export declare function detectsInputRequiredPattern(cursorLine: string): boolean;
|
|
40
39
|
/**
|
|
41
40
|
* Enhanced version of {@link waitForIdle} that uses prompt detection heuristics. After the terminal
|
|
42
41
|
* idles for the specified period, checks if the terminal's cursor line looks like a common prompt.
|
|
@@ -37,15 +37,6 @@ function detectsCommonPromptPattern(cursorLine) {
|
|
|
37
37
|
}
|
|
38
38
|
return { detected: false, reason: `No common prompt pattern found in last line: "${cursorLine}"` };
|
|
39
39
|
}
|
|
40
|
-
const PS_CONFIRM_RE = /\s*(?:\[[^\]]\]\s+[^\[]+\s*)+(?:\(default is\s+"[^"]+"\):)?\s+$/;
|
|
41
|
-
const YN_PAIRED_RE = /(?:\(|\[)\s*(?:y(?:es)?\s*\/\s*n(?:o)?|n(?:o)?\s*\/\s*y(?:es)?)\s*(?:\]|\))\s+$/i;
|
|
42
|
-
const YN_AFTER_PUNCT_RE = /[?:]\s*(?:\(|\[)?\s*y(?:es)?\s*\/\s*n(?:o)?\s*(?:\]|\))?\s+$/i;
|
|
43
|
-
const CONFIRM_Y_RE = /\(y\)\s*$/i;
|
|
44
|
-
const LINE_ENDS_WITH_COLON_RE = /:\s*$/;
|
|
45
|
-
const END = /\(END\)$/;
|
|
46
|
-
function detectsInputRequiredPattern(cursorLine) {
|
|
47
|
-
return PS_CONFIRM_RE.test(cursorLine) || YN_PAIRED_RE.test(cursorLine) || YN_AFTER_PUNCT_RE.test(cursorLine) || CONFIRM_Y_RE.test(cursorLine) || LINE_ENDS_WITH_COLON_RE.test(cursorLine.trim()) || END.test(cursorLine);
|
|
48
|
-
}
|
|
49
40
|
async function waitForIdleWithPromptHeuristics(onData, instance, idlePollIntervalMs, extendedTimeoutMs) {
|
|
50
41
|
await waitForIdle(onData, idlePollIntervalMs);
|
|
51
42
|
const xterm = await instance.xtermReadyPromise;
|
|
@@ -89,6 +80,15 @@ async function trackIdleOnPrompt(instance, idleDurationMs, store) {
|
|
|
89
80
|
const scheduler = store.add(( new RunOnceScheduler(() => {
|
|
90
81
|
idleOnPrompt.complete();
|
|
91
82
|
}, idleDurationMs)));
|
|
83
|
+
let state = 0 ;
|
|
84
|
+
const promptFallbackScheduler = store.add(( new RunOnceScheduler(() => {
|
|
85
|
+
if (state === 2 || state === 3 ) {
|
|
86
|
+
promptFallbackScheduler.cancel();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
state = 3 ;
|
|
90
|
+
scheduler.schedule();
|
|
91
|
+
}, 1000)));
|
|
92
92
|
let TerminalState;
|
|
93
93
|
(function (TerminalState) {
|
|
94
94
|
TerminalState[TerminalState["Initial"] = 0] = "Initial";
|
|
@@ -96,30 +96,36 @@ async function trackIdleOnPrompt(instance, idleDurationMs, store) {
|
|
|
96
96
|
TerminalState[TerminalState["Executing"] = 2] = "Executing";
|
|
97
97
|
TerminalState[TerminalState["PromptAfterExecuting"] = 3] = "PromptAfterExecuting";
|
|
98
98
|
})(TerminalState || (TerminalState = {}));
|
|
99
|
-
let state = TerminalState.Initial;
|
|
100
99
|
store.add(onData(e => {
|
|
101
100
|
const matches = e.matchAll(/(?:\x1b\]|\x9d)[16]33;(?<type>[ACD])(?:;.*)?(?:\x1b\\|\x07|\x9c)/g);
|
|
102
101
|
for (const match of matches) {
|
|
103
102
|
if (match.groups?.type === 'A') {
|
|
104
|
-
if (state ===
|
|
105
|
-
state =
|
|
103
|
+
if (state === 0 ) {
|
|
104
|
+
state = 1 ;
|
|
106
105
|
}
|
|
107
|
-
else if (state ===
|
|
108
|
-
state =
|
|
106
|
+
else if (state === 2 ) {
|
|
107
|
+
state = 3 ;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
else if (match.groups?.type === 'C' || match.groups?.type === 'D') {
|
|
112
|
-
state =
|
|
111
|
+
state = 2 ;
|
|
113
112
|
}
|
|
114
113
|
}
|
|
115
|
-
if (state ===
|
|
114
|
+
if (state === 3 ) {
|
|
115
|
+
promptFallbackScheduler.cancel();
|
|
116
116
|
scheduler.schedule();
|
|
117
117
|
}
|
|
118
118
|
else {
|
|
119
119
|
scheduler.cancel();
|
|
120
|
+
if (state === 0 || state === 1 ) {
|
|
121
|
+
promptFallbackScheduler.schedule();
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
promptFallbackScheduler.cancel();
|
|
125
|
+
}
|
|
120
126
|
}
|
|
121
127
|
}));
|
|
122
128
|
return idleOnPrompt.p;
|
|
123
129
|
}
|
|
124
130
|
|
|
125
|
-
export { detectsCommonPromptPattern,
|
|
131
|
+
export { detectsCommonPromptPattern, trackIdleOnPrompt, waitForIdle, waitForIdleWithPromptHeuristics };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
2
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-
|
|
3
|
+
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
4
4
|
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
5
5
|
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
6
6
|
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
|
|
2
|
+
import { truncateOutputKeepingTail } from './runInTerminalHelpers.js';
|
|
2
3
|
|
|
4
|
+
const MAX_OUTPUT_LENGTH = 16000;
|
|
3
5
|
function getOutput(instance, startMarker) {
|
|
4
6
|
if (!instance.xterm || !instance.xterm.raw) {
|
|
5
7
|
return '';
|
|
@@ -13,8 +15,8 @@ function getOutput(instance, startMarker) {
|
|
|
13
15
|
lines[y - startLine] = line ? line.translateToString(true) : '';
|
|
14
16
|
}
|
|
15
17
|
let output = lines.join('\n');
|
|
16
|
-
if (output.length >
|
|
17
|
-
output = output
|
|
18
|
+
if (output.length > MAX_OUTPUT_LENGTH) {
|
|
19
|
+
output = truncateOutputKeepingTail(output, MAX_OUTPUT_LENGTH);
|
|
18
20
|
}
|
|
19
21
|
return output;
|
|
20
22
|
}
|
|
@@ -5,6 +5,8 @@ export declare function isPowerShell(envShell: string, os: OperatingSystem): boo
|
|
|
5
5
|
export declare function isWindowsPowerShell(envShell: string): boolean;
|
|
6
6
|
export declare function isZsh(envShell: string, os: OperatingSystem): boolean;
|
|
7
7
|
export declare function isFish(envShell: string, os: OperatingSystem): boolean;
|
|
8
|
+
export declare const TRUNCATION_MESSAGE = "\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n";
|
|
9
|
+
export declare function truncateOutputKeepingTail(output: string, maxLength: number): string;
|
|
8
10
|
export declare function sanitizeTerminalOutput(output: string): string;
|
|
9
11
|
export declare function generateAutoApproveActions(commandLine: string, subCommands: string[], autoApproveResult: {
|
|
10
12
|
subCommandResults: ICommandApprovalResultWithReason[];
|
|
@@ -27,6 +27,19 @@ function isFish(envShell, os) {
|
|
|
27
27
|
}
|
|
28
28
|
return /^fish$/.test(posix.basename(envShell));
|
|
29
29
|
}
|
|
30
|
+
const TRUNCATION_MESSAGE = '\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n';
|
|
31
|
+
function truncateOutputKeepingTail(output, maxLength) {
|
|
32
|
+
if (output.length <= maxLength) {
|
|
33
|
+
return output;
|
|
34
|
+
}
|
|
35
|
+
const truncationMessageLength = TRUNCATION_MESSAGE.length;
|
|
36
|
+
if (truncationMessageLength >= maxLength) {
|
|
37
|
+
return TRUNCATION_MESSAGE.slice(TRUNCATION_MESSAGE.length - maxLength);
|
|
38
|
+
}
|
|
39
|
+
const availableLength = maxLength - truncationMessageLength;
|
|
40
|
+
const endPortion = output.slice(-availableLength);
|
|
41
|
+
return TRUNCATION_MESSAGE + endPortion;
|
|
42
|
+
}
|
|
30
43
|
function generateAutoApproveActions(commandLine, subCommands, autoApproveResult) {
|
|
31
44
|
const actions = [];
|
|
32
45
|
const canCreateAutoApproval = (autoApproveResult.subCommandResults.every(e => e.result !== 'denied') &&
|
|
@@ -72,11 +85,11 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
72
85
|
if (subCommandsToSuggest.length > 0) {
|
|
73
86
|
let subCommandLabel;
|
|
74
87
|
if (subCommandsToSuggest.length === 1) {
|
|
75
|
-
subCommandLabel = ( localize(
|
|
88
|
+
subCommandLabel = ( localize(11989, 'Always Allow Command: {0}', subCommandsToSuggest[0]));
|
|
76
89
|
}
|
|
77
90
|
else {
|
|
78
91
|
const commandSeparated = subCommandsToSuggest.join(', ');
|
|
79
|
-
subCommandLabel = ( localize(
|
|
92
|
+
subCommandLabel = ( localize(11990, 'Always Allow Commands: {0}', commandSeparated));
|
|
80
93
|
}
|
|
81
94
|
actions.push({
|
|
82
95
|
label: subCommandLabel,
|
|
@@ -94,7 +107,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
94
107
|
!( commandsWithSubcommands.has(commandLine)) &&
|
|
95
108
|
!( commandsWithSubSubCommands.has(commandLine))) {
|
|
96
109
|
actions.push({
|
|
97
|
-
label: ( localize(
|
|
110
|
+
label: ( localize(11991, 'Always Allow Exact Command Line')),
|
|
98
111
|
data: {
|
|
99
112
|
type: 'newRule',
|
|
100
113
|
rule: {
|
|
@@ -112,7 +125,15 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
112
125
|
actions.push(( new Separator()));
|
|
113
126
|
}
|
|
114
127
|
actions.push({
|
|
115
|
-
label: ( localize(
|
|
128
|
+
label: ( localize(11992, 'Allow All Commands in this Session')),
|
|
129
|
+
tooltip: ( localize(11993, 'Allow this tool to run in this session without confirmation.')),
|
|
130
|
+
data: {
|
|
131
|
+
type: 'sessionApproval'
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
actions.push(( new Separator()));
|
|
135
|
+
actions.push({
|
|
136
|
+
label: ( localize(11994, 'Configure Auto Approve...')),
|
|
116
137
|
data: {
|
|
117
138
|
type: 'configure'
|
|
118
139
|
}
|
|
@@ -125,4 +146,4 @@ function dedupeRules(rules) {
|
|
|
125
146
|
});
|
|
126
147
|
}
|
|
127
148
|
|
|
128
|
-
export { dedupeRules, generateAutoApproveActions, isFish, isPowerShell, isWindowsPowerShell, isZsh };
|
|
149
|
+
export { TRUNCATION_MESSAGE, dedupeRules, generateAutoApproveActions, isFish, isPowerShell, isWindowsPowerShell, isZsh, truncateOutputKeepingTail };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare function getTaskDefinition(id: string): {
|
|
|
14
14
|
taskType: string;
|
|
15
15
|
};
|
|
16
16
|
export declare function getTaskRepresentation(task: IConfiguredTask | Task): string;
|
|
17
|
+
export declare function getTaskKey(task: Task): string;
|
|
18
|
+
export declare function tasksMatch(a: Task, b: Task): boolean;
|
|
17
19
|
export declare function getTaskForTool(id: string | undefined, taskDefinition: {
|
|
18
20
|
taskLabel?: string;
|
|
19
21
|
taskType?: string;
|
|
@@ -45,7 +47,7 @@ export declare function resolveDependencyTasks(parentTask: Task, workspaceFolder
|
|
|
45
47
|
/**
|
|
46
48
|
* Collects output, polling duration, and idle status for all terminals.
|
|
47
49
|
*/
|
|
48
|
-
export declare function collectTerminalResults(terminals: ITerminalInstance[], task: Task, instantiationService: IInstantiationService, invocationContext: IToolInvocationContext, progress: ToolProgress, token: CancellationToken, disposableStore: DisposableStore, isActive?: (task: Task) => Promise<boolean>, dependencyTasks?: Task[]): Promise<Array<{
|
|
50
|
+
export declare function collectTerminalResults(terminals: ITerminalInstance[], task: Task, instantiationService: IInstantiationService, invocationContext: IToolInvocationContext, progress: ToolProgress, token: CancellationToken, disposableStore: DisposableStore, isActive?: (task: Task) => Promise<boolean>, dependencyTasks?: Task[], taskService?: ITaskService): Promise<Array<{
|
|
49
51
|
name: string;
|
|
50
52
|
output: string;
|
|
51
53
|
resources?: ILinkLocation[];
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
|
|
2
|
+
import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
2
3
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
3
4
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
5
|
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
@@ -6,6 +7,7 @@ import { getOutput } from './outputHelpers.js';
|
|
|
6
7
|
import { OutputMonitor } from './tools/monitoring/outputMonitor.js';
|
|
7
8
|
import { OutputMonitorState } from './tools/monitoring/types.js';
|
|
8
9
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
10
|
+
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
11
|
|
|
10
12
|
function getTaskDefinition(id) {
|
|
11
13
|
const idx = id.indexOf(': ');
|
|
@@ -24,10 +26,25 @@ function getTaskRepresentation(task) {
|
|
|
24
26
|
return task.script;
|
|
25
27
|
}
|
|
26
28
|
else if ('command' in task && task.command) {
|
|
27
|
-
return
|
|
29
|
+
return isString(task.command) ? task.command : task.command.name?.toString() || '';
|
|
28
30
|
}
|
|
29
31
|
return '';
|
|
30
32
|
}
|
|
33
|
+
function getTaskKey(task) {
|
|
34
|
+
return task.getKey() ?? task.getMapKey();
|
|
35
|
+
}
|
|
36
|
+
function tasksMatch(a, b) {
|
|
37
|
+
if (!a || !b) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (getTaskKey(a) === getTaskKey(b)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (a.getCommonTaskId?.() === b.getCommonTaskId?.()) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
return a._id === b._id;
|
|
47
|
+
}
|
|
31
48
|
async function getTaskForTool(id, taskDefinition, workspaceFolder, configurationService, taskService, allowParentTask) {
|
|
32
49
|
let index = 0;
|
|
33
50
|
let task;
|
|
@@ -87,7 +104,7 @@ async function resolveDependencyTasks(parentTask, workspaceFolder, configuration
|
|
|
87
104
|
return undefined;
|
|
88
105
|
}
|
|
89
106
|
const dependencyTasks = await Promise.all(( parentTask.configurationProperties.dependsOn.map(async (dep) => {
|
|
90
|
-
const depId =
|
|
107
|
+
const depId = isString(dep.task) ? dep.task : dep.task?._key;
|
|
91
108
|
if (!depId) {
|
|
92
109
|
return undefined;
|
|
93
110
|
}
|
|
@@ -95,7 +112,7 @@ async function resolveDependencyTasks(parentTask, workspaceFolder, configuration
|
|
|
95
112
|
})));
|
|
96
113
|
return dependencyTasks.filter((t) => t !== undefined);
|
|
97
114
|
}
|
|
98
|
-
async function collectTerminalResults(terminals, task, instantiationService, invocationContext, progress, token, disposableStore, isActive, dependencyTasks) {
|
|
115
|
+
async function collectTerminalResults(terminals, task, instantiationService, invocationContext, progress, token, disposableStore, isActive, dependencyTasks, taskService) {
|
|
99
116
|
const results = [];
|
|
100
117
|
if (token.isCancellationRequested) {
|
|
101
118
|
return results;
|
|
@@ -138,6 +155,17 @@ async function collectTerminalResults(terminals, task, instantiationService, inv
|
|
|
138
155
|
dependencyTasks,
|
|
139
156
|
sessionId: invocationContext.sessionId
|
|
140
157
|
};
|
|
158
|
+
if (terminalTask.configurationProperties.problemMatchers && terminalTask.configurationProperties.problemMatchers.length > 0 && taskService) {
|
|
159
|
+
const maxWaitTime = 1000;
|
|
160
|
+
const startTime = Date.now();
|
|
161
|
+
while (!token.isCancellationRequested && Date.now() - startTime < maxWaitTime) {
|
|
162
|
+
const busyTasks = await taskService.getBusyTasks();
|
|
163
|
+
if (( busyTasks.some(t => tasksMatch(t, terminalTask)))) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
await timeout(100);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
141
169
|
const outputMonitor = disposableStore.add(instantiationService.createInstance(OutputMonitor, execution, taskProblemPollFn, invocationContext, token, task._label));
|
|
142
170
|
await Event.toPromise(outputMonitor.onDidFinishCommand);
|
|
143
171
|
const pollingResult = outputMonitor.pollingResult;
|
|
@@ -204,4 +232,4 @@ async function taskProblemPollFn(execution, token, taskService) {
|
|
|
204
232
|
throw ( new Error('Polling failed'));
|
|
205
233
|
}
|
|
206
234
|
|
|
207
|
-
export { collectTerminalResults, getTaskDefinition, getTaskForTool, getTaskRepresentation, resolveDependencyTasks, taskProblemPollFn };
|
|
235
|
+
export { collectTerminalResults, getTaskDefinition, getTaskForTool, getTaskKey, getTaskRepresentation, resolveDependencyTasks, taskProblemPollFn, tasksMatch };
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
4
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
6
5
|
import { isNumber } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
6
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
7
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
@@ -11,18 +10,14 @@ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
11
10
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
11
|
import { TerminalSettingId } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
|
|
13
12
|
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
14
|
-
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
15
|
-
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
16
|
-
import { showChatView } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
17
13
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
18
14
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
19
|
-
import { ToolDataSource, VSCodeToolReference } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
20
15
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
21
|
-
import { registerActiveInstanceAction, sharedWhenClause } from '@codingame/monaco-vscode-
|
|
22
|
-
import { TerminalContextMenuGroup } from '@codingame/monaco-vscode-
|
|
23
|
-
import { TerminalContextKeys } from '@codingame/monaco-vscode-
|
|
16
|
+
import { registerActiveInstanceAction, sharedWhenClause } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminal/browser/terminalActions';
|
|
17
|
+
import { TerminalContextMenuGroup } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminalMenus';
|
|
18
|
+
import { TerminalContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminalContextKey';
|
|
24
19
|
import { TerminalChatAgentToolsCommandId } from '../common/terminal.chatAgentTools.js';
|
|
25
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-
|
|
20
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
26
21
|
import { GetTerminalLastCommandTool, GetTerminalLastCommandToolData } from './tools/getTerminalLastCommandTool.js';
|
|
27
22
|
import { GetTerminalOutputTool, GetTerminalOutputToolData } from './tools/getTerminalOutputTool.js';
|
|
28
23
|
import { GetTerminalSelectionTool, GetTerminalSelectionToolData } from './tools/getTerminalSelectionTool.js';
|
|
@@ -58,34 +53,27 @@ let ChatAgentToolsContribution = class ChatAgentToolsContribution extends Dispos
|
|
|
58
53
|
this._register(toolsService.registerTool(ConfirmTerminalCommandToolData, confirmTerminalCommandTool));
|
|
59
54
|
const getTerminalOutputTool = instantiationService.createInstance(GetTerminalOutputTool);
|
|
60
55
|
this._register(toolsService.registerTool(GetTerminalOutputToolData, getTerminalOutputTool));
|
|
61
|
-
|
|
62
|
-
icon: ThemeIcon.fromId(Codicon.terminal.id),
|
|
63
|
-
description: ( localize(11854, 'Runs commands in the terminal'))
|
|
64
|
-
}));
|
|
65
|
-
runCommandsToolSet.addTool(GetTerminalOutputToolData);
|
|
56
|
+
this._register(toolsService.executeToolSet.addTool(GetTerminalOutputToolData));
|
|
66
57
|
instantiationService.invokeFunction(createRunInTerminalToolData).then(runInTerminalToolData => {
|
|
67
58
|
const runInTerminalTool = instantiationService.createInstance(RunInTerminalTool);
|
|
68
59
|
this._register(toolsService.registerTool(runInTerminalToolData, runInTerminalTool));
|
|
69
|
-
|
|
60
|
+
this._register(toolsService.executeToolSet.addTool(runInTerminalToolData));
|
|
70
61
|
});
|
|
71
62
|
const getTerminalSelectionTool = instantiationService.createInstance(GetTerminalSelectionTool);
|
|
72
63
|
this._register(toolsService.registerTool(GetTerminalSelectionToolData, getTerminalSelectionTool));
|
|
73
64
|
const getTerminalLastCommandTool = instantiationService.createInstance(GetTerminalLastCommandTool);
|
|
74
65
|
this._register(toolsService.registerTool(GetTerminalLastCommandToolData, getTerminalLastCommandTool));
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
this._register(toolsService.readToolSet.addTool(GetTerminalSelectionToolData));
|
|
67
|
+
this._register(toolsService.readToolSet.addTool(GetTerminalLastCommandToolData));
|
|
77
68
|
const runTaskTool = instantiationService.createInstance(RunTaskTool);
|
|
78
69
|
this._register(toolsService.registerTool(RunTaskToolData, runTaskTool));
|
|
79
70
|
const getTaskOutputTool = instantiationService.createInstance(GetTaskOutputTool);
|
|
80
71
|
this._register(toolsService.registerTool(GetTaskOutputToolData, getTaskOutputTool));
|
|
81
72
|
const createAndRunTaskTool = instantiationService.createInstance(CreateAndRunTaskTool);
|
|
82
73
|
this._register(toolsService.registerTool(CreateAndRunTaskToolData, createAndRunTaskTool));
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
runTasksToolSet.addTool(RunTaskToolData);
|
|
87
|
-
runTasksToolSet.addTool(GetTaskOutputToolData);
|
|
88
|
-
runTasksToolSet.addTool(CreateAndRunTaskToolData);
|
|
74
|
+
this._register(toolsService.executeToolSet.addTool(RunTaskToolData));
|
|
75
|
+
this._register(toolsService.executeToolSet.addTool(GetTaskOutputToolData));
|
|
76
|
+
this._register(toolsService.executeToolSet.addTool(CreateAndRunTaskToolData));
|
|
89
77
|
}
|
|
90
78
|
};
|
|
91
79
|
ChatAgentToolsContribution = ( __decorate([
|
|
@@ -95,7 +83,7 @@ ChatAgentToolsContribution = ( __decorate([
|
|
|
95
83
|
registerWorkbenchContribution2(ChatAgentToolsContribution.ID, ChatAgentToolsContribution, WorkbenchPhase.AfterRestored);
|
|
96
84
|
registerActiveInstanceAction({
|
|
97
85
|
id: TerminalChatAgentToolsCommandId.ChatAddTerminalSelection,
|
|
98
|
-
title: ( localize(
|
|
86
|
+
title: ( localize(11995, 'Add Terminal Selection to Chat')),
|
|
99
87
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, sharedWhenClause.terminalAvailable)),
|
|
100
88
|
menu: [
|
|
101
89
|
{
|
|
@@ -106,22 +94,20 @@ registerActiveInstanceAction({
|
|
|
106
94
|
},
|
|
107
95
|
],
|
|
108
96
|
run: async (activeInstance, _c, accessor) => {
|
|
109
|
-
const viewsService = accessor.get(IViewsService);
|
|
110
97
|
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
111
|
-
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
112
98
|
const selection = activeInstance.selection;
|
|
113
99
|
if (!selection) {
|
|
114
100
|
return;
|
|
115
101
|
}
|
|
116
|
-
const chatView = chatWidgetService.lastFocusedWidget
|
|
102
|
+
const chatView = chatWidgetService.lastFocusedWidget ?? (await chatWidgetService.revealWidget());
|
|
117
103
|
if (!chatView) {
|
|
118
104
|
return;
|
|
119
105
|
}
|
|
120
106
|
chatView.attachmentModel.addContext({
|
|
121
107
|
id: `terminal-selection-${Date.now()}`,
|
|
122
108
|
kind: 'generic',
|
|
123
|
-
name: ( localize(
|
|
124
|
-
fullName: ( localize(
|
|
109
|
+
name: ( localize(11996, 'Terminal Selection')),
|
|
110
|
+
fullName: ( localize(11996, 'Terminal Selection')),
|
|
125
111
|
value: selection,
|
|
126
112
|
icon: Codicon.terminal
|
|
127
113
|
});
|