@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
|
@@ -6,14 +6,14 @@ import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/c
|
|
|
6
6
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
7
|
import { DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
9
|
-
import { isNumber, isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
|
+
import { isNumber, isObject, hasKey, isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
10
10
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
-
import { TerminalCapability } from '@codingame/monaco-vscode-
|
|
12
|
-
import { PromptInputState } from '@codingame/monaco-vscode-
|
|
11
|
+
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
12
|
+
import { PromptInputState } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel';
|
|
13
13
|
import { TerminalSettingId } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
|
|
14
14
|
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
15
15
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
16
|
-
import { getShellIntegrationTimeout } from '@codingame/monaco-vscode-
|
|
16
|
+
import { getShellIntegrationTimeout } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminal/common/terminalEnvironment';
|
|
17
17
|
|
|
18
18
|
var ToolTerminalCreator_1;
|
|
19
19
|
var ShellLaunchType;
|
|
@@ -47,7 +47,7 @@ let ToolTerminalCreator = class ToolTerminalCreator {
|
|
|
47
47
|
instance.processReady.then(() => processReadyTimestamp = Date.now()),
|
|
48
48
|
Event.toPromise(instance.onExit),
|
|
49
49
|
]);
|
|
50
|
-
if (!isNumber(initResult) && isObject(initResult) &&
|
|
50
|
+
if (!isNumber(initResult) && isObject(initResult) && hasKey(initResult, { message: true })) {
|
|
51
51
|
throw ( new Error(initResult.message));
|
|
52
52
|
}
|
|
53
53
|
const siInjectionEnabled = this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled) === true;
|
|
@@ -64,7 +64,10 @@ let ToolTerminalCreator = class ToolTerminalCreator {
|
|
|
64
64
|
const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
65
65
|
if (commandDetection?.promptInputModel.state === PromptInputState.Unknown) {
|
|
66
66
|
this._logService.info(`ToolTerminalCreator#createTerminal: Waiting up to 2s for PromptInputModel state to change`);
|
|
67
|
-
await raceTimeout(Event.toPromise(commandDetection.onCommandStarted), 2000);
|
|
67
|
+
const didStart = await raceTimeout(Event.toPromise(commandDetection.onCommandStarted), 2000);
|
|
68
|
+
if (!didStart) {
|
|
69
|
+
this._logService.info(`ToolTerminalCreator#createTerminal: PromptInputModel state did not change within timeout`);
|
|
70
|
+
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
if (shellIntegrationQuality !== ShellIntegrationQuality.None) {
|
|
@@ -97,7 +100,7 @@ let ToolTerminalCreator = class ToolTerminalCreator {
|
|
|
97
100
|
GIT_PAGER: 'cat',
|
|
98
101
|
}
|
|
99
102
|
};
|
|
100
|
-
if (
|
|
103
|
+
if (isString(shellOrProfile)) {
|
|
101
104
|
config.executable = shellOrProfile;
|
|
102
105
|
}
|
|
103
106
|
else {
|
|
@@ -14,9 +14,21 @@ export interface ICommandLineAnalyzerOptions {
|
|
|
14
14
|
os: OperatingSystem;
|
|
15
15
|
treeSitterLanguage: TreeSitterCommandParserLanguage;
|
|
16
16
|
terminalToolSessionId: string;
|
|
17
|
+
chatSessionId: string | undefined;
|
|
17
18
|
}
|
|
18
19
|
export interface ICommandLineAnalyzerResult {
|
|
20
|
+
/**
|
|
21
|
+
* Whether auto approval is allowed based on the analysis, when false this
|
|
22
|
+
* will block auto approval.
|
|
23
|
+
*/
|
|
19
24
|
readonly isAutoApproveAllowed: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the command line was explicitly auto approved by this analyzer.
|
|
27
|
+
* - `true`: This analyzer explicitly approves auto-execution
|
|
28
|
+
* - `false`: This analyzer explicitly denies auto-execution
|
|
29
|
+
* - `undefined`: This analyzer does not make an approval/denial decision
|
|
30
|
+
*/
|
|
31
|
+
readonly isAutoApproved?: boolean;
|
|
20
32
|
readonly disclaimers?: readonly string[];
|
|
21
33
|
readonly autoApproveInfo?: IMarkdownString;
|
|
22
34
|
readonly customActions?: ToolConfirmationAction[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
2
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
3
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
4
5
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
5
6
|
import type { RunInTerminalToolTelemetry } from "../../runInTerminalToolTelemetry.js";
|
|
6
7
|
import { type TreeSitterCommandParser } from "../../treeSitterCommandParser.js";
|
|
@@ -11,8 +12,9 @@ export declare class CommandLineAutoApproveAnalyzer extends Disposable implement
|
|
|
11
12
|
private readonly _log;
|
|
12
13
|
private readonly _configurationService;
|
|
13
14
|
private readonly _storageService;
|
|
15
|
+
private readonly _terminalChatService;
|
|
14
16
|
private readonly _commandLineAutoApprover;
|
|
15
|
-
constructor(_treeSitterCommandParser: TreeSitterCommandParser, _telemetry: RunInTerminalToolTelemetry, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, instantiationService: IInstantiationService, _storageService: IStorageService);
|
|
17
|
+
constructor(_treeSitterCommandParser: TreeSitterCommandParser, _telemetry: RunInTerminalToolTelemetry, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, instantiationService: IInstantiationService, _storageService: IStorageService, _terminalChatService: ITerminalChatService);
|
|
16
18
|
analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
|
|
17
19
|
private _createAutoApproveInfo;
|
|
18
20
|
}
|
|
@@ -6,14 +6,15 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
6
6
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
7
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
8
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
+
import { ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
9
10
|
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
10
11
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
11
|
-
import { TerminalToolConfirmationStorageKeys } from '@codingame/monaco-vscode-
|
|
12
|
-
import { openTerminalSettingsLinkCommandId } from '@codingame/monaco-vscode-a793b3ee-7ba9-5176-a019-30ec806fdd95-common/vscode/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart';
|
|
12
|
+
import { TerminalToolConfirmationStorageKeys } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart';
|
|
13
13
|
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
14
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-
|
|
14
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
15
15
|
import { CommandLineAutoApprover } from '../../commandLineAutoApprover.js';
|
|
16
16
|
import { isPowerShell, generateAutoApproveActions, dedupeRules } from '../../runInTerminalHelpers.js';
|
|
17
|
+
import { TerminalChatCommandId } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
|
|
17
18
|
|
|
18
19
|
const promptInjectionWarningCommandsLower = [
|
|
19
20
|
'curl',
|
|
@@ -26,16 +27,32 @@ const promptInjectionWarningCommandsLowerPwshOnly = [
|
|
|
26
27
|
'iwr',
|
|
27
28
|
];
|
|
28
29
|
let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extends Disposable {
|
|
29
|
-
constructor(_treeSitterCommandParser, _telemetry, _log, _configurationService, instantiationService, _storageService) {
|
|
30
|
+
constructor(_treeSitterCommandParser, _telemetry, _log, _configurationService, instantiationService, _storageService, _terminalChatService) {
|
|
30
31
|
super();
|
|
31
32
|
this._treeSitterCommandParser = _treeSitterCommandParser;
|
|
32
33
|
this._telemetry = _telemetry;
|
|
33
34
|
this._log = _log;
|
|
34
35
|
this._configurationService = _configurationService;
|
|
35
36
|
this._storageService = _storageService;
|
|
37
|
+
this._terminalChatService = _terminalChatService;
|
|
36
38
|
this._commandLineAutoApprover = this._register(instantiationService.createInstance(CommandLineAutoApprover));
|
|
37
39
|
}
|
|
38
40
|
async analyze(options) {
|
|
41
|
+
if (options.chatSessionId && this._terminalChatService.hasChatSessionAutoApproval(options.chatSessionId)) {
|
|
42
|
+
this._log('Session has auto approval enabled, auto approving command');
|
|
43
|
+
const disableUri = createCommandUri(TerminalChatCommandId.DisableSessionAutoApproval, options.chatSessionId);
|
|
44
|
+
const mdTrustSettings = {
|
|
45
|
+
isTrusted: {
|
|
46
|
+
enabledCommands: [TerminalChatCommandId.DisableSessionAutoApproval]
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
isAutoApproved: true,
|
|
51
|
+
isAutoApproveAllowed: true,
|
|
52
|
+
disclaimers: [],
|
|
53
|
+
autoApproveInfo: ( new MarkdownString(`${( localize(11997, 'Auto approved for this session'))} ([${( localize(11998, 'Disable'))}](${( disableUri.toString())}))`, mdTrustSettings)),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
39
56
|
let subCommands;
|
|
40
57
|
try {
|
|
41
58
|
subCommands = await this._treeSitterCommandParser.extractSubCommands(options.treeSitterLanguage, options.commandLine);
|
|
@@ -122,7 +139,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
122
139
|
if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) ||
|
|
123
140
|
(isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
|
|
124
141
|
disclaimers.push(( localize(
|
|
125
|
-
|
|
142
|
+
11999,
|
|
126
143
|
'Web content may contain malicious code or attempt prompt injection attacks.'
|
|
127
144
|
)));
|
|
128
145
|
}
|
|
@@ -130,7 +147,8 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
130
147
|
customActions = generateAutoApproveActions(options.commandLine, subCommands, { subCommandResults, commandLineResult });
|
|
131
148
|
}
|
|
132
149
|
return {
|
|
133
|
-
|
|
150
|
+
isAutoApproved,
|
|
151
|
+
isAutoApproveAllowed: true,
|
|
134
152
|
disclaimers,
|
|
135
153
|
autoApproveInfo,
|
|
136
154
|
customActions,
|
|
@@ -139,23 +157,23 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
139
157
|
_createAutoApproveInfo(isAutoApproved, isDenied, autoApproveReason, subCommandResults, commandLineResult) {
|
|
140
158
|
const formatRuleLinks = (result) => {
|
|
141
159
|
return ( asArray(result).map(e => {
|
|
142
|
-
const settingsUri = createCommandUri(
|
|
143
|
-
return `[\`${e.rule.sourceText}\`](${( settingsUri.toString())} "${( localize(
|
|
160
|
+
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
|
|
161
|
+
return `[\`${e.rule.sourceText}\`](${( settingsUri.toString())} "${( localize(12000, 'View rule in settings'))}")`;
|
|
144
162
|
})).join(', ');
|
|
145
163
|
};
|
|
146
164
|
const mdTrustSettings = {
|
|
147
165
|
isTrusted: {
|
|
148
|
-
enabledCommands: [
|
|
166
|
+
enabledCommands: [TerminalChatCommandId.OpenTerminalSettingsLink]
|
|
149
167
|
}
|
|
150
168
|
};
|
|
151
169
|
const config = this._configurationService.inspect(ChatConfiguration.GlobalAutoApprove);
|
|
152
170
|
const isGlobalAutoApproved = config?.value ?? config.defaultValue;
|
|
153
171
|
if (isGlobalAutoApproved) {
|
|
154
|
-
const settingsUri = createCommandUri(
|
|
172
|
+
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, 'global');
|
|
155
173
|
return (new MarkdownString(`${( localize(
|
|
156
|
-
|
|
174
|
+
12001,
|
|
157
175
|
'Auto approved by setting {0}',
|
|
158
|
-
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(
|
|
176
|
+
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(12002, 'View settings'))}")`
|
|
159
177
|
))}`, mdTrustSettings));
|
|
160
178
|
}
|
|
161
179
|
if (isAutoApproved) {
|
|
@@ -163,7 +181,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
163
181
|
case 'commandLine': {
|
|
164
182
|
if (commandLineResult.rule) {
|
|
165
183
|
return (new MarkdownString(
|
|
166
|
-
localize(
|
|
184
|
+
localize(12003, 'Auto approved by rule {0}', formatRuleLinks(commandLineResult)),
|
|
167
185
|
mdTrustSettings
|
|
168
186
|
));
|
|
169
187
|
}
|
|
@@ -173,13 +191,13 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
173
191
|
const uniqueRules = dedupeRules(subCommandResults);
|
|
174
192
|
if (uniqueRules.length === 1) {
|
|
175
193
|
return (new MarkdownString(
|
|
176
|
-
localize(
|
|
194
|
+
localize(12003, 'Auto approved by rule {0}', formatRuleLinks(uniqueRules)),
|
|
177
195
|
mdTrustSettings
|
|
178
196
|
));
|
|
179
197
|
}
|
|
180
198
|
else if (uniqueRules.length > 1) {
|
|
181
199
|
return (new MarkdownString(
|
|
182
|
-
localize(
|
|
200
|
+
localize(12004, 'Auto approved by rules {0}', formatRuleLinks(uniqueRules)),
|
|
183
201
|
mdTrustSettings
|
|
184
202
|
));
|
|
185
203
|
}
|
|
@@ -192,7 +210,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
192
210
|
case 'commandLine': {
|
|
193
211
|
if (commandLineResult.rule) {
|
|
194
212
|
return (new MarkdownString(localize(
|
|
195
|
-
|
|
213
|
+
12005,
|
|
196
214
|
'Auto approval denied by rule {0}',
|
|
197
215
|
formatRuleLinks(commandLineResult)
|
|
198
216
|
), mdTrustSettings));
|
|
@@ -203,12 +221,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
203
221
|
const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === 'denied'));
|
|
204
222
|
if (uniqueRules.length === 1) {
|
|
205
223
|
return (new MarkdownString(
|
|
206
|
-
localize(
|
|
224
|
+
localize(12005, 'Auto approval denied by rule {0}', formatRuleLinks(uniqueRules))
|
|
207
225
|
));
|
|
208
226
|
}
|
|
209
227
|
else if (uniqueRules.length > 1) {
|
|
210
228
|
return (new MarkdownString(
|
|
211
|
-
localize(
|
|
229
|
+
localize(12006, 'Auto approval denied by rules {0}', formatRuleLinks(uniqueRules))
|
|
212
230
|
));
|
|
213
231
|
}
|
|
214
232
|
break;
|
|
@@ -221,7 +239,8 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
221
239
|
CommandLineAutoApproveAnalyzer = ( __decorate([
|
|
222
240
|
( __param(3, IConfigurationService)),
|
|
223
241
|
( __param(4, IInstantiationService)),
|
|
224
|
-
( __param(5, IStorageService))
|
|
242
|
+
( __param(5, IStorageService)),
|
|
243
|
+
( __param(6, ITerminalChatService))
|
|
225
244
|
], CommandLineAutoApproveAnalyzer));
|
|
226
245
|
|
|
227
246
|
export { CommandLineAutoApproveAnalyzer };
|
|
@@ -13,5 +13,6 @@ export declare class CommandLineFileWriteAnalyzer extends Disposable implements
|
|
|
13
13
|
constructor(_treeSitterCommandParser: TreeSitterCommandParser, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, _labelService: ILabelService, _workspaceContextService: IWorkspaceContextService);
|
|
14
14
|
analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
|
|
15
15
|
private _getFileWrites;
|
|
16
|
+
private _mapNullDevice;
|
|
16
17
|
private _getResult;
|
|
17
18
|
}
|
|
@@ -6,11 +6,13 @@ import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common
|
|
|
6
6
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
7
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
8
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.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
|
+
import { TreeSitterCommandParserLanguage } from '../../treeSitterCommandParser.js';
|
|
10
11
|
import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
11
12
|
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
12
13
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
13
14
|
|
|
15
|
+
const nullDevice = Symbol('null device');
|
|
14
16
|
let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Disposable {
|
|
15
17
|
constructor(_treeSitterCommandParser, _log, _configurationService, _labelService, _workspaceContextService) {
|
|
16
18
|
super();
|
|
@@ -36,12 +38,16 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
36
38
|
}
|
|
37
39
|
async _getFileWrites(options) {
|
|
38
40
|
let fileWrites = [];
|
|
39
|
-
const capturedFileWrites = await this._treeSitterCommandParser.getFileWrites(options.treeSitterLanguage, options.commandLine)
|
|
41
|
+
const capturedFileWrites = ( (await this._treeSitterCommandParser.getFileWrites(options.treeSitterLanguage, options.commandLine))
|
|
42
|
+
.map(this._mapNullDevice.bind(this, options)));
|
|
40
43
|
if (capturedFileWrites.length) {
|
|
41
44
|
const cwd = options.cwd;
|
|
42
45
|
if (cwd) {
|
|
43
46
|
this._log('Detected cwd', ( cwd.toString()));
|
|
44
47
|
fileWrites = ( capturedFileWrites.map(e => {
|
|
48
|
+
if (e === nullDevice) {
|
|
49
|
+
return e;
|
|
50
|
+
}
|
|
45
51
|
const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(e) : posix.isAbsolute(e);
|
|
46
52
|
if (isAbsolute) {
|
|
47
53
|
return URI.file(e);
|
|
@@ -59,6 +65,16 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
59
65
|
this._log('File writes detected', ( fileWrites.map(e => ( e.toString()))));
|
|
60
66
|
return fileWrites;
|
|
61
67
|
}
|
|
68
|
+
_mapNullDevice(options, rawFileWrite) {
|
|
69
|
+
if (options.treeSitterLanguage === TreeSitterCommandParserLanguage.PowerShell) {
|
|
70
|
+
return rawFileWrite === '$null'
|
|
71
|
+
? nullDevice
|
|
72
|
+
: rawFileWrite;
|
|
73
|
+
}
|
|
74
|
+
return rawFileWrite === '/dev/null'
|
|
75
|
+
? nullDevice
|
|
76
|
+
: rawFileWrite;
|
|
77
|
+
}
|
|
62
78
|
_getResult(options, fileWrites) {
|
|
63
79
|
let isAutoApproveAllowed = true;
|
|
64
80
|
if (fileWrites.length > 0) {
|
|
@@ -73,6 +89,10 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
73
89
|
const workspaceFolders = this._workspaceContextService.getWorkspace().folders;
|
|
74
90
|
if (workspaceFolders.length > 0) {
|
|
75
91
|
for (const fileWrite of fileWrites) {
|
|
92
|
+
if (fileWrite === nullDevice) {
|
|
93
|
+
this._log('File write to null device allowed', URI.isUri(fileWrite) ? ( fileWrite.toString()) : fileWrite);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
76
96
|
if (isString(fileWrite)) {
|
|
77
97
|
const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(fileWrite) : posix.isAbsolute(fileWrite);
|
|
78
98
|
if (!isAbsolute) {
|
|
@@ -97,8 +117,11 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
97
117
|
}
|
|
98
118
|
}
|
|
99
119
|
else {
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
const hasOnlyNullDevices = fileWrites.every(fw => fw === nullDevice);
|
|
121
|
+
if (!hasOnlyNullDevices) {
|
|
122
|
+
isAutoApproveAllowed = false;
|
|
123
|
+
this._log('File writes blocked - no workspace folders');
|
|
124
|
+
}
|
|
102
125
|
}
|
|
103
126
|
break;
|
|
104
127
|
}
|
|
@@ -106,16 +129,18 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
106
129
|
}
|
|
107
130
|
const disclaimers = [];
|
|
108
131
|
if (fileWrites.length > 0) {
|
|
109
|
-
const fileWritesList = ( fileWrites.map(
|
|
132
|
+
const fileWritesList = ( fileWrites.map(
|
|
133
|
+
fw => `\`${URI.isUri(fw) ? this._labelService.getUriLabel(fw) : fw === nullDevice ? '/dev/null' : ( fw.toString())}\``
|
|
134
|
+
)).join(', ');
|
|
110
135
|
if (!isAutoApproveAllowed) {
|
|
111
136
|
disclaimers.push(( localize(
|
|
112
|
-
|
|
137
|
+
12007,
|
|
113
138
|
'File write operations detected that cannot be auto approved: {0}',
|
|
114
139
|
fileWritesList
|
|
115
140
|
)));
|
|
116
141
|
}
|
|
117
142
|
else {
|
|
118
|
-
disclaimers.push(( localize(
|
|
143
|
+
disclaimers.push(( localize(12008, 'File write operations detected: {0}', fileWritesList)));
|
|
119
144
|
}
|
|
120
145
|
}
|
|
121
146
|
return {
|
|
@@ -3,14 +3,15 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
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
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { TerminalCapability } from '@codingame/monaco-vscode-
|
|
6
|
+
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
7
7
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
8
8
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
9
9
|
|
|
10
10
|
const GetTerminalLastCommandToolData = {
|
|
11
11
|
id: 'terminal_last_command',
|
|
12
12
|
toolReferenceName: 'terminalLastCommand',
|
|
13
|
-
|
|
13
|
+
legacyToolReferenceFullNames: ['runCommands/terminalLastCommand'],
|
|
14
|
+
displayName: ( localize(12009, 'Get Terminal Last Command')),
|
|
14
15
|
modelDescription: 'Get the last command run in the active terminal.',
|
|
15
16
|
source: ToolDataSource.Internal,
|
|
16
17
|
icon: Codicon.terminal,
|
|
@@ -22,8 +23,8 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
22
23
|
}
|
|
23
24
|
async prepareToolInvocation(context, token) {
|
|
24
25
|
return {
|
|
25
|
-
invocationMessage: ( localize(
|
|
26
|
-
pastTenseMessage: ( localize(
|
|
26
|
+
invocationMessage: ( localize(12010, "Getting last terminal command")),
|
|
27
|
+
pastTenseMessage: ( localize(12011, "Got last terminal command")),
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -8,7 +8,8 @@ import { RunInTerminalTool } from './runInTerminalTool.js';
|
|
|
8
8
|
const GetTerminalOutputToolData = {
|
|
9
9
|
id: 'get_terminal_output',
|
|
10
10
|
toolReferenceName: 'getTerminalOutput',
|
|
11
|
-
|
|
11
|
+
legacyToolReferenceFullNames: ['runCommands/getTerminalOutput'],
|
|
12
|
+
displayName: ( localize(12012, 'Get Terminal Output')),
|
|
12
13
|
modelDescription: 'Get the output of a terminal command previously started with run_in_terminal',
|
|
13
14
|
icon: Codicon.terminal,
|
|
14
15
|
source: ToolDataSource.Internal,
|
|
@@ -28,8 +29,8 @@ const GetTerminalOutputToolData = {
|
|
|
28
29
|
class GetTerminalOutputTool extends Disposable {
|
|
29
30
|
async prepareToolInvocation(context, token) {
|
|
30
31
|
return {
|
|
31
|
-
invocationMessage: ( localize(
|
|
32
|
-
pastTenseMessage: ( localize(
|
|
32
|
+
invocationMessage: ( localize(12013, "Checking background terminal output")),
|
|
33
|
+
pastTenseMessage: ( localize(12014, "Checked background terminal output")),
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -9,7 +9,8 @@ import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workben
|
|
|
9
9
|
const GetTerminalSelectionToolData = {
|
|
10
10
|
id: 'terminal_selection',
|
|
11
11
|
toolReferenceName: 'terminalSelection',
|
|
12
|
-
|
|
12
|
+
legacyToolReferenceFullNames: ['runCommands/terminalSelection'],
|
|
13
|
+
displayName: ( localize(12015, 'Get Terminal Selection')),
|
|
13
14
|
modelDescription: 'Get the current selection in the active terminal.',
|
|
14
15
|
source: ToolDataSource.Internal,
|
|
15
16
|
icon: Codicon.terminal,
|
|
@@ -21,8 +22,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
21
22
|
}
|
|
22
23
|
async prepareToolInvocation(context, token) {
|
|
23
24
|
return {
|
|
24
|
-
invocationMessage: ( localize(
|
|
25
|
-
pastTenseMessage: ( localize(
|
|
25
|
+
invocationMessage: ( localize(12016, "Reading terminal selection")),
|
|
26
|
+
pastTenseMessage: ( localize(12017, "Read terminal selection")),
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
async invoke(invocation, _countTokens, _progress, token) {
|