@codingame/monaco-vscode-chat-service-override 27.0.0 → 28.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 +5 -2
- package/package.json +5 -5
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +54 -4
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +179 -11
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +5 -1
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +6 -1
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +25 -10
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +67 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +263 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +49 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +537 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/media/agentPluginEditor.css +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +17 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +89 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +4 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +146 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +56 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +189 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +42 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +210 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +14 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +122 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +87 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +702 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +279 -214
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +63 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +62 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +32 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditorController.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +49 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +103 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +61 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +245 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.js +234 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +31 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +229 -524
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +54 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +112 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +99 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +489 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +348 -285
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +107 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +55 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +148 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +29 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +72 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +11 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +72 -23
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +19 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +37 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +36 -3
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +71 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +217 -91
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +85 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +257 -63
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +3 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +7 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +32 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +26 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +287 -88
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +75 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +121 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +1422 -0
- 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 +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +81 -41
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +14 -2
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +54 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +6 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +38 -22
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +8 -8
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- 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/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +36 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +27 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -67
|
@@ -5,7 +5,7 @@ import { PromptBodyAutocompletion } from './languageProviders/promptBodyAutocomp
|
|
|
5
5
|
import { PromptHeaderAutocompletion } from './languageProviders/promptHeaderAutocompletion.js';
|
|
6
6
|
import { PromptHoverProvider } from './languageProviders/promptHovers.js';
|
|
7
7
|
import { PromptHeaderDefinitionProvider } from './languageProviders/PromptHeaderDefinitionProvider.js';
|
|
8
|
-
import { PromptValidatorContribution } from '
|
|
8
|
+
import { PromptValidatorContribution } from './languageProviders/promptValidator.js';
|
|
9
9
|
import { PromptDocumentSemanticTokensProvider } from './languageProviders/promptDocumentSemanticTokensProvider.js';
|
|
10
10
|
import { PromptCodeActionProvider } from './languageProviders/promptCodeActions.js';
|
|
11
11
|
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { ParsedPromptFile } from "@codingame/monaco-vscode-api/vscode/vs/workben
|
|
|
23
23
|
import { IChatPromptSlashCommand, IConfiguredHooksInfo, ICustomAgent, IPromptPath, IAgentSkill, PromptsStorage, IPromptFileContext, IPromptFileResource, IPromptDiscoveryInfo, IResolvedAgentFile, Logger, IPromptDiscoveryLogEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService";
|
|
24
24
|
import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
|
|
25
25
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
26
|
+
import { IWorkspaceTrustManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service";
|
|
26
27
|
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
27
28
|
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
28
29
|
import { IAgentPluginService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service";
|
|
@@ -68,6 +69,7 @@ export declare class PromptsService extends Disposable implements IPromptsServic
|
|
|
68
69
|
private readonly pathService;
|
|
69
70
|
private readonly contextKeyService;
|
|
70
71
|
private readonly agentPluginService;
|
|
72
|
+
private readonly workspaceTrustService;
|
|
71
73
|
readonly _serviceBrand: undefined;
|
|
72
74
|
/**
|
|
73
75
|
* Prompt files locator utility.
|
|
@@ -120,10 +122,11 @@ export declare class PromptsService extends Disposable implements IPromptsServic
|
|
|
120
122
|
private readonly _contributedWhenKeys;
|
|
121
123
|
private readonly _contributedWhenClauses;
|
|
122
124
|
private readonly _onDidContributedWhenChange;
|
|
125
|
+
private readonly _onDidChangeInstructions;
|
|
123
126
|
private readonly _onDidPluginPromptFilesChange;
|
|
124
127
|
private readonly _onDidPluginHooksChange;
|
|
125
128
|
private _pluginPromptFilesByType;
|
|
126
|
-
constructor(logger: ILogService, labelService: ILabelService, modelService: IModelService, instantiationService: IInstantiationService, userDataService: IUserDataProfileService, configurationService: IConfigurationService, fileService: IFileService, filesConfigService: IFilesConfigurationService, storageService: IStorageService, extensionService: IExtensionService, telemetryService: ITelemetryService, workspaceService: IWorkspaceContextService, pathService: IPathService, contextKeyService: IContextKeyService, agentPluginService: IAgentPluginService);
|
|
129
|
+
constructor(logger: ILogService, labelService: ILabelService, modelService: IModelService, instantiationService: IInstantiationService, userDataService: IUserDataProfileService, configurationService: IConfigurationService, fileService: IFileService, filesConfigService: IFilesConfigurationService, storageService: IStorageService, extensionService: IExtensionService, telemetryService: ITelemetryService, workspaceService: IWorkspaceContextService, pathService: IPathService, contextKeyService: IContextKeyService, agentPluginService: IAgentPluginService, workspaceTrustService: IWorkspaceTrustManagementService);
|
|
127
130
|
private watchPluginPromptFilesForType;
|
|
128
131
|
protected createPromptFilesLocator(): PromptFilesLocator;
|
|
129
132
|
private getFileLocatorEvent;
|
|
@@ -174,6 +177,7 @@ export declare class PromptsService extends Disposable implements IPromptsServic
|
|
|
174
177
|
* Emitter for custom agents change events.
|
|
175
178
|
*/
|
|
176
179
|
get onDidChangeCustomAgents(): Event<void>;
|
|
180
|
+
get onDidChangeInstructions(): Event<void>;
|
|
177
181
|
getCustomAgents(token: CancellationToken, sessionResource?: URI): Promise<readonly ICustomAgent[]>;
|
|
178
182
|
private computeCustomAgents;
|
|
179
183
|
parseNew(uri: URI, token: CancellationToken): Promise<ParsedPromptFile>;
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js
CHANGED
|
@@ -26,17 +26,18 @@ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platfo
|
|
|
26
26
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
27
27
|
import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
28
28
|
import { getCleanPromptName, AGENT_MD_FILENAME, CLAUDE_CONFIG_FOLDER, CLAUDE_MD_FILENAME, CLAUDE_LOCAL_MD_FILENAME, PromptFileSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
29
|
-
import { PromptsType, PROMPT_LANGUAGE_ID, getPromptsTypeForLanguageId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
29
|
+
import { PromptsType, PROMPT_LANGUAGE_ID, Target, getPromptsTypeForLanguageId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
30
30
|
import { PromptFilesLocator } from '../utils/promptFilesLocator.js';
|
|
31
31
|
import { PromptFileParser, PromptHeaderAttributes } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser';
|
|
32
|
-
import { PromptsStorage, ExtensionAgentSourceType, SKILL_PROVIDER_ACTIVATION_EVENT, PROMPT_FILE_PROVIDER_ACTIVATION_EVENT, INSTRUCTIONS_PROVIDER_ACTIVATION_EVENT, CUSTOM_AGENT_PROVIDER_ACTIVATION_EVENT,
|
|
32
|
+
import { PromptsStorage, ExtensionAgentSourceType, SKILL_PROVIDER_ACTIVATION_EVENT, PROMPT_FILE_PROVIDER_ACTIVATION_EVENT, INSTRUCTIONS_PROVIDER_ACTIVATION_EVENT, CUSTOM_AGENT_PROVIDER_ACTIVATION_EVENT, AgentFileType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
33
33
|
import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
34
34
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
35
|
-
import {
|
|
35
|
+
import { parseSubagentHooksFromYaml } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookSchema';
|
|
36
36
|
import { parseHooksFromFile, HookSourceFormat, getHookSourceFormat } from '../hookCompatibility.js';
|
|
37
37
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
38
|
+
import { IWorkspaceTrustManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
38
39
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
39
|
-
import { getTarget, mapClaudeModels, mapClaudeTools } from '@codingame/monaco-vscode-
|
|
40
|
+
import { getTarget, mapClaudeModels, mapClaudeTools } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes';
|
|
40
41
|
import { StopWatch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stopwatch';
|
|
41
42
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
42
43
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
@@ -83,7 +84,8 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
83
84
|
workspaceService,
|
|
84
85
|
pathService,
|
|
85
86
|
contextKeyService,
|
|
86
|
-
agentPluginService
|
|
87
|
+
agentPluginService,
|
|
88
|
+
workspaceTrustService
|
|
87
89
|
) {
|
|
88
90
|
super();
|
|
89
91
|
this.logger = logger;
|
|
@@ -101,6 +103,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
101
103
|
this.pathService = pathService;
|
|
102
104
|
this.contextKeyService = contextKeyService;
|
|
103
105
|
this.agentPluginService = agentPluginService;
|
|
106
|
+
this.workspaceTrustService = workspaceTrustService;
|
|
104
107
|
this.cachedParsedPromptFromModels = ( new ResourceMap());
|
|
105
108
|
this._onDidLogDiscovery = this._register(( new Emitter()));
|
|
106
109
|
this.onDidLogDiscovery = this._onDidLogDiscovery.event;
|
|
@@ -116,6 +119,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
116
119
|
this._contributedWhenKeys = ( new Set());
|
|
117
120
|
this._contributedWhenClauses = ( new Map());
|
|
118
121
|
this._onDidContributedWhenChange = this._register(( new Emitter()));
|
|
122
|
+
this._onDidChangeInstructions = this._register(( new Emitter()));
|
|
119
123
|
this._onDidPluginPromptFilesChange = this._register(( new Emitter()));
|
|
120
124
|
this._onDidPluginHooksChange = this._register(( new Emitter()));
|
|
121
125
|
this._pluginPromptFilesByType = ( new Map());
|
|
@@ -137,7 +141,11 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
137
141
|
this.cachedCustomAgents = this._register(( new CachedPromise(token => this.computeCustomAgents(token), () => Event.any(
|
|
138
142
|
this.getFileLocatorEvent(PromptsType.agent),
|
|
139
143
|
Event.filter(modelChangeEvent, e => e.promptType === PromptsType.agent),
|
|
140
|
-
this._onDidContributedWhenChange.event
|
|
144
|
+
this._onDidContributedWhenChange.event,
|
|
145
|
+
Event.filter(
|
|
146
|
+
this.configurationService.onDidChangeConfiguration,
|
|
147
|
+
e => e.affectsConfiguration(PromptsConfig.USE_CUSTOM_AGENT_HOOKS)
|
|
148
|
+
)
|
|
141
149
|
))));
|
|
142
150
|
this.cachedSlashCommands = this._register(( new CachedPromise(token => this.computePromptSlashCommands(token), () => Event.any(
|
|
143
151
|
this.getFileLocatorEvent(PromptsType.prompt),
|
|
@@ -158,7 +166,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
158
166
|
() => Event.any(this.getFileLocatorEvent(PromptsType.hook), Event.filter(
|
|
159
167
|
this.configurationService.onDidChangeConfiguration,
|
|
160
168
|
e => e.affectsConfiguration(PromptsConfig.USE_CHAT_HOOKS) || e.affectsConfiguration(PromptsConfig.USE_CLAUDE_HOOKS)
|
|
161
|
-
), this._onDidPluginHooksChange.event)
|
|
169
|
+
), this._onDidPluginHooksChange.event, this.workspaceTrustService.onDidChangeTrust)
|
|
162
170
|
)));
|
|
163
171
|
this._register(this.cachedSkills.onDidChange(() => {}));
|
|
164
172
|
this._register(this.cachedHooks.onDidChange(() => {}));
|
|
@@ -314,6 +322,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
314
322
|
this.cachedCustomAgents.refresh();
|
|
315
323
|
} else if (type === PromptsType.instructions) {
|
|
316
324
|
this.cachedFileLocations[PromptsType.instructions] = undefined;
|
|
325
|
+
this._onDidChangeInstructions.fire();
|
|
317
326
|
} else if (type === PromptsType.prompt) {
|
|
318
327
|
this.cachedFileLocations[PromptsType.prompt] = undefined;
|
|
319
328
|
this.cachedSlashCommands.refresh();
|
|
@@ -526,16 +535,23 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
526
535
|
get onDidChangeCustomAgents() {
|
|
527
536
|
return this.cachedCustomAgents.onDidChange;
|
|
528
537
|
}
|
|
538
|
+
get onDidChangeInstructions() {
|
|
539
|
+
return Event.any(
|
|
540
|
+
this.getFileLocatorEvent(PromptsType.instructions),
|
|
541
|
+
this._onDidContributedWhenChange.event,
|
|
542
|
+
this._onDidChangeInstructions.event
|
|
543
|
+
);
|
|
544
|
+
}
|
|
529
545
|
async getCustomAgents(token, sessionResource) {
|
|
530
546
|
const sw = StopWatch.create();
|
|
531
547
|
const result = await this.cachedCustomAgents.get(token);
|
|
532
548
|
if (sessionResource) {
|
|
533
549
|
const elapsed = sw.elapsed();
|
|
534
550
|
const discoveryInfo = await this.getAgentDiscoveryInfo(token);
|
|
535
|
-
const details = result.length === 1 ? ( localize(
|
|
551
|
+
const details = result.length === 1 ? ( localize(7327, "Resolved {0} agent in {1}ms", result.length, elapsed.toFixed(1))) : ( localize(7328, "Resolved {0} agents in {1}ms", result.length, elapsed.toFixed(1)));
|
|
536
552
|
this._onDidLogDiscovery.fire({
|
|
537
553
|
sessionResource,
|
|
538
|
-
name: ( localize(
|
|
554
|
+
name: ( localize(7329, "Load Agents")),
|
|
539
555
|
details,
|
|
540
556
|
discoveryInfo,
|
|
541
557
|
category: "discovery"
|
|
@@ -547,6 +563,9 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
547
563
|
let agentFiles = await this.listPromptFiles(PromptsType.agent, token);
|
|
548
564
|
const disabledAgents = this.getDisabledPromptFiles(PromptsType.agent);
|
|
549
565
|
agentFiles = agentFiles.filter(promptPath => !( disabledAgents.has(promptPath.uri)));
|
|
566
|
+
const userHomeUri = await this.pathService.userHome();
|
|
567
|
+
const userHome = userHomeUri.scheme === Schemas.file ? userHomeUri.fsPath : userHomeUri.path;
|
|
568
|
+
const defaultFolder = this.workspaceService.getWorkspace().folders[0];
|
|
550
569
|
const customAgentsResults = await Promise.allSettled(( agentFiles.map(async promptPath => {
|
|
551
570
|
const uri = promptPath.uri;
|
|
552
571
|
const ast = await this.parseNew(uri, token);
|
|
@@ -601,7 +620,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
601
620
|
}
|
|
602
621
|
const visibility = {
|
|
603
622
|
userInvocable: ast.header.userInvocable !== false,
|
|
604
|
-
agentInvocable: ast.header.infer === true
|
|
623
|
+
agentInvocable: ast.header.infer !== undefined ? ast.header.infer === true : ast.header.disableModelInvocation !== true
|
|
605
624
|
};
|
|
606
625
|
let model = ast.header.model;
|
|
607
626
|
if (target === Target.Claude && model) {
|
|
@@ -617,6 +636,14 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
617
636
|
if (target === Target.Claude && tools) {
|
|
618
637
|
tools = mapClaudeTools(tools);
|
|
619
638
|
}
|
|
639
|
+
let hooks;
|
|
640
|
+
const useCustomAgentHooks = this.configurationService.getValue(PromptsConfig.USE_CUSTOM_AGENT_HOOKS);
|
|
641
|
+
const hooksRaw = ast.header.hooksRaw;
|
|
642
|
+
if (useCustomAgentHooks && hooksRaw) {
|
|
643
|
+
const hookWorkspaceFolder = this.workspaceService.getWorkspaceFolder(uri) ?? defaultFolder;
|
|
644
|
+
const workspaceRootUri = hookWorkspaceFolder?.uri;
|
|
645
|
+
hooks = parseSubagentHooksFromYaml(hooksRaw, workspaceRootUri, userHome, target);
|
|
646
|
+
}
|
|
620
647
|
return {
|
|
621
648
|
uri,
|
|
622
649
|
name,
|
|
@@ -628,6 +655,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
628
655
|
target,
|
|
629
656
|
visibility,
|
|
630
657
|
agents,
|
|
658
|
+
hooks,
|
|
631
659
|
agentInstructions,
|
|
632
660
|
source
|
|
633
661
|
};
|
|
@@ -748,17 +776,17 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
748
776
|
relative: true
|
|
749
777
|
});
|
|
750
778
|
case PromptsStorage.user:
|
|
751
|
-
return localize(
|
|
779
|
+
return localize(7330, "User Data");
|
|
752
780
|
case PromptsStorage.extension:
|
|
753
781
|
{
|
|
754
782
|
return localize(
|
|
755
|
-
|
|
783
|
+
7331,
|
|
756
784
|
"Extension: {0}",
|
|
757
785
|
promptPath.extension.displayName ?? promptPath.extension.id
|
|
758
786
|
);
|
|
759
787
|
}
|
|
760
788
|
case PromptsStorage.plugin:
|
|
761
|
-
return localize(
|
|
789
|
+
return localize(7332, "Plugin");
|
|
762
790
|
default:
|
|
763
791
|
assertNever(promptPath, "Unknown prompt storage type");
|
|
764
792
|
}
|
|
@@ -971,10 +999,10 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
971
999
|
if (sessionResource) {
|
|
972
1000
|
const elapsed = sw.elapsed();
|
|
973
1001
|
const discoveryInfo = await this.getSkillDiscoveryInfo(token);
|
|
974
|
-
const details = result.length === 1 ? ( localize(
|
|
1002
|
+
const details = result.length === 1 ? ( localize(7333, "Resolved {0} skill in {1}ms", result.length, elapsed.toFixed(1))) : ( localize(7334, "Resolved {0} skills in {1}ms", result.length, elapsed.toFixed(1)));
|
|
975
1003
|
this._onDidLogDiscovery.fire({
|
|
976
1004
|
sessionResource,
|
|
977
|
-
name: ( localize(
|
|
1005
|
+
name: ( localize(7335, "Load Skills")),
|
|
978
1006
|
details,
|
|
979
1007
|
discoveryInfo,
|
|
980
1008
|
category: "discovery"
|
|
@@ -1055,10 +1083,10 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1055
1083
|
const elapsed = sw.elapsed();
|
|
1056
1084
|
const hookCount = result ? ( Object.values(result.hooks)).reduce((sum, arr) => sum + arr.length, 0) : 0;
|
|
1057
1085
|
const discoveryInfo = await this.getHookDiscoveryInfo(token);
|
|
1058
|
-
const details = hookCount === 1 ? ( localize(
|
|
1086
|
+
const details = hookCount === 1 ? ( localize(7336, "Resolved {0} hook in {1}ms", hookCount, elapsed.toFixed(1))) : ( localize(7337, "Resolved {0} hooks in {1}ms", hookCount, elapsed.toFixed(1)));
|
|
1059
1087
|
this._onDidLogDiscovery.fire({
|
|
1060
1088
|
sessionResource,
|
|
1061
|
-
name: ( localize(
|
|
1089
|
+
name: ( localize(7338, "Load Hooks")),
|
|
1062
1090
|
details,
|
|
1063
1091
|
discoveryInfo,
|
|
1064
1092
|
category: "discovery"
|
|
@@ -1073,19 +1101,19 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1073
1101
|
const elapsed = sw.elapsed();
|
|
1074
1102
|
const discoveryInfo = await this.getInstructionsDiscoveryInfo(token);
|
|
1075
1103
|
const details = result.length === 1 ? ( localize(
|
|
1076
|
-
|
|
1104
|
+
7339,
|
|
1077
1105
|
"Resolved {0} instruction in {1}ms",
|
|
1078
1106
|
result.length,
|
|
1079
1107
|
elapsed.toFixed(1)
|
|
1080
1108
|
)) : ( localize(
|
|
1081
|
-
|
|
1109
|
+
7340,
|
|
1082
1110
|
"Resolved {0} instructions in {1}ms",
|
|
1083
1111
|
result.length,
|
|
1084
1112
|
elapsed.toFixed(1)
|
|
1085
1113
|
));
|
|
1086
1114
|
this._onDidLogDiscovery.fire({
|
|
1087
1115
|
sessionResource,
|
|
1088
|
-
name: ( localize(
|
|
1116
|
+
name: ( localize(7341, "Load Instructions")),
|
|
1089
1117
|
details,
|
|
1090
1118
|
discoveryInfo,
|
|
1091
1119
|
category: "discovery"
|
|
@@ -1098,22 +1126,16 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1098
1126
|
if (!useChatHooks) {
|
|
1099
1127
|
return undefined;
|
|
1100
1128
|
}
|
|
1129
|
+
if (!this.workspaceTrustService.isWorkspaceTrusted()) {
|
|
1130
|
+
return undefined;
|
|
1131
|
+
}
|
|
1101
1132
|
const useClaudeHooks = this.configurationService.getValue(PromptsConfig.USE_CLAUDE_HOOKS);
|
|
1102
1133
|
const hookFiles = await this.listPromptFiles(PromptsType.hook, token);
|
|
1103
1134
|
this.logger.trace(`[PromptsService] Found ${hookFiles.length} hook file(s).`);
|
|
1104
1135
|
const userHomeUri = await this.pathService.userHome();
|
|
1105
1136
|
const userHome = userHomeUri.scheme === Schemas.file ? userHomeUri.fsPath : userHomeUri.path;
|
|
1106
1137
|
let hasDisabledClaudeHooks = false;
|
|
1107
|
-
const collectedHooks =
|
|
1108
|
-
[HookType.SessionStart]: [],
|
|
1109
|
-
[HookType.UserPromptSubmit]: [],
|
|
1110
|
-
[HookType.PreToolUse]: [],
|
|
1111
|
-
[HookType.PostToolUse]: [],
|
|
1112
|
-
[HookType.PreCompact]: [],
|
|
1113
|
-
[HookType.SubagentStart]: [],
|
|
1114
|
-
[HookType.SubagentStop]: [],
|
|
1115
|
-
[HookType.Stop]: []
|
|
1116
|
-
};
|
|
1138
|
+
const collectedHooks = ( new Map());
|
|
1117
1139
|
const defaultFolder = this.workspaceService.getWorkspace().folders[0];
|
|
1118
1140
|
for (const hookFile of hookFiles) {
|
|
1119
1141
|
try {
|
|
@@ -1150,7 +1172,12 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1150
1172
|
hooks: commands
|
|
1151
1173
|
}] of hooks) {
|
|
1152
1174
|
for (const command of commands) {
|
|
1153
|
-
collectedHooks
|
|
1175
|
+
let bucket = collectedHooks.get(hookType);
|
|
1176
|
+
if (!bucket) {
|
|
1177
|
+
bucket = [];
|
|
1178
|
+
collectedHooks.set(hookType, bucket);
|
|
1179
|
+
}
|
|
1180
|
+
bucket.push(command);
|
|
1154
1181
|
this.logger.trace(
|
|
1155
1182
|
`[PromptsService] Collected ${hookType} hook from ${hookFile.uri} (format: ${format})`
|
|
1156
1183
|
);
|
|
@@ -1163,17 +1190,19 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1163
1190
|
const plugins = this.agentPluginService.plugins.get();
|
|
1164
1191
|
for (const plugin of plugins) {
|
|
1165
1192
|
for (const hook of plugin.hooks.get()) {
|
|
1166
|
-
collectedHooks
|
|
1193
|
+
let bucket = collectedHooks.get(hook.type);
|
|
1194
|
+
if (!bucket) {
|
|
1195
|
+
bucket = [];
|
|
1196
|
+
collectedHooks.set(hook.type, bucket);
|
|
1197
|
+
}
|
|
1198
|
+
bucket.push(...hook.hooks);
|
|
1167
1199
|
}
|
|
1168
1200
|
}
|
|
1169
|
-
|
|
1170
|
-
if (!hasHooks) {
|
|
1201
|
+
if (collectedHooks.size === 0) {
|
|
1171
1202
|
this.logger.trace("[PromptsService] No valid hooks collected.");
|
|
1172
1203
|
return undefined;
|
|
1173
1204
|
}
|
|
1174
|
-
const result = Object.fromEntries(
|
|
1175
|
-
Object.entries(collectedHooks).filter(([_, commands]) => commands.length > 0)
|
|
1176
|
-
);
|
|
1205
|
+
const result = Object.fromEntries(collectedHooks);
|
|
1177
1206
|
this.logger.trace(`[PromptsService] Collected hooks: ${JSON.stringify(( Object.keys(result)))}`);
|
|
1178
1207
|
return {
|
|
1179
1208
|
hooks: result,
|
|
@@ -1184,7 +1213,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1184
1213
|
if (sessionResource) {
|
|
1185
1214
|
this._onDidLogDiscovery.fire({
|
|
1186
1215
|
sessionResource,
|
|
1187
|
-
name: ( localize(
|
|
1216
|
+
name: ( localize(7342, "Discovery {0} (Start)", type)),
|
|
1188
1217
|
category: "discovery"
|
|
1189
1218
|
});
|
|
1190
1219
|
}
|
|
@@ -1216,10 +1245,10 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1216
1245
|
};
|
|
1217
1246
|
}
|
|
1218
1247
|
if (sessionResource) {
|
|
1219
|
-
const details = ( localize(
|
|
1248
|
+
const details = ( localize(7343, "{0} loaded, {1} skipped", loadedCount, skippedCount));
|
|
1220
1249
|
this._onDidLogDiscovery.fire({
|
|
1221
1250
|
sessionResource,
|
|
1222
|
-
name: ( localize(
|
|
1251
|
+
name: ( localize(7344, "Discovery {0} (End)", type)),
|
|
1223
1252
|
details,
|
|
1224
1253
|
discoveryInfo: result,
|
|
1225
1254
|
category: "discovery"
|
|
@@ -1533,6 +1562,17 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1533
1562
|
const storage = promptPath.storage;
|
|
1534
1563
|
const extensionId = promptPath.extension?.identifier?.value;
|
|
1535
1564
|
const name = basename(uri);
|
|
1565
|
+
if (!this.workspaceTrustService.isWorkspaceTrusted()) {
|
|
1566
|
+
files.push({
|
|
1567
|
+
uri: promptPath.uri,
|
|
1568
|
+
storage: promptPath.storage,
|
|
1569
|
+
status: "skipped",
|
|
1570
|
+
skipReason: "workspace-untrusted",
|
|
1571
|
+
name: basename(promptPath.uri),
|
|
1572
|
+
extensionId: promptPath.extension?.identifier?.value
|
|
1573
|
+
});
|
|
1574
|
+
continue;
|
|
1575
|
+
}
|
|
1536
1576
|
if (getHookSourceFormat(uri) === HookSourceFormat.Claude && useClaudeHooks === false) {
|
|
1537
1577
|
files.push({
|
|
1538
1578
|
uri,
|
|
@@ -1602,7 +1642,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
1602
1642
|
};
|
|
1603
1643
|
}
|
|
1604
1644
|
};
|
|
1605
|
-
PromptsService = ( __decorate([( __param(0, ILogService)), ( __param(1, ILabelService)), ( __param(2, IModelService)), ( __param(3, IInstantiationService)), ( __param(4, IUserDataProfileService)), ( __param(5, IConfigurationService)), ( __param(6, IFileService)), ( __param(7, IFilesConfigurationService)), ( __param(8, IStorageService)), ( __param(9, IExtensionService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkspaceContextService)), ( __param(12, IPathService)), ( __param(13, IContextKeyService)), ( __param(14, IAgentPluginService))], PromptsService));
|
|
1645
|
+
PromptsService = ( __decorate([( __param(0, ILogService)), ( __param(1, ILabelService)), ( __param(2, IModelService)), ( __param(3, IInstantiationService)), ( __param(4, IUserDataProfileService)), ( __param(5, IConfigurationService)), ( __param(6, IFileService)), ( __param(7, IFilesConfigurationService)), ( __param(8, IStorageService)), ( __param(9, IExtensionService)), ( __param(10, ITelemetryService)), ( __param(11, IWorkspaceContextService)), ( __param(12, IPathService)), ( __param(13, IContextKeyService)), ( __param(14, IAgentPluginService)), ( __param(15, IWorkspaceTrustManagementService))], PromptsService));
|
|
1606
1646
|
class CachedPromise extends Disposable {
|
|
1607
1647
|
constructor(computeFn, getEvent, delay = 0) {
|
|
1608
1648
|
super();
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts
CHANGED
|
@@ -113,7 +113,9 @@ export declare class PromptFilesLocator {
|
|
|
113
113
|
private toAbsoluteLocations;
|
|
114
114
|
/**
|
|
115
115
|
* Uses the file service to resolve the provided location and return either the file at the location of files in the directory.
|
|
116
|
-
* For
|
|
116
|
+
* For instruction folders, this searches recursively (up to {@link MAX_INSTRUCTIONS_RECURSION_DEPTH} levels deep) provided
|
|
117
|
+
* the location is not a workspace folder root and does not contain wildcards, to support subdirectories while avoiding
|
|
118
|
+
* accidentally broad traversal.
|
|
117
119
|
*/
|
|
118
120
|
private resolveFilesAtLocation;
|
|
119
121
|
/**
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js
CHANGED
|
@@ -7,10 +7,10 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
|
7
7
|
import { FileOperationError, FileOperationResult } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
8
8
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
9
9
|
import { PromptsConfig, isTildePath, getPromptFileLocationsConfigKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
10
|
-
import { dirname, joinPath, basename, isEqualOrParent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
10
|
+
import { dirname, joinPath, basename, isEqual, isEqualOrParent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
11
11
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
12
12
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
13
|
-
import { getPromptFileType, PromptFileSource, getPromptFileDefaultLocations, getPromptFileExtension,
|
|
13
|
+
import { getPromptFileType, PromptFileSource, getPromptFileDefaultLocations, getPromptFileExtension, COPILOT_CUSTOM_INSTRUCTIONS_FILENAME, LEGACY_MODE_FILE_EXTENSION, AGENTS_SOURCE_FOLDER, getCleanPromptName, AGENT_FILE_EXTENSION, SKILL_FILENAME } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
14
14
|
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
15
15
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
16
16
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
@@ -24,6 +24,7 @@ import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/com
|
|
|
24
24
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
25
25
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
26
26
|
|
|
27
|
+
const MAX_INSTRUCTIONS_RECURSION_DEPTH = 5;
|
|
27
28
|
let PromptFilesLocator = class PromptFilesLocator {
|
|
28
29
|
constructor(
|
|
29
30
|
fileService,
|
|
@@ -90,7 +91,7 @@ let PromptFilesLocator = class PromptFilesLocator {
|
|
|
90
91
|
uri: userDataPromptsHome,
|
|
91
92
|
source: PromptFileSource.CopilotPersonal,
|
|
92
93
|
storage: PromptsStorage.user,
|
|
93
|
-
displayPath: ( localize(
|
|
94
|
+
displayPath: ( localize(7345, "User Data")),
|
|
94
95
|
isDefault: true
|
|
95
96
|
}];
|
|
96
97
|
}
|
|
@@ -373,11 +374,12 @@ let PromptFilesLocator = class PromptFilesLocator {
|
|
|
373
374
|
}
|
|
374
375
|
return result;
|
|
375
376
|
}
|
|
376
|
-
async resolveFilesAtLocation(location, type, token) {
|
|
377
|
+
async resolveFilesAtLocation(location, type, token, depth = 0) {
|
|
377
378
|
if (type === PromptsType.skill) {
|
|
378
379
|
return this.findAgentSkillsInFolder(location, token);
|
|
379
380
|
}
|
|
380
|
-
const
|
|
381
|
+
const isWorkspaceRoot = depth === 0 && ( this.getWorkspaceFolders().some(f => isEqual(f.uri, location)));
|
|
382
|
+
const recursive = type === PromptsType.instructions && !isWorkspaceRoot && !hasGlobPattern(location.path) && depth < MAX_INSTRUCTIONS_RECURSION_DEPTH;
|
|
381
383
|
try {
|
|
382
384
|
const info = await this.fileService.resolve(location);
|
|
383
385
|
if (token.isCancellationRequested) {
|
|
@@ -391,7 +393,7 @@ let PromptFilesLocator = class PromptFilesLocator {
|
|
|
391
393
|
if (child.isFile) {
|
|
392
394
|
result.push(child.resource);
|
|
393
395
|
} else if (recursive && child.isDirectory) {
|
|
394
|
-
const subFiles = await this.resolveFilesAtLocation(child.resource, type, token);
|
|
396
|
+
const subFiles = await this.resolveFilesAtLocation(child.resource, type, token, depth + 1);
|
|
395
397
|
result.push(...subFiles);
|
|
396
398
|
}
|
|
397
399
|
}
|
|
@@ -20,7 +20,7 @@ var PhraseTextType;
|
|
|
20
20
|
})(PhraseTextType || (PhraseTextType = {}));
|
|
21
21
|
const VoiceChatInProgress = ( new RawContextKey("voiceChatInProgress", false, {
|
|
22
22
|
type: "boolean",
|
|
23
|
-
description: ( localize(
|
|
23
|
+
description: ( localize(7406, "A speech-to-text session is in progress for chat."))
|
|
24
24
|
}));
|
|
25
25
|
let VoiceChatService = class VoiceChatService extends Disposable {
|
|
26
26
|
static {
|
|
@@ -6,14 +6,22 @@ import { FileSystemProviderCapabilities, FileType, IFileSystemProviderWithFileAt
|
|
|
6
6
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
7
7
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
8
8
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
9
|
-
|
|
9
|
+
import { IChatResponseResourceFileSystemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service";
|
|
10
|
+
export declare class ChatResponseResourceFileSystemProvider extends Disposable implements IChatResponseResourceFileSystemProvider, IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileReadStreamCapability {
|
|
10
11
|
private readonly chatService;
|
|
11
12
|
private readonly _fileService;
|
|
12
|
-
|
|
13
|
+
readonly _serviceBrand: undefined;
|
|
13
14
|
readonly onDidChangeCapabilities: Event<any>;
|
|
14
15
|
readonly onDidChangeFile: Event<any>;
|
|
15
16
|
readonly capabilities: FileSystemProviderCapabilities;
|
|
17
|
+
/** In-memory store for data associated via {@link associate}, keyed by URI. */
|
|
18
|
+
private readonly _associated;
|
|
19
|
+
/** Tracks which associated URIs belong to which session, for cleanup on dispose. */
|
|
20
|
+
private readonly _sessionAssociations;
|
|
16
21
|
constructor(chatService: IChatService, _fileService: IFileService);
|
|
22
|
+
associate(sessionResource: URI, data: Uint8Array | {
|
|
23
|
+
base64: string;
|
|
24
|
+
}, name?: string): URI;
|
|
17
25
|
readFile(resource: URI): Promise<Uint8Array>;
|
|
18
26
|
readFileStream(resource: URI): ReadableStreamEvents<Uint8Array>;
|
|
19
27
|
stat(resource: URI): Promise<IStat>;
|
|
@@ -29,3 +37,7 @@ export declare class ChatResponseResourceFileSystemProvider extends Disposable i
|
|
|
29
37
|
private findMatchingInvocation;
|
|
30
38
|
private lookupURI;
|
|
31
39
|
}
|
|
40
|
+
export declare class ChatResponseResourceWorkbenchContribution extends Disposable implements IWorkbenchContribution {
|
|
41
|
+
static readonly ID = "chatResponseResourceWorkbenchContribution";
|
|
42
|
+
constructor(chatResponseResourceFsProvider: IChatResponseResourceFileSystemProvider, fileService: IFileService);
|
|
43
|
+
}
|
package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js
CHANGED
|
@@ -3,18 +3,19 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { VSBuffer, decodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
4
|
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
5
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
7
|
import { newWriteableStream } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stream';
|
|
8
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
9
|
+
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
7
10
|
import { FileSystemProviderCapabilities, FileType, createFileSystemProviderError, FileSystemProviderErrorCode } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
8
11
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
9
12
|
import { ChatResponseResource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel';
|
|
10
13
|
import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
11
14
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
12
15
|
import { isToolResultInputOutputDetails } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
16
|
+
import { IChatResponseResourceFileSystemProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service';
|
|
13
17
|
|
|
14
18
|
let ChatResponseResourceFileSystemProvider = class ChatResponseResourceFileSystemProvider extends Disposable {
|
|
15
|
-
static {
|
|
16
|
-
this.ID = "workbench.contrib.chatResponseResourceFileSystemProvider";
|
|
17
|
-
}
|
|
18
19
|
constructor(chatService, _fileService) {
|
|
19
20
|
super();
|
|
20
21
|
this.chatService = chatService;
|
|
@@ -22,7 +23,34 @@ let ChatResponseResourceFileSystemProvider = class ChatResponseResourceFileSyste
|
|
|
22
23
|
this.onDidChangeCapabilities = Event.None;
|
|
23
24
|
this.onDidChangeFile = Event.None;
|
|
24
25
|
this.capabilities = FileSystemProviderCapabilities.None | FileSystemProviderCapabilities.Readonly | FileSystemProviderCapabilities.PathCaseSensitive | FileSystemProviderCapabilities.FileReadStream | FileSystemProviderCapabilities.FileAtomicRead | FileSystemProviderCapabilities.FileReadWrite;
|
|
25
|
-
this.
|
|
26
|
+
this._associated = ( new ResourceMap());
|
|
27
|
+
this._sessionAssociations = ( new ResourceMap());
|
|
28
|
+
this._register(this.chatService.onDidDisposeSession(e => {
|
|
29
|
+
for (const sessionResource of e.sessionResource) {
|
|
30
|
+
const uris = this._sessionAssociations.get(sessionResource);
|
|
31
|
+
if (uris) {
|
|
32
|
+
for (const uri of uris) {
|
|
33
|
+
this._associated.delete(uri);
|
|
34
|
+
}
|
|
35
|
+
this._sessionAssociations.delete(sessionResource);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
associate(sessionResource, data, name) {
|
|
41
|
+
const id = generateUuid();
|
|
42
|
+
const uri = ( URI.from({
|
|
43
|
+
scheme: ChatResponseResource.scheme,
|
|
44
|
+
path: `/assoc/${id}` + (name ? `/${name}` : "")
|
|
45
|
+
}));
|
|
46
|
+
this._associated.set(uri, data);
|
|
47
|
+
let set = this._sessionAssociations.get(sessionResource);
|
|
48
|
+
if (!set) {
|
|
49
|
+
set = ( new ResourceSet());
|
|
50
|
+
this._sessionAssociations.set(sessionResource, set);
|
|
51
|
+
}
|
|
52
|
+
set.add(uri);
|
|
53
|
+
return uri;
|
|
26
54
|
}
|
|
27
55
|
readFile(resource) {
|
|
28
56
|
return Promise.resolve(this.lookupURI(resource));
|
|
@@ -89,6 +117,15 @@ let ChatResponseResourceFileSystemProvider = class ChatResponseResourceFileSyste
|
|
|
89
117
|
throw createFileSystemProviderError(`File not found`, FileSystemProviderErrorCode.FileNotFound);
|
|
90
118
|
}
|
|
91
119
|
lookupURI(uri) {
|
|
120
|
+
const associated = this._associated.get(uri);
|
|
121
|
+
if (associated) {
|
|
122
|
+
if (associated instanceof Uint8Array) {
|
|
123
|
+
return associated;
|
|
124
|
+
}
|
|
125
|
+
const decoded = decodeBase64(associated.base64).buffer;
|
|
126
|
+
this._associated.set(uri, decoded);
|
|
127
|
+
return decoded;
|
|
128
|
+
}
|
|
92
129
|
const {
|
|
93
130
|
result,
|
|
94
131
|
index
|
|
@@ -108,5 +145,17 @@ let ChatResponseResourceFileSystemProvider = class ChatResponseResourceFileSyste
|
|
|
108
145
|
}
|
|
109
146
|
};
|
|
110
147
|
ChatResponseResourceFileSystemProvider = ( __decorate([( __param(0, IChatService)), ( __param(1, IFileService))], ChatResponseResourceFileSystemProvider));
|
|
148
|
+
let ChatResponseResourceWorkbenchContribution = class ChatResponseResourceWorkbenchContribution extends Disposable {
|
|
149
|
+
static {
|
|
150
|
+
this.ID = "chatResponseResourceWorkbenchContribution";
|
|
151
|
+
}
|
|
152
|
+
constructor(chatResponseResourceFsProvider, fileService) {
|
|
153
|
+
super();
|
|
154
|
+
this._register(
|
|
155
|
+
fileService.registerProvider(ChatResponseResource.scheme, chatResponseResourceFsProvider)
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
ChatResponseResourceWorkbenchContribution = ( __decorate([( __param(0, IChatResponseResourceFileSystemProvider)), ( __param(1, IFileService))], ChatResponseResourceWorkbenchContribution));
|
|
111
160
|
|
|
112
|
-
export { ChatResponseResourceFileSystemProvider };
|
|
161
|
+
export { ChatResponseResourceFileSystemProvider, ChatResponseResourceWorkbenchContribution };
|
|
@@ -3,7 +3,7 @@ import './inlineChatDefaultModel.js';
|
|
|
3
3
|
import { registerEditorContribution, EditorContributionInstantiation } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
4
4
|
import { registerAction2, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
5
5
|
import { InlineChatController } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
6
|
-
import { KeepSessionAction2, UndoSessionAction2, UndoAndCloseSessionAction2, CancelSessionAction, StartSessionAction, AskInChatAction, FocusInlineChat, SubmitInlineChatInputAction, QueueInChatAction, HideInlineChatInputAction, FixDiagnosticsAction } from './inlineChatActions.js';
|
|
6
|
+
import { KeepSessionAction2, UndoSessionAction2, UndoAndCloseSessionAction2, CancelSessionAction, StartSessionAction, AskInChatAction, FocusInlineChat, SubmitInlineChatInputAction, QueueInChatAction, HideInlineChatInputAction, FixDiagnosticsAction, DismissEditorAffordanceAction } from './inlineChatActions.js';
|
|
7
7
|
import { CTX_INLINE_CHAT_REQUEST_IN_PROGRESS, CTX_INLINE_CHAT_EDITING, CTX_INLINE_CHAT_V1_ENABLED, MENU_INLINE_CHAT_WIDGET_STATUS } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
8
8
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
9
9
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
@@ -33,7 +33,7 @@ const editActionMenuItem = {
|
|
|
33
33
|
order: 0,
|
|
34
34
|
command: {
|
|
35
35
|
id: ChatSubmitAction.ID,
|
|
36
|
-
title: ( localize(
|
|
36
|
+
title: ( localize(9634, "Edit Code"))
|
|
37
37
|
},
|
|
38
38
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), CTX_INLINE_CHAT_EDITING, CTX_INLINE_CHAT_V1_ENABLED))
|
|
39
39
|
};
|
|
@@ -42,7 +42,7 @@ const generateActionMenuItem = {
|
|
|
42
42
|
order: 0,
|
|
43
43
|
command: {
|
|
44
44
|
id: ChatSubmitAction.ID,
|
|
45
|
-
title: ( localize(
|
|
45
|
+
title: ( localize(9635, "Generate"))
|
|
46
46
|
},
|
|
47
47
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), ( CTX_INLINE_CHAT_EDITING.toNegated()), CTX_INLINE_CHAT_V1_ENABLED))
|
|
48
48
|
};
|
|
@@ -53,8 +53,8 @@ const cancelActionMenuItem = {
|
|
|
53
53
|
order: 0,
|
|
54
54
|
command: {
|
|
55
55
|
id: CancelAction.ID,
|
|
56
|
-
title: ( localize(
|
|
57
|
-
shortTitle: ( localize(
|
|
56
|
+
title: ( localize(9636, "Cancel Request")),
|
|
57
|
+
shortTitle: ( localize(9637, "Cancel"))
|
|
58
58
|
},
|
|
59
59
|
when: ( ContextKeyExpr.and(CTX_INLINE_CHAT_REQUEST_IN_PROGRESS))
|
|
60
60
|
};
|
|
@@ -66,6 +66,7 @@ registerAction2(SubmitInlineChatInputAction);
|
|
|
66
66
|
registerAction2(QueueInChatAction);
|
|
67
67
|
registerAction2(HideInlineChatInputAction);
|
|
68
68
|
registerAction2(FixDiagnosticsAction);
|
|
69
|
+
registerAction2(DismissEditorAffordanceAction);
|
|
69
70
|
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
70
71
|
workbenchContributionsRegistry.registerWorkbenchContribution(InlineChatNotebookContribution, LifecyclePhase.Restored);
|
|
71
72
|
registerWorkbenchContribution2(InlineChatEnabler.Id, InlineChatEnabler, WorkbenchPhase.AfterRestored);
|