@codingame/monaco-vscode-chat-service-override 22.1.8 → 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 +16 -7
- package/package.json +43 -41
- 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 +18 -18
- 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 +33 -32
- 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 +12 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +18 -30
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +62 -139
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +16 -15
- 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
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js
CHANGED
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import {
|
|
4
|
-
import { PromptsType, getPromptsTypeForLanguageId, PROMPT_LANGUAGE_ID, MODE_LANGUAGE_ID } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
5
|
-
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
6
|
-
import { PromptFilesLocator } from '../utils/promptFilesLocator.js';
|
|
7
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
10
|
-
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
11
|
-
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
3
|
+
import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
12
4
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
5
|
+
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
6
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
10
|
+
import { isEqual, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
11
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
12
|
+
import { OffsetRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/offsetRange';
|
|
17
13
|
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
18
|
-
import {
|
|
14
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
15
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
19
16
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
20
|
-
import { NewPromptsParser } from './newPromptsParser.js';
|
|
21
17
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { isEqual, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
26
|
-
import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
18
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
19
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
20
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
27
21
|
import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
22
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
23
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
24
|
+
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
25
|
+
import { PromptsConfig } from '@codingame/monaco-vscode-8d4ef243-d8c1-540d-9f11-38df46f54c9f-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
26
|
+
import { getCleanPromptName, PROMPT_FILE_EXTENSION } from '@codingame/monaco-vscode-8d4ef243-d8c1-540d-9f11-38df46f54c9f-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
27
|
+
import { PromptsType, getPromptsTypeForLanguageId, PROMPT_LANGUAGE_ID, getLanguageIdForPromptsType } from '@codingame/monaco-vscode-8d4ef243-d8c1-540d-9f11-38df46f54c9f-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
28
|
+
import { PromptFilesLocator } from '../utils/promptFilesLocator.js';
|
|
29
|
+
import { PromptFileParser, PromptHeaderAttributes } from '@codingame/monaco-vscode-8d4ef243-d8c1-540d-9f11-38df46f54c9f-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser';
|
|
30
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
28
31
|
|
|
29
|
-
var
|
|
32
|
+
var UpdateTracker_1;
|
|
30
33
|
let PromptsService = class PromptsService extends Disposable {
|
|
31
|
-
constructor(logger, labelService, modelService, instantiationService, userDataService, languageService, configurationService, fileService, filesConfigService) {
|
|
34
|
+
constructor(logger, labelService, modelService, instantiationService, userDataService, languageService, configurationService, fileService, filesConfigService, storageService) {
|
|
32
35
|
super();
|
|
33
36
|
this.logger = logger;
|
|
34
37
|
this.labelService = labelService;
|
|
@@ -39,27 +42,53 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
39
42
|
this.configurationService = configurationService;
|
|
40
43
|
this.fileService = fileService;
|
|
41
44
|
this.filesConfigService = filesConfigService;
|
|
45
|
+
this.storageService = storageService;
|
|
42
46
|
this.parsedPromptFileCache = ( new ResourceMap());
|
|
47
|
+
this.promptFileByCommandCache = ( new Map());
|
|
48
|
+
this.onDidChangeParsedPromptFilesCacheEmitter = ( new Emitter());
|
|
43
49
|
this.contributedFiles = {
|
|
44
50
|
[PromptsType.prompt]: ( new ResourceMap()),
|
|
45
51
|
[PromptsType.instructions]: ( new ResourceMap()),
|
|
46
|
-
[PromptsType.
|
|
52
|
+
[PromptsType.agent]: ( new ResourceMap()),
|
|
47
53
|
};
|
|
54
|
+
this.disabledPromptsStorageKeyPrefix = 'chat.disabledPromptFiles.';
|
|
55
|
+
this.onDidChangeParsedPromptFilesCacheEmitter = this._register(( new Emitter()));
|
|
48
56
|
this.fileLocator = this._register(this.instantiationService.createInstance(PromptFilesLocator));
|
|
57
|
+
const promptUpdateTracker = this._register(( new UpdateTracker(this.fileLocator, PromptsType.prompt, this.modelService)));
|
|
58
|
+
this._register(promptUpdateTracker.onDidPromptChange((event) => {
|
|
59
|
+
if (event.kind === 'fileSystem') {
|
|
60
|
+
this.promptFileByCommandCache.clear();
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
const pendingDeletes = [];
|
|
64
|
+
for (const [key, value] of this.promptFileByCommandCache) {
|
|
65
|
+
if (isEqual(value.value?.uri, event.uri)) {
|
|
66
|
+
pendingDeletes.push(key);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const key of pendingDeletes) {
|
|
70
|
+
this.promptFileByCommandCache.delete(key);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.onDidChangeParsedPromptFilesCacheEmitter.fire();
|
|
74
|
+
}));
|
|
49
75
|
this._register(this.modelService.onModelRemoved((model) => {
|
|
50
76
|
this.parsedPromptFileCache.delete(model.uri);
|
|
51
77
|
}));
|
|
52
78
|
}
|
|
53
|
-
get
|
|
54
|
-
if (!this.
|
|
55
|
-
const emitter = this.
|
|
56
|
-
const
|
|
57
|
-
this._register(
|
|
58
|
-
this.
|
|
79
|
+
get onDidChangeCustomAgents() {
|
|
80
|
+
if (!this.onDidChangeCustomAgentsEmitter) {
|
|
81
|
+
const emitter = this.onDidChangeCustomAgentsEmitter = this._register(( new Emitter()));
|
|
82
|
+
const updateTracker = this._register(( new UpdateTracker(this.fileLocator, PromptsType.agent, this.modelService)));
|
|
83
|
+
this._register(updateTracker.onDidPromptChange((event) => {
|
|
84
|
+
this.cachedCustomAgents = undefined;
|
|
59
85
|
emitter.fire();
|
|
60
86
|
}));
|
|
61
87
|
}
|
|
62
|
-
return this.
|
|
88
|
+
return this.onDidChangeCustomAgentsEmitter.event;
|
|
89
|
+
}
|
|
90
|
+
get onDidChangeParsedPromptFilesCache() {
|
|
91
|
+
return this.onDidChangeParsedPromptFilesCacheEmitter.event;
|
|
63
92
|
}
|
|
64
93
|
getPromptFileType(uri) {
|
|
65
94
|
const model = this.modelService.getModel(uri);
|
|
@@ -71,16 +100,13 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
71
100
|
if (cached && cached[0] === textModel.getVersionId()) {
|
|
72
101
|
return cached[1];
|
|
73
102
|
}
|
|
74
|
-
const ast = ( new
|
|
103
|
+
const ast = ( new PromptFileParser()).parse(textModel.uri, textModel.getValue());
|
|
75
104
|
if (!cached || cached[0] < textModel.getVersionId()) {
|
|
76
105
|
this.parsedPromptFileCache.set(textModel.uri, [textModel.getVersionId(), ast]);
|
|
77
106
|
}
|
|
78
107
|
return ast;
|
|
79
108
|
}
|
|
80
109
|
async listPromptFiles(type, token) {
|
|
81
|
-
if (!PromptsConfig.enabled(this.configurationService)) {
|
|
82
|
-
return [];
|
|
83
|
-
}
|
|
84
110
|
const prompts = await Promise.all([
|
|
85
111
|
this.fileLocator.listFiles(type, PromptsStorage.user, token).then(uris => ( uris.map(uri => ({ uri, storage: PromptsStorage.user, type })))),
|
|
86
112
|
this.fileLocator.listFiles(type, PromptsStorage.local, token).then(uris => ( uris.map(uri => ({ uri, storage: PromptsStorage.local, type })))),
|
|
@@ -89,9 +115,6 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
89
115
|
return [...prompts.flat()];
|
|
90
116
|
}
|
|
91
117
|
async listPromptFilesForStorage(type, storage, token) {
|
|
92
|
-
if (!PromptsConfig.enabled(this.configurationService)) {
|
|
93
|
-
return [];
|
|
94
|
-
}
|
|
95
118
|
switch (storage) {
|
|
96
119
|
case PromptsStorage.extension:
|
|
97
120
|
return this.getExtensionContributions(type);
|
|
@@ -107,12 +130,17 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
107
130
|
return Promise.all(( this.contributedFiles[type].values()));
|
|
108
131
|
}
|
|
109
132
|
getSourceFolders(type) {
|
|
110
|
-
if (!PromptsConfig.enabled(this.configurationService)) {
|
|
111
|
-
return [];
|
|
112
|
-
}
|
|
113
133
|
const result = [];
|
|
114
|
-
|
|
115
|
-
|
|
134
|
+
if (type === PromptsType.agent) {
|
|
135
|
+
const folders = this.fileLocator.getAgentSourceFolder();
|
|
136
|
+
for (const uri of folders) {
|
|
137
|
+
result.push({ uri, storage: PromptsStorage.local, type });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
for (const uri of this.fileLocator.getConfigBasedSourceFolders(type)) {
|
|
142
|
+
result.push({ uri, storage: PromptsStorage.local, type });
|
|
143
|
+
}
|
|
116
144
|
}
|
|
117
145
|
const userHome = this.userDataService.currentProfile.promptsHome;
|
|
118
146
|
result.push({ uri: userHome, storage: PromptsStorage.user, type });
|
|
@@ -120,12 +148,12 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
120
148
|
}
|
|
121
149
|
asPromptSlashCommand(command) {
|
|
122
150
|
if (command.match(/^[\p{L}\d_\-\.]+$/u)) {
|
|
123
|
-
return { command, detail: ( localize(
|
|
151
|
+
return { command, detail: ( localize(5922, 'Prompt file: {0}', command)) };
|
|
124
152
|
}
|
|
125
153
|
return undefined;
|
|
126
154
|
}
|
|
127
155
|
async resolvePromptSlashCommand(data, token) {
|
|
128
|
-
const promptUri = await this.getPromptPath(data);
|
|
156
|
+
const promptUri = data.promptPath?.uri ?? (await this.getPromptPath(data.command));
|
|
129
157
|
if (!promptUri) {
|
|
130
158
|
return undefined;
|
|
131
159
|
}
|
|
@@ -137,15 +165,46 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
137
165
|
return undefined;
|
|
138
166
|
}
|
|
139
167
|
}
|
|
140
|
-
async
|
|
141
|
-
|
|
142
|
-
|
|
168
|
+
async populatePromptCommandCache(command) {
|
|
169
|
+
let cache = this.promptFileByCommandCache.get(command);
|
|
170
|
+
if (cache && cache.pendingPromise) {
|
|
171
|
+
return cache.pendingPromise;
|
|
172
|
+
}
|
|
173
|
+
const newPromise = this.resolvePromptSlashCommand({ command, detail: '' }, CancellationToken.None);
|
|
174
|
+
if (cache) {
|
|
175
|
+
cache.pendingPromise = newPromise;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
cache = { value: undefined, pendingPromise: newPromise };
|
|
179
|
+
this.promptFileByCommandCache.set(command, cache);
|
|
180
|
+
}
|
|
181
|
+
const newValue = await newPromise.finally(() => cache.pendingPromise = undefined);
|
|
182
|
+
cache.value = newValue;
|
|
183
|
+
this.onDidChangeParsedPromptFilesCacheEmitter.fire();
|
|
184
|
+
return newValue;
|
|
185
|
+
}
|
|
186
|
+
resolvePromptSlashCommandFromCache(command) {
|
|
187
|
+
const cache = this.promptFileByCommandCache.get(command);
|
|
188
|
+
const value = cache?.value;
|
|
189
|
+
if (value === undefined) {
|
|
190
|
+
void this.populatePromptCommandCache(command).catch((error) => { });
|
|
143
191
|
}
|
|
192
|
+
return value;
|
|
193
|
+
}
|
|
194
|
+
async getPromptDetails(promptPath) {
|
|
195
|
+
const parsedPromptFile = await this.parseNew(promptPath.uri, CancellationToken.None).catch(() => undefined);
|
|
196
|
+
return {
|
|
197
|
+
name: parsedPromptFile?.header?.name ?? promptPath.name ?? getCleanPromptName(promptPath.uri),
|
|
198
|
+
description: parsedPromptFile?.header?.description ?? promptPath.description
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
async getPromptPath(command) {
|
|
144
202
|
const promptPaths = await this.listPromptFiles(PromptsType.prompt, CancellationToken.None);
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
203
|
+
for (const promptPath of promptPaths) {
|
|
204
|
+
const details = await this.getPromptDetails(promptPath);
|
|
205
|
+
if (details.name === command) {
|
|
206
|
+
return promptPath.uri;
|
|
207
|
+
}
|
|
149
208
|
}
|
|
150
209
|
const textModel = this.modelService.getModels().find(model => model.getLanguageId() === PROMPT_LANGUAGE_ID && getCommandNameFromURI(model.uri) === command);
|
|
151
210
|
if (textModel) {
|
|
@@ -155,44 +214,47 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
155
214
|
}
|
|
156
215
|
async getPromptCommandName(uri) {
|
|
157
216
|
const promptPaths = await this.listPromptFiles(PromptsType.prompt, CancellationToken.None);
|
|
158
|
-
|
|
217
|
+
let promptPath = promptPaths.find(promptPath => isEqual(promptPath.uri, uri));
|
|
159
218
|
if (!promptPath) {
|
|
160
|
-
|
|
219
|
+
promptPath = { uri, storage: PromptsStorage.local, type: PromptsType.prompt };
|
|
161
220
|
}
|
|
162
|
-
|
|
221
|
+
const { name } = await this.getPromptDetails(promptPath);
|
|
222
|
+
return name;
|
|
163
223
|
}
|
|
164
224
|
async findPromptSlashCommands() {
|
|
165
225
|
const promptFiles = await this.listPromptFiles(PromptsType.prompt, CancellationToken.None);
|
|
166
|
-
return (promptFiles.map(promptPath => {
|
|
167
|
-
const
|
|
226
|
+
return Promise.all(( promptFiles.map(async (promptPath) => {
|
|
227
|
+
const { name } = await this.getPromptDetails(promptPath);
|
|
168
228
|
return {
|
|
169
|
-
command,
|
|
229
|
+
command: name,
|
|
170
230
|
detail: ( localize(
|
|
171
|
-
|
|
231
|
+
5922,
|
|
172
232
|
'Prompt file: {0}',
|
|
173
233
|
this.labelService.getUriLabel(promptPath.uri, { relative: true })
|
|
174
234
|
)),
|
|
175
235
|
promptPath
|
|
176
236
|
};
|
|
177
|
-
}));
|
|
237
|
+
})));
|
|
178
238
|
}
|
|
179
|
-
async
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
239
|
+
async getCustomAgents(token) {
|
|
240
|
+
let customAgents = this.cachedCustomAgents;
|
|
241
|
+
if (!customAgents) {
|
|
242
|
+
customAgents = this.computeCustomAgents(token);
|
|
243
|
+
if (this.onDidChangeCustomAgentsEmitter) {
|
|
244
|
+
this.cachedCustomAgents = customAgents;
|
|
184
245
|
}
|
|
185
|
-
this.cachedCustomChatModes = customChatModes;
|
|
186
246
|
}
|
|
187
|
-
|
|
247
|
+
const disabledAgents = this.getDisabledPromptFiles(PromptsType.agent);
|
|
248
|
+
return (await customAgents).filter(agent => !( disabledAgents.has(agent.uri)));
|
|
188
249
|
}
|
|
189
|
-
async
|
|
190
|
-
const
|
|
191
|
-
const
|
|
250
|
+
async computeCustomAgents(token) {
|
|
251
|
+
const agentFiles = await this.listPromptFiles(PromptsType.agent, token);
|
|
252
|
+
const customAgents = await Promise.all(( agentFiles.map(async (promptPath) => {
|
|
253
|
+
const uri = promptPath.uri;
|
|
192
254
|
const ast = await this.parseNew(uri, token);
|
|
193
255
|
let metadata;
|
|
194
256
|
if (ast.header) {
|
|
195
|
-
const advanced = ast.header.getAttribute(
|
|
257
|
+
const advanced = ast.header.getAttribute(PromptHeaderAttributes.advancedOptions);
|
|
196
258
|
if (advanced && advanced.value.type === 'object') {
|
|
197
259
|
metadata = {};
|
|
198
260
|
for (const [key, value] of Object.entries(advanced.value)) {
|
|
@@ -212,19 +274,20 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
212
274
|
toolReferences.push({ name, range });
|
|
213
275
|
}
|
|
214
276
|
}
|
|
215
|
-
const
|
|
277
|
+
const agentInstructions = {
|
|
216
278
|
content: ast.body?.getContent() ?? '',
|
|
217
279
|
toolReferences,
|
|
218
280
|
metadata,
|
|
219
281
|
};
|
|
220
|
-
const name =
|
|
282
|
+
const name = ast.header?.name ?? promptPath.name ?? getCleanPromptName(uri);
|
|
283
|
+
const source = IAgentSource.fromPromptPath(promptPath);
|
|
221
284
|
if (!ast.header) {
|
|
222
|
-
return { uri, name,
|
|
285
|
+
return { uri, name, agentInstructions, source };
|
|
223
286
|
}
|
|
224
|
-
const { description, model, tools } = ast.header;
|
|
225
|
-
return { uri, name, description, model, tools,
|
|
287
|
+
const { description, model, tools, handOffs, argumentHint, target } = ast.header;
|
|
288
|
+
return { uri, name, description, model, tools, handOffs, argumentHint, target, agentInstructions, source };
|
|
226
289
|
})));
|
|
227
|
-
return
|
|
290
|
+
return customAgents;
|
|
228
291
|
}
|
|
229
292
|
async parseNew(uri, token) {
|
|
230
293
|
const model = this.modelService.getModel(uri);
|
|
@@ -235,7 +298,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
235
298
|
if (token.isCancellationRequested) {
|
|
236
299
|
throw ( new CancellationError());
|
|
237
300
|
}
|
|
238
|
-
return ( new
|
|
301
|
+
return ( new PromptFileParser()).parse(uri, ( fileContent.value.toString()));
|
|
239
302
|
}
|
|
240
303
|
registerContributedFile(type, name, description, uri, extension) {
|
|
241
304
|
const bucket = this.contributedFiles[type];
|
|
@@ -253,27 +316,27 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
253
316
|
return { uri, name, description, storage: PromptsStorage.extension, type, extension };
|
|
254
317
|
})();
|
|
255
318
|
bucket.set(uri, entryPromise);
|
|
256
|
-
const
|
|
257
|
-
if (type === PromptsType.
|
|
258
|
-
this.
|
|
259
|
-
this.
|
|
319
|
+
const updateAgentsIfRequired = () => {
|
|
320
|
+
if (type === PromptsType.agent) {
|
|
321
|
+
this.cachedCustomAgents = undefined;
|
|
322
|
+
this.onDidChangeCustomAgentsEmitter?.fire();
|
|
260
323
|
}
|
|
261
324
|
};
|
|
262
|
-
|
|
325
|
+
updateAgentsIfRequired();
|
|
263
326
|
return {
|
|
264
327
|
dispose: () => {
|
|
265
328
|
bucket.delete(uri);
|
|
266
|
-
|
|
329
|
+
updateAgentsIfRequired();
|
|
267
330
|
}
|
|
268
331
|
};
|
|
269
332
|
}
|
|
270
333
|
getPromptLocationLabel(promptPath) {
|
|
271
334
|
switch (promptPath.storage) {
|
|
272
335
|
case PromptsStorage.local: return this.labelService.getUriLabel(dirname(promptPath.uri), { relative: true });
|
|
273
|
-
case PromptsStorage.user: return localize(
|
|
336
|
+
case PromptsStorage.user: return localize(5923, 'User Data');
|
|
274
337
|
case PromptsStorage.extension: {
|
|
275
338
|
return localize(
|
|
276
|
-
|
|
339
|
+
5924,
|
|
277
340
|
'Extension: {0}',
|
|
278
341
|
promptPath.extension.displayName ?? promptPath.extension.id
|
|
279
342
|
);
|
|
@@ -284,6 +347,55 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
284
347
|
findAgentMDsInWorkspace(token) {
|
|
285
348
|
return this.fileLocator.findAgentMDsInWorkspace(token);
|
|
286
349
|
}
|
|
350
|
+
async listAgentMDs(token, includeNested) {
|
|
351
|
+
const useAgentMD = this.configurationService.getValue(PromptsConfig.USE_AGENT_MD);
|
|
352
|
+
if (!useAgentMD) {
|
|
353
|
+
return [];
|
|
354
|
+
}
|
|
355
|
+
if (includeNested) {
|
|
356
|
+
return await this.fileLocator.findAgentMDsInWorkspace(token);
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
return await this.fileLocator.findAgentMDsInWorkspaceRoots(token);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
async listCopilotInstructionsMDs(token) {
|
|
363
|
+
const useCopilotInstructionsFiles = this.configurationService.getValue(PromptsConfig.USE_COPILOT_INSTRUCTION_FILES);
|
|
364
|
+
if (!useCopilotInstructionsFiles) {
|
|
365
|
+
return [];
|
|
366
|
+
}
|
|
367
|
+
return await this.fileLocator.findCopilotInstructionsMDsInWorkspace(token);
|
|
368
|
+
}
|
|
369
|
+
getAgentFileURIFromModeFile(oldURI) {
|
|
370
|
+
return this.fileLocator.getAgentFileURIFromModeFile(oldURI);
|
|
371
|
+
}
|
|
372
|
+
getDisabledPromptFiles(type) {
|
|
373
|
+
const disabledKey = this.disabledPromptsStorageKeyPrefix + type;
|
|
374
|
+
const value = this.storageService.get(disabledKey, StorageScope.PROFILE, '[]');
|
|
375
|
+
const result = ( new ResourceSet());
|
|
376
|
+
try {
|
|
377
|
+
const arr = JSON.parse(value);
|
|
378
|
+
if (Array.isArray(arr)) {
|
|
379
|
+
for (const s of arr) {
|
|
380
|
+
try {
|
|
381
|
+
result.add(URI.revive(s));
|
|
382
|
+
}
|
|
383
|
+
catch {
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
}
|
|
390
|
+
return result;
|
|
391
|
+
}
|
|
392
|
+
setDisabledPromptFiles(type, uris) {
|
|
393
|
+
const disabled = ( Array.from(uris).map(uri => uri.toJSON()));
|
|
394
|
+
this.storageService.store(this.disabledPromptsStorageKeyPrefix + type, JSON.stringify(disabled), StorageScope.PROFILE, StorageTarget.USER);
|
|
395
|
+
if (type === PromptsType.agent) {
|
|
396
|
+
this.onDidChangeCustomAgentsEmitter?.fire();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
287
399
|
};
|
|
288
400
|
PromptsService = ( __decorate([
|
|
289
401
|
( __param(0, ILogService)),
|
|
@@ -294,38 +406,36 @@ PromptsService = ( __decorate([
|
|
|
294
406
|
( __param(5, ILanguageService)),
|
|
295
407
|
( __param(6, IConfigurationService)),
|
|
296
408
|
( __param(7, IFileService)),
|
|
297
|
-
( __param(8, IFilesConfigurationService))
|
|
409
|
+
( __param(8, IFilesConfigurationService)),
|
|
410
|
+
( __param(9, IStorageService))
|
|
298
411
|
], PromptsService));
|
|
299
|
-
function getCommandNameFromPromptPath(promptPath) {
|
|
300
|
-
return promptPath.name ?? getCommandNameFromURI(promptPath.uri);
|
|
301
|
-
}
|
|
302
412
|
function getCommandNameFromURI(uri) {
|
|
303
413
|
return basename(uri.fsPath, PROMPT_FILE_EXTENSION);
|
|
304
414
|
}
|
|
305
|
-
let
|
|
306
|
-
static {
|
|
307
|
-
static { this.
|
|
308
|
-
get
|
|
309
|
-
return this.
|
|
415
|
+
let UpdateTracker = class UpdateTracker extends Disposable {
|
|
416
|
+
static { UpdateTracker_1 = this; }
|
|
417
|
+
static { this.PROMPT_UPDATE_DELAY_MS = 200; }
|
|
418
|
+
get onDidPromptChange() {
|
|
419
|
+
return this.onDidPromptModelChange.event;
|
|
310
420
|
}
|
|
311
|
-
constructor(fileLocator, modelService) {
|
|
421
|
+
constructor(fileLocator, promptType, modelService) {
|
|
312
422
|
super();
|
|
313
423
|
this.listeners = ( new ResourceMap());
|
|
314
|
-
this.
|
|
315
|
-
const delayer = this._register(( new Delayer(
|
|
316
|
-
const trigger = () => delayer.trigger(() => this.
|
|
317
|
-
const filesUpdatedEventRegistration = this._register(fileLocator.createFilesUpdatedEvent(
|
|
318
|
-
this._register(filesUpdatedEventRegistration.event(() => trigger()));
|
|
424
|
+
this.onDidPromptModelChange = this._register(( new Emitter()));
|
|
425
|
+
const delayer = this._register(( new Delayer(UpdateTracker_1.PROMPT_UPDATE_DELAY_MS)));
|
|
426
|
+
const trigger = (event) => delayer.trigger(() => this.onDidPromptModelChange.fire(event));
|
|
427
|
+
const filesUpdatedEventRegistration = this._register(fileLocator.createFilesUpdatedEvent(promptType));
|
|
428
|
+
this._register(filesUpdatedEventRegistration.event(() => trigger({ kind: 'fileSystem' })));
|
|
319
429
|
const onAdd = (model) => {
|
|
320
|
-
if (model.getLanguageId() ===
|
|
321
|
-
this.listeners.set(model.uri, model.onDidChangeContent(() => trigger()));
|
|
430
|
+
if (model.getLanguageId() === getLanguageIdForPromptsType(promptType)) {
|
|
431
|
+
this.listeners.set(model.uri, model.onDidChangeContent(() => trigger({ kind: 'textModel', uri: model.uri })));
|
|
322
432
|
}
|
|
323
433
|
};
|
|
324
434
|
const onRemove = (languageId, uri) => {
|
|
325
|
-
if (languageId ===
|
|
435
|
+
if (languageId === getLanguageIdForPromptsType(promptType)) {
|
|
326
436
|
this.listeners.get(uri)?.dispose();
|
|
327
437
|
this.listeners.delete(uri);
|
|
328
|
-
trigger();
|
|
438
|
+
trigger({ kind: 'textModel', uri });
|
|
329
439
|
}
|
|
330
440
|
};
|
|
331
441
|
this._register(modelService.onModelAdded(model => onAdd(model)));
|
|
@@ -341,8 +451,25 @@ let ChatModeUpdateTracker = class ChatModeUpdateTracker extends Disposable {
|
|
|
341
451
|
this.listeners.clear();
|
|
342
452
|
}
|
|
343
453
|
};
|
|
344
|
-
|
|
345
|
-
( __param(
|
|
346
|
-
],
|
|
454
|
+
UpdateTracker = UpdateTracker_1 = ( __decorate([
|
|
455
|
+
( __param(2, IModelService))
|
|
456
|
+
], UpdateTracker));
|
|
457
|
+
var IAgentSource;
|
|
458
|
+
(function (IAgentSource) {
|
|
459
|
+
function fromPromptPath(promptPath) {
|
|
460
|
+
if (promptPath.storage === PromptsStorage.extension) {
|
|
461
|
+
return {
|
|
462
|
+
storage: PromptsStorage.extension,
|
|
463
|
+
extensionId: promptPath.extension.identifier
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
return {
|
|
468
|
+
storage: promptPath.storage
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
IAgentSource.fromPromptPath = fromPromptPath;
|
|
473
|
+
})(IAgentSource || (IAgentSource = {}));
|
|
347
474
|
|
|
348
|
-
export {
|
|
475
|
+
export { PromptsService, UpdateTracker };
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
|
2
2
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
3
3
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
4
4
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
import { PromptsType } from "@codingame/monaco-vscode-
|
|
5
|
+
import { PromptsType } from "@codingame/monaco-vscode-8d4ef243-d8c1-540d-9f11-38df46f54c9f-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes";
|
|
6
6
|
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
7
7
|
import { ISearchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/search/common/search.service";
|
|
8
8
|
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
9
|
-
import { PromptsStorage } from "
|
|
9
|
+
import { PromptsStorage } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService";
|
|
10
10
|
import { IUserDataProfileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service";
|
|
11
11
|
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
12
12
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
@@ -34,6 +34,7 @@ export declare class PromptFilesLocator extends Disposable {
|
|
|
34
34
|
readonly event: Event<void>;
|
|
35
35
|
dispose: () => void;
|
|
36
36
|
};
|
|
37
|
+
getAgentSourceFolder(): readonly URI[];
|
|
37
38
|
/**
|
|
38
39
|
* Get all possible unambiguous prompt file source folders based on
|
|
39
40
|
* the current workspace folder structure.
|
|
@@ -68,8 +69,17 @@ export declare class PromptFilesLocator extends Disposable {
|
|
|
68
69
|
* Uses the search service to find all files at the provided location
|
|
69
70
|
*/
|
|
70
71
|
private searchFilesInLocation;
|
|
72
|
+
findCopilotInstructionsMDsInWorkspace(token: CancellationToken): Promise<URI[]>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets list of `AGENTS.md` files anywhere in the workspace.
|
|
75
|
+
*/
|
|
71
76
|
findAgentMDsInWorkspace(token: CancellationToken): Promise<URI[]>;
|
|
72
77
|
private findAgentMDsInFolder;
|
|
78
|
+
/**
|
|
79
|
+
* Gets list of `AGENTS.md` files only at the root workspace folder(s).
|
|
80
|
+
*/
|
|
81
|
+
findAgentMDsInWorkspaceRoots(token: CancellationToken): Promise<URI[]>;
|
|
82
|
+
getAgentFileURIFromModeFile(oldURI: URI): URI | undefined;
|
|
73
83
|
}
|
|
74
84
|
/**
|
|
75
85
|
* Checks if the provided `pattern` could be a valid glob pattern.
|