@codingame/monaco-vscode-chat-service-override 30.0.0 → 31.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 +21 -3
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +125 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +393 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +65 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +453 -0
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +28 -0
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +81 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +75 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +180 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +202 -51
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +182 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +282 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +303 -32
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +30 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +662 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +12 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +17 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +5 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +5 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +42 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +7 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +118 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +551 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +22 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +113 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +81 -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 +47 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +15 -10
- 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 +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +58 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +24 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +29 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +65 -55
- 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 +4 -4
- 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 +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +28 -28
- 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/aiCustomizationDebugPanel.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +80 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +20 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +30 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +363 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +31 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +374 -764
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +222 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +269 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +249 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +113 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +202 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +246 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +162 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +306 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +581 -257
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +245 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +25 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +3 -5
- 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.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +103 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +80 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +20 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +128 -65
- 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 +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- 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.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -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 +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +10 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +4 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +4 -310
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +3 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +61 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +46 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +96 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +21 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +315 -263
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +196 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +26 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +48 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- 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/promptsDebugContribution.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +226 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +108 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +9 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +21 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +26 -59
- 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 +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +46 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +32 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +152 -26
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +5 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +265 -261
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +28 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +75 -7
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +9 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +32 -4
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +10 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +7 -52
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +58 -466
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +36 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +168 -182
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +491 -462
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +16 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +18 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +145 -68
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +25 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +19 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +5 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +77 -157
- 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 +17 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +29 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +12 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +49 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +9 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +13 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +319 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +21 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +35 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +0 -94
- package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +0 -16
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +0 -578
- package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +0 -206
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -114
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +0 -860
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -27
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +0 -58
- package/vscode/src/vs/platform/browserElements/common/browserElements.js +0 -16
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +0 -443
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +0 -132
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +0 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -66
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +0 -158
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -164
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -163
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -137
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -39
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -249
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -92
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -209
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +0 -106
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -168
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -1019
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -150
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -1619
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -130
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -122
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -482
package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js
CHANGED
|
@@ -4,14 +4,14 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
4
4
|
import * as aiCustomizationManagement from './media/aiCustomizationManagement.css';
|
|
5
5
|
import { $ as $$1, append, addDisposableListener, getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
6
|
import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
|
|
7
|
+
import { Checkbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
|
|
7
8
|
import { DisposableStore, Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
|
+
import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
8
10
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
-
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
10
11
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
11
|
-
import {
|
|
12
|
+
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
13
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
13
14
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
14
|
-
import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
15
15
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
16
16
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
17
17
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -19,11 +19,11 @@ import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/l
|
|
|
19
19
|
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
20
20
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
21
21
|
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
22
|
-
import { promptIcon, hookIcon, instructionsIcon, skillIcon, agentIcon,
|
|
23
|
-
import { AI_CUSTOMIZATION_ITEM_TYPE_KEY, AI_CUSTOMIZATION_ITEM_URI_KEY, AI_CUSTOMIZATION_ITEM_DISABLED_KEY, AI_CUSTOMIZATION_ITEM_STORAGE_KEY, AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY, AICustomizationManagementItemMenuId, AICustomizationManagementCreateMenuId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement';
|
|
22
|
+
import { promptIcon, hookIcon, instructionsIcon, skillIcon, agentIcon, workspaceIcon, userIcon, pluginIcon, builtinIcon, extensionIcon } from './aiCustomizationIcons.js';
|
|
23
|
+
import { AI_CUSTOMIZATION_ITEM_TYPE_KEY, AI_CUSTOMIZATION_ITEM_URI_KEY, AI_CUSTOMIZATION_ITEM_DISABLED_KEY, AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, AI_CUSTOMIZATION_ITEM_STORAGE_KEY, AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY, AICustomizationManagementItemMenuId, AICustomizationManagementCreateMenuId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement';
|
|
24
24
|
import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
|
|
25
25
|
import { InputBox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/inputbox/inputBox';
|
|
26
|
-
import { defaultInputBoxStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
26
|
+
import { defaultCheckboxStyles, defaultInputBoxStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
27
27
|
import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
28
28
|
import { IContextViewService, IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
29
29
|
import { HighlightedLabel } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
|
@@ -36,7 +36,6 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
36
36
|
import { createActionViewItem, getContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
37
37
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
38
38
|
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
39
|
-
import { AICustomizationManagementSection, BUILTIN_STORAGE, applyStorageSourceFilter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
|
|
40
39
|
import { IAICustomizationWorkspaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service';
|
|
41
40
|
import { Separator, Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
42
41
|
import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
@@ -47,21 +46,13 @@ import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/s
|
|
|
47
46
|
import { generateCustomizationDebugReport } from './aiCustomizationDebugPanel.js';
|
|
48
47
|
import { getCustomizationSecondaryText } from './aiCustomizationListWidgetUtils.js';
|
|
49
48
|
export { truncateToFirstLine } from './aiCustomizationListWidgetUtils.js';
|
|
50
|
-
import { parseHooksFromFile } from '../../common/promptSyntax/hookCompatibility.js';
|
|
51
|
-
import { formatHookCommandLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookSchema';
|
|
52
|
-
import { HOOK_METADATA, HookType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookTypes';
|
|
53
|
-
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
54
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
55
|
-
import { OS } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
56
49
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
57
|
-
import { matchesWorkspaceSubpath, matchesInstructionFileFilter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService';
|
|
58
50
|
import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
|
|
59
|
-
import { evaluateApplyToPattern } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
|
|
60
|
-
import { AGENT_MD_FILENAME, CLAUDE_MD_FILENAME, CLAUDE_LOCAL_MD_FILENAME, COPILOT_CUSTOM_INSTRUCTIONS_FILENAME, getCleanPromptName, isInClaudeRulesFolder } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
61
|
-
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
62
51
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
63
52
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
64
|
-
import {
|
|
53
|
+
import { AICustomizationItemNormalizer, ProviderCustomizationItemSource } from './aiCustomizationItemSource.js';
|
|
54
|
+
import { PromptsServiceCustomizationItemProvider } from './promptsServiceCustomizationItemProvider.js';
|
|
55
|
+
import { AICustomizationManagementSection, BUILTIN_STORAGE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
|
|
65
56
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
66
57
|
|
|
67
58
|
registerCss(aiCustomizationManagement);
|
|
@@ -148,32 +139,9 @@ function promptTypeToIcon(type) {
|
|
|
148
139
|
return promptIcon;
|
|
149
140
|
}
|
|
150
141
|
}
|
|
151
|
-
function storageToIcon(storage) {
|
|
152
|
-
switch (storage) {
|
|
153
|
-
case PromptsStorage.local:
|
|
154
|
-
return workspaceIcon;
|
|
155
|
-
case PromptsStorage.user:
|
|
156
|
-
return userIcon;
|
|
157
|
-
case PromptsStorage.extension:
|
|
158
|
-
return extensionIcon;
|
|
159
|
-
case PromptsStorage.plugin:
|
|
160
|
-
return pluginIcon;
|
|
161
|
-
default:
|
|
162
|
-
return instructionsIcon;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
142
|
function formatDisplayName(name) {
|
|
166
143
|
return name.replace(/\.md$/i, "");
|
|
167
144
|
}
|
|
168
|
-
const AGENT_INSTRUCTION_FILENAMES = ( new Set([
|
|
169
|
-
AGENT_MD_FILENAME.toLowerCase(),
|
|
170
|
-
CLAUDE_MD_FILENAME.toLowerCase(),
|
|
171
|
-
CLAUDE_LOCAL_MD_FILENAME.toLowerCase(),
|
|
172
|
-
COPILOT_CUSTOM_INSTRUCTIONS_FILENAME.toLowerCase()
|
|
173
|
-
]));
|
|
174
|
-
function isAgentInstructionFile(uri) {
|
|
175
|
-
return ( AGENT_INSTRUCTION_FILENAMES.has(basename(uri).toLowerCase()));
|
|
176
|
-
}
|
|
177
145
|
let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
178
146
|
constructor(
|
|
179
147
|
hoverService,
|
|
@@ -181,7 +149,8 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
181
149
|
menuService,
|
|
182
150
|
contextKeyService,
|
|
183
151
|
instantiationService,
|
|
184
|
-
agentPluginService
|
|
152
|
+
agentPluginService,
|
|
153
|
+
harnessService
|
|
185
154
|
) {
|
|
186
155
|
this.hoverService = hoverService;
|
|
187
156
|
this.labelService = labelService;
|
|
@@ -189,6 +158,7 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
189
158
|
this.contextKeyService = contextKeyService;
|
|
190
159
|
this.instantiationService = instantiationService;
|
|
191
160
|
this.agentPluginService = agentPluginService;
|
|
161
|
+
this.harnessService = harnessService;
|
|
192
162
|
this.templateId = "aiCustomizationItem";
|
|
193
163
|
}
|
|
194
164
|
renderTemplate(container) {
|
|
@@ -196,11 +166,14 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
196
166
|
const elementDisposables = ( new DisposableStore());
|
|
197
167
|
container.classList.add("ai-customization-list-item");
|
|
198
168
|
const leftSection = append(container, $(".item-left"));
|
|
169
|
+
const syncCheckboxContainer = append(leftSection, $(".item-sync-checkbox"));
|
|
170
|
+
syncCheckboxContainer.style.display = "none";
|
|
199
171
|
const typeIcon = append(leftSection, $(".item-type-icon"));
|
|
200
172
|
const textContainer = append(leftSection, $(".item-text"));
|
|
201
173
|
const nameRow = append(textContainer, $(".item-name-row"));
|
|
202
174
|
const nameLabel = disposables.add(( new HighlightedLabel(append(nameRow, $(".item-name")))));
|
|
203
175
|
const badge = append(nameRow, $(".inline-badge.item-badge"));
|
|
176
|
+
const statusIcon = append(nameRow, $(".item-status-icon"));
|
|
204
177
|
const description = disposables.add(( new HighlightedLabel(append(textContainer, $(".item-description")))));
|
|
205
178
|
const actionsContainer = append(container, $(".item-right"));
|
|
206
179
|
const actionBar = disposables.add(( new ActionBar(actionsContainer, {
|
|
@@ -210,9 +183,11 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
210
183
|
container,
|
|
211
184
|
actionsContainer,
|
|
212
185
|
actionBar,
|
|
186
|
+
syncCheckboxContainer,
|
|
213
187
|
typeIcon,
|
|
214
188
|
nameLabel,
|
|
215
189
|
badge,
|
|
190
|
+
statusIcon,
|
|
216
191
|
description,
|
|
217
192
|
disposables,
|
|
218
193
|
elementDisposables
|
|
@@ -221,6 +196,19 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
221
196
|
renderElement(entry, index, templateData) {
|
|
222
197
|
templateData.elementDisposables.clear();
|
|
223
198
|
const element = entry.item;
|
|
199
|
+
if (element.syncable) {
|
|
200
|
+
templateData.syncCheckboxContainer.style.display = "";
|
|
201
|
+
const title = element.synced ? ( localize(5313, "Remove {0} from sync", element.name)) : ( localize(5314, "Add {0} to sync", element.name));
|
|
202
|
+
const checkbox = templateData.elementDisposables.add(( new Checkbox(title, !!element.synced, defaultCheckboxStyles)));
|
|
203
|
+
templateData.syncCheckboxContainer.replaceChildren(checkbox.domNode);
|
|
204
|
+
templateData.elementDisposables.add(checkbox.onChange(() => {
|
|
205
|
+
const syncProvider = this.harnessService.getActiveDescriptor().syncProvider;
|
|
206
|
+
syncProvider?.toggleUri(element.uri, element.promptType);
|
|
207
|
+
}));
|
|
208
|
+
} else {
|
|
209
|
+
templateData.syncCheckboxContainer.style.display = "none";
|
|
210
|
+
templateData.syncCheckboxContainer.replaceChildren();
|
|
211
|
+
}
|
|
224
212
|
templateData.typeIcon.className = "item-type-icon";
|
|
225
213
|
templateData.typeIcon.classList.add(
|
|
226
214
|
...ThemeIcon.asClassNameArray(element.typeIcon ?? promptTypeToIcon(element.promptType))
|
|
@@ -228,9 +216,9 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
228
216
|
templateData.elementDisposables.add(this.hoverService.setupDelayedHover(templateData.container, () => {
|
|
229
217
|
let content;
|
|
230
218
|
if (element.isBuiltin) {
|
|
231
|
-
content = `${element.name}\n${( localize(
|
|
219
|
+
content = `${element.name}\n${( localize(5315, "Built-in"))}`;
|
|
232
220
|
} else if (element.extensionLabel) {
|
|
233
|
-
content = `${element.name}\n${( localize(
|
|
221
|
+
content = `${element.name}\n${( localize(5316, "Extension: {0}", element.extensionLabel))}`;
|
|
234
222
|
} else {
|
|
235
223
|
const isWorkspaceItem = element.storage === PromptsStorage.local;
|
|
236
224
|
const uriLabel = this.labelService.getUriLabel(element.uri, {
|
|
@@ -243,7 +231,7 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
243
231
|
}
|
|
244
232
|
const plugin = element.pluginUri && this.agentPluginService.plugins.get().find(p => isEqual(p.uri, element.pluginUri));
|
|
245
233
|
if (plugin) {
|
|
246
|
-
content += `\n${( localize(
|
|
234
|
+
content += `\n${( localize(5317, "Plugin: {0}", plugin.label))}`;
|
|
247
235
|
}
|
|
248
236
|
return {
|
|
249
237
|
content,
|
|
@@ -268,6 +256,34 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
268
256
|
templateData.badge.textContent = "";
|
|
269
257
|
templateData.badge.style.display = "none";
|
|
270
258
|
}
|
|
259
|
+
if (element.status) {
|
|
260
|
+
templateData.statusIcon.style.display = "";
|
|
261
|
+
templateData.statusIcon.className = "item-status-icon";
|
|
262
|
+
switch (element.status) {
|
|
263
|
+
case "loading":
|
|
264
|
+
templateData.statusIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.loading), "codicon-modifier-spin");
|
|
265
|
+
break;
|
|
266
|
+
case "loaded":
|
|
267
|
+
templateData.statusIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.check));
|
|
268
|
+
break;
|
|
269
|
+
case "degraded":
|
|
270
|
+
templateData.statusIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.warning));
|
|
271
|
+
break;
|
|
272
|
+
case "error":
|
|
273
|
+
templateData.statusIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.error));
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
if (element.statusMessage) {
|
|
277
|
+
templateData.elementDisposables.add(this.hoverService.setupManagedHover(
|
|
278
|
+
getDefaultHoverDelegate("mouse"),
|
|
279
|
+
templateData.statusIcon,
|
|
280
|
+
element.statusMessage
|
|
281
|
+
));
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
templateData.statusIcon.style.display = "none";
|
|
285
|
+
templateData.statusIcon.className = "item-status-icon";
|
|
286
|
+
}
|
|
271
287
|
const secondaryText = getCustomizationSecondaryText(element.description, element.filename, element.promptType);
|
|
272
288
|
let secondaryTextMatches;
|
|
273
289
|
if (secondaryText && element.description && element.descriptionMatches) {
|
|
@@ -302,12 +318,17 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
302
318
|
name: element.name,
|
|
303
319
|
promptType: element.promptType,
|
|
304
320
|
storage: element.storage,
|
|
305
|
-
pluginUri: element.pluginUri?.toString()
|
|
321
|
+
pluginUri: element.pluginUri?.toString(),
|
|
322
|
+
itemId: element.id
|
|
306
323
|
};
|
|
307
324
|
const overlayPairs = [
|
|
308
325
|
[AI_CUSTOMIZATION_ITEM_TYPE_KEY, element.promptType],
|
|
309
326
|
[AI_CUSTOMIZATION_ITEM_URI_KEY, ( element.uri.toString())],
|
|
310
|
-
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, element.disabled]
|
|
327
|
+
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, element.disabled],
|
|
328
|
+
[
|
|
329
|
+
AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY,
|
|
330
|
+
this.harnessService.getActiveDescriptor().supportsTroubleshoot ?? false
|
|
331
|
+
]
|
|
311
332
|
];
|
|
312
333
|
if (element.storage) {
|
|
313
334
|
overlayPairs.push([AI_CUSTOMIZATION_ITEM_STORAGE_KEY, element.storage]);
|
|
@@ -340,7 +361,7 @@ let AICustomizationItemRenderer = class AICustomizationItemRenderer {
|
|
|
340
361
|
templateData.disposables.dispose();
|
|
341
362
|
}
|
|
342
363
|
};
|
|
343
|
-
AICustomizationItemRenderer = ( __decorate([( __param(0, IHoverService)), ( __param(1, ILabelService)), ( __param(2, IMenuService)), ( __param(3, IContextKeyService)), ( __param(4, IInstantiationService)), ( __param(5, IAgentPluginService))], AICustomizationItemRenderer));
|
|
364
|
+
AICustomizationItemRenderer = ( __decorate([( __param(0, IHoverService)), ( __param(1, ILabelService)), ( __param(2, IMenuService)), ( __param(3, IContextKeyService)), ( __param(4, IInstantiationService)), ( __param(5, IAgentPluginService)), ( __param(6, ICustomizationHarnessService))], AICustomizationItemRenderer));
|
|
344
365
|
function sectionToPromptType(section) {
|
|
345
366
|
switch (section) {
|
|
346
367
|
case AICustomizationManagementSection.Agents:
|
|
@@ -376,8 +397,7 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
376
397
|
harnessService,
|
|
377
398
|
agentPluginService,
|
|
378
399
|
commandService,
|
|
379
|
-
productService
|
|
380
|
-
userDataProfileService
|
|
400
|
+
productService
|
|
381
401
|
) {
|
|
382
402
|
super();
|
|
383
403
|
this.instantiationService = instantiationService;
|
|
@@ -399,13 +419,13 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
399
419
|
this.agentPluginService = agentPluginService;
|
|
400
420
|
this.commandService = commandService;
|
|
401
421
|
this.productService = productService;
|
|
402
|
-
this.userDataProfileService = userDataProfileService;
|
|
403
422
|
this.currentSection = AICustomizationManagementSection.Agents;
|
|
404
423
|
this.allItems = [];
|
|
405
424
|
this.displayEntries = [];
|
|
406
425
|
this.searchQuery = "";
|
|
407
426
|
this.collapsedGroups = ( new Set());
|
|
408
427
|
this.dropdownActionDisposables = this._register(( new DisposableStore()));
|
|
428
|
+
this._loadItemsSeq = 0;
|
|
409
429
|
this.delayedFilter = ( new Delayer(200));
|
|
410
430
|
this._onDidSelectItem = this._register(( new Emitter()));
|
|
411
431
|
this.onDidSelectItem = this._onDidSelectItem.event;
|
|
@@ -415,6 +435,19 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
415
435
|
this.onDidRequestCreate = this._onDidRequestCreate.event;
|
|
416
436
|
this._onDidRequestCreateManual = this._register(( new Emitter()));
|
|
417
437
|
this.onDidRequestCreateManual = this._onDidRequestCreateManual.event;
|
|
438
|
+
this.itemNormalizer = ( new AICustomizationItemNormalizer(
|
|
439
|
+
this.workspaceContextService,
|
|
440
|
+
this.workspaceService,
|
|
441
|
+
this.labelService,
|
|
442
|
+
this.agentPluginService,
|
|
443
|
+
this.productService
|
|
444
|
+
));
|
|
445
|
+
this.promptsServiceItemProvider = ( new PromptsServiceCustomizationItemProvider(
|
|
446
|
+
() => this.harnessService.getActiveDescriptor(),
|
|
447
|
+
this.promptsService,
|
|
448
|
+
this.workspaceService,
|
|
449
|
+
this.productService
|
|
450
|
+
));
|
|
418
451
|
this.element = $(".ai-customization-list-widget");
|
|
419
452
|
this.create();
|
|
420
453
|
this._register(
|
|
@@ -434,22 +467,20 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
434
467
|
this.harnessService.availableHarnesses.read(reader);
|
|
435
468
|
this.refresh();
|
|
436
469
|
}));
|
|
437
|
-
const
|
|
470
|
+
const itemSourceChangeDisposable = this._register(( new MutableDisposable()));
|
|
438
471
|
this._register(autorun(reader => {
|
|
439
472
|
this.harnessService.activeHarness.read(reader);
|
|
473
|
+
this.harnessService.availableHarnesses.read(reader);
|
|
474
|
+
this.cachedItemSource = undefined;
|
|
440
475
|
const activeDescriptor = this.harnessService.getActiveDescriptor();
|
|
441
|
-
|
|
442
|
-
providerChangeDisposable.value = activeDescriptor.itemProvider.onDidChange(() => this.refresh());
|
|
443
|
-
} else {
|
|
444
|
-
providerChangeDisposable.clear();
|
|
445
|
-
}
|
|
476
|
+
itemSourceChangeDisposable.value = this.getItemSource(activeDescriptor).onDidChange(() => this.refresh());
|
|
446
477
|
}));
|
|
447
478
|
}
|
|
448
479
|
create() {
|
|
449
480
|
this.searchAndButtonContainer = append(this.element, $(".list-search-and-button-container"));
|
|
450
481
|
this.searchContainer = append(this.searchAndButtonContainer, $(".list-search-container"));
|
|
451
482
|
this.searchInput = this._register(( new InputBox(this.searchContainer, this.contextViewService, {
|
|
452
|
-
placeholder: ( localize(
|
|
483
|
+
placeholder: ( localize(5318, "Type to search...")),
|
|
453
484
|
inputBoxStyles: defaultInputBoxStyles
|
|
454
485
|
})));
|
|
455
486
|
this._register(this.searchInput.onDidChange(() => {
|
|
@@ -504,17 +535,17 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
504
535
|
getAriaLabel: entry => {
|
|
505
536
|
if (entry.type === "group-header") {
|
|
506
537
|
return localize(
|
|
507
|
-
|
|
538
|
+
5319,
|
|
508
539
|
"{0}, {1} items, {2}",
|
|
509
540
|
entry.label,
|
|
510
541
|
entry.count,
|
|
511
|
-
entry.collapsed ? ( localize(
|
|
542
|
+
entry.collapsed ? ( localize(5320, "collapsed")) : ( localize(5321, "expanded"))
|
|
512
543
|
);
|
|
513
544
|
}
|
|
514
|
-
const nameAndDesc = entry.item.description ? ( localize(
|
|
515
|
-
return entry.item.disabled ? ( localize(
|
|
545
|
+
const nameAndDesc = entry.item.description ? ( localize(5322, "{0}, {1}", entry.item.name, entry.item.description)) : entry.item.name;
|
|
546
|
+
return entry.item.disabled ? ( localize(5323, "{0}, disabled", nameAndDesc)) : nameAndDesc;
|
|
516
547
|
},
|
|
517
|
-
getWidgetAriaLabel: () => ( localize(
|
|
548
|
+
getWidgetAriaLabel: () => ( localize(5324, "Agent Customizations"))
|
|
518
549
|
},
|
|
519
550
|
keyboardNavigationLabelProvider: {
|
|
520
551
|
getKeyboardNavigationLabel: entry => entry.type === "group-header" ? entry.label : entry.item.name
|
|
@@ -533,9 +564,6 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
533
564
|
}
|
|
534
565
|
}));
|
|
535
566
|
this._register(this.list.onContextMenu(e => this.onContextMenu(e)));
|
|
536
|
-
this._register(this.promptsService.onDidChangeCustomAgents(() => this.refresh()));
|
|
537
|
-
this._register(this.promptsService.onDidChangeSlashCommands(() => this.refresh()));
|
|
538
|
-
this._register(this.promptsService.onDidChangeSkills(() => this.refresh()));
|
|
539
567
|
this._register(this.fileService.onDidFilesChange(e => {
|
|
540
568
|
if (e.gotDeleted()) {
|
|
541
569
|
this.refresh();
|
|
@@ -563,12 +591,17 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
563
591
|
name: item.name,
|
|
564
592
|
promptType: item.promptType,
|
|
565
593
|
storage: item.storage,
|
|
566
|
-
pluginUri: item.pluginUri?.toString()
|
|
594
|
+
pluginUri: item.pluginUri?.toString(),
|
|
595
|
+
itemId: item.id
|
|
567
596
|
};
|
|
568
597
|
const overlayPairs = [
|
|
569
598
|
[AI_CUSTOMIZATION_ITEM_TYPE_KEY, item.promptType],
|
|
570
599
|
[AI_CUSTOMIZATION_ITEM_URI_KEY, ( item.uri.toString())],
|
|
571
|
-
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, item.disabled]
|
|
600
|
+
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, item.disabled],
|
|
601
|
+
[
|
|
602
|
+
AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY,
|
|
603
|
+
this.harnessService.getActiveDescriptor().supportsTroubleshoot ?? false
|
|
604
|
+
]
|
|
572
605
|
];
|
|
573
606
|
if (item.storage) {
|
|
574
607
|
overlayPairs.push([AI_CUSTOMIZATION_ITEM_STORAGE_KEY, item.storage]);
|
|
@@ -584,9 +617,9 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
584
617
|
const {
|
|
585
618
|
secondary
|
|
586
619
|
} = getContextMenuActions(actions, "inline");
|
|
587
|
-
const copyActions = item.isBuiltin ? [] : [( new Separator()), ( new Action("copyFullPath", ( localize(
|
|
620
|
+
const copyActions = item.isBuiltin ? [] : [( new Separator()), ( new Action("copyFullPath", ( localize(5325, "Copy Full Path")), undefined, true, async () => {
|
|
588
621
|
await this.clipboardService.writeText(item.uri.fsPath);
|
|
589
|
-
})), ( new Action("copyRelativePath", ( localize(
|
|
622
|
+
})), ( new Action("copyRelativePath", ( localize(5326, "Copy Relative Path")), undefined, true, async () => {
|
|
590
623
|
const basePath = this.workspaceService.getActiveProjectRoot();
|
|
591
624
|
if (basePath && item.uri.fsPath.startsWith(basePath.fsPath)) {
|
|
592
625
|
const relative = item.uri.fsPath.substring(basePath.fsPath.length + 1);
|
|
@@ -603,10 +636,16 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
603
636
|
getActions: () => [...secondary, ...copyActions]
|
|
604
637
|
});
|
|
605
638
|
}
|
|
639
|
+
prependToSearchRow(element) {
|
|
640
|
+
this.searchAndButtonContainer.insertBefore(element, this.searchAndButtonContainer.firstChild);
|
|
641
|
+
}
|
|
606
642
|
async setSection(section) {
|
|
607
643
|
this.currentSection = section;
|
|
608
644
|
this.updateSectionHeader();
|
|
609
645
|
await this.loadItems();
|
|
646
|
+
if (this._store.isDisposed) {
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
610
649
|
this.updateAddButton();
|
|
611
650
|
}
|
|
612
651
|
updateSectionHeader() {
|
|
@@ -616,41 +655,41 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
616
655
|
switch (this.currentSection) {
|
|
617
656
|
case AICustomizationManagementSection.Agents:
|
|
618
657
|
description = ( localize(
|
|
619
|
-
|
|
658
|
+
5327,
|
|
620
659
|
"Configure the AI to adopt different personas tailored to specific development tasks. Each agent has its own instructions, tools, and behavior."
|
|
621
660
|
));
|
|
622
661
|
docsUrl = "https://code.visualstudio.com/docs/copilot/customization/custom-agents";
|
|
623
|
-
learnMoreLabel = ( localize(
|
|
662
|
+
learnMoreLabel = ( localize(5328, "Learn more about custom agents"));
|
|
624
663
|
break;
|
|
625
664
|
case AICustomizationManagementSection.Skills:
|
|
626
665
|
description = ( localize(
|
|
627
|
-
|
|
666
|
+
5329,
|
|
628
667
|
"Folders of instructions, scripts, and resources that Copilot loads when relevant to perform specialized tasks."
|
|
629
668
|
));
|
|
630
669
|
docsUrl = "https://code.visualstudio.com/docs/copilot/customization/agent-skills";
|
|
631
|
-
learnMoreLabel = ( localize(
|
|
670
|
+
learnMoreLabel = ( localize(5330, "Learn more about agent skills"));
|
|
632
671
|
break;
|
|
633
672
|
case AICustomizationManagementSection.Instructions:
|
|
634
673
|
description = ( localize(
|
|
635
|
-
|
|
674
|
+
5331,
|
|
636
675
|
"Define common guidelines and rules that automatically influence how AI generates code and handles development tasks."
|
|
637
676
|
));
|
|
638
677
|
docsUrl = "https://code.visualstudio.com/docs/copilot/customization/custom-instructions";
|
|
639
|
-
learnMoreLabel = ( localize(
|
|
678
|
+
learnMoreLabel = ( localize(5332, "Learn more about custom instructions"));
|
|
640
679
|
break;
|
|
641
680
|
case AICustomizationManagementSection.Hooks:
|
|
642
|
-
description = ( localize(
|
|
681
|
+
description = ( localize(5333, "Prompts executed at specific points during an agentic lifecycle."));
|
|
643
682
|
docsUrl = "https://code.visualstudio.com/docs/copilot/customization/hooks";
|
|
644
|
-
learnMoreLabel = ( localize(
|
|
683
|
+
learnMoreLabel = ( localize(5334, "Learn more about hooks"));
|
|
645
684
|
break;
|
|
646
685
|
case AICustomizationManagementSection.Prompts:
|
|
647
686
|
default:
|
|
648
687
|
description = ( localize(
|
|
649
|
-
|
|
688
|
+
5335,
|
|
650
689
|
"Reusable prompts for common development tasks like generating code, performing reviews, or scaffolding components."
|
|
651
690
|
));
|
|
652
691
|
docsUrl = "https://code.visualstudio.com/docs/copilot/customization/prompt-files";
|
|
653
|
-
learnMoreLabel = ( localize(
|
|
692
|
+
learnMoreLabel = ( localize(5336, "Learn more about prompt files"));
|
|
654
693
|
break;
|
|
655
694
|
}
|
|
656
695
|
this.sectionDescription.textContent = description;
|
|
@@ -694,6 +733,27 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
694
733
|
}
|
|
695
734
|
}];
|
|
696
735
|
}
|
|
736
|
+
const menuActions = this.menuService.getMenuActions(AICustomizationManagementCreateMenuId, this.contextKeyService, {
|
|
737
|
+
shouldForwardArgs: true
|
|
738
|
+
});
|
|
739
|
+
const extensionCreateActions = [];
|
|
740
|
+
for (const [, group] of menuActions) {
|
|
741
|
+
for (const menuItem of group) {
|
|
742
|
+
if (menuItem instanceof MenuItemAction) {
|
|
743
|
+
const icon = ThemeIcon.isThemeIcon(menuItem.item.icon) ? menuItem.item.icon.id : Codicon.add.id;
|
|
744
|
+
extensionCreateActions.push({
|
|
745
|
+
label: `$(${icon}) ${typeof menuItem.item.title === "string" ? menuItem.item.title : menuItem.item.title.value}`,
|
|
746
|
+
enabled: menuItem.enabled,
|
|
747
|
+
run: () => {
|
|
748
|
+
menuItem.run();
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
if (extensionCreateActions.length > 0) {
|
|
755
|
+
return extensionCreateActions;
|
|
756
|
+
}
|
|
697
757
|
const createTypeLabel = override?.typeLabel ?? typeLabel;
|
|
698
758
|
const actions = [];
|
|
699
759
|
const addedTargets = ( new Set());
|
|
@@ -721,7 +781,7 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
721
781
|
});
|
|
722
782
|
if (hasWorkspace) {
|
|
723
783
|
actions.push({
|
|
724
|
-
label: `$(${Codicon.add.id}) Configure Hooks`,
|
|
784
|
+
label: `$(${Codicon.add.id}) ${( localize(5337, "Configure Hooks"))}`,
|
|
725
785
|
enabled: true,
|
|
726
786
|
run: () => {
|
|
727
787
|
this._onDidRequestCreateManual.fire({
|
|
@@ -733,9 +793,9 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
733
793
|
}
|
|
734
794
|
} else if (!override?.commandId) {
|
|
735
795
|
actions.push({
|
|
736
|
-
label: `$(${Codicon.add.id})
|
|
796
|
+
label: `$(${Codicon.add.id}) ${( localize(5337, "Configure Hooks"))}`,
|
|
737
797
|
enabled: hasWorkspace,
|
|
738
|
-
tooltip: hasWorkspace ? undefined : ( localize(
|
|
798
|
+
tooltip: hasWorkspace ? undefined : ( localize(5338, "Open a workspace folder to configure hooks.")),
|
|
739
799
|
run: () => {
|
|
740
800
|
this._onDidRequestCreateManual.fire({
|
|
741
801
|
type: promptType,
|
|
@@ -820,27 +880,6 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
820
880
|
});
|
|
821
881
|
}
|
|
822
882
|
}
|
|
823
|
-
const menuActions = this.menuService.getMenuActions(AICustomizationManagementCreateMenuId, this.contextKeyService, {
|
|
824
|
-
shouldForwardArgs: true
|
|
825
|
-
});
|
|
826
|
-
const extensionCreateActions = [];
|
|
827
|
-
for (const [, group] of menuActions) {
|
|
828
|
-
for (const menuItem of group) {
|
|
829
|
-
if (menuItem instanceof MenuItemAction) {
|
|
830
|
-
const icon = ThemeIcon.isThemeIcon(menuItem.item.icon) ? menuItem.item.icon.id : Codicon.add.id;
|
|
831
|
-
extensionCreateActions.push({
|
|
832
|
-
label: `$(${icon}) ${typeof menuItem.item.title === "string" ? menuItem.item.title : menuItem.item.title.value}`,
|
|
833
|
-
enabled: menuItem.enabled,
|
|
834
|
-
run: () => {
|
|
835
|
-
menuItem.run();
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
if (extensionCreateActions.length > 0) {
|
|
842
|
-
return extensionCreateActions;
|
|
843
|
-
}
|
|
844
883
|
return actions;
|
|
845
884
|
}
|
|
846
885
|
getDropdownActions() {
|
|
@@ -860,26 +899,36 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
860
899
|
getTypeLabel() {
|
|
861
900
|
switch (this.currentSection) {
|
|
862
901
|
case AICustomizationManagementSection.Agents:
|
|
863
|
-
return localize(
|
|
902
|
+
return localize(5339, "Agent");
|
|
864
903
|
case AICustomizationManagementSection.Skills:
|
|
865
|
-
return localize(
|
|
904
|
+
return localize(5340, "Skill");
|
|
866
905
|
case AICustomizationManagementSection.Instructions:
|
|
867
|
-
return localize(
|
|
906
|
+
return localize(5341, "Instructions");
|
|
868
907
|
case AICustomizationManagementSection.Hooks:
|
|
869
|
-
return localize(
|
|
908
|
+
return localize(5342, "Hook");
|
|
870
909
|
case AICustomizationManagementSection.Prompts:
|
|
871
910
|
default:
|
|
872
|
-
return localize(
|
|
911
|
+
return localize(5343, "Prompt");
|
|
873
912
|
}
|
|
874
913
|
}
|
|
875
914
|
async refresh() {
|
|
876
915
|
await this.loadItems();
|
|
916
|
+
if (this._store.isDisposed) {
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
877
919
|
this.updateAddButton();
|
|
878
920
|
}
|
|
879
921
|
async loadItems() {
|
|
880
922
|
const section = this.currentSection;
|
|
881
|
-
const
|
|
882
|
-
|
|
923
|
+
const seq = ++this._loadItemsSeq;
|
|
924
|
+
let items;
|
|
925
|
+
try {
|
|
926
|
+
items = await this.fetchItemsForSection(section);
|
|
927
|
+
} catch (err) {
|
|
928
|
+
onUnexpectedError(err);
|
|
929
|
+
items = [];
|
|
930
|
+
}
|
|
931
|
+
if (this._store.isDisposed || this.currentSection !== section || this._loadItemsSeq !== seq) {
|
|
883
932
|
return;
|
|
884
933
|
}
|
|
885
934
|
this.allItems = items;
|
|
@@ -890,651 +939,57 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
890
939
|
const items = await this.fetchItemsForSection(section);
|
|
891
940
|
return items.length;
|
|
892
941
|
}
|
|
893
|
-
isChatExtensionItem(extensionId) {
|
|
894
|
-
const chatExtensionId = this.productService.defaultChatAgent?.chatExtensionId;
|
|
895
|
-
return !!chatExtensionId && ExtensionIdentifier.equals(extensionId, chatExtensionId);
|
|
896
|
-
}
|
|
897
|
-
applyBuiltinGroupKeys(items, extensionInfoByUri) {
|
|
898
|
-
return ( items.map(item => {
|
|
899
|
-
if (item.storage !== PromptsStorage.extension) {
|
|
900
|
-
return item;
|
|
901
|
-
}
|
|
902
|
-
const extInfo = extensionInfoByUri.get(( item.uri.toString()));
|
|
903
|
-
if (!extInfo) {
|
|
904
|
-
return item;
|
|
905
|
-
}
|
|
906
|
-
const isBuiltin = this.isChatExtensionItem(extInfo.id);
|
|
907
|
-
if (isBuiltin) {
|
|
908
|
-
return {
|
|
909
|
-
...item,
|
|
910
|
-
isBuiltin: true,
|
|
911
|
-
groupKey: item.groupKey ?? BUILTIN_STORAGE
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
return {
|
|
915
|
-
...item,
|
|
916
|
-
extensionLabel: extInfo.displayName || extInfo.id.value
|
|
917
|
-
};
|
|
918
|
-
}));
|
|
919
|
-
}
|
|
920
942
|
async fetchItemsForSection(section) {
|
|
921
943
|
const promptType = sectionToPromptType(section);
|
|
922
|
-
|
|
923
|
-
if (activeDescriptor.itemProvider && promptType) {
|
|
924
|
-
const items = await this.fetchItemsFromProvider(activeDescriptor.itemProvider, promptType);
|
|
925
|
-
if (promptType === PromptsType.instructions) {
|
|
926
|
-
return this.enrichProviderInstructionItems(items);
|
|
927
|
-
}
|
|
928
|
-
return items;
|
|
929
|
-
}
|
|
930
|
-
const items = [];
|
|
931
|
-
const disabledUris = this.promptsService.getDisabledPromptFiles(promptType);
|
|
932
|
-
const extensionInfoByUri = ( new Map());
|
|
933
|
-
if (promptType === PromptsType.agent) {
|
|
934
|
-
const agents = await this.promptsService.getCustomAgents(CancellationToken.None);
|
|
935
|
-
const allAgentFiles = await this.promptsService.listPromptFiles(PromptsType.agent, CancellationToken.None);
|
|
936
|
-
for (const file of allAgentFiles) {
|
|
937
|
-
if (file.extension) {
|
|
938
|
-
extensionInfoByUri.set(( file.uri.toString()), {
|
|
939
|
-
id: file.extension.identifier,
|
|
940
|
-
displayName: file.extension.displayName
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
for (const agent of agents) {
|
|
945
|
-
const filename = basename(agent.uri);
|
|
946
|
-
items.push({
|
|
947
|
-
id: ( agent.uri.toString()),
|
|
948
|
-
uri: agent.uri,
|
|
949
|
-
name: agent.name,
|
|
950
|
-
filename,
|
|
951
|
-
description: agent.description,
|
|
952
|
-
storage: agent.source.storage,
|
|
953
|
-
promptType,
|
|
954
|
-
pluginUri: agent.source.storage === PromptsStorage.plugin ? agent.source.pluginUri : undefined,
|
|
955
|
-
disabled: ( disabledUris.has(agent.uri))
|
|
956
|
-
});
|
|
957
|
-
if (agent.source.storage === PromptsStorage.extension && !( extensionInfoByUri.has(( agent.uri.toString())))) {
|
|
958
|
-
extensionInfoByUri.set(( agent.uri.toString()), {
|
|
959
|
-
id: agent.source.extensionId
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
} else if (promptType === PromptsType.skill) {
|
|
964
|
-
const skills = await this.promptsService.findAgentSkills(CancellationToken.None);
|
|
965
|
-
const allSkillFiles = await this.promptsService.listPromptFiles(PromptsType.skill, CancellationToken.None);
|
|
966
|
-
for (const file of allSkillFiles) {
|
|
967
|
-
if (file.extension) {
|
|
968
|
-
extensionInfoByUri.set(( file.uri.toString()), {
|
|
969
|
-
id: file.extension.identifier,
|
|
970
|
-
displayName: file.extension.displayName
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
const uiIntegrations = this.workspaceService.getSkillUIIntegrations();
|
|
975
|
-
const seenUris = ( new ResourceSet());
|
|
976
|
-
for (const skill of skills || []) {
|
|
977
|
-
const filename = basename(skill.uri);
|
|
978
|
-
const skillName = skill.name || basename(dirname(skill.uri)) || filename;
|
|
979
|
-
seenUris.add(skill.uri);
|
|
980
|
-
const skillFolderName = basename(dirname(skill.uri));
|
|
981
|
-
const uiTooltip = uiIntegrations.get(skillFolderName);
|
|
982
|
-
items.push({
|
|
983
|
-
id: ( skill.uri.toString()),
|
|
984
|
-
uri: skill.uri,
|
|
985
|
-
name: skillName,
|
|
986
|
-
filename,
|
|
987
|
-
description: skill.description,
|
|
988
|
-
storage: skill.storage,
|
|
989
|
-
promptType,
|
|
990
|
-
pluginUri: skill.storage === PromptsStorage.plugin ? this.findPluginUri(skill.uri) : undefined,
|
|
991
|
-
disabled: false,
|
|
992
|
-
badge: uiTooltip ? ( localize(5329, "UI Integration")) : undefined,
|
|
993
|
-
badgeTooltip: uiTooltip
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
if (disabledUris.size > 0) {
|
|
997
|
-
for (const file of allSkillFiles) {
|
|
998
|
-
if (!( seenUris.has(file.uri)) && ( disabledUris.has(file.uri))) {
|
|
999
|
-
const filename = basename(file.uri);
|
|
1000
|
-
const disabledName = file.name || basename(dirname(file.uri)) || filename;
|
|
1001
|
-
const disabledFolderName = basename(dirname(file.uri));
|
|
1002
|
-
const uiTooltip = uiIntegrations.get(disabledFolderName);
|
|
1003
|
-
items.push({
|
|
1004
|
-
id: ( file.uri.toString()),
|
|
1005
|
-
uri: file.uri,
|
|
1006
|
-
name: disabledName,
|
|
1007
|
-
filename,
|
|
1008
|
-
description: file.description,
|
|
1009
|
-
storage: file.storage,
|
|
1010
|
-
promptType,
|
|
1011
|
-
disabled: true,
|
|
1012
|
-
badge: uiTooltip ? ( localize(5329, "UI Integration")) : undefined,
|
|
1013
|
-
badgeTooltip: uiTooltip
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
} else if (promptType === PromptsType.prompt) {
|
|
1019
|
-
const commands = await this.promptsService.getPromptSlashCommands(CancellationToken.None);
|
|
1020
|
-
for (const command of commands) {
|
|
1021
|
-
if (command.promptPath.type === PromptsType.skill) {
|
|
1022
|
-
continue;
|
|
1023
|
-
}
|
|
1024
|
-
const filename = basename(command.promptPath.uri);
|
|
1025
|
-
items.push({
|
|
1026
|
-
id: ( command.promptPath.uri.toString()),
|
|
1027
|
-
uri: command.promptPath.uri,
|
|
1028
|
-
name: command.name,
|
|
1029
|
-
filename,
|
|
1030
|
-
description: command.description,
|
|
1031
|
-
storage: command.promptPath.storage,
|
|
1032
|
-
promptType,
|
|
1033
|
-
pluginUri: command.promptPath.storage === PromptsStorage.plugin ? command.promptPath.pluginUri : undefined,
|
|
1034
|
-
disabled: ( disabledUris.has(command.promptPath.uri))
|
|
1035
|
-
});
|
|
1036
|
-
if (command.promptPath.extension) {
|
|
1037
|
-
extensionInfoByUri.set(( command.promptPath.uri.toString()), {
|
|
1038
|
-
id: command.promptPath.extension.identifier,
|
|
1039
|
-
displayName: command.promptPath.extension.displayName
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
} else if (promptType === PromptsType.hook) {
|
|
1044
|
-
const hookFiles = await this.promptsService.listPromptFiles(PromptsType.hook, CancellationToken.None);
|
|
1045
|
-
const activeRoot = this.workspaceService.getActiveProjectRoot();
|
|
1046
|
-
const userHomeUri = await this.pathService.userHome();
|
|
1047
|
-
const userHome = userHomeUri.scheme === Schemas.file ? userHomeUri.fsPath : userHomeUri.path;
|
|
1048
|
-
for (const hookFile of hookFiles) {
|
|
1049
|
-
if (hookFile.storage === PromptsStorage.plugin) {
|
|
1050
|
-
const filename = basename(hookFile.uri);
|
|
1051
|
-
items.push({
|
|
1052
|
-
id: ( hookFile.uri.toString()) + ":" + hookFile.name,
|
|
1053
|
-
uri: hookFile.uri,
|
|
1054
|
-
name: hookFile.name || this.getFriendlyName(filename),
|
|
1055
|
-
filename,
|
|
1056
|
-
storage: hookFile.storage,
|
|
1057
|
-
promptType,
|
|
1058
|
-
pluginUri: hookFile.pluginUri,
|
|
1059
|
-
disabled: ( disabledUris.has(hookFile.uri))
|
|
1060
|
-
});
|
|
1061
|
-
continue;
|
|
1062
|
-
}
|
|
1063
|
-
let parsedHooks = false;
|
|
1064
|
-
try {
|
|
1065
|
-
const content = await this.fileService.readFile(hookFile.uri);
|
|
1066
|
-
const json = parse(( content.value.toString()));
|
|
1067
|
-
const {
|
|
1068
|
-
hooks
|
|
1069
|
-
} = parseHooksFromFile(hookFile.uri, json, activeRoot, userHome);
|
|
1070
|
-
if (hooks.size > 0) {
|
|
1071
|
-
parsedHooks = true;
|
|
1072
|
-
for (const [hookType, entry] of hooks) {
|
|
1073
|
-
const hookMeta = HOOK_METADATA[hookType];
|
|
1074
|
-
for (let i = 0; i < entry.hooks.length; i++) {
|
|
1075
|
-
const hook = entry.hooks[i];
|
|
1076
|
-
const cmdLabel = formatHookCommandLabel(hook, OS);
|
|
1077
|
-
const truncatedCmd = cmdLabel.length > 60 ? cmdLabel.substring(0, 57) + "..." : cmdLabel;
|
|
1078
|
-
items.push({
|
|
1079
|
-
id: `${( hookFile.uri.toString())}#${entry.originalId}[${i}]`,
|
|
1080
|
-
uri: hookFile.uri,
|
|
1081
|
-
name: hookMeta?.label ?? entry.originalId,
|
|
1082
|
-
filename: basename(hookFile.uri),
|
|
1083
|
-
description: truncatedCmd || ( localize(5330, "(unset)")),
|
|
1084
|
-
storage: hookFile.storage,
|
|
1085
|
-
promptType,
|
|
1086
|
-
disabled: ( disabledUris.has(hookFile.uri))
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
} catch {}
|
|
1092
|
-
if (!parsedHooks) {
|
|
1093
|
-
const filename = basename(hookFile.uri);
|
|
1094
|
-
items.push({
|
|
1095
|
-
id: ( hookFile.uri.toString()),
|
|
1096
|
-
uri: hookFile.uri,
|
|
1097
|
-
name: hookFile.name || this.getFriendlyName(filename),
|
|
1098
|
-
filename,
|
|
1099
|
-
storage: hookFile.storage,
|
|
1100
|
-
promptType,
|
|
1101
|
-
disabled: ( disabledUris.has(hookFile.uri))
|
|
1102
|
-
});
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
const agents = !this.workspaceService.isSessionsWindow ? await this.promptsService.getCustomAgents(CancellationToken.None) : [];
|
|
1106
|
-
for (const agent of agents) {
|
|
1107
|
-
if (!agent.hooks) {
|
|
1108
|
-
continue;
|
|
1109
|
-
}
|
|
1110
|
-
for (const hookType of ( Object.values(HookType))) {
|
|
1111
|
-
const hookCommands = agent.hooks[hookType];
|
|
1112
|
-
if (!hookCommands || hookCommands.length === 0) {
|
|
1113
|
-
continue;
|
|
1114
|
-
}
|
|
1115
|
-
const hookMeta = HOOK_METADATA[hookType];
|
|
1116
|
-
for (let i = 0; i < hookCommands.length; i++) {
|
|
1117
|
-
const hook = hookCommands[i];
|
|
1118
|
-
const cmdLabel = formatHookCommandLabel(hook, OS);
|
|
1119
|
-
const truncatedCmd = cmdLabel.length > 60 ? cmdLabel.substring(0, 57) + "..." : cmdLabel;
|
|
1120
|
-
items.push({
|
|
1121
|
-
id: `${( agent.uri.toString())}#hook:${hookType}[${i}]`,
|
|
1122
|
-
uri: agent.uri,
|
|
1123
|
-
name: hookMeta?.label ?? hookType,
|
|
1124
|
-
filename: basename(agent.uri),
|
|
1125
|
-
description: `${agent.name}: ${truncatedCmd || ( localize(5330, "(unset)"))}`,
|
|
1126
|
-
storage: agent.source.storage,
|
|
1127
|
-
groupKey: "agents",
|
|
1128
|
-
promptType,
|
|
1129
|
-
pluginUri: agent.source.storage === PromptsStorage.plugin ? agent.source.pluginUri : undefined,
|
|
1130
|
-
disabled: ( disabledUris.has(agent.uri))
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
} else {
|
|
1136
|
-
const promptFiles = await this.promptsService.listPromptFiles(promptType, CancellationToken.None);
|
|
1137
|
-
for (const file of promptFiles) {
|
|
1138
|
-
if (file.extension) {
|
|
1139
|
-
extensionInfoByUri.set(( file.uri.toString()), {
|
|
1140
|
-
id: file.extension.identifier,
|
|
1141
|
-
displayName: file.extension.displayName
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
const agentInstructionFiles = await this.promptsService.listAgentInstructions(CancellationToken.None, undefined);
|
|
1146
|
-
const agentInstructionUris = ( new ResourceSet(( agentInstructionFiles.map(f => f.uri))));
|
|
1147
|
-
const workspaceFolderUris = ( this.workspaceContextService.getWorkspace().folders.map(f => f.uri));
|
|
1148
|
-
const activeRoot = this.workspaceService.getActiveProjectRoot();
|
|
1149
|
-
if (activeRoot) {
|
|
1150
|
-
workspaceFolderUris.push(activeRoot);
|
|
1151
|
-
}
|
|
1152
|
-
for (const file of agentInstructionFiles) {
|
|
1153
|
-
const storage = PromptsStorage.local;
|
|
1154
|
-
const filename = basename(file.uri);
|
|
1155
|
-
items.push({
|
|
1156
|
-
id: ( file.uri.toString()),
|
|
1157
|
-
uri: file.uri,
|
|
1158
|
-
name: filename,
|
|
1159
|
-
filename: this.labelService.getUriLabel(file.uri, {
|
|
1160
|
-
relative: true
|
|
1161
|
-
}),
|
|
1162
|
-
displayName: filename,
|
|
1163
|
-
storage,
|
|
1164
|
-
promptType,
|
|
1165
|
-
typeIcon: storageToIcon(storage),
|
|
1166
|
-
groupKey: "agent-instructions",
|
|
1167
|
-
disabled: ( disabledUris.has(file.uri))
|
|
1168
|
-
});
|
|
1169
|
-
}
|
|
1170
|
-
const promptFilesToParse = promptFiles.filter(item => !( agentInstructionUris.has(item.uri)));
|
|
1171
|
-
const parseResults = await Promise.all(( promptFilesToParse.map(async item => {
|
|
1172
|
-
try {
|
|
1173
|
-
const parsed = await this.promptsService.parseNew(item.uri, CancellationToken.None);
|
|
1174
|
-
return {
|
|
1175
|
-
item,
|
|
1176
|
-
parsed
|
|
1177
|
-
};
|
|
1178
|
-
} catch {
|
|
1179
|
-
return {
|
|
1180
|
-
item,
|
|
1181
|
-
parsed: undefined
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
})));
|
|
1185
|
-
for (const {
|
|
1186
|
-
item,
|
|
1187
|
-
parsed
|
|
1188
|
-
} of parseResults) {
|
|
1189
|
-
items.push(this.buildInstructionListItem(
|
|
1190
|
-
item.uri,
|
|
1191
|
-
item.name || getCleanPromptName(item.uri),
|
|
1192
|
-
item.description,
|
|
1193
|
-
item.storage,
|
|
1194
|
-
parsed?.header,
|
|
1195
|
-
( disabledUris.has(item.uri)),
|
|
1196
|
-
item.storage === PromptsStorage.plugin ? item.pluginUri : undefined
|
|
1197
|
-
));
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
const groupedItems = this.applyBuiltinGroupKeys(items, extensionInfoByUri);
|
|
1201
|
-
const filter = this.workspaceService.getStorageSourceFilter(promptType);
|
|
1202
|
-
const withStorage = groupedItems.filter(item => item.storage !== undefined);
|
|
1203
|
-
const withoutStorage = groupedItems.filter(item => item.storage === undefined);
|
|
1204
|
-
const filteredItems = [...applyStorageSourceFilter(withStorage, filter), ...withoutStorage];
|
|
1205
|
-
items.length = 0;
|
|
1206
|
-
items.push(...filteredItems);
|
|
1207
|
-
const descriptor = this.harnessService.getActiveDescriptor();
|
|
1208
|
-
const subpaths = descriptor.workspaceSubpaths;
|
|
1209
|
-
const instrFilter = descriptor.instructionFileFilter;
|
|
1210
|
-
if (subpaths) {
|
|
1211
|
-
const projectRoot = this.workspaceService.getActiveProjectRoot();
|
|
1212
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
1213
|
-
const item = items[i];
|
|
1214
|
-
if (item.storage === PromptsStorage.local && projectRoot && isEqualOrParent(item.uri, projectRoot)) {
|
|
1215
|
-
if (!matchesWorkspaceSubpath(item.uri.path, subpaths)) {
|
|
1216
|
-
if (instrFilter && promptType === PromptsType.instructions && matchesInstructionFileFilter(item.uri.path, instrFilter)) {
|
|
1217
|
-
continue;
|
|
1218
|
-
}
|
|
1219
|
-
items.splice(i, 1);
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
if (instrFilter && promptType === PromptsType.instructions) {
|
|
1225
|
-
for (let i = items.length - 1; i >= 0; i--) {
|
|
1226
|
-
if (!matchesInstructionFileFilter(items[i].uri.path, instrFilter)) {
|
|
1227
|
-
items.splice(i, 1);
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
items.sort((a, b) => a.name.localeCompare(b.name));
|
|
1232
|
-
return items;
|
|
944
|
+
return this.getItemSource(this.harnessService.getActiveDescriptor()).fetchItems(promptType);
|
|
1233
945
|
}
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
return [];
|
|
1238
|
-
}
|
|
1239
|
-
return ( allItems.filter(item => item.type === promptType).map(item => {
|
|
1240
|
-
const pluginUri = this.findPluginUri(item.uri);
|
|
1241
|
-
const storage = pluginUri ? PromptsStorage.plugin : this.inferStorageFromUri(item.uri);
|
|
1242
|
-
return {
|
|
1243
|
-
id: ( item.uri.toString()),
|
|
1244
|
-
uri: item.uri,
|
|
1245
|
-
name: item.name,
|
|
1246
|
-
filename: basename(item.uri),
|
|
1247
|
-
description: item.description,
|
|
1248
|
-
promptType,
|
|
1249
|
-
disabled: false,
|
|
1250
|
-
groupKey: item.groupKey,
|
|
1251
|
-
badge: item.badge,
|
|
1252
|
-
badgeTooltip: item.badgeTooltip,
|
|
1253
|
-
storage,
|
|
1254
|
-
pluginUri
|
|
1255
|
-
};
|
|
1256
|
-
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
1257
|
-
}
|
|
1258
|
-
async enrichProviderInstructionItems(items) {
|
|
1259
|
-
const result = [];
|
|
1260
|
-
const toParse = items.filter(item => !item.groupKey);
|
|
1261
|
-
const passThrough = items.filter(item => !!item.groupKey);
|
|
1262
|
-
const parseResults = await Promise.all(( toParse.map(async item => {
|
|
1263
|
-
try {
|
|
1264
|
-
const parsed = await this.promptsService.parseNew(item.uri, CancellationToken.None);
|
|
1265
|
-
return {
|
|
1266
|
-
item,
|
|
1267
|
-
parsed
|
|
1268
|
-
};
|
|
1269
|
-
} catch {
|
|
1270
|
-
return {
|
|
1271
|
-
item,
|
|
1272
|
-
parsed: undefined
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
})));
|
|
1276
|
-
for (const {
|
|
1277
|
-
item,
|
|
1278
|
-
parsed
|
|
1279
|
-
} of parseResults) {
|
|
1280
|
-
result.push(this.buildInstructionListItem(
|
|
1281
|
-
item.uri,
|
|
1282
|
-
item.name,
|
|
1283
|
-
item.description,
|
|
1284
|
-
item.storage ?? PromptsStorage.local,
|
|
1285
|
-
parsed?.header,
|
|
1286
|
-
item.disabled,
|
|
1287
|
-
item.pluginUri
|
|
1288
|
-
));
|
|
946
|
+
getItemSource(descriptor) {
|
|
947
|
+
if (this.cachedItemSource && this.cachedItemSource.descriptorId === descriptor.id) {
|
|
948
|
+
return this.cachedItemSource.source;
|
|
1289
949
|
}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
name: friendlyName,
|
|
1304
|
-
filename: this.labelService.getUriLabel(uri, {
|
|
1305
|
-
relative: true
|
|
1306
|
-
}),
|
|
1307
|
-
displayName: friendlyName,
|
|
1308
|
-
description,
|
|
1309
|
-
storage,
|
|
1310
|
-
promptType: PromptsType.instructions,
|
|
1311
|
-
typeIcon: storageToIcon(storage),
|
|
1312
|
-
groupKey: "agent-instructions",
|
|
1313
|
-
pluginUri,
|
|
1314
|
-
disabled
|
|
1315
|
-
};
|
|
1316
|
-
}
|
|
1317
|
-
const applyTo = evaluateApplyToPattern(header, isInClaudeRulesFolder(uri));
|
|
1318
|
-
if (applyTo !== undefined) {
|
|
1319
|
-
const badge = applyTo === "**" ? ( localize(5331, "always added")) : applyTo;
|
|
1320
|
-
const badgeTooltip = applyTo === "**" ? ( localize(5332, "This instruction is automatically included in every interaction.")) : ( localize(
|
|
1321
|
-
5333,
|
|
1322
|
-
"This instruction is automatically included when files matching '{0}' are in context.",
|
|
1323
|
-
applyTo
|
|
1324
|
-
));
|
|
1325
|
-
return {
|
|
1326
|
-
id: ( uri.toString()),
|
|
1327
|
-
uri,
|
|
1328
|
-
name: friendlyName,
|
|
1329
|
-
filename: this.labelService.getUriLabel(uri, {
|
|
1330
|
-
relative: true
|
|
1331
|
-
}),
|
|
1332
|
-
displayName: friendlyName,
|
|
1333
|
-
badge,
|
|
1334
|
-
badgeTooltip,
|
|
1335
|
-
description,
|
|
1336
|
-
storage,
|
|
1337
|
-
promptType: PromptsType.instructions,
|
|
1338
|
-
typeIcon: storageToIcon(storage),
|
|
1339
|
-
groupKey: "context-instructions",
|
|
1340
|
-
pluginUri,
|
|
1341
|
-
disabled
|
|
1342
|
-
};
|
|
1343
|
-
}
|
|
1344
|
-
return {
|
|
1345
|
-
id: ( uri.toString()),
|
|
1346
|
-
uri,
|
|
1347
|
-
name: friendlyName,
|
|
1348
|
-
filename,
|
|
1349
|
-
displayName: friendlyName,
|
|
1350
|
-
description,
|
|
1351
|
-
storage,
|
|
1352
|
-
promptType: PromptsType.instructions,
|
|
1353
|
-
typeIcon: storageToIcon(storage),
|
|
1354
|
-
groupKey: "on-demand-instructions",
|
|
1355
|
-
pluginUri,
|
|
1356
|
-
disabled
|
|
950
|
+
const itemProvider = descriptor.itemProvider ?? (descriptor.syncProvider ? undefined : this.promptsServiceItemProvider);
|
|
951
|
+
const source = ( new ProviderCustomizationItemSource(
|
|
952
|
+
itemProvider,
|
|
953
|
+
descriptor.syncProvider,
|
|
954
|
+
this.promptsService,
|
|
955
|
+
this.workspaceService,
|
|
956
|
+
this.fileService,
|
|
957
|
+
this.pathService,
|
|
958
|
+
this.itemNormalizer
|
|
959
|
+
));
|
|
960
|
+
this.cachedItemSource = {
|
|
961
|
+
descriptorId: descriptor.id,
|
|
962
|
+
source
|
|
1357
963
|
};
|
|
964
|
+
return source;
|
|
1358
965
|
}
|
|
1359
|
-
|
|
1360
|
-
if (this.workspaceContextService.getWorkspaceFolder(uri)) {
|
|
1361
|
-
return PromptsStorage.local;
|
|
1362
|
-
}
|
|
1363
|
-
const activeProjectRoot = this.workspaceService.getActiveProjectRoot();
|
|
1364
|
-
if (activeProjectRoot && isEqualOrParent(uri, activeProjectRoot)) {
|
|
1365
|
-
return PromptsStorage.local;
|
|
1366
|
-
}
|
|
1367
|
-
const promptsHome = this.userDataProfileService.currentProfile.promptsHome;
|
|
1368
|
-
if (isEqualOrParent(uri, promptsHome)) {
|
|
1369
|
-
return PromptsStorage.user;
|
|
1370
|
-
}
|
|
1371
|
-
return PromptsStorage.user;
|
|
1372
|
-
}
|
|
1373
|
-
getFriendlyName(filename) {
|
|
1374
|
-
let name = filename.replace(/\.instructions\.md$/i, "").replace(/\.prompt\.md$/i, "").replace(/\.agent\.md$/i, "").replace(/\.md$/i, "");
|
|
1375
|
-
name = name.replace(/[-_]/g, " ").replace(/\b\w/g, c => c.toUpperCase());
|
|
1376
|
-
return name || filename;
|
|
1377
|
-
}
|
|
1378
|
-
filterItems() {
|
|
1379
|
-
let matchedItems;
|
|
966
|
+
applySearchFilter(items) {
|
|
1380
967
|
if (!this.searchQuery.trim()) {
|
|
1381
|
-
|
|
968
|
+
return ( items.map(item => ({
|
|
1382
969
|
...item,
|
|
1383
970
|
nameMatches: undefined,
|
|
1384
971
|
descriptionMatches: undefined
|
|
1385
972
|
})));
|
|
1386
|
-
} else {
|
|
1387
|
-
const query = this.searchQuery.toLowerCase();
|
|
1388
|
-
matchedItems = [];
|
|
1389
|
-
for (const item of this.allItems) {
|
|
1390
|
-
const displayName = item.displayName ?? formatDisplayName(item.name);
|
|
1391
|
-
const nameMatches = matchesContiguousSubString(query, displayName);
|
|
1392
|
-
const descriptionMatches = item.description ? matchesContiguousSubString(query, item.description) : null;
|
|
1393
|
-
const filenameMatches = matchesContiguousSubString(query, item.filename);
|
|
1394
|
-
const badgeMatches = item.badge ? matchesContiguousSubString(query, item.badge) : null;
|
|
1395
|
-
if (nameMatches || descriptionMatches || filenameMatches || badgeMatches) {
|
|
1396
|
-
matchedItems.push({
|
|
1397
|
-
...item,
|
|
1398
|
-
nameMatches: nameMatches || undefined,
|
|
1399
|
-
descriptionMatches: descriptionMatches || undefined
|
|
1400
|
-
});
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
973
|
}
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
description: "",
|
|
1419
|
-
items: []
|
|
1420
|
-
};
|
|
1421
|
-
groupsMap.set(key, group);
|
|
1422
|
-
}
|
|
1423
|
-
group.items.push(item);
|
|
1424
|
-
}
|
|
1425
|
-
const groups = Array.from(( groupsMap.values()));
|
|
1426
|
-
for (const group of groups) {
|
|
1427
|
-
group.items.sort((a, b) => a.name.localeCompare(b.name));
|
|
1428
|
-
}
|
|
1429
|
-
this.displayEntries = [];
|
|
1430
|
-
let isFirstGroup = true;
|
|
1431
|
-
for (const group of groups) {
|
|
1432
|
-
if (group.items.length === 0) {
|
|
1433
|
-
continue;
|
|
1434
|
-
}
|
|
1435
|
-
const collapsed = ( this.collapsedGroups.has(group.groupKey));
|
|
1436
|
-
this.displayEntries.push({
|
|
1437
|
-
type: "group-header",
|
|
1438
|
-
id: `group-${group.groupKey}`,
|
|
1439
|
-
groupKey: group.groupKey,
|
|
1440
|
-
label: group.label,
|
|
1441
|
-
icon: group.icon,
|
|
1442
|
-
count: group.items.length,
|
|
1443
|
-
isFirst: isFirstGroup,
|
|
1444
|
-
description: group.description,
|
|
1445
|
-
collapsed
|
|
1446
|
-
});
|
|
1447
|
-
isFirstGroup = false;
|
|
1448
|
-
if (!collapsed) {
|
|
1449
|
-
for (const item of group.items) {
|
|
1450
|
-
this.displayEntries.push({
|
|
1451
|
-
type: "file-item",
|
|
1452
|
-
item
|
|
1453
|
-
});
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
}
|
|
1457
|
-
this.list.splice(0, this.list.length, this.displayEntries);
|
|
1458
|
-
this.updateEmptyState();
|
|
1459
|
-
return matchedItems.length;
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
const promptType = sectionToPromptType(this.currentSection);
|
|
1463
|
-
const visibleSources = ( new Set(this.workspaceService.getStorageSourceFilter(promptType).sources));
|
|
1464
|
-
const groups = this.currentSection === AICustomizationManagementSection.Instructions ? [{
|
|
1465
|
-
groupKey: "agent-instructions",
|
|
1466
|
-
label: ( localize(5335, "Agent Instructions")),
|
|
1467
|
-
icon: instructionsIcon,
|
|
1468
|
-
description: ( localize(
|
|
1469
|
-
5336,
|
|
1470
|
-
"Instruction files automatically loaded for all agent interactions (e.g. AGENTS.md, CLAUDE.md, copilot-instructions.md)."
|
|
1471
|
-
)),
|
|
1472
|
-
items: []
|
|
1473
|
-
}, {
|
|
1474
|
-
groupKey: "context-instructions",
|
|
1475
|
-
label: ( localize(5337, "Included Based on Context")),
|
|
1476
|
-
icon: instructionsIcon,
|
|
1477
|
-
description: ( localize(
|
|
1478
|
-
5338,
|
|
1479
|
-
"Instructions automatically loaded when matching files are part of the context."
|
|
1480
|
-
)),
|
|
1481
|
-
items: []
|
|
1482
|
-
}, {
|
|
1483
|
-
groupKey: "on-demand-instructions",
|
|
1484
|
-
label: ( localize(5339, "Loaded on Demand")),
|
|
1485
|
-
icon: instructionsIcon,
|
|
1486
|
-
description: ( localize(5340, "Instructions loaded only when explicitly referenced.")),
|
|
1487
|
-
items: []
|
|
1488
|
-
}] : [{
|
|
1489
|
-
groupKey: PromptsStorage.local,
|
|
1490
|
-
label: ( localize(5341, "Workspace")),
|
|
1491
|
-
icon: workspaceIcon,
|
|
1492
|
-
description: ( localize(
|
|
1493
|
-
5342,
|
|
1494
|
-
"Customizations stored as files in your project folder and shared with your team via version control."
|
|
1495
|
-
)),
|
|
1496
|
-
items: []
|
|
1497
|
-
}, {
|
|
1498
|
-
groupKey: PromptsStorage.user,
|
|
1499
|
-
label: ( localize(5343, "User")),
|
|
1500
|
-
icon: userIcon,
|
|
1501
|
-
description: ( localize(
|
|
1502
|
-
5344,
|
|
1503
|
-
"Customizations stored locally on your machine in a central location. Private to you and available across all projects."
|
|
1504
|
-
)),
|
|
1505
|
-
items: []
|
|
1506
|
-
}, {
|
|
1507
|
-
groupKey: PromptsStorage.plugin,
|
|
1508
|
-
label: ( localize(5345, "Plugins")),
|
|
1509
|
-
icon: pluginIcon,
|
|
1510
|
-
description: ( localize(5346, "Read-only customizations provided by installed plugins.")),
|
|
1511
|
-
items: []
|
|
1512
|
-
}, {
|
|
1513
|
-
groupKey: PromptsStorage.extension,
|
|
1514
|
-
label: ( localize(5347, "Extensions")),
|
|
1515
|
-
icon: extensionIcon,
|
|
1516
|
-
description: ( localize(5348, "Read-only customizations provided by installed extensions.")),
|
|
1517
|
-
items: []
|
|
1518
|
-
}, {
|
|
1519
|
-
groupKey: BUILTIN_STORAGE,
|
|
1520
|
-
label: ( localize(5349, "Built-in")),
|
|
1521
|
-
icon: builtinIcon,
|
|
1522
|
-
description: ( localize(5350, "Built-in customizations shipped with the application.")),
|
|
1523
|
-
items: []
|
|
1524
|
-
}, {
|
|
1525
|
-
groupKey: "agents",
|
|
1526
|
-
label: ( localize(5351, "Agents")),
|
|
1527
|
-
icon: agentIcon,
|
|
1528
|
-
description: ( localize(5352, "Hooks defined in agent files.")),
|
|
1529
|
-
items: []
|
|
1530
|
-
}].filter(g => ( visibleSources.has(g.groupKey)) || g.groupKey === "agents");
|
|
1531
|
-
for (const item of matchedItems) {
|
|
1532
|
-
const key = item.groupKey ?? item.storage ?? PromptsStorage.local;
|
|
1533
|
-
const group = groups.find(g => g.groupKey === key);
|
|
1534
|
-
if (group) {
|
|
1535
|
-
group.items.push(item);
|
|
974
|
+
const query = this.searchQuery.toLowerCase();
|
|
975
|
+
const matched = [];
|
|
976
|
+
for (const item of items) {
|
|
977
|
+
const displayName = item.displayName ?? formatDisplayName(item.name);
|
|
978
|
+
const nameMatches = matchesContiguousSubString(query, displayName);
|
|
979
|
+
const descriptionMatches = item.description ? matchesContiguousSubString(query, item.description) : null;
|
|
980
|
+
const filenameMatches = matchesContiguousSubString(query, item.filename);
|
|
981
|
+
const badgeMatches = item.badge ? matchesContiguousSubString(query, item.badge) : null;
|
|
982
|
+
if (nameMatches || descriptionMatches || filenameMatches || badgeMatches) {
|
|
983
|
+
matched.push({
|
|
984
|
+
...item,
|
|
985
|
+
nameMatches: nameMatches || undefined,
|
|
986
|
+
descriptionMatches: descriptionMatches || undefined
|
|
987
|
+
});
|
|
1536
988
|
}
|
|
1537
989
|
}
|
|
990
|
+
return matched;
|
|
991
|
+
}
|
|
992
|
+
buildGroupedEntries(groups) {
|
|
1538
993
|
for (const group of groups) {
|
|
1539
994
|
group.items.sort((a, b) => a.name.localeCompare(b.name));
|
|
1540
995
|
}
|
|
@@ -1566,8 +1021,167 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
1566
1021
|
}
|
|
1567
1022
|
}
|
|
1568
1023
|
}
|
|
1024
|
+
}
|
|
1025
|
+
commitDisplayEntries() {
|
|
1569
1026
|
this.list.splice(0, this.list.length, this.displayEntries);
|
|
1570
1027
|
this.updateEmptyState();
|
|
1028
|
+
}
|
|
1029
|
+
groupMatchedItems(matchedItems) {
|
|
1030
|
+
const activeDescriptor = this.harnessService.getActiveDescriptor();
|
|
1031
|
+
if (activeDescriptor.syncProvider) {
|
|
1032
|
+
const remoteItems = matchedItems.filter(i => !i.syncable);
|
|
1033
|
+
const localItems = matchedItems.filter(i => i.syncable);
|
|
1034
|
+
const entries = [];
|
|
1035
|
+
for (const item of remoteItems.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
1036
|
+
entries.push({
|
|
1037
|
+
type: "file-item",
|
|
1038
|
+
item
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
if (localItems.length > 0) {
|
|
1042
|
+
const syncedCount = localItems.filter(i => i.synced).length;
|
|
1043
|
+
entries.push({
|
|
1044
|
+
type: "group-header",
|
|
1045
|
+
id: "group-sync-local",
|
|
1046
|
+
groupKey: "sync-local",
|
|
1047
|
+
label: ( localize(5344, "Local")),
|
|
1048
|
+
icon: Codicon.folder,
|
|
1049
|
+
count: syncedCount,
|
|
1050
|
+
isFirst: remoteItems.length === 0,
|
|
1051
|
+
description: ( localize(5345, "Local customizations available to sync to the remote agent.")),
|
|
1052
|
+
collapsed: false
|
|
1053
|
+
});
|
|
1054
|
+
const sorted = localItems.sort((a, b) => {
|
|
1055
|
+
if (a.synced !== b.synced) {
|
|
1056
|
+
return a.synced ? -1 : 1;
|
|
1057
|
+
}
|
|
1058
|
+
return a.name.localeCompare(b.name);
|
|
1059
|
+
});
|
|
1060
|
+
for (const item of sorted) {
|
|
1061
|
+
entries.push({
|
|
1062
|
+
type: "file-item",
|
|
1063
|
+
item: item.synced ? item : {
|
|
1064
|
+
...item,
|
|
1065
|
+
disabled: true
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
this.displayEntries = entries;
|
|
1071
|
+
} else {
|
|
1072
|
+
const groups = this.currentSection === AICustomizationManagementSection.Instructions ? [{
|
|
1073
|
+
groupKey: "agent-instructions",
|
|
1074
|
+
label: ( localize(5346, "Agent Instructions")),
|
|
1075
|
+
icon: instructionsIcon,
|
|
1076
|
+
description: ( localize(
|
|
1077
|
+
5347,
|
|
1078
|
+
"Instruction files automatically loaded for all agent interactions (e.g. AGENTS.md, CLAUDE.md, copilot-instructions.md)."
|
|
1079
|
+
)),
|
|
1080
|
+
items: []
|
|
1081
|
+
}, {
|
|
1082
|
+
groupKey: "context-instructions",
|
|
1083
|
+
label: ( localize(5348, "Included Based on Context")),
|
|
1084
|
+
icon: instructionsIcon,
|
|
1085
|
+
description: ( localize(
|
|
1086
|
+
5349,
|
|
1087
|
+
"Instructions automatically loaded when matching files are part of the context."
|
|
1088
|
+
)),
|
|
1089
|
+
items: []
|
|
1090
|
+
}, {
|
|
1091
|
+
groupKey: "on-demand-instructions",
|
|
1092
|
+
label: ( localize(5350, "Loaded on Demand")),
|
|
1093
|
+
icon: instructionsIcon,
|
|
1094
|
+
description: ( localize(5351, "Instructions loaded only when explicitly referenced.")),
|
|
1095
|
+
items: []
|
|
1096
|
+
}, {
|
|
1097
|
+
groupKey: PromptsStorage.local,
|
|
1098
|
+
label: ( localize(5352, "Workspace")),
|
|
1099
|
+
icon: workspaceIcon,
|
|
1100
|
+
description: ( localize(
|
|
1101
|
+
5353,
|
|
1102
|
+
"Customizations stored as files in your project folder and shared with your team via version control."
|
|
1103
|
+
)),
|
|
1104
|
+
items: []
|
|
1105
|
+
}, {
|
|
1106
|
+
groupKey: PromptsStorage.user,
|
|
1107
|
+
label: ( localize(5354, "User")),
|
|
1108
|
+
icon: userIcon,
|
|
1109
|
+
description: ( localize(
|
|
1110
|
+
5355,
|
|
1111
|
+
"Customizations stored locally on your machine in a central location. Private to you and available across all projects."
|
|
1112
|
+
)),
|
|
1113
|
+
items: []
|
|
1114
|
+
}, {
|
|
1115
|
+
groupKey: PromptsStorage.plugin,
|
|
1116
|
+
label: ( localize(5356, "Plugins")),
|
|
1117
|
+
icon: pluginIcon,
|
|
1118
|
+
description: ( localize(5357, "Read-only customizations provided by installed plugins.")),
|
|
1119
|
+
items: []
|
|
1120
|
+
}, {
|
|
1121
|
+
groupKey: BUILTIN_STORAGE,
|
|
1122
|
+
label: ( localize(5358, "Built-in")),
|
|
1123
|
+
icon: builtinIcon,
|
|
1124
|
+
description: ( localize(5359, "Built-in customizations shipped with the application.")),
|
|
1125
|
+
items: []
|
|
1126
|
+
}] : [{
|
|
1127
|
+
groupKey: PromptsStorage.local,
|
|
1128
|
+
label: ( localize(5352, "Workspace")),
|
|
1129
|
+
icon: workspaceIcon,
|
|
1130
|
+
description: ( localize(
|
|
1131
|
+
5353,
|
|
1132
|
+
"Customizations stored as files in your project folder and shared with your team via version control."
|
|
1133
|
+
)),
|
|
1134
|
+
items: []
|
|
1135
|
+
}, {
|
|
1136
|
+
groupKey: PromptsStorage.user,
|
|
1137
|
+
label: ( localize(5354, "User")),
|
|
1138
|
+
icon: userIcon,
|
|
1139
|
+
description: ( localize(
|
|
1140
|
+
5355,
|
|
1141
|
+
"Customizations stored locally on your machine in a central location. Private to you and available across all projects."
|
|
1142
|
+
)),
|
|
1143
|
+
items: []
|
|
1144
|
+
}, {
|
|
1145
|
+
groupKey: PromptsStorage.plugin,
|
|
1146
|
+
label: ( localize(5356, "Plugins")),
|
|
1147
|
+
icon: pluginIcon,
|
|
1148
|
+
description: ( localize(5357, "Read-only customizations provided by installed plugins.")),
|
|
1149
|
+
items: []
|
|
1150
|
+
}, {
|
|
1151
|
+
groupKey: PromptsStorage.extension,
|
|
1152
|
+
label: ( localize(5360, "Extensions")),
|
|
1153
|
+
icon: extensionIcon,
|
|
1154
|
+
description: ( localize(5361, "Read-only customizations provided by installed extensions.")),
|
|
1155
|
+
items: []
|
|
1156
|
+
}, {
|
|
1157
|
+
groupKey: BUILTIN_STORAGE,
|
|
1158
|
+
label: ( localize(5358, "Built-in")),
|
|
1159
|
+
icon: builtinIcon,
|
|
1160
|
+
description: ( localize(5359, "Built-in customizations shipped with the application.")),
|
|
1161
|
+
items: []
|
|
1162
|
+
}];
|
|
1163
|
+
for (const item of matchedItems) {
|
|
1164
|
+
const key = item.groupKey ?? item.storage ?? PromptsStorage.local;
|
|
1165
|
+
let group = groups.find(g => g.groupKey === key);
|
|
1166
|
+
if (!group) {
|
|
1167
|
+
group = {
|
|
1168
|
+
groupKey: key,
|
|
1169
|
+
label: formatDisplayName(key),
|
|
1170
|
+
icon: Codicon.folder,
|
|
1171
|
+
description: "",
|
|
1172
|
+
items: []
|
|
1173
|
+
};
|
|
1174
|
+
groups.push(group);
|
|
1175
|
+
}
|
|
1176
|
+
group.items.push(item);
|
|
1177
|
+
}
|
|
1178
|
+
this.buildGroupedEntries(groups);
|
|
1179
|
+
}
|
|
1180
|
+
this.commitDisplayEntries();
|
|
1181
|
+
}
|
|
1182
|
+
filterItems() {
|
|
1183
|
+
const matchedItems = this.applySearchFilter(this.allItems);
|
|
1184
|
+
this.groupMatchedItems(matchedItems);
|
|
1571
1185
|
return matchedItems.length;
|
|
1572
1186
|
}
|
|
1573
1187
|
toggleGroup(entry) {
|
|
@@ -1587,8 +1201,8 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
1587
1201
|
const sectionIcon = this.getSectionIcon();
|
|
1588
1202
|
this.emptyStateIcon.classList.add(...ThemeIcon.asClassNameArray(sectionIcon));
|
|
1589
1203
|
if (this.searchQuery.trim()) {
|
|
1590
|
-
this.emptyStateText.textContent = ( localize(
|
|
1591
|
-
this.emptyStateSubtext.textContent = ( localize(
|
|
1204
|
+
this.emptyStateText.textContent = ( localize(5362, "No items match '{0}'", this.searchQuery));
|
|
1205
|
+
this.emptyStateSubtext.textContent = ( localize(5363, "Try a different search term"));
|
|
1592
1206
|
} else {
|
|
1593
1207
|
const emptyInfo = this.getEmptyStateInfo();
|
|
1594
1208
|
this.emptyStateText.textContent = emptyInfo.title;
|
|
@@ -1614,41 +1228,33 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
1614
1228
|
return promptIcon;
|
|
1615
1229
|
}
|
|
1616
1230
|
}
|
|
1617
|
-
findPluginUri(itemUri) {
|
|
1618
|
-
for (const plugin of this.agentPluginService.plugins.get()) {
|
|
1619
|
-
if (isEqualOrParent(itemUri, plugin.uri)) {
|
|
1620
|
-
return plugin.uri;
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
return undefined;
|
|
1624
|
-
}
|
|
1625
1231
|
getEmptyStateInfo() {
|
|
1626
1232
|
switch (this.currentSection) {
|
|
1627
1233
|
case AICustomizationManagementSection.Agents:
|
|
1628
1234
|
return {
|
|
1629
|
-
title: ( localize(
|
|
1630
|
-
description: ( localize(
|
|
1235
|
+
title: ( localize(5364, "No agents yet")),
|
|
1236
|
+
description: ( localize(5365, "Create your first custom agent to get started"))
|
|
1631
1237
|
};
|
|
1632
1238
|
case AICustomizationManagementSection.Skills:
|
|
1633
1239
|
return {
|
|
1634
|
-
title: ( localize(
|
|
1635
|
-
description: ( localize(
|
|
1240
|
+
title: ( localize(5366, "No skills yet")),
|
|
1241
|
+
description: ( localize(5367, "Create your first skill to extend agent capabilities"))
|
|
1636
1242
|
};
|
|
1637
1243
|
case AICustomizationManagementSection.Instructions:
|
|
1638
1244
|
return {
|
|
1639
|
-
title: ( localize(
|
|
1640
|
-
description: ( localize(
|
|
1245
|
+
title: ( localize(5368, "No instructions yet")),
|
|
1246
|
+
description: ( localize(5369, "Add instructions to teach Copilot about your codebase"))
|
|
1641
1247
|
};
|
|
1642
1248
|
case AICustomizationManagementSection.Hooks:
|
|
1643
1249
|
return {
|
|
1644
|
-
title: ( localize(
|
|
1645
|
-
description: ( localize(
|
|
1250
|
+
title: ( localize(5370, "No hooks yet")),
|
|
1251
|
+
description: ( localize(5371, "Create hooks to execute commands at agent lifecycle events"))
|
|
1646
1252
|
};
|
|
1647
1253
|
case AICustomizationManagementSection.Prompts:
|
|
1648
1254
|
default:
|
|
1649
1255
|
return {
|
|
1650
|
-
title: ( localize(
|
|
1651
|
-
description: ( localize(
|
|
1256
|
+
title: ( localize(5372, "No prompts yet")),
|
|
1257
|
+
description: ( localize(5373, "Create reusable prompts for common tasks"))
|
|
1652
1258
|
};
|
|
1653
1259
|
}
|
|
1654
1260
|
}
|
|
@@ -1689,13 +1295,17 @@ let AICustomizationListWidget = class AICustomizationListWidget extends Disposab
|
|
|
1689
1295
|
return this.allItems.length;
|
|
1690
1296
|
}
|
|
1691
1297
|
async generateDebugReport() {
|
|
1298
|
+
await this.loadItems();
|
|
1299
|
+
if (this._store.isDisposed) {
|
|
1300
|
+
return "";
|
|
1301
|
+
}
|
|
1692
1302
|
const activeDescriptor = this.harnessService.getActiveDescriptor();
|
|
1693
1303
|
return generateCustomizationDebugReport(this.currentSection, this.promptsService, this.workspaceService, {
|
|
1694
1304
|
allItems: this.allItems,
|
|
1695
1305
|
displayEntries: this.displayEntries
|
|
1696
|
-
}, activeDescriptor.
|
|
1306
|
+
}, activeDescriptor, this.promptsServiceItemProvider);
|
|
1697
1307
|
}
|
|
1698
1308
|
};
|
|
1699
|
-
AICustomizationListWidget = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IPromptsService)), ( __param(2, IContextViewService)), ( __param(3, IOpenerService)), ( __param(4, IContextMenuService)), ( __param(5, IMenuService)), ( __param(6, IContextKeyService)), ( __param(7, IWorkspaceContextService)), ( __param(8, ILabelService)), ( __param(9, IAICustomizationWorkspaceService)), ( __param(10, IClipboardService)), ( __param(11, IHoverService)), ( __param(12, IFileService)), ( __param(13, IPathService)), ( __param(14, ITelemetryService)), ( __param(15, ICustomizationHarnessService)), ( __param(16, IAgentPluginService)), ( __param(17, ICommandService)), ( __param(18, IProductService))
|
|
1309
|
+
AICustomizationListWidget = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IPromptsService)), ( __param(2, IContextViewService)), ( __param(3, IOpenerService)), ( __param(4, IContextMenuService)), ( __param(5, IMenuService)), ( __param(6, IContextKeyService)), ( __param(7, IWorkspaceContextService)), ( __param(8, ILabelService)), ( __param(9, IAICustomizationWorkspaceService)), ( __param(10, IClipboardService)), ( __param(11, IHoverService)), ( __param(12, IFileService)), ( __param(13, IPathService)), ( __param(14, ITelemetryService)), ( __param(15, ICustomizationHarnessService)), ( __param(16, IAgentPluginService)), ( __param(17, ICommandService)), ( __param(18, IProductService))], AICustomizationListWidget));
|
|
1700
1310
|
|
|
1701
1311
|
export { AICustomizationListWidget, formatDisplayName, sectionToPromptType };
|