@codingame/monaco-vscode-chat-service-override 22.1.9 → 23.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +17 -8
- package/package.json +43 -40
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +57 -48
- 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 +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +26 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +51 -5
- 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.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.d.ts → chatNewActions.d.ts} +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.js → chatNewActions.js} +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +101 -98
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +35 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +43 -25
- 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 +34 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +154 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +290 -231
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +6 -6
- 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 +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +113 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +646 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +46 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +17 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +44 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +46 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +45 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +30 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +60 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +60 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +29 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +365 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +3 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +58 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +5 -4
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +6 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +7 -11
- 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 +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +38 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +83 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +370 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +349 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +787 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +211 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +21 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +54 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +31 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +16 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +29 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +37 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +15 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +96 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +66 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +77 -71
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +91 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +458 -138
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +212 -150
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +96 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +15 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +33 -17
- 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 +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +126 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +38 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +28 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +24 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +25 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +30 -29
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +10 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +61 -43
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +28 -28
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +254 -165
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +10 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +20 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +13 -17
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +51 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +7 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +74 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +83 -53
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +136 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +18 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +357 -157
- 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 +55 -28
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +235 -108
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +50 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- 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/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +11 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +13 -15
- 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 +20 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +63 -140
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +17 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- 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 +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +119 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +6 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +192 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +21 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +8 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +18 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +24 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +33 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +42 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +14 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +227 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +133 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +75 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +28 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +366 -363
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +123 -0
- package/vscode/src/vs/base/common/yaml.d.ts +0 -74
- package/vscode/src/vs/base/common/yaml.js +0 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +0 -239
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +0 -435
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +0 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -380
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +0 -137
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +0 -176
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +0 -206
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +0 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +0 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +0 -306
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +0 -102
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.d.ts +0 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.js +0 -247
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +0 -55
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +0 -66
|
@@ -57,7 +57,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
57
57
|
await this._fileService.writeFile(tasksJsonUri, VSBuffer.fromString(JSON.stringify(tasksJson, null, '\t')));
|
|
58
58
|
_progress.report({ message: 'Updated tasks.json file' });
|
|
59
59
|
}
|
|
60
|
-
_progress.report({ message: ( new MarkdownString(( localize(
|
|
60
|
+
_progress.report({ message: ( new MarkdownString(( localize(11871, 'Resolving the task')))) });
|
|
61
61
|
let task;
|
|
62
62
|
const start = Date.now();
|
|
63
63
|
while (Date.now() - start < 5000 && !token.isCancellationRequested) {
|
|
@@ -68,9 +68,9 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
68
68
|
await timeout(100);
|
|
69
69
|
}
|
|
70
70
|
if (!task) {
|
|
71
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
71
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(11872, 'Task not found: `{0}`', args.task.label)))) };
|
|
72
72
|
}
|
|
73
|
-
_progress.report({ message: ( new MarkdownString(( localize(
|
|
73
|
+
_progress.report({ message: ( new MarkdownString(( localize(11873, 'Running task `{0}`', args.task.label)))) });
|
|
74
74
|
const raceResult = await Promise.race([this._tasksService.run(task, undefined, TaskRunSource.ChatAgent), timeout(3000)]);
|
|
75
75
|
const result = raceResult && typeof raceResult === 'object' ? raceResult : undefined;
|
|
76
76
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
@@ -78,13 +78,13 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
78
78
|
const terminals = resources?.map(resource => this._terminalService.instances.find(t => t.resource.path === resource?.path && t.resource.scheme === resource.scheme)).filter(Boolean);
|
|
79
79
|
if (!terminals || terminals.length === 0) {
|
|
80
80
|
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${args.task.label}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
81
|
-
|
|
81
|
+
11874,
|
|
82
82
|
'Task started but no terminal was found for: `{0}`',
|
|
83
83
|
args.task.label
|
|
84
84
|
)))) };
|
|
85
85
|
}
|
|
86
86
|
const store = ( new DisposableStore());
|
|
87
|
-
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, () => this._isTaskActive(
|
|
87
|
+
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks);
|
|
88
88
|
store.dispose();
|
|
89
89
|
for (const r of terminalResults) {
|
|
90
90
|
this._telemetryService.publicLog2?.('copilotChat.runTaskTool.createAndRunTask', {
|
|
@@ -111,7 +111,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
111
111
|
}
|
|
112
112
|
async _isTaskActive(task) {
|
|
113
113
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
114
|
-
return activeTasks?.
|
|
114
|
+
return activeTasks?.some((t) => t._id === task._id);
|
|
115
115
|
}
|
|
116
116
|
async prepareToolInvocation(context, token) {
|
|
117
117
|
const args = context.parameters;
|
|
@@ -119,27 +119,27 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
|
|
|
119
119
|
const allTasks = await this._tasksService.tasks();
|
|
120
120
|
if (allTasks?.find(t => t._label === task.label)) {
|
|
121
121
|
return {
|
|
122
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
123
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
122
|
+
invocationMessage: ( new MarkdownString(( localize(11875, 'Task `{0}` already exists.', task.label)))),
|
|
123
|
+
pastTenseMessage: ( new MarkdownString(( localize(11876, 'Task `{0}` already exists.', task.label)))),
|
|
124
124
|
confirmationMessages: undefined
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
128
128
|
if (activeTasks.find(t => t._label === task.label)) {
|
|
129
129
|
return {
|
|
130
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
131
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
130
|
+
invocationMessage: ( new MarkdownString(( localize(11877, 'Task \`{0}\` is already running.', task.label)))),
|
|
131
|
+
pastTenseMessage: ( new MarkdownString(( localize(11877, 'Task \`{0}\` is already running.', task.label)))),
|
|
132
132
|
confirmationMessages: undefined
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
return {
|
|
136
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
137
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
136
|
+
invocationMessage: ( new MarkdownString(( localize(11878, 'Created task \`{0}\`', task.label)))),
|
|
137
|
+
pastTenseMessage: ( new MarkdownString(( localize(11879, 'Created task \`{0}\`', task.label)))),
|
|
138
138
|
confirmationMessages: {
|
|
139
|
-
title: ( localize(
|
|
139
|
+
title: ( localize(11880, 'Allow task creation and execution?')),
|
|
140
140
|
message: ( new MarkdownString(( localize(
|
|
141
|
-
|
|
142
|
-
'
|
|
141
|
+
11881,
|
|
142
|
+
'A task \`{0}\` with command \`{1}\`{2} will be created.',
|
|
143
143
|
task.label,
|
|
144
144
|
task.command,
|
|
145
145
|
task.args?.length ? ` and args \`${task.args.join(' ')}\`` : ''
|
|
@@ -159,12 +159,12 @@ CreateAndRunTaskTool = ( __decorate([
|
|
|
159
159
|
const CreateAndRunTaskToolData = {
|
|
160
160
|
id: 'create_and_run_task',
|
|
161
161
|
toolReferenceName: 'createAndRunTask',
|
|
162
|
-
displayName: ( localize(
|
|
162
|
+
displayName: ( localize(11882, 'Create and run Task')),
|
|
163
163
|
modelDescription: ( localize(
|
|
164
|
-
|
|
164
|
+
11883,
|
|
165
165
|
'Creates and runs a build, run, or custom task for the workspace by generating or adding to a tasks.json file based on the project structure (such as package.json or README.md). If the user asks to build, run, launch and they have no tasks.json file, use this tool. If they ask to create or add a task, use this tool.'
|
|
166
166
|
)),
|
|
167
|
-
userDescription: ( localize(
|
|
167
|
+
userDescription: ( localize(11884, "Create and run a task in the workspace")),
|
|
168
168
|
source: ToolDataSource.Internal,
|
|
169
169
|
inputSchema: {
|
|
170
170
|
'type': 'object',
|
|
@@ -16,7 +16,7 @@ import { toolResultDetailsFromResponse, toolResultMessageFromResponse } from './
|
|
|
16
16
|
const GetTaskOutputToolData = {
|
|
17
17
|
id: 'get_task_output',
|
|
18
18
|
toolReferenceName: 'getTaskOutput',
|
|
19
|
-
displayName: ( localize(
|
|
19
|
+
displayName: ( localize(11885, 'Get Task Output')),
|
|
20
20
|
modelDescription: 'Get the output of a task',
|
|
21
21
|
source: ToolDataSource.Internal,
|
|
22
22
|
when: TasksAvailableContext,
|
|
@@ -52,16 +52,16 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
52
52
|
const taskDefinition = getTaskDefinition(args.id);
|
|
53
53
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
54
54
|
if (!task) {
|
|
55
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
55
|
+
return { invocationMessage: ( new MarkdownString(( localize(11886, 'Task not found: `{0}`', args.id)))) };
|
|
56
56
|
}
|
|
57
57
|
const taskLabel = task._label;
|
|
58
58
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
59
59
|
if (activeTasks.includes(task)) {
|
|
60
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
60
|
+
return { invocationMessage: ( new MarkdownString(( localize(11887, 'The task `{0}` is already running.', taskLabel)))) };
|
|
61
61
|
}
|
|
62
62
|
return {
|
|
63
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
64
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
63
|
+
invocationMessage: ( new MarkdownString(( localize(11888, 'Checking output for task `{0}`', taskLabel)))),
|
|
64
|
+
pastTenseMessage: ( new MarkdownString(( localize(11889, 'Checked output for task `{0}`', taskLabel)))),
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -69,17 +69,17 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
69
69
|
const taskDefinition = getTaskDefinition(args.id);
|
|
70
70
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
71
71
|
if (!task) {
|
|
72
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
72
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(11886, 'Task not found: `{0}`', args.id)))) };
|
|
73
73
|
}
|
|
74
74
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
75
75
|
const resources = this._tasksService.getTerminalsForTasks(dependencyTasks ?? task);
|
|
76
76
|
const taskLabel = task._label;
|
|
77
77
|
const terminals = resources?.map(resource => this._terminalService.instances.find(t => t.resource.path === resource?.path && t.resource.scheme === resource.scheme)).filter(t => !!t);
|
|
78
78
|
if (!terminals || terminals.length === 0) {
|
|
79
|
-
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
79
|
+
return { content: [{ kind: 'text', value: `Terminal not found for task ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(11890, 'Terminal not found for task `{0}`', taskLabel)))) };
|
|
80
80
|
}
|
|
81
81
|
const store = ( new DisposableStore());
|
|
82
|
-
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, () => this._isTaskActive(
|
|
82
|
+
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks);
|
|
83
83
|
store.dispose();
|
|
84
84
|
for (const r of terminalResults) {
|
|
85
85
|
this._telemetryService.publicLog2?.('copilotChat.getTaskOutputTool.get', {
|
|
@@ -106,7 +106,7 @@ let GetTaskOutputTool = class GetTaskOutputTool extends Disposable {
|
|
|
106
106
|
}
|
|
107
107
|
async _isTaskActive(task) {
|
|
108
108
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
109
|
-
return activeTasks?.
|
|
109
|
+
return activeTasks?.some((t) => t._id === task._id);
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
GetTaskOutputTool = ( __decorate([
|
|
@@ -32,26 +32,26 @@ let RunTaskTool = class RunTaskTool {
|
|
|
32
32
|
const taskDefinition = getTaskDefinition(args.id);
|
|
33
33
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
34
34
|
if (!task) {
|
|
35
|
-
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
35
|
+
return { content: [{ kind: 'text', value: `Task not found: ${args.id}` }], toolResultMessage: ( new MarkdownString(( localize(11891, 'Task not found: `{0}`', args.id)))) };
|
|
36
36
|
}
|
|
37
37
|
const taskLabel = task._label;
|
|
38
38
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
39
39
|
if (activeTasks.includes(task)) {
|
|
40
|
-
return { content: [{ kind: 'text', value: `The task ${taskLabel} is already running.` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
40
|
+
return { content: [{ kind: 'text', value: `The task ${taskLabel} is already running.` }], toolResultMessage: ( new MarkdownString(( localize(11892, 'The task `{0}` is already running.', taskLabel)))) };
|
|
41
41
|
}
|
|
42
42
|
const raceResult = await Promise.race([this._tasksService.run(task, undefined, TaskRunSource.ChatAgent), timeout(3000)]);
|
|
43
43
|
const result = raceResult && typeof raceResult === 'object' ? raceResult : undefined;
|
|
44
44
|
const dependencyTasks = await resolveDependencyTasks(task, args.workspaceFolder, this._configurationService, this._tasksService);
|
|
45
45
|
const resources = this._tasksService.getTerminalsForTasks(dependencyTasks ?? task);
|
|
46
46
|
if (!resources || resources.length === 0) {
|
|
47
|
-
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
47
|
+
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(11893, 'Task started but no terminal was found for: `{0}`', taskLabel)))) };
|
|
48
48
|
}
|
|
49
49
|
const terminals = this._terminalService.instances.filter(t => ( resources.some(r => r.path === t.resource.path && r.scheme === t.resource.scheme)));
|
|
50
50
|
if (terminals.length === 0) {
|
|
51
|
-
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(
|
|
51
|
+
return { content: [{ kind: 'text', value: `Task started but no terminal was found for: ${taskLabel}` }], toolResultMessage: ( new MarkdownString(( localize(11893, 'Task started but no terminal was found for: `{0}`', taskLabel)))) };
|
|
52
52
|
}
|
|
53
53
|
const store = ( new DisposableStore());
|
|
54
|
-
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, () => this._isTaskActive(
|
|
54
|
+
const terminalResults = await collectTerminalResults(terminals, task, this._instantiationService, invocation.context, _progress, token, store, (terminalTask) => this._isTaskActive(terminalTask), dependencyTasks);
|
|
55
55
|
store.dispose();
|
|
56
56
|
for (const r of terminalResults) {
|
|
57
57
|
this._telemetryService.publicLog2?.('copilotChat.runTaskTool.run', {
|
|
@@ -78,34 +78,34 @@ let RunTaskTool = class RunTaskTool {
|
|
|
78
78
|
}
|
|
79
79
|
async _isTaskActive(task) {
|
|
80
80
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
81
|
-
return Promise.resolve(activeTasks?.
|
|
81
|
+
return Promise.resolve(activeTasks?.some((t) => t._id === task._id));
|
|
82
82
|
}
|
|
83
83
|
async prepareToolInvocation(context, token) {
|
|
84
84
|
const args = context.parameters;
|
|
85
85
|
const taskDefinition = getTaskDefinition(args.id);
|
|
86
86
|
const task = await getTaskForTool(args.id, taskDefinition, args.workspaceFolder, this._configurationService, this._tasksService, true);
|
|
87
87
|
if (!task) {
|
|
88
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
88
|
+
return { invocationMessage: ( new MarkdownString(( localize(11891, 'Task not found: `{0}`', args.id)))) };
|
|
89
89
|
}
|
|
90
90
|
const taskLabel = task._label;
|
|
91
91
|
const activeTasks = await this._tasksService.getActiveTasks();
|
|
92
92
|
if (task && activeTasks.includes(task)) {
|
|
93
|
-
return { invocationMessage: ( new MarkdownString(( localize(
|
|
93
|
+
return { invocationMessage: ( new MarkdownString(( localize(11894, 'The task is already running.')))) };
|
|
94
94
|
}
|
|
95
95
|
if (await this._isTaskActive(task)) {
|
|
96
96
|
return {
|
|
97
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
98
|
-
pastTenseMessage: ( new MarkdownString(( localize(
|
|
97
|
+
invocationMessage: ( new MarkdownString(( localize(11895, '`{0}` is already running.', taskLabel)))),
|
|
98
|
+
pastTenseMessage: ( new MarkdownString(( localize(11896, '`{0}` was already running.', taskLabel)))),
|
|
99
99
|
confirmationMessages: undefined
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
return {
|
|
103
|
-
invocationMessage: ( new MarkdownString(( localize(
|
|
103
|
+
invocationMessage: ( new MarkdownString(( localize(11897, 'Running `{0}`', taskLabel)))),
|
|
104
104
|
pastTenseMessage: ( new MarkdownString(task?.configurationProperties.isBackground
|
|
105
|
-
? ( localize(
|
|
106
|
-
: ( localize(
|
|
105
|
+
? ( localize(11898, 'Started `{0}`', taskLabel))
|
|
106
|
+
: ( localize(11899, 'Ran `{0}`', taskLabel)))),
|
|
107
107
|
confirmationMessages: task
|
|
108
|
-
? { title: ( localize(
|
|
108
|
+
? { title: ( localize(11900, 'Allow task run?')), message: ( localize(11901, 'Allow to run the task `{0}`?', taskLabel)) }
|
|
109
109
|
: undefined
|
|
110
110
|
};
|
|
111
111
|
}
|
|
@@ -120,9 +120,9 @@ RunTaskTool = ( __decorate([
|
|
|
120
120
|
const RunTaskToolData = {
|
|
121
121
|
id: 'run_task',
|
|
122
122
|
toolReferenceName: 'runTask',
|
|
123
|
-
displayName: ( localize(
|
|
123
|
+
displayName: ( localize(11902, 'Run Task')),
|
|
124
124
|
modelDescription: 'Runs a VS Code task.\n\n- If you see that an appropriate task exists for building or running code, prefer to use this tool to run the task instead of using the run_in_terminal tool.\n- Make sure that any appropriate build or watch task is running before trying to run tests or execute code.\n- If the user asks to run a task, use this tool to do so.',
|
|
125
|
-
userDescription: ( localize(
|
|
125
|
+
userDescription: ( localize(11903, 'Tool for running tasks in the workspace')),
|
|
126
126
|
icon: Codicon.tools,
|
|
127
127
|
source: ToolDataSource.Internal,
|
|
128
128
|
when: TasksAvailableContext,
|
|
@@ -17,7 +17,7 @@ function toolResultDetailsFromResponse(terminalResults) {
|
|
|
17
17
|
function toolResultMessageFromResponse(result, taskLabel, toolResultDetails, terminalResults, getOutputTool) {
|
|
18
18
|
let resultSummary = '';
|
|
19
19
|
if (result?.exitCode) {
|
|
20
|
-
resultSummary = ( localize(
|
|
20
|
+
resultSummary = ( localize(11904, 'Task `{0}` failed with exit code {1}.', taskLabel, result.exitCode));
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
resultSummary += `\`${taskLabel}\` task `;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { QueryCapture } from "@vscode/tree-sitter-wasm";
|
|
2
|
+
import { ITreeSitterLibraryService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/treeSitter/treeSitterLibraryService.service";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
export declare enum TreeSitterCommandParserLanguage {
|
|
5
|
+
Bash = "bash",
|
|
6
|
+
PowerShell = "powershell"
|
|
7
|
+
}
|
|
8
|
+
export declare class TreeSitterCommandParser extends Disposable {
|
|
9
|
+
private readonly _treeSitterLibraryService;
|
|
10
|
+
private readonly _parser;
|
|
11
|
+
private readonly _treeCache;
|
|
12
|
+
constructor(_treeSitterLibraryService: ITreeSitterLibraryService);
|
|
13
|
+
extractSubCommands(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<string[]>;
|
|
14
|
+
extractPwshDoubleAmpersandChainOperators(commandLine: string): Promise<QueryCapture[]>;
|
|
15
|
+
getFileWrites(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<string[]>;
|
|
16
|
+
private _queryTree;
|
|
17
|
+
private _doQuery;
|
|
18
|
+
private _throwIfCanCrash;
|
|
19
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { BugIndicatingError, ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
+
import { arch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/process';
|
|
5
|
+
import { ITreeSitterLibraryService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/treeSitter/treeSitterLibraryService.service';
|
|
6
|
+
import { Disposable, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
8
|
+
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
9
|
+
import { isWindows } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
10
|
+
|
|
11
|
+
var TreeSitterCommandParserLanguage;
|
|
12
|
+
(function (TreeSitterCommandParserLanguage) {
|
|
13
|
+
TreeSitterCommandParserLanguage["Bash"] = "bash";
|
|
14
|
+
TreeSitterCommandParserLanguage["PowerShell"] = "powershell";
|
|
15
|
+
})(TreeSitterCommandParserLanguage || (TreeSitterCommandParserLanguage = {}));
|
|
16
|
+
let TreeSitterCommandParser = class TreeSitterCommandParser extends Disposable {
|
|
17
|
+
constructor(_treeSitterLibraryService) {
|
|
18
|
+
super();
|
|
19
|
+
this._treeSitterLibraryService = _treeSitterLibraryService;
|
|
20
|
+
this._treeCache = this._register(( new TreeCache()));
|
|
21
|
+
this._parser = ( new Lazy(
|
|
22
|
+
() => this._treeSitterLibraryService.getParserClass().then(ParserCtor => ( new ParserCtor()))
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
async extractSubCommands(languageId, commandLine) {
|
|
26
|
+
const captures = await this._queryTree(languageId, commandLine, '(command) @command');
|
|
27
|
+
return ( captures.map(e => e.node.text));
|
|
28
|
+
}
|
|
29
|
+
async extractPwshDoubleAmpersandChainOperators(commandLine) {
|
|
30
|
+
const captures = await this._queryTree(TreeSitterCommandParserLanguage.PowerShell, commandLine, [
|
|
31
|
+
'(',
|
|
32
|
+
' (command',
|
|
33
|
+
' (command_elements',
|
|
34
|
+
' (generic_token) @double.ampersand',
|
|
35
|
+
' (#eq? @double.ampersand "&&")))',
|
|
36
|
+
')',
|
|
37
|
+
].join('\n'));
|
|
38
|
+
return captures;
|
|
39
|
+
}
|
|
40
|
+
async getFileWrites(languageId, commandLine) {
|
|
41
|
+
let query;
|
|
42
|
+
switch (languageId) {
|
|
43
|
+
case TreeSitterCommandParserLanguage.Bash:
|
|
44
|
+
query = [
|
|
45
|
+
'(file_redirect',
|
|
46
|
+
' destination: [(word) (string (string_content)) (raw_string) (concatenation)] @file)',
|
|
47
|
+
].join('\n');
|
|
48
|
+
break;
|
|
49
|
+
case TreeSitterCommandParserLanguage.PowerShell:
|
|
50
|
+
query = [
|
|
51
|
+
'(redirection',
|
|
52
|
+
' (redirected_file_name) @file)',
|
|
53
|
+
].join('\n');
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
const captures = await this._queryTree(languageId, commandLine, query);
|
|
57
|
+
return ( captures.map(e => e.node.text.trim()));
|
|
58
|
+
}
|
|
59
|
+
async _queryTree(languageId, commandLine, querySource) {
|
|
60
|
+
const { tree, query } = await this._doQuery(languageId, commandLine, querySource);
|
|
61
|
+
return query.captures(tree.rootNode);
|
|
62
|
+
}
|
|
63
|
+
async _doQuery(languageId, commandLine, querySource) {
|
|
64
|
+
this._throwIfCanCrash(languageId);
|
|
65
|
+
const language = await this._treeSitterLibraryService.getLanguagePromise(languageId);
|
|
66
|
+
if (!language) {
|
|
67
|
+
throw ( new BugIndicatingError('Failed to fetch language grammar'));
|
|
68
|
+
}
|
|
69
|
+
let tree = this._treeCache.get(languageId, commandLine);
|
|
70
|
+
if (!tree) {
|
|
71
|
+
const parser = await this._parser.value;
|
|
72
|
+
parser.setLanguage(language);
|
|
73
|
+
const parsedTree = parser.parse(commandLine);
|
|
74
|
+
if (!parsedTree) {
|
|
75
|
+
throw ( new ErrorNoTelemetry('Failed to parse tree'));
|
|
76
|
+
}
|
|
77
|
+
tree = parsedTree;
|
|
78
|
+
this._treeCache.set(languageId, commandLine, tree);
|
|
79
|
+
}
|
|
80
|
+
const query = await this._treeSitterLibraryService.createQuery(language, querySource);
|
|
81
|
+
if (!query) {
|
|
82
|
+
throw ( new BugIndicatingError('Failed to create tree sitter query'));
|
|
83
|
+
}
|
|
84
|
+
return { tree, query };
|
|
85
|
+
}
|
|
86
|
+
_throwIfCanCrash(languageId) {
|
|
87
|
+
if (isWindows &&
|
|
88
|
+
(arch === 'arm' || arch === 'arm64') &&
|
|
89
|
+
languageId === TreeSitterCommandParserLanguage.PowerShell) {
|
|
90
|
+
throw ( new ErrorNoTelemetry('powershell grammar is not supported on arm or arm64'));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
TreeSitterCommandParser = ( __decorate([
|
|
95
|
+
( __param(0, ITreeSitterLibraryService))
|
|
96
|
+
], TreeSitterCommandParser));
|
|
97
|
+
class TreeCache extends Disposable {
|
|
98
|
+
constructor() {
|
|
99
|
+
super();
|
|
100
|
+
this._cache = ( new Map());
|
|
101
|
+
this._clearScheduler = this._register(( new MutableDisposable()));
|
|
102
|
+
this._register(toDisposable(() => this._cache.clear()));
|
|
103
|
+
}
|
|
104
|
+
get(languageId, commandLine) {
|
|
105
|
+
this._resetClearTimer();
|
|
106
|
+
return this._cache.get(this._getCacheKey(languageId, commandLine));
|
|
107
|
+
}
|
|
108
|
+
set(languageId, commandLine, tree) {
|
|
109
|
+
this._resetClearTimer();
|
|
110
|
+
this._cache.set(this._getCacheKey(languageId, commandLine), tree);
|
|
111
|
+
}
|
|
112
|
+
_getCacheKey(languageId, commandLine) {
|
|
113
|
+
return `${languageId}:${commandLine}`;
|
|
114
|
+
}
|
|
115
|
+
_resetClearTimer() {
|
|
116
|
+
this._clearScheduler.value = ( new RunOnceScheduler(() => {
|
|
117
|
+
this._cache.clear();
|
|
118
|
+
}, 10000));
|
|
119
|
+
this._clearScheduler.value.schedule();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { TreeSitterCommandParser, TreeSitterCommandParserLanguage };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses a simplified YAML-like input from a single string.
|
|
3
|
-
* Supports objects, arrays, primitive types (string, number, boolean, null).
|
|
4
|
-
* Tracks positions for error reporting and node locations.
|
|
5
|
-
*
|
|
6
|
-
* Limitations:
|
|
7
|
-
* - No multi-line strings or block literals
|
|
8
|
-
* - No anchors or references
|
|
9
|
-
* - No complex types (dates, binary)
|
|
10
|
-
* - No special handling for escape sequences in strings
|
|
11
|
-
* - Indentation must be consistent (spaces only, no tabs)
|
|
12
|
-
*
|
|
13
|
-
* Notes:
|
|
14
|
-
* - New line separators can be either "\n" or "\r\n". The input string is split into lines internally.
|
|
15
|
-
*
|
|
16
|
-
* @param input A string containing the YAML-like input
|
|
17
|
-
* @param errors Array to collect parsing errors
|
|
18
|
-
* @param options Parsing options
|
|
19
|
-
* @returns The parsed representation (ObjectNode, ArrayNode, or primitive node)
|
|
20
|
-
*/
|
|
21
|
-
export declare function parse(input: string, errors?: YamlParseError[], options?: ParseOptions): YamlNode | undefined;
|
|
22
|
-
export interface YamlParseError {
|
|
23
|
-
readonly message: string;
|
|
24
|
-
readonly start: Position;
|
|
25
|
-
readonly end: Position;
|
|
26
|
-
readonly code: string;
|
|
27
|
-
}
|
|
28
|
-
export interface ParseOptions {
|
|
29
|
-
readonly allowDuplicateKeys?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface Position {
|
|
32
|
-
readonly line: number;
|
|
33
|
-
readonly character: number;
|
|
34
|
-
}
|
|
35
|
-
export interface YamlStringNode {
|
|
36
|
-
readonly type: "string";
|
|
37
|
-
readonly value: string;
|
|
38
|
-
readonly start: Position;
|
|
39
|
-
readonly end: Position;
|
|
40
|
-
}
|
|
41
|
-
export interface YamlNumberNode {
|
|
42
|
-
readonly type: "number";
|
|
43
|
-
readonly value: number;
|
|
44
|
-
readonly start: Position;
|
|
45
|
-
readonly end: Position;
|
|
46
|
-
}
|
|
47
|
-
export interface YamlBooleanNode {
|
|
48
|
-
readonly type: "boolean";
|
|
49
|
-
readonly value: boolean;
|
|
50
|
-
readonly start: Position;
|
|
51
|
-
readonly end: Position;
|
|
52
|
-
}
|
|
53
|
-
export interface YamlNullNode {
|
|
54
|
-
readonly type: "null";
|
|
55
|
-
readonly value: null;
|
|
56
|
-
readonly start: Position;
|
|
57
|
-
readonly end: Position;
|
|
58
|
-
}
|
|
59
|
-
export interface YamlObjectNode {
|
|
60
|
-
readonly type: "object";
|
|
61
|
-
readonly properties: {
|
|
62
|
-
key: YamlStringNode;
|
|
63
|
-
value: YamlNode;
|
|
64
|
-
}[];
|
|
65
|
-
readonly start: Position;
|
|
66
|
-
readonly end: Position;
|
|
67
|
-
}
|
|
68
|
-
export interface YamlArrayNode {
|
|
69
|
-
readonly type: "array";
|
|
70
|
-
readonly items: YamlNode[];
|
|
71
|
-
readonly start: Position;
|
|
72
|
-
readonly end: Position;
|
|
73
|
-
}
|
|
74
|
-
export type YamlNode = YamlStringNode | YamlNumberNode | YamlBooleanNode | YamlNullNode | YamlObjectNode | YamlArrayNode;
|