@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
|
@@ -14,17 +14,18 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
14
14
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
15
|
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
16
16
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
17
|
-
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
17
|
+
import { Target, PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
18
18
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
19
19
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
20
20
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
21
|
-
import {
|
|
21
|
+
import { HOOKS_BY_TARGET, HOOK_METADATA } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookTypes';
|
|
22
|
+
import { formatHookCommandLabel, getEffectiveCommandFieldKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookSchema';
|
|
22
23
|
import { resolveCopilotCliHookType, getCopilotCliHookTypeName } from '../../common/promptSyntax/hookCopilotCliCompat.js';
|
|
23
24
|
import { getHookSourceFormat, HookSourceFormat, buildNewHookEntry } from '../../common/promptSyntax/hookCompatibility.js';
|
|
24
25
|
import { getClaudeHookTypeName, resolveClaudeHookType } from '../../common/promptSyntax/hookClaudeCompat.js';
|
|
25
26
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
26
27
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
27
|
-
import { findHookCommandSelection, parseAllHookFiles } from './hookUtils.js';
|
|
28
|
+
import { findHookCommandSelection, parseAllHookFiles, findHookCommandInYaml } from './hookUtils.js';
|
|
28
29
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
29
30
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
30
31
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
@@ -33,7 +34,7 @@ import { IBulkEditService } from '@codingame/monaco-vscode-api/vscode/vs/editor/
|
|
|
33
34
|
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
34
35
|
import { getCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
35
36
|
import { IRemoteAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
36
|
-
import { OS } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
37
|
+
import { OS, OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
37
38
|
|
|
38
39
|
const CONFIGURE_HOOKS_ACTION_ID = "workbench.action.chat.configure.hooks";
|
|
39
40
|
function usesCopilotCliNaming(hooksObj) {
|
|
@@ -73,7 +74,7 @@ async function addHookToFile(
|
|
|
73
74
|
}
|
|
74
75
|
} catch {
|
|
75
76
|
notificationService.error(( localize(
|
|
76
|
-
|
|
77
|
+
6273,
|
|
77
78
|
"Failed to parse existing hooks file. Please fix the JSON syntax errors and try again."
|
|
78
79
|
)));
|
|
79
80
|
await editorService.openEditor({
|
|
@@ -156,7 +157,7 @@ async function addHookToFile(
|
|
|
156
157
|
range: ( new Range(1, 1, Number.MAX_SAFE_INTEGER, 1)),
|
|
157
158
|
text: jsonContent
|
|
158
159
|
}))], {
|
|
159
|
-
label: ( localize(
|
|
160
|
+
label: ( localize(6274, "Add Hook"))
|
|
160
161
|
});
|
|
161
162
|
const selection = findHookCommandSelection(jsonContent, keyToUse, newHookIndex, "command");
|
|
162
163
|
await editorService.openEditor({
|
|
@@ -181,7 +182,7 @@ async function addHookToFile(
|
|
|
181
182
|
range: ( new Range(1, 1, Number.MAX_SAFE_INTEGER, 1)),
|
|
182
183
|
text: jsonContent
|
|
183
184
|
}))], {
|
|
184
|
-
label: ( localize(
|
|
185
|
+
label: ( localize(6274, "Add Hook"))
|
|
185
186
|
});
|
|
186
187
|
}
|
|
187
188
|
const selection = findHookCommandSelection(jsonContent, keyToUse, newHookIndex, "command");
|
|
@@ -232,7 +233,7 @@ var Step;
|
|
|
232
233
|
Step[Step["SelectFolder"] = 4] = "SelectFolder";
|
|
233
234
|
Step[Step["EnterFilename"] = 5] = "EnterFilename";
|
|
234
235
|
})(Step || (Step = {}));
|
|
235
|
-
async function showConfigureHooksQuickPick(accessor,
|
|
236
|
+
async function showConfigureHooksQuickPick(accessor, options) {
|
|
236
237
|
const promptsService = accessor.get(IPromptsService);
|
|
237
238
|
const quickInputService = accessor.get(IQuickInputService);
|
|
238
239
|
const fileService = accessor.get(IFileService);
|
|
@@ -256,7 +257,9 @@ async function showConfigureHooksQuickPick(accessor, callbacks) {
|
|
|
256
257
|
workspaceRootUri,
|
|
257
258
|
userHome,
|
|
258
259
|
targetOS,
|
|
259
|
-
CancellationToken.None
|
|
260
|
+
CancellationToken.None,
|
|
261
|
+
{
|
|
262
|
+
}
|
|
260
263
|
);
|
|
261
264
|
const hookCountByType = ( new Map());
|
|
262
265
|
for (const entry of hookEntries) {
|
|
@@ -267,12 +270,6 @@ async function showConfigureHooksQuickPick(accessor, callbacks) {
|
|
|
267
270
|
useSeparators: true
|
|
268
271
|
}));
|
|
269
272
|
const backButton = quickInputService.backButton;
|
|
270
|
-
let suppressHideDispose = false;
|
|
271
|
-
store.add(picker.onDidHide(() => {
|
|
272
|
-
if (!suppressHideDispose) {
|
|
273
|
-
store.dispose();
|
|
274
|
-
}
|
|
275
|
-
}));
|
|
276
273
|
picker.show();
|
|
277
274
|
let step = Step.SelectHookType;
|
|
278
275
|
let selectedHookType;
|
|
@@ -281,315 +278,381 @@ async function showConfigureHooksQuickPick(accessor, callbacks) {
|
|
|
281
278
|
let selectedFolder;
|
|
282
279
|
const stepHistory = [];
|
|
283
280
|
const goBack = () => stepHistory.pop();
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
281
|
+
try {
|
|
282
|
+
while (true) {
|
|
283
|
+
switch (step) {
|
|
284
|
+
case Step.SelectHookType:
|
|
285
|
+
{
|
|
286
|
+
const makeItem = ([hookType, meta]) => {
|
|
287
|
+
const count = hookCountByType.get(hookType) ?? 0;
|
|
288
|
+
const countLabel = count > 0 ? ` (${count})` : "";
|
|
289
|
+
return {
|
|
290
|
+
label: `${meta.label}${countLabel}`,
|
|
291
|
+
description: meta.description,
|
|
292
|
+
hookType,
|
|
293
|
+
hookTypeMeta: meta
|
|
294
|
+
};
|
|
295
295
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
});
|
|
330
|
-
hookItems.push({
|
|
331
|
-
label: entry.commandLabel,
|
|
332
|
-
description,
|
|
333
|
-
hookEntry: entry
|
|
334
|
-
});
|
|
296
|
+
let pickerItems;
|
|
297
|
+
if (options?.target) {
|
|
298
|
+
const targetHookTypes = ( new Set(( Object.values(HOOKS_BY_TARGET[options.target]))));
|
|
299
|
+
pickerItems = ( Object.entries(HOOK_METADATA).filter(([hookType]) => ( targetHookTypes.has(hookType))).map(makeItem));
|
|
300
|
+
} else {
|
|
301
|
+
const vscodeTypes = ( new Set(( Object.values(HOOKS_BY_TARGET[Target.VSCode]))));
|
|
302
|
+
const copilotTypes = ( new Set(( Object.values(HOOKS_BY_TARGET[Target.GitHubCopilot]))));
|
|
303
|
+
const allEntries = Object.entries(HOOK_METADATA);
|
|
304
|
+
const shared = allEntries.filter(([h]) => ( vscodeTypes.has(h)) && ( copilotTypes.has(h)));
|
|
305
|
+
const vscodeOnly = allEntries.filter(([h]) => ( vscodeTypes.has(h)) && !( copilotTypes.has(h)));
|
|
306
|
+
const copilotOnly = allEntries.filter(([h]) => !( vscodeTypes.has(h)) && ( copilotTypes.has(h)));
|
|
307
|
+
pickerItems = [];
|
|
308
|
+
if (shared.length > 0) {
|
|
309
|
+
pickerItems.push({
|
|
310
|
+
type: "separator",
|
|
311
|
+
label: ( localize(6275, "Local/Copilot CLI Agents"))
|
|
312
|
+
});
|
|
313
|
+
pickerItems.push(...( shared.map(makeItem)));
|
|
314
|
+
}
|
|
315
|
+
if (vscodeOnly.length > 0) {
|
|
316
|
+
pickerItems.push({
|
|
317
|
+
type: "separator",
|
|
318
|
+
label: ( localize(6276, "Local Agents"))
|
|
319
|
+
});
|
|
320
|
+
pickerItems.push(...( vscodeOnly.map(makeItem)));
|
|
321
|
+
}
|
|
322
|
+
if (copilotOnly.length > 0) {
|
|
323
|
+
pickerItems.push({
|
|
324
|
+
type: "separator",
|
|
325
|
+
label: ( localize(6277, "Copilot CLI Agents"))
|
|
326
|
+
});
|
|
327
|
+
pickerItems.push(...( copilotOnly.map(makeItem)));
|
|
328
|
+
}
|
|
335
329
|
}
|
|
336
|
-
|
|
337
|
-
if (hooksOfType.length === 0) {
|
|
338
|
-
selectedHook = hookItems[0];
|
|
339
|
-
} else {
|
|
340
|
-
picker.items = hookItems;
|
|
330
|
+
picker.items = pickerItems;
|
|
341
331
|
picker.value = "";
|
|
342
|
-
picker.placeholder = ( localize(
|
|
343
|
-
picker.title =
|
|
344
|
-
picker.buttons = [
|
|
332
|
+
picker.placeholder = ( localize(6278, "Select a lifecycle event"));
|
|
333
|
+
picker.title = ( localize(6279, "Hooks"));
|
|
334
|
+
picker.buttons = [];
|
|
345
335
|
const result = await awaitPick(picker, backButton);
|
|
346
|
-
if (result === "back") {
|
|
347
|
-
step = goBack() ?? Step.SelectHookType;
|
|
348
|
-
break;
|
|
349
|
-
}
|
|
350
|
-
if (!result) {
|
|
351
|
-
picker.hide();
|
|
336
|
+
if (!result || result === "back") {
|
|
352
337
|
return;
|
|
353
338
|
}
|
|
354
|
-
|
|
355
|
-
stepHistory.push(Step.
|
|
339
|
+
selectedHookType = result;
|
|
340
|
+
stepHistory.push(Step.SelectHookType);
|
|
341
|
+
step = Step.SelectHook;
|
|
342
|
+
break;
|
|
356
343
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if (
|
|
369
|
-
|
|
370
|
-
|
|
344
|
+
case Step.SelectHook:
|
|
345
|
+
{
|
|
346
|
+
const hooksOfType = hookEntries.filter(h => h.hookType === selectedHookType.hookType);
|
|
347
|
+
const fileHooks = hooksOfType.filter(h => !h.agentName);
|
|
348
|
+
const agentHooks = hooksOfType.filter(h => h.agentName);
|
|
349
|
+
const hookItems = [];
|
|
350
|
+
hookItems.push({
|
|
351
|
+
label: `$(plus) ${( localize(6280, "Add new hook..."))}`,
|
|
352
|
+
isAddNewHook: true,
|
|
353
|
+
alwaysShow: true
|
|
354
|
+
});
|
|
355
|
+
if (fileHooks.length > 0) {
|
|
356
|
+
hookItems.push({
|
|
357
|
+
type: "separator",
|
|
358
|
+
label: ( localize(6281, "Existing Hooks"))
|
|
371
359
|
});
|
|
360
|
+
for (const entry of fileHooks) {
|
|
361
|
+
const description = labelService.getUriLabel(entry.fileUri, {
|
|
362
|
+
relative: true
|
|
363
|
+
});
|
|
364
|
+
hookItems.push({
|
|
365
|
+
label: entry.commandLabel,
|
|
366
|
+
description,
|
|
367
|
+
hookEntry: entry
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (agentHooks.length > 0) {
|
|
372
|
+
const agentNames = [...( new Set(( agentHooks.map(h => h.agentName))))];
|
|
373
|
+
for (const agentName of agentNames) {
|
|
374
|
+
hookItems.push({
|
|
375
|
+
type: "separator",
|
|
376
|
+
label: ( localize(6282, "Agent: {0}", agentName))
|
|
377
|
+
});
|
|
378
|
+
for (const entry of agentHooks.filter(h => h.agentName === agentName)) {
|
|
379
|
+
const description = labelService.getUriLabel(entry.fileUri, {
|
|
380
|
+
relative: true
|
|
381
|
+
});
|
|
382
|
+
hookItems.push({
|
|
383
|
+
label: entry.commandLabel,
|
|
384
|
+
description,
|
|
385
|
+
hookEntry: entry
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (hooksOfType.length === 0) {
|
|
391
|
+
selectedHook = hookItems[0];
|
|
372
392
|
} else {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
393
|
+
picker.items = hookItems;
|
|
394
|
+
picker.value = "";
|
|
395
|
+
picker.placeholder = ( localize(6283, "Select a hook to open or add a new one"));
|
|
396
|
+
picker.title = selectedHookType.hookTypeMeta.label;
|
|
397
|
+
picker.buttons = [backButton];
|
|
398
|
+
const result = await awaitPick(picker, backButton);
|
|
399
|
+
if (result === "back") {
|
|
400
|
+
step = goBack() ?? Step.SelectHookType;
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
if (!result) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
selectedHook = result;
|
|
407
|
+
stepHistory.push(Step.SelectHook);
|
|
408
|
+
}
|
|
409
|
+
if (selectedHook.hookEntry) {
|
|
410
|
+
const entry = selectedHook.hookEntry;
|
|
411
|
+
let selection;
|
|
412
|
+
if (entry.agentName) {
|
|
413
|
+
try {
|
|
414
|
+
const content = await fileService.readFile(entry.fileUri);
|
|
415
|
+
const commandText = formatHookCommandLabel(entry.command, targetOS);
|
|
416
|
+
if (commandText) {
|
|
417
|
+
selection = findHookCommandInYaml(( content.value.toString()), commandText);
|
|
418
|
+
}
|
|
419
|
+
} catch {}
|
|
420
|
+
} else {
|
|
421
|
+
const commandFieldName = getEffectiveCommandFieldKey(entry.command, targetOS);
|
|
422
|
+
if (commandFieldName) {
|
|
423
|
+
try {
|
|
424
|
+
const content = await fileService.readFile(entry.fileUri);
|
|
425
|
+
selection = findHookCommandSelection(( content.value.toString()), entry.originalHookTypeId, entry.index, commandFieldName);
|
|
426
|
+
} catch {}
|
|
378
427
|
}
|
|
379
|
-
}
|
|
428
|
+
}
|
|
429
|
+
if (options?.openEditor) {
|
|
430
|
+
await options.openEditor(entry.fileUri, {
|
|
431
|
+
selection
|
|
432
|
+
});
|
|
433
|
+
} else {
|
|
434
|
+
await editorService.openEditor({
|
|
435
|
+
resource: entry.fileUri,
|
|
436
|
+
options: {
|
|
437
|
+
selection,
|
|
438
|
+
pinned: false
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
return;
|
|
380
443
|
}
|
|
381
|
-
|
|
444
|
+
step = Step.SelectFile;
|
|
445
|
+
break;
|
|
382
446
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
{
|
|
388
|
-
const hookFiles = await promptsService.listPromptFilesForStorage(PromptsType.hook, PromptsStorage.local, CancellationToken.None);
|
|
389
|
-
const fileItems = [];
|
|
390
|
-
fileItems.push({
|
|
391
|
-
label: `$(new-file) ${( localize(6191, "Create new hook config file..."))}`,
|
|
392
|
-
isCreateNewFile: true,
|
|
393
|
-
alwaysShow: true
|
|
394
|
-
});
|
|
395
|
-
if (hookFiles.length > 0) {
|
|
447
|
+
case Step.SelectFile:
|
|
448
|
+
{
|
|
449
|
+
const hookFiles = await promptsService.listPromptFilesForStorage(PromptsType.hook, PromptsStorage.local, CancellationToken.None);
|
|
450
|
+
const fileItems = [];
|
|
396
451
|
fileItems.push({
|
|
397
|
-
|
|
398
|
-
|
|
452
|
+
label: `$(new-file) ${( localize(6284, "Create new hook config file..."))}`,
|
|
453
|
+
isCreateNewFile: true,
|
|
454
|
+
alwaysShow: true
|
|
399
455
|
});
|
|
400
|
-
|
|
401
|
-
const relativePath = labelService.getUriLabel(hookFile.uri, {
|
|
402
|
-
relative: true
|
|
403
|
-
});
|
|
456
|
+
if (hookFiles.length > 0) {
|
|
404
457
|
fileItems.push({
|
|
405
|
-
|
|
406
|
-
|
|
458
|
+
type: "separator",
|
|
459
|
+
label: ( localize(6285, "Existing Hook Files"))
|
|
407
460
|
});
|
|
461
|
+
for (const hookFile of hookFiles) {
|
|
462
|
+
const relativePath = labelService.getUriLabel(hookFile.uri, {
|
|
463
|
+
relative: true
|
|
464
|
+
});
|
|
465
|
+
fileItems.push({
|
|
466
|
+
label: relativePath,
|
|
467
|
+
fileUri: hookFile.uri
|
|
468
|
+
});
|
|
469
|
+
}
|
|
408
470
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
471
|
+
if (hookFiles.length === 0) {
|
|
472
|
+
selectedFile = fileItems[0];
|
|
473
|
+
} else {
|
|
474
|
+
picker.items = fileItems;
|
|
475
|
+
picker.value = "";
|
|
476
|
+
picker.placeholder = ( localize(6286, "Select a hook file or create a new one"));
|
|
477
|
+
picker.title = ( localize(6287, "Add Hook"));
|
|
478
|
+
picker.buttons = [backButton];
|
|
479
|
+
const result = await awaitPick(picker, backButton);
|
|
480
|
+
if (result === "back") {
|
|
481
|
+
step = goBack() ?? Step.SelectHook;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
if (!result) {
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
selectedFile = result;
|
|
488
|
+
stepHistory.push(Step.SelectFile);
|
|
422
489
|
}
|
|
423
|
-
if (
|
|
424
|
-
|
|
490
|
+
if (selectedFile.fileUri) {
|
|
491
|
+
await addHookToFile(
|
|
492
|
+
selectedFile.fileUri,
|
|
493
|
+
selectedHookType.hookType,
|
|
494
|
+
fileService,
|
|
495
|
+
editorService,
|
|
496
|
+
notificationService,
|
|
497
|
+
bulkEditService,
|
|
498
|
+
options?.openEditor
|
|
499
|
+
);
|
|
425
500
|
return;
|
|
426
501
|
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
if (selectedFile.fileUri) {
|
|
431
|
-
picker.hide();
|
|
432
|
-
await addHookToFile(
|
|
433
|
-
selectedFile.fileUri,
|
|
434
|
-
selectedHookType.hookType.id,
|
|
435
|
-
fileService,
|
|
436
|
-
editorService,
|
|
437
|
-
notificationService,
|
|
438
|
-
bulkEditService,
|
|
439
|
-
callbacks?.openEditor
|
|
440
|
-
);
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
step = Step.SelectFolder;
|
|
444
|
-
break;
|
|
445
|
-
}
|
|
446
|
-
case Step.SelectFolder:
|
|
447
|
-
{
|
|
448
|
-
const allFolders = await promptsService.getSourceFolders(PromptsType.hook);
|
|
449
|
-
const localFolders = allFolders.filter(f => f.storage === PromptsStorage.local);
|
|
450
|
-
if (localFolders.length === 0) {
|
|
451
|
-
picker.hide();
|
|
452
|
-
notificationService.error(( localize(6195, "Please open a workspace folder to configure hooks.")));
|
|
453
|
-
return;
|
|
502
|
+
step = Step.SelectFolder;
|
|
503
|
+
break;
|
|
454
504
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
folder
|
|
462
|
-
})));
|
|
463
|
-
picker.items = folderItems;
|
|
464
|
-
picker.value = "";
|
|
465
|
-
picker.placeholder = ( localize(6196, "Select a location for the hook file"));
|
|
466
|
-
picker.title = ( localize(6197, "Hook File Location"));
|
|
467
|
-
picker.buttons = [backButton];
|
|
468
|
-
const result = await awaitPick(picker, backButton);
|
|
469
|
-
if (result === "back") {
|
|
470
|
-
step = goBack() ?? Step.SelectFile;
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
if (!result) {
|
|
474
|
-
picker.hide();
|
|
505
|
+
case Step.SelectFolder:
|
|
506
|
+
{
|
|
507
|
+
const allFolders = await promptsService.getSourceFolders(PromptsType.hook);
|
|
508
|
+
const localFolders = allFolders.filter(f => f.storage === PromptsStorage.local);
|
|
509
|
+
if (localFolders.length === 0) {
|
|
510
|
+
notificationService.error(( localize(6288, "Please open a workspace folder to configure hooks.")));
|
|
475
511
|
return;
|
|
476
512
|
}
|
|
477
|
-
selectedFolder =
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
if (
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
resolve(value);
|
|
513
|
+
selectedFolder = localFolders[0];
|
|
514
|
+
if (localFolders.length > 1) {
|
|
515
|
+
const folderItems = ( localFolders.map(folder => ({
|
|
516
|
+
label: labelService.getUriLabel(folder.uri, {
|
|
517
|
+
relative: true
|
|
518
|
+
}),
|
|
519
|
+
folder
|
|
520
|
+
})));
|
|
521
|
+
picker.items = folderItems;
|
|
522
|
+
picker.value = "";
|
|
523
|
+
picker.placeholder = ( localize(6289, "Select a location for the hook file"));
|
|
524
|
+
picker.title = ( localize(6290, "Hook File Location"));
|
|
525
|
+
picker.buttons = [backButton];
|
|
526
|
+
const result = await awaitPick(picker, backButton);
|
|
527
|
+
if (result === "back") {
|
|
528
|
+
step = goBack() ?? Step.SelectFile;
|
|
529
|
+
break;
|
|
495
530
|
}
|
|
496
|
-
|
|
497
|
-
const inputDisposables = ( new DisposableStore());
|
|
498
|
-
const inputBox = inputDisposables.add(quickInputService.createInputBox());
|
|
499
|
-
inputBox.prompt = ( localize(6198, "Enter hook file name"));
|
|
500
|
-
inputBox.placeholder = ( localize(6199, "e.g., hooks, diagnostics, security"));
|
|
501
|
-
inputBox.title = ( localize(6200, "Hook File Name"));
|
|
502
|
-
inputBox.buttons = [backButton];
|
|
503
|
-
inputBox.ignoreFocusOut = true;
|
|
504
|
-
inputDisposables.add(inputBox.onDidAccept(async () => {
|
|
505
|
-
const value = inputBox.value;
|
|
506
|
-
if (!value || !value.trim()) {
|
|
507
|
-
inputBox.validationMessage = ( localize(6201, "File name is required"));
|
|
531
|
+
if (!result) {
|
|
508
532
|
return;
|
|
509
533
|
}
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
done(name);
|
|
516
|
-
}));
|
|
517
|
-
inputDisposables.add(inputBox.onDidChangeValue(() => {
|
|
518
|
-
inputBox.validationMessage = undefined;
|
|
519
|
-
}));
|
|
520
|
-
inputDisposables.add(inputBox.onDidTriggerButton(button => {
|
|
521
|
-
if (button === backButton) {
|
|
522
|
-
done("back");
|
|
523
|
-
}
|
|
524
|
-
}));
|
|
525
|
-
inputDisposables.add(inputBox.onDidHide(() => {
|
|
526
|
-
done(undefined);
|
|
527
|
-
}));
|
|
528
|
-
inputBox.show();
|
|
529
|
-
}));
|
|
530
|
-
if (fileNameResult === "back") {
|
|
531
|
-
picker.show();
|
|
532
|
-
step = goBack() ?? Step.SelectFolder;
|
|
534
|
+
selectedFolder = result.folder;
|
|
535
|
+
stepHistory.push(Step.SelectFolder);
|
|
536
|
+
}
|
|
537
|
+
step = Step.EnterFilename;
|
|
533
538
|
break;
|
|
534
539
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
540
|
+
case Step.EnterFilename:
|
|
541
|
+
{
|
|
542
|
+
picker.hide();
|
|
543
|
+
const fileNameResult = await ( new Promise(resolve => {
|
|
544
|
+
let resolved = false;
|
|
545
|
+
const done = value => {
|
|
546
|
+
if (!resolved) {
|
|
547
|
+
resolved = true;
|
|
548
|
+
inputDisposables.dispose();
|
|
549
|
+
resolve(value);
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
const inputDisposables = ( new DisposableStore());
|
|
553
|
+
const inputBox = inputDisposables.add(quickInputService.createInputBox());
|
|
554
|
+
inputBox.prompt = ( localize(6291, "Enter hook file name"));
|
|
555
|
+
inputBox.placeholder = ( localize(6292, "e.g., hooks, diagnostics, security"));
|
|
556
|
+
inputBox.title = ( localize(6293, "Hook File Name"));
|
|
557
|
+
inputBox.buttons = [backButton];
|
|
558
|
+
inputBox.ignoreFocusOut = true;
|
|
559
|
+
inputDisposables.add(inputBox.onDidAccept(async () => {
|
|
560
|
+
const value = inputBox.value;
|
|
561
|
+
if (!value || !value.trim()) {
|
|
562
|
+
inputBox.validationMessage = ( localize(6294, "File name is required"));
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
const name = value.trim();
|
|
566
|
+
if (/[/\\:*?"<>|]/.test(name)) {
|
|
567
|
+
inputBox.validationMessage = ( localize(6295, "File name contains invalid characters"));
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
done(name);
|
|
571
|
+
}));
|
|
572
|
+
inputDisposables.add(inputBox.onDidChangeValue(() => {
|
|
573
|
+
inputBox.validationMessage = undefined;
|
|
574
|
+
}));
|
|
575
|
+
inputDisposables.add(inputBox.onDidTriggerButton(button => {
|
|
576
|
+
if (button === backButton) {
|
|
577
|
+
done("back");
|
|
578
|
+
}
|
|
579
|
+
}));
|
|
580
|
+
inputDisposables.add(inputBox.onDidHide(() => {
|
|
581
|
+
done(undefined);
|
|
582
|
+
}));
|
|
583
|
+
inputBox.show();
|
|
584
|
+
}));
|
|
585
|
+
if (fileNameResult === "back") {
|
|
586
|
+
picker.show();
|
|
587
|
+
step = goBack() ?? Step.SelectFolder;
|
|
588
|
+
break;
|
|
562
589
|
}
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
590
|
+
if (!fileNameResult) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
await fileService.createFolder(selectedFolder.uri);
|
|
594
|
+
const hookFileName = fileNameResult.endsWith(".json") ? fileNameResult : `${fileNameResult}.json`;
|
|
595
|
+
const hookFileUri = URI.joinPath(selectedFolder.uri, hookFileName);
|
|
596
|
+
if (await fileService.exists(hookFileUri)) {
|
|
597
|
+
await addHookToFile(
|
|
598
|
+
hookFileUri,
|
|
599
|
+
selectedHookType.hookType,
|
|
600
|
+
fileService,
|
|
601
|
+
editorService,
|
|
602
|
+
notificationService,
|
|
603
|
+
bulkEditService,
|
|
604
|
+
options?.openEditor
|
|
605
|
+
);
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const newFileFormat = getHookSourceFormat(hookFileUri);
|
|
609
|
+
const isClaudeNewFile = newFileFormat === HookSourceFormat.Claude;
|
|
610
|
+
const isCopilotCliOnly = !isClaudeNewFile && !( ( new Set(( Object.values(HOOKS_BY_TARGET[Target.VSCode])))).has(selectedHookType.hookType)) && ( ( new Set(( Object.values(HOOKS_BY_TARGET[Target.GitHubCopilot])))).has(selectedHookType.hookType));
|
|
611
|
+
const hookTypeKey = isClaudeNewFile ? (getClaudeHookTypeName(selectedHookType.hookType) ?? selectedHookType.hookType) : isCopilotCliOnly ? (getCopilotCliHookTypeName(selectedHookType.hookType) ?? selectedHookType.hookType) : selectedHookType.hookType;
|
|
612
|
+
const newFileHookEntry = isCopilotCliOnly ? {
|
|
613
|
+
type: "command",
|
|
614
|
+
[targetOS === OperatingSystem.Windows ? "powershell" : "bash"]: ""
|
|
615
|
+
} : buildNewHookEntry(newFileFormat);
|
|
616
|
+
const commandFieldKey = isCopilotCliOnly ? (targetOS === OperatingSystem.Windows ? "powershell" : "bash") : "command";
|
|
617
|
+
const hooksContent = {
|
|
618
|
+
...(isCopilotCliOnly ? {
|
|
619
|
+
version: 1
|
|
620
|
+
} : {}),
|
|
621
|
+
hooks: {
|
|
622
|
+
[hookTypeKey]: [newFileHookEntry]
|
|
579
623
|
}
|
|
580
|
-
}
|
|
624
|
+
};
|
|
625
|
+
const jsonContent = JSON.stringify(hooksContent, null, "\t");
|
|
626
|
+
await fileService.writeFile(hookFileUri, VSBuffer.fromString(jsonContent));
|
|
627
|
+
options?.onHookFileCreated?.(hookFileUri);
|
|
628
|
+
const selection = findHookCommandSelection(jsonContent, hookTypeKey, 0, commandFieldKey);
|
|
629
|
+
if (options?.openEditor) {
|
|
630
|
+
await options.openEditor(hookFileUri, {
|
|
631
|
+
selection
|
|
632
|
+
});
|
|
633
|
+
} else {
|
|
634
|
+
await editorService.openEditor({
|
|
635
|
+
resource: hookFileUri,
|
|
636
|
+
options: {
|
|
637
|
+
selection,
|
|
638
|
+
pinned: false
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
}
|
|
642
|
+
return;
|
|
581
643
|
}
|
|
582
|
-
return;
|
|
583
644
|
}
|
|
584
645
|
}
|
|
646
|
+
} finally {
|
|
647
|
+
store.dispose();
|
|
585
648
|
}
|
|
586
649
|
}
|
|
587
650
|
class ManageHooksAction extends Action2 {
|
|
588
651
|
constructor() {
|
|
589
652
|
super({
|
|
590
653
|
id: CONFIGURE_HOOKS_ACTION_ID,
|
|
591
|
-
title: ( localize2(
|
|
592
|
-
shortTitle: ( localize2(
|
|
654
|
+
title: ( localize2(6296, "Configure Hooks...")),
|
|
655
|
+
shortTitle: ( localize2(6297, "Hooks")),
|
|
593
656
|
icon: Codicon.zap,
|
|
594
657
|
f1: true,
|
|
595
658
|
precondition: ChatContextKeys.enabled,
|