@codingame/monaco-vscode-chat-service-override 37.1.0 → 37.3.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/common.d.ts +9 -0
- package/common.js +372 -0
- package/index.d.ts +4 -6
- package/index.js +20 -367
- package/package.json +12 -5
- package/session.d.ts +8 -0
- package/session.js +56 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +5 -2
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +2 -2
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +35 -11
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -2
- package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +34 -18
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +54 -54
- package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +20 -23
- package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +8 -8
- package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.d.ts +198 -0
- package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.js +197 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +14 -14
- package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.d.ts +63 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.js +7 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.d.ts +51 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.js +6 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +1 -1
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +6 -6
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/media/mobileMultiDiffView.css +215 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.d.ts +28 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.js +429 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.d.ts +100 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.js +675 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.d.ts +86 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.js +860 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.d.ts +35 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.js +67 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.js +41 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +85 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +247 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.d.ts +16 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.js +71 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.js +106 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.js +438 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.d.ts +8 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.js +25 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.js +173 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/media/runScriptAction.css +186 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +9 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.d.ts +12 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.js +104 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.js +23 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.d.ts +51 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.js +151 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.d.ts +32 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.js +85 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.js +20 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.js +34 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.js +828 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.d.ts +48 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.js +215 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.d.ts +27 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.js +237 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.js +348 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.js +35 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.js +189 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.d.ts +3 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.js +17 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +381 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.d.ts +23 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.js +48 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.d.ts +40 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.js +116 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.js +300 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.js +74 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.d.ts +55 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.js +103 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.d.ts +50 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.js +72 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.js +70 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.d.ts +69 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.js +151 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.d.ts +17 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.js +39 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.js +150 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +42 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +19 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +199 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +104 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +301 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +518 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +3121 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.js +37 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.d.ts +25 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.js +97 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.d.ts +74 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.js +355 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.d.ts +135 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.js +521 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.d.ts +26 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.js +86 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +14 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +166 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +586 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.js +47 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.js +109 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +49 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +69 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.d.ts +47 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.js +109 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.js +72 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.d.ts +79 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.js +353 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.js +161 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.d.ts +95 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.js +172 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostFilter.css +259 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostPickerSheet.css +351 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.d.ts +36 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.js +236 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.d.ts +80 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js +686 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.d.ts +20 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1210 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.js +136 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.d.ts +103 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.js +173 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.js +51 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.d.ts +74 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.js +438 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.js +52 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.d.ts +44 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js +171 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.js +98 -0
- package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.d.ts +24 -0
- package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.js +142 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +104 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +827 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +15 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +71 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +16 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +95 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +286 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +38 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +130 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +907 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +28 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +167 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +46 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +358 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +35 -35
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +4 -4
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +20 -20
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +6 -6
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +40 -40
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +27 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +97 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +50 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +431 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +88 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +48 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +55 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +3 -3
- 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 +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +48 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +26 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +393 -419
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +43 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +36 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +136 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +75 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +36 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +32 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +42 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +36 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +18 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +59 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +39 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +21 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +37 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +46 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +68 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +97 -93
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/editorHoverWrapper.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +253 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +28 -26
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +698 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +18 -12
- 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.js +157 -157
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +239 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +143 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +298 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +177 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +73 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +577 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +90 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +518 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +231 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +29 -25
- 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 +12 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +22 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +28 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +78 -78
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandParser.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +7 -7
- package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +4 -4
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +3 -3
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +4 -4
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +1 -1
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +6 -6
- package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +25 -25
- package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.d.ts +0 -603
- package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +0 -1911
- package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +0 -9
- package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +0 -144
- package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +0 -204
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +0 -440
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +0 -47
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +0 -75
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +0 -68
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +0 -161
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +0 -16
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +0 -14
- package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +0 -261
- package/vscode/src/vs/platform/agentHost/common/agentMerge.js +0 -67
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +0 -39
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +0 -169
- package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +0 -130
- package/vscode/src/vs/platform/agentHost/common/changesetUri.js +0 -41
- package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +0 -42
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +0 -110
- package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +0 -79
- package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +0 -1
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +0 -26
- package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +0 -75
- package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +0 -84
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +0 -461
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +0 -803
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +0 -18
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +0 -89
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +0 -37
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +0 -45
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +0 -13
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +0 -147
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +0 -544
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +0 -30
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +0 -430
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +0 -114
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +0 -17
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +0 -9
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +0 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +0 -7
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +0 -67
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +0 -117
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +0 -106
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +0 -23
- package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +0 -15
- package/vscode/src/vs/platform/agentHost/common/transportConstants.js +0 -6
- package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +0 -24
- package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +0 -15
- package/vscode/src/vs/platform/domWidget/browser/domWidget.d.ts +0 -52
- package/vscode/src/vs/platform/domWidget/browser/domWidget.js +0 -53
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -54
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -210
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -8
- package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -10
- package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +0 -29
- package/vscode/src/vs/workbench/browser/chatChangesPill.js +0 -84
- package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +0 -19
- package/vscode/src/vs/workbench/common/chatPullRequest.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +0 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +0 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +0 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +0 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +0 -294
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -147
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +0 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +0 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +0 -278
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +0 -2036
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +0 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +0 -397
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +0 -4127
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +0 -93
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +0 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +0 -369
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +0 -302
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +0 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +0 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.d.ts +0 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +0 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +0 -240
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +0 -762
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +0 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +0 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +0 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +0 -743
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +0 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +0 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +0 -91
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +0 -357
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +0 -2656
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +0 -3742
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +0 -301
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +0 -354
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +0 -197
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +0 -2205
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -317
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +0 -132
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +0 -1216
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +0 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +0 -282
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +0 -540
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +0 -1448
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +0 -329
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +0 -114
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +0 -1268
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +0 -552
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +0 -676
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +0 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +0 -225
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +0 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js +0 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +0 -16
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +0 -163
- package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +0 -69
- package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +0 -60
- package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +0 -139
|
@@ -1,4127 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
-
import * as aiCustomizationManagement from './media/aiCustomizationManagement.css';
|
|
5
|
-
import { $ as $$1, append, clearNode, addDisposableListener, getWindow, EventType, DisposableResizeObserver, isHTMLElement, EventHelper, addStandardDisposableListener, scheduleAtNextAnimationFrame, isAncestorOfActiveElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
|
-
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
7
|
-
import { Checkbox, TriStateCheckbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
|
|
8
|
-
import { defaultCheckboxStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
9
|
-
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
10
|
-
import { dirname as dirname$1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
11
|
-
import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
12
|
-
import { RunOnceScheduler, timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
13
|
-
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
14
|
-
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
15
|
-
import { onUnexpectedError, getErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
16
|
-
import { DisposableStore, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
17
|
-
import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
18
|
-
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
19
|
-
import { isMarkdownString, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
20
|
-
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
21
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
22
|
-
import { SplitView, Sizing } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/splitview/splitview';
|
|
23
|
-
import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
|
|
24
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
25
|
-
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
26
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
27
|
-
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
28
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
29
|
-
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
30
|
-
import { IFileDialogService, IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
31
|
-
import { EditorPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
32
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
33
|
-
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
34
|
-
import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
35
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
36
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
37
|
-
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
38
|
-
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
39
|
-
import { getComparisonKey, isEqual, basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
40
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
41
|
-
import { AICustomizationManagementEditorInput } from './aiCustomizationManagementEditorInput.js';
|
|
42
|
-
import { aiCustomizationManagementSectionRegistry } from './aiCustomizationManagementSectionRegistry.js';
|
|
43
|
-
import { AICustomizationListWidget } from './aiCustomizationListWidget.js';
|
|
44
|
-
import { ITEMS_MODEL_SECTIONS } from './aiCustomizationItemsModel.js';
|
|
45
|
-
import { IAICustomizationItemsModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service';
|
|
46
|
-
import { McpListWidget } from './mcpListWidget.js';
|
|
47
|
-
import { PluginListWidget } from './pluginListWidget.js';
|
|
48
|
-
import { ToolsListWidget } from './toolsListWidget.js';
|
|
49
|
-
import { AGENT_HOST_COPILOT_CLI_SESSION_TYPE } from '../agentSessions/agentHost/agentHostToolSetEnablementService.js';
|
|
50
|
-
import { AI_CUSTOMIZATION_MANAGEMENT_EDITOR_ID, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_EDITOR, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_SECTION, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_HARNESS, AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY, AI_CUSTOMIZATION_MANAGEMENT_SIDEBAR_WIDTH_KEY, SIDEBAR_DEFAULT_WIDTH, SIDEBAR_MAX_WIDTH, SIDEBAR_MIN_WIDTH, CONTENT_MIN_WIDTH } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement';
|
|
51
|
-
import { toolsIcon, pluginIcon, hookIcon, promptIcon, instructionsIcon, skillIcon, agentIcon } from './aiCustomizationIcons.js';
|
|
52
|
-
import { ChatModelsWidget } from '../chatManagement/chatModelsWidget.js';
|
|
53
|
-
import { PromptsType, Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
54
|
-
import { CustomizationMigrationType, isMcpServerCustomizationMigrationCandidate, getCustomizationMigrationTargetType, getMcpServerCustomizationMigrationCandidateKey } from '../../common/promptSyntax/service/customizationMigrationService.js';
|
|
55
|
-
import { ICustomizationMigrationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.service';
|
|
56
|
-
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
57
|
-
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
58
|
-
import { AGENT_MD_FILENAME } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
59
|
-
import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
60
|
-
import { getTarget, getAttributeDefinition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes';
|
|
61
|
-
import { NEW_SKILL_COMMAND_ID, NEW_AGENT_COMMAND_ID, NEW_INSTRUCTIONS_COMMAND_ID, NEW_PROMPT_COMMAND_ID } from '@codingame/monaco-vscode-xterm-addons-common/vscode/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions';
|
|
62
|
-
import { showConfigureHooksQuickPick } from '../promptSyntax/hookActions.js';
|
|
63
|
-
import { CustomizationLocationPicker, resolveWorkspaceTargetDirectory, resolveUserTargetDirectory } from './customizationCreatorService.js';
|
|
64
|
-
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
65
|
-
import { AICustomizationManagementSection, AICustomizationSources } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
|
|
66
|
-
import { IAICustomizationWorkspaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service';
|
|
67
|
-
import { hasReadableCustomizationContent } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostCustomizationUri';
|
|
68
|
-
import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
69
|
-
import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
70
|
-
import { createTextBufferFactoryFromSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
71
|
-
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
72
|
-
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
73
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
74
|
-
import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
75
|
-
import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
76
|
-
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
77
|
-
import { FileSystemProviderCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
78
|
-
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
79
|
-
import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
|
|
80
|
-
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
81
|
-
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
82
|
-
import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
83
|
-
import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
|
|
84
|
-
import { EmbeddedMcpServerDetail } from './embeddedMcpServerDetail.js';
|
|
85
|
-
import { EmbeddedAgentPluginDetail } from './embeddedAgentPluginDetail.js';
|
|
86
|
-
import { layoutVirtualizedSections, getVirtualizedSectionMinimumHeight, layoutVirtualizedSectionList } from './customizationCardList.js';
|
|
87
|
-
import { IMcpService, IMcpWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
|
|
88
|
-
import { IAgentHostCustomizationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service';
|
|
89
|
-
import { EmbeddedExtensionToolsDetail } from './embeddedExtensionToolsDetail.js';
|
|
90
|
-
import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
|
|
91
|
-
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
92
|
-
import { AICustomizationWelcomePage } from './aiCustomizationWelcomePage.js';
|
|
93
|
-
import { migrateCustomizations } from './customizationMigration.js';
|
|
94
|
-
import { CustomizationMigrationCategoryId, CUSTOMIZATION_MIGRATION_CATEGORIES, getCustomizationMigrationCategory } from './customizationMigrationCategories.js';
|
|
95
|
-
import { CustomizationMigrationDashboard } from './customizationMigrationDashboard.js';
|
|
96
|
-
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
97
|
-
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
98
|
-
import { showNoFoldersDialog } from '@codingame/monaco-vscode-xterm-addons-common/vscode/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder';
|
|
99
|
-
import { isAgentHostTarget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
100
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
101
|
-
import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
|
|
102
|
-
|
|
103
|
-
var AICustomizationManagementEditor_1;
|
|
104
|
-
registerCss(aiCustomizationManagement);
|
|
105
|
-
const $ = $$1;
|
|
106
|
-
const homepageMigrationCategories = [
|
|
107
|
-
CustomizationMigrationCategoryId.PromptFiles,
|
|
108
|
-
CustomizationMigrationCategoryId.UserData,
|
|
109
|
-
CustomizationMigrationCategoryId.McpServers
|
|
110
|
-
];
|
|
111
|
-
function isCurrentPluginContributionNavigation(
|
|
112
|
-
requestGeneration,
|
|
113
|
-
currentGeneration,
|
|
114
|
-
requestedSection,
|
|
115
|
-
selectedSection,
|
|
116
|
-
isListView
|
|
117
|
-
) {
|
|
118
|
-
return requestGeneration === currentGeneration && requestedSection === selectedSection && isListView;
|
|
119
|
-
}
|
|
120
|
-
class SectionItemDelegate {
|
|
121
|
-
getHeight() {
|
|
122
|
-
return 26;
|
|
123
|
-
}
|
|
124
|
-
getTemplateId() {
|
|
125
|
-
return "sectionItem";
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
class SectionItemRenderer {
|
|
129
|
-
constructor(hoverService) {
|
|
130
|
-
this.hoverService = hoverService;
|
|
131
|
-
this.templateId = "sectionItem";
|
|
132
|
-
}
|
|
133
|
-
renderTemplate(container) {
|
|
134
|
-
container.classList.add("section-list-item");
|
|
135
|
-
const icon = append(container, $(".section-icon"));
|
|
136
|
-
const label = append(container, $(".section-label"));
|
|
137
|
-
const count = append(container, $(".section-count"));
|
|
138
|
-
const templateDisposables = ( new DisposableStore());
|
|
139
|
-
return {
|
|
140
|
-
container,
|
|
141
|
-
icon,
|
|
142
|
-
label,
|
|
143
|
-
count,
|
|
144
|
-
templateDisposables
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
renderElement(element, index, templateData) {
|
|
148
|
-
templateData.templateDisposables.clear();
|
|
149
|
-
templateData.icon.className = "section-icon";
|
|
150
|
-
templateData.icon.classList.add(...ThemeIcon.asClassNameArray(element.icon));
|
|
151
|
-
templateData.label.textContent = element.label;
|
|
152
|
-
if (element.count > 0) {
|
|
153
|
-
templateData.count.textContent = String(element.count);
|
|
154
|
-
templateData.count.style.display = "";
|
|
155
|
-
} else {
|
|
156
|
-
templateData.count.textContent = "";
|
|
157
|
-
templateData.count.style.display = "none";
|
|
158
|
-
}
|
|
159
|
-
templateData.templateDisposables.add(this.hoverService.setupManagedHover(
|
|
160
|
-
getDefaultHoverDelegate("element"),
|
|
161
|
-
templateData.container,
|
|
162
|
-
element.description
|
|
163
|
-
));
|
|
164
|
-
}
|
|
165
|
-
disposeTemplate(templateData) {
|
|
166
|
-
templateData.templateDisposables.dispose();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const MIGRATION_ITEM_HEIGHT = 56;
|
|
170
|
-
class MigrationItemDelegate {
|
|
171
|
-
getHeight() {
|
|
172
|
-
return MIGRATION_ITEM_HEIGHT;
|
|
173
|
-
}
|
|
174
|
-
getTemplateId() {
|
|
175
|
-
return "migrationItem";
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
class MigrationItemRenderer {
|
|
179
|
-
constructor(
|
|
180
|
-
isSelected,
|
|
181
|
-
getPresentation,
|
|
182
|
-
onSelectionChange,
|
|
183
|
-
onOpen,
|
|
184
|
-
onMore,
|
|
185
|
-
onFirstFocusable,
|
|
186
|
-
hoverService
|
|
187
|
-
) {
|
|
188
|
-
this.isSelected = isSelected;
|
|
189
|
-
this.getPresentation = getPresentation;
|
|
190
|
-
this.onSelectionChange = onSelectionChange;
|
|
191
|
-
this.onOpen = onOpen;
|
|
192
|
-
this.onMore = onMore;
|
|
193
|
-
this.onFirstFocusable = onFirstFocusable;
|
|
194
|
-
this.hoverService = hoverService;
|
|
195
|
-
this.templateId = "migrationItem";
|
|
196
|
-
this.templates = ( new Set());
|
|
197
|
-
}
|
|
198
|
-
renderTemplate(container) {
|
|
199
|
-
container.classList.add("ai-customization-list-item", "prompt-migration-item");
|
|
200
|
-
const templateDisposables = ( new DisposableStore());
|
|
201
|
-
const elementDisposables = templateDisposables.add(( new DisposableStore()));
|
|
202
|
-
const checkboxContainer = append(container, $(".item-sync-checkbox.prompt-migration-checkbox"));
|
|
203
|
-
const checkbox = templateDisposables.add(( new Checkbox("", false, defaultCheckboxStyles)));
|
|
204
|
-
checkboxContainer.replaceChildren(checkbox.domNode);
|
|
205
|
-
const itemLeft = append(container, $("span.item-left"));
|
|
206
|
-
const openButton = templateDisposables.add(( new Button(itemLeft, {})));
|
|
207
|
-
clearNode(openButton.element);
|
|
208
|
-
openButton.element.classList.add("item-text", "prompt-migration-open-button");
|
|
209
|
-
const openNameRow = append(openButton.element, $("span.item-name-row"));
|
|
210
|
-
const openNameLabel = append(openNameRow, $("span.item-name.prompt-migration-item-name"));
|
|
211
|
-
const openPathLabel = append(
|
|
212
|
-
openButton.element,
|
|
213
|
-
$("span.item-description.is-filename.prompt-migration-item-path")
|
|
214
|
-
);
|
|
215
|
-
const staticText = append(itemLeft, $("span.item-text.prompt-migration-static-text"));
|
|
216
|
-
const staticNameRow = append(staticText, $("span.item-name-row"));
|
|
217
|
-
const staticNameLabel = append(staticNameRow, $("span.item-name.prompt-migration-item-name"));
|
|
218
|
-
const staticPathLabel = append(
|
|
219
|
-
staticText,
|
|
220
|
-
$("span.item-description.is-filename.prompt-migration-item-path")
|
|
221
|
-
);
|
|
222
|
-
const itemRight = append(container, $("span.item-right"));
|
|
223
|
-
const moreButton = append(itemRight, $("button.icon-button.prompt-migration-more-action", {
|
|
224
|
-
type: "button"
|
|
225
|
-
}));
|
|
226
|
-
moreButton.classList.add(...ThemeIcon.asClassNameArray(Codicon.ellipsis));
|
|
227
|
-
const template = {
|
|
228
|
-
container,
|
|
229
|
-
checkbox,
|
|
230
|
-
openButton,
|
|
231
|
-
openNameLabel,
|
|
232
|
-
openPathLabel,
|
|
233
|
-
staticText,
|
|
234
|
-
staticNameLabel,
|
|
235
|
-
staticPathLabel,
|
|
236
|
-
moreButton,
|
|
237
|
-
templateDisposables,
|
|
238
|
-
elementDisposables,
|
|
239
|
-
hasFileActions: false
|
|
240
|
-
};
|
|
241
|
-
this.templates.add(template);
|
|
242
|
-
return template;
|
|
243
|
-
}
|
|
244
|
-
renderElement(customization, index, templateData) {
|
|
245
|
-
templateData.elementDisposables.clear();
|
|
246
|
-
templateData.container.removeAttribute("aria-selected");
|
|
247
|
-
templateData.currentIndex = index;
|
|
248
|
-
templateData.currentElement = customization;
|
|
249
|
-
const presentation = this.getPresentation(customization);
|
|
250
|
-
const file = presentation.file;
|
|
251
|
-
templateData.hasFileActions = file !== undefined;
|
|
252
|
-
this.updateCheckboxState(templateData, customization);
|
|
253
|
-
templateData.checkbox.domNode.setAttribute("aria-label", presentation.selectionAriaLabel);
|
|
254
|
-
templateData.openNameLabel.textContent = presentation.name;
|
|
255
|
-
templateData.openPathLabel.textContent = presentation.pathLabel;
|
|
256
|
-
templateData.staticNameLabel.textContent = presentation.name;
|
|
257
|
-
templateData.staticPathLabel.textContent = presentation.pathLabel;
|
|
258
|
-
templateData.openButton.element.style.display = file ? "" : "none";
|
|
259
|
-
templateData.staticText.style.display = file ? "none" : "";
|
|
260
|
-
templateData.moreButton.style.display = file ? "" : "none";
|
|
261
|
-
if (index === 0) {
|
|
262
|
-
this.onFirstFocusable(templateData.checkbox.domNode);
|
|
263
|
-
}
|
|
264
|
-
templateData.elementDisposables.add(templateData.checkbox.onChange(() => {
|
|
265
|
-
this.onSelectionChange(customization, templateData.checkbox.checked);
|
|
266
|
-
}));
|
|
267
|
-
if (file) {
|
|
268
|
-
templateData.openButton.element.setAttribute("aria-label", ( localize(6528, "Open {0}, {1}", presentation.name, presentation.pathLabel)));
|
|
269
|
-
templateData.moreButton.setAttribute("aria-label", ( localize(6529, "More actions for {0}", presentation.name)));
|
|
270
|
-
templateData.elementDisposables.add(templateData.openButton.onDidClick(() => this.onOpen(file)));
|
|
271
|
-
templateData.elementDisposables.add(this.hoverService.setupManagedHover(
|
|
272
|
-
getDefaultHoverDelegate("element"),
|
|
273
|
-
templateData.moreButton,
|
|
274
|
-
( localize(6530, "More Actions"))
|
|
275
|
-
));
|
|
276
|
-
templateData.elementDisposables.add(addDisposableListener(templateData.moreButton, "click", event => {
|
|
277
|
-
event.stopPropagation();
|
|
278
|
-
this.onMore(file, templateData.moreButton);
|
|
279
|
-
}));
|
|
280
|
-
} else {
|
|
281
|
-
templateData.openButton.element.removeAttribute("aria-label");
|
|
282
|
-
templateData.moreButton.removeAttribute("aria-label");
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
refreshSelectionState() {
|
|
286
|
-
for (const template of this.templates) {
|
|
287
|
-
if (template.currentElement) {
|
|
288
|
-
this.updateCheckboxState(template, template.currentElement);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
updateCheckboxState(templateData, customization) {
|
|
293
|
-
const selected = this.isSelected(customization);
|
|
294
|
-
templateData.checkbox.checked = selected;
|
|
295
|
-
templateData.checkbox.domNode.setAttribute("aria-checked", String(selected));
|
|
296
|
-
}
|
|
297
|
-
getIndex(target) {
|
|
298
|
-
for (const template of this.templates) {
|
|
299
|
-
if (template.container.contains(target)) {
|
|
300
|
-
return template.currentIndex;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
return undefined;
|
|
304
|
-
}
|
|
305
|
-
getControls(index) {
|
|
306
|
-
for (const template of this.templates) {
|
|
307
|
-
if (template.currentIndex === index) {
|
|
308
|
-
return template.hasFileActions ? [
|
|
309
|
-
template.checkbox.domNode,
|
|
310
|
-
template.openButton.element,
|
|
311
|
-
template.moreButton
|
|
312
|
-
] : [template.checkbox.domNode];
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
return [];
|
|
316
|
-
}
|
|
317
|
-
disposeElement(_customization, _index, templateData) {
|
|
318
|
-
templateData.elementDisposables.clear();
|
|
319
|
-
templateData.currentIndex = undefined;
|
|
320
|
-
templateData.currentElement = undefined;
|
|
321
|
-
templateData.hasFileActions = false;
|
|
322
|
-
}
|
|
323
|
-
disposeTemplate(templateData) {
|
|
324
|
-
this.templates.delete(templateData);
|
|
325
|
-
templateData.templateDisposables.dispose();
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
let AICustomizationManagementEditor = class AICustomizationManagementEditor extends EditorPane {
|
|
329
|
-
static {
|
|
330
|
-
AICustomizationManagementEditor_1 = this;
|
|
331
|
-
}
|
|
332
|
-
static {
|
|
333
|
-
this.ID = AI_CUSTOMIZATION_MANAGEMENT_EDITOR_ID;
|
|
334
|
-
}
|
|
335
|
-
constructor(
|
|
336
|
-
group,
|
|
337
|
-
telemetryService,
|
|
338
|
-
themeService,
|
|
339
|
-
storageService,
|
|
340
|
-
instantiationService,
|
|
341
|
-
contextKeyService,
|
|
342
|
-
openerService,
|
|
343
|
-
commandService,
|
|
344
|
-
workspaceService,
|
|
345
|
-
promptsService,
|
|
346
|
-
customizationMigrationService,
|
|
347
|
-
textModelService,
|
|
348
|
-
configurationService,
|
|
349
|
-
workingCopyService,
|
|
350
|
-
hoverService,
|
|
351
|
-
markdownRendererService,
|
|
352
|
-
modelService,
|
|
353
|
-
quickInputService,
|
|
354
|
-
fileService,
|
|
355
|
-
notificationService,
|
|
356
|
-
fileDialogService,
|
|
357
|
-
dialogService,
|
|
358
|
-
contextMenuService,
|
|
359
|
-
harnessService,
|
|
360
|
-
viewsService,
|
|
361
|
-
labelService,
|
|
362
|
-
itemsModel,
|
|
363
|
-
mcpService,
|
|
364
|
-
mcpWorkbenchService,
|
|
365
|
-
agentHostCustomizationService
|
|
366
|
-
) {
|
|
367
|
-
super(
|
|
368
|
-
AICustomizationManagementEditor_1.ID,
|
|
369
|
-
group,
|
|
370
|
-
telemetryService,
|
|
371
|
-
themeService,
|
|
372
|
-
storageService
|
|
373
|
-
);
|
|
374
|
-
this.storageService = storageService;
|
|
375
|
-
this.instantiationService = instantiationService;
|
|
376
|
-
this.openerService = openerService;
|
|
377
|
-
this.commandService = commandService;
|
|
378
|
-
this.workspaceService = workspaceService;
|
|
379
|
-
this.promptsService = promptsService;
|
|
380
|
-
this.customizationMigrationService = customizationMigrationService;
|
|
381
|
-
this.textModelService = textModelService;
|
|
382
|
-
this.configurationService = configurationService;
|
|
383
|
-
this.workingCopyService = workingCopyService;
|
|
384
|
-
this.hoverService = hoverService;
|
|
385
|
-
this.markdownRendererService = markdownRendererService;
|
|
386
|
-
this.modelService = modelService;
|
|
387
|
-
this.quickInputService = quickInputService;
|
|
388
|
-
this.fileService = fileService;
|
|
389
|
-
this.notificationService = notificationService;
|
|
390
|
-
this.fileDialogService = fileDialogService;
|
|
391
|
-
this.dialogService = dialogService;
|
|
392
|
-
this.contextMenuService = contextMenuService;
|
|
393
|
-
this.harnessService = harnessService;
|
|
394
|
-
this.viewsService = viewsService;
|
|
395
|
-
this.labelService = labelService;
|
|
396
|
-
this.itemsModel = itemsModel;
|
|
397
|
-
this.mcpService = mcpService;
|
|
398
|
-
this.mcpWorkbenchService = mcpWorkbenchService;
|
|
399
|
-
this.agentHostCustomizationService = agentHostCustomizationService;
|
|
400
|
-
this.contributedSectionContainers = ( new Map());
|
|
401
|
-
this.contributedSectionWidgets = ( new Map());
|
|
402
|
-
this.editorActionButtonInProgress = false;
|
|
403
|
-
this.editorDisplayMode = "preview";
|
|
404
|
-
this.editorModelChangeDisposables = this._register(( new DisposableStore()));
|
|
405
|
-
this.editorPreviewDisposables = this._register(( new DisposableStore()));
|
|
406
|
-
this.editorPreviewRenderScheduler = this._register(( new RunOnceScheduler(() => {
|
|
407
|
-
if (this.viewMode === "editor" && this.editorDisplayMode === "preview") {
|
|
408
|
-
this.renderCurrentEditorPreview();
|
|
409
|
-
}
|
|
410
|
-
}, 200)));
|
|
411
|
-
this.builtinEditingSessions = ( new Map());
|
|
412
|
-
this.currentEditingReadOnly = false;
|
|
413
|
-
this.editorReturnViewMode = "list";
|
|
414
|
-
this.viewMode = "list";
|
|
415
|
-
this.migrationSectionLists = [];
|
|
416
|
-
this.migrationSectionScrollPositions = ( new Map());
|
|
417
|
-
this.migrationWorkspaceSkipped = false;
|
|
418
|
-
this.selectedCustomizationMigrationItems = ( new ResourceMap());
|
|
419
|
-
this.selectedMcpServerMigrationItems = ( new Set());
|
|
420
|
-
this.knownMcpServerMigrationItems = ( new Set());
|
|
421
|
-
this.migrationSelectionContextKey = "";
|
|
422
|
-
this.selectedCustomizationMigrationTargets = ( new Map());
|
|
423
|
-
this.explicitlySelectedCustomizationMigrationTargets = ( new Set());
|
|
424
|
-
this.migrationPageDisposables = this._register(( new DisposableStore()));
|
|
425
|
-
this.migrationBannerDisposables = this._register(( new DisposableStore()));
|
|
426
|
-
this.mcpDetailDisposables = this._register(( new DisposableStore()));
|
|
427
|
-
this.pluginDetailDisposables = this._register(( new DisposableStore()));
|
|
428
|
-
this.toolsDetailDisposables = this._register(( new DisposableStore()));
|
|
429
|
-
this.sections = [];
|
|
430
|
-
this.allSections = [];
|
|
431
|
-
this.contentNavigationGeneration = 0;
|
|
432
|
-
this.customizationsByMigrationCategory = ( new Map());
|
|
433
|
-
this.customizationMigrationTargetFoldersByType = ( new Map());
|
|
434
|
-
this.customizationMigrationRefreshSequence = 0;
|
|
435
|
-
this.customizationMigrationLoading = false;
|
|
436
|
-
this.customizationMigrationInProgress = false;
|
|
437
|
-
this.customizationMigrationWritesInProgress = false;
|
|
438
|
-
this.editorDisposables = this._register(( new DisposableStore()));
|
|
439
|
-
this.pendingMigrationLayout = this._register(( new MutableDisposable()));
|
|
440
|
-
this._editorContentChanged = false;
|
|
441
|
-
this.sidebarWidth = 0;
|
|
442
|
-
this.sidebarHeight = 0;
|
|
443
|
-
this.inEditorContextKey = CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_EDITOR.bindTo(contextKeyService);
|
|
444
|
-
this.sectionContextKey = CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_SECTION.bindTo(contextKeyService);
|
|
445
|
-
this.harnessContextKey = CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_HARNESS.bindTo(contextKeyService);
|
|
446
|
-
this.updateTargetLabelPresentation();
|
|
447
|
-
this._register(autorun(reader => {
|
|
448
|
-
this.workspaceService.activeProjectRoot.read(reader);
|
|
449
|
-
this.workspaceService.activeProjectLabel.read(reader);
|
|
450
|
-
this.updateTargetLabelPresentation();
|
|
451
|
-
if (this.viewMode === "editor") {
|
|
452
|
-
this.currentEditingProjectRoot = this.workspaceService.getActiveProjectRoot();
|
|
453
|
-
}
|
|
454
|
-
}));
|
|
455
|
-
this._register(toDisposable(() => {
|
|
456
|
-
this.currentModelRef?.dispose();
|
|
457
|
-
this.currentModelRef = undefined;
|
|
458
|
-
}));
|
|
459
|
-
this._register(toDisposable(() => this.disposeBuiltinEditingSessions()));
|
|
460
|
-
const sectionInfo = {
|
|
461
|
-
[AICustomizationManagementSection.Agents]: {
|
|
462
|
-
label: ( localize(6531, "Agents")),
|
|
463
|
-
icon: agentIcon,
|
|
464
|
-
description: ( localize(
|
|
465
|
-
6532,
|
|
466
|
-
"Define custom agents with specialized personas, tool access, and instructions for specific tasks."
|
|
467
|
-
))
|
|
468
|
-
},
|
|
469
|
-
[AICustomizationManagementSection.Skills]: {
|
|
470
|
-
label: ( localize(6533, "Skills")),
|
|
471
|
-
icon: skillIcon,
|
|
472
|
-
description: ( localize(
|
|
473
|
-
6534,
|
|
474
|
-
"Create reusable skill files that provide domain-specific knowledge and workflows."
|
|
475
|
-
))
|
|
476
|
-
},
|
|
477
|
-
[AICustomizationManagementSection.Instructions]: {
|
|
478
|
-
label: ( localize(6535, "Instructions")),
|
|
479
|
-
icon: instructionsIcon,
|
|
480
|
-
description: ( localize(
|
|
481
|
-
6536,
|
|
482
|
-
"Set always-on instructions that guide AI behavior across your workspace or user profile."
|
|
483
|
-
))
|
|
484
|
-
},
|
|
485
|
-
[AICustomizationManagementSection.Prompts]: {
|
|
486
|
-
label: ( localize(6537, "Prompts")),
|
|
487
|
-
icon: promptIcon,
|
|
488
|
-
description: ( localize(6538, "Reusable prompt templates that can be invoked as slash commands."))
|
|
489
|
-
},
|
|
490
|
-
[AICustomizationManagementSection.Hooks]: {
|
|
491
|
-
label: ( localize(6539, "Hooks")),
|
|
492
|
-
icon: hookIcon,
|
|
493
|
-
description: ( localize(
|
|
494
|
-
6540,
|
|
495
|
-
"Configure automated actions triggered by events like saving files or running tasks."
|
|
496
|
-
))
|
|
497
|
-
},
|
|
498
|
-
[AICustomizationManagementSection.McpServers]: {
|
|
499
|
-
label: ( localize(6541, "MCP Servers")),
|
|
500
|
-
icon: Codicon.server,
|
|
501
|
-
description: ( localize(
|
|
502
|
-
6542,
|
|
503
|
-
"Connect external tool servers that extend AI capabilities with custom tools and data sources."
|
|
504
|
-
))
|
|
505
|
-
},
|
|
506
|
-
[AICustomizationManagementSection.Plugins]: {
|
|
507
|
-
label: ( localize(6543, "Plugins")),
|
|
508
|
-
icon: pluginIcon,
|
|
509
|
-
description: ( localize(
|
|
510
|
-
6544,
|
|
511
|
-
"Install and manage agent plugins that add additional tools, skills, and integrations."
|
|
512
|
-
))
|
|
513
|
-
},
|
|
514
|
-
[AICustomizationManagementSection.Models]: {
|
|
515
|
-
label: ( localize(6545, "Models")),
|
|
516
|
-
icon: Codicon.vm,
|
|
517
|
-
description: ( localize(6546, "Configure and manage language models available for use."))
|
|
518
|
-
},
|
|
519
|
-
[AICustomizationManagementSection.Tools]: {
|
|
520
|
-
label: ( localize(6547, "Tools")),
|
|
521
|
-
icon: toolsIcon,
|
|
522
|
-
description: ( localize(
|
|
523
|
-
6548,
|
|
524
|
-
"Enable or disable groups of language model tools available to chat."
|
|
525
|
-
))
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
const activeHarnessId = this.harnessService.activeHarness.get();
|
|
529
|
-
for (const id of this.workspaceService.managementSections) {
|
|
530
|
-
const contribution = aiCustomizationManagementSectionRegistry.get(id, activeHarnessId) ?? aiCustomizationManagementSectionRegistry.getDefault(id);
|
|
531
|
-
const info = contribution ?? sectionInfo[id];
|
|
532
|
-
if (info) {
|
|
533
|
-
this.allSections.push({
|
|
534
|
-
id,
|
|
535
|
-
label: info.label,
|
|
536
|
-
icon: info.icon,
|
|
537
|
-
description: info.description,
|
|
538
|
-
count: 0
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
this.rebuildVisibleSections();
|
|
543
|
-
const savedSection = this.storageService.get(AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY, StorageScope.PROFILE);
|
|
544
|
-
if (savedSection && ( this.sections.some(s => s.id === savedSection))) {
|
|
545
|
-
this.selectedSection = savedSection;
|
|
546
|
-
} else {
|
|
547
|
-
this.selectedSection = undefined;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
createEditor(parent) {
|
|
551
|
-
this.pendingMigrationLayout.clear();
|
|
552
|
-
this.editorDisposables.clear();
|
|
553
|
-
this.contributedSectionContainers.clear();
|
|
554
|
-
this.contributedSectionWidgets.clear();
|
|
555
|
-
this.container = append(parent, $(".ai-customization-management-editor"));
|
|
556
|
-
this.createSplitView();
|
|
557
|
-
this.updateStyles();
|
|
558
|
-
}
|
|
559
|
-
createSplitView() {
|
|
560
|
-
this.splitViewContainer = append(this.container, $(".management-split-view"));
|
|
561
|
-
this.sidebarContainer = $(".management-sidebar");
|
|
562
|
-
this.contentContainer = $(".management-content");
|
|
563
|
-
this.createSidebar();
|
|
564
|
-
this.createContent();
|
|
565
|
-
this.splitView = this.editorDisposables.add(( new SplitView(this.splitViewContainer, {
|
|
566
|
-
orientation: Orientation.HORIZONTAL,
|
|
567
|
-
proportionalLayout: true
|
|
568
|
-
})));
|
|
569
|
-
const savedWidth = this.storageService.getNumber(
|
|
570
|
-
AI_CUSTOMIZATION_MANAGEMENT_SIDEBAR_WIDTH_KEY,
|
|
571
|
-
StorageScope.PROFILE,
|
|
572
|
-
SIDEBAR_DEFAULT_WIDTH
|
|
573
|
-
);
|
|
574
|
-
this.splitView.addView({
|
|
575
|
-
onDidChange: Event.None,
|
|
576
|
-
element: this.sidebarContainer,
|
|
577
|
-
minimumSize: SIDEBAR_MIN_WIDTH,
|
|
578
|
-
maximumSize: SIDEBAR_MAX_WIDTH,
|
|
579
|
-
layout: (width, _, height) => {
|
|
580
|
-
this.sidebarContainer.style.width = `${width}px`;
|
|
581
|
-
if (height !== undefined) {
|
|
582
|
-
this.layoutSidebar(width, height);
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
}, savedWidth, undefined, true);
|
|
586
|
-
this.splitView.addView({
|
|
587
|
-
onDidChange: Event.None,
|
|
588
|
-
element: this.contentContainer,
|
|
589
|
-
minimumSize: CONTENT_MIN_WIDTH,
|
|
590
|
-
maximumSize: Number.POSITIVE_INFINITY,
|
|
591
|
-
layout: (width, _, height) => {
|
|
592
|
-
this.contentContainer.style.width = `${width}px`;
|
|
593
|
-
if (height !== undefined) {
|
|
594
|
-
if (this.promptsContentContainer?.style.display !== "none") {
|
|
595
|
-
this.listWidget.layout(height - 16, width - 24);
|
|
596
|
-
}
|
|
597
|
-
if (this.mcpContentContainer?.style.display !== "none") {
|
|
598
|
-
this.mcpListWidget?.layout(height - 16, width - 24);
|
|
599
|
-
}
|
|
600
|
-
if (this.pluginContentContainer?.style.display !== "none") {
|
|
601
|
-
this.pluginListWidget?.layout(height - 16, width - 24);
|
|
602
|
-
}
|
|
603
|
-
if (this.toolsContentContainer?.style.display !== "none") {
|
|
604
|
-
this.toolsListWidget?.layout(height - 16, width - 24);
|
|
605
|
-
}
|
|
606
|
-
const modelsFooterHeight = this.modelsFooterElement?.offsetHeight || 80;
|
|
607
|
-
this.modelsWidget?.layout(height - 16 - modelsFooterHeight, width);
|
|
608
|
-
if (this.viewMode === "editor" && this.embeddedEditor && this.embeddedEditorContainer) {
|
|
609
|
-
const {
|
|
610
|
-
clientWidth,
|
|
611
|
-
clientHeight
|
|
612
|
-
} = this.embeddedEditorContainer;
|
|
613
|
-
if (clientWidth > 0 && clientHeight > 0) {
|
|
614
|
-
this.embeddedEditor.layout({
|
|
615
|
-
width: clientWidth,
|
|
616
|
-
height: clientHeight
|
|
617
|
-
});
|
|
618
|
-
} else if (this.dimension) {
|
|
619
|
-
getWindow(this.embeddedEditorContainer).requestAnimationFrame(() => {
|
|
620
|
-
if (this.embeddedEditor && this.embeddedEditorContainer) {
|
|
621
|
-
const {
|
|
622
|
-
clientWidth: w,
|
|
623
|
-
clientHeight: h
|
|
624
|
-
} = this.embeddedEditorContainer;
|
|
625
|
-
if (w > 0 && h > 0) {
|
|
626
|
-
this.embeddedEditor.layout({
|
|
627
|
-
width: w,
|
|
628
|
-
height: h
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}, Sizing.Distribute, undefined, true);
|
|
638
|
-
this.editorDisposables.add(this.splitView.onDidSashChange(() => {
|
|
639
|
-
const width = this.splitView.getViewSize(0);
|
|
640
|
-
this.storageService.store(
|
|
641
|
-
AI_CUSTOMIZATION_MANAGEMENT_SIDEBAR_WIDTH_KEY,
|
|
642
|
-
width,
|
|
643
|
-
StorageScope.PROFILE,
|
|
644
|
-
StorageTarget.USER
|
|
645
|
-
);
|
|
646
|
-
}));
|
|
647
|
-
this.editorDisposables.add(this.splitView.onDidSashReset(() => {
|
|
648
|
-
const totalWidth = this.splitView.getViewSize(0) + this.splitView.getViewSize(1);
|
|
649
|
-
this.splitView.resizeView(0, SIDEBAR_DEFAULT_WIDTH);
|
|
650
|
-
this.splitView.resizeView(1, totalWidth - SIDEBAR_DEFAULT_WIDTH);
|
|
651
|
-
}));
|
|
652
|
-
}
|
|
653
|
-
getActiveHarnessLabel() {
|
|
654
|
-
const label = this.harnessService.getActiveDescriptor().label;
|
|
655
|
-
return label || (this.workspaceService.isSessionsWindow ? "" : ( localize(6549, "Local")));
|
|
656
|
-
}
|
|
657
|
-
updateTargetLabelPresentation() {
|
|
658
|
-
const harnessLabel = this.getActiveHarnessLabel();
|
|
659
|
-
const workspaceLabel = this.workspaceService.activeProjectLabel.get();
|
|
660
|
-
this.welcomePage?.setHarnessLabel(harnessLabel);
|
|
661
|
-
if (this.input instanceof AICustomizationManagementEditorInput) {
|
|
662
|
-
this.input.setTargetLabels(harnessLabel, workspaceLabel);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
rebuildVisibleSections() {
|
|
666
|
-
const activeId = this.harnessService.activeHarness.get();
|
|
667
|
-
const descriptor = this.harnessService.findHarnessById(activeId);
|
|
668
|
-
const hidden = ( new Set(descriptor?.hiddenSections ?? []));
|
|
669
|
-
this.sections.length = 0;
|
|
670
|
-
for (const s of this.allSections) {
|
|
671
|
-
const contribution = aiCustomizationManagementSectionRegistry.get(s.id, activeId);
|
|
672
|
-
const contributed = ( aiCustomizationManagementSectionRegistry.has(s.id));
|
|
673
|
-
if (!( hidden.has(s.id)) && (!contributed || !!contribution)) {
|
|
674
|
-
this.sections.push(contribution ? {
|
|
675
|
-
...s,
|
|
676
|
-
label: contribution.label,
|
|
677
|
-
icon: contribution.icon,
|
|
678
|
-
description: contribution.description
|
|
679
|
-
} : s);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
if (this.sectionsList) {
|
|
683
|
-
this.sectionsList.splice(0, this.sectionsList.length, this.sections);
|
|
684
|
-
this.layoutSidebar(this.sidebarWidth, this.sidebarHeight);
|
|
685
|
-
}
|
|
686
|
-
this.welcomePage?.rebuildCards(( new Set(( this.sections.map(s => s.id)))));
|
|
687
|
-
if (this.selectedSection !== undefined && !( this.sections.some(s => s.id === this.selectedSection)) && this.sections.length > 0) {
|
|
688
|
-
this.showWelcomePage();
|
|
689
|
-
} else {
|
|
690
|
-
this.ensureSectionsListReflectsActiveSection();
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
createSidebar() {
|
|
694
|
-
const sidebarContent = append(this.sidebarContainer, $(".sidebar-content"));
|
|
695
|
-
this.createSidebarHeader(sidebarContent);
|
|
696
|
-
const sectionsListContainer = this.sectionsListContainer = append(sidebarContent, $(".sidebar-sections-list"));
|
|
697
|
-
this.sectionsList = this.editorDisposables.add(this.instantiationService.createInstance(
|
|
698
|
-
WorkbenchList,
|
|
699
|
-
"AICustomizationManagementSections",
|
|
700
|
-
sectionsListContainer,
|
|
701
|
-
( new SectionItemDelegate()),
|
|
702
|
-
[( new SectionItemRenderer(this.hoverService))],
|
|
703
|
-
{
|
|
704
|
-
multipleSelectionSupport: false,
|
|
705
|
-
setRowLineHeight: false,
|
|
706
|
-
horizontalScrolling: false,
|
|
707
|
-
accessibilityProvider: {
|
|
708
|
-
getAriaLabel: item => item.count > 0 ? ( localize(6550, "{0}, {1} items", item.label, item.count)) : item.label,
|
|
709
|
-
getWidgetAriaLabel: () => ( localize(6551, "Agent Customization Sections"))
|
|
710
|
-
},
|
|
711
|
-
openOnSingleClick: true,
|
|
712
|
-
identityProvider: {
|
|
713
|
-
getId: item => item.id
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
));
|
|
717
|
-
this.sectionsList.splice(0, this.sectionsList.length, this.sections);
|
|
718
|
-
this.ensureSectionsListReflectsActiveSection();
|
|
719
|
-
this.editorDisposables.add(this.sectionsList.onDidChangeSelection(e => {
|
|
720
|
-
if (e.elements.length === 0) {
|
|
721
|
-
if (this.selectedSection !== undefined) {
|
|
722
|
-
this.showWelcomePage();
|
|
723
|
-
}
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
this.selectSection(e.elements[0].id);
|
|
727
|
-
}));
|
|
728
|
-
this.editorDisposables.add(autorun(reader => {
|
|
729
|
-
this.harnessService.availableHarnesses.read(reader);
|
|
730
|
-
const activeId = this.harnessService.activeHarness.read(reader);
|
|
731
|
-
this.harnessContextKey.set(activeId);
|
|
732
|
-
this.updateHomeButtonHarnessPresentation();
|
|
733
|
-
this.rebuildVisibleSections();
|
|
734
|
-
if (this._previousActiveHarnessId !== undefined && this._previousActiveHarnessId !== activeId) {
|
|
735
|
-
for (const [section, widget] of this.contributedSectionWidgets) {
|
|
736
|
-
this.editorDisposables.delete(widget);
|
|
737
|
-
this.contributedSectionContainers.get(section)?.replaceChildren();
|
|
738
|
-
}
|
|
739
|
-
this.contributedSectionWidgets.clear();
|
|
740
|
-
for (const section of this.sections) {
|
|
741
|
-
this.updateSectionCount(section.id, 0);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
this._previousActiveHarnessId = activeId;
|
|
745
|
-
}));
|
|
746
|
-
this.editorDisposables.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
747
|
-
if (e.affectsConfiguration(ChatConfiguration.ChatCustomizationsStructuredPreviewEnabled)) {
|
|
748
|
-
this.onStructuredPreviewSettingChanged();
|
|
749
|
-
}
|
|
750
|
-
if (( CUSTOMIZATION_MIGRATION_CATEGORIES.some(
|
|
751
|
-
category => e.affectsConfiguration(category.enablementSetting) || category.configurationSettingIds?.some(settingId => e.affectsConfiguration(settingId))
|
|
752
|
-
))) {
|
|
753
|
-
void this.refreshCustomizationMigrationInfo();
|
|
754
|
-
}
|
|
755
|
-
}));
|
|
756
|
-
this.createSidebarMigrationShortcut(sidebarContent);
|
|
757
|
-
}
|
|
758
|
-
layoutSidebar(width, height) {
|
|
759
|
-
this.sidebarWidth = width;
|
|
760
|
-
this.sidebarHeight = height;
|
|
761
|
-
if (!this.sectionsListContainer) {
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
const headerHeight = this.sidebarHeaderContainer?.offsetHeight ?? 0;
|
|
765
|
-
const migrationHeight = this.migrationShortcutContainer?.style.display !== "none" ? (this.migrationShortcutContainer?.offsetHeight ?? 0) : 0;
|
|
766
|
-
const availableListHeight = Math.max(0, height - 8 - headerHeight - migrationHeight);
|
|
767
|
-
const listHeight = Math.min(availableListHeight, this.sections.length * 26);
|
|
768
|
-
this.sectionsListContainer.style.height = `${listHeight}px`;
|
|
769
|
-
this.sectionsList.layout(listHeight, width);
|
|
770
|
-
}
|
|
771
|
-
createSidebarHeader(sidebarContent) {
|
|
772
|
-
const headerRow = this.sidebarHeaderContainer = append(sidebarContent, $(".sidebar-header-row"));
|
|
773
|
-
const homeButton = this.homeButton = append(headerRow, $("button.sidebar-home-button"));
|
|
774
|
-
homeButton.classList.add("sidebar-harness-home-button");
|
|
775
|
-
homeButton.setAttribute("aria-label", ( localize(6552, "Overview")));
|
|
776
|
-
this.editorDisposables.add(
|
|
777
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), homeButton, ( localize(6553, "Back to overview")))
|
|
778
|
-
);
|
|
779
|
-
const homeIcon = this.homeButtonIcon = append(homeButton, $("span.sidebar-home-icon"));
|
|
780
|
-
homeIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.home));
|
|
781
|
-
homeIcon.setAttribute("aria-hidden", "true");
|
|
782
|
-
const homeLabel = this.homeButtonLabel = append(homeButton, $("span.sidebar-home-label"));
|
|
783
|
-
homeLabel.textContent = ( localize(6554, "Overview"));
|
|
784
|
-
this.editorDisposables.add(addDisposableListener(homeButton, "click", () => {
|
|
785
|
-
this.showWelcomePage();
|
|
786
|
-
}));
|
|
787
|
-
this.updateHomeButtonHarnessPresentation();
|
|
788
|
-
this.updateHomeButtonStyle();
|
|
789
|
-
}
|
|
790
|
-
updateHomeButtonStyle() {
|
|
791
|
-
if (!this.homeButtonLabel || !this.homeButton) {
|
|
792
|
-
return;
|
|
793
|
-
}
|
|
794
|
-
this.homeButtonLabel.style.display = "";
|
|
795
|
-
this.homeButton.style.flex = "1";
|
|
796
|
-
}
|
|
797
|
-
updateHomeButtonHarnessPresentation() {
|
|
798
|
-
this.updateTargetLabelPresentation();
|
|
799
|
-
if (!this.homeButton || !this.homeButtonIcon || !this.homeButtonLabel) {
|
|
800
|
-
return;
|
|
801
|
-
}
|
|
802
|
-
this.homeButtonIcon.className = "sidebar-home-icon";
|
|
803
|
-
this.homeButtonIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.home));
|
|
804
|
-
this.homeButtonLabel.textContent = ( localize(6554, "Overview"));
|
|
805
|
-
this.homeButton.setAttribute("aria-label", ( localize(6552, "Overview")));
|
|
806
|
-
this.homeButton.title = ( localize(6553, "Back to overview"));
|
|
807
|
-
}
|
|
808
|
-
createSidebarMigrationShortcut(sidebarContent) {
|
|
809
|
-
const container = this.migrationShortcutContainer = append(sidebarContent, $(".sidebar-migration-shortcut"));
|
|
810
|
-
container.style.display = "none";
|
|
811
|
-
append(container, $("div.sidebar-migration-separator"));
|
|
812
|
-
const button = this.migrationShortcutButton = append(container, $("button.sidebar-migration-button"));
|
|
813
|
-
button.type = "button";
|
|
814
|
-
button.setAttribute("aria-label", ( localize(6555, "Migrations")));
|
|
815
|
-
this.editorDisposables.add(
|
|
816
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), button, ( localize(6556, "Review customizations that need migration")))
|
|
817
|
-
);
|
|
818
|
-
const icon = append(button, $("span.sidebar-migration-icon"));
|
|
819
|
-
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.warning));
|
|
820
|
-
icon.setAttribute("aria-hidden", "true");
|
|
821
|
-
append(button, $("span.sidebar-migration-label")).textContent = ( localize(6557, "Migrations"));
|
|
822
|
-
this.migrationShortcutCount = append(button, $("span.sidebar-migration-count"));
|
|
823
|
-
this.editorDisposables.add(
|
|
824
|
-
addDisposableListener(button, "click", () => this.showCustomizationMigrationDashboard())
|
|
825
|
-
);
|
|
826
|
-
}
|
|
827
|
-
createWelcomePage(parent) {
|
|
828
|
-
this.welcomePage = this.editorDisposables.add(( new AICustomizationWelcomePage(parent, this.workspaceService.welcomePageFeatures, {
|
|
829
|
-
selectSection: section => this.selectSection(section),
|
|
830
|
-
selectSectionWithMarketplace: section => this.selectSection(section, {
|
|
831
|
-
showMarketplace: true
|
|
832
|
-
}),
|
|
833
|
-
closeEditor: () => {
|
|
834
|
-
if (this.input) {
|
|
835
|
-
this.group.closeEditor(this.input);
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
reviewMigrations: () => {
|
|
839
|
-
this.showCustomizationMigrationDashboard();
|
|
840
|
-
},
|
|
841
|
-
prefillChat: async (query, options) => {
|
|
842
|
-
try {
|
|
843
|
-
if (this.workspaceService.isSessionsWindow) {
|
|
844
|
-
const sessionsViewId = "workbench.view.sessions.chat";
|
|
845
|
-
if (options?.newChat) {
|
|
846
|
-
await this.commandService.executeCommand("workbench.action.sessions.newChat");
|
|
847
|
-
}
|
|
848
|
-
const view = await this.viewsService.openView(sessionsViewId, true);
|
|
849
|
-
const chatView = view;
|
|
850
|
-
if (options?.isPartialQuery && chatView?.prefillInput) {
|
|
851
|
-
chatView.prefillInput(query);
|
|
852
|
-
} else if (chatView?.sendQuery) {
|
|
853
|
-
chatView.sendQuery(query);
|
|
854
|
-
}
|
|
855
|
-
} else {
|
|
856
|
-
if (options?.newChat) {
|
|
857
|
-
await this.commandService.executeCommand("workbench.action.chat.newChat");
|
|
858
|
-
}
|
|
859
|
-
await this.commandService.executeCommand("workbench.action.chat.open", {
|
|
860
|
-
query,
|
|
861
|
-
isPartialQuery: options?.isPartialQuery ?? false
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
} catch (err) {
|
|
865
|
-
onUnexpectedError(err);
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}, this.commandService, this.workspaceService, this.hoverService, this.getActiveHarnessLabel())));
|
|
869
|
-
this.welcomePage.rebuildCards(( new Set(( this.sections.map(s => s.id)))));
|
|
870
|
-
this.welcomePage.setMigrationCategories(this.getMigrationCategorySummaries());
|
|
871
|
-
}
|
|
872
|
-
createBackArrowButton(
|
|
873
|
-
onClick,
|
|
874
|
-
ariaLabel = ( localize(6558, "Back to overview")),
|
|
875
|
-
tooltip = ( localize(6559, "Back to overview"))
|
|
876
|
-
) {
|
|
877
|
-
const button = $("button.section-back-arrow-button");
|
|
878
|
-
button.type = "button";
|
|
879
|
-
button.setAttribute("aria-label", ariaLabel);
|
|
880
|
-
this.editorDisposables.add(
|
|
881
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), button, tooltip)
|
|
882
|
-
);
|
|
883
|
-
const icon = append(button, $("span.section-back-arrow-icon"));
|
|
884
|
-
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.arrowLeft));
|
|
885
|
-
icon.setAttribute("aria-hidden", "true");
|
|
886
|
-
this.editorDisposables.add(addDisposableListener(button, "click", () => {
|
|
887
|
-
if (onClick) {
|
|
888
|
-
onClick();
|
|
889
|
-
} else {
|
|
890
|
-
this.showWelcomePage();
|
|
891
|
-
}
|
|
892
|
-
}));
|
|
893
|
-
return button;
|
|
894
|
-
}
|
|
895
|
-
createCustomizationMigrationContent(contentInner) {
|
|
896
|
-
this.migrationContentContainer = append(
|
|
897
|
-
contentInner,
|
|
898
|
-
$(".prompt-migration-content-container.ai-customization-list-widget")
|
|
899
|
-
);
|
|
900
|
-
const header = this.migrationHeader = append(this.migrationContentContainer, $(".section-title-header"));
|
|
901
|
-
const titleRow = append(header, $(".section-title-row"));
|
|
902
|
-
this.migrationBackButton = this.createBackArrowButton(() => this.showCustomizationMigrationDashboard(), ( localize(6560, "Back to customization migrations")), ( localize(6561, "Back to customization migrations")));
|
|
903
|
-
titleRow.appendChild(this.migrationBackButton);
|
|
904
|
-
this.migrationTitleElement = append(titleRow, $("h2.section-title"));
|
|
905
|
-
this.migrationDescriptionElement = append(header, $("p.section-title-description"));
|
|
906
|
-
this.migrationDescriptionTextElement = append(this.migrationDescriptionElement, $("span.section-title-description-text"));
|
|
907
|
-
const sectionLink = this.migrationLinkElement = append(
|
|
908
|
-
this.migrationDescriptionElement,
|
|
909
|
-
$("a.section-title-link.migration-learn-more-link")
|
|
910
|
-
);
|
|
911
|
-
this.editorDisposables.add(addDisposableListener(sectionLink, "click", e => {
|
|
912
|
-
e.preventDefault();
|
|
913
|
-
this.openerService.open(( URI.parse(sectionLink.href)));
|
|
914
|
-
}));
|
|
915
|
-
this.migrationBannerContainer = append(this.migrationContentContainer, $(".customization-migration-banner"));
|
|
916
|
-
this.migrationBannerContainer.style.display = "none";
|
|
917
|
-
const migrationScrollContainer = $(".prompt-migration-scroll-container");
|
|
918
|
-
this.migrationListContainer = append(
|
|
919
|
-
migrationScrollContainer,
|
|
920
|
-
$(".prompt-migration-list.list-container.distributed-section-layout")
|
|
921
|
-
);
|
|
922
|
-
const migrationListScrollable = this.editorDisposables.add(( new DomScrollableElement(migrationScrollContainer, {
|
|
923
|
-
horizontal: ScrollbarVisibility.Hidden,
|
|
924
|
-
vertical: ScrollbarVisibility.Auto,
|
|
925
|
-
useShadows: false
|
|
926
|
-
})));
|
|
927
|
-
this.migrationListScrollable = migrationListScrollable;
|
|
928
|
-
this.editorDisposables.add(
|
|
929
|
-
addDisposableListener(migrationScrollContainer, EventType.SCROLL, () => {
|
|
930
|
-
migrationListScrollable.setScrollPosition({
|
|
931
|
-
scrollTop: migrationScrollContainer.scrollTop
|
|
932
|
-
});
|
|
933
|
-
})
|
|
934
|
-
);
|
|
935
|
-
const migrationListScrollableNode = migrationListScrollable.getDomNode();
|
|
936
|
-
migrationListScrollableNode.classList.add("prompt-migration-list-scrollable");
|
|
937
|
-
this.migrationContentContainer.appendChild(migrationListScrollableNode);
|
|
938
|
-
const footer = this.migrationFooter = append(this.migrationContentContainer, $(".prompt-migration-footer"));
|
|
939
|
-
this.migrationSelectedCountElement = append(footer, $("span.prompt-migration-selected-count"));
|
|
940
|
-
this.migrationSelectedCountElement.setAttribute("aria-live", "polite");
|
|
941
|
-
const clearSettingsLabel = ( localize(6562, "Clear unused location settings after migration"));
|
|
942
|
-
this.migrationClearSettingsCheckbox = this.editorDisposables.add(( new Checkbox(clearSettingsLabel, true, defaultCheckboxStyles)));
|
|
943
|
-
const actionButtonContainer = append(footer, $(".list-add-button-container"));
|
|
944
|
-
this.migrationMigrateButton = this.editorDisposables.add(( new Button(actionButtonContainer, defaultButtonStyles)));
|
|
945
|
-
this.migrationMigrateButton.element.classList.add("list-add-button", "prompt-migration-button");
|
|
946
|
-
this.editorDisposables.add(this.hoverService.setupManagedHover(
|
|
947
|
-
getDefaultHoverDelegate("element"),
|
|
948
|
-
this.migrationMigrateButton.element,
|
|
949
|
-
() => this.getActiveMigrationCategory()?.migrateButtonTooltip ?? ( localize(6563, "Migrate all customizations"))
|
|
950
|
-
));
|
|
951
|
-
this.editorDisposables.add(this.migrationMigrateButton.onDidClick(() => {
|
|
952
|
-
const category = this.getActiveMigrationCategory();
|
|
953
|
-
if (!category) {
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
const selectedCustomizations = this.getMigrationCandidates(category, this.activeMigrationStorage).filter(customization => this.isCustomizationSelectedForMigration(customization));
|
|
957
|
-
void this.migrateSelectedCustomizations(category, selectedCustomizations);
|
|
958
|
-
}));
|
|
959
|
-
const targetWindow = getWindow(this.migrationContentContainer);
|
|
960
|
-
const migrationResizeObserver = this.editorDisposables.add(new DisposableResizeObserver(
|
|
961
|
-
"AICustomizationManagementEditor.promptMigrationListScrollable",
|
|
962
|
-
() => this.scheduleMigrationSectionLayout(),
|
|
963
|
-
targetWindow
|
|
964
|
-
));
|
|
965
|
-
this.editorDisposables.add(migrationResizeObserver.observe(migrationListScrollableNode));
|
|
966
|
-
this.migrationDashboardContainer = $(".customization-migration-dashboard-container");
|
|
967
|
-
this.migrationDashboardScrollable = this.editorDisposables.add(( new DomScrollableElement(this.migrationDashboardContainer, {
|
|
968
|
-
horizontal: ScrollbarVisibility.Hidden,
|
|
969
|
-
vertical: ScrollbarVisibility.Auto,
|
|
970
|
-
useShadows: false
|
|
971
|
-
})));
|
|
972
|
-
const dashboardScrollableNode = this.migrationDashboardScrollable.getDomNode();
|
|
973
|
-
dashboardScrollableNode.classList.add("customization-migration-dashboard-scrollable");
|
|
974
|
-
this.migrationContentContainer.appendChild(dashboardScrollableNode);
|
|
975
|
-
const migrationDashboardResizeObserver = this.editorDisposables.add(new DisposableResizeObserver(
|
|
976
|
-
"AICustomizationManagementEditor.customizationMigrationDashboard",
|
|
977
|
-
() => this.migrationDashboardScrollable?.scanDomNode(),
|
|
978
|
-
targetWindow
|
|
979
|
-
));
|
|
980
|
-
this.editorDisposables.add(migrationDashboardResizeObserver.observe(dashboardScrollableNode));
|
|
981
|
-
this.editorDisposables.add(migrationDashboardResizeObserver.observe(this.migrationDashboardContainer));
|
|
982
|
-
this.migrationDashboard = this.editorDisposables.add(
|
|
983
|
-
this.instantiationService.createInstance(CustomizationMigrationDashboard, this.migrationDashboardContainer, {
|
|
984
|
-
onDidChangeContent: () => this.migrationDashboardScrollable?.scanDomNode(),
|
|
985
|
-
configureLocations: storage => void this.configureCustomizationMigrationLocations(storage).finally(() => this.migrationDashboard?.focusDestination(storage)),
|
|
986
|
-
dismissResult: () => {
|
|
987
|
-
this.migrationResult = undefined;
|
|
988
|
-
this.renderCustomizationMigrationPage();
|
|
989
|
-
},
|
|
990
|
-
reviewCategory: (id, storage) => void this.showCustomizationMigrationPage(id, storage),
|
|
991
|
-
setWorkspaceSkipped: skipped => {
|
|
992
|
-
this.migrationWorkspaceSkipped = skipped;
|
|
993
|
-
this.storeMigrationActivityState(PromptsStorage.local, {
|
|
994
|
-
...this.getMigrationActivityState(PromptsStorage.local),
|
|
995
|
-
skipped
|
|
996
|
-
});
|
|
997
|
-
this.refreshCustomizationMigrationUi();
|
|
998
|
-
},
|
|
999
|
-
dismissActivity: id => {
|
|
1000
|
-
for (const storage of [PromptsStorage.user, PromptsStorage.local]) {
|
|
1001
|
-
const state = this.getMigrationActivityState(storage);
|
|
1002
|
-
this.storeMigrationActivityState(storage, {
|
|
1003
|
-
...state,
|
|
1004
|
-
activity: state.activity.filter(entry => entry.id !== id)
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
this.renderCustomizationMigrationPage();
|
|
1008
|
-
}
|
|
1009
|
-
})
|
|
1010
|
-
);
|
|
1011
|
-
this.renderCustomizationMigrationPage();
|
|
1012
|
-
if (this.viewMode === "migration") {
|
|
1013
|
-
this.scheduleMigrationSectionLayout();
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
createContent() {
|
|
1017
|
-
const contentInner = append(this.contentContainer, $(".content-inner"));
|
|
1018
|
-
this.createWelcomePage(contentInner);
|
|
1019
|
-
this.editorDisposables.add(Event.any(
|
|
1020
|
-
this.promptsService.onDidChangeSlashCommands,
|
|
1021
|
-
this.promptsService.onDidChangeCustomAgents,
|
|
1022
|
-
this.promptsService.onDidChangeInstructions,
|
|
1023
|
-
this.promptsService.onDidChangeAgentInstructions
|
|
1024
|
-
)(() => this.refreshCustomizationMigrationInfoFromPromptChange()));
|
|
1025
|
-
this.editorDisposables.add(
|
|
1026
|
-
this.agentHostCustomizationService.onDidChangeCustomizations(() => this.refreshCustomizationMigrationInfoFromMcpChange())
|
|
1027
|
-
);
|
|
1028
|
-
this.editorDisposables.add(
|
|
1029
|
-
Event.any(this.mcpWorkbenchService.onChange, this.mcpWorkbenchService.onReset)(() => this.refreshCustomizationMigrationInfoFromMcpChange())
|
|
1030
|
-
);
|
|
1031
|
-
this.editorDisposables.add(autorun(reader => {
|
|
1032
|
-
for (const server of this.mcpService.servers.read(reader)) {
|
|
1033
|
-
server.enablement.read(reader);
|
|
1034
|
-
server.readDefinitions().read(reader);
|
|
1035
|
-
}
|
|
1036
|
-
this.refreshCustomizationMigrationInfoFromMcpChange();
|
|
1037
|
-
}));
|
|
1038
|
-
this.registerCustomizationMigrationSessionRefresh();
|
|
1039
|
-
this.promptsContentContainer = append(contentInner, $(".prompts-content-container"));
|
|
1040
|
-
this.listWidget = this.editorDisposables.add(this.instantiationService.createInstance(AICustomizationListWidget));
|
|
1041
|
-
this.promptsContentContainer.appendChild(this.listWidget.element);
|
|
1042
|
-
this.createCustomizationMigrationContent(contentInner);
|
|
1043
|
-
this.editorDisposables.add(this.listWidget.onDidSelectItem(item => {
|
|
1044
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.itemSelected", {
|
|
1045
|
-
section: this.selectedSection ?? "welcome",
|
|
1046
|
-
promptType: item.promptType,
|
|
1047
|
-
storage: item.source ?? "external"
|
|
1048
|
-
});
|
|
1049
|
-
const source = item.source;
|
|
1050
|
-
const isWorkspaceFile = source === AICustomizationSources.local;
|
|
1051
|
-
const isReadOnly = !source || source === AICustomizationSources.extension || source === AICustomizationSources.plugin || source === AICustomizationSources.builtin;
|
|
1052
|
-
this.showEmbeddedEditor(
|
|
1053
|
-
item.uri,
|
|
1054
|
-
item.name,
|
|
1055
|
-
item.promptType,
|
|
1056
|
-
source ?? AICustomizationSources.builtin,
|
|
1057
|
-
isWorkspaceFile,
|
|
1058
|
-
isReadOnly
|
|
1059
|
-
);
|
|
1060
|
-
}));
|
|
1061
|
-
this.editorDisposables.add(this.listWidget.onDidRequestCreate(promptType => {
|
|
1062
|
-
this.createNewItemWithAI(promptType);
|
|
1063
|
-
}));
|
|
1064
|
-
this.editorDisposables.add(this.listWidget.onDidRequestCreateManual((
|
|
1065
|
-
{
|
|
1066
|
-
type,
|
|
1067
|
-
target,
|
|
1068
|
-
rootFileName
|
|
1069
|
-
}
|
|
1070
|
-
) => {
|
|
1071
|
-
this.createNewItemManual(type, target, rootFileName);
|
|
1072
|
-
}));
|
|
1073
|
-
const hasSections = ( new Set(this.workspaceService.managementSections));
|
|
1074
|
-
if (( hasSections.has(AICustomizationManagementSection.Models))) {
|
|
1075
|
-
this.modelsContentContainer = append(contentInner, $(".models-content-container"));
|
|
1076
|
-
const modelsBackBar = append(this.modelsContentContainer, $(".section-back-bar"));
|
|
1077
|
-
modelsBackBar.appendChild(this.createBackArrowButton());
|
|
1078
|
-
this.modelsWidget = this.editorDisposables.add(this.instantiationService.createInstance(ChatModelsWidget));
|
|
1079
|
-
this.modelsContentContainer.appendChild(this.modelsWidget.element);
|
|
1080
|
-
this.modelsFooterElement = append(this.modelsContentContainer, $(".section-footer"));
|
|
1081
|
-
const modelsDescription = append(this.modelsFooterElement, $("p.section-footer-description"));
|
|
1082
|
-
modelsDescription.textContent = ( localize(
|
|
1083
|
-
6564,
|
|
1084
|
-
"Browse and manage language models from different providers. Select models for use in chat, code completion, and other AI features."
|
|
1085
|
-
));
|
|
1086
|
-
const modelsLink = append(this.modelsFooterElement, $("a.section-footer-link"));
|
|
1087
|
-
modelsLink.textContent = ( localize(6565, "Learn more about language models"));
|
|
1088
|
-
modelsLink.href = "https://code.visualstudio.com/docs/agent-customization/language-models?referrer=in-product";
|
|
1089
|
-
this.editorDisposables.add(addDisposableListener(modelsLink, "click", e => {
|
|
1090
|
-
e.preventDefault();
|
|
1091
|
-
this.openerService.open(( URI.parse(modelsLink.href)));
|
|
1092
|
-
}));
|
|
1093
|
-
}
|
|
1094
|
-
if (( hasSections.has(AICustomizationManagementSection.McpServers))) {
|
|
1095
|
-
this.mcpContentContainer = append(contentInner, $(".mcp-content-container"));
|
|
1096
|
-
this.mcpListWidget = this.editorDisposables.add(this.instantiationService.createInstance(McpListWidget));
|
|
1097
|
-
this.mcpContentContainer.appendChild(this.mcpListWidget.element);
|
|
1098
|
-
this.mcpDetailContainer = append(contentInner, $(".mcp-detail-container"));
|
|
1099
|
-
this.editorDisposables.add(this.mcpListWidget.onDidSelectServer(server => {
|
|
1100
|
-
this.showEmbeddedMcpDetail(server);
|
|
1101
|
-
}));
|
|
1102
|
-
this.editorDisposables.add(this.mcpListWidget.onDidRequestShowPlugin(item => {
|
|
1103
|
-
this.showPluginDetail(item);
|
|
1104
|
-
}));
|
|
1105
|
-
}
|
|
1106
|
-
if (( hasSections.has(AICustomizationManagementSection.Plugins))) {
|
|
1107
|
-
this.pluginContentContainer = append(contentInner, $(".plugin-content-container"));
|
|
1108
|
-
this.pluginListWidget = this.editorDisposables.add(this.instantiationService.createInstance(PluginListWidget, undefined));
|
|
1109
|
-
this.pluginContentContainer.appendChild(this.pluginListWidget.element);
|
|
1110
|
-
this.pluginDetailContainer = append(contentInner, $(".plugin-detail-container"));
|
|
1111
|
-
this.createEmbeddedPluginDetail();
|
|
1112
|
-
this.editorDisposables.add(this.pluginListWidget.onDidSelectPlugin(item => {
|
|
1113
|
-
this.pluginDetailReturnSection = undefined;
|
|
1114
|
-
this.showEmbeddedPluginDetail(item);
|
|
1115
|
-
}));
|
|
1116
|
-
}
|
|
1117
|
-
if (( hasSections.has(AICustomizationManagementSection.Tools))) {
|
|
1118
|
-
this.toolsContentContainer = append(contentInner, $(".tools-content-container"));
|
|
1119
|
-
this.toolsListWidget = this.editorDisposables.add(
|
|
1120
|
-
this.instantiationService.createInstance(ToolsListWidget, AGENT_HOST_COPILOT_CLI_SESSION_TYPE)
|
|
1121
|
-
);
|
|
1122
|
-
this.toolsContentContainer.appendChild(this.toolsListWidget.element);
|
|
1123
|
-
this.toolsDetailContainer = append(contentInner, $(".tools-detail-container"));
|
|
1124
|
-
this.createEmbeddedToolDetail();
|
|
1125
|
-
this.editorDisposables.add(this.toolsListWidget.onDidSelectExtension(extension => {
|
|
1126
|
-
this.showEmbeddedToolDetail(extension);
|
|
1127
|
-
}));
|
|
1128
|
-
}
|
|
1129
|
-
for (const section of this.workspaceService.managementSections) {
|
|
1130
|
-
if (!( aiCustomizationManagementSectionRegistry.has(section))) {
|
|
1131
|
-
continue;
|
|
1132
|
-
}
|
|
1133
|
-
const container = append(contentInner, $(".contributed-section-container"));
|
|
1134
|
-
this.contributedSectionContainers.set(section, container);
|
|
1135
|
-
}
|
|
1136
|
-
this.editorContentContainer = append(contentInner, $(".editor-content-container"));
|
|
1137
|
-
this.createEmbeddedEditor();
|
|
1138
|
-
this.updateContentVisibility();
|
|
1139
|
-
this.editorDisposables.add(this.listWidget.onDidChangeItemCount(count => {
|
|
1140
|
-
if (this.isPromptsSection(this.selectedSection)) {
|
|
1141
|
-
this.updateSectionCount(this.selectedSection, count);
|
|
1142
|
-
}
|
|
1143
|
-
}));
|
|
1144
|
-
if (this.mcpListWidget) {
|
|
1145
|
-
this.editorDisposables.add(this.mcpListWidget.onDidChangeItemCount(count => {
|
|
1146
|
-
this.updateSectionCount(AICustomizationManagementSection.McpServers, count);
|
|
1147
|
-
}));
|
|
1148
|
-
this.mcpListWidget.fireItemCount();
|
|
1149
|
-
}
|
|
1150
|
-
if (this.pluginListWidget) {
|
|
1151
|
-
this.editorDisposables.add(this.pluginListWidget.onDidChangeItemCount(count => {
|
|
1152
|
-
this.updateSectionCount(AICustomizationManagementSection.Plugins, count);
|
|
1153
|
-
}));
|
|
1154
|
-
this.pluginListWidget.fireItemCount();
|
|
1155
|
-
}
|
|
1156
|
-
if (this.modelsWidget) {
|
|
1157
|
-
this.editorDisposables.add(this.modelsWidget.onDidChangeItemCount(count => {
|
|
1158
|
-
this.updateSectionCount(AICustomizationManagementSection.Models, count);
|
|
1159
|
-
}));
|
|
1160
|
-
this.modelsWidget.fireItemCount();
|
|
1161
|
-
}
|
|
1162
|
-
if (this.toolsListWidget) {
|
|
1163
|
-
this.editorDisposables.add(this.toolsListWidget.onDidChangeItemCount(count => {
|
|
1164
|
-
this.updateSectionCount(AICustomizationManagementSection.Tools, count);
|
|
1165
|
-
}));
|
|
1166
|
-
this.toolsListWidget.fireItemCount();
|
|
1167
|
-
}
|
|
1168
|
-
for (const section of ITEMS_MODEL_SECTIONS) {
|
|
1169
|
-
const observable = this.itemsModel.getCount(section);
|
|
1170
|
-
this.editorDisposables.add(autorun(reader => {
|
|
1171
|
-
this.updateSectionCount(section, observable.read(reader));
|
|
1172
|
-
}));
|
|
1173
|
-
}
|
|
1174
|
-
if (this.isPromptsSection(this.selectedSection)) {
|
|
1175
|
-
void this.listWidget.setSection(this.selectedSection);
|
|
1176
|
-
}
|
|
1177
|
-
void this.refreshCustomizationMigrationInfo();
|
|
1178
|
-
}
|
|
1179
|
-
registerCustomizationMigrationSessionRefresh() {
|
|
1180
|
-
this.editorDisposables.add(autorun(reader => {
|
|
1181
|
-
this.harnessService.activeSessionResource.read(reader);
|
|
1182
|
-
this.workspaceService.activeProjectRoot.read(reader);
|
|
1183
|
-
this.activeMigrationStorage = undefined;
|
|
1184
|
-
this.migrationWorkspaceSkipped = this.getMigrationActivityState(PromptsStorage.local).skipped;
|
|
1185
|
-
this.migrationResult = undefined;
|
|
1186
|
-
void this.refreshCustomizationMigrationInfo();
|
|
1187
|
-
}));
|
|
1188
|
-
}
|
|
1189
|
-
refreshCustomizationMigrationInfoFromPromptChange() {
|
|
1190
|
-
if (!this.customizationMigrationWritesInProgress) {
|
|
1191
|
-
void this.refreshCustomizationMigrationInfo();
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
refreshCustomizationMigrationInfoFromMcpChange() {
|
|
1195
|
-
if (!this.customizationMigrationWritesInProgress) {
|
|
1196
|
-
void this.refreshCustomizationMigrationInfo();
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
async refreshCustomizationMigrationInfo() {
|
|
1200
|
-
const activeHarnessId = this.harnessService.activeHarness.get();
|
|
1201
|
-
const activeSessionResource = this.harnessService.activeSessionResource.get();
|
|
1202
|
-
const projectRoot = this.workspaceService.activeProjectRoot.get();
|
|
1203
|
-
const selectionContextKey = `${activeHarnessId}\n${( activeSessionResource.toString())}\n${projectRoot ? getComparisonKey(projectRoot) : ""}`;
|
|
1204
|
-
if (selectionContextKey !== this.migrationSelectionContextKey) {
|
|
1205
|
-
this.migrationSelectionContextKey = selectionContextKey;
|
|
1206
|
-
this.knownMcpServerMigrationItems.clear();
|
|
1207
|
-
this.selectedMcpServerMigrationItems.clear();
|
|
1208
|
-
this.selectedCustomizationMigrationTargets.clear();
|
|
1209
|
-
this.explicitlySelectedCustomizationMigrationTargets.clear();
|
|
1210
|
-
}
|
|
1211
|
-
const refreshSequence = ++this.customizationMigrationRefreshSequence;
|
|
1212
|
-
this.customizationMigrationLoading = true;
|
|
1213
|
-
this.customizationMigrationLoadError = undefined;
|
|
1214
|
-
this.renderCustomizationMigrationPage();
|
|
1215
|
-
if (!isAgentHostTarget(activeHarnessId)) {
|
|
1216
|
-
this.customizationMigrationLoading = false;
|
|
1217
|
-
this.setCustomizationsToMigrate(( new Map()), ( new Map()));
|
|
1218
|
-
return;
|
|
1219
|
-
}
|
|
1220
|
-
try {
|
|
1221
|
-
const enabledCategories = this.getEnabledMigrationCategories();
|
|
1222
|
-
if (enabledCategories.length === 0) {
|
|
1223
|
-
this.customizationMigrationLoading = false;
|
|
1224
|
-
this.setCustomizationsToMigrate(( new Map()), ( new Map()));
|
|
1225
|
-
return;
|
|
1226
|
-
}
|
|
1227
|
-
const migrationsByCategory = await Promise.all(( enabledCategories.map(async category => {
|
|
1228
|
-
let migration;
|
|
1229
|
-
switch (category.migrationType) {
|
|
1230
|
-
case CustomizationMigrationType.McpServers:
|
|
1231
|
-
migration = await this.customizationMigrationService.computeMigration(activeSessionResource, CustomizationMigrationType.McpServers);
|
|
1232
|
-
break;
|
|
1233
|
-
default:
|
|
1234
|
-
migration = await this.customizationMigrationService.computeMigration(activeSessionResource, category.migrationType);
|
|
1235
|
-
break;
|
|
1236
|
-
}
|
|
1237
|
-
return [category.id, migration];
|
|
1238
|
-
})));
|
|
1239
|
-
if (refreshSequence !== this.customizationMigrationRefreshSequence || activeHarnessId !== this.harnessService.activeHarness.get() || !isEqual(activeSessionResource, this.harnessService.activeSessionResource.get())) {
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
const candidatesByCategory = ( new Map(( migrationsByCategory.map(([categoryId, migration]) => [categoryId, migration.candidates]))));
|
|
1243
|
-
const provider = this.harnessService.findHarnessById(activeHarnessId)?.itemProvider;
|
|
1244
|
-
const targetTypes = ( new Set(( [...( candidatesByCategory.values())].flat().filter(candidate => !isMcpServerCustomizationMigrationCandidate(candidate)).map(getCustomizationMigrationTargetType))));
|
|
1245
|
-
const targetFolderEntries = await Promise.all(( [...targetTypes].map(async targetType => {
|
|
1246
|
-
const folders = await provider?.provideSourceFolders?.(activeSessionResource, targetType, CancellationToken.None);
|
|
1247
|
-
return [targetType, folders ?? []];
|
|
1248
|
-
})));
|
|
1249
|
-
if (refreshSequence !== this.customizationMigrationRefreshSequence || activeHarnessId !== this.harnessService.activeHarness.get() || !isEqual(activeSessionResource, this.harnessService.activeSessionResource.get())) {
|
|
1250
|
-
return;
|
|
1251
|
-
}
|
|
1252
|
-
const targetFoldersByType = ( new Map(targetFolderEntries));
|
|
1253
|
-
this.customizationMigrationLoading = false;
|
|
1254
|
-
this.setCustomizationsToMigrate(candidatesByCategory, targetFoldersByType);
|
|
1255
|
-
} catch (error) {
|
|
1256
|
-
if (refreshSequence === this.customizationMigrationRefreshSequence) {
|
|
1257
|
-
this.customizationMigrationLoading = false;
|
|
1258
|
-
this.customizationMigrationLoadError = getErrorMessage(error);
|
|
1259
|
-
this.renderCustomizationMigrationPage();
|
|
1260
|
-
}
|
|
1261
|
-
onUnexpectedError(error);
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
setCustomizationsToMigrate(candidatesByCategory, targetFoldersByType) {
|
|
1265
|
-
const previousFileItems = this.createCustomizationMigrationItemMap(
|
|
1266
|
-
this.getAllMigrationCandidates().filter(candidate => !isMcpServerCustomizationMigrationCandidate(candidate))
|
|
1267
|
-
);
|
|
1268
|
-
const selectedItems = ( new ResourceMap());
|
|
1269
|
-
for (const customization of [...( candidatesByCategory.values())].flat()) {
|
|
1270
|
-
if (isMcpServerCustomizationMigrationCandidate(customization)) {
|
|
1271
|
-
const key = getMcpServerCustomizationMigrationCandidateKey(customization);
|
|
1272
|
-
if (!( this.knownMcpServerMigrationItems.has(key))) {
|
|
1273
|
-
this.knownMcpServerMigrationItems.add(key);
|
|
1274
|
-
this.selectedMcpServerMigrationItems.add(key);
|
|
1275
|
-
}
|
|
1276
|
-
} else if (!this.hasCustomizationMigrationItem(previousFileItems, customization) || this.isCustomizationSelectedForMigration(customization)) {
|
|
1277
|
-
this.addCustomizationMigrationItem(selectedItems, customization);
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
this.selectedCustomizationMigrationItems = selectedItems;
|
|
1281
|
-
this.customizationsByMigrationCategory = candidatesByCategory;
|
|
1282
|
-
this.customizationMigrationTargetFoldersByType = targetFoldersByType;
|
|
1283
|
-
this.reconcileCustomizationMigrationTargets();
|
|
1284
|
-
this.refreshCustomizationMigrationUi();
|
|
1285
|
-
if (this.viewMode === "migration" && this.activeMigrationCategoryId !== undefined && !( candidatesByCategory.has(this.activeMigrationCategoryId))) {
|
|
1286
|
-
this.showWelcomePage();
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
reconcileCustomizationMigrationTargets() {
|
|
1290
|
-
const requiredTargets = ( new Map());
|
|
1291
|
-
for (const customization of this.getAllMigrationCandidates()) {
|
|
1292
|
-
if (isMcpServerCustomizationMigrationCandidate(customization)) {
|
|
1293
|
-
continue;
|
|
1294
|
-
}
|
|
1295
|
-
const type = getCustomizationMigrationTargetType(customization);
|
|
1296
|
-
const key = this.getCustomizationMigrationTargetKey(type, customization.storage);
|
|
1297
|
-
requiredTargets.set(key, {
|
|
1298
|
-
type,
|
|
1299
|
-
storage: customization.storage
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
for (const key of ( this.selectedCustomizationMigrationTargets.keys())) {
|
|
1303
|
-
if (!( requiredTargets.has(key))) {
|
|
1304
|
-
this.selectedCustomizationMigrationTargets.delete(key);
|
|
1305
|
-
this.explicitlySelectedCustomizationMigrationTargets.delete(key);
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
for (const [key, target] of requiredTargets) {
|
|
1309
|
-
if (( this.selectedCustomizationMigrationTargets.has(key)) && ( this.explicitlySelectedCustomizationMigrationTargets.has(key))) {
|
|
1310
|
-
continue;
|
|
1311
|
-
}
|
|
1312
|
-
const folder = this.getCustomizationMigrationFolders(target.type, target.storage)[0];
|
|
1313
|
-
if (folder) {
|
|
1314
|
-
this.selectedCustomizationMigrationTargets.set(key, folder);
|
|
1315
|
-
} else {
|
|
1316
|
-
this.selectedCustomizationMigrationTargets.delete(key);
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
getCustomizationMigrationTargetKey(type, storage) {
|
|
1321
|
-
return `${type}:${storage}`;
|
|
1322
|
-
}
|
|
1323
|
-
createCustomizationMigrationItemMap(customizations) {
|
|
1324
|
-
const result = ( new ResourceMap());
|
|
1325
|
-
for (const customization of customizations) {
|
|
1326
|
-
this.addCustomizationMigrationItem(result, customization);
|
|
1327
|
-
}
|
|
1328
|
-
return result;
|
|
1329
|
-
}
|
|
1330
|
-
hasCustomizationMigrationItem(items, customization) {
|
|
1331
|
-
return items.get(customization.uri)?.has(customization.storage) === true;
|
|
1332
|
-
}
|
|
1333
|
-
addCustomizationMigrationItem(items, customization) {
|
|
1334
|
-
const storages = items.get(customization.uri) ?? ( new Set());
|
|
1335
|
-
storages.add(customization.storage);
|
|
1336
|
-
items.set(customization.uri, storages);
|
|
1337
|
-
}
|
|
1338
|
-
getCustomizationMigrationCandidateKey(customization) {
|
|
1339
|
-
return isMcpServerCustomizationMigrationCandidate(customization) ? `mcp:${getMcpServerCustomizationMigrationCandidateKey(customization)}` : `file:${customization.storage}:${( customization.uri.toString())}`;
|
|
1340
|
-
}
|
|
1341
|
-
isCustomizationSelectedForMigration(customization) {
|
|
1342
|
-
if (isMcpServerCustomizationMigrationCandidate(customization)) {
|
|
1343
|
-
return ( this.selectedMcpServerMigrationItems.has(getMcpServerCustomizationMigrationCandidateKey(customization)));
|
|
1344
|
-
}
|
|
1345
|
-
return this.hasCustomizationMigrationItem(this.selectedCustomizationMigrationItems, customization);
|
|
1346
|
-
}
|
|
1347
|
-
setCustomizationSelectedForMigration(customization, selected) {
|
|
1348
|
-
if (isMcpServerCustomizationMigrationCandidate(customization)) {
|
|
1349
|
-
const key = getMcpServerCustomizationMigrationCandidateKey(customization);
|
|
1350
|
-
if (selected) {
|
|
1351
|
-
this.selectedMcpServerMigrationItems.add(key);
|
|
1352
|
-
} else {
|
|
1353
|
-
this.selectedMcpServerMigrationItems.delete(key);
|
|
1354
|
-
}
|
|
1355
|
-
return;
|
|
1356
|
-
}
|
|
1357
|
-
if (selected) {
|
|
1358
|
-
this.addCustomizationMigrationItem(this.selectedCustomizationMigrationItems, customization);
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
const storages = this.selectedCustomizationMigrationItems.get(customization.uri);
|
|
1362
|
-
storages?.delete(customization.storage);
|
|
1363
|
-
if (storages?.size === 0) {
|
|
1364
|
-
this.selectedCustomizationMigrationItems.delete(customization.uri);
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
getMigrationCandidates(category, storage) {
|
|
1368
|
-
if (!this.isMigrationCategoryEnabled(category)) {
|
|
1369
|
-
return [];
|
|
1370
|
-
}
|
|
1371
|
-
const candidates = this.customizationsByMigrationCategory.get(category.id) ?? [];
|
|
1372
|
-
return storage === undefined ? candidates : candidates.filter(candidate => this.getMigrationCandidateStorage(candidate) === storage);
|
|
1373
|
-
}
|
|
1374
|
-
getMigrationCandidateStorage(candidate) {
|
|
1375
|
-
return isMcpServerCustomizationMigrationCandidate(candidate) ? PromptsStorage.local : candidate.storage;
|
|
1376
|
-
}
|
|
1377
|
-
getAllMigrationCandidates() {
|
|
1378
|
-
return [...( this.customizationsByMigrationCategory.values())].flat();
|
|
1379
|
-
}
|
|
1380
|
-
getActiveMigrationCategory() {
|
|
1381
|
-
return this.activeMigrationCategoryId ? getCustomizationMigrationCategory(this.activeMigrationCategoryId) : undefined;
|
|
1382
|
-
}
|
|
1383
|
-
getDashboardFileMigrationCandidates() {
|
|
1384
|
-
return [
|
|
1385
|
-
CustomizationMigrationCategoryId.PromptFiles,
|
|
1386
|
-
CustomizationMigrationCategoryId.UserData
|
|
1387
|
-
].flatMap(id => this.getMigrationCandidates(getCustomizationMigrationCategory(id))).filter(candidate => !isMcpServerCustomizationMigrationCandidate(candidate));
|
|
1388
|
-
}
|
|
1389
|
-
getMigrationCategorySummaries() {
|
|
1390
|
-
const harnessLabel = this.getActiveHarnessLabel();
|
|
1391
|
-
const summaries = [];
|
|
1392
|
-
for (const id of homepageMigrationCategories) {
|
|
1393
|
-
const category = getCustomizationMigrationCategory(id);
|
|
1394
|
-
const candidates = this.getMigrationCandidates(category).filter(
|
|
1395
|
-
candidate => !this.migrationWorkspaceSkipped || this.getMigrationCandidateStorage(candidate) !== PromptsStorage.local
|
|
1396
|
-
);
|
|
1397
|
-
if (candidates.length === 0) {
|
|
1398
|
-
continue;
|
|
1399
|
-
}
|
|
1400
|
-
summaries.push({
|
|
1401
|
-
id: category.id,
|
|
1402
|
-
label: category.cardLabel,
|
|
1403
|
-
description: category.getCardDescription(candidates, harnessLabel),
|
|
1404
|
-
actionLabel: category.cardActionLabel,
|
|
1405
|
-
actionAriaLabel: category.cardActionAriaLabel,
|
|
1406
|
-
count: candidates.length
|
|
1407
|
-
});
|
|
1408
|
-
}
|
|
1409
|
-
return summaries;
|
|
1410
|
-
}
|
|
1411
|
-
refreshCustomizationMigrationUi() {
|
|
1412
|
-
this.welcomePage?.setMigrationCategories(this.getMigrationCategorySummaries());
|
|
1413
|
-
this.updateSidebarMigrationShortcut();
|
|
1414
|
-
this.renderCustomizationMigrationPage();
|
|
1415
|
-
}
|
|
1416
|
-
updateSidebarMigrationShortcut() {
|
|
1417
|
-
if (!this.migrationShortcutContainer || !this.migrationShortcutButton || !this.migrationShortcutCount) {
|
|
1418
|
-
return;
|
|
1419
|
-
}
|
|
1420
|
-
const candidates = homepageMigrationCategories.flatMap(id => this.getMigrationCandidates(getCustomizationMigrationCategory(id)));
|
|
1421
|
-
const count = candidates.filter(
|
|
1422
|
-
candidate => !this.migrationWorkspaceSkipped || this.getMigrationCandidateStorage(candidate) !== PromptsStorage.local
|
|
1423
|
-
).length;
|
|
1424
|
-
const enabled = isAgentHostTarget(this.harnessService.activeHarness.get()) && ( homepageMigrationCategories.some(
|
|
1425
|
-
id => this.isMigrationCategoryEnabled(getCustomizationMigrationCategory(id))
|
|
1426
|
-
));
|
|
1427
|
-
this.migrationShortcutContainer.style.display = enabled ? "" : "none";
|
|
1428
|
-
this.migrationShortcutCount.textContent = count > 0 ? String(count) : "";
|
|
1429
|
-
this.migrationShortcutButton.setAttribute("aria-label", count === 1 ? ( localize(6566, "Migrations, 1 customization needs attention")) : ( localize(6567, "Migrations, {0} customizations need attention", count)));
|
|
1430
|
-
this.layoutSidebar(this.sidebarWidth, this.sidebarHeight);
|
|
1431
|
-
}
|
|
1432
|
-
async migrateSelectedCustomizations(category, customizations) {
|
|
1433
|
-
if (this.customizationMigrationInProgress || customizations.length === 0 || !this.isMigrationCategoryEnabled(category)) {
|
|
1434
|
-
return;
|
|
1435
|
-
}
|
|
1436
|
-
this.customizationMigrationInProgress = true;
|
|
1437
|
-
this.updateCustomizationMigrationActionState();
|
|
1438
|
-
try {
|
|
1439
|
-
const sessionResource = this.harnessService.activeSessionResource.get();
|
|
1440
|
-
const activityContexts = this.getMigrationActivityContexts();
|
|
1441
|
-
if (category.migrationType === CustomizationMigrationType.McpServers) {
|
|
1442
|
-
await this.migrateSelectedMcpServers(
|
|
1443
|
-
category,
|
|
1444
|
-
customizations.filter(isMcpServerCustomizationMigrationCandidate),
|
|
1445
|
-
sessionResource
|
|
1446
|
-
);
|
|
1447
|
-
return;
|
|
1448
|
-
}
|
|
1449
|
-
const files = customizations.filter(candidate => !isMcpServerCustomizationMigrationCandidate(candidate));
|
|
1450
|
-
const settingsToClear = this.getConfiguredLocationSettingsToClear(category, files);
|
|
1451
|
-
const targetFolders = await this.resolveCustomizationMigrationTargetFolders(files, this.customizationMigrationTargetFoldersByType, sessionResource);
|
|
1452
|
-
if (!targetFolders || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
1453
|
-
return;
|
|
1454
|
-
}
|
|
1455
|
-
const confirmation = category.getConfirmation(
|
|
1456
|
-
files,
|
|
1457
|
-
this.getActiveHarnessLabel(),
|
|
1458
|
-
this.getCustomizationMigrationDestinationLabel([...( targetFolders.values())].flatMap(folders => [...( folders.values())]))
|
|
1459
|
-
);
|
|
1460
|
-
const confirmed = await this.dialogService.confirm({
|
|
1461
|
-
type: "question",
|
|
1462
|
-
message: confirmation.message,
|
|
1463
|
-
detail: confirmation.detail,
|
|
1464
|
-
primaryButton: confirmation.primaryButton,
|
|
1465
|
-
...(confirmation.deleteOriginalsLabel ? {
|
|
1466
|
-
checkbox: {
|
|
1467
|
-
label: confirmation.deleteOriginalsLabel,
|
|
1468
|
-
checked: true
|
|
1469
|
-
}
|
|
1470
|
-
} : {})
|
|
1471
|
-
});
|
|
1472
|
-
if (!confirmed.confirmed || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
1473
|
-
return;
|
|
1474
|
-
}
|
|
1475
|
-
const deleteOriginalFiles = confirmed.checkboxChecked !== false;
|
|
1476
|
-
this.migrationResult = undefined;
|
|
1477
|
-
const result = await this.runCustomizationMigration(files, targetFolders, deleteOriginalFiles);
|
|
1478
|
-
for (const context of activityContexts) {
|
|
1479
|
-
const items = result.migratedSources.flatMap((source, index) => {
|
|
1480
|
-
const target = result.migratedCustomizations[index];
|
|
1481
|
-
const file = files.find(file => file.storage === source.storage && isEqual(file.uri, source.uri));
|
|
1482
|
-
return source.storage === context.storage && target && file ? [{
|
|
1483
|
-
label: file.name ?? basename(source.uri),
|
|
1484
|
-
sourceLabel: this.labelService.getUriLabel(source.uri),
|
|
1485
|
-
targetLabel: this.labelService.getUriLabel(target.uri),
|
|
1486
|
-
operation: file.type === PromptsType.prompt ? "converted" : deleteOriginalFiles ? "moved" : "copied"
|
|
1487
|
-
}] : [];
|
|
1488
|
-
});
|
|
1489
|
-
this.recordMigrationActivity(category, context, items);
|
|
1490
|
-
}
|
|
1491
|
-
if (result.failedCustomizationFileNames.length > 0) {
|
|
1492
|
-
const displayedFileNames = result.failedCustomizationFileNames.slice(0, 3);
|
|
1493
|
-
this.notificationService.error(category.getFailedMessage(
|
|
1494
|
-
displayedFileNames,
|
|
1495
|
-
result.failedCustomizationFileNames.length - displayedFileNames.length
|
|
1496
|
-
));
|
|
1497
|
-
}
|
|
1498
|
-
if (result.migratedCount === 0) {
|
|
1499
|
-
if (result.failedCustomizationFileNames.length === 0) {
|
|
1500
|
-
this.notificationService.warn(category.noFilesMigratedMessage);
|
|
1501
|
-
}
|
|
1502
|
-
return;
|
|
1503
|
-
}
|
|
1504
|
-
if (result.failedCustomizationFileNames.length === 0 && result.migratedCount === files.length && settingsToClear.length > 0) {
|
|
1505
|
-
try {
|
|
1506
|
-
await this.clearConfiguredLocationSettings(settingsToClear);
|
|
1507
|
-
} catch (error) {
|
|
1508
|
-
this.notificationService.error(( localize(
|
|
1509
|
-
6568,
|
|
1510
|
-
"Customizations were migrated, but the custom location settings could not be cleared: {0}",
|
|
1511
|
-
getErrorMessage(error)
|
|
1512
|
-
)));
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
if (deleteOriginalFiles) {
|
|
1516
|
-
await this.refreshCustomizationMigrationInfo();
|
|
1517
|
-
}
|
|
1518
|
-
const unsupportedKeys = result.unsupportedHeaderKeys.join(", ");
|
|
1519
|
-
this.notificationService.info(
|
|
1520
|
-
unsupportedKeys && category.getMigratedWithReviewMessage ? category.getMigratedWithReviewMessage(result.migratedCount, unsupportedKeys) : category.getMigratedMessage(result.migratedCount)
|
|
1521
|
-
);
|
|
1522
|
-
this.showCustomizationMigrationDashboard();
|
|
1523
|
-
} finally {
|
|
1524
|
-
this.customizationMigrationInProgress = false;
|
|
1525
|
-
this.updateCustomizationMigrationActionState();
|
|
1526
|
-
}
|
|
1527
|
-
}
|
|
1528
|
-
async migrateSelectedMcpServers(category, servers, sessionResource) {
|
|
1529
|
-
if (servers.length === 0) {
|
|
1530
|
-
return;
|
|
1531
|
-
}
|
|
1532
|
-
const context = this.getMigrationActivityContext(PromptsStorage.local);
|
|
1533
|
-
const confirmation = category.getConfirmation(servers, this.getActiveHarnessLabel());
|
|
1534
|
-
const confirmResult = await this.dialogService.confirm({
|
|
1535
|
-
type: "question",
|
|
1536
|
-
message: confirmation.message,
|
|
1537
|
-
detail: confirmation.detail,
|
|
1538
|
-
primaryButton: confirmation.primaryButton
|
|
1539
|
-
});
|
|
1540
|
-
if (!confirmResult.confirmed || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
|
-
this.customizationMigrationWritesInProgress = true;
|
|
1544
|
-
this.migrationResult = undefined;
|
|
1545
|
-
let result;
|
|
1546
|
-
try {
|
|
1547
|
-
result = await this.customizationMigrationService.migrateMcpServers(sessionResource, servers);
|
|
1548
|
-
} finally {
|
|
1549
|
-
await timeout(0);
|
|
1550
|
-
this.customizationMigrationWritesInProgress = false;
|
|
1551
|
-
}
|
|
1552
|
-
const migratedServers = servers.filter(server => !( result.failures.some(
|
|
1553
|
-
failure => failure.id === server.id && isEqual(failure.sourceUri, server.sourceUri)
|
|
1554
|
-
)));
|
|
1555
|
-
if (result.migratedCount > 0) {
|
|
1556
|
-
this.recordMigrationActivity(category, context, ( migratedServers.map(server => ({
|
|
1557
|
-
label: server.name,
|
|
1558
|
-
sourceLabel: this.labelService.getUriLabel(server.sourceUri),
|
|
1559
|
-
targetLabel: this.labelService.getUriLabel(server.targetUri),
|
|
1560
|
-
operation: "server"
|
|
1561
|
-
}))));
|
|
1562
|
-
}
|
|
1563
|
-
await this.refreshCustomizationMigrationInfo();
|
|
1564
|
-
for (const failure of result.failures) {
|
|
1565
|
-
if (failure.error) {
|
|
1566
|
-
onUnexpectedError(failure.error);
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
if (result.failures.length > 0) {
|
|
1570
|
-
const message = category.getMcpServerFailureMessage?.(result.failures) ?? category.getFailedMessage(( result.failures.slice(0, 3).map(failure => failure.name)), Math.max(0, result.failures.length - 3));
|
|
1571
|
-
this.notificationService.error(message);
|
|
1572
|
-
}
|
|
1573
|
-
if (result.migratedCount > 0) {
|
|
1574
|
-
this.notificationService.info(category.getMigratedMessage(result.migratedCount));
|
|
1575
|
-
this.showCustomizationMigrationDashboard();
|
|
1576
|
-
} else if (result.failures.length === 0) {
|
|
1577
|
-
this.notificationService.warn(category.noFilesMigratedMessage);
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
getConfiguredLocationSettingsToClear(category, customizations) {
|
|
1581
|
-
if (category.id !== CustomizationMigrationCategoryId.ConfiguredLocations || !this.migrationClearSettingsCheckbox?.checked) {
|
|
1582
|
-
return [];
|
|
1583
|
-
}
|
|
1584
|
-
const selectedCustomizations = this.createCustomizationMigrationItemMap(customizations);
|
|
1585
|
-
const remainingCustomizations = this.getMigrationCandidates(category).filter(
|
|
1586
|
-
customization => !isMcpServerCustomizationMigrationCandidate(customization)
|
|
1587
|
-
).filter(
|
|
1588
|
-
customization => !this.hasCustomizationMigrationItem(selectedCustomizations, customization)
|
|
1589
|
-
);
|
|
1590
|
-
return this.getModifiedConfiguredLocationSettingIds(category).filter(settingId => ( customizations.some(
|
|
1591
|
-
customization => this.configuredLocationSettingAppliesTo(settingId, customization)
|
|
1592
|
-
)) && !( remainingCustomizations.some(
|
|
1593
|
-
customization => this.configuredLocationSettingAppliesTo(settingId, customization)
|
|
1594
|
-
)));
|
|
1595
|
-
}
|
|
1596
|
-
getModifiedConfiguredLocationSettingIds(category) {
|
|
1597
|
-
return category.getModifiedSettingIds?.(this.configurationService) ?? [];
|
|
1598
|
-
}
|
|
1599
|
-
configuredLocationSettingAppliesTo(settingId, customization) {
|
|
1600
|
-
switch (settingId) {
|
|
1601
|
-
case PromptsConfig.AGENTS_LOCATION_KEY:
|
|
1602
|
-
case PromptsConfig.MODE_LOCATION_KEY:
|
|
1603
|
-
return customization.type === PromptsType.agent;
|
|
1604
|
-
case PromptsConfig.INSTRUCTIONS_LOCATION_KEY:
|
|
1605
|
-
return customization.type === PromptsType.instructions;
|
|
1606
|
-
case PromptsConfig.SKILLS_LOCATION_KEY:
|
|
1607
|
-
return customization.type === PromptsType.skill;
|
|
1608
|
-
default:
|
|
1609
|
-
return false;
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
async clearConfiguredLocationSettings(settingIds) {
|
|
1613
|
-
for (const settingId of settingIds) {
|
|
1614
|
-
await this.configurationService.updateValue(settingId, undefined);
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
async runCustomizationMigration(customizations, targetFolders, deleteOriginalFiles) {
|
|
1618
|
-
this.customizationMigrationWritesInProgress = true;
|
|
1619
|
-
try {
|
|
1620
|
-
return await migrateCustomizations(customizations, targetFolders, this.fileService, onUnexpectedError, {
|
|
1621
|
-
deleteOriginalFiles
|
|
1622
|
-
});
|
|
1623
|
-
} finally {
|
|
1624
|
-
await timeout(0);
|
|
1625
|
-
this.customizationMigrationWritesInProgress = false;
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
renderCustomizationMigrationPage() {
|
|
1629
|
-
if (!this.migrationListContainer) {
|
|
1630
|
-
return;
|
|
1631
|
-
}
|
|
1632
|
-
const category = this.getActiveMigrationCategory();
|
|
1633
|
-
this.migrationContentContainer?.classList.toggle("showing-dashboard", !category);
|
|
1634
|
-
if (this.migrationDashboardScrollable) {
|
|
1635
|
-
this.migrationDashboardScrollable.getDomNode().style.display = category ? "none" : "";
|
|
1636
|
-
}
|
|
1637
|
-
if (this.migrationDashboardContainer) {
|
|
1638
|
-
this.migrationDashboardContainer.style.display = category ? "none" : "";
|
|
1639
|
-
}
|
|
1640
|
-
if (this.migrationListScrollable) {
|
|
1641
|
-
this.migrationListScrollable.getDomNode().style.display = category ? "" : "none";
|
|
1642
|
-
}
|
|
1643
|
-
if (this.migrationHeader) {
|
|
1644
|
-
this.migrationHeader.style.display = category ? "" : "none";
|
|
1645
|
-
}
|
|
1646
|
-
if (this.migrationFooter) {
|
|
1647
|
-
this.migrationFooter.style.display = category ? "" : "none";
|
|
1648
|
-
}
|
|
1649
|
-
if (!category) {
|
|
1650
|
-
this.renderCustomizationMigrationBanner(undefined);
|
|
1651
|
-
this.renderCustomizationMigrationDashboardState();
|
|
1652
|
-
return;
|
|
1653
|
-
}
|
|
1654
|
-
const targetDocument = getWindow(this.migrationListContainer).document;
|
|
1655
|
-
const activeElement = targetDocument.activeElement;
|
|
1656
|
-
const capturedFocusState = this.captureCustomizationMigrationFocus();
|
|
1657
|
-
if (capturedFocusState) {
|
|
1658
|
-
this.migrationFocusState = capturedFocusState;
|
|
1659
|
-
} else if (isHTMLElement(activeElement) && activeElement.isConnected && activeElement !== targetDocument.body) {
|
|
1660
|
-
this.migrationFocusState = undefined;
|
|
1661
|
-
}
|
|
1662
|
-
for (const section of this.migrationSectionLists) {
|
|
1663
|
-
this.migrationSectionScrollPositions?.set(section.key, section.list.scrollTop);
|
|
1664
|
-
}
|
|
1665
|
-
this.migrationPageDisposables.clear();
|
|
1666
|
-
clearNode(this.migrationListContainer);
|
|
1667
|
-
this.migrationClearSettingsContainer = undefined;
|
|
1668
|
-
this.migrationFirstFocusableElement = undefined;
|
|
1669
|
-
this.migrationSectionLists = [];
|
|
1670
|
-
const candidates = this.getMigrationCandidates(category, this.activeMigrationStorage);
|
|
1671
|
-
this.updateCustomizationMigrationPageHeader(category, candidates);
|
|
1672
|
-
this.updateCustomizationMigrationActionState();
|
|
1673
|
-
if (this.customizationMigrationLoading) {
|
|
1674
|
-
this.renderCustomizationMigrationState(( localize(6569, "Loading customizations...")), ( localize(6570, "Checking the active harness and available destinations.")));
|
|
1675
|
-
if (this.migrationMigrateButton) {
|
|
1676
|
-
this.migrationMigrateButton.enabled = false;
|
|
1677
|
-
}
|
|
1678
|
-
this.migrationListScrollable?.scanDomNode();
|
|
1679
|
-
return;
|
|
1680
|
-
}
|
|
1681
|
-
if (this.customizationMigrationLoadError) {
|
|
1682
|
-
this.renderCustomizationMigrationState(( localize(6571, "Customizations could not be loaded")), ( localize(6572, "Check the active agent connection, then try again.")), () => void this.refreshCustomizationMigrationInfo());
|
|
1683
|
-
if (this.migrationMigrateButton) {
|
|
1684
|
-
this.migrationMigrateButton.enabled = false;
|
|
1685
|
-
}
|
|
1686
|
-
return;
|
|
1687
|
-
}
|
|
1688
|
-
if (candidates.length === 0) {
|
|
1689
|
-
this.renderCustomizationMigrationState(
|
|
1690
|
-
category.pageEmptyMessage,
|
|
1691
|
-
category.getPageDescription(candidates, this.getActiveHarnessLabel())
|
|
1692
|
-
);
|
|
1693
|
-
return;
|
|
1694
|
-
}
|
|
1695
|
-
const renderGroup = (groupKey, groupLabel, customizations) => {
|
|
1696
|
-
const group = append(this.migrationListContainer, $(".prompt-migration-group"));
|
|
1697
|
-
const groupHeader = append(group, $(".prompt-migration-group-header"));
|
|
1698
|
-
const groupHeading = append(groupHeader, $(".prompt-migration-group-heading"));
|
|
1699
|
-
const label = append(groupHeading, $("h3.prompt-migration-group-title"));
|
|
1700
|
-
label.textContent = groupLabel;
|
|
1701
|
-
if (customizations.length === 0) {
|
|
1702
|
-
const count = append(groupHeading, $("span.prompt-migration-group-count"));
|
|
1703
|
-
count.textContent = "0";
|
|
1704
|
-
const emptyItems = append(group, $(".prompt-migration-group-items"));
|
|
1705
|
-
append(emptyItems, $(".plugin-inventory-empty.prompt-migration-group-empty")).textContent = ( localize(6573, "No customizations are available to migrate from {0}.", groupLabel));
|
|
1706
|
-
return;
|
|
1707
|
-
}
|
|
1708
|
-
const selectedInGroup = customizations.filter(customization => this.isCustomizationSelectedForMigration(customization)).length;
|
|
1709
|
-
const initialGroupState = selectedInGroup === customizations.length ? true : selectedInGroup === 0 ? false : "mixed";
|
|
1710
|
-
const groupCheckboxAriaLabel = ( localize(6574, "Select all customizations in {0}", groupLabel));
|
|
1711
|
-
const groupCheckbox = this.migrationPageDisposables.add(( new TriStateCheckbox(groupCheckboxAriaLabel, initialGroupState, defaultCheckboxStyles)));
|
|
1712
|
-
const count = append(groupHeading, $("span.prompt-migration-group-count"));
|
|
1713
|
-
count.textContent = String(customizations.length);
|
|
1714
|
-
const groupControls = append(groupHeader, $(".prompt-migration-group-controls"));
|
|
1715
|
-
const groupCheckboxContainer = append(groupControls, $(".item-sync-checkbox.prompt-migration-group-checkbox"));
|
|
1716
|
-
groupCheckboxContainer.replaceChildren(groupCheckbox.domNode);
|
|
1717
|
-
this.migrationFirstFocusableElement ??= groupCheckbox.domNode;
|
|
1718
|
-
const selectAllLabel = append(groupControls, $("span.prompt-migration-select-all-label"));
|
|
1719
|
-
selectAllLabel.textContent = ( localize(6575, "Select all"));
|
|
1720
|
-
const setGroupCheckboxState = state => {
|
|
1721
|
-
groupCheckbox.checked = state;
|
|
1722
|
-
groupCheckbox.domNode.setAttribute("aria-checked", String(state));
|
|
1723
|
-
};
|
|
1724
|
-
setGroupCheckboxState(initialGroupState);
|
|
1725
|
-
const updateGroupCheckboxState = () => {
|
|
1726
|
-
const selectedCount = customizations.filter(customization => this.isCustomizationSelectedForMigration(customization)).length;
|
|
1727
|
-
setGroupCheckboxState(
|
|
1728
|
-
selectedCount === customizations.length ? true : selectedCount === 0 ? false : "mixed"
|
|
1729
|
-
);
|
|
1730
|
-
};
|
|
1731
|
-
const groupId = `prompt-migration-group-${category.id}-${groupKey}`;
|
|
1732
|
-
const groupItems = append(group, $(".prompt-migration-group-items.virtualized-section-list"));
|
|
1733
|
-
groupItems.id = `${groupId}-items`;
|
|
1734
|
-
const sectionKey = `${category.id}:${groupKey}`;
|
|
1735
|
-
const section = this.createMigrationSectionList(
|
|
1736
|
-
groupItems,
|
|
1737
|
-
sectionKey,
|
|
1738
|
-
groupLabel,
|
|
1739
|
-
customizations,
|
|
1740
|
-
updateGroupCheckboxState
|
|
1741
|
-
);
|
|
1742
|
-
const setGroupSelection = selected => {
|
|
1743
|
-
for (const customization of customizations) {
|
|
1744
|
-
this.setCustomizationSelectedForMigration(customization, selected);
|
|
1745
|
-
}
|
|
1746
|
-
this.updateCustomizationMigrationActionState();
|
|
1747
|
-
section.renderer.refreshSelectionState();
|
|
1748
|
-
};
|
|
1749
|
-
this.migrationPageDisposables.add(
|
|
1750
|
-
groupCheckbox.onChange(() => setGroupSelection(groupCheckbox.checked === true))
|
|
1751
|
-
);
|
|
1752
|
-
this.migrationPageDisposables.add(addDisposableListener(selectAllLabel, "click", e => {
|
|
1753
|
-
EventHelper.stop(e, true);
|
|
1754
|
-
const selected = groupCheckbox.checked !== true;
|
|
1755
|
-
setGroupCheckboxState(selected);
|
|
1756
|
-
setGroupSelection(selected);
|
|
1757
|
-
groupCheckbox.focus();
|
|
1758
|
-
}));
|
|
1759
|
-
};
|
|
1760
|
-
const groups = category.group(candidates).filter(
|
|
1761
|
-
group => this.activeMigrationStorage === undefined || group.customizations.length > 0
|
|
1762
|
-
);
|
|
1763
|
-
const groupedCandidates = ( new Set());
|
|
1764
|
-
for (const group of groups) {
|
|
1765
|
-
for (const customization of group.customizations) {
|
|
1766
|
-
groupedCandidates.add(this.getCustomizationMigrationCandidateKey(customization));
|
|
1767
|
-
}
|
|
1768
|
-
renderGroup(group.key, group.label, group.customizations);
|
|
1769
|
-
}
|
|
1770
|
-
const ungroupedCandidates = candidates.filter(candidate => !( groupedCandidates.has(this.getCustomizationMigrationCandidateKey(candidate))));
|
|
1771
|
-
if (ungroupedCandidates.length > 0) {
|
|
1772
|
-
const ungroupedItems = append(
|
|
1773
|
-
this.migrationListContainer,
|
|
1774
|
-
$(".prompt-migration-group-items.virtualized-section-list")
|
|
1775
|
-
);
|
|
1776
|
-
this.createMigrationSectionList(
|
|
1777
|
-
ungroupedItems,
|
|
1778
|
-
`${category.id}:ungrouped`,
|
|
1779
|
-
category.pageTitle,
|
|
1780
|
-
ungroupedCandidates
|
|
1781
|
-
);
|
|
1782
|
-
}
|
|
1783
|
-
if (category.id === CustomizationMigrationCategoryId.ConfiguredLocations) {
|
|
1784
|
-
this.renderConfiguredLocationSettingsGroup();
|
|
1785
|
-
}
|
|
1786
|
-
this.updateCustomizationMigrationActionState();
|
|
1787
|
-
this.restoreCustomizationMigrationFocus();
|
|
1788
|
-
this.scheduleMigrationSectionLayout();
|
|
1789
|
-
}
|
|
1790
|
-
captureCustomizationMigrationFocus() {
|
|
1791
|
-
const activeElement = this.migrationListContainer ? getWindow(this.migrationListContainer).document.activeElement : undefined;
|
|
1792
|
-
if (!isHTMLElement(activeElement)) {
|
|
1793
|
-
return undefined;
|
|
1794
|
-
}
|
|
1795
|
-
for (const section of this.migrationSectionLists) {
|
|
1796
|
-
const index = section.renderer.getIndex(activeElement);
|
|
1797
|
-
if (index === undefined) {
|
|
1798
|
-
continue;
|
|
1799
|
-
}
|
|
1800
|
-
const candidate = section.items[index];
|
|
1801
|
-
if (candidate) {
|
|
1802
|
-
const controls = section.renderer.getControls(index);
|
|
1803
|
-
const controlIndex = controls.findIndex(control => control === activeElement || control.contains(activeElement));
|
|
1804
|
-
return {
|
|
1805
|
-
candidateKey: this.getCustomizationMigrationCandidateKey(candidate),
|
|
1806
|
-
controlIndex: Math.max(0, controlIndex)
|
|
1807
|
-
};
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
return undefined;
|
|
1811
|
-
}
|
|
1812
|
-
restoreCustomizationMigrationFocus() {
|
|
1813
|
-
const focusState = this.migrationFocusState;
|
|
1814
|
-
if (!focusState) {
|
|
1815
|
-
return;
|
|
1816
|
-
}
|
|
1817
|
-
this.migrationFocusState = undefined;
|
|
1818
|
-
for (const section of this.migrationSectionLists) {
|
|
1819
|
-
const index = section.items.findIndex(
|
|
1820
|
-
candidate => this.getCustomizationMigrationCandidateKey(candidate) === focusState.candidateKey
|
|
1821
|
-
);
|
|
1822
|
-
if (index < 0) {
|
|
1823
|
-
continue;
|
|
1824
|
-
}
|
|
1825
|
-
section.list.setFocus([index]);
|
|
1826
|
-
section.list.reveal(index);
|
|
1827
|
-
section.renderer.getControls(index)[focusState.controlIndex]?.focus();
|
|
1828
|
-
return;
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
renderConfiguredLocationSettingsGroup() {
|
|
1832
|
-
if (!this.migrationListContainer || !this.migrationClearSettingsCheckbox) {
|
|
1833
|
-
return;
|
|
1834
|
-
}
|
|
1835
|
-
const group = append(
|
|
1836
|
-
this.migrationListContainer,
|
|
1837
|
-
$(".prompt-migration-group.prompt-migration-settings-group")
|
|
1838
|
-
);
|
|
1839
|
-
const groupHeader = append(group, $(".prompt-migration-group-header"));
|
|
1840
|
-
const groupHeading = append(groupHeader, $(".prompt-migration-group-heading"));
|
|
1841
|
-
const settingsGroupLabel = ( localize(6576, "Settings"));
|
|
1842
|
-
append(groupHeading, $("h3.prompt-migration-group-title")).textContent = settingsGroupLabel;
|
|
1843
|
-
const groupItems = append(group, $(".prompt-migration-group-items"));
|
|
1844
|
-
const item = this.migrationClearSettingsContainer = append(groupItems, $(".prompt-migration-settings-item"));
|
|
1845
|
-
const checkboxContainer = append(item, $(".item-sync-checkbox.prompt-migration-checkbox"));
|
|
1846
|
-
checkboxContainer.replaceChildren(this.migrationClearSettingsCheckbox.domNode);
|
|
1847
|
-
const itemText = append(item, $("span.prompt-migration-settings-item-text"));
|
|
1848
|
-
const label = append(itemText, $("span.prompt-migration-settings-item-label"));
|
|
1849
|
-
label.textContent = ( localize(6577, "Clear unused location settings"));
|
|
1850
|
-
const description = append(itemText, $("span.prompt-migration-settings-item-description"));
|
|
1851
|
-
description.textContent = ( localize(
|
|
1852
|
-
6578,
|
|
1853
|
-
"Remove deprecated settings that are no longer needed after the selected customizations migrate successfully."
|
|
1854
|
-
));
|
|
1855
|
-
this.migrationPageDisposables.add(addDisposableListener(itemText, "click", () => {
|
|
1856
|
-
if (!this.migrationClearSettingsCheckbox?.enabled) {
|
|
1857
|
-
return;
|
|
1858
|
-
}
|
|
1859
|
-
this.migrationClearSettingsCheckbox.checked = !this.migrationClearSettingsCheckbox.checked;
|
|
1860
|
-
this.migrationClearSettingsCheckbox.focus();
|
|
1861
|
-
}));
|
|
1862
|
-
}
|
|
1863
|
-
createMigrationSectionList(container, key, label, items, onSelectionChange) {
|
|
1864
|
-
container.style.height = `${MIGRATION_ITEM_HEIGHT}px`;
|
|
1865
|
-
const category = this.getActiveMigrationCategory() ?? CUSTOMIZATION_MIGRATION_CATEGORIES[0];
|
|
1866
|
-
const renderer = ( new MigrationItemRenderer(
|
|
1867
|
-
customization => this.isCustomizationSelectedForMigration(customization),
|
|
1868
|
-
customization => category.getCandidatePresentation(customization, uri => this.labelService.getUriLabel(uri, {
|
|
1869
|
-
relative: true
|
|
1870
|
-
})),
|
|
1871
|
-
(customization, selected) => {
|
|
1872
|
-
this.setCustomizationSelectedForMigration(customization, selected);
|
|
1873
|
-
this.updateCustomizationMigrationActionState();
|
|
1874
|
-
onSelectionChange?.();
|
|
1875
|
-
},
|
|
1876
|
-
customization => {
|
|
1877
|
-
const isWorkspaceFile = customization.storage === PromptsStorage.local;
|
|
1878
|
-
void this.showEmbeddedEditor(
|
|
1879
|
-
customization.uri,
|
|
1880
|
-
customization.name ?? basename(customization.uri),
|
|
1881
|
-
customization.type,
|
|
1882
|
-
customization.storage,
|
|
1883
|
-
isWorkspaceFile
|
|
1884
|
-
);
|
|
1885
|
-
},
|
|
1886
|
-
(customization, anchor) => this.showCustomizationMigrationItemActions(customization, anchor),
|
|
1887
|
-
element => this.migrationFirstFocusableElement ??= element,
|
|
1888
|
-
this.hoverService
|
|
1889
|
-
));
|
|
1890
|
-
const list = this.migrationPageDisposables.add(this.instantiationService.createInstance(
|
|
1891
|
-
WorkbenchList,
|
|
1892
|
-
`CustomizationMigration.${label}`,
|
|
1893
|
-
container,
|
|
1894
|
-
( new MigrationItemDelegate()),
|
|
1895
|
-
[renderer],
|
|
1896
|
-
{
|
|
1897
|
-
multipleSelectionSupport: false,
|
|
1898
|
-
horizontalScrolling: false,
|
|
1899
|
-
accessibilityProvider: {
|
|
1900
|
-
getWidgetAriaLabel: () => label,
|
|
1901
|
-
getAriaLabel: customization => {
|
|
1902
|
-
const presentation = category.getCandidatePresentation(customization, uri => this.labelService.getUriLabel(uri, {
|
|
1903
|
-
relative: true
|
|
1904
|
-
}));
|
|
1905
|
-
return localize(6579, "{0}, {1}", presentation.name, presentation.pathLabel);
|
|
1906
|
-
},
|
|
1907
|
-
getSetSize: (_element, _index, listLength) => listLength,
|
|
1908
|
-
getPosInSet: (_element, index) => index + 1
|
|
1909
|
-
},
|
|
1910
|
-
identityProvider: {
|
|
1911
|
-
getId: customization => this.getCustomizationMigrationCandidateKey(customization)
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
));
|
|
1915
|
-
list.splice(0, 0, items);
|
|
1916
|
-
list.scrollTop = this.migrationSectionScrollPositions?.get(key) ?? 0;
|
|
1917
|
-
this.migrationPageDisposables.add(list.onDidChangeSelection(event => {
|
|
1918
|
-
if (event.indexes.length > 0) {
|
|
1919
|
-
list.setSelection([]);
|
|
1920
|
-
}
|
|
1921
|
-
}));
|
|
1922
|
-
this.migrationPageDisposables.add(
|
|
1923
|
-
addStandardDisposableListener(container, EventType.KEY_DOWN, event => {
|
|
1924
|
-
if (event.keyCode !== KeyCode.Tab) {
|
|
1925
|
-
return;
|
|
1926
|
-
}
|
|
1927
|
-
const target = event.target;
|
|
1928
|
-
if (!isHTMLElement(target)) {
|
|
1929
|
-
return;
|
|
1930
|
-
}
|
|
1931
|
-
const index = renderer.getIndex(target);
|
|
1932
|
-
if (index === undefined) {
|
|
1933
|
-
return;
|
|
1934
|
-
}
|
|
1935
|
-
const controls = renderer.getControls(index);
|
|
1936
|
-
const controlIndex = controls.findIndex(control => control === target || control.contains(target));
|
|
1937
|
-
const targetIndex = event.shiftKey ? index - 1 : index + 1;
|
|
1938
|
-
const crossesRowBoundary = event.shiftKey ? controlIndex === 0 : controlIndex === controls.length - 1;
|
|
1939
|
-
if (!crossesRowBoundary || targetIndex < 0 || targetIndex >= items.length) {
|
|
1940
|
-
return;
|
|
1941
|
-
}
|
|
1942
|
-
event.preventDefault();
|
|
1943
|
-
event.stopPropagation();
|
|
1944
|
-
list.setFocus([targetIndex]);
|
|
1945
|
-
list.reveal(targetIndex);
|
|
1946
|
-
const targetControls = renderer.getControls(targetIndex);
|
|
1947
|
-
targetControls[event.shiftKey ? targetControls.length - 1 : 0]?.focus();
|
|
1948
|
-
})
|
|
1949
|
-
);
|
|
1950
|
-
const section = {
|
|
1951
|
-
list,
|
|
1952
|
-
renderer,
|
|
1953
|
-
container,
|
|
1954
|
-
items,
|
|
1955
|
-
key
|
|
1956
|
-
};
|
|
1957
|
-
this.migrationSectionLists.push(section);
|
|
1958
|
-
return section;
|
|
1959
|
-
}
|
|
1960
|
-
showCustomizationMigrationItemActions(customization, anchor) {
|
|
1961
|
-
const actions = ( new DisposableStore());
|
|
1962
|
-
const deleteAction = actions.add(( new Action("customizationMigration.delete", ( localize(6580, "Delete")), ThemeIcon.asClassName(Codicon.trash), true, () => this.deleteCustomizationFile(customization))));
|
|
1963
|
-
this.contextMenuService.showContextMenu({
|
|
1964
|
-
getAnchor: () => anchor,
|
|
1965
|
-
getActions: () => [deleteAction],
|
|
1966
|
-
onHide: () => actions.dispose()
|
|
1967
|
-
});
|
|
1968
|
-
}
|
|
1969
|
-
layoutMigrationSectionLists() {
|
|
1970
|
-
if (!this.migrationListContainer) {
|
|
1971
|
-
return;
|
|
1972
|
-
}
|
|
1973
|
-
const heights = layoutVirtualizedSections(this.migrationListContainer, ( this.migrationSectionLists.map(section => ({
|
|
1974
|
-
container: section.container,
|
|
1975
|
-
contentHeight: section.items.length * MIGRATION_ITEM_HEIGHT,
|
|
1976
|
-
minimumHeight: getVirtualizedSectionMinimumHeight(section.items, () => MIGRATION_ITEM_HEIGHT)
|
|
1977
|
-
}))));
|
|
1978
|
-
for (let index = 0; index < this.migrationSectionLists.length; index++) {
|
|
1979
|
-
const section = this.migrationSectionLists[index];
|
|
1980
|
-
const height = heights[index];
|
|
1981
|
-
layoutVirtualizedSectionList(
|
|
1982
|
-
section.list,
|
|
1983
|
-
section.container,
|
|
1984
|
-
height,
|
|
1985
|
-
section.container.clientWidth || undefined
|
|
1986
|
-
);
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
scheduleMigrationSectionLayout() {
|
|
1990
|
-
this.migrationDashboardScrollable?.scanDomNode();
|
|
1991
|
-
if (this.migrationContentContainer?.style.display === "none") {
|
|
1992
|
-
this.pendingMigrationLayout?.clear();
|
|
1993
|
-
return;
|
|
1994
|
-
}
|
|
1995
|
-
if (!this.pendingMigrationLayout) {
|
|
1996
|
-
this.layoutMigrationSectionLists();
|
|
1997
|
-
this.migrationListScrollable?.scanDomNode();
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
if (!this.migrationListContainer) {
|
|
2001
|
-
this.pendingMigrationLayout.clear();
|
|
2002
|
-
return;
|
|
2003
|
-
}
|
|
2004
|
-
this.pendingMigrationLayout.value = scheduleAtNextAnimationFrame(getWindow(this.migrationListContainer), () => {
|
|
2005
|
-
this.layoutMigrationSectionLists();
|
|
2006
|
-
this.migrationListScrollable?.scanDomNode();
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
renderCustomizationMigrationDashboardState() {
|
|
2010
|
-
if (!this.migrationDashboard) {
|
|
2011
|
-
return;
|
|
2012
|
-
}
|
|
2013
|
-
if (this.customizationMigrationLoading) {
|
|
2014
|
-
this.migrationDashboard.showLoading(( localize(6569, "Loading customizations...")), ( localize(6570, "Checking the active harness and available destinations.")));
|
|
2015
|
-
return;
|
|
2016
|
-
}
|
|
2017
|
-
if (this.customizationMigrationLoadError) {
|
|
2018
|
-
this.migrationDashboard.showLoading(( localize(6571, "Customizations could not be loaded")), ( localize(6572, "Check the active agent connection, then try again.")), () => void this.refreshCustomizationMigrationInfo());
|
|
2019
|
-
this.migrationListScrollable?.scanDomNode();
|
|
2020
|
-
return;
|
|
2021
|
-
}
|
|
2022
|
-
this.renderCustomizationMigrationDashboard();
|
|
2023
|
-
}
|
|
2024
|
-
renderCustomizationMigrationDashboard() {
|
|
2025
|
-
if (!this.migrationDashboard) {
|
|
2026
|
-
return;
|
|
2027
|
-
}
|
|
2028
|
-
this.migrationDashboard.showOverview(this.getCustomizationMigrationDashboardOverview());
|
|
2029
|
-
this.migrationDashboardScrollable?.scanDomNode();
|
|
2030
|
-
this.migrationListScrollable?.scanDomNode();
|
|
2031
|
-
}
|
|
2032
|
-
getMigrationAccessibilityContent() {
|
|
2033
|
-
if (this.viewMode !== "migration" || this.activeMigrationCategoryId || !this.migrationDashboard || !isAncestorOfActiveElement(this.migrationDashboard.element)) {
|
|
2034
|
-
return undefined;
|
|
2035
|
-
}
|
|
2036
|
-
const overview = this.getCustomizationMigrationDashboardOverview();
|
|
2037
|
-
return [( localize(6581, "Your migration checklist")), ...( overview.scopes.map(scope => [scope.label, scope.skipped ? ( localize(6582, "Skipped")) : scope.count === 0 ? ( localize(6583, "No remaining migrations.")) : "", ...(scope.skipped ? [] : ( scope.categories.map(category => ( localize(
|
|
2038
|
-
6584,
|
|
2039
|
-
"{0}: {1}. {2}{3}",
|
|
2040
|
-
category.label,
|
|
2041
|
-
category.countLabel,
|
|
2042
|
-
category.highRisk ? ( localize(6585, "High risk. ")) : "",
|
|
2043
|
-
category.description
|
|
2044
|
-
)))))].filter(Boolean).join("\n"))), ...( overview.activity.map(entry => [( localize(
|
|
2045
|
-
6586,
|
|
2046
|
-
"Migration activity: {0}, {1}",
|
|
2047
|
-
entry.categoryLabel,
|
|
2048
|
-
entry.scopeLabel
|
|
2049
|
-
)), ...( entry.items.map(item => ( localize(
|
|
2050
|
-
6587,
|
|
2051
|
-
"{0}: from {1} to {2}",
|
|
2052
|
-
item.label,
|
|
2053
|
-
item.sourceLabel,
|
|
2054
|
-
item.targetLabel
|
|
2055
|
-
))))].join("\n")))].join("\n\n");
|
|
2056
|
-
}
|
|
2057
|
-
getCustomizationMigrationDashboardOverview() {
|
|
2058
|
-
const storages = [PromptsStorage.user];
|
|
2059
|
-
if (this.workspaceService.activeProjectRoot.get()) {
|
|
2060
|
-
storages.push(PromptsStorage.local);
|
|
2061
|
-
}
|
|
2062
|
-
const scopes = ( storages.map(storage => {
|
|
2063
|
-
const categories = homepageMigrationCategories.flatMap(id => {
|
|
2064
|
-
const candidates = this.getMigrationCandidates(getCustomizationMigrationCategory(id), storage);
|
|
2065
|
-
return candidates.length ? [this.getHomepageMigrationCategory(id, candidates)] : [];
|
|
2066
|
-
});
|
|
2067
|
-
return {
|
|
2068
|
-
storage,
|
|
2069
|
-
label: this.getMigrationScopeLabel(storage),
|
|
2070
|
-
count: categories.reduce((count, category) => count + category.count, 0),
|
|
2071
|
-
skipped: storage === PromptsStorage.local && this.migrationWorkspaceSkipped,
|
|
2072
|
-
started: this.getMigrationActivityState(storage).started === true,
|
|
2073
|
-
hasConfigurableDestinations: ( categories.some(category => category.id !== CustomizationMigrationCategoryId.McpServers)),
|
|
2074
|
-
categories
|
|
2075
|
-
};
|
|
2076
|
-
}));
|
|
2077
|
-
return {
|
|
2078
|
-
scopes,
|
|
2079
|
-
activity: storages.flatMap(storage => this.getMigrationActivityState(storage).activity).sort((a, b) => b.id.localeCompare(a.id)),
|
|
2080
|
-
result: this.migrationResult
|
|
2081
|
-
};
|
|
2082
|
-
}
|
|
2083
|
-
getHomepageMigrationCategory(id, candidates) {
|
|
2084
|
-
const count = candidates.length;
|
|
2085
|
-
switch (id) {
|
|
2086
|
-
case CustomizationMigrationCategoryId.PromptFiles:
|
|
2087
|
-
return {
|
|
2088
|
-
id,
|
|
2089
|
-
count,
|
|
2090
|
-
label: ( localize(6588, "Prompts to skills")),
|
|
2091
|
-
description: ( localize(
|
|
2092
|
-
6589,
|
|
2093
|
-
"Convert reusable prompt files into skills so agents can discover and run them as supported customizations."
|
|
2094
|
-
)),
|
|
2095
|
-
countLabel: count === 1 ? ( localize(6590, "1 prompt")) : ( localize(6591, "{0} prompts", count)),
|
|
2096
|
-
highRisk: true
|
|
2097
|
-
};
|
|
2098
|
-
case CustomizationMigrationCategoryId.McpServers:
|
|
2099
|
-
return {
|
|
2100
|
-
id,
|
|
2101
|
-
count,
|
|
2102
|
-
label: ( localize(6592, "MCP Servers")),
|
|
2103
|
-
description: ( localize(
|
|
2104
|
-
6593,
|
|
2105
|
-
"Move supported workspace servers to the root .mcp.json so agents can discover them directly."
|
|
2106
|
-
)),
|
|
2107
|
-
countLabel: count === 1 ? ( localize(6594, "1 server")) : ( localize(6595, "{0} servers", count))
|
|
2108
|
-
};
|
|
2109
|
-
case CustomizationMigrationCategoryId.UserData:
|
|
2110
|
-
{
|
|
2111
|
-
const agents = candidates.filter(candidate => candidate.type === PromptsType.agent).length;
|
|
2112
|
-
const instructions = candidates.filter(candidate => candidate.type === PromptsType.instructions).length;
|
|
2113
|
-
const counts = [];
|
|
2114
|
-
if (agents) {
|
|
2115
|
-
counts.push(agents === 1 ? ( localize(6596, "1 agent")) : ( localize(6597, "{0} agents", agents)));
|
|
2116
|
-
}
|
|
2117
|
-
if (instructions) {
|
|
2118
|
-
counts.push(instructions === 1 ? ( localize(6598, "1 instruction")) : ( localize(6599, "{0} instructions", instructions)));
|
|
2119
|
-
}
|
|
2120
|
-
return {
|
|
2121
|
-
id,
|
|
2122
|
-
count,
|
|
2123
|
-
label: ( localize(6600, "User Data")),
|
|
2124
|
-
description: ( localize(
|
|
2125
|
-
6601,
|
|
2126
|
-
"Move agents and instructions to shared locations so they remain available to supported agent experiences."
|
|
2127
|
-
)),
|
|
2128
|
-
countLabel: counts.join(" · ")
|
|
2129
|
-
};
|
|
2130
|
-
}
|
|
2131
|
-
default:
|
|
2132
|
-
throw ( new Error(`Unsupported migration checklist category: ${id}`));
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
getMigrationScopeLabel(storage) {
|
|
2136
|
-
return storage === PromptsStorage.user ? ( localize(6602, "Your profile")) : this.workspaceService.activeProjectLabel.get() || ( localize(6603, "Workspace"));
|
|
2137
|
-
}
|
|
2138
|
-
getMigrationActivityKey(storage) {
|
|
2139
|
-
const project = this.workspaceService.activeProjectRoot.get();
|
|
2140
|
-
return storage === PromptsStorage.user ? `chat.customizationMigration.activity.profile.${this.harnessService.activeHarness.get()}` : `chat.customizationMigration.activity.workspace.${project ? getComparisonKey(project) : ""}.${this.harnessService.activeHarness.get()}`;
|
|
2141
|
-
}
|
|
2142
|
-
getMigrationActivityState(storage) {
|
|
2143
|
-
return this.storageService.getObject(this.getMigrationActivityKey(storage), StorageScope.PROFILE, {
|
|
2144
|
-
activity: [],
|
|
2145
|
-
skipped: false
|
|
2146
|
-
});
|
|
2147
|
-
}
|
|
2148
|
-
getMigrationActivityContexts() {
|
|
2149
|
-
return ( [PromptsStorage.user, PromptsStorage.local].map(storage => this.getMigrationActivityContext(storage)));
|
|
2150
|
-
}
|
|
2151
|
-
getMigrationActivityContext(storage) {
|
|
2152
|
-
return {
|
|
2153
|
-
storage,
|
|
2154
|
-
key: this.getMigrationActivityKey(storage),
|
|
2155
|
-
label: this.getMigrationScopeLabel(storage)
|
|
2156
|
-
};
|
|
2157
|
-
}
|
|
2158
|
-
recordMigrationActivity(category, context, items) {
|
|
2159
|
-
if (!items.length || !( homepageMigrationCategories.some(id => id === category.id))) {
|
|
2160
|
-
return;
|
|
2161
|
-
}
|
|
2162
|
-
const state = this.storageService.getObject(context.key, StorageScope.PROFILE, {
|
|
2163
|
-
activity: [],
|
|
2164
|
-
skipped: false
|
|
2165
|
-
});
|
|
2166
|
-
const entry = {
|
|
2167
|
-
id: `${Date.now()}-${generateUuid()}`,
|
|
2168
|
-
categoryLabel: this.getHomepageMigrationCategory(category.id, []).label,
|
|
2169
|
-
scopeLabel: context.label,
|
|
2170
|
-
storage: context.storage,
|
|
2171
|
-
items
|
|
2172
|
-
};
|
|
2173
|
-
this.storageService.store(context.key, {
|
|
2174
|
-
...state,
|
|
2175
|
-
started: true,
|
|
2176
|
-
activity: [entry, ...state.activity]
|
|
2177
|
-
}, StorageScope.PROFILE, StorageTarget.MACHINE);
|
|
2178
|
-
if (context.key === this.getMigrationActivityKey(context.storage)) {
|
|
2179
|
-
this.migrationResult = {
|
|
2180
|
-
migratedCount: (this.migrationResult?.migratedCount ?? 0) + items.length
|
|
2181
|
-
};
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
storeMigrationActivityState(storage, state) {
|
|
2185
|
-
this.storageService.store(
|
|
2186
|
-
this.getMigrationActivityKey(storage),
|
|
2187
|
-
state,
|
|
2188
|
-
StorageScope.PROFILE,
|
|
2189
|
-
StorageTarget.MACHINE
|
|
2190
|
-
);
|
|
2191
|
-
}
|
|
2192
|
-
getCustomizationMigrationDashboardDestinations(customizations) {
|
|
2193
|
-
const destinations = ( new Map());
|
|
2194
|
-
for (const customization of customizations) {
|
|
2195
|
-
const targetType = getCustomizationMigrationTargetType(customization);
|
|
2196
|
-
const key = this.getCustomizationMigrationTargetKey(targetType, customization.storage);
|
|
2197
|
-
if (( destinations.has(key))) {
|
|
2198
|
-
continue;
|
|
2199
|
-
}
|
|
2200
|
-
const folder = this.selectedCustomizationMigrationTargets.get(key);
|
|
2201
|
-
const contextLabel = this.getCustomizationMigrationDestinationContextLabel(targetType, customization.storage);
|
|
2202
|
-
if (!folder) {
|
|
2203
|
-
const label = ( localize(6604, "Not configured"));
|
|
2204
|
-
destinations.set(key, {
|
|
2205
|
-
targetType,
|
|
2206
|
-
storage: customization.storage,
|
|
2207
|
-
contextLabel,
|
|
2208
|
-
label,
|
|
2209
|
-
ariaLabel: ( localize(6605, "Configure destination for {0}", contextLabel))
|
|
2210
|
-
});
|
|
2211
|
-
continue;
|
|
2212
|
-
}
|
|
2213
|
-
const folderLabel = this.getCustomizationMigrationFolderLabel(folder);
|
|
2214
|
-
destinations.set(key, {
|
|
2215
|
-
targetType,
|
|
2216
|
-
storage: customization.storage,
|
|
2217
|
-
contextLabel,
|
|
2218
|
-
label: folderLabel,
|
|
2219
|
-
ariaLabel: ( localize(
|
|
2220
|
-
6606,
|
|
2221
|
-
"Change destination for {0}, currently {1}",
|
|
2222
|
-
contextLabel,
|
|
2223
|
-
folderLabel
|
|
2224
|
-
))
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
|
-
return [...( destinations.values())];
|
|
2228
|
-
}
|
|
2229
|
-
async configureCustomizationMigrationLocations(storage) {
|
|
2230
|
-
const sessionResource = this.harnessService.activeSessionResource.get();
|
|
2231
|
-
const destinations = this.getCustomizationMigrationDashboardDestinations(
|
|
2232
|
-
this.getDashboardFileMigrationCandidates().filter(candidate => candidate.storage === storage)
|
|
2233
|
-
);
|
|
2234
|
-
if (destinations.length === 0) {
|
|
2235
|
-
this.notificationService.info(( localize(
|
|
2236
|
-
6607,
|
|
2237
|
-
"There are no file migration destinations to configure. MCP servers migrate to the workspace root .mcp.json."
|
|
2238
|
-
)));
|
|
2239
|
-
return;
|
|
2240
|
-
}
|
|
2241
|
-
const selected = await this.quickInputService.pick(( destinations.map(destination => ({
|
|
2242
|
-
label: destination.contextLabel,
|
|
2243
|
-
description: destination.label,
|
|
2244
|
-
destination
|
|
2245
|
-
}))), {
|
|
2246
|
-
canPickMany: false,
|
|
2247
|
-
placeHolder: ( localize(6608, "Choose a migration location to customize")),
|
|
2248
|
-
matchOnDescription: true
|
|
2249
|
-
});
|
|
2250
|
-
if (selected && this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
2251
|
-
await this.chooseCustomizationMigrationDestination(selected.destination);
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
getCustomizationMigrationDestinationContextLabel(targetType, storage) {
|
|
2255
|
-
const scope = storage === PromptsStorage.local ? ( localize(6609, "Workspace")) : ( localize(6610, "User"));
|
|
2256
|
-
switch (targetType) {
|
|
2257
|
-
case PromptsType.skill:
|
|
2258
|
-
return localize(6611, "{0} skills", scope);
|
|
2259
|
-
case PromptsType.agent:
|
|
2260
|
-
return localize(6612, "{0} agents", scope);
|
|
2261
|
-
default:
|
|
2262
|
-
return localize(6613, "{0} instructions", scope);
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
async chooseCustomizationMigrationDestination(destination) {
|
|
2266
|
-
const sessionResource = this.harnessService.activeSessionResource.get();
|
|
2267
|
-
const key = this.getCustomizationMigrationTargetKey(destination.targetType, destination.storage);
|
|
2268
|
-
const currentFolder = this.selectedCustomizationMigrationTargets.get(key);
|
|
2269
|
-
const availableFolders = this.getCustomizationMigrationFolders(destination.targetType, destination.storage);
|
|
2270
|
-
const picks = ( availableFolders.map(folder => ({
|
|
2271
|
-
label: folder.label,
|
|
2272
|
-
description: this.getCustomizationMigrationFolderPickDescription(folder, this.getCustomizationMigrationFolderLabel(folder)),
|
|
2273
|
-
picked: currentFolder ? isEqual(folder.uri, currentFolder.uri) : false,
|
|
2274
|
-
folder
|
|
2275
|
-
})));
|
|
2276
|
-
picks.push({
|
|
2277
|
-
label: ( localize(6614, "Choose another folder...")),
|
|
2278
|
-
description: ( localize(6615, "Use a custom migration destination")),
|
|
2279
|
-
chooseAnother: true
|
|
2280
|
-
});
|
|
2281
|
-
const selected = await this.quickInputService.pick(picks, {
|
|
2282
|
-
canPickMany: false,
|
|
2283
|
-
placeHolder: ( localize(6616, "Choose a destination for {0}", destination.contextLabel)),
|
|
2284
|
-
matchOnDescription: true
|
|
2285
|
-
});
|
|
2286
|
-
if (!selected || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
2287
|
-
return;
|
|
2288
|
-
}
|
|
2289
|
-
let folder = selected.folder;
|
|
2290
|
-
if (selected.chooseAnother) {
|
|
2291
|
-
const folders = await this.fileDialogService.showOpenDialog({
|
|
2292
|
-
title: ( localize(6617, "Choose a Custom Migration Destination")),
|
|
2293
|
-
openLabel: ( localize(6618, "Select Folder")),
|
|
2294
|
-
canSelectFiles: false,
|
|
2295
|
-
canSelectFolders: true,
|
|
2296
|
-
canSelectMany: false,
|
|
2297
|
-
defaultUri: currentFolder?.uri
|
|
2298
|
-
});
|
|
2299
|
-
const uri = folders?.[0];
|
|
2300
|
-
if (!uri || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
2301
|
-
return;
|
|
2302
|
-
}
|
|
2303
|
-
folder = {
|
|
2304
|
-
uri,
|
|
2305
|
-
label: this.labelService.getUriLabel(uri, {
|
|
2306
|
-
relative: true
|
|
2307
|
-
}),
|
|
2308
|
-
source: destination.storage
|
|
2309
|
-
};
|
|
2310
|
-
}
|
|
2311
|
-
if (!folder) {
|
|
2312
|
-
return;
|
|
2313
|
-
}
|
|
2314
|
-
this.selectedCustomizationMigrationTargets.set(key, folder);
|
|
2315
|
-
this.explicitlySelectedCustomizationMigrationTargets.add(key);
|
|
2316
|
-
this.renderCustomizationMigrationPage();
|
|
2317
|
-
}
|
|
2318
|
-
renderCustomizationMigrationState(title, description, retry) {
|
|
2319
|
-
const state = append(
|
|
2320
|
-
this.migrationListContainer,
|
|
2321
|
-
$(".plugin-inventory-empty.prompt-migration-state")
|
|
2322
|
-
);
|
|
2323
|
-
append(state, $("strong.prompt-migration-state-title")).textContent = title;
|
|
2324
|
-
append(state, $("span.prompt-migration-state-description")).textContent = description;
|
|
2325
|
-
if (retry) {
|
|
2326
|
-
const retryButton = this.migrationPageDisposables.add(( new Button(state, {
|
|
2327
|
-
...defaultButtonStyles,
|
|
2328
|
-
secondary: true,
|
|
2329
|
-
ariaLabel: ( localize(6619, "Retry loading customizations"))
|
|
2330
|
-
})));
|
|
2331
|
-
retryButton.label = ( localize(6620, "Retry"));
|
|
2332
|
-
this.migrationFirstFocusableElement ??= retryButton.element;
|
|
2333
|
-
this.migrationPageDisposables.add(retryButton.onDidClick(retry));
|
|
2334
|
-
}
|
|
2335
|
-
this.migrationListScrollable?.scanDomNode();
|
|
2336
|
-
}
|
|
2337
|
-
updateCustomizationMigrationPageHeader(category, candidates) {
|
|
2338
|
-
if (this.migrationHeader) {
|
|
2339
|
-
this.migrationHeader.style.display = "";
|
|
2340
|
-
}
|
|
2341
|
-
if (this.migrationBackButton) {
|
|
2342
|
-
this.migrationBackButton.style.display = "";
|
|
2343
|
-
}
|
|
2344
|
-
if (this.migrationFooter) {
|
|
2345
|
-
this.migrationFooter.style.display = "";
|
|
2346
|
-
}
|
|
2347
|
-
if (this.migrationTitleElement) {
|
|
2348
|
-
this.migrationTitleElement.textContent = category.pageTitle;
|
|
2349
|
-
}
|
|
2350
|
-
const banner = candidates.length > 0 ? category.getBanner?.(
|
|
2351
|
-
candidates,
|
|
2352
|
-
this.getActiveHarnessLabel(),
|
|
2353
|
-
this.getCustomizationMigrationDestinationLabel(candidates.filter(
|
|
2354
|
-
customization => !isMcpServerCustomizationMigrationCandidate(customization)
|
|
2355
|
-
).flatMap(customization => {
|
|
2356
|
-
const targetType = getCustomizationMigrationTargetType(customization);
|
|
2357
|
-
return this.customizationMigrationTargetFoldersByType.get(targetType)?.filter(folder => folder.source === customization.storage) ?? [];
|
|
2358
|
-
})),
|
|
2359
|
-
category.getModifiedSettingIds?.(this.configurationService) ?? []
|
|
2360
|
-
) : undefined;
|
|
2361
|
-
this.renderCustomizationMigrationBanner(banner);
|
|
2362
|
-
if (this.migrationDescriptionElement) {
|
|
2363
|
-
const description = banner ? "" : category.getPageDescription(candidates, this.getActiveHarnessLabel());
|
|
2364
|
-
if (this.migrationDescriptionTextElement) {
|
|
2365
|
-
this.migrationDescriptionTextElement.textContent = description;
|
|
2366
|
-
} else {
|
|
2367
|
-
this.migrationDescriptionElement.textContent = description;
|
|
2368
|
-
}
|
|
2369
|
-
this.migrationDescriptionElement.style.display = banner ? "none" : "";
|
|
2370
|
-
}
|
|
2371
|
-
if (this.migrationLinkElement) {
|
|
2372
|
-
this.migrationLinkElement.style.display = "";
|
|
2373
|
-
this.migrationLinkElement.textContent = category.pageLinkLabel;
|
|
2374
|
-
this.migrationLinkElement.href = category.pageLinkUrl;
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
|
-
renderCustomizationMigrationBanner(banner) {
|
|
2378
|
-
const container = this.migrationBannerContainer;
|
|
2379
|
-
if (!container) {
|
|
2380
|
-
return;
|
|
2381
|
-
}
|
|
2382
|
-
this.migrationBannerDisposables.clear();
|
|
2383
|
-
clearNode(container);
|
|
2384
|
-
if (!banner) {
|
|
2385
|
-
if (this.migrationLinkElement && this.migrationDescriptionElement) {
|
|
2386
|
-
this.migrationDescriptionElement.appendChild(this.migrationLinkElement);
|
|
2387
|
-
}
|
|
2388
|
-
container.style.display = "none";
|
|
2389
|
-
return;
|
|
2390
|
-
}
|
|
2391
|
-
container.style.display = "";
|
|
2392
|
-
const content = append(container, $(".customization-migration-banner-content"));
|
|
2393
|
-
if (isMarkdownString(banner.message)) {
|
|
2394
|
-
const renderedMessage = this.migrationBannerDisposables.add(this.markdownRendererService.render(banner.message));
|
|
2395
|
-
renderedMessage.element.classList.add("customization-migration-banner-message");
|
|
2396
|
-
content.appendChild(renderedMessage.element);
|
|
2397
|
-
} else {
|
|
2398
|
-
append(content, $("p.customization-migration-banner-message")).textContent = banner.message;
|
|
2399
|
-
}
|
|
2400
|
-
if (banner.consequence) {
|
|
2401
|
-
append(content, $("p.customization-migration-banner-consequence")).textContent = banner.consequence;
|
|
2402
|
-
}
|
|
2403
|
-
if (this.migrationLinkElement) {
|
|
2404
|
-
content.appendChild(this.migrationLinkElement);
|
|
2405
|
-
}
|
|
2406
|
-
}
|
|
2407
|
-
updateCustomizationMigrationActionState() {
|
|
2408
|
-
if (!this.migrationMigrateButton) {
|
|
2409
|
-
return;
|
|
2410
|
-
}
|
|
2411
|
-
const category = this.getActiveMigrationCategory();
|
|
2412
|
-
if (!category) {
|
|
2413
|
-
this.migrationMigrateButton.enabled = false;
|
|
2414
|
-
return;
|
|
2415
|
-
}
|
|
2416
|
-
const selectedCount = this.getMigrationCandidates(category, this.activeMigrationStorage).filter(customization => this.isCustomizationSelectedForMigration(customization)).length;
|
|
2417
|
-
this.migrationMigrateButton.enabled = selectedCount > 0 && !this.customizationMigrationInProgress;
|
|
2418
|
-
if (this.migrationClearSettingsCheckbox) {
|
|
2419
|
-
const hasModifiedSettings = this.getModifiedConfiguredLocationSettingIds(category).length > 0;
|
|
2420
|
-
const canClearSettings = category.id === CustomizationMigrationCategoryId.ConfiguredLocations && hasModifiedSettings && !this.customizationMigrationInProgress && !this.customizationMigrationLoading && !this.customizationMigrationLoadError;
|
|
2421
|
-
this.migrationClearSettingsContainer?.classList.toggle("disabled", !canClearSettings);
|
|
2422
|
-
if (canClearSettings) {
|
|
2423
|
-
this.migrationClearSettingsCheckbox.enable();
|
|
2424
|
-
this.migrationClearSettingsCheckbox.setTitle(( localize(6562, "Clear unused location settings after migration")));
|
|
2425
|
-
} else {
|
|
2426
|
-
this.migrationClearSettingsCheckbox.disable();
|
|
2427
|
-
this.migrationClearSettingsCheckbox.setTitle(( localize(6621, "The custom location settings are managed and cannot be cleared")));
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
if (this.migrationSelectedCountElement) {
|
|
2431
|
-
this.migrationSelectedCountElement.textContent = selectedCount === 1 ? ( localize(6622, "1 selected")) : ( localize(6623, "{0} selected", selectedCount));
|
|
2432
|
-
}
|
|
2433
|
-
if (category.id === CustomizationMigrationCategoryId.PromptFiles) {
|
|
2434
|
-
this.migrationMigrateButton.label = selectedCount > 0 ? ( localize(6624, "Convert {0} to Skills", selectedCount)) : ( localize(6625, "Convert to Skills"));
|
|
2435
|
-
} else {
|
|
2436
|
-
this.migrationMigrateButton.label = selectedCount > 0 ? ( localize(6626, "Migrate {0}", selectedCount)) : ( localize(6627, "Migrate"));
|
|
2437
|
-
}
|
|
2438
|
-
}
|
|
2439
|
-
async deleteCustomizationFile(customization) {
|
|
2440
|
-
if (this.customizationMigrationInProgress) {
|
|
2441
|
-
return;
|
|
2442
|
-
}
|
|
2443
|
-
const fileName = customization.name ?? basename(customization.uri);
|
|
2444
|
-
const confirmation = await this.dialogService.confirm({
|
|
2445
|
-
message: ( localize(6628, "Are you sure you want to delete '{0}'?", fileName)),
|
|
2446
|
-
detail: ( localize(6629, "This action cannot be undone.")),
|
|
2447
|
-
primaryButton: ( localize(6580, "Delete")),
|
|
2448
|
-
type: "warning"
|
|
2449
|
-
});
|
|
2450
|
-
if (!confirmation.confirmed) {
|
|
2451
|
-
return;
|
|
2452
|
-
}
|
|
2453
|
-
const useTrash = this.fileService.hasCapability(customization.uri, FileSystemProviderCapabilities.Trash);
|
|
2454
|
-
await this.fileService.del(customization.uri, {
|
|
2455
|
-
useTrash
|
|
2456
|
-
});
|
|
2457
|
-
if (customization.storage === PromptsStorage.local) {
|
|
2458
|
-
const projectRoot = this.workspaceService.getActiveProjectRoot();
|
|
2459
|
-
if (projectRoot) {
|
|
2460
|
-
await this.workspaceService.deleteFiles(projectRoot, [customization.uri]);
|
|
2461
|
-
}
|
|
2462
|
-
}
|
|
2463
|
-
const updatedCandidates = ( new Map());
|
|
2464
|
-
for (const [categoryId, candidates] of this.customizationsByMigrationCategory) {
|
|
2465
|
-
updatedCandidates.set(categoryId, candidates.filter(
|
|
2466
|
-
candidate => isMcpServerCustomizationMigrationCandidate(candidate) || !isEqual(candidate.uri, customization.uri)
|
|
2467
|
-
));
|
|
2468
|
-
}
|
|
2469
|
-
this.setCustomizationsToMigrate(updatedCandidates, this.customizationMigrationTargetFoldersByType);
|
|
2470
|
-
}
|
|
2471
|
-
isMigrationCategoryEnabled(category) {
|
|
2472
|
-
if (this.configurationService.getValue(category.enablementSetting) !== true) {
|
|
2473
|
-
return false;
|
|
2474
|
-
}
|
|
2475
|
-
const modifiedSettingIds = category.getModifiedSettingIds?.(this.configurationService);
|
|
2476
|
-
return modifiedSettingIds === undefined || modifiedSettingIds.length > 0;
|
|
2477
|
-
}
|
|
2478
|
-
getEnabledMigrationCategories() {
|
|
2479
|
-
return CUSTOMIZATION_MIGRATION_CATEGORIES.filter(category => this.isMigrationCategoryEnabled(category));
|
|
2480
|
-
}
|
|
2481
|
-
async resolveCustomizationMigrationTargetFolders(customizations, availableSourceFolders, sessionResource) {
|
|
2482
|
-
const requiredStorageByTargetType = ( new Map());
|
|
2483
|
-
for (const customization of customizations) {
|
|
2484
|
-
const targetType = getCustomizationMigrationTargetType(customization);
|
|
2485
|
-
const storages = requiredStorageByTargetType.get(targetType) ?? ( new Set());
|
|
2486
|
-
storages.add(customization.storage);
|
|
2487
|
-
requiredStorageByTargetType.set(targetType, storages);
|
|
2488
|
-
}
|
|
2489
|
-
const targetFolders = ( new Map());
|
|
2490
|
-
const selectedDestinationGroupIds = ( new Map());
|
|
2491
|
-
for (const [targetType, requiredStorages] of requiredStorageByTargetType) {
|
|
2492
|
-
const availableFolders = availableSourceFolders.get(targetType) ?? [];
|
|
2493
|
-
if (!this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
2494
|
-
return undefined;
|
|
2495
|
-
}
|
|
2496
|
-
const foldersByStorage = ( new Map());
|
|
2497
|
-
for (const storage of requiredStorages) {
|
|
2498
|
-
const matchingFolders = this.getCustomizationMigrationFolders(targetType, storage, availableFolders);
|
|
2499
|
-
const selectedFolder = this.selectedCustomizationMigrationTargets.get(this.getCustomizationMigrationTargetKey(targetType, storage));
|
|
2500
|
-
if (matchingFolders.length === 0 && !selectedFolder) {
|
|
2501
|
-
this.notificationService.error(this.getMissingMigrationTargetFolderMessage(targetType, storage));
|
|
2502
|
-
return undefined;
|
|
2503
|
-
}
|
|
2504
|
-
const selectedDestinationGroupId = selectedDestinationGroupIds.get(storage);
|
|
2505
|
-
const foldersAtSelectedDestination = selectedDestinationGroupId ? matchingFolders.filter(folder => folder.destinationGroupId === selectedDestinationGroupId) : [];
|
|
2506
|
-
let targetFolder = selectedFolder;
|
|
2507
|
-
if (targetFolder?.destinationGroupId) {
|
|
2508
|
-
selectedDestinationGroupIds.set(storage, targetFolder.destinationGroupId);
|
|
2509
|
-
} else if (foldersAtSelectedDestination.length === 1) {
|
|
2510
|
-
targetFolder = foldersAtSelectedDestination[0];
|
|
2511
|
-
} else if (!targetFolder && matchingFolders.length === 1) {
|
|
2512
|
-
targetFolder = matchingFolders[0];
|
|
2513
|
-
} else if (!targetFolder) {
|
|
2514
|
-
targetFolder = await this.pickCustomizationMigrationTargetFolder(matchingFolders, targetType, requiredStorageByTargetType.size > 1);
|
|
2515
|
-
if (targetFolder?.destinationGroupId) {
|
|
2516
|
-
selectedDestinationGroupIds.set(storage, targetFolder.destinationGroupId);
|
|
2517
|
-
}
|
|
2518
|
-
}
|
|
2519
|
-
if (!targetFolder || !this.isCustomizationMigrationSessionActive(sessionResource)) {
|
|
2520
|
-
return undefined;
|
|
2521
|
-
}
|
|
2522
|
-
foldersByStorage.set(storage, targetFolder);
|
|
2523
|
-
}
|
|
2524
|
-
targetFolders.set(targetType, foldersByStorage);
|
|
2525
|
-
}
|
|
2526
|
-
return targetFolders;
|
|
2527
|
-
}
|
|
2528
|
-
isCustomizationMigrationSessionActive(sessionResource) {
|
|
2529
|
-
return isEqual(sessionResource, this.harnessService.activeSessionResource.get());
|
|
2530
|
-
}
|
|
2531
|
-
getMissingMigrationTargetFolderMessage(targetType, storage) {
|
|
2532
|
-
if (storage === PromptsStorage.local) {
|
|
2533
|
-
switch (targetType) {
|
|
2534
|
-
case PromptsType.skill:
|
|
2535
|
-
return localize(6630, "No workspace skills folder is configured for the active harness.");
|
|
2536
|
-
case PromptsType.agent:
|
|
2537
|
-
return localize(6631, "No workspace agents folder is configured for the active harness.");
|
|
2538
|
-
default:
|
|
2539
|
-
return localize(
|
|
2540
|
-
6632,
|
|
2541
|
-
"No workspace instructions folder is configured for the active harness."
|
|
2542
|
-
);
|
|
2543
|
-
}
|
|
2544
|
-
}
|
|
2545
|
-
switch (targetType) {
|
|
2546
|
-
case PromptsType.skill:
|
|
2547
|
-
return localize(6633, "No global skills folder is configured for the active harness.");
|
|
2548
|
-
case PromptsType.agent:
|
|
2549
|
-
return localize(6634, "No global agents folder is configured for the active harness.");
|
|
2550
|
-
default:
|
|
2551
|
-
return localize(
|
|
2552
|
-
6635,
|
|
2553
|
-
"No global instructions folder is configured for the active harness."
|
|
2554
|
-
);
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
async pickCustomizationMigrationTargetFolder(sourceFolders, targetType, selectsMultipleTypes) {
|
|
2558
|
-
const picks = ( this.sortCustomizationMigrationFolders(sourceFolders).map(folder => ({
|
|
2559
|
-
label: folder.label,
|
|
2560
|
-
description: this.getCustomizationMigrationFolderPickDescription(folder, this.labelService.getUriLabel(folder.uri, {
|
|
2561
|
-
relative: true
|
|
2562
|
-
})),
|
|
2563
|
-
folder
|
|
2564
|
-
})));
|
|
2565
|
-
const selected = await this.quickInputService.pick(picks, {
|
|
2566
|
-
canPickMany: false,
|
|
2567
|
-
placeHolder: this.getMigrationTargetFolderPlaceholder(targetType, selectsMultipleTypes),
|
|
2568
|
-
matchOnDescription: true
|
|
2569
|
-
});
|
|
2570
|
-
return selected?.folder;
|
|
2571
|
-
}
|
|
2572
|
-
sortCustomizationMigrationFolders(folders) {
|
|
2573
|
-
return [...folders].sort(
|
|
2574
|
-
(first, second) => Number(this.isRecommendedCustomizationMigrationFolder(second)) - Number(this.isRecommendedCustomizationMigrationFolder(first))
|
|
2575
|
-
);
|
|
2576
|
-
}
|
|
2577
|
-
getCustomizationMigrationFolders(
|
|
2578
|
-
type,
|
|
2579
|
-
storage,
|
|
2580
|
-
availableFolders = this.customizationMigrationTargetFoldersByType.get(type) ?? []
|
|
2581
|
-
) {
|
|
2582
|
-
return this.sortCustomizationMigrationFolders(availableFolders.filter(
|
|
2583
|
-
folder => folder.source === storage && !(type === PromptsType.skill && storage === PromptsStorage.local && basename(dirname(folder.uri)).toLowerCase() === ".claude")
|
|
2584
|
-
));
|
|
2585
|
-
}
|
|
2586
|
-
isRecommendedCustomizationMigrationFolder(folder) {
|
|
2587
|
-
const root = basename(dirname(folder.uri)).toLowerCase();
|
|
2588
|
-
return root === (folder.source === PromptsStorage.local ? ".github" : ".copilot");
|
|
2589
|
-
}
|
|
2590
|
-
getCustomizationMigrationFolderPickDescription(folder, description) {
|
|
2591
|
-
return this.isRecommendedCustomizationMigrationFolder(folder) ? ( localize(6636, "{0} (Recommended)", description)) : description;
|
|
2592
|
-
}
|
|
2593
|
-
getMigrationTargetFolderPlaceholder(targetType, selectsMultipleTypes) {
|
|
2594
|
-
if (selectsMultipleTypes) {
|
|
2595
|
-
return localize(6637, "Select a destination for the migrated customizations");
|
|
2596
|
-
}
|
|
2597
|
-
switch (targetType) {
|
|
2598
|
-
case PromptsType.skill:
|
|
2599
|
-
return localize(6638, "Select a destination folder for migrated skills");
|
|
2600
|
-
case PromptsType.agent:
|
|
2601
|
-
return localize(6639, "Select a destination folder for migrated agents");
|
|
2602
|
-
default:
|
|
2603
|
-
return localize(6640, "Select a destination folder for migrated instructions");
|
|
2604
|
-
}
|
|
2605
|
-
}
|
|
2606
|
-
getCustomizationMigrationFolderLabel(folder) {
|
|
2607
|
-
const useSourceLabel = folder.label.startsWith("~") || (folder.source === PromptsStorage.local && folder.label.startsWith("."));
|
|
2608
|
-
let label = useSourceLabel ? folder.label : this.labelService.getUriLabel(folder.uri, {
|
|
2609
|
-
relative: folder.source === PromptsStorage.local
|
|
2610
|
-
});
|
|
2611
|
-
const folderName = basename(folder.uri);
|
|
2612
|
-
const normalizedLabel = label.replaceAll("\\", "/");
|
|
2613
|
-
if (useSourceLabel && normalizedLabel.split("/").at(-1) !== folderName) {
|
|
2614
|
-
const separator = label.includes("\\") ? "\\" : "/";
|
|
2615
|
-
label = `${label}${separator}${folderName}`;
|
|
2616
|
-
}
|
|
2617
|
-
return label;
|
|
2618
|
-
}
|
|
2619
|
-
getCustomizationMigrationDestinationLabel(folders) {
|
|
2620
|
-
const seen = ( new ResourceSet());
|
|
2621
|
-
const uniqueFolders = folders.filter(folder => {
|
|
2622
|
-
if (( seen.has(folder.uri))) {
|
|
2623
|
-
return false;
|
|
2624
|
-
}
|
|
2625
|
-
seen.add(folder.uri);
|
|
2626
|
-
return true;
|
|
2627
|
-
});
|
|
2628
|
-
if (uniqueFolders.length === 0) {
|
|
2629
|
-
return undefined;
|
|
2630
|
-
}
|
|
2631
|
-
const commonLabel = uniqueFolders[0].label;
|
|
2632
|
-
if (commonLabel && uniqueFolders.every(folder => folder.label === commonLabel)) {
|
|
2633
|
-
return commonLabel;
|
|
2634
|
-
}
|
|
2635
|
-
const labelParent = dirname$1(uniqueFolders[0].label);
|
|
2636
|
-
if (labelParent !== "." && uniqueFolders.every(folder => dirname$1(folder.label) === labelParent)) {
|
|
2637
|
-
return labelParent;
|
|
2638
|
-
}
|
|
2639
|
-
let destination = uniqueFolders[0].uri;
|
|
2640
|
-
if (uniqueFolders.length > 1) {
|
|
2641
|
-
const commonParent = dirname(destination);
|
|
2642
|
-
if (!uniqueFolders.every(folder => isEqual(dirname(folder.uri), commonParent))) {
|
|
2643
|
-
return undefined;
|
|
2644
|
-
}
|
|
2645
|
-
destination = commonParent;
|
|
2646
|
-
}
|
|
2647
|
-
return this.labelService.getUriLabel(destination);
|
|
2648
|
-
}
|
|
2649
|
-
isPromptsSection(section) {
|
|
2650
|
-
return section === AICustomizationManagementSection.Agents || section === AICustomizationManagementSection.Skills || section === AICustomizationManagementSection.Instructions || section === AICustomizationManagementSection.Prompts || section === AICustomizationManagementSection.Hooks;
|
|
2651
|
-
}
|
|
2652
|
-
updateSectionCount(sectionId, count) {
|
|
2653
|
-
const section = this.sections.find(s => s.id === sectionId);
|
|
2654
|
-
if (!section || section.count === count) {
|
|
2655
|
-
return;
|
|
2656
|
-
}
|
|
2657
|
-
section.count = count;
|
|
2658
|
-
this.sectionsList.splice(0, this.sectionsList.length, this.sections);
|
|
2659
|
-
this.ensureSectionsListReflectsActiveSection();
|
|
2660
|
-
}
|
|
2661
|
-
showWelcomePage() {
|
|
2662
|
-
if (this.viewMode === "editor") {
|
|
2663
|
-
this.goBackToList();
|
|
2664
|
-
}
|
|
2665
|
-
if (this.viewMode === "migration") {
|
|
2666
|
-
this.viewMode = "list";
|
|
2667
|
-
}
|
|
2668
|
-
if (this.viewMode === "mcpDetail") {
|
|
2669
|
-
this.goBackFromMcpDetail();
|
|
2670
|
-
}
|
|
2671
|
-
if (this.viewMode === "pluginDetail") {
|
|
2672
|
-
this.goBackFromPluginDetail();
|
|
2673
|
-
}
|
|
2674
|
-
if (this.viewMode === "toolsDetail") {
|
|
2675
|
-
this.goBackFromToolDetail();
|
|
2676
|
-
}
|
|
2677
|
-
this.selectedSection = undefined;
|
|
2678
|
-
this.activeMigrationStorage = undefined;
|
|
2679
|
-
this.sectionContextKey.set("");
|
|
2680
|
-
this.storageService.remove(AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY, StorageScope.PROFILE);
|
|
2681
|
-
this.welcomePage?.reset();
|
|
2682
|
-
this.updateContentVisibility();
|
|
2683
|
-
this.ensureSectionsListReflectsActiveSection(undefined);
|
|
2684
|
-
this.welcomePage?.focus();
|
|
2685
|
-
}
|
|
2686
|
-
selectSection(section, options) {
|
|
2687
|
-
if (this.selectedSection === section && !options?.showMarketplace) {
|
|
2688
|
-
this.ensureSectionsListReflectsActiveSection(section);
|
|
2689
|
-
return;
|
|
2690
|
-
}
|
|
2691
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.sectionChanged", {
|
|
2692
|
-
section
|
|
2693
|
-
});
|
|
2694
|
-
if (this.viewMode === "editor") {
|
|
2695
|
-
this.goBackToList();
|
|
2696
|
-
}
|
|
2697
|
-
if (this.viewMode === "migration") {
|
|
2698
|
-
this.viewMode = "list";
|
|
2699
|
-
}
|
|
2700
|
-
if (this.viewMode === "mcpDetail") {
|
|
2701
|
-
this.goBackFromMcpDetail();
|
|
2702
|
-
}
|
|
2703
|
-
if (this.viewMode === "pluginDetail") {
|
|
2704
|
-
this.goBackFromPluginDetail();
|
|
2705
|
-
}
|
|
2706
|
-
if (this.viewMode === "toolsDetail") {
|
|
2707
|
-
this.goBackFromToolDetail();
|
|
2708
|
-
}
|
|
2709
|
-
this.selectedSection = section;
|
|
2710
|
-
this.sectionContextKey.set(section);
|
|
2711
|
-
this.storageService.store(
|
|
2712
|
-
AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY,
|
|
2713
|
-
section,
|
|
2714
|
-
StorageScope.PROFILE,
|
|
2715
|
-
StorageTarget.USER
|
|
2716
|
-
);
|
|
2717
|
-
this.updateContentVisibility();
|
|
2718
|
-
if (this.isPromptsSection(section)) {
|
|
2719
|
-
void this.listWidget.setSection(section);
|
|
2720
|
-
}
|
|
2721
|
-
if (this.dimension) {
|
|
2722
|
-
this.layout(this.dimension);
|
|
2723
|
-
}
|
|
2724
|
-
this.ensureSectionsListReflectsActiveSection(section);
|
|
2725
|
-
if (options?.showMarketplace) {
|
|
2726
|
-
if (section === AICustomizationManagementSection.McpServers) {
|
|
2727
|
-
this.mcpListWidget?.showBrowseMarketplace();
|
|
2728
|
-
} else if (section === AICustomizationManagementSection.Plugins) {
|
|
2729
|
-
this.pluginListWidget?.showBrowseMarketplace();
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
if (section === AICustomizationManagementSection.McpServers) {
|
|
2733
|
-
this.mcpListWidget?.focusSearch();
|
|
2734
|
-
} else if (section === AICustomizationManagementSection.Plugins) {
|
|
2735
|
-
this.pluginListWidget?.focusSearch();
|
|
2736
|
-
} else if (section === AICustomizationManagementSection.Models) {
|
|
2737
|
-
this.modelsWidget?.focusSearch();
|
|
2738
|
-
} else if (section === AICustomizationManagementSection.Tools) {
|
|
2739
|
-
this.toolsListWidget?.focusSearch();
|
|
2740
|
-
} else {
|
|
2741
|
-
this.listWidget?.focusSearch();
|
|
2742
|
-
}
|
|
2743
|
-
}
|
|
2744
|
-
ensureSectionsListReflectsActiveSection(section = this.selectedSection) {
|
|
2745
|
-
if (!this.sectionsList) {
|
|
2746
|
-
return;
|
|
2747
|
-
}
|
|
2748
|
-
if (section === undefined) {
|
|
2749
|
-
this.sectionsList.setSelection([]);
|
|
2750
|
-
this.sectionsList.setFocus([]);
|
|
2751
|
-
return;
|
|
2752
|
-
}
|
|
2753
|
-
const index = this.sections.findIndex(s => s.id === section);
|
|
2754
|
-
if (index < 0) {
|
|
2755
|
-
return;
|
|
2756
|
-
}
|
|
2757
|
-
const selection = this.sectionsList.getSelection();
|
|
2758
|
-
if (selection.length !== 1 || selection[0] !== index) {
|
|
2759
|
-
this.sectionsList.setSelection([index]);
|
|
2760
|
-
}
|
|
2761
|
-
const focus = this.sectionsList.getFocus();
|
|
2762
|
-
if (focus.length !== 1 || focus[0] !== index) {
|
|
2763
|
-
this.sectionsList.setFocus([index]);
|
|
2764
|
-
}
|
|
2765
|
-
}
|
|
2766
|
-
updateContentVisibility() {
|
|
2767
|
-
this.contentNavigationGeneration++;
|
|
2768
|
-
const isEditorMode = this.viewMode === "editor";
|
|
2769
|
-
const isMigrationMode = this.viewMode === "migration";
|
|
2770
|
-
const isMcpDetailMode = this.viewMode === "mcpDetail";
|
|
2771
|
-
const isPluginDetailMode = this.viewMode === "pluginDetail";
|
|
2772
|
-
const isToolsDetailMode = this.viewMode === "toolsDetail";
|
|
2773
|
-
const isDetailMode = isMcpDetailMode || isPluginDetailMode || isToolsDetailMode;
|
|
2774
|
-
const isWelcome = this.selectedSection === undefined;
|
|
2775
|
-
const isPromptsSection = this.selectedSection !== undefined && this.isPromptsSection(this.selectedSection);
|
|
2776
|
-
const isModelsSection = this.selectedSection === AICustomizationManagementSection.Models;
|
|
2777
|
-
const isMcpSection = this.selectedSection === AICustomizationManagementSection.McpServers;
|
|
2778
|
-
const isPluginsSection = this.selectedSection === AICustomizationManagementSection.Plugins;
|
|
2779
|
-
const isToolsSection = this.selectedSection === AICustomizationManagementSection.Tools;
|
|
2780
|
-
if (this.welcomePage) {
|
|
2781
|
-
this.welcomePage.container.style.display = isWelcome && !isEditorMode && !isMigrationMode && !isDetailMode ? "" : "none";
|
|
2782
|
-
}
|
|
2783
|
-
if (this.promptsContentContainer) {
|
|
2784
|
-
this.promptsContentContainer.style.display = !isEditorMode && !isMigrationMode && !isDetailMode && isPromptsSection ? "" : "none";
|
|
2785
|
-
}
|
|
2786
|
-
if (this.migrationContentContainer) {
|
|
2787
|
-
this.migrationContentContainer.style.display = isMigrationMode ? "" : "none";
|
|
2788
|
-
}
|
|
2789
|
-
if (this.migrationShortcutButton) {
|
|
2790
|
-
this.migrationShortcutButton.classList.toggle("selected", isMigrationMode);
|
|
2791
|
-
if (isMigrationMode) {
|
|
2792
|
-
this.migrationShortcutButton.setAttribute("aria-current", "page");
|
|
2793
|
-
} else {
|
|
2794
|
-
this.migrationShortcutButton.removeAttribute("aria-current");
|
|
2795
|
-
}
|
|
2796
|
-
}
|
|
2797
|
-
if (this.modelsContentContainer) {
|
|
2798
|
-
this.modelsContentContainer.style.display = !isEditorMode && !isMigrationMode && !isDetailMode && isModelsSection ? "" : "none";
|
|
2799
|
-
}
|
|
2800
|
-
if (this.mcpContentContainer) {
|
|
2801
|
-
this.mcpContentContainer.style.display = !isEditorMode && !isMigrationMode && !isDetailMode && isMcpSection ? "" : "none";
|
|
2802
|
-
}
|
|
2803
|
-
this.mcpListWidget?.setVisible(!isEditorMode && !isMigrationMode && !isDetailMode && isMcpSection);
|
|
2804
|
-
if (this.mcpDetailContainer) {
|
|
2805
|
-
this.mcpDetailContainer.style.display = isMcpDetailMode ? "" : "none";
|
|
2806
|
-
}
|
|
2807
|
-
if (this.pluginContentContainer) {
|
|
2808
|
-
this.pluginContentContainer.style.display = !isEditorMode && !isMigrationMode && !isDetailMode && isPluginsSection ? "" : "none";
|
|
2809
|
-
}
|
|
2810
|
-
this.pluginListWidget?.setVisible(!isEditorMode && !isMigrationMode && !isDetailMode && isPluginsSection);
|
|
2811
|
-
if (this.pluginDetailContainer) {
|
|
2812
|
-
this.pluginDetailContainer.style.display = isPluginDetailMode ? "" : "none";
|
|
2813
|
-
}
|
|
2814
|
-
if (this.toolsContentContainer) {
|
|
2815
|
-
this.toolsContentContainer.style.display = !isEditorMode && !isMigrationMode && !isDetailMode && isToolsSection ? "" : "none";
|
|
2816
|
-
}
|
|
2817
|
-
if (this.toolsDetailContainer) {
|
|
2818
|
-
this.toolsDetailContainer.style.display = isToolsDetailMode ? "" : "none";
|
|
2819
|
-
}
|
|
2820
|
-
for (const [section, container] of this.contributedSectionContainers) {
|
|
2821
|
-
const visible = !isEditorMode && !isMigrationMode && !isDetailMode && this.selectedSection === section;
|
|
2822
|
-
container.style.display = visible ? "" : "none";
|
|
2823
|
-
if (visible) {
|
|
2824
|
-
this.ensureContributedSectionWidget(section);
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
if (this.editorContentContainer) {
|
|
2828
|
-
this.editorContentContainer.style.display = isEditorMode ? "" : "none";
|
|
2829
|
-
}
|
|
2830
|
-
if (isModelsSection && this.modelsWidget) {
|
|
2831
|
-
this.modelsWidget.render();
|
|
2832
|
-
if (this.dimension) {
|
|
2833
|
-
this.layout(this.dimension);
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
}
|
|
2837
|
-
ensureContributedSectionWidget(section) {
|
|
2838
|
-
const existing = this.contributedSectionWidgets.get(section);
|
|
2839
|
-
if (existing) {
|
|
2840
|
-
return existing;
|
|
2841
|
-
}
|
|
2842
|
-
const contribution = aiCustomizationManagementSectionRegistry.get(section, this.harnessService.activeHarness.get());
|
|
2843
|
-
const container = this.contributedSectionContainers.get(section);
|
|
2844
|
-
if (!contribution || !container) {
|
|
2845
|
-
return undefined;
|
|
2846
|
-
}
|
|
2847
|
-
const widget = contribution.create(this.instantiationService, container);
|
|
2848
|
-
this.contributedSectionWidgets.set(section, widget);
|
|
2849
|
-
this.editorDisposables.add(widget);
|
|
2850
|
-
if (this.dimension) {
|
|
2851
|
-
widget.layout?.(this.dimension);
|
|
2852
|
-
}
|
|
2853
|
-
return widget;
|
|
2854
|
-
}
|
|
2855
|
-
async createNewItemWithAI(type) {
|
|
2856
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.createItem", {
|
|
2857
|
-
section: this.selectedSection ?? "welcome",
|
|
2858
|
-
promptType: type,
|
|
2859
|
-
creationMode: "ai",
|
|
2860
|
-
target: "workspace"
|
|
2861
|
-
});
|
|
2862
|
-
if (this.input) {
|
|
2863
|
-
this.group.closeEditor(this.input);
|
|
2864
|
-
}
|
|
2865
|
-
await this.workspaceService.generateCustomization(type);
|
|
2866
|
-
}
|
|
2867
|
-
async createNewItemManual(type, target, rootFileName) {
|
|
2868
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.createItem", {
|
|
2869
|
-
section: this.selectedSection ?? "welcome",
|
|
2870
|
-
promptType: type,
|
|
2871
|
-
creationMode: "manual",
|
|
2872
|
-
target: target === "workspace-root" ? "workspace" : target
|
|
2873
|
-
});
|
|
2874
|
-
if (target === "workspace-root") {
|
|
2875
|
-
const projectRoot = this.workspaceService.getActiveProjectRoot();
|
|
2876
|
-
if (!projectRoot) {
|
|
2877
|
-
return;
|
|
2878
|
-
}
|
|
2879
|
-
const override = this.selectedSection ? this.harnessService.getActiveDescriptor().sectionOverrides?.get(this.selectedSection) : undefined;
|
|
2880
|
-
const fileName = rootFileName ?? override?.rootFile ?? AGENT_MD_FILENAME;
|
|
2881
|
-
const fileUri = URI.joinPath(projectRoot, fileName);
|
|
2882
|
-
if (await this.fileService.exists(fileUri)) {
|
|
2883
|
-
await this.showEmbeddedEditor(fileUri, fileName, PromptsType.instructions, PromptsStorage.local, true);
|
|
2884
|
-
} else {
|
|
2885
|
-
await this.fileService.createFile(fileUri);
|
|
2886
|
-
await this.showEmbeddedEditor(fileUri, fileName, PromptsType.instructions, PromptsStorage.local, true);
|
|
2887
|
-
}
|
|
2888
|
-
this.listWidget.refresh();
|
|
2889
|
-
return;
|
|
2890
|
-
}
|
|
2891
|
-
if (type === PromptsType.hook) {
|
|
2892
|
-
const preferredStorage = target === "user" ? PromptsStorage.user : PromptsStorage.local;
|
|
2893
|
-
if (this.workspaceService.isSessionsWindow) {
|
|
2894
|
-
await this.instantiationService.invokeFunction(showConfigureHooksQuickPick, {
|
|
2895
|
-
openEditor: async resource => {
|
|
2896
|
-
await this.showEmbeddedEditor(
|
|
2897
|
-
resource,
|
|
2898
|
-
basename(resource),
|
|
2899
|
-
PromptsType.hook,
|
|
2900
|
-
preferredStorage,
|
|
2901
|
-
preferredStorage === PromptsStorage.local
|
|
2902
|
-
);
|
|
2903
|
-
return;
|
|
2904
|
-
},
|
|
2905
|
-
target: Target.GitHubCopilot,
|
|
2906
|
-
preferredStorage
|
|
2907
|
-
});
|
|
2908
|
-
} else {
|
|
2909
|
-
await this.instantiationService.invokeFunction(showConfigureHooksQuickPick, {
|
|
2910
|
-
openEditor: async resource => {
|
|
2911
|
-
await this.showEmbeddedEditor(
|
|
2912
|
-
resource,
|
|
2913
|
-
basename(resource),
|
|
2914
|
-
PromptsType.hook,
|
|
2915
|
-
preferredStorage,
|
|
2916
|
-
preferredStorage === PromptsStorage.local
|
|
2917
|
-
);
|
|
2918
|
-
return;
|
|
2919
|
-
},
|
|
2920
|
-
preferredStorage
|
|
2921
|
-
});
|
|
2922
|
-
}
|
|
2923
|
-
return;
|
|
2924
|
-
}
|
|
2925
|
-
const sessionResource = this.harnessService.activeSessionResource.get();
|
|
2926
|
-
const picker = this.instantiationService.createInstance(CustomizationLocationPicker);
|
|
2927
|
-
const targetDir = await picker.resolveTargetDirectoryWithPicker(sessionResource, type, target);
|
|
2928
|
-
if (targetDir === null) {
|
|
2929
|
-
return;
|
|
2930
|
-
}
|
|
2931
|
-
if (targetDir === undefined) {
|
|
2932
|
-
await this.instantiationService.invokeFunction(showNoFoldersDialog, type);
|
|
2933
|
-
return;
|
|
2934
|
-
}
|
|
2935
|
-
const override = this.selectedSection ? this.harnessService.getActiveDescriptor().sectionOverrides?.get(this.selectedSection) : undefined;
|
|
2936
|
-
const options = {
|
|
2937
|
-
targetFolder: targetDir,
|
|
2938
|
-
targetStorage: target === AICustomizationSources.user ? PromptsStorage.user : PromptsStorage.local,
|
|
2939
|
-
fileExtension: override?.fileExtension,
|
|
2940
|
-
openFile: async uri => {
|
|
2941
|
-
const isWorkspace = target === AICustomizationSources.local;
|
|
2942
|
-
await this.showEmbeddedEditor(uri, basename(uri), type, target, isWorkspace);
|
|
2943
|
-
return this.embeddedEditor;
|
|
2944
|
-
}
|
|
2945
|
-
};
|
|
2946
|
-
let commandId;
|
|
2947
|
-
switch (type) {
|
|
2948
|
-
case PromptsType.prompt:
|
|
2949
|
-
commandId = NEW_PROMPT_COMMAND_ID;
|
|
2950
|
-
break;
|
|
2951
|
-
case PromptsType.instructions:
|
|
2952
|
-
commandId = NEW_INSTRUCTIONS_COMMAND_ID;
|
|
2953
|
-
break;
|
|
2954
|
-
case PromptsType.agent:
|
|
2955
|
-
commandId = NEW_AGENT_COMMAND_ID;
|
|
2956
|
-
break;
|
|
2957
|
-
case PromptsType.skill:
|
|
2958
|
-
commandId = NEW_SKILL_COMMAND_ID;
|
|
2959
|
-
break;
|
|
2960
|
-
default:
|
|
2961
|
-
return;
|
|
2962
|
-
}
|
|
2963
|
-
await this.commandService.executeCommand(commandId, options);
|
|
2964
|
-
this.listWidget.refresh();
|
|
2965
|
-
}
|
|
2966
|
-
updateStyles() {
|
|
2967
|
-
this.splitView?.style({
|
|
2968
|
-
separatorBorder: Color.transparent
|
|
2969
|
-
});
|
|
2970
|
-
}
|
|
2971
|
-
async setInput(input, options, context, token) {
|
|
2972
|
-
this.workspaceService.clearOverrideProjectRoot();
|
|
2973
|
-
this.inEditorContextKey.set(true);
|
|
2974
|
-
this.sectionContextKey.set(this.selectedSection ?? "");
|
|
2975
|
-
input.setSaveHandler(() => this.handleBuiltinSave());
|
|
2976
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.opened", {
|
|
2977
|
-
section: this.selectedSection ?? "welcome"
|
|
2978
|
-
});
|
|
2979
|
-
await super.setInput(input, options, context, token);
|
|
2980
|
-
input.setTargetLabels(
|
|
2981
|
-
this.getActiveHarnessLabel(),
|
|
2982
|
-
this.workspaceService.activeProjectLabel.get()
|
|
2983
|
-
);
|
|
2984
|
-
if (this.dimension) {
|
|
2985
|
-
this.layout(this.dimension);
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
clearInput() {
|
|
2989
|
-
const input = this.input;
|
|
2990
|
-
if (input instanceof AICustomizationManagementEditorInput) {
|
|
2991
|
-
input.setSaveHandler(undefined);
|
|
2992
|
-
input.setDirty(false);
|
|
2993
|
-
}
|
|
2994
|
-
this.inEditorContextKey.set(false);
|
|
2995
|
-
if (this.viewMode === "editor") {
|
|
2996
|
-
this.goBackToList();
|
|
2997
|
-
}
|
|
2998
|
-
if (this.viewMode === "migration") {
|
|
2999
|
-
this.viewMode = "list";
|
|
3000
|
-
}
|
|
3001
|
-
if (this.viewMode === "mcpDetail") {
|
|
3002
|
-
this.goBackFromMcpDetail();
|
|
3003
|
-
}
|
|
3004
|
-
if (this.viewMode === "pluginDetail") {
|
|
3005
|
-
this.goBackFromPluginDetail();
|
|
3006
|
-
}
|
|
3007
|
-
if (this.viewMode === "toolsDetail") {
|
|
3008
|
-
this.goBackFromToolDetail();
|
|
3009
|
-
}
|
|
3010
|
-
this.workspaceService.clearOverrideProjectRoot();
|
|
3011
|
-
this.disposeBuiltinEditingSessions();
|
|
3012
|
-
super.clearInput();
|
|
3013
|
-
}
|
|
3014
|
-
setEditorVisible(visible) {
|
|
3015
|
-
super.setEditorVisible(visible);
|
|
3016
|
-
if (visible && this.dimension) {
|
|
3017
|
-
this.layout(this.dimension);
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
|
-
layout(dimension) {
|
|
3021
|
-
this.dimension = dimension;
|
|
3022
|
-
if (this.container && this.splitView) {
|
|
3023
|
-
this.splitViewContainer.style.height = `${dimension.height}px`;
|
|
3024
|
-
this.splitView.layout(dimension.width, dimension.height);
|
|
3025
|
-
}
|
|
3026
|
-
for (const widget of ( this.contributedSectionWidgets.values())) {
|
|
3027
|
-
widget.layout?.(dimension);
|
|
3028
|
-
}
|
|
3029
|
-
if (this.viewMode === "migration") {
|
|
3030
|
-
this.scheduleMigrationSectionLayout();
|
|
3031
|
-
}
|
|
3032
|
-
if (this.migrationContentContainer) {
|
|
3033
|
-
const migrationWidth = this.migrationContentContainer.offsetWidth || dimension.width;
|
|
3034
|
-
this.migrationContentContainer.classList.toggle("narrow-layout", migrationWidth < 500);
|
|
3035
|
-
}
|
|
3036
|
-
this.migrationListScrollable?.scanDomNode();
|
|
3037
|
-
this.migrationDashboardScrollable?.scanDomNode();
|
|
3038
|
-
}
|
|
3039
|
-
focus() {
|
|
3040
|
-
super.focus();
|
|
3041
|
-
if (this.viewMode === "editor") {
|
|
3042
|
-
if (this.editorDisplayMode === "raw") {
|
|
3043
|
-
this.embeddedEditor?.focus();
|
|
3044
|
-
} else {
|
|
3045
|
-
this.editorModeButton?.focus();
|
|
3046
|
-
}
|
|
3047
|
-
return;
|
|
3048
|
-
}
|
|
3049
|
-
if (this.viewMode === "migration") {
|
|
3050
|
-
this.focusCustomizationMigrationPage();
|
|
3051
|
-
return;
|
|
3052
|
-
}
|
|
3053
|
-
if (this.selectedSection === undefined) {
|
|
3054
|
-
this.welcomePage?.focus();
|
|
3055
|
-
return;
|
|
3056
|
-
}
|
|
3057
|
-
if (this.selectedSection === AICustomizationManagementSection.McpServers) {
|
|
3058
|
-
this.mcpListWidget?.focusSearch();
|
|
3059
|
-
} else if (this.selectedSection === AICustomizationManagementSection.Plugins) {
|
|
3060
|
-
this.pluginListWidget?.focusSearch();
|
|
3061
|
-
} else if (this.selectedSection === AICustomizationManagementSection.Models) {
|
|
3062
|
-
this.modelsWidget?.focusSearch();
|
|
3063
|
-
} else if (this.selectedSection === AICustomizationManagementSection.Tools) {
|
|
3064
|
-
this.toolsListWidget?.focusSearch();
|
|
3065
|
-
} else if (this.selectedSection && ( this.contributedSectionContainers.has(this.selectedSection))) {
|
|
3066
|
-
this.ensureContributedSectionWidget(this.selectedSection)?.focus?.();
|
|
3067
|
-
} else {
|
|
3068
|
-
this.listWidget?.focusSearch();
|
|
3069
|
-
}
|
|
3070
|
-
}
|
|
3071
|
-
selectSectionById(sectionId, options) {
|
|
3072
|
-
const index = this.sections.findIndex(s => s.id === sectionId);
|
|
3073
|
-
if (index >= 0) {
|
|
3074
|
-
if (this.viewMode === "editor") {
|
|
3075
|
-
this.goBackToList();
|
|
3076
|
-
}
|
|
3077
|
-
if (this.viewMode === "migration") {
|
|
3078
|
-
this.viewMode = "list";
|
|
3079
|
-
}
|
|
3080
|
-
if (this.viewMode === "mcpDetail") {
|
|
3081
|
-
this.goBackFromMcpDetail();
|
|
3082
|
-
}
|
|
3083
|
-
if (this.viewMode === "pluginDetail") {
|
|
3084
|
-
this.goBackFromPluginDetail();
|
|
3085
|
-
}
|
|
3086
|
-
if (this.viewMode === "toolsDetail") {
|
|
3087
|
-
this.goBackFromToolDetail();
|
|
3088
|
-
}
|
|
3089
|
-
this.selectedSection = sectionId;
|
|
3090
|
-
this.sectionContextKey.set(sectionId);
|
|
3091
|
-
this.storageService.store(
|
|
3092
|
-
AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY,
|
|
3093
|
-
sectionId,
|
|
3094
|
-
StorageScope.PROFILE,
|
|
3095
|
-
StorageTarget.USER
|
|
3096
|
-
);
|
|
3097
|
-
this.updateContentVisibility();
|
|
3098
|
-
if (this.isPromptsSection(sectionId)) {
|
|
3099
|
-
void this.listWidget.setSection(sectionId);
|
|
3100
|
-
}
|
|
3101
|
-
if (this.dimension) {
|
|
3102
|
-
this.layout(this.dimension);
|
|
3103
|
-
}
|
|
3104
|
-
this.ensureSectionsListReflectsActiveSection(sectionId);
|
|
3105
|
-
if (options?.showMarketplace) {
|
|
3106
|
-
if (sectionId === AICustomizationManagementSection.McpServers) {
|
|
3107
|
-
this.mcpListWidget?.showBrowseMarketplace();
|
|
3108
|
-
} else if (sectionId === AICustomizationManagementSection.Plugins) {
|
|
3109
|
-
this.pluginListWidget?.showBrowseMarketplace();
|
|
3110
|
-
}
|
|
3111
|
-
}
|
|
3112
|
-
}
|
|
3113
|
-
}
|
|
3114
|
-
prepareCustomizationMigrationView() {
|
|
3115
|
-
if (this.viewMode === "editor") {
|
|
3116
|
-
this.goBackToList();
|
|
3117
|
-
}
|
|
3118
|
-
if (this.viewMode === "mcpDetail") {
|
|
3119
|
-
this.goBackFromMcpDetail();
|
|
3120
|
-
}
|
|
3121
|
-
if (this.viewMode === "pluginDetail") {
|
|
3122
|
-
this.goBackFromPluginDetail();
|
|
3123
|
-
}
|
|
3124
|
-
if (this.viewMode === "toolsDetail") {
|
|
3125
|
-
this.goBackFromToolDetail();
|
|
3126
|
-
}
|
|
3127
|
-
this.selectedSection = undefined;
|
|
3128
|
-
this.sectionContextKey.set("");
|
|
3129
|
-
this.viewMode = "migration";
|
|
3130
|
-
this.ensureSectionsListReflectsActiveSection(undefined);
|
|
3131
|
-
}
|
|
3132
|
-
showCustomizationMigrationDashboard() {
|
|
3133
|
-
this.prepareCustomizationMigrationView();
|
|
3134
|
-
this.activeMigrationCategoryId = undefined;
|
|
3135
|
-
this.activeMigrationStorage = undefined;
|
|
3136
|
-
this.renderCustomizationMigrationPage();
|
|
3137
|
-
this.updateContentVisibility();
|
|
3138
|
-
if (this.dimension) {
|
|
3139
|
-
this.layout(this.dimension);
|
|
3140
|
-
}
|
|
3141
|
-
if (this.migrationContentContainer) {
|
|
3142
|
-
getWindow(this.migrationContentContainer).requestAnimationFrame(() => this.focusCustomizationMigrationPage());
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
async showCustomizationMigrationPage(categoryId, storage) {
|
|
3146
|
-
if (!categoryId) {
|
|
3147
|
-
await this.refreshCustomizationMigrationInfo();
|
|
3148
|
-
this.showCustomizationMigrationDashboard();
|
|
3149
|
-
return;
|
|
3150
|
-
}
|
|
3151
|
-
if (!this.isMigrationCategoryEnabled(getCustomizationMigrationCategory(categoryId))) {
|
|
3152
|
-
return;
|
|
3153
|
-
}
|
|
3154
|
-
this.prepareCustomizationMigrationView();
|
|
3155
|
-
this.activeMigrationCategoryId = categoryId;
|
|
3156
|
-
this.activeMigrationStorage = storage;
|
|
3157
|
-
if (this.migrationClearSettingsCheckbox) {
|
|
3158
|
-
this.migrationClearSettingsCheckbox.checked = true;
|
|
3159
|
-
}
|
|
3160
|
-
this.renderCustomizationMigrationPage();
|
|
3161
|
-
this.updateContentVisibility();
|
|
3162
|
-
if (this.dimension) {
|
|
3163
|
-
this.layout(this.dimension);
|
|
3164
|
-
}
|
|
3165
|
-
if (this.migrationContentContainer) {
|
|
3166
|
-
getWindow(this.migrationContentContainer).requestAnimationFrame(() => this.focusCustomizationMigrationPage());
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
3169
|
-
refreshList() {
|
|
3170
|
-
this.listWidget.refresh();
|
|
3171
|
-
}
|
|
3172
|
-
async revealCustomizationByUri(uri) {
|
|
3173
|
-
if (!this.isPromptsSection(this.selectedSection)) {
|
|
3174
|
-
return;
|
|
3175
|
-
}
|
|
3176
|
-
for (let attempt = 0; attempt < 10; attempt++) {
|
|
3177
|
-
if (this.listWidget.revealAndSelectFirstItemByUri([uri])) {
|
|
3178
|
-
return;
|
|
3179
|
-
}
|
|
3180
|
-
if (attempt === 0) {
|
|
3181
|
-
this.listWidget.clearSearch();
|
|
3182
|
-
}
|
|
3183
|
-
await timeout(100);
|
|
3184
|
-
}
|
|
3185
|
-
}
|
|
3186
|
-
revealLastItem() {
|
|
3187
|
-
if (this.selectedSection === AICustomizationManagementSection.McpServers) {
|
|
3188
|
-
this.mcpListWidget?.revealLastItem();
|
|
3189
|
-
} else if (this.selectedSection === AICustomizationManagementSection.Plugins) {
|
|
3190
|
-
this.pluginListWidget?.revealLastItem();
|
|
3191
|
-
} else {
|
|
3192
|
-
this.listWidget.revealLastItem();
|
|
3193
|
-
}
|
|
3194
|
-
}
|
|
3195
|
-
async generateDebugReport() {
|
|
3196
|
-
return this.listWidget.generateDebugReport();
|
|
3197
|
-
}
|
|
3198
|
-
createEmbeddedEditor() {
|
|
3199
|
-
if (!this.editorContentContainer) {
|
|
3200
|
-
return;
|
|
3201
|
-
}
|
|
3202
|
-
const editorHeader = append(this.editorContentContainer, $(".editor-header"));
|
|
3203
|
-
this.editorActionButton = append(editorHeader, $("button.editor-back-button"));
|
|
3204
|
-
this.editorActionButton.setAttribute("aria-label", ( localize(6641, "Back to list")));
|
|
3205
|
-
this.editorDisposables.add(this.hoverService.setupManagedHover(
|
|
3206
|
-
getDefaultHoverDelegate("element"),
|
|
3207
|
-
this.editorActionButton,
|
|
3208
|
-
( localize(6642, "Back to list"))
|
|
3209
|
-
));
|
|
3210
|
-
this.editorActionButtonIcon = append(
|
|
3211
|
-
this.editorActionButton,
|
|
3212
|
-
$(`.codicon.codicon-${Codicon.arrowLeft.id}.editor-action-button-icon`)
|
|
3213
|
-
);
|
|
3214
|
-
this.editorActionButtonIcon.setAttribute("aria-hidden", "true");
|
|
3215
|
-
this.editorDisposables.add(addDisposableListener(this.editorActionButton, "click", () => {
|
|
3216
|
-
void this.handleEditorActionButton().catch(error => {
|
|
3217
|
-
console.error("Failed to handle editor back action:", error);
|
|
3218
|
-
this.notificationService.error(( localize(6643, "Failed to finish the prompt action.")));
|
|
3219
|
-
});
|
|
3220
|
-
}));
|
|
3221
|
-
const itemInfo = append(editorHeader, $(".editor-item-info"));
|
|
3222
|
-
this.editorItemNameElement = append(itemInfo, $(".editor-item-name"));
|
|
3223
|
-
this.editorItemPathElement = append(itemInfo, $(".editor-item-path"));
|
|
3224
|
-
this.editorModeButton = append(editorHeader, $("button.editor-mode-button"));
|
|
3225
|
-
this.editorModeButton.type = "button";
|
|
3226
|
-
this.editorModeButton.setAttribute("aria-pressed", "false");
|
|
3227
|
-
this.editorDisposables.add(this.hoverService.setupManagedHover(
|
|
3228
|
-
getDefaultHoverDelegate("element"),
|
|
3229
|
-
this.editorModeButton,
|
|
3230
|
-
() => this.getEditorModeButtonTooltip()
|
|
3231
|
-
));
|
|
3232
|
-
this.editorDisposables.add(addDisposableListener(this.editorModeButton, "click", () => {
|
|
3233
|
-
this.toggleEditorDisplayMode();
|
|
3234
|
-
}));
|
|
3235
|
-
this.editorSaveIndicator = append(editorHeader, $(".editor-save-indicator"));
|
|
3236
|
-
this.editorPreviewContainer = append(this.editorContentContainer, $(".editor-preview-container"));
|
|
3237
|
-
this.editorPreviewScrollContainer = append(this.editorPreviewContainer, $(".editor-preview-scroll-container"));
|
|
3238
|
-
this.editorPreviewScrollContainer.setAttribute("role", "region");
|
|
3239
|
-
this.editorPreviewScrollContainer.setAttribute("aria-label", ( localize(6644, "Customization preview")));
|
|
3240
|
-
this.editorPreviewIssuesContainer = append(this.editorPreviewScrollContainer, $(".editor-preview-issues"));
|
|
3241
|
-
const frontMatterSection = append(
|
|
3242
|
-
this.editorPreviewScrollContainer,
|
|
3243
|
-
$(".editor-preview-section.editor-preview-frontmatter-section")
|
|
3244
|
-
);
|
|
3245
|
-
this.editorPreviewFrontMatterContainer = append(frontMatterSection, $(".editor-preview-frontmatter-list"));
|
|
3246
|
-
const bodySection = append(
|
|
3247
|
-
this.editorPreviewScrollContainer,
|
|
3248
|
-
$(".editor-preview-section.editor-preview-body-section")
|
|
3249
|
-
);
|
|
3250
|
-
this.editorPreviewBodyContainer = append(bodySection, $(".editor-preview-body-content"));
|
|
3251
|
-
this.embeddedEditorContainer = append(this.editorContentContainer, $(".embedded-editor-container"));
|
|
3252
|
-
const overflowWidgetsDomNode = append(
|
|
3253
|
-
this.editorContentContainer,
|
|
3254
|
-
$(".embedded-editor-overflow-widgets.monaco-editor")
|
|
3255
|
-
);
|
|
3256
|
-
this.editorDisposables.add(toDisposable(() => overflowWidgetsDomNode.remove()));
|
|
3257
|
-
this.embeddedEditor = this.editorDisposables.add(
|
|
3258
|
-
this.instantiationService.createInstance(CodeEditorWidget, this.embeddedEditorContainer, {
|
|
3259
|
-
...getSimpleEditorOptions(this.configurationService),
|
|
3260
|
-
readOnly: false,
|
|
3261
|
-
minimap: {
|
|
3262
|
-
enabled: false
|
|
3263
|
-
},
|
|
3264
|
-
lineNumbers: "on",
|
|
3265
|
-
wordWrap: "on",
|
|
3266
|
-
scrollBeyondLastLine: false,
|
|
3267
|
-
automaticLayout: false,
|
|
3268
|
-
folding: true,
|
|
3269
|
-
renderLineHighlight: "all",
|
|
3270
|
-
scrollbar: {
|
|
3271
|
-
vertical: "auto",
|
|
3272
|
-
horizontal: "auto"
|
|
3273
|
-
},
|
|
3274
|
-
overflowWidgetsDomNode
|
|
3275
|
-
}, {
|
|
3276
|
-
isSimpleWidget: false
|
|
3277
|
-
})
|
|
3278
|
-
);
|
|
3279
|
-
this.updateEditorDisplayMode();
|
|
3280
|
-
}
|
|
3281
|
-
async showEmbeddedEditor(
|
|
3282
|
-
uri,
|
|
3283
|
-
displayName,
|
|
3284
|
-
promptType,
|
|
3285
|
-
source,
|
|
3286
|
-
isWorkspaceFile = false,
|
|
3287
|
-
isReadOnly = false
|
|
3288
|
-
) {
|
|
3289
|
-
if (!hasReadableCustomizationContent(uri)) {
|
|
3290
|
-
return;
|
|
3291
|
-
}
|
|
3292
|
-
this.editorReturnViewMode = this.viewMode === "migration" ? "migration" : "list";
|
|
3293
|
-
this.currentModelRef?.dispose();
|
|
3294
|
-
this.currentModelRef = undefined;
|
|
3295
|
-
this.editorModelChangeDisposables.clear();
|
|
3296
|
-
this.editorPreviewDisposables.clear();
|
|
3297
|
-
this.editorPreviewRenderScheduler.cancel();
|
|
3298
|
-
this.currentEditingUri = uri;
|
|
3299
|
-
this.currentEditingProjectRoot = isWorkspaceFile ? this.workspaceService.getActiveProjectRoot() : undefined;
|
|
3300
|
-
this.currentEditingSource = source;
|
|
3301
|
-
this.currentEditingPromptType = promptType;
|
|
3302
|
-
this.currentEditingReadOnly = isReadOnly;
|
|
3303
|
-
this.editorDisplayMode = this.isStructuredPreviewSupported(promptType) ? "preview" : "raw";
|
|
3304
|
-
this.viewMode = "editor";
|
|
3305
|
-
this.editorItemNameElement.textContent = displayName;
|
|
3306
|
-
this.editorItemPathElement.textContent = basename(uri);
|
|
3307
|
-
this._editorContentChanged = false;
|
|
3308
|
-
this.resetEditorSaveIndicator();
|
|
3309
|
-
this.updateEditorActionButton();
|
|
3310
|
-
this.updateEditorDisplayMode();
|
|
3311
|
-
this.updateContentVisibility();
|
|
3312
|
-
try {
|
|
3313
|
-
if (source === AICustomizationSources.builtin && (promptType === PromptsType.prompt || promptType === PromptsType.skill)) {
|
|
3314
|
-
const session = await this.getOrCreateBuiltinEditingSession(uri);
|
|
3315
|
-
if (!isEqual(this.currentEditingUri, uri)) {
|
|
3316
|
-
return;
|
|
3317
|
-
}
|
|
3318
|
-
this.embeddedEditor.setModel(session.model);
|
|
3319
|
-
this.embeddedEditor.updateOptions({
|
|
3320
|
-
readOnly: false
|
|
3321
|
-
});
|
|
3322
|
-
this._editorContentChanged = session.model.getValue() !== session.originalContent;
|
|
3323
|
-
this.renderCurrentEditorPreview();
|
|
3324
|
-
this.updateEditorActionButton();
|
|
3325
|
-
if (this.dimension) {
|
|
3326
|
-
this.layout(this.dimension);
|
|
3327
|
-
}
|
|
3328
|
-
if (this.editorDisplayMode === "raw") {
|
|
3329
|
-
this.embeddedEditor.focus();
|
|
3330
|
-
} else {
|
|
3331
|
-
this.editorModeButton?.focus();
|
|
3332
|
-
}
|
|
3333
|
-
this.editorModelChangeDisposables.add(session.model.onDidChangeContent(() => {
|
|
3334
|
-
this._editorContentChanged = session.model.getValue() !== session.originalContent;
|
|
3335
|
-
this.scheduleCurrentEditorPreviewRender();
|
|
3336
|
-
this.updateEditorActionButton();
|
|
3337
|
-
}));
|
|
3338
|
-
return;
|
|
3339
|
-
}
|
|
3340
|
-
const ref = await this.textModelService.createModelReference(uri);
|
|
3341
|
-
if (!isEqual(this.currentEditingUri, uri)) {
|
|
3342
|
-
ref.dispose();
|
|
3343
|
-
return;
|
|
3344
|
-
}
|
|
3345
|
-
this.currentModelRef = ref;
|
|
3346
|
-
this.embeddedEditor.setModel(ref.object.textEditorModel);
|
|
3347
|
-
this.embeddedEditor.updateOptions({
|
|
3348
|
-
readOnly: isReadOnly
|
|
3349
|
-
});
|
|
3350
|
-
this.renderCurrentEditorPreview();
|
|
3351
|
-
if (this.dimension) {
|
|
3352
|
-
this.layout(this.dimension);
|
|
3353
|
-
}
|
|
3354
|
-
if (this.editorDisplayMode === "raw") {
|
|
3355
|
-
this.embeddedEditor.focus();
|
|
3356
|
-
} else {
|
|
3357
|
-
this.editorModeButton?.focus();
|
|
3358
|
-
}
|
|
3359
|
-
this._editorContentChanged = this.workingCopyService.isDirty(uri);
|
|
3360
|
-
this.editorModelChangeDisposables.add(ref.object.textEditorModel.onDidChangeContent(() => {
|
|
3361
|
-
this._editorContentChanged = true;
|
|
3362
|
-
this.scheduleCurrentEditorPreviewRender();
|
|
3363
|
-
this.resetEditorSaveIndicator();
|
|
3364
|
-
}));
|
|
3365
|
-
this.editorModelChangeDisposables.add(this.workingCopyService.onDidSave(e => {
|
|
3366
|
-
if (isEqual(e.workingCopy.resource, uri)) {
|
|
3367
|
-
this._editorContentChanged = this.workingCopyService.isDirty(uri);
|
|
3368
|
-
this.editorSaveIndicator.className = "editor-save-indicator visible saved";
|
|
3369
|
-
this.editorSaveIndicator.classList.add(...ThemeIcon.asClassNameArray(Codicon.check));
|
|
3370
|
-
this.editorSaveIndicator.title = ( localize(6645, "Saved"));
|
|
3371
|
-
this.editorSaveIndicator.setAttribute("aria-label", ( localize(6645, "Saved")));
|
|
3372
|
-
status(( localize(6645, "Saved")));
|
|
3373
|
-
}
|
|
3374
|
-
}));
|
|
3375
|
-
} catch (error) {
|
|
3376
|
-
console.error("Failed to load model for embedded editor:", error);
|
|
3377
|
-
if (isEqual(this.currentEditingUri, uri)) {
|
|
3378
|
-
this.goBackToList();
|
|
3379
|
-
}
|
|
3380
|
-
}
|
|
3381
|
-
}
|
|
3382
|
-
goBackToList() {
|
|
3383
|
-
const returnViewMode = this.editorReturnViewMode;
|
|
3384
|
-
this.editorReturnViewMode = "list";
|
|
3385
|
-
const fileUri = this.currentEditingUri;
|
|
3386
|
-
const backgroundSaveRequest = this.createExistingCustomizationSaveRequest();
|
|
3387
|
-
if (backgroundSaveRequest) {
|
|
3388
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.saveItem", {
|
|
3389
|
-
promptType: this.currentEditingPromptType ?? "",
|
|
3390
|
-
storage: String(this.currentEditingSource ?? ""),
|
|
3391
|
-
saveTarget: "existing"
|
|
3392
|
-
});
|
|
3393
|
-
}
|
|
3394
|
-
if (fileUri && this.currentEditingSource === AICustomizationSources.builtin) {
|
|
3395
|
-
this.disposeBuiltinEditingSession(fileUri);
|
|
3396
|
-
}
|
|
3397
|
-
this.currentModelRef?.dispose();
|
|
3398
|
-
this.currentModelRef = undefined;
|
|
3399
|
-
this.currentEditingUri = undefined;
|
|
3400
|
-
this.currentEditingProjectRoot = undefined;
|
|
3401
|
-
this.currentEditingSource = undefined;
|
|
3402
|
-
this.currentEditingPromptType = undefined;
|
|
3403
|
-
this.currentEditingReadOnly = false;
|
|
3404
|
-
this.editorDisplayMode = "preview";
|
|
3405
|
-
this._editorContentChanged = false;
|
|
3406
|
-
this.editorModelChangeDisposables.clear();
|
|
3407
|
-
this.editorPreviewRenderScheduler.cancel();
|
|
3408
|
-
this.clearEditorPreview();
|
|
3409
|
-
this.resetEditorSaveIndicator();
|
|
3410
|
-
this.updateEditorActionButton();
|
|
3411
|
-
this.updateEditorDisplayMode();
|
|
3412
|
-
this.embeddedEditor?.setModel(null);
|
|
3413
|
-
this.viewMode = returnViewMode;
|
|
3414
|
-
this.updateContentVisibility();
|
|
3415
|
-
if (returnViewMode === "migration") {
|
|
3416
|
-
this.renderCustomizationMigrationPage();
|
|
3417
|
-
void this.refreshCustomizationMigrationInfo();
|
|
3418
|
-
} else {
|
|
3419
|
-
void this.listWidget?.refresh();
|
|
3420
|
-
}
|
|
3421
|
-
if (this.dimension) {
|
|
3422
|
-
this.layout(this.dimension);
|
|
3423
|
-
}
|
|
3424
|
-
if (returnViewMode === "migration") {
|
|
3425
|
-
this.focusCustomizationMigrationPage();
|
|
3426
|
-
} else {
|
|
3427
|
-
this.listWidget?.focusSearch();
|
|
3428
|
-
}
|
|
3429
|
-
if (backgroundSaveRequest) {
|
|
3430
|
-
const saveRequest = backgroundSaveRequest;
|
|
3431
|
-
void this.saveExistingCustomization(saveRequest).catch(error => {
|
|
3432
|
-
console.error("Failed to save customization changes on exit:", error);
|
|
3433
|
-
this.notificationService.warn(( localize(6646, "Could not save changes to {0}.", basename(saveRequest.fileUri))));
|
|
3434
|
-
});
|
|
3435
|
-
}
|
|
3436
|
-
}
|
|
3437
|
-
focusCustomizationMigrationPage() {
|
|
3438
|
-
if (this.activeMigrationCategoryId !== undefined) {
|
|
3439
|
-
(this.migrationFirstFocusableElement ?? this.migrationLinkElement ?? this.migrationMigrateButton?.element)?.focus();
|
|
3440
|
-
} else {
|
|
3441
|
-
this.migrationDashboard?.focus();
|
|
3442
|
-
}
|
|
3443
|
-
}
|
|
3444
|
-
async getOrCreateBuiltinEditingSession(uri) {
|
|
3445
|
-
const key = ( uri.toString());
|
|
3446
|
-
const existing = this.builtinEditingSessions.get(key);
|
|
3447
|
-
if (existing && !existing.model.isDisposed()) {
|
|
3448
|
-
return existing;
|
|
3449
|
-
}
|
|
3450
|
-
const ref = await this.textModelService.createModelReference(uri);
|
|
3451
|
-
try {
|
|
3452
|
-
const session = {
|
|
3453
|
-
model: this.modelService.createModel(
|
|
3454
|
-
createTextBufferFactoryFromSnapshot(ref.object.textEditorModel.createSnapshot()),
|
|
3455
|
-
{
|
|
3456
|
-
languageId: ref.object.textEditorModel.getLanguageId(),
|
|
3457
|
-
onDidChange: Event.None
|
|
3458
|
-
},
|
|
3459
|
-
( URI.from({
|
|
3460
|
-
scheme: "ai-customization-builtin",
|
|
3461
|
-
path: uri.path,
|
|
3462
|
-
query: generateUuid()
|
|
3463
|
-
})),
|
|
3464
|
-
false
|
|
3465
|
-
),
|
|
3466
|
-
originalContent: ref.object.textEditorModel.getValue()
|
|
3467
|
-
};
|
|
3468
|
-
this.builtinEditingSessions.set(key, session);
|
|
3469
|
-
return session;
|
|
3470
|
-
} finally {
|
|
3471
|
-
ref.dispose();
|
|
3472
|
-
}
|
|
3473
|
-
}
|
|
3474
|
-
createBuiltinPromptSaveRequest(target) {
|
|
3475
|
-
const sourceUri = this.currentEditingUri;
|
|
3476
|
-
const promptType = this.currentEditingPromptType;
|
|
3477
|
-
if (!sourceUri || this.currentEditingSource !== AICustomizationSources.builtin || (promptType !== PromptsType.prompt && promptType !== PromptsType.skill) || !target.folder || target.target === "cancel") {
|
|
3478
|
-
return;
|
|
3479
|
-
}
|
|
3480
|
-
const session = this.builtinEditingSessions.get(( sourceUri.toString()));
|
|
3481
|
-
if (!session || !this._editorContentChanged) {
|
|
3482
|
-
return;
|
|
3483
|
-
}
|
|
3484
|
-
return {
|
|
3485
|
-
target: target.target,
|
|
3486
|
-
folder: target.folder,
|
|
3487
|
-
sourceUri,
|
|
3488
|
-
content: session.model.getValue(),
|
|
3489
|
-
promptType,
|
|
3490
|
-
projectRoot: target.target === "workspace" ? this.workspaceService.getActiveProjectRoot() : undefined
|
|
3491
|
-
};
|
|
3492
|
-
}
|
|
3493
|
-
createExistingCustomizationSaveRequest() {
|
|
3494
|
-
if (!this._editorContentChanged || this.currentEditingSource === AICustomizationSources.builtin || !this.currentEditingUri) {
|
|
3495
|
-
return undefined;
|
|
3496
|
-
}
|
|
3497
|
-
const model = this.currentModelRef?.object.textEditorModel;
|
|
3498
|
-
if (!model) {
|
|
3499
|
-
return undefined;
|
|
3500
|
-
}
|
|
3501
|
-
return {
|
|
3502
|
-
fileUri: this.currentEditingUri,
|
|
3503
|
-
content: model.getValue(),
|
|
3504
|
-
projectRoot: this.currentEditingProjectRoot
|
|
3505
|
-
};
|
|
3506
|
-
}
|
|
3507
|
-
async saveBuiltinPromptCopy(request) {
|
|
3508
|
-
let targetUri;
|
|
3509
|
-
if (request.promptType === PromptsType.skill) {
|
|
3510
|
-
const skillFolderName = basename(dirname(request.sourceUri));
|
|
3511
|
-
targetUri = URI.joinPath(request.folder, skillFolderName, basename(request.sourceUri));
|
|
3512
|
-
} else {
|
|
3513
|
-
targetUri = URI.joinPath(request.folder, basename(request.sourceUri));
|
|
3514
|
-
}
|
|
3515
|
-
await this.fileService.createFolder(dirname(targetUri));
|
|
3516
|
-
await this.fileService.writeFile(targetUri, VSBuffer.fromString(request.content));
|
|
3517
|
-
if (request.target === "workspace" && request.projectRoot) {
|
|
3518
|
-
await this.workspaceService.commitFiles(request.projectRoot, [targetUri]);
|
|
3519
|
-
}
|
|
3520
|
-
}
|
|
3521
|
-
async saveExistingCustomization(request) {
|
|
3522
|
-
await this.fileService.writeFile(request.fileUri, VSBuffer.fromString(request.content));
|
|
3523
|
-
if (request.projectRoot) {
|
|
3524
|
-
await this.workspaceService.commitFiles(request.projectRoot, [request.fileUri]);
|
|
3525
|
-
}
|
|
3526
|
-
}
|
|
3527
|
-
async pickBuiltinPromptSaveTarget() {
|
|
3528
|
-
const items = [];
|
|
3529
|
-
const promptType = this.currentEditingPromptType ?? PromptsType.prompt;
|
|
3530
|
-
const workspaceFolder = resolveWorkspaceTargetDirectory(this.workspaceService, promptType);
|
|
3531
|
-
if (workspaceFolder) {
|
|
3532
|
-
items.push({
|
|
3533
|
-
label: ( localize(6647, "Workspace")),
|
|
3534
|
-
description: this.labelService.getUriLabel(workspaceFolder, {
|
|
3535
|
-
relative: true
|
|
3536
|
-
}),
|
|
3537
|
-
target: "workspace",
|
|
3538
|
-
folder: workspaceFolder
|
|
3539
|
-
});
|
|
3540
|
-
}
|
|
3541
|
-
const userFolder = await resolveUserTargetDirectory(this.promptsService, promptType);
|
|
3542
|
-
if (userFolder) {
|
|
3543
|
-
items.push({
|
|
3544
|
-
label: ( localize(6648, "User")),
|
|
3545
|
-
description: this.labelService.getUriLabel(userFolder, {
|
|
3546
|
-
relative: true
|
|
3547
|
-
}),
|
|
3548
|
-
target: "user",
|
|
3549
|
-
folder: userFolder
|
|
3550
|
-
});
|
|
3551
|
-
}
|
|
3552
|
-
items.push({
|
|
3553
|
-
label: ( localize(6649, "Cancel")),
|
|
3554
|
-
target: "cancel"
|
|
3555
|
-
});
|
|
3556
|
-
return this.quickInputService.pick(items, {
|
|
3557
|
-
canPickMany: false,
|
|
3558
|
-
placeHolder: ( localize(6650, "Select Workspace, User, or Cancel")),
|
|
3559
|
-
matchOnDescription: true
|
|
3560
|
-
});
|
|
3561
|
-
}
|
|
3562
|
-
async handleEditorActionButton() {
|
|
3563
|
-
if (this.editorActionButtonInProgress) {
|
|
3564
|
-
return;
|
|
3565
|
-
}
|
|
3566
|
-
this.editorActionButtonInProgress = true;
|
|
3567
|
-
this.updateEditorActionButton();
|
|
3568
|
-
let backgroundSaveRequest;
|
|
3569
|
-
try {
|
|
3570
|
-
if (this.shouldShowBuiltinSaveAction()) {
|
|
3571
|
-
const selection = await this.pickBuiltinPromptSaveTarget();
|
|
3572
|
-
if (!selection || selection.target === "cancel") {
|
|
3573
|
-
return;
|
|
3574
|
-
}
|
|
3575
|
-
backgroundSaveRequest = this.createBuiltinPromptSaveRequest(selection);
|
|
3576
|
-
if (backgroundSaveRequest) {
|
|
3577
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.saveItem", {
|
|
3578
|
-
promptType: this.currentEditingPromptType ?? "",
|
|
3579
|
-
storage: String(this.currentEditingSource ?? ""),
|
|
3580
|
-
saveTarget: selection.target
|
|
3581
|
-
});
|
|
3582
|
-
}
|
|
3583
|
-
}
|
|
3584
|
-
this.goBackToList();
|
|
3585
|
-
if (backgroundSaveRequest) {
|
|
3586
|
-
const saveRequest = backgroundSaveRequest;
|
|
3587
|
-
void this.saveBuiltinPromptCopy(saveRequest).then(() => {
|
|
3588
|
-
void this.listWidget?.refresh();
|
|
3589
|
-
}, error => {
|
|
3590
|
-
console.error("Failed to save built-in override:", error);
|
|
3591
|
-
this.notificationService.warn(saveRequest.target === "workspace" ? ( localize(6651, "Could not save the override to the workspace.")) : ( localize(6652, "Could not save the override to your user folder.")));
|
|
3592
|
-
});
|
|
3593
|
-
}
|
|
3594
|
-
} finally {
|
|
3595
|
-
this.editorActionButtonInProgress = false;
|
|
3596
|
-
this.updateEditorActionButton();
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
updateEditorActionButton() {
|
|
3600
|
-
this.updateInputDirtyState();
|
|
3601
|
-
if (!this.editorActionButton || !this.editorActionButtonIcon) {
|
|
3602
|
-
return;
|
|
3603
|
-
}
|
|
3604
|
-
const shouldShowBuiltinSaveAction = this.shouldShowBuiltinSaveAction();
|
|
3605
|
-
this.editorActionButtonIcon.className = `codicon codicon-${shouldShowBuiltinSaveAction ? Codicon.save.id : Codicon.arrowLeft.id} editor-action-button-icon`;
|
|
3606
|
-
this.editorActionButton.disabled = this.editorActionButtonInProgress;
|
|
3607
|
-
this.editorActionButton.setAttribute("aria-label", shouldShowBuiltinSaveAction ? ( localize(6653, "Save override")) : this.editorReturnViewMode === "migration" ? (this.getActiveMigrationCategory()?.backLabel ?? ( localize(6654, "Back to migration"))) : ( localize(6641, "Back to list")));
|
|
3608
|
-
this.editorActionButton.title = shouldShowBuiltinSaveAction ? ( localize(6655, "Save override (choose Workspace, User, or Cancel)")) : this.editorReturnViewMode === "migration" ? (this.getActiveMigrationCategory()?.backLabel ?? ( localize(6654, "Back to migration"))) : ( localize(6641, "Back to list"));
|
|
3609
|
-
}
|
|
3610
|
-
shouldShowBuiltinSaveAction() {
|
|
3611
|
-
return this._editorContentChanged && this.currentEditingSource === AICustomizationSources.builtin && (this.currentEditingPromptType === PromptsType.prompt || this.currentEditingPromptType === PromptsType.skill);
|
|
3612
|
-
}
|
|
3613
|
-
updateInputDirtyState() {
|
|
3614
|
-
const input = this.input;
|
|
3615
|
-
if (input instanceof AICustomizationManagementEditorInput) {
|
|
3616
|
-
input.setDirty(this.shouldShowBuiltinSaveAction());
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
async handleBuiltinSave() {
|
|
3620
|
-
if (!this.shouldShowBuiltinSaveAction()) {
|
|
3621
|
-
return false;
|
|
3622
|
-
}
|
|
3623
|
-
const target = await this.pickBuiltinPromptSaveTarget();
|
|
3624
|
-
if (!target || target.target === "cancel") {
|
|
3625
|
-
return false;
|
|
3626
|
-
}
|
|
3627
|
-
const saveRequest = this.createBuiltinPromptSaveRequest(target);
|
|
3628
|
-
if (!saveRequest) {
|
|
3629
|
-
return false;
|
|
3630
|
-
}
|
|
3631
|
-
try {
|
|
3632
|
-
await this.saveBuiltinPromptCopy(saveRequest);
|
|
3633
|
-
this.telemetryService.publicLog2("chatCustomizationEditor.saveItem", {
|
|
3634
|
-
promptType: this.currentEditingPromptType ?? "",
|
|
3635
|
-
storage: String(this.currentEditingSource ?? ""),
|
|
3636
|
-
saveTarget: target.target
|
|
3637
|
-
});
|
|
3638
|
-
this._editorContentChanged = false;
|
|
3639
|
-
this.updateEditorActionButton();
|
|
3640
|
-
return true;
|
|
3641
|
-
} catch (error) {
|
|
3642
|
-
console.error("Failed to save built-in override:", error);
|
|
3643
|
-
this.notificationService.warn(target.target === "workspace" ? ( localize(6651, "Could not save the override to the workspace.")) : ( localize(6652, "Could not save the override to your user folder.")));
|
|
3644
|
-
return false;
|
|
3645
|
-
}
|
|
3646
|
-
}
|
|
3647
|
-
resetEditorSaveIndicator() {
|
|
3648
|
-
this.editorSaveIndicator.className = "editor-save-indicator";
|
|
3649
|
-
this.editorSaveIndicator.title = "";
|
|
3650
|
-
this.editorSaveIndicator.removeAttribute("aria-label");
|
|
3651
|
-
}
|
|
3652
|
-
isStructuredPreviewSupported(promptType) {
|
|
3653
|
-
if (this.configurationService.getValue(ChatConfiguration.ChatCustomizationsStructuredPreviewEnabled) !== true) {
|
|
3654
|
-
return false;
|
|
3655
|
-
}
|
|
3656
|
-
return promptType === PromptsType.agent || promptType === PromptsType.skill || promptType === PromptsType.instructions || promptType === PromptsType.prompt;
|
|
3657
|
-
}
|
|
3658
|
-
onStructuredPreviewSettingChanged() {
|
|
3659
|
-
if (this.viewMode !== "editor") {
|
|
3660
|
-
return;
|
|
3661
|
-
}
|
|
3662
|
-
const supportsStructuredPreview = this.isStructuredPreviewSupported(this.currentEditingPromptType);
|
|
3663
|
-
if (!supportsStructuredPreview) {
|
|
3664
|
-
this.editorDisplayMode = "raw";
|
|
3665
|
-
this.editorPreviewRenderScheduler.cancel();
|
|
3666
|
-
this.clearEditorPreview();
|
|
3667
|
-
} else if (this.editorDisplayMode === "preview") {
|
|
3668
|
-
this.editorPreviewRenderScheduler.schedule();
|
|
3669
|
-
}
|
|
3670
|
-
this.updateEditorDisplayMode();
|
|
3671
|
-
if (this.dimension) {
|
|
3672
|
-
this.layout(this.dimension);
|
|
3673
|
-
}
|
|
3674
|
-
}
|
|
3675
|
-
getCurrentEditingModel() {
|
|
3676
|
-
if (!this.currentEditingUri) {
|
|
3677
|
-
return undefined;
|
|
3678
|
-
}
|
|
3679
|
-
if (this.currentEditingSource === AICustomizationSources.builtin) {
|
|
3680
|
-
return this.builtinEditingSessions.get(( this.currentEditingUri.toString()))?.model;
|
|
3681
|
-
}
|
|
3682
|
-
return this.currentModelRef?.object.textEditorModel;
|
|
3683
|
-
}
|
|
3684
|
-
toggleEditorDisplayMode() {
|
|
3685
|
-
if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
|
|
3686
|
-
return;
|
|
3687
|
-
}
|
|
3688
|
-
this.editorDisplayMode = this.editorDisplayMode === "preview" ? "raw" : "preview";
|
|
3689
|
-
if (this.editorDisplayMode === "preview") {
|
|
3690
|
-
this.editorPreviewRenderScheduler.cancel();
|
|
3691
|
-
this.renderCurrentEditorPreview();
|
|
3692
|
-
}
|
|
3693
|
-
this.updateEditorDisplayMode();
|
|
3694
|
-
if (this.dimension) {
|
|
3695
|
-
this.layout(this.dimension);
|
|
3696
|
-
}
|
|
3697
|
-
if (this.editorDisplayMode === "raw") {
|
|
3698
|
-
this.embeddedEditor?.focus();
|
|
3699
|
-
} else {
|
|
3700
|
-
this.editorModeButton?.focus();
|
|
3701
|
-
}
|
|
3702
|
-
}
|
|
3703
|
-
updateEditorDisplayMode() {
|
|
3704
|
-
const supportsStructuredPreview = this.isStructuredPreviewSupported(this.currentEditingPromptType);
|
|
3705
|
-
const showPreview = supportsStructuredPreview && this.editorDisplayMode === "preview";
|
|
3706
|
-
if (this.editorModeButton) {
|
|
3707
|
-
this.editorModeButton.style.display = supportsStructuredPreview ? "" : "none";
|
|
3708
|
-
this.editorModeButton.textContent = this.getEditorModeButtonLabel();
|
|
3709
|
-
this.editorModeButton.setAttribute("aria-label", this.getEditorModeButtonTooltip());
|
|
3710
|
-
this.editorModeButton.setAttribute("aria-pressed", String(this.editorDisplayMode === "raw"));
|
|
3711
|
-
this.editorModeButton.title = this.getEditorModeButtonTooltip();
|
|
3712
|
-
}
|
|
3713
|
-
if (this.editorPreviewContainer) {
|
|
3714
|
-
this.editorPreviewContainer.style.display = showPreview ? "" : "none";
|
|
3715
|
-
}
|
|
3716
|
-
if (this.embeddedEditorContainer) {
|
|
3717
|
-
this.embeddedEditorContainer.style.display = showPreview ? "none" : "";
|
|
3718
|
-
}
|
|
3719
|
-
}
|
|
3720
|
-
getEditorModeButtonLabel() {
|
|
3721
|
-
if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
|
|
3722
|
-
return "";
|
|
3723
|
-
}
|
|
3724
|
-
if (this.editorDisplayMode === "raw") {
|
|
3725
|
-
return localize(6656, "Preview");
|
|
3726
|
-
}
|
|
3727
|
-
return this.canEditCurrentRaw() ? ( localize(6657, "Edit")) : ( localize(6658, "View Raw"));
|
|
3728
|
-
}
|
|
3729
|
-
getEditorModeButtonTooltip() {
|
|
3730
|
-
if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
|
|
3731
|
-
return "";
|
|
3732
|
-
}
|
|
3733
|
-
if (this.editorDisplayMode === "raw") {
|
|
3734
|
-
return localize(6659, "Show structured preview");
|
|
3735
|
-
}
|
|
3736
|
-
return this.canEditCurrentRaw() ? ( localize(6660, "Edit the raw markdown file")) : ( localize(6661, "Show the raw markdown file"));
|
|
3737
|
-
}
|
|
3738
|
-
canEditCurrentRaw() {
|
|
3739
|
-
const promptType = this.currentEditingPromptType;
|
|
3740
|
-
if (!promptType) {
|
|
3741
|
-
return false;
|
|
3742
|
-
}
|
|
3743
|
-
return (this.currentEditingSource === AICustomizationSources.builtin && (promptType === PromptsType.prompt || promptType === PromptsType.skill)) || !this.currentEditingReadOnly;
|
|
3744
|
-
}
|
|
3745
|
-
scheduleCurrentEditorPreviewRender() {
|
|
3746
|
-
if (this.editorDisplayMode !== "preview") {
|
|
3747
|
-
return;
|
|
3748
|
-
}
|
|
3749
|
-
this.editorPreviewRenderScheduler.schedule();
|
|
3750
|
-
}
|
|
3751
|
-
renderCurrentEditorPreview() {
|
|
3752
|
-
const model = this.getCurrentEditingModel();
|
|
3753
|
-
const promptType = this.currentEditingPromptType;
|
|
3754
|
-
if (!model || !promptType || this.editorDisplayMode !== "preview" || !this.isStructuredPreviewSupported(promptType)) {
|
|
3755
|
-
this.clearEditorPreview();
|
|
3756
|
-
return;
|
|
3757
|
-
}
|
|
3758
|
-
const parsedPromptFile = this.promptsService.getParsedPromptFile(model);
|
|
3759
|
-
this.renderEditorPreview(parsedPromptFile, promptType);
|
|
3760
|
-
}
|
|
3761
|
-
renderEditorPreview(parsedPromptFile, promptType) {
|
|
3762
|
-
if (!this.editorPreviewIssuesContainer || !this.editorPreviewFrontMatterContainer || !this.editorPreviewBodyContainer) {
|
|
3763
|
-
return;
|
|
3764
|
-
}
|
|
3765
|
-
this.editorPreviewDisposables.clear();
|
|
3766
|
-
clearNode(this.editorPreviewIssuesContainer);
|
|
3767
|
-
clearNode(this.editorPreviewFrontMatterContainer);
|
|
3768
|
-
clearNode(this.editorPreviewBodyContainer);
|
|
3769
|
-
const target = getTarget(promptType, parsedPromptFile.header ?? parsedPromptFile.uri);
|
|
3770
|
-
this.renderPreviewIssues(parsedPromptFile);
|
|
3771
|
-
this.renderPreviewFrontMatter(parsedPromptFile, promptType, target);
|
|
3772
|
-
this.renderPreviewBody(parsedPromptFile);
|
|
3773
|
-
}
|
|
3774
|
-
renderPreviewIssues(parsedPromptFile) {
|
|
3775
|
-
if (!this.editorPreviewIssuesContainer || !parsedPromptFile.header?.errors.length) {
|
|
3776
|
-
return;
|
|
3777
|
-
}
|
|
3778
|
-
const issuesContainer = append(this.editorPreviewIssuesContainer, $(".editor-preview-issues-box"));
|
|
3779
|
-
append(issuesContainer, $("div.editor-preview-issues-title")).textContent = ( localize(6662, "Header issues detected"));
|
|
3780
|
-
append(issuesContainer, $("div.editor-preview-issues-description")).textContent = ( localize(6663, "Switch to raw view to fix invalid or unsupported metadata entries."));
|
|
3781
|
-
const list = append(issuesContainer, $("ul.editor-preview-issues-list"));
|
|
3782
|
-
for (const error of parsedPromptFile.header.errors) {
|
|
3783
|
-
append(list, $("li.editor-preview-issues-item")).textContent = error.message;
|
|
3784
|
-
}
|
|
3785
|
-
}
|
|
3786
|
-
renderPreviewFrontMatter(parsedPromptFile, promptType, target) {
|
|
3787
|
-
if (!this.editorPreviewFrontMatterContainer) {
|
|
3788
|
-
return;
|
|
3789
|
-
}
|
|
3790
|
-
const attributes = parsedPromptFile.header?.attributes ?? [];
|
|
3791
|
-
if (!attributes.length) {
|
|
3792
|
-
append(
|
|
3793
|
-
this.editorPreviewFrontMatterContainer,
|
|
3794
|
-
$("div.editor-preview-empty-state")
|
|
3795
|
-
).textContent = ( localize(6664, "No metadata found in this file."));
|
|
3796
|
-
return;
|
|
3797
|
-
}
|
|
3798
|
-
for (const attribute of attributes) {
|
|
3799
|
-
this.renderPreviewAttribute(attribute, promptType, target);
|
|
3800
|
-
}
|
|
3801
|
-
}
|
|
3802
|
-
renderPreviewAttribute(attribute, promptType, target) {
|
|
3803
|
-
if (!this.editorPreviewFrontMatterContainer) {
|
|
3804
|
-
return;
|
|
3805
|
-
}
|
|
3806
|
-
const row = append(this.editorPreviewFrontMatterContainer, $(".editor-preview-row"));
|
|
3807
|
-
const header = append(row, $(".editor-preview-row-header"));
|
|
3808
|
-
append(header, $("div.editor-preview-row-key")).textContent = attribute.key;
|
|
3809
|
-
const helpButton = append(header, $("button.editor-preview-row-help"));
|
|
3810
|
-
helpButton.type = "button";
|
|
3811
|
-
helpButton.setAttribute("aria-label", ( localize(6665, "Show help for '{0}'", attribute.key)));
|
|
3812
|
-
const helpIcon = append(helpButton, $("span.editor-preview-row-help-icon"));
|
|
3813
|
-
helpIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.info));
|
|
3814
|
-
helpIcon.setAttribute("aria-hidden", "true");
|
|
3815
|
-
const description = getAttributeDefinition(attribute.key, promptType, target)?.description ?? ( localize(6666, "Custom metadata field `{0}`.", attribute.key));
|
|
3816
|
-
const helpHover = this.editorPreviewDisposables.add(
|
|
3817
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), helpButton, {
|
|
3818
|
-
markdown: ( new MarkdownString(description)),
|
|
3819
|
-
markdownNotSupportedFallback: description
|
|
3820
|
-
})
|
|
3821
|
-
);
|
|
3822
|
-
this.editorPreviewDisposables.add(addDisposableListener(helpButton, "click", e => {
|
|
3823
|
-
e.preventDefault();
|
|
3824
|
-
e.stopPropagation();
|
|
3825
|
-
helpHover.show(true);
|
|
3826
|
-
}));
|
|
3827
|
-
const valueElement = append(row, $("div.editor-preview-row-value"));
|
|
3828
|
-
const valueText = this.stringifyPreviewValue(attribute.value);
|
|
3829
|
-
valueElement.textContent = valueText;
|
|
3830
|
-
valueElement.classList.toggle("multiline", valueText.includes("\n"));
|
|
3831
|
-
}
|
|
3832
|
-
renderPreviewBody(parsedPromptFile) {
|
|
3833
|
-
if (!this.editorPreviewBodyContainer) {
|
|
3834
|
-
return;
|
|
3835
|
-
}
|
|
3836
|
-
const bodyContent = parsedPromptFile.body?.getContent() ?? "";
|
|
3837
|
-
if (!bodyContent.trim()) {
|
|
3838
|
-
append(this.editorPreviewBodyContainer, $("div.editor-preview-empty-state")).textContent = ( localize(6667, "No markdown body found in this file."));
|
|
3839
|
-
return;
|
|
3840
|
-
}
|
|
3841
|
-
const markdown = ( new MarkdownString(bodyContent, {
|
|
3842
|
-
supportThemeIcons: true
|
|
3843
|
-
}));
|
|
3844
|
-
markdown.baseUri = parsedPromptFile.uri;
|
|
3845
|
-
const renderedMarkdown = this.editorPreviewDisposables.add(this.markdownRendererService.render(markdown));
|
|
3846
|
-
this.editorPreviewBodyContainer.appendChild(renderedMarkdown.element);
|
|
3847
|
-
}
|
|
3848
|
-
stringifyPreviewValue(value) {
|
|
3849
|
-
switch (value.type) {
|
|
3850
|
-
case "scalar":
|
|
3851
|
-
return value.value;
|
|
3852
|
-
case "sequence":
|
|
3853
|
-
if (value.items.every(item => item.type === "scalar")) {
|
|
3854
|
-
return ( value.items.map(item => item.value)).join("\n");
|
|
3855
|
-
}
|
|
3856
|
-
return JSON.stringify(this.toPreviewObject(value), null, 2);
|
|
3857
|
-
case "map":
|
|
3858
|
-
return JSON.stringify(this.toPreviewObject(value), null, 2);
|
|
3859
|
-
}
|
|
3860
|
-
}
|
|
3861
|
-
toPreviewObject(value) {
|
|
3862
|
-
switch (value.type) {
|
|
3863
|
-
case "scalar":
|
|
3864
|
-
return value.value;
|
|
3865
|
-
case "sequence":
|
|
3866
|
-
return ( value.items.map(item => this.toPreviewObject(item)));
|
|
3867
|
-
case "map":
|
|
3868
|
-
{
|
|
3869
|
-
const entries = {};
|
|
3870
|
-
for (const property of value.properties) {
|
|
3871
|
-
entries[property.key.value] = this.toPreviewObject(property.value);
|
|
3872
|
-
}
|
|
3873
|
-
return entries;
|
|
3874
|
-
}
|
|
3875
|
-
}
|
|
3876
|
-
}
|
|
3877
|
-
clearEditorPreview() {
|
|
3878
|
-
this.editorPreviewRenderScheduler.cancel();
|
|
3879
|
-
this.editorPreviewDisposables.clear();
|
|
3880
|
-
if (this.editorPreviewIssuesContainer) {
|
|
3881
|
-
clearNode(this.editorPreviewIssuesContainer);
|
|
3882
|
-
}
|
|
3883
|
-
if (this.editorPreviewFrontMatterContainer) {
|
|
3884
|
-
clearNode(this.editorPreviewFrontMatterContainer);
|
|
3885
|
-
}
|
|
3886
|
-
if (this.editorPreviewBodyContainer) {
|
|
3887
|
-
clearNode(this.editorPreviewBodyContainer);
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
disposeBuiltinEditingSessions() {
|
|
3891
|
-
for (const session of ( this.builtinEditingSessions.values())) {
|
|
3892
|
-
session.model.dispose();
|
|
3893
|
-
}
|
|
3894
|
-
this.builtinEditingSessions.clear();
|
|
3895
|
-
}
|
|
3896
|
-
disposeBuiltinEditingSession(uri) {
|
|
3897
|
-
const key = ( uri.toString());
|
|
3898
|
-
const session = this.builtinEditingSessions.get(key);
|
|
3899
|
-
if (!session) {
|
|
3900
|
-
return;
|
|
3901
|
-
}
|
|
3902
|
-
session.model.dispose();
|
|
3903
|
-
this.builtinEditingSessions.delete(key);
|
|
3904
|
-
}
|
|
3905
|
-
createEmbeddedMcpDetail() {
|
|
3906
|
-
if (!this.mcpDetailContainer) {
|
|
3907
|
-
return;
|
|
3908
|
-
}
|
|
3909
|
-
const detailBody = append(this.mcpDetailContainer, $(".mcp-detail-editor-container"));
|
|
3910
|
-
this.embeddedMcpDetail = this.editorDisposables.add(
|
|
3911
|
-
this.instantiationService.createInstance(EmbeddedMcpServerDetail, detailBody)
|
|
3912
|
-
);
|
|
3913
|
-
const backButton = append(this.embeddedMcpDetail.leadingSlot, $("button.editor-back-button"));
|
|
3914
|
-
this.mcpDetailBackButton = backButton;
|
|
3915
|
-
backButton.setAttribute("type", "button");
|
|
3916
|
-
backButton.setAttribute("aria-label", ( localize(6668, "Back to MCP servers")));
|
|
3917
|
-
this.editorDisposables.add(
|
|
3918
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(6669, "Back to MCP servers")))
|
|
3919
|
-
);
|
|
3920
|
-
const backIconEl = append(
|
|
3921
|
-
backButton,
|
|
3922
|
-
$(`.codicon.codicon-${Codicon.arrowLeft.id}.editor-action-button-icon`)
|
|
3923
|
-
);
|
|
3924
|
-
backIconEl.setAttribute("aria-hidden", "true");
|
|
3925
|
-
this.editorDisposables.add(addDisposableListener(backButton, "click", () => {
|
|
3926
|
-
this.goBackFromMcpDetail();
|
|
3927
|
-
}));
|
|
3928
|
-
}
|
|
3929
|
-
async showEmbeddedMcpDetail(server) {
|
|
3930
|
-
if (!this.embeddedMcpDetail) {
|
|
3931
|
-
this.createEmbeddedMcpDetail();
|
|
3932
|
-
}
|
|
3933
|
-
if (!this.embeddedMcpDetail) {
|
|
3934
|
-
return;
|
|
3935
|
-
}
|
|
3936
|
-
this.viewMode = "mcpDetail";
|
|
3937
|
-
this.updateContentVisibility();
|
|
3938
|
-
this.mcpDetailDisposables.clear();
|
|
3939
|
-
this.embeddedMcpDetail.setInput(server);
|
|
3940
|
-
if (this.dimension) {
|
|
3941
|
-
this.layout(this.dimension);
|
|
3942
|
-
}
|
|
3943
|
-
this.mcpDetailBackButton?.focus();
|
|
3944
|
-
}
|
|
3945
|
-
goBackFromMcpDetail() {
|
|
3946
|
-
this.mcpDetailDisposables.clear();
|
|
3947
|
-
this.embeddedMcpDetail?.clearInput();
|
|
3948
|
-
this.viewMode = "list";
|
|
3949
|
-
this.updateContentVisibility();
|
|
3950
|
-
if (this.dimension) {
|
|
3951
|
-
this.layout(this.dimension);
|
|
3952
|
-
}
|
|
3953
|
-
this.mcpListWidget?.focusSearch();
|
|
3954
|
-
}
|
|
3955
|
-
createEmbeddedPluginDetail() {
|
|
3956
|
-
if (!this.pluginDetailContainer) {
|
|
3957
|
-
return;
|
|
3958
|
-
}
|
|
3959
|
-
const detailBody = append(this.pluginDetailContainer, $(".plugin-detail-editor-container"));
|
|
3960
|
-
this.embeddedPluginDetail = this.editorDisposables.add(
|
|
3961
|
-
this.instantiationService.createInstance(EmbeddedAgentPluginDetail, detailBody)
|
|
3962
|
-
);
|
|
3963
|
-
this.editorDisposables.add(this.embeddedPluginDetail.onDidRequestOpenSkill(uri => {
|
|
3964
|
-
this.openSkillFromPluginDetail(uri);
|
|
3965
|
-
}));
|
|
3966
|
-
this.editorDisposables.add(this.embeddedPluginDetail.onDidRequestOpenAgent(uri => {
|
|
3967
|
-
this.openPromptsItemFromPluginDetail(AICustomizationManagementSection.Agents, uri);
|
|
3968
|
-
}));
|
|
3969
|
-
this.editorDisposables.add(this.embeddedPluginDetail.onDidRequestOpenSection(section => {
|
|
3970
|
-
this.openSectionFromPluginDetail(section);
|
|
3971
|
-
}));
|
|
3972
|
-
this.editorDisposables.add(this.embeddedPluginDetail.onDidUninstall(() => {
|
|
3973
|
-
this.goBackFromPluginDetail();
|
|
3974
|
-
}));
|
|
3975
|
-
const backButton = append(this.embeddedPluginDetail.leadingSlot, $("button.editor-back-button"));
|
|
3976
|
-
backButton.setAttribute("type", "button");
|
|
3977
|
-
backButton.setAttribute("aria-label", ( localize(6670, "Back to plugins")));
|
|
3978
|
-
this.editorDisposables.add(
|
|
3979
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(6671, "Back to plugins")))
|
|
3980
|
-
);
|
|
3981
|
-
const backIconEl = append(backButton, $(`.codicon.codicon-${Codicon.arrowLeft.id}`));
|
|
3982
|
-
backIconEl.setAttribute("aria-hidden", "true");
|
|
3983
|
-
this.editorDisposables.add(addDisposableListener(backButton, "click", () => {
|
|
3984
|
-
this.goBackFromPluginDetail();
|
|
3985
|
-
}));
|
|
3986
|
-
}
|
|
3987
|
-
async showEmbeddedPluginDetail(item) {
|
|
3988
|
-
if (!this.embeddedPluginDetail) {
|
|
3989
|
-
return;
|
|
3990
|
-
}
|
|
3991
|
-
this.viewMode = "pluginDetail";
|
|
3992
|
-
this.updateContentVisibility();
|
|
3993
|
-
this.pluginDetailDisposables.clear();
|
|
3994
|
-
this.embeddedPluginDetail.setInput(item);
|
|
3995
|
-
if (this.dimension) {
|
|
3996
|
-
this.layout(this.dimension);
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3999
|
-
async openSkillFromPluginDetail(uri) {
|
|
4000
|
-
await this.openPromptsItemFromPluginDetail(AICustomizationManagementSection.Skills, uri);
|
|
4001
|
-
}
|
|
4002
|
-
async openPromptsItemFromPluginDetail(section, uri) {
|
|
4003
|
-
this.pluginDetailDisposables.clear();
|
|
4004
|
-
this.embeddedPluginDetail?.clearInput();
|
|
4005
|
-
this.pluginDetailReturnSection = undefined;
|
|
4006
|
-
this.viewMode = "list";
|
|
4007
|
-
this.selectedSection = section;
|
|
4008
|
-
this.sectionContextKey.set(section);
|
|
4009
|
-
this.storageService.store(
|
|
4010
|
-
AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY,
|
|
4011
|
-
section,
|
|
4012
|
-
StorageScope.PROFILE,
|
|
4013
|
-
StorageTarget.USER
|
|
4014
|
-
);
|
|
4015
|
-
this.updateContentVisibility();
|
|
4016
|
-
const navigationGeneration = this.contentNavigationGeneration;
|
|
4017
|
-
await this.listWidget.setSection(section);
|
|
4018
|
-
const modelSection = ITEMS_MODEL_SECTIONS.find(s => s === section);
|
|
4019
|
-
if (modelSection) {
|
|
4020
|
-
await this.itemsModel.whenSectionLoaded(modelSection);
|
|
4021
|
-
if (!isCurrentPluginContributionNavigation(
|
|
4022
|
-
navigationGeneration,
|
|
4023
|
-
this.contentNavigationGeneration,
|
|
4024
|
-
section,
|
|
4025
|
-
this.selectedSection,
|
|
4026
|
-
this.viewMode === "list"
|
|
4027
|
-
)) {
|
|
4028
|
-
return;
|
|
4029
|
-
}
|
|
4030
|
-
const item = this.itemsModel.getItems(modelSection).get().find(item => isEqual(item.uri, uri));
|
|
4031
|
-
if (item) {
|
|
4032
|
-
const source = item.source;
|
|
4033
|
-
const isWorkspaceFile = source === AICustomizationSources.local;
|
|
4034
|
-
const isReadOnly = !source || source === AICustomizationSources.extension || source === AICustomizationSources.plugin || source === AICustomizationSources.builtin;
|
|
4035
|
-
this.showEmbeddedEditor(
|
|
4036
|
-
item.uri,
|
|
4037
|
-
item.name,
|
|
4038
|
-
item.promptType,
|
|
4039
|
-
source ?? AICustomizationSources.builtin,
|
|
4040
|
-
isWorkspaceFile,
|
|
4041
|
-
isReadOnly
|
|
4042
|
-
);
|
|
4043
|
-
}
|
|
4044
|
-
}
|
|
4045
|
-
this.ensureSectionsListReflectsActiveSection(section);
|
|
4046
|
-
if (this.dimension) {
|
|
4047
|
-
this.layout(this.dimension);
|
|
4048
|
-
}
|
|
4049
|
-
}
|
|
4050
|
-
openSectionFromPluginDetail(section) {
|
|
4051
|
-
this.pluginDetailDisposables.clear();
|
|
4052
|
-
this.embeddedPluginDetail?.clearInput();
|
|
4053
|
-
this.pluginDetailReturnSection = undefined;
|
|
4054
|
-
this.viewMode = "list";
|
|
4055
|
-
this.updateContentVisibility();
|
|
4056
|
-
this.selectSectionById(section);
|
|
4057
|
-
}
|
|
4058
|
-
async showPluginDetail(item) {
|
|
4059
|
-
if (this.selectedSection !== AICustomizationManagementSection.Plugins) {
|
|
4060
|
-
this.pluginDetailReturnSection = this.selectedSection ?? AICustomizationManagementSection.Agents;
|
|
4061
|
-
}
|
|
4062
|
-
await this.showEmbeddedPluginDetail(item);
|
|
4063
|
-
}
|
|
4064
|
-
goBackFromPluginDetail() {
|
|
4065
|
-
this.pluginDetailDisposables.clear();
|
|
4066
|
-
this.embeddedPluginDetail?.clearInput();
|
|
4067
|
-
const returnSection = this.pluginDetailReturnSection;
|
|
4068
|
-
this.pluginDetailReturnSection = undefined;
|
|
4069
|
-
if (returnSection) {
|
|
4070
|
-
this.viewMode = "list";
|
|
4071
|
-
this.updateContentVisibility();
|
|
4072
|
-
this.selectSection(returnSection);
|
|
4073
|
-
} else {
|
|
4074
|
-
this.viewMode = "list";
|
|
4075
|
-
this.updateContentVisibility();
|
|
4076
|
-
this.pluginListWidget?.focusSearch();
|
|
4077
|
-
}
|
|
4078
|
-
if (this.dimension) {
|
|
4079
|
-
this.layout(this.dimension);
|
|
4080
|
-
}
|
|
4081
|
-
}
|
|
4082
|
-
createEmbeddedToolDetail() {
|
|
4083
|
-
if (!this.toolsDetailContainer) {
|
|
4084
|
-
return;
|
|
4085
|
-
}
|
|
4086
|
-
const detailBody = append(this.toolsDetailContainer, $(".tools-detail-editor-container"));
|
|
4087
|
-
this.embeddedToolDetail = this.editorDisposables.add(
|
|
4088
|
-
this.instantiationService.createInstance(EmbeddedExtensionToolsDetail, detailBody)
|
|
4089
|
-
);
|
|
4090
|
-
const backButton = append(this.embeddedToolDetail.leadingSlot, $("button.editor-back-button"));
|
|
4091
|
-
backButton.setAttribute("type", "button");
|
|
4092
|
-
backButton.setAttribute("aria-label", ( localize(6672, "Back to tools")));
|
|
4093
|
-
this.editorDisposables.add(
|
|
4094
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(6673, "Back to tools")))
|
|
4095
|
-
);
|
|
4096
|
-
const backIconEl = append(backButton, $(`.codicon.codicon-${Codicon.arrowLeft.id}`));
|
|
4097
|
-
backIconEl.setAttribute("aria-hidden", "true");
|
|
4098
|
-
this.editorDisposables.add(addDisposableListener(backButton, "click", () => {
|
|
4099
|
-
this.goBackFromToolDetail();
|
|
4100
|
-
}));
|
|
4101
|
-
}
|
|
4102
|
-
async showEmbeddedToolDetail(extension) {
|
|
4103
|
-
if (!this.embeddedToolDetail) {
|
|
4104
|
-
return;
|
|
4105
|
-
}
|
|
4106
|
-
this.viewMode = "toolsDetail";
|
|
4107
|
-
this.updateContentVisibility();
|
|
4108
|
-
this.toolsDetailDisposables.clear();
|
|
4109
|
-
this.embeddedToolDetail.setInput(extension);
|
|
4110
|
-
if (this.dimension) {
|
|
4111
|
-
this.layout(this.dimension);
|
|
4112
|
-
}
|
|
4113
|
-
}
|
|
4114
|
-
goBackFromToolDetail() {
|
|
4115
|
-
this.toolsDetailDisposables.clear();
|
|
4116
|
-
this.embeddedToolDetail?.clearInput();
|
|
4117
|
-
this.viewMode = "list";
|
|
4118
|
-
this.updateContentVisibility();
|
|
4119
|
-
if (this.dimension) {
|
|
4120
|
-
this.layout(this.dimension);
|
|
4121
|
-
}
|
|
4122
|
-
this.toolsListWidget?.focusSearch();
|
|
4123
|
-
}
|
|
4124
|
-
};
|
|
4125
|
-
AICustomizationManagementEditor = AICustomizationManagementEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IInstantiationService)), ( __param(5, IContextKeyService)), ( __param(6, IOpenerService)), ( __param(7, ICommandService)), ( __param(8, IAICustomizationWorkspaceService)), ( __param(9, IPromptsService)), ( __param(10, ICustomizationMigrationService)), ( __param(11, ITextModelService)), ( __param(12, IConfigurationService)), ( __param(13, IWorkingCopyService)), ( __param(14, IHoverService)), ( __param(15, IMarkdownRendererService)), ( __param(16, IModelService)), ( __param(17, IQuickInputService)), ( __param(18, IFileService)), ( __param(19, INotificationService)), ( __param(20, IFileDialogService)), ( __param(21, IDialogService)), ( __param(22, IContextMenuService)), ( __param(23, ICustomizationHarnessService)), ( __param(24, IViewsService)), ( __param(25, ILabelService)), ( __param(26, IAICustomizationItemsModel)), ( __param(27, IMcpService)), ( __param(28, IMcpWorkbenchService)), ( __param(29, IAgentHostCustomizationService))], AICustomizationManagementEditor));
|
|
4126
|
-
|
|
4127
|
-
export { AICustomizationManagementEditor, isCurrentPluginContributionNavigation };
|