@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.
Files changed (746) hide show
  1. package/common.d.ts +9 -0
  2. package/common.js +372 -0
  3. package/index.d.ts +4 -6
  4. package/index.js +20 -367
  5. package/package.json +12 -5
  6. package/session.d.ts +8 -0
  7. package/session.js +56 -0
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +5 -2
  9. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +1 -1
  10. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +2 -2
  11. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +35 -11
  12. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +1 -1
  13. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -2
  14. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +34 -18
  15. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.d.ts +1 -1
  16. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
  17. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +54 -54
  18. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +20 -23
  19. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +8 -8
  20. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +3 -1
  21. package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.d.ts +198 -0
  22. package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.js +197 -0
  23. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +14 -14
  24. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +1 -1
  25. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.d.ts +63 -0
  26. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.js +7 -0
  27. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.d.ts +51 -0
  28. package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.js +6 -0
  29. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
  30. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +1 -1
  31. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +6 -6
  32. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/media/mobileMultiDiffView.css +215 -0
  33. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.d.ts +28 -0
  34. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.js +429 -0
  35. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.d.ts +100 -0
  36. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.js +675 -0
  37. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.d.ts +86 -0
  38. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.js +860 -0
  39. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.d.ts +35 -0
  40. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.js +67 -0
  41. package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.d.ts +1 -0
  42. package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.js +41 -0
  43. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +85 -0
  44. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +247 -0
  45. package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.d.ts +16 -0
  46. package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.js +71 -0
  47. package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.d.ts +15 -0
  48. package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.js +106 -0
  49. package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.d.ts +1 -0
  50. package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.js +438 -0
  51. package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.d.ts +8 -0
  52. package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.js +25 -0
  53. package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.d.ts +1 -0
  54. package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.js +173 -0
  55. package/vscode/src/vs/sessions/contrib/chat/browser/media/runScriptAction.css +186 -0
  56. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +9 -0
  57. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.d.ts +12 -0
  58. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.js +104 -0
  59. package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.d.ts +15 -0
  60. package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.js +23 -0
  61. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.d.ts +51 -0
  62. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.js +151 -0
  63. package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.d.ts +32 -0
  64. package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.js +85 -0
  65. package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.d.ts +14 -0
  66. package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.js +20 -0
  67. package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.d.ts +1 -0
  68. package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.js +34 -0
  69. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.d.ts +39 -0
  70. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.js +828 -0
  71. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.d.ts +48 -0
  72. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.js +215 -0
  73. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.d.ts +27 -0
  74. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.js +237 -0
  75. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.d.ts +10 -0
  76. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.js +348 -0
  77. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.d.ts +6 -0
  78. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.js +35 -0
  79. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.d.ts +45 -0
  80. package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.js +189 -0
  81. package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.d.ts +3 -0
  82. package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.js +17 -0
  83. package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +14 -0
  84. package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +381 -0
  85. package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.d.ts +23 -0
  86. package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.js +48 -0
  87. package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.d.ts +40 -0
  88. package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.js +116 -0
  89. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.d.ts +1 -0
  90. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.js +300 -0
  91. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.d.ts +1 -0
  92. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.js +74 -0
  93. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.d.ts +55 -0
  94. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.js +103 -0
  95. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.d.ts +50 -0
  96. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.js +72 -0
  97. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.d.ts +1 -0
  98. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.js +70 -0
  99. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.d.ts +69 -0
  100. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.js +151 -0
  101. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.d.ts +17 -0
  102. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.js +39 -0
  103. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.d.ts +31 -0
  104. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.js +150 -0
  105. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +1 -0
  106. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +42 -0
  107. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +19 -0
  108. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +199 -0
  109. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +104 -0
  110. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +301 -0
  111. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +518 -0
  112. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +3121 -0
  113. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.d.ts +1 -0
  114. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.js +37 -0
  115. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.d.ts +25 -0
  116. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.js +97 -0
  117. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.d.ts +74 -0
  118. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.js +355 -0
  119. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.d.ts +135 -0
  120. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.js +521 -0
  121. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.d.ts +26 -0
  122. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.js +86 -0
  123. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +1 -0
  124. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +14 -0
  125. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +166 -0
  126. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +586 -0
  127. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.d.ts +15 -0
  128. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.js +47 -0
  129. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.d.ts +45 -0
  130. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.js +109 -0
  131. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +49 -0
  132. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +69 -0
  133. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.d.ts +47 -0
  134. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.js +109 -0
  135. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.d.ts +1 -0
  136. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.js +72 -0
  137. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.d.ts +79 -0
  138. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.js +353 -0
  139. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.d.ts +1 -0
  140. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.js +161 -0
  141. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.d.ts +95 -0
  142. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.js +172 -0
  143. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostFilter.css +259 -0
  144. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostPickerSheet.css +351 -0
  145. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.d.ts +36 -0
  146. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.js +236 -0
  147. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.d.ts +80 -0
  148. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js +686 -0
  149. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.d.ts +20 -0
  150. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1210 -0
  151. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.d.ts +31 -0
  152. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.js +136 -0
  153. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.d.ts +103 -0
  154. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.js +173 -0
  155. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.d.ts +1 -0
  156. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.js +51 -0
  157. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.d.ts +74 -0
  158. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.js +438 -0
  159. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.d.ts +14 -0
  160. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.js +52 -0
  161. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.d.ts +44 -0
  162. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js +171 -0
  163. package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.d.ts +1 -0
  164. package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.js +98 -0
  165. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.d.ts +24 -0
  166. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.js +142 -0
  167. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +104 -0
  168. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +827 -0
  169. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +15 -0
  170. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +71 -0
  171. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +16 -0
  172. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +95 -0
  173. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +22 -0
  174. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +286 -0
  175. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +10 -0
  176. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +38 -0
  177. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
  178. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
  179. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +130 -0
  180. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +907 -0
  181. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +10 -0
  182. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +28 -0
  183. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +27 -0
  184. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +167 -0
  185. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +46 -0
  186. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +358 -0
  187. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +35 -35
  188. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +4 -4
  189. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +3 -3
  190. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +20 -20
  191. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +6 -6
  192. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +3 -3
  193. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
  194. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  195. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  196. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +1 -1
  197. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
  198. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  199. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
  200. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  201. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
  202. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  203. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
  204. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
  205. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  206. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +14 -14
  207. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  208. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +2 -2
  209. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +40 -40
  210. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
  211. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +27 -31
  212. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  213. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +97 -97
  215. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +5 -3
  216. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +1 -1
  217. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +17 -17
  218. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +11 -11
  219. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  220. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +11 -11
  221. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  222. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +8 -8
  223. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  224. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +15 -15
  225. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  226. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +13 -13
  227. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
  228. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +17 -17
  229. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  230. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
  231. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  232. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
  233. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +20 -20
  234. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +50 -42
  235. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +11 -11
  236. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +9 -5
  237. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  238. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +6 -6
  239. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +1 -1
  240. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +3 -3
  241. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -12
  242. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +1 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +20 -20
  244. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +3 -3
  245. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +8 -6
  246. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +2 -7
  247. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +4 -4
  248. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +2 -2
  249. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +7 -7
  250. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +1 -1
  251. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +431 -19
  252. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +7 -7
  253. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +3 -1
  254. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +1 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +11 -11
  256. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +1 -1
  257. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  258. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +1 -1
  259. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +4 -4
  260. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +4 -2
  261. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +1 -1
  262. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +3 -3
  263. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +1 -1
  264. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +88 -77
  265. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +3 -3
  266. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +48 -43
  267. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +4 -4
  269. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +1 -1
  270. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +2 -2
  271. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +9 -4
  273. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +2 -2
  274. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +4 -4
  275. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +1 -1
  276. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +1 -1
  277. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +8 -6
  278. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +2 -2
  279. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +12 -3
  280. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +3 -3
  281. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +1 -1
  282. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +5 -5
  283. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +1 -1
  284. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +1 -1
  285. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +1 -1
  286. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +9 -9
  287. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -4
  288. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +1 -1
  289. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +55 -53
  290. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +1 -1
  291. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +7 -7
  292. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +3 -3
  293. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  294. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +6 -6
  295. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  296. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -25
  297. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +20 -20
  298. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  299. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -5
  300. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +1 -1
  301. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +1 -1
  302. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
  303. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +48 -48
  304. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +7 -7
  305. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +1 -1
  306. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +26 -23
  307. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +1 -1
  308. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +9 -9
  309. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +9 -9
  310. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +1 -1
  311. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +1 -1
  312. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -2
  313. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +393 -419
  314. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +1 -1
  315. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +43 -43
  316. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +10 -10
  317. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +1 -1
  318. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +1 -1
  319. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +1 -1
  320. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +36 -36
  321. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +1 -1
  322. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +136 -136
  323. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +75 -75
  324. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +1 -1
  325. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  326. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +1 -1
  327. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  328. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
  329. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
  330. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  331. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +1 -1
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +8 -8
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +26 -26
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +7 -7
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  339. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +1 -1
  340. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +18 -18
  341. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +1 -1
  342. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +27 -27
  343. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +1 -1
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +1 -1
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +36 -36
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +1 -1
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +32 -36
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +42 -42
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +13 -13
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +5 -5
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +19 -19
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +12 -12
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +15 -15
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +8 -8
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +3 -3
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +18 -18
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +10 -10
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +12 -12
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -2
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +4 -4
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +5 -5
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +5 -5
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +4 -4
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +9 -9
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +2 -2
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +36 -36
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +18 -16
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +39 -39
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +2 -0
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +57 -0
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +19 -19
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +1 -1
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +7 -7
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +37 -37
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +59 -54
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +39 -37
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +9 -9
  397. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  398. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  399. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +2 -2
  400. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +6 -6
  401. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  402. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +2 -2
  403. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +1 -1
  404. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +2 -2
  405. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +6 -6
  406. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +7 -7
  407. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +3 -3
  408. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
  409. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +30 -30
  410. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +21 -17
  411. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +7 -7
  412. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
  413. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  414. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +3 -3
  415. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +5 -5
  416. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
  417. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -10
  418. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +8 -8
  419. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +5 -5
  420. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +4 -4
  421. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +5 -2
  422. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +6 -6
  423. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  424. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +5 -5
  425. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +12 -12
  426. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +4 -4
  427. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +4 -4
  428. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +1 -1
  429. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +37 -30
  430. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +3 -3
  431. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
  432. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +46 -42
  433. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +33 -33
  434. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +10 -10
  435. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +3 -3
  436. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +68 -4
  437. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +12 -12
  438. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  439. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
  440. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +1 -1
  441. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +10 -10
  442. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +3 -3
  443. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
  444. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +25 -25
  445. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  446. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +1 -1
  447. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +2 -2
  448. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +1 -1
  449. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +1 -1
  450. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +13 -13
  451. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +1 -1
  452. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +4 -4
  453. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +2 -2
  454. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +97 -93
  455. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +4 -4
  456. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +14 -6
  457. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/editorHoverWrapper.js +1 -1
  458. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
  459. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  460. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -2
  461. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +19 -19
  462. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +3 -3
  463. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +1 -1
  464. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +253 -0
  465. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +20 -0
  466. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +1 -1
  467. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +3 -3
  468. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -1
  469. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +28 -26
  470. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +2 -2
  471. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +4 -4
  472. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -2
  473. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +14 -14
  474. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +1 -1
  475. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +1 -1
  476. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +19 -19
  477. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +2 -2
  478. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +20 -20
  479. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +65 -0
  480. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +698 -0
  481. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +13 -13
  482. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +18 -12
  483. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  484. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +157 -157
  485. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +36 -0
  486. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +239 -0
  487. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +21 -0
  488. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +143 -0
  489. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +24 -0
  490. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +298 -0
  491. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +25 -0
  492. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +177 -0
  493. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +73 -0
  494. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +577 -0
  495. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +11 -0
  496. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +90 -0
  497. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +16 -0
  498. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +130 -0
  499. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +12 -0
  500. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +53 -0
  501. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +5 -0
  502. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +12 -0
  503. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +10 -0
  504. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +91 -0
  505. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +1 -1
  506. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +38 -0
  507. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +518 -0
  508. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +6 -0
  509. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +231 -0
  510. package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.js +5 -1
  511. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +6 -6
  512. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
  513. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +13 -13
  514. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  515. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  516. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
  517. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +16 -16
  518. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +3 -3
  519. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +3 -3
  520. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +1 -1
  521. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +5 -5
  522. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +29 -25
  523. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  524. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +12 -12
  525. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +6 -6
  526. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  527. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
  528. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
  529. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  530. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +22 -22
  531. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  532. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
  533. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +4 -2
  534. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +4 -4
  535. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +1 -1
  536. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +15 -15
  537. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +2 -2
  538. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +7 -7
  539. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -5
  540. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +1 -1
  541. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  542. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +18 -18
  543. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +9 -9
  544. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +28 -25
  545. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  546. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  547. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  548. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  549. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +4 -4
  550. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  551. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +78 -78
  552. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +1 -1
  553. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  554. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
  555. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
  556. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
  557. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  558. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +1 -1
  559. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandParser.js +3 -3
  560. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +3 -3
  561. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +1 -1
  562. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +7 -7
  563. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +4 -4
  564. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +3 -3
  565. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +4 -4
  566. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +1 -1
  567. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +1 -1
  568. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +6 -6
  569. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +25 -25
  570. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.d.ts +0 -603
  571. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +0 -1911
  572. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +0 -9
  573. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +0 -20
  574. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +0 -144
  575. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +0 -20
  576. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +0 -204
  577. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +0 -440
  578. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +0 -47
  579. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +0 -75
  580. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +0 -68
  581. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +0 -161
  582. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +0 -16
  583. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +0 -14
  584. package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +0 -261
  585. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +0 -67
  586. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +0 -39
  587. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +0 -169
  588. package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +0 -130
  589. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +0 -41
  590. package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +0 -42
  591. package/vscode/src/vs/platform/agentHost/common/customAgents.js +0 -20
  592. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +0 -110
  593. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +0 -79
  594. package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +0 -4
  595. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +0 -1
  596. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +0 -26
  597. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +0 -75
  598. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +0 -84
  599. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +0 -461
  600. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +0 -803
  601. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +0 -18
  602. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +0 -89
  603. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +0 -4
  604. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +0 -37
  605. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +0 -4
  606. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +0 -45
  607. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +0 -13
  608. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +0 -147
  609. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +0 -6
  610. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +0 -544
  611. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +0 -6
  612. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +0 -30
  613. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +0 -6
  614. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +0 -430
  615. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +0 -6
  616. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +0 -114
  617. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +0 -17
  618. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +0 -9
  619. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +0 -1
  620. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +0 -7
  621. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +0 -67
  622. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +0 -117
  623. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +0 -106
  624. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +0 -23
  625. package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +0 -15
  626. package/vscode/src/vs/platform/agentHost/common/transportConstants.js +0 -6
  627. package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +0 -24
  628. package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +0 -15
  629. package/vscode/src/vs/platform/domWidget/browser/domWidget.d.ts +0 -52
  630. package/vscode/src/vs/platform/domWidget/browser/domWidget.js +0 -53
  631. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -54
  632. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -210
  633. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -8
  634. package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -10
  635. package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +0 -29
  636. package/vscode/src/vs/workbench/browser/chatChangesPill.js +0 -84
  637. package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +0 -19
  638. package/vscode/src/vs/workbench/common/chatPullRequest.js +0 -53
  639. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +0 -30
  640. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +0 -37
  641. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +0 -30
  642. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +0 -9
  643. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +0 -35
  644. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +0 -73
  645. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +0 -51
  646. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +0 -167
  647. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +0 -3
  648. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +0 -62
  649. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +0 -104
  650. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +0 -115
  651. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +0 -168
  652. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +0 -35
  653. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +0 -294
  654. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -66
  655. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +0 -23
  656. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -147
  657. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -31
  658. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +0 -83
  659. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +0 -55
  660. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +0 -278
  661. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +0 -2036
  662. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +0 -22
  663. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +0 -18
  664. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +0 -397
  665. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +0 -4127
  666. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +0 -37
  667. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +0 -93
  668. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +0 -26
  669. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +0 -34
  670. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +0 -2
  671. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +0 -23
  672. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +0 -57
  673. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +0 -48
  674. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +0 -40
  675. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +0 -369
  676. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +0 -40
  677. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +0 -302
  678. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +0 -70
  679. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +0 -74
  680. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.d.ts +0 -43
  681. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +0 -63
  682. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +0 -38
  683. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +0 -240
  684. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +0 -82
  685. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +0 -762
  686. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +0 -80
  687. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +0 -279
  688. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +0 -109
  689. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +0 -743
  690. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +0 -42
  691. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +0 -130
  692. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +0 -62
  693. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +0 -217
  694. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +0 -46
  695. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +0 -91
  696. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +0 -357
  697. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +0 -2656
  698. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +0 -3742
  699. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +0 -301
  700. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +0 -354
  701. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +0 -197
  702. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +0 -2205
  703. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -27
  704. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -317
  705. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +0 -132
  706. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +0 -1216
  707. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +0 -86
  708. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +0 -282
  709. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +0 -118
  710. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +0 -540
  711. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +0 -82
  712. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +0 -1448
  713. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +0 -329
  714. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +0 -7
  715. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +0 -114
  716. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +0 -2
  717. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +0 -9
  718. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -99
  719. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +0 -1268
  720. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +0 -552
  721. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +0 -31
  722. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +0 -676
  723. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +0 -68
  724. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +0 -225
  725. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +0 -13
  726. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +0 -52
  727. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +0 -22
  728. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +0 -58
  729. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +0 -11
  730. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +0 -13
  731. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +0 -73
  732. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +0 -65
  733. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +0 -31
  734. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +0 -110
  735. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +0 -11
  736. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js +0 -28
  737. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +0 -3
  738. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +0 -16
  739. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +0 -22
  740. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +0 -163
  741. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +0 -6
  742. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +0 -12
  743. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +0 -115
  744. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +0 -69
  745. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +0 -60
  746. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +0 -139
@@ -1,2656 +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, DisposableResizeObserver, addDisposableListener, EventType, clearNode, addDisposableGenericMouseDownListener, EventHelper, getWindow, createTextNode, scheduleAtNextAnimationFrame } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
- import { Disposable, DisposableStore, MutableDisposable, isDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
- import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
9
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
- import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
11
- import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
12
- import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
13
- import { Switch } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/switch';
14
- import { getButtonStyles, defaultButtonStyles, defaultInputBoxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
15
- import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
16
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
17
- import { mcpAccessConfig, McpAccessValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement';
18
- import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
19
- import { MCP_PLUGIN_COLLECTION_ID_PREFIX, McpConnectionState, McpServerInstallState, McpServerTransportType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
20
- import { IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
21
- import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
22
- import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery';
23
- import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
24
- import { ContributionEnablementState, isContributionDisabled, isContributionEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
25
- import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
26
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
27
- import { defaultGenerator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/idGenerator';
28
- import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
29
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
30
- import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
31
- import { InputBox, MessageType } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/inputbox/inputBox';
32
- import { IContextViewService, IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
33
- import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
34
- import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
35
- import { Action, Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
36
- import { StartServerAction, StopServerAction, RestartServerAction, ConfigureModelAccessAction, ShowSamplingRequestsAction, EnableMcpServerGloballyAction, EnableMcpServerForWorkspaceAction, DisableMcpServerGloballyAction, DisableMcpServerForWorkspaceAction, ShowServerOutputAction, getContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpServerActions';
37
- import { LocalMcpServerScope } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/mcp/common/mcpWorkbenchManagementService';
38
- import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
39
- import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
40
- import { mcpServerIcon } from './aiCustomizationIcons.js';
41
- import { formatDisplayName } from './aiCustomizationListWidget.js';
42
- import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
43
- import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
44
- import { IAICustomizationWorkspaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service';
45
- import { AgentPluginItemKind } from '../agentPluginEditor/agentPluginItems.js';
46
- import { getCustomizationDisabledLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService';
47
- import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
48
- import { IAgentHostCustomizationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service';
49
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
50
- import { McpServerStatus, CustomizationEnablementKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
51
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
52
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
53
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
54
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
55
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation/state';
56
- import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation-run/state';
57
- import { IOutputService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/output/common/output.service';
58
- import { getCustomizationScopeEnablement } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/customizationEnablement';
59
- import { createAgentHostEnablePluginAction } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentPluginActions';
60
- import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
61
- import { getErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
62
- import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
63
- import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
64
- import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
65
- import { createWorkbenchMcpServerDetailInput } from './embeddedMcpServerDetail.js';
66
- import { setVirtualizedRowActionsTabbable, createCustomizationCardPrimaryAction, setupCollapsibleSection, CustomizationCardListController, layoutVirtualizedSections, getVirtualizedSectionMinimumHeight, renderVirtualizedSectionLoadingPlaceholder } from './customizationCardList.js';
67
- import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
68
- import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
69
- import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
70
- import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignalFromEvent';
71
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
72
- import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
73
- import { truncateToFirstLine } from './aiCustomizationListWidgetUtils.js';
74
- import { observableSignal } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignal';
75
-
76
- registerCss(aiCustomizationManagement);
77
- const $ = $$1;
78
- const PLUGIN_COLLECTION_PREFIX = MCP_PLUGIN_COLLECTION_ID_PREFIX;
79
- const MCP_SECTION_ITEM_HEIGHT = 66;
80
- const MCP_ERROR_PREVIEW_LENGTH = 300;
81
- const COPILOT_EXTENSION_IDS = ["github.copilot", "github.copilot-chat"];
82
- function isCopilotExtension(id) {
83
- return ( COPILOT_EXTENSION_IDS.some(copilotId => ExtensionIdentifier.equals(id, copilotId)));
84
- }
85
- function getPluginUriFromCollectionId(collectionId) {
86
- return collectionId?.startsWith(PLUGIN_COLLECTION_PREFIX) ? collectionId.slice(PLUGIN_COLLECTION_PREFIX.length) : undefined;
87
- }
88
- function createBuiltinActiveSessionMcpEntries(servers) {
89
- return ( servers.map(server => ({
90
- type: "session-server-item",
91
- server
92
- })));
93
- }
94
- function isMcpServerCollectionVisible(collectionId, hiddenCollectionIds) {
95
- return !hiddenCollectionIds?.includes(collectionId);
96
- }
97
- class McpSectionDelegate {
98
- getHeight() {
99
- return MCP_SECTION_ITEM_HEIGHT;
100
- }
101
- getTemplateId(element) {
102
- return element.type === "marketplace-item" ? "mcpMarketplaceItem" : "mcpServerItem";
103
- }
104
- hasDynamicHeight(element) {
105
- return element.type !== "marketplace-item";
106
- }
107
- }
108
- function getToggledMcpEnablementState(state) {
109
- switch (state) {
110
- case ContributionEnablementState.EnabledWorkspace:
111
- return ContributionEnablementState.DisabledWorkspace;
112
- case ContributionEnablementState.DisabledWorkspace:
113
- return ContributionEnablementState.EnabledWorkspace;
114
- case ContributionEnablementState.EnabledProfile:
115
- return ContributionEnablementState.DisabledProfile;
116
- case ContributionEnablementState.DisabledProfile:
117
- return ContributionEnablementState.EnabledProfile;
118
- }
119
- }
120
- let McpServerItemRenderer = class McpServerItemRenderer extends Disposable {
121
- constructor(
122
- _renderManagementActions,
123
- workspaceService,
124
- agentPluginService,
125
- hoverService,
126
- agentHostCustomizationService,
127
- customizationHarnessService
128
- ) {
129
- super();
130
- this._renderManagementActions = _renderManagementActions;
131
- this.workspaceService = workspaceService;
132
- this.agentPluginService = agentPluginService;
133
- this.hoverService = hoverService;
134
- this.agentHostCustomizationService = agentHostCustomizationService;
135
- this.customizationHarnessService = customizationHarnessService;
136
- this.templateId = "mcpServerItem";
137
- this._templates = ( new Set());
138
- this._focusedIndex = -1;
139
- this._onDidChangeHeight = this._register(( new Emitter()));
140
- this.onDidChangeHeight = this._onDidChangeHeight.event;
141
- this.errorExpansionChanged = observableSignal(this);
142
- this.expandedErrors = ( new Map());
143
- }
144
- readErrorExpansion(reader) {
145
- this.errorExpansionChanged.read(reader);
146
- }
147
- syncError(element, error) {
148
- const session = this.customizationHarnessService.activeSessionResource.get();
149
- if (!isEqual(session, this.expansionSession)) {
150
- this.expansionSession = session;
151
- if (this.expandedErrors.size) {
152
- this.expandedErrors.clear();
153
- this.errorExpansionChanged.trigger(undefined);
154
- }
155
- }
156
- const key = getMcpRowKey(element);
157
- if (( this.expandedErrors.has(key)) && this.expandedErrors.get(key) !== error) {
158
- this.expandedErrors.delete(key);
159
- this.errorExpansionChanged.trigger(undefined);
160
- }
161
- }
162
- isErrorExpanded(element, error) {
163
- return error !== undefined && isEqual(
164
- this.expansionSession,
165
- this.customizationHarnessService.activeSessionResource.get()
166
- ) && this.expandedErrors.get(getMcpRowKey(element)) === error;
167
- }
168
- isErrorClipped(element) {
169
- return ( [...this._templates].some(
170
- template => template.currentIndex >= 0 && template.renderedRowKey === getMcpRowKey(element) && template.isClipped
171
- ));
172
- }
173
- renderTemplate(container) {
174
- const templateDisposables = ( new DisposableStore());
175
- container.classList.add("mcp-server-item");
176
- container.style.minHeight = `${MCP_SECTION_ITEM_HEIGHT}px`;
177
- const typeIcon = append(container, $(".mcp-server-icon"));
178
- typeIcon.classList.add(...ThemeIcon.asClassNameArray(mcpServerIcon));
179
- const details = append(container, $(".mcp-server-details"));
180
- const nameRow = append(details, $(".mcp-server-name-row"));
181
- const name = append(nameRow, $(".mcp-server-name"));
182
- const statusBadge = append(nameRow, $(".plugin-list-item-status.mcp-runtime-status-badge"));
183
- statusBadge.setAttribute("aria-hidden", "true");
184
- const description = append(details, $(".mcp-server-description"));
185
- description.id = defaultGenerator.nextId();
186
- const descriptionHover = templateDisposables.add(
187
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), description, "")
188
- );
189
- const expandButton = templateDisposables.add(( new Button(details, {
190
- ...getButtonStyles({
191
- buttonBackground: undefined,
192
- buttonHoverBackground: undefined,
193
- buttonForeground: undefined,
194
- buttonBorder: undefined
195
- })
196
- })));
197
- expandButton.element.classList.add("mcp-server-error-toggle");
198
- expandButton.element.style.display = "none";
199
- expandButton.element.setAttribute("aria-controls", description.id);
200
- const actions = append(container, $(".mcp-server-actions"));
201
- const template = {
202
- container,
203
- typeIcon,
204
- name,
205
- statusBadge,
206
- description,
207
- descriptionHover,
208
- expandButton,
209
- actions,
210
- templateDisposables,
211
- elementDisposables: ( new DisposableStore()),
212
- actionDisposables: ( new DisposableStore()),
213
- currentIndex: -1,
214
- isRendering: false,
215
- isExpanded: false,
216
- isClipped: false
217
- };
218
- registerMcpInlineButtonAction(templateDisposables, expandButton, () => {
219
- if (!template.currentElement || !template.currentError) {
220
- return;
221
- }
222
- const key = getMcpRowKey(template.currentElement);
223
- if (template.isExpanded) {
224
- this.expandedErrors.delete(key);
225
- } else {
226
- this.expandedErrors.set(key, template.currentError);
227
- }
228
- this.renderDescription(template);
229
- this.errorExpansionChanged.trigger(undefined);
230
- });
231
- const resizeObserver = templateDisposables.add(new DisposableResizeObserver(
232
- "McpServerItemRenderer.description",
233
- () => this.updateExpandButton(template)
234
- ));
235
- templateDisposables.add(resizeObserver.observe(description));
236
- templateDisposables.add(addDisposableListener(
237
- expandButton.element,
238
- EventType.BLUR,
239
- () => this.updateExpandButton(template)
240
- ));
241
- this._templates.add(template);
242
- return template;
243
- }
244
- renderElement(element, index, templateData) {
245
- templateData.isRendering = true;
246
- try {
247
- this.renderEntry(element, index, templateData);
248
- } finally {
249
- templateData.isRendering = false;
250
- }
251
- }
252
- renderEntry(element, index, templateData) {
253
- templateData.currentIndex = index;
254
- templateData.currentElement = element;
255
- const rowKey = getMcpRowKey(element);
256
- if (templateData.renderedRowKey !== rowKey) {
257
- templateData.renderedRowKey = rowKey;
258
- templateData.renderedStatusSignature = undefined;
259
- templateData.actionDisposables.clear();
260
- clearNode(templateData.actions);
261
- }
262
- templateData.elementDisposables.clear();
263
- if (element.type === "builtin-item") {
264
- templateData.container.classList.add("builtin");
265
- templateData.container.classList.toggle("has-detail", false);
266
- templateData.name.textContent = formatDisplayName(element.label);
267
- if (element.description) {
268
- templateData.description.textContent = truncateToFirstLine(element.description);
269
- templateData.description.style.display = "";
270
- } else {
271
- templateData.description.textContent = "";
272
- templateData.description.style.display = "none";
273
- }
274
- this.updateKnownServerStatus(templateData, element);
275
- const pluginUriStr = getPluginUriFromCollectionId(element.collectionId);
276
- if (pluginUriStr) {
277
- templateData.elementDisposables.add(this.hoverService.setupDelayedHover(templateData.container, () => {
278
- const plugin = this.agentPluginService.plugins.get().find(p => ( p.uri.toString()) === pluginUriStr);
279
- if (plugin) {
280
- return {
281
- content: `${element.label}\n${( localize(6995, "Plugin: {0}", plugin.label))}`,
282
- appearance: {
283
- compact: true,
284
- skipFadeInAnimation: true
285
- }
286
- };
287
- }
288
- return {
289
- content: element.label,
290
- appearance: {
291
- compact: true,
292
- skipFadeInAnimation: true
293
- }
294
- };
295
- }));
296
- }
297
- return;
298
- }
299
- if (element.type === "session-server-item") {
300
- templateData.container.classList.remove("builtin");
301
- templateData.container.classList.toggle("has-detail", false);
302
- templateData.name.textContent = formatDisplayName(element.server.name);
303
- templateData.description.textContent = "";
304
- templateData.description.style.display = "none";
305
- this.updateActiveSessionStatus(templateData, element);
306
- return;
307
- }
308
- templateData.container.classList.remove("builtin");
309
- templateData.name.textContent = formatDisplayName(element.server.label);
310
- const description = element.server.description?.trim();
311
- const isGallery = !element.server.local;
312
- const hasDetail = !!description || isGallery;
313
- templateData.container.classList.toggle("has-detail", hasDetail);
314
- if (description) {
315
- templateData.description.textContent = truncateToFirstLine(description);
316
- templateData.description.style.display = "";
317
- } else {
318
- templateData.description.textContent = "";
319
- templateData.description.style.display = "none";
320
- }
321
- if (element.activeSessionServer !== undefined) {
322
- this.updateKnownServerStatus(templateData, element);
323
- } else if (this.workspaceService.isSessionsWindow) {
324
- this.updateKnownServerStatus(templateData, element);
325
- } else {
326
- templateData.elementDisposables.add(autorun(reader => {
327
- const disabled = element.localServer ? isContributionDisabled(element.localServer.enablement.read(reader)) : false;
328
- const connectionState = element.localServer?.connectionState.read(reader);
329
- templateData.container.classList.toggle("disabled", disabled);
330
- this.updateStatus(
331
- templateData,
332
- element,
333
- element,
334
- disabled ? "disabled" : connectionState?.state,
335
- undefined,
336
- connectionState?.state === McpConnectionState.Kind.Error ? connectionState.message : undefined
337
- );
338
- }));
339
- }
340
- }
341
- updateKnownServerStatus(templateData, element) {
342
- let localDisabled = false;
343
- let connectionState;
344
- const update = () => {
345
- const currentEntry = resolveMcpEntry(
346
- element,
347
- this.agentHostCustomizationService,
348
- this.customizationHarnessService.activeSessionResource.get()
349
- );
350
- const activeSessionServer = currentEntry && getActiveSessionServer(currentEntry);
351
- if (element.activeSessionServer !== undefined) {
352
- const presentation = activeSessionServer && getActiveSessionServerPresentation(activeSessionServer);
353
- templateData.container.classList.toggle("disabled", presentation?.enabled === false);
354
- this.updateStatus(
355
- templateData,
356
- element,
357
- currentEntry,
358
- presentation?.status,
359
- presentation?.enabled ? undefined : activeSessionServer?.disabledReason,
360
- activeSessionServer?.state?.kind === McpServerStatus.Error ? activeSessionServer.state.error?.message : undefined
361
- );
362
- return;
363
- }
364
- templateData.container.classList.toggle("disabled", localDisabled);
365
- const localError = !this.workspaceService.isSessionsWindow && connectionState?.state === McpConnectionState.Kind.Error ? connectionState : undefined;
366
- this.updateStatus(
367
- templateData,
368
- element,
369
- currentEntry,
370
- localDisabled ? "disabled" : localError?.state,
371
- undefined,
372
- localError?.message
373
- );
374
- };
375
- templateData.elementDisposables.add(autorun(reader => {
376
- this.customizationHarnessService.activeSessionResource.read(reader);
377
- localDisabled = element.localServer ? isContributionDisabled(element.localServer.enablement.read(reader)) : false;
378
- connectionState = element.localServer?.connectionState.read(reader);
379
- update();
380
- }));
381
- templateData.elementDisposables.add(this.agentHostCustomizationService.onDidChangeCustomizations(update));
382
- }
383
- updateActiveSessionStatus(templateData, element) {
384
- const update = () => {
385
- const currentEntry = resolveMcpEntry(
386
- element,
387
- this.agentHostCustomizationService,
388
- this.customizationHarnessService.activeSessionResource.get()
389
- );
390
- const server = currentEntry && getActiveSessionServer(currentEntry);
391
- const presentation = server && getActiveSessionServerPresentation(server);
392
- templateData.container.classList.toggle("disabled", presentation?.enabled === false);
393
- this.updateStatus(
394
- templateData,
395
- element,
396
- currentEntry,
397
- presentation?.status,
398
- server?.disabledReason,
399
- server?.state?.kind === McpServerStatus.Error ? server.state.error?.message : undefined
400
- );
401
- };
402
- templateData.elementDisposables.add(autorun(reader => {
403
- this.customizationHarnessService.activeSessionResource.read(reader);
404
- update();
405
- }));
406
- templateData.elementDisposables.add(this.agentHostCustomizationService.onDidChangeCustomizations(update));
407
- }
408
- updateStatus(templateData, element, currentEntry, state, disabledReason, errorMessage) {
409
- const error = getMcpErrorMessage(state, errorMessage);
410
- this.syncError(element, error);
411
- templateData.currentError = error;
412
- this.renderDescription(templateData);
413
- const presentation = getMcpStatusPresentation(state, disabledReason);
414
- templateData.statusBadge.className = "plugin-list-item-status mcp-runtime-status-badge";
415
- if (presentation) {
416
- templateData.statusBadge.textContent = presentation.label;
417
- templateData.statusBadge.classList.add(presentation.className);
418
- templateData.statusBadge.style.display = "";
419
- } else {
420
- templateData.statusBadge.textContent = "";
421
- templateData.statusBadge.style.display = "none";
422
- }
423
- const activeSessionServer = currentEntry && getActiveSessionServer(currentEntry);
424
- const label = getMcpEntryLabel(currentEntry ?? element);
425
- const activeSessionResource = this.customizationHarnessService.activeSessionResource.get();
426
- const localServer = element.type === "session-server-item" ? undefined : element.localServer;
427
- const signature = getMcpStatusRenderSignature({
428
- rowKey: getMcpRowKey(element),
429
- label,
430
- state,
431
- statusLabel: presentation?.label,
432
- statusClassName: presentation?.className,
433
- statusIconId: presentation?.icon?.id,
434
- activeSessionServerId: activeSessionServer?.id,
435
- logOutputChannelId: activeSessionServer?.logOutputChannelId,
436
- localServerId: localServer?.definition.id,
437
- activeSessionResource: ( activeSessionResource.toString())
438
- });
439
- if (templateData.renderedStatusSignature === signature) {
440
- return;
441
- }
442
- templateData.renderedStatusSignature = signature;
443
- templateData.actionDisposables.clear();
444
- clearNode(templateData.actions);
445
- if (!currentEntry) {
446
- return;
447
- }
448
- const getEntry = () => resolveMcpEntry(currentEntry, this.agentHostCustomizationService, activeSessionResource);
449
- if (!presentation) {
450
- this._renderManagementActions(
451
- getEntry,
452
- templateData.actions,
453
- templateData.actionDisposables,
454
- () => this.updateActionsTabbability(templateData)
455
- );
456
- this.updateActionsTabbability(templateData);
457
- return;
458
- }
459
- if (state === McpServerStatus.AuthRequired && activeSessionServer !== undefined) {
460
- const signInButton = createMcpSignInButton(templateData.actions, templateData.actionDisposables, label);
461
- registerMcpInlineButtonAction(templateData.actionDisposables, signInButton, async () => {
462
- signInButton.enabled = false;
463
- try {
464
- await authenticateMcpServer(
465
- this.agentHostCustomizationService,
466
- activeSessionResource,
467
- activeSessionServer.id
468
- );
469
- } finally {
470
- signInButton.enabled = true;
471
- }
472
- });
473
- }
474
- if (!presentation.icon || error !== undefined) {
475
- this._renderManagementActions(
476
- getEntry,
477
- templateData.actions,
478
- templateData.actionDisposables,
479
- () => this.updateActionsTabbability(templateData)
480
- );
481
- this.updateActionsTabbability(templateData);
482
- return;
483
- }
484
- const statusElement = append(templateData.actions, $(".mcp-server-status"));
485
- statusElement.classList.add(presentation.className, ...ThemeIcon.asClassNameArray(presentation.icon));
486
- statusElement.setAttribute("aria-hidden", "true");
487
- templateData.actionDisposables.add(
488
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), statusElement, presentation.label)
489
- );
490
- this._renderManagementActions(
491
- getEntry,
492
- templateData.actions,
493
- templateData.actionDisposables,
494
- () => this.updateActionsTabbability(templateData)
495
- );
496
- this.updateActionsTabbability(templateData);
497
- }
498
- setFocusedIndex(index) {
499
- this._focusedIndex = index;
500
- for (const template of this._templates) {
501
- this.updateActionsTabbability(template);
502
- }
503
- }
504
- updateActionsTabbability(templateData) {
505
- setVirtualizedRowActionsTabbable(templateData.actions, templateData.currentIndex === this._focusedIndex);
506
- templateData.expandButton.element.tabIndex = templateData.currentIndex === this._focusedIndex ? 0 : -1;
507
- }
508
- notifyHeightChange(template) {
509
- if (!template.isRendering && template.currentIndex >= 0) {
510
- this._onDidChangeHeight.fire({
511
- index: template.currentIndex,
512
- text: template.currentError === undefined ? undefined : template.renderedDescription,
513
- expanded: template.isExpanded
514
- });
515
- }
516
- }
517
- renderDescription(template) {
518
- const element = template.currentElement;
519
- if (!element) {
520
- return;
521
- }
522
- const error = template.currentError;
523
- const expanded = this.isErrorExpanded(element, error);
524
- const description = error === undefined ? element.type === "session-server-item" ? "" : element.type === "builtin-item" ? element.description : element.server.description?.trim() ?? "" : expanded ? error : getMcpErrorPreview(error).text;
525
- const text = error === undefined ? truncateToFirstLine(description) : description;
526
- const changed = template.renderedDescription !== description || template.isExpanded !== expanded || template.description.classList.contains("error") !== (error !== undefined);
527
- if (template.description.textContent !== text) {
528
- template.description.textContent = text;
529
- }
530
- template.isExpanded = expanded;
531
- template.description.classList.toggle("expanded", expanded);
532
- template.description.classList.toggle("error", error !== undefined);
533
- template.container.classList.toggle("has-error", error !== undefined);
534
- template.description.style.display = description ? "" : "none";
535
- if (template.renderedDescription !== description) {
536
- template.renderedDescription = description;
537
- template.descriptionHover.update(description);
538
- }
539
- if (changed) {
540
- this.updateExpandButton(template);
541
- this.notifyHeightChange(template);
542
- }
543
- }
544
- updateExpandButton(template) {
545
- if (!template.currentElement) {
546
- return;
547
- }
548
- const clipped = template.currentError !== undefined && !template.isExpanded && template.description.clientWidth > 0 && template.description.scrollHeight > template.description.clientHeight;
549
- if (clipped !== template.isClipped) {
550
- template.isClipped = clipped;
551
- this.errorExpansionChanged.trigger(undefined);
552
- }
553
- const visible = template.currentError !== undefined && (template.isExpanded || getMcpErrorPreview(template.currentError).truncated || clipped || template.expandButton.hasFocus());
554
- const display = visible ? "" : "none";
555
- if (template.expandButton.element.style.display !== display) {
556
- template.expandButton.element.style.display = display;
557
- this.notifyHeightChange(template);
558
- }
559
- template.expandButton.label = template.isExpanded ? ( localize(6996, "Show Less")) : ( localize(6997, "Show More"));
560
- template.expandButton.element.setAttribute("aria-expanded", String(template.isExpanded));
561
- this.updateActionsTabbability(template);
562
- }
563
- disposeElement(_element, _index, templateData) {
564
- templateData.elementDisposables.clear();
565
- templateData.descriptionHover.hide();
566
- templateData.descriptionHover.update("");
567
- templateData.description.textContent = "";
568
- templateData.renderedDescription = undefined;
569
- templateData.currentElement = undefined;
570
- templateData.currentError = undefined;
571
- templateData.isClipped = false;
572
- templateData.currentIndex = -1;
573
- }
574
- disposeTemplate(templateData) {
575
- this._templates.delete(templateData);
576
- templateData.templateDisposables.dispose();
577
- templateData.elementDisposables.dispose();
578
- templateData.actionDisposables.dispose();
579
- }
580
- dispose() {
581
- this.expandedErrors.clear();
582
- super.dispose();
583
- }
584
- };
585
- McpServerItemRenderer = ( __decorate([( __param(1, IAICustomizationWorkspaceService)), ( __param(2, IAgentPluginService)), ( __param(3, IHoverService)), ( __param(4, IAgentHostCustomizationService)), ( __param(5, ICustomizationHarnessService))], McpServerItemRenderer));
586
- class McpMarketplaceItemRenderer {
587
- constructor(_install) {
588
- this._install = _install;
589
- this.templateId = "mcpMarketplaceItem";
590
- this._templates = ( new Set());
591
- this._focusedIndex = -1;
592
- }
593
- renderTemplate(container) {
594
- container.classList.add("plugin-list-item", "plugin-marketplace-home-row");
595
- const details = append(container, $(".plugin-list-item-details"));
596
- const name = append(
597
- append(details, $(".plugin-list-item-name-row")),
598
- $(".plugin-list-item-name")
599
- );
600
- const description = append(details, $(".plugin-list-item-description"));
601
- const actionContainer = append(container, $(".plugin-list-item-action"));
602
- const installButton = ( new Button(actionContainer, defaultButtonStyles));
603
- installButton.element.classList.add("plugin-list-item-install-button");
604
- const templateDisposables = ( new DisposableStore());
605
- templateDisposables.add(installButton);
606
- templateDisposables.add(
607
- addDisposableGenericMouseDownListener(installButton.element, event => EventHelper.stop(event, true))
608
- );
609
- const template = {
610
- container,
611
- name,
612
- description,
613
- installButton,
614
- elementDisposables: ( new DisposableStore()),
615
- templateDisposables,
616
- currentIndex: -1
617
- };
618
- this._templates.add(template);
619
- return template;
620
- }
621
- renderElement(element, index, templateData) {
622
- templateData.elementDisposables.clear();
623
- templateData.currentIndex = index;
624
- templateData.name.textContent = element.server.label;
625
- templateData.description.textContent = truncateToFirstLine(element.server.description || ( localize(6998, "No description provided.")));
626
- templateData.installButton.label = ( localize(6999, "Install"));
627
- templateData.installButton.enabled = true;
628
- templateData.installButton.element.tabIndex = index === this._focusedIndex ? 0 : -1;
629
- templateData.elementDisposables.add(templateData.installButton.onDidClick(event => {
630
- EventHelper.stop(event, true);
631
- void this._install(element.server, templateData.installButton);
632
- }));
633
- }
634
- setFocusedIndex(index) {
635
- this._focusedIndex = index;
636
- for (const template of this._templates) {
637
- template.installButton.element.tabIndex = template.currentIndex === index ? 0 : -1;
638
- }
639
- }
640
- disposeElement(_element, _index, templateData) {
641
- templateData.elementDisposables.clear();
642
- }
643
- disposeTemplate(templateData) {
644
- this._templates.delete(templateData);
645
- templateData.elementDisposables.dispose();
646
- templateData.templateDisposables.dispose();
647
- }
648
- }
649
- function createMcpSignInButton(parent, store, serverLabel) {
650
- const signInLabel = ( localize(7000, "Sign in to {0}", serverLabel));
651
- const signInButton = store.add(( new Button(parent, {
652
- ...defaultButtonStyles,
653
- secondary: true,
654
- small: true,
655
- title: signInLabel,
656
- ariaLabel: signInLabel
657
- })));
658
- signInButton.label = ( localize(7001, "Sign In"));
659
- signInButton.element.classList.add("mcp-server-sign-in");
660
- return signInButton;
661
- }
662
- function registerMcpInlineButtonAction(store, button, action) {
663
- store.add(
664
- addDisposableGenericMouseDownListener(button.element, event => EventHelper.stop(event, true))
665
- );
666
- store.add(button.onDidClick(event => {
667
- EventHelper.stop(event, true);
668
- void action();
669
- }));
670
- }
671
- function authenticateMcpServer(agentHostCustomizationService, sessionResource, serverId) {
672
- return agentHostCustomizationService.authenticateMcpServer(sessionResource, serverId);
673
- }
674
- function getMcpServerOutputHandler(
675
- outputService,
676
- localServer,
677
- activeSessionServer,
678
- closeCustomizationEditor,
679
- showActiveSessionOutput
680
- ) {
681
- const outputChannelId = activeSessionServer?.logOutputChannelId;
682
- if (showActiveSessionOutput) {
683
- return () => showActiveSessionOutput(closeCustomizationEditor);
684
- }
685
- if (outputChannelId) {
686
- return async () => {
687
- await closeCustomizationEditor?.();
688
- await outputService.showChannel(outputChannelId);
689
- };
690
- }
691
- if (localServer) {
692
- return async () => {
693
- await closeCustomizationEditor?.();
694
- await localServer.showOutput();
695
- };
696
- }
697
- return undefined;
698
- }
699
- function getMcpStatusPresentation(state, disabledReason) {
700
- if (state === undefined) {
701
- return undefined;
702
- }
703
- if (state === "disabled") {
704
- return {
705
- label: getCustomizationDisabledLabel(disabledReason),
706
- className: "disabled",
707
- icon: Codicon.circleSlash
708
- };
709
- }
710
- switch (state) {
711
- case McpConnectionState.Kind.Running:
712
- case McpServerStatus.Ready:
713
- return {
714
- label: ( localize(7002, "Running")),
715
- className: "running",
716
- icon: Codicon.check
717
- };
718
- case McpConnectionState.Kind.Starting:
719
- case McpServerStatus.Starting:
720
- return {
721
- label: ( localize(7003, "Starting")),
722
- className: "starting",
723
- icon: ThemeIcon.modify(Codicon.loading, "spin")
724
- };
725
- case McpServerStatus.AuthRequired:
726
- return {
727
- label: ( localize(7004, "Authentication required")),
728
- className: "auth-required",
729
- icon: Codicon.account
730
- };
731
- case McpConnectionState.Kind.Error:
732
- case McpServerStatus.Error:
733
- return {
734
- label: ( localize(7005, "Error")),
735
- className: "error",
736
- icon: Codicon.error
737
- };
738
- case McpConnectionState.Kind.Stopped:
739
- case McpServerStatus.Stopped:
740
- default:
741
- return {
742
- label: ( localize(7006, "Stopped")),
743
- className: "stopped"
744
- };
745
- }
746
- }
747
- function getMcpErrorMessage(state, message) {
748
- if (state !== McpServerStatus.Error && state !== McpConnectionState.Kind.Error) {
749
- return undefined;
750
- }
751
- return message && /\S/u.test(message) ? message : ( localize(7007, "The server reported an error without additional details."));
752
- }
753
- function getMcpErrorPreview(message) {
754
- let end = 0;
755
- const characters = [];
756
- for (let count = 0; count < MCP_ERROR_PREVIEW_LENGTH && end < message.length; count++) {
757
- const codePoint = message.codePointAt(end);
758
- characters.push(String.fromCodePoint(codePoint));
759
- end += codePoint > 0xFFFF ? 2 : 1;
760
- }
761
- const truncated = end < message.length;
762
- return {
763
- text: characters.join("") + (truncated ? "…" : ""),
764
- truncated
765
- };
766
- }
767
- function getActiveSessionServer(entry) {
768
- return entry.type === "session-server-item" ? entry.server : entry.activeSessionServer;
769
- }
770
- function resolveMcpEntry(entry, customizations, sessionResource) {
771
- const activeSessionServer = getActiveSessionServer(entry);
772
- if (!activeSessionServer) {
773
- return entry;
774
- }
775
- const server = customizations.getMcpServers(sessionResource).find(server => server.id === activeSessionServer.id);
776
- return server ? entry.type === "session-server-item" ? {
777
- ...entry,
778
- server
779
- } : {
780
- ...entry,
781
- activeSessionServer: server
782
- } : undefined;
783
- }
784
- function getMcpRowKey(entry) {
785
- switch (entry.type) {
786
- case "server-item":
787
- return `server:${entry.server.id}:${entry.marketplace ? 1 : 0}`;
788
- case "session-server-item":
789
- return `session:${entry.server.id}`;
790
- case "builtin-item":
791
- return `builtin:${entry.id}`;
792
- }
793
- }
794
- function getMcpStatusRenderSignature(input) {
795
- return JSON.stringify([
796
- input.rowKey,
797
- input.label,
798
- input.state ?? null,
799
- input.statusLabel ?? null,
800
- input.statusClassName ?? null,
801
- input.statusIconId ?? null,
802
- input.activeSessionServerId ?? null,
803
- input.logOutputChannelId ?? null,
804
- input.localServerId ?? null,
805
- input.activeSessionResource ?? null
806
- ]);
807
- }
808
- function getMcpEntryLabel(element) {
809
- return element.type === "session-server-item" ? element.server.name : element.type === "builtin-item" ? element.label : element.server.label;
810
- }
811
- function getMcpStatusKind(entry, isSessionsWindow) {
812
- if (entry.type === "session-server-item") {
813
- return getActiveSessionServerPresentation(entry.server).status;
814
- }
815
- if (entry.activeSessionServer !== undefined) {
816
- return getActiveSessionServerPresentation(entry.activeSessionServer).status;
817
- }
818
- if (entry.localServer && isContributionDisabled(entry.localServer.enablement.get())) {
819
- return "disabled";
820
- }
821
- if (entry.type === "server-item" && !isSessionsWindow) {
822
- return entry.localServer?.connectionState.get().state;
823
- }
824
- return undefined;
825
- }
826
- function getMcpEntryAriaLabel(element, isSessionsWindow) {
827
- const label = getMcpEntryLabel(element);
828
- const statusKind = getMcpStatusKind(element, isSessionsWindow);
829
- const disabledReason = statusKind === "disabled" ? getMcpDisabledReason(element) : undefined;
830
- const status = getMcpStatusPresentation(statusKind, disabledReason);
831
- return status ? ( localize(7008, "{0}, {1}", label, status.label)) : label;
832
- }
833
- function getMcpDisabledReason(entry) {
834
- if (entry.type === "session-server-item") {
835
- return entry.server.disabledReason;
836
- }
837
- if (entry.activeSessionServer !== undefined) {
838
- return entry.activeSessionServer.disabledReason;
839
- }
840
- return undefined;
841
- }
842
- function normalizeMcpMatchKey(value) {
843
- return value || undefined;
844
- }
845
- function getUniqueMcpMatchKeys(values) {
846
- const keys = ( new Set());
847
- for (const value of values) {
848
- const key = normalizeMcpMatchKey(value);
849
- if (key) {
850
- keys.add(key);
851
- }
852
- }
853
- return [...keys];
854
- }
855
- class ActiveSessionMcpServerMatcher {
856
- constructor(servers) {
857
- this.servers = servers;
858
- this.byKey = ( new Map());
859
- this.matchedIds = ( new Set());
860
- for (const server of servers) {
861
- const separator = server.id.indexOf("/");
862
- const rawId = separator >= 0 ? server.id.slice(separator + 1) : server.id;
863
- for (const key of getUniqueMcpMatchKeys([rawId, server.name])) {
864
- let bucket = this.byKey.get(key);
865
- if (!bucket) {
866
- bucket = [];
867
- this.byKey.set(key, bucket);
868
- }
869
- bucket.push(server);
870
- }
871
- }
872
- }
873
- take(keys) {
874
- for (const key of getUniqueMcpMatchKeys(keys)) {
875
- const matches = this.byKey.get(key)?.filter(server => !( this.matchedIds.has(server.id)));
876
- if (matches?.length === 1) {
877
- this.matchedIds.add(matches[0].id);
878
- return matches[0];
879
- }
880
- }
881
- return undefined;
882
- }
883
- unmatched(query) {
884
- return this.servers.filter(server => !( this.matchedIds.has(server.id)) && matchesActiveSessionServerQuery(server, query));
885
- }
886
- }
887
- class LocalMcpServerMatcher {
888
- constructor(servers) {
889
- this.byKey = ( new Map());
890
- for (const server of servers) {
891
- for (const key of getRuntimeServerMatchKeys(server)) {
892
- let matches = this.byKey.get(key);
893
- if (!matches) {
894
- matches = [];
895
- this.byKey.set(key, matches);
896
- }
897
- matches.push(server);
898
- }
899
- }
900
- }
901
- find(keys) {
902
- for (const key of getUniqueMcpMatchKeys(keys)) {
903
- const matches = this.byKey.get(key);
904
- if (matches?.length === 1) {
905
- return matches[0];
906
- }
907
- }
908
- return undefined;
909
- }
910
- }
911
- function matchesActiveSessionServerQuery(server, query) {
912
- if (!query) {
913
- return true;
914
- }
915
- return server.name.toLowerCase().includes(query);
916
- }
917
- function getWorkbenchServerMatchKeys(server) {
918
- return getUniqueMcpMatchKeys([server.id, server.name, server.label]);
919
- }
920
- function getRuntimeServerMatchKeys(server) {
921
- return getUniqueMcpMatchKeys([server.definition.id, server.definition.label]);
922
- }
923
- function getActiveSessionServerPresentation(server) {
924
- return {
925
- enabled: server.enabled,
926
- status: server.enabled ? server.status : "disabled"
927
- };
928
- }
929
- function updateMcpCardRuntimePresentation(
930
- statusBadge,
931
- primaryAction,
932
- description,
933
- statusKind,
934
- disabledReason,
935
- ariaLabel,
936
- descriptionText
937
- ) {
938
- const statusPresentation = getMcpStatusPresentation(statusKind, disabledReason);
939
- statusBadge.className = "plugin-list-item-status mcp-runtime-status-badge";
940
- statusBadge.style.display = statusPresentation ? "" : "none";
941
- statusBadge.textContent = statusPresentation?.label ?? "";
942
- if (statusPresentation) {
943
- statusBadge.classList.add(statusPresentation.className);
944
- }
945
- primaryAction.setAttribute("aria-label", ariaLabel);
946
- description.textContent = descriptionText;
947
- }
948
- function shouldLoadMcpGallerySnapshot(visible, query, itemCount, failed, loading, accessEnabled) {
949
- return accessEnabled && visible && !query.trim() && itemCount === 0 && !failed && !loading;
950
- }
951
- function hasSameMcpMembership(previous, current) {
952
- return previous === current;
953
- }
954
- function getActiveSessionServerLifecycleAction(server) {
955
- if (!getActiveSessionServerPresentation(server).enabled) {
956
- return undefined;
957
- }
958
- return server.status === McpServerStatus.Stopped || server.status === McpServerStatus.Error ? ( new Action("mcpServer.activeSession.start", ( localize(7009, "Start Server")), undefined, true, () => server.start())) : ( new Action("mcpServer.activeSession.stop", ( localize(7010, "Stop Server")), undefined, true, () => server.stop()));
959
- }
960
- function isHostOwnedPluginMcpServer(server) {
961
- return server.isPluginProvided === true && !server.isClientBundled;
962
- }
963
- const agentHostMcpServerEnablementActionInfo = {
964
- global: {
965
- kind: CustomizationEnablementKind.Global,
966
- enableLabel: () => ( localize(7011, "Enable")),
967
- disableLabel: () => ( localize(7012, "Disable"))
968
- },
969
- workspace: {
970
- kind: CustomizationEnablementKind.Workspace,
971
- enableLabel: () => ( localize(7013, "Enable (Workspace)")),
972
- disableLabel: () => ( localize(7014, "Disable (Workspace)"))
973
- },
974
- session: {
975
- kind: CustomizationEnablementKind.Session,
976
- enableLabel: () => ( localize(7015, "Enable (Session)")),
977
- disableLabel: () => ( localize(7016, "Disable (Session)"))
978
- }
979
- };
980
- function getAgentHostMcpServerEnablementActions(
981
- agentHostCustomizations,
982
- agentPluginService,
983
- sessionResource,
984
- server,
985
- scopes = ["global", "workspace", "session"]
986
- ) {
987
- if (server.disabledReason?.source === "plugin") {
988
- const decision = server.disabledReason.plugin.enablement?.[0];
989
- if (!decision) {
990
- return [];
991
- }
992
- const action = createAgentHostEnablePluginAction(
993
- agentHostCustomizations,
994
- agentPluginService,
995
- sessionResource,
996
- server.disabledReason.plugin,
997
- decision.kind
998
- );
999
- return [( new Action(action.id, action.label, undefined, true, action.run))];
1000
- }
1001
- const enablement = getCustomizationScopeEnablement(server);
1002
- const actions = [];
1003
- if (scopes.includes("global")) {
1004
- actions.push(createAgentHostMcpServerEnablementAction(
1005
- agentHostCustomizations,
1006
- sessionResource,
1007
- server,
1008
- !enablement.global,
1009
- "global"
1010
- ));
1011
- }
1012
- if (scopes.includes("workspace") && agentHostCustomizations.getWorkingDirectories(sessionResource).length > 0) {
1013
- actions.push(createAgentHostMcpServerEnablementAction(
1014
- agentHostCustomizations,
1015
- sessionResource,
1016
- server,
1017
- !enablement.workspace,
1018
- "workspace"
1019
- ));
1020
- }
1021
- if (scopes.includes("session")) {
1022
- actions.push(createAgentHostMcpServerEnablementAction(
1023
- agentHostCustomizations,
1024
- sessionResource,
1025
- server,
1026
- !enablement.session,
1027
- "session"
1028
- ));
1029
- }
1030
- return actions;
1031
- }
1032
- function setPrimaryMcpServerEnablement(
1033
- mcpService,
1034
- agentHostCustomizations,
1035
- sessionResource,
1036
- localServerId,
1037
- activeSessionServer,
1038
- enabled
1039
- ) {
1040
- if (activeSessionServer && isHostOwnedPluginMcpServer(activeSessionServer)) {
1041
- agentHostCustomizations.setCustomizationEnablement(
1042
- sessionResource,
1043
- activeSessionServer.id,
1044
- activeSessionServer.enablement,
1045
- CustomizationEnablementKind.Global,
1046
- enabled
1047
- );
1048
- return;
1049
- }
1050
- if (localServerId) {
1051
- const current = mcpService.enablementModel.readEnabled(localServerId);
1052
- const next = getToggledMcpEnablementState(current);
1053
- if (isContributionEnabled(next) !== enabled) {
1054
- throw ( new Error(`Unexpected MCP enablement transition for ${localServerId}.`));
1055
- }
1056
- mcpService.enablementModel.setEnabled(localServerId, next);
1057
- return;
1058
- }
1059
- if (!activeSessionServer) {
1060
- throw ( new Error("Cannot update MCP enablement without a durable server target."));
1061
- }
1062
- agentHostCustomizations.setCustomizationEnablement(
1063
- sessionResource,
1064
- activeSessionServer.id,
1065
- activeSessionServer.enablement,
1066
- CustomizationEnablementKind.Global,
1067
- enabled
1068
- );
1069
- }
1070
- function isPrimaryMcpServerEnabled(mcpService, localServerId, activeSessionServer) {
1071
- if (activeSessionServer && isHostOwnedPluginMcpServer(activeSessionServer)) {
1072
- return getCustomizationScopeEnablement(activeSessionServer).global;
1073
- }
1074
- if (localServerId) {
1075
- return isContributionEnabled(mcpService.enablementModel.readEnabled(localServerId));
1076
- }
1077
- if (activeSessionServer) {
1078
- return getCustomizationScopeEnablement(activeSessionServer).global;
1079
- }
1080
- return true;
1081
- }
1082
- function createAgentHostMcpServerEnablementAction(agentHostCustomizations, sessionResource, server, enabled, scope) {
1083
- const actionInfo = agentHostMcpServerEnablementActionInfo[scope];
1084
- return ( new Action(
1085
- `mcpServer.agentHost.${enabled ? "enable" : "disable"}.${scope}`,
1086
- enabled ? actionInfo.enableLabel() : actionInfo.disableLabel(),
1087
- undefined,
1088
- true,
1089
- () => agentHostCustomizations.setCustomizationEnablement(sessionResource, server.id, server.enablement, actionInfo.kind, enabled)
1090
- ));
1091
- }
1092
- function getLocalMcpServerEnablementActions(mcpService, serverId, isEmptyWorkbench, options = {}) {
1093
- const includeWorkspace = options.includeWorkspace ?? true;
1094
- const disabled = options.activeSessionServer ? !getActiveSessionServerPresentation(options.activeSessionServer).enabled : isContributionDisabled(mcpService.enablementModel.readEnabled(serverId));
1095
- const actions = [];
1096
- if (disabled) {
1097
- actions.push(( new Action("mcpServer.builtin.enable", ( localize(7017, "Enable")), undefined, true, () => {
1098
- mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.EnabledProfile);
1099
- })));
1100
- if (includeWorkspace && !isEmptyWorkbench) {
1101
- actions.push(( new Action("mcpServer.builtin.enableWorkspace", ( localize(7018, "Enable (Workspace)")), undefined, true, () => {
1102
- mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.EnabledWorkspace);
1103
- })));
1104
- }
1105
- } else {
1106
- actions.push(( new Action("mcpServer.builtin.disable", ( localize(7019, "Disable")), undefined, true, () => {
1107
- mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.DisabledProfile);
1108
- })));
1109
- if (includeWorkspace && !isEmptyWorkbench) {
1110
- actions.push(( new Action("mcpServer.builtin.disableWorkspace", ( localize(7020, "Disable (Workspace)")), undefined, true, () => {
1111
- mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.DisabledWorkspace);
1112
- })));
1113
- }
1114
- }
1115
- return actions;
1116
- }
1117
- function getBuiltinMcpServerEnablementActions(
1118
- mcpService,
1119
- serverId,
1120
- isEmptyWorkbench,
1121
- agentHostCustomizations,
1122
- agentPluginService,
1123
- sessionResource,
1124
- activeSessionServer
1125
- ) {
1126
- if (activeSessionServer === undefined) {
1127
- return getLocalMcpServerEnablementActions(mcpService, serverId, isEmptyWorkbench);
1128
- }
1129
- if (isHostOwnedPluginMcpServer(activeSessionServer)) {
1130
- return getAgentHostMcpServerEnablementActions(
1131
- agentHostCustomizations,
1132
- agentPluginService,
1133
- sessionResource,
1134
- activeSessionServer
1135
- );
1136
- }
1137
- return [
1138
- ...getLocalMcpServerEnablementActions(mcpService, serverId, isEmptyWorkbench, {
1139
- includeWorkspace: false,
1140
- activeSessionServer
1141
- }),
1142
- ...getAgentHostMcpServerEnablementActions(
1143
- agentHostCustomizations,
1144
- agentPluginService,
1145
- sessionResource,
1146
- activeSessionServer,
1147
- ["workspace", "session"]
1148
- )
1149
- ];
1150
- }
1151
- function getActiveSessionServerOptionsActions(
1152
- commandService,
1153
- agentHostCustomizations,
1154
- agentPluginService,
1155
- sessionResource,
1156
- server
1157
- ) {
1158
- const actions = [];
1159
- const lifecycleAction = getActiveSessionServerLifecycleAction(server);
1160
- if (lifecycleAction) {
1161
- actions.push(lifecycleAction);
1162
- }
1163
- const durableActions = getAgentHostMcpServerEnablementActions(agentHostCustomizations, agentPluginService, sessionResource, server);
1164
- if (durableActions.length > 0) {
1165
- if (actions.length > 0) {
1166
- actions.push(( new Separator()));
1167
- }
1168
- actions.push(...durableActions);
1169
- }
1170
- actions.push(( new Separator()));
1171
- actions.push(( new Action("mcpServer.activeSession.options", ( localize(7021, "Server Options")), undefined, true, async () => {
1172
- await commandService.executeCommand(McpCommandIds.AgentHostServerOptions, sessionResource, server.id);
1173
- })));
1174
- return actions;
1175
- }
1176
- function shouldHideLocalActionForActiveSessionServer(action) {
1177
- return action instanceof StartServerAction || action instanceof StopServerAction || action instanceof RestartServerAction || action instanceof ConfigureModelAccessAction || action instanceof ShowSamplingRequestsAction || isLocalMcpServerWorkspaceEnablementAction(action);
1178
- }
1179
- function isLocalMcpServerEnablementAction(action) {
1180
- return action.id === EnableMcpServerGloballyAction.ID || action.id === EnableMcpServerForWorkspaceAction.ID || action.id === DisableMcpServerGloballyAction.ID || action.id === DisableMcpServerForWorkspaceAction.ID;
1181
- }
1182
- function isLocalMcpServerWorkspaceEnablementAction(action) {
1183
- return action.id === EnableMcpServerForWorkspaceAction.ID || action.id === DisableMcpServerForWorkspaceAction.ID;
1184
- }
1185
- function getServerItemContextMenuActions(
1186
- menuActionGroups,
1187
- activeSessionServer,
1188
- activeSessionLifecycleAction,
1189
- agentHostEnablementActions
1190
- ) {
1191
- const actions = [];
1192
- const hasActiveSession = activeSessionServer !== undefined;
1193
- let agentHostEnablementAdded = false;
1194
- if (activeSessionLifecycleAction) {
1195
- actions.push(activeSessionLifecycleAction, ( new Separator()));
1196
- }
1197
- for (const menuActions of menuActionGroups) {
1198
- const visibleMenuActions = hasActiveSession ? menuActions.filter(action => !shouldHideLocalActionForActiveSessionServer(action)) : menuActions;
1199
- actions.push(...visibleMenuActions);
1200
- if (hasActiveSession && ( menuActions.some(isLocalMcpServerEnablementAction))) {
1201
- actions.push(...agentHostEnablementActions);
1202
- agentHostEnablementAdded = true;
1203
- }
1204
- if (visibleMenuActions.length > 0) {
1205
- actions.push(( new Separator()));
1206
- }
1207
- }
1208
- if (hasActiveSession && !agentHostEnablementAdded) {
1209
- actions.push(...agentHostEnablementActions);
1210
- }
1211
- if (actions[actions.length - 1] instanceof Separator) {
1212
- actions.pop();
1213
- }
1214
- return actions;
1215
- }
1216
- function createBuiltinEntry(server, activeSessionServer) {
1217
- return {
1218
- type: "builtin-item",
1219
- id: `builtin-${server.definition.id}`,
1220
- label: server.definition.label,
1221
- description: "",
1222
- collectionId: server.collection.id,
1223
- activeSessionServer,
1224
- localServer: server
1225
- };
1226
- }
1227
- function createInstalledMcpServerDetailInput(entry) {
1228
- if (entry.type === "server-item") {
1229
- return createWorkbenchMcpServerDetailInput(entry.server);
1230
- }
1231
- const activeSessionServer = getActiveSessionServer(entry);
1232
- const localServer = entry.type === "session-server-item" ? undefined : entry.localServer;
1233
- const localDefinitions = localServer?.readDefinitions().get();
1234
- const localDefinition = localDefinitions?.server;
1235
- const collectionOrigin = localDefinitions?.collection?.presentation?.origin;
1236
- const localSource = localDefinition?.presentation?.origin ?? (collectionOrigin ? {
1237
- uri: collectionOrigin
1238
- } : undefined);
1239
- const activeSessionSource = activeSessionServer?.sourceUri ? {
1240
- uri: activeSessionServer.sourceUri,
1241
- range: activeSessionServer.sourceRange ? ( new Range(
1242
- activeSessionServer.sourceRange.start.line + 1,
1243
- activeSessionServer.sourceRange.start.character + 1,
1244
- activeSessionServer.sourceRange.end.line + 1,
1245
- activeSessionServer.sourceRange.end.character + 1
1246
- )) : undefined
1247
- } : undefined;
1248
- return {
1249
- id: getMcpRowKey(entry),
1250
- name: getMcpEntryLabel(entry),
1251
- label: getMcpEntryLabel(entry),
1252
- installState: McpServerInstallState.Installed,
1253
- config: localDefinition ? getMcpServerConfiguration(localDefinition) : undefined,
1254
- source: localSource ?? activeSessionSource
1255
- };
1256
- }
1257
- function getMcpServerConfiguration(definition) {
1258
- const launch = definition.launch;
1259
- if (launch.type === McpServerTransportType.HTTP) {
1260
- return {
1261
- type: McpServerType.REMOTE,
1262
- url: ( launch.uri.toString(true)),
1263
- headers: launch.headers.length > 0 ? Object.fromEntries(launch.headers) : undefined,
1264
- oauth: launch.oauth,
1265
- dev: definition.devMode
1266
- };
1267
- }
1268
- return {
1269
- type: McpServerType.LOCAL,
1270
- command: launch.command,
1271
- args: launch.args,
1272
- env: launch.env,
1273
- envFile: launch.envFile,
1274
- cwd: launch.cwd,
1275
- sandboxEnabled: definition.sandboxEnabled,
1276
- dev: definition.devMode
1277
- };
1278
- }
1279
- let McpListWidget = class McpListWidget extends Disposable {
1280
- constructor(
1281
- instantiationService,
1282
- mcpWorkbenchService,
1283
- mcpService,
1284
- mcpRegistry,
1285
- commandService,
1286
- openerService,
1287
- contextViewService,
1288
- contextMenuService,
1289
- agentPluginService,
1290
- dialogService,
1291
- configurationService,
1292
- customizationHarnessService,
1293
- agentHostCustomizationService,
1294
- workspaceService,
1295
- notificationService,
1296
- outputService,
1297
- mcpGalleryManifestService
1298
- ) {
1299
- super();
1300
- this.instantiationService = instantiationService;
1301
- this.mcpWorkbenchService = mcpWorkbenchService;
1302
- this.mcpService = mcpService;
1303
- this.mcpRegistry = mcpRegistry;
1304
- this.commandService = commandService;
1305
- this.openerService = openerService;
1306
- this.contextViewService = contextViewService;
1307
- this.contextMenuService = contextMenuService;
1308
- this.agentPluginService = agentPluginService;
1309
- this.dialogService = dialogService;
1310
- this.configurationService = configurationService;
1311
- this.customizationHarnessService = customizationHarnessService;
1312
- this.agentHostCustomizationService = agentHostCustomizationService;
1313
- this.workspaceService = workspaceService;
1314
- this.notificationService = notificationService;
1315
- this.outputService = outputService;
1316
- this._onDidSelectServer = this._register(( new Emitter()));
1317
- this.onDidSelectServer = this._onDidSelectServer.event;
1318
- this._onDidChangeItemCount = this._register(( new Emitter()));
1319
- this.onDidChangeItemCount = this._onDidChangeItemCount.event;
1320
- this._onDidRequestShowPlugin = this._register(( new Emitter()));
1321
- this.onDidRequestShowPlugin = this._onDidRequestShowPlugin.event;
1322
- this.disabledLinkListener = this._register(( new MutableDisposable()));
1323
- this.filteredServers = [];
1324
- this.filteredBuiltinCount = 0;
1325
- this.filteredActiveSessionCount = 0;
1326
- this.installedEntries = [];
1327
- this.gallerySnapshotServers = [];
1328
- this.galleryServers = [];
1329
- this.searchQuery = "";
1330
- this.gallerySnapshotFailed = false;
1331
- this.gallerySnapshotLoading = false;
1332
- this.gallerySearchLoading = false;
1333
- this.visible = false;
1334
- this.mcpAccessEnabled = false;
1335
- this.narrowLayout = false;
1336
- this.wideLayout = false;
1337
- this.lastHeight = 0;
1338
- this.lastWidth = 0;
1339
- this.lastHeaderHeight = 0;
1340
- this._layoutDeferred = false;
1341
- this.revealLastItemScheduler = this._register(( new MutableDisposable()));
1342
- this.sectionScrollPositions = ( new Map());
1343
- this.cardDisposables = this._register(( new DisposableStore()));
1344
- this.pendingSectionLayout = this._register(( new MutableDisposable()));
1345
- this.cardListControllers = ( new WeakMap());
1346
- this.sectionLists = [];
1347
- this.collapsedSections = ( new Set());
1348
- this.delayedFilter = ( new Delayer(200));
1349
- this.delayedGallerySearch = ( new Delayer(400));
1350
- this.agentHostCustomizationsChanged = observableSignalFromEvent(this, this.agentHostCustomizationService.onDidChangeCustomizations);
1351
- this.element = $(".mcp-list-widget.plugin-list-widget");
1352
- this.create();
1353
- const resizeObserver = this._register(new DisposableResizeObserver(
1354
- "McpListWidget",
1355
- () => this.updateResponsiveLayout(this.element.offsetWidth),
1356
- getWindow(this.element)
1357
- ));
1358
- this._register(resizeObserver.observe(this.element));
1359
- this.updateAccessState();
1360
- this._register(mcpGalleryManifestService.onDidChangeMcpGalleryManifest(() => {
1361
- this.galleryCts?.dispose(true);
1362
- this.galleryCts = undefined;
1363
- this.gallerySnapshotServers = [];
1364
- this.galleryServers = [];
1365
- this.gallerySnapshotFailed = false;
1366
- this.gallerySnapshotLoading = false;
1367
- if (this.searchQuery.trim()) {
1368
- void this.queryMcpSearch();
1369
- } else {
1370
- void this.refresh();
1371
- }
1372
- }));
1373
- void mcpGalleryManifestService.getMcpGalleryManifest();
1374
- void this.refresh();
1375
- this._register(this.configurationService.onDidChangeConfiguration(e => {
1376
- if (e.affectsConfiguration(mcpAccessConfig)) {
1377
- this.updateAccessState();
1378
- }
1379
- }));
1380
- this._register({
1381
- dispose: () => {
1382
- this.delayedFilter.cancel();
1383
- this.delayedGallerySearch.cancel();
1384
- this.galleryCts?.dispose(true);
1385
- }
1386
- });
1387
- }
1388
- create() {
1389
- this.sectionTitleHeader = append(this.element, $(".section-title-header"));
1390
- const titleRow = append(this.sectionTitleHeader, $(".section-title-row"));
1391
- const sectionTitle = append(titleRow, $("h2.section-title"));
1392
- sectionTitle.textContent = ( localize(7022, "MCP Servers"));
1393
- const sectionTitleDescription = append(this.sectionTitleHeader, $("p.section-title-description"));
1394
- const sectionTitleDescriptionText = append(sectionTitleDescription, $("span.section-title-description-text"));
1395
- sectionTitleDescriptionText.textContent = ( localize(
1396
- 7023,
1397
- "An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more."
1398
- ));
1399
- sectionTitleDescription.appendChild(createTextNode(" "));
1400
- this.sectionLink = append(sectionTitleDescription, $("a.section-title-link"));
1401
- this.sectionLink.textContent = ( localize(7024, "Learn more about MCP servers"));
1402
- this.sectionLink.href = "https://code.visualstudio.com/docs/agent-customization/mcp-servers?referrer=in-product";
1403
- this._register(addDisposableListener(this.sectionLink, "click", e => {
1404
- e.preventDefault();
1405
- const href = this.sectionLink.href;
1406
- if (href) {
1407
- this.openerService.open(( URI.parse(href)));
1408
- }
1409
- }));
1410
- const targetWindow = getWindow(this.element);
1411
- const headerObserver = this._register(
1412
- new DisposableResizeObserver("McpListWidget.sectionTitleHeader", () => {
1413
- if (this.lastWidth <= 0 || this.lastHeight <= 0) {
1414
- return;
1415
- }
1416
- const headerHeight = this.sectionTitleHeader.offsetHeight;
1417
- if (headerHeight === this.lastHeaderHeight) {
1418
- return;
1419
- }
1420
- this.layout(this.lastHeight, this.lastWidth);
1421
- }, targetWindow)
1422
- );
1423
- this._register(headerObserver.observe(this.sectionTitleHeader));
1424
- this.searchAndButtonContainer = append(this.element, $(".list-search-and-button-container"));
1425
- const searchContainer = append(this.searchAndButtonContainer, $(".list-search-container"));
1426
- this.searchInput = this._register(( new InputBox(searchContainer, this.contextViewService, {
1427
- placeholder: ( localize(7025, "Type to search...")),
1428
- inputBoxStyles: defaultInputBoxStyles
1429
- })));
1430
- this._register(this.searchInput.onDidChange(() => {
1431
- this.searchQuery = this.searchInput.value;
1432
- this.galleryCts?.dispose(true);
1433
- this.galleryCts = undefined;
1434
- this.searchInput.hideMessage();
1435
- const query = this.searchQuery.toLowerCase().trim();
1436
- this.galleryServers = query ? this.gallerySnapshotServers.filter(server => this.matchesGalleryServerQuery(server, query)) : [...this.gallerySnapshotServers];
1437
- this.delayedFilter.trigger(() => this.filterServers());
1438
- if (!this.mcpAccessEnabled) {
1439
- this.gallerySearchLoading = false;
1440
- this.delayedGallerySearch.cancel();
1441
- return;
1442
- }
1443
- if (query) {
1444
- this.gallerySearchLoading = true;
1445
- this.delayedGallerySearch.trigger(() => this.queryMcpSearch());
1446
- } else {
1447
- this.gallerySearchLoading = false;
1448
- this.delayedGallerySearch.cancel();
1449
- if (this.visible && this.gallerySnapshotServers.length === 0) {
1450
- this.delayedGallerySearch.trigger(() => this.queryGallerySnapshot());
1451
- }
1452
- }
1453
- }));
1454
- this.emptyContainer = append(this.element, $(".mcp-empty-state"));
1455
- const emptyHeader = append(this.emptyContainer, $(".empty-state-header"));
1456
- this.emptyText = append(emptyHeader, $(".empty-text"));
1457
- this.emptySubtext = append(this.emptyContainer, $(".empty-subtext"));
1458
- this.disabledContainer = append(this.element, $(".mcp-disabled-state"));
1459
- const disabledHeader = append(this.disabledContainer, $(".empty-state-header"));
1460
- this.disabledIcon = append(disabledHeader, $(".empty-icon"));
1461
- const disabledText = append(disabledHeader, $(".empty-text"));
1462
- disabledText.textContent = ( localize(7026, "MCP servers are disabled"));
1463
- this.disabledMessage = append(this.disabledContainer, $(".empty-subtext"));
1464
- this.cardContainer = $(".plugin-card-container");
1465
- this.cardScrollable = this._register(( new DomScrollableElement(this.cardContainer, {
1466
- horizontal: ScrollbarVisibility.Hidden,
1467
- vertical: ScrollbarVisibility.Auto,
1468
- useShadows: false
1469
- })));
1470
- this._register(
1471
- addDisposableListener(this.cardContainer, EventType.SCROLL, () => {
1472
- this.cardScrollable.setScrollPosition({
1473
- scrollTop: this.cardContainer.scrollTop
1474
- });
1475
- })
1476
- );
1477
- this.cardScrollableNode = this.cardScrollable.getDomNode();
1478
- this.cardScrollableNode.classList.add("plugin-card-scrollable");
1479
- this.cardScrollableNode.style.display = "none";
1480
- this.element.appendChild(this.cardScrollableNode);
1481
- const cardResizeObserver = this._register(
1482
- new DisposableResizeObserver("McpListWidget.cardScrollable", () => this.cardScrollable.scanDomNode())
1483
- );
1484
- this._register(cardResizeObserver.observe(this.cardScrollableNode));
1485
- this._register(this.mcpWorkbenchService.onChange(() => {
1486
- this.refresh();
1487
- }));
1488
- this._register(autorun(reader => {
1489
- const servers = this.mcpService.servers.read(reader);
1490
- for (const server of servers) {
1491
- server.enablement.read(reader);
1492
- }
1493
- this.refresh();
1494
- }));
1495
- this._register(autorun(reader => {
1496
- this.customizationHarnessService.activeSessionResource.read(reader);
1497
- this.refresh();
1498
- }));
1499
- this._register(this.agentHostCustomizationService.onDidChangeCustomizations(() => {
1500
- const previousMembership = this.getInstalledEntryMembershipSignature();
1501
- this.filterServers(false);
1502
- if (!hasSameMcpMembership(previousMembership, this.getInstalledEntryMembershipSignature())) {
1503
- this.renderFilteredServers();
1504
- }
1505
- }));
1506
- }
1507
- async refresh() {
1508
- this.filterServers();
1509
- if (shouldLoadMcpGallerySnapshot(
1510
- this.visible,
1511
- this.searchQuery,
1512
- this.gallerySnapshotServers.length,
1513
- this.gallerySnapshotFailed,
1514
- this.gallerySnapshotLoading,
1515
- this.mcpAccessEnabled
1516
- )) {
1517
- await this.queryGallerySnapshot();
1518
- }
1519
- }
1520
- setVisible(visible) {
1521
- if (this.visible === visible) {
1522
- return;
1523
- }
1524
- this.visible = visible;
1525
- if (visible) {
1526
- void this.refresh();
1527
- }
1528
- }
1529
- updateAccessState() {
1530
- const inspect = this.configurationService.inspect(mcpAccessConfig);
1531
- const value = inspect.value ?? inspect.defaultValue;
1532
- const disabled = value === McpAccessValue.None;
1533
- const policyLocked = inspect.policyValue === McpAccessValue.None;
1534
- const accessChanged = this.mcpAccessEnabled === disabled;
1535
- this.mcpAccessEnabled = !disabled;
1536
- this.element.classList.toggle("access-disabled", disabled);
1537
- if (disabled) {
1538
- this.delayedGallerySearch.cancel();
1539
- this.galleryCts?.dispose(true);
1540
- this.galleryCts = undefined;
1541
- this.gallerySnapshotLoading = false;
1542
- this.gallerySearchLoading = false;
1543
- this.searchInput.hideMessage();
1544
- this.disabledIcon.className = "empty-icon";
1545
- this.disabledIcon.classList.add(
1546
- ...ThemeIcon.asClassNameArray(policyLocked ? Codicon.shield : mcpServerIcon)
1547
- );
1548
- clearNode(this.disabledMessage);
1549
- this.disabledLinkListener.clear();
1550
- if (policyLocked) {
1551
- this.disabledMessage.textContent = ( localize(
1552
- 7027,
1553
- "Access to MCP servers is disabled by your organization. Contact your organization administrator for more information."
1554
- ));
1555
- } else {
1556
- this.disabledMessage.appendChild(createTextNode(( localize(7028, "MCP servers are disabled in settings. "))));
1557
- const link = append(this.disabledMessage, $("a.mcp-disabled-settings-link"));
1558
- link.textContent = ( localize(7029, "Configure in settings."));
1559
- link.href = "#";
1560
- link.setAttribute("role", "button");
1561
- this.disabledLinkListener.value = addDisposableListener(link, "click", e => {
1562
- e.preventDefault();
1563
- this.commandService.executeCommand("workbench.action.openSettings", `@id:${mcpAccessConfig}`);
1564
- });
1565
- }
1566
- } else if (accessChanged && this.visible) {
1567
- if (this.searchQuery.trim()) {
1568
- void this.queryMcpSearch();
1569
- } else {
1570
- void this.refresh();
1571
- }
1572
- }
1573
- }
1574
- showBrowseMarketplace() {
1575
- if (!this.mcpAccessEnabled) {
1576
- return;
1577
- }
1578
- this.searchInput.value = "";
1579
- this.searchQuery = "";
1580
- void this.queryGallerySnapshot(true);
1581
- }
1582
- async queryGallerySnapshot(revealMarketplace = false) {
1583
- if (!this.mcpAccessEnabled) {
1584
- return;
1585
- }
1586
- this.galleryCts?.dispose(true);
1587
- const cts = this.galleryCts = ( new CancellationTokenSource());
1588
- this.gallerySnapshotLoading = true;
1589
- if (!revealMarketplace && !this.searchQuery.trim()) {
1590
- this.renderMcpHome();
1591
- }
1592
- try {
1593
- const pager = await this.mcpWorkbenchService.queryGallery(undefined, cts.token);
1594
- if (this.galleryCts !== cts || cts.token.isCancellationRequested || !this.mcpAccessEnabled || this.searchQuery.trim()) {
1595
- return;
1596
- }
1597
- this.gallerySnapshotServers = pager.firstPage.items;
1598
- this.galleryServers = [...this.gallerySnapshotServers];
1599
- this.gallerySnapshotFailed = false;
1600
- this.gallerySnapshotLoading = false;
1601
- this.renderMcpHome();
1602
- if (revealMarketplace) {
1603
- this.availableSection?.scrollIntoView({
1604
- block: "start"
1605
- });
1606
- }
1607
- } catch {
1608
- if (this.galleryCts === cts && !cts.token.isCancellationRequested && this.mcpAccessEnabled) {
1609
- this.gallerySnapshotServers = [];
1610
- this.galleryServers = [];
1611
- this.gallerySnapshotFailed = true;
1612
- this.gallerySnapshotLoading = false;
1613
- this.renderMcpHome();
1614
- }
1615
- } finally {
1616
- if (this.galleryCts === cts) {
1617
- this.gallerySnapshotLoading = false;
1618
- }
1619
- }
1620
- }
1621
- async queryMcpSearch() {
1622
- const query = this.searchQuery.trim();
1623
- if (!query || !this.mcpAccessEnabled) {
1624
- return;
1625
- }
1626
- this.galleryCts?.dispose(true);
1627
- const cts = this.galleryCts = ( new CancellationTokenSource());
1628
- this.gallerySearchLoading = true;
1629
- try {
1630
- const pager = await this.mcpWorkbenchService.queryGallery({
1631
- text: query
1632
- }, cts.token);
1633
- if (this.galleryCts !== cts || cts.token.isCancellationRequested || !this.mcpAccessEnabled || this.searchQuery.trim() !== query) {
1634
- return;
1635
- }
1636
- this.galleryServers = pager.firstPage.items;
1637
- this.searchInput.hideMessage();
1638
- } catch {
1639
- if (this.galleryCts === cts && !cts.token.isCancellationRequested && this.mcpAccessEnabled && this.searchQuery.trim() === query) {
1640
- this.galleryServers = this.gallerySnapshotServers.filter(server => this.matchesGalleryServerQuery(server, query.toLowerCase()));
1641
- this.searchInput.showMessage({
1642
- content: ( localize(
1643
- 7030,
1644
- "Marketplace results are unavailable. Showing installed MCP servers only."
1645
- )),
1646
- type: MessageType.WARNING
1647
- });
1648
- }
1649
- } finally {
1650
- if (this.galleryCts === cts && this.mcpAccessEnabled && this.searchQuery.trim() === query) {
1651
- this.gallerySearchLoading = false;
1652
- this.filterServers();
1653
- }
1654
- }
1655
- }
1656
- showCardSurface() {
1657
- this.emptyContainer.style.display = "none";
1658
- this.cardScrollableNode.style.display = "";
1659
- }
1660
- showEmptySurface(message, detail) {
1661
- this.cardScrollableNode.style.display = "none";
1662
- this.emptyContainer.style.display = "flex";
1663
- this.emptyText.textContent = message;
1664
- this.emptySubtext.textContent = detail;
1665
- }
1666
- createCardScrollContent(...classNames) {
1667
- const content = append(this.cardContainer, $(".plugin-card-scroll.plugin-card-scroll-content"));
1668
- content.classList.add(...classNames);
1669
- this.sectionLayoutContainer = classNames.includes("distributed-section-layout") ? content : undefined;
1670
- const resizeObserver = this.cardDisposables.add(
1671
- new DisposableResizeObserver("McpListWidget.cardScrollContent", () => this.scheduleMcpSectionLayout())
1672
- );
1673
- this.cardDisposables.add(resizeObserver.observe(content));
1674
- return content;
1675
- }
1676
- addSurfaceActivation(surface, label, callback, ...classNames) {
1677
- const primaryAction = createCustomizationCardPrimaryAction(surface, label, ...classNames);
1678
- this.firstCardFocusElement ??= primaryAction;
1679
- this.cardDisposables.add(addDisposableListener(primaryAction, "click", callback));
1680
- return primaryAction;
1681
- }
1682
- renderCardSection(parent, title, description, className, count, renderActions) {
1683
- const section = append(parent, $(".plugin-card-section"));
1684
- section.classList.add(className);
1685
- const header = append(section, $(".plugin-card-section-header"));
1686
- const text = append(header, $(".plugin-card-section-text"));
1687
- const headingRow = append(text, $(".plugin-card-section-heading-row"));
1688
- const heading = append(headingRow, $("h3.plugin-card-section-title"));
1689
- heading.textContent = title;
1690
- if (count !== undefined) {
1691
- const countElement = append(headingRow, $(".plugin-card-section-count"));
1692
- countElement.textContent = String(count);
1693
- }
1694
- if (description) {
1695
- const descriptionElement = append(text, $(".plugin-card-section-description"));
1696
- descriptionElement.textContent = description;
1697
- }
1698
- renderActions?.(header);
1699
- const list = append(section, $(".plugin-card-grid"));
1700
- list.dataset.virtualizedSectionKey = className;
1701
- const collapsedSections = this.collapsedSections ??= ( new Set());
1702
- setupCollapsibleSection(headingRow, list, title, this.cardDisposables, ( collapsedSections.has(className)), collapsed => {
1703
- if (collapsed) {
1704
- collapsedSections.add(className);
1705
- } else {
1706
- collapsedSections.delete(className);
1707
- }
1708
- this.scheduleMcpSectionLayout();
1709
- });
1710
- this.cardListControllers.set(list, this.cardDisposables.add(( new CustomizationCardListController(list, title))));
1711
- return list;
1712
- }
1713
- createMcpSectionList(container, label, entries) {
1714
- const key = container.dataset.virtualizedSectionKey ?? label;
1715
- container.style.height = `${MCP_SECTION_ITEM_HEIGHT}px`;
1716
- container.classList.add("virtualized-section-list");
1717
- this.cardListControllers.get(container)?.dispose();
1718
- this.cardListControllers.delete(container);
1719
- container.removeAttribute("role");
1720
- container.removeAttribute("aria-label");
1721
- const itemRenderer = this.cardDisposables.add(this.instantiationService.createInstance(
1722
- McpServerItemRenderer,
1723
- (getEntry, actions, disposables, updateTabbability) => this.renderMcpListActions(getEntry, actions, disposables, updateTabbability)
1724
- ));
1725
- const marketplaceRenderer = ( new McpMarketplaceItemRenderer((server, button) => this.installMarketplaceServer(server, button)));
1726
- const list = this.cardDisposables.add(
1727
- this.instantiationService.createInstance(WorkbenchList, `McpManagementList.${label}`, container, ( new McpSectionDelegate()), [itemRenderer, marketplaceRenderer], {
1728
- multipleSelectionSupport: false,
1729
- setRowLineHeight: false,
1730
- horizontalScrolling: false,
1731
- supportDynamicHeights: true,
1732
- accessibilityProvider: {
1733
- getAriaLabel: entry => entry.type === "marketplace-item" ? ( localize(
1734
- 7031,
1735
- "{0}. Available to install from the MCP marketplace.",
1736
- entry.server.label
1737
- )) : this.getMcpEntryAriaLabel(entry, itemRenderer),
1738
- getWidgetAriaLabel: () => label,
1739
- getSetSize: (_entry, _index, listLength) => listLength,
1740
- getPosInSet: (_entry, index) => index + 1
1741
- },
1742
- openOnSingleClick: true,
1743
- identityProvider: {
1744
- getId: entry => entry.type === "marketplace-item" ? `marketplace:${entry.server.id}` : getMcpRowKey(entry)
1745
- }
1746
- })
1747
- );
1748
- this.cardDisposables.add(list.onDidChangeContentHeight(() => this.scheduleMcpSectionLayout()));
1749
- list.splice(0, 0, entries);
1750
- const section = {
1751
- list,
1752
- entries,
1753
- container,
1754
- key,
1755
- pendingMeasurements: ( new Set()),
1756
- deferredMeasurements: ( new Set())
1757
- };
1758
- this.sectionLists.push(section);
1759
- this.cardDisposables.add(list.onDidScroll(() => {
1760
- if (( [...section.deferredMeasurements].some(index => index >= list.firstVisibleIndex && index <= list.lastVisibleIndex))) {
1761
- this.scheduleMcpSectionLayout();
1762
- }
1763
- }));
1764
- const heightInputs = ( new Map());
1765
- this.cardDisposables.add(itemRenderer.onDidChangeHeight((
1766
- {
1767
- index,
1768
- text,
1769
- expanded
1770
- }
1771
- ) => {
1772
- const entry = entries[index];
1773
- if (entry && entry.type !== "marketplace-item") {
1774
- heightInputs.set(entry, {
1775
- text,
1776
- expanded
1777
- });
1778
- }
1779
- section.pendingMeasurements.add(index);
1780
- this.scheduleMcpSectionLayout();
1781
- }));
1782
- this.cardDisposables.add(autorun(reader => {
1783
- this.agentHostCustomizationsChanged.read(reader);
1784
- const sessionResource = this.customizationHarnessService.activeSessionResource.read(reader);
1785
- const servers = ( new Map(( this.agentHostCustomizationService.getMcpServers(sessionResource).map(server => [server.id, server]))));
1786
- for (let index = 0; index < entries.length; index++) {
1787
- const entry = entries[index];
1788
- if (entry.type === "marketplace-item") {
1789
- continue;
1790
- }
1791
- const host = getActiveSessionServer(entry);
1792
- let error;
1793
- if (host) {
1794
- const server = servers.get(host.id);
1795
- error = server?.enabled && server.status === McpServerStatus.Error ? getMcpErrorMessage(
1796
- server.status,
1797
- server.state?.kind === McpServerStatus.Error ? server.state.error?.message : undefined
1798
- ) : undefined;
1799
- } else if (!this.workspaceService.isSessionsWindow && entry.type !== "session-server-item") {
1800
- const state = entry.localServer?.connectionState.read(reader);
1801
- const enabled = !entry.localServer || isContributionEnabled(entry.localServer.enablement.read(reader));
1802
- error = enabled && state?.state === McpConnectionState.Kind.Error ? getMcpErrorMessage(state.state, state.message) : undefined;
1803
- }
1804
- itemRenderer.syncError(entry, error);
1805
- const expanded = itemRenderer.isErrorExpanded(entry, error);
1806
- const text = error === undefined ? undefined : expanded ? error : getMcpErrorPreview(error).text;
1807
- const previous = heightInputs.get(entry);
1808
- heightInputs.set(entry, {
1809
- text,
1810
- expanded
1811
- });
1812
- if (previous && (previous.text !== text || previous.expanded !== expanded)) {
1813
- section.pendingMeasurements.add(index);
1814
- }
1815
- }
1816
- if (section.pendingMeasurements.size) {
1817
- this.scheduleMcpSectionLayout();
1818
- }
1819
- }));
1820
- list.scrollTop = this.sectionScrollPositions.get(key) ?? 0;
1821
- this.cardDisposables.add(list.onDidOpen(event => {
1822
- const entry = event.element;
1823
- if (!entry) {
1824
- return;
1825
- }
1826
- this._onDidSelectServer.fire(
1827
- entry.type === "marketplace-item" ? createWorkbenchMcpServerDetailInput(entry.server) : createInstalledMcpServerDetailInput(entry)
1828
- );
1829
- }));
1830
- this.cardDisposables.add(list.onContextMenu(event => {
1831
- if (event.element && event.element.type !== "marketplace-item") {
1832
- this.showMcpServerActions(event.element, event.anchor);
1833
- }
1834
- }));
1835
- this.cardDisposables.add(list.onDidChangeFocus(event => {
1836
- const index = event.indexes[0] ?? -1;
1837
- itemRenderer.setFocusedIndex(index);
1838
- marketplaceRenderer.setFocusedIndex(index);
1839
- }));
1840
- this.cardDisposables.add(list.onDidFocus(() => {
1841
- if (list.getFocus().length === 0 && entries.length > 0) {
1842
- list.setFocus([0]);
1843
- }
1844
- }));
1845
- }
1846
- captureSectionScrollPositions() {
1847
- for (const section of this.sectionLists) {
1848
- this.sectionScrollPositions.set(section.key, section.list.scrollTop);
1849
- }
1850
- }
1851
- getMcpEntryAriaLabel(entry, renderer) {
1852
- return derived(this, reader => {
1853
- renderer?.readErrorExpansion(reader);
1854
- this.agentHostCustomizationsChanged.read(reader);
1855
- const label = getMcpEntryLabel(entry);
1856
- const activeSessionResource = this.customizationHarnessService.activeSessionResource.read(reader);
1857
- let statusKind;
1858
- let disabledReason;
1859
- let errorMessage;
1860
- const activeSessionServer = getActiveSessionServer(entry);
1861
- if (activeSessionServer !== undefined) {
1862
- const server = this.agentHostCustomizationService.getMcpServers(activeSessionResource).find(server => server.id === activeSessionServer.id);
1863
- const presentation = server && getActiveSessionServerPresentation(server);
1864
- statusKind = presentation?.status;
1865
- disabledReason = presentation?.enabled ? undefined : server?.disabledReason;
1866
- errorMessage = server?.state?.kind === McpServerStatus.Error ? server.state.error?.message : undefined;
1867
- } else if (entry.type !== "session-server-item" && entry.localServer && isContributionDisabled(entry.localServer.enablement.read(reader))) {
1868
- statusKind = "disabled";
1869
- disabledReason = getMcpDisabledReason(entry);
1870
- } else if (entry.type !== "session-server-item" && !this.workspaceService.isSessionsWindow) {
1871
- const connectionState = entry.localServer?.connectionState.read(reader);
1872
- statusKind = entry.type === "server-item" || connectionState?.state === McpConnectionState.Kind.Error ? connectionState?.state : undefined;
1873
- errorMessage = connectionState?.state === McpConnectionState.Kind.Error ? connectionState.message : undefined;
1874
- }
1875
- const status = getMcpStatusPresentation(statusKind, disabledReason);
1876
- const error = getMcpErrorMessage(statusKind, errorMessage);
1877
- if (status && error) {
1878
- const preview = getMcpErrorPreview(error);
1879
- const expanded = renderer?.isErrorExpanded(entry, error);
1880
- const text = expanded ? error : preview.text;
1881
- return !expanded && (preview.truncated || renderer?.isErrorClipped(entry)) ? ( localize(
1882
- 7032,
1883
- "{0}, {1}, {2}. Use Show More to read the full error.",
1884
- label,
1885
- status.label,
1886
- text
1887
- )) : ( localize(7033, "{0}, {1}, {2}", label, status.label, text));
1888
- }
1889
- return status ? ( localize(7008, "{0}, {1}", label, status.label)) : label;
1890
- });
1891
- }
1892
- renderMcpListActions(getEntry, actions, disposables, updateTabbability) {
1893
- const entry = getEntry();
1894
- if (!entry) {
1895
- return;
1896
- }
1897
- const label = getMcpEntryLabel(entry);
1898
- let enabled = this.isInstalledEntryEnabled(entry);
1899
- const toggle = disposables.add(( new Switch({
1900
- ariaLabel: label,
1901
- checked: enabled
1902
- })));
1903
- append(actions, toggle.domNode);
1904
- const update = () => {
1905
- const currentEntry = getEntry();
1906
- enabled = currentEntry ? this.isInstalledEntryEnabled(currentEntry) : false;
1907
- const blockedByPlugin = currentEntry && getMcpDisabledReason(currentEntry)?.source === "plugin";
1908
- const toggleLabel = enabled ? ( localize(7034, "Disable {0}", label)) : ( localize(7035, "Enable {0}", label));
1909
- const accessibleLabel = blockedByPlugin ? ( localize(7036, "{0} is disabled by its plugin", label)) : toggleLabel;
1910
- toggle.disabled = !currentEntry || !!blockedByPlugin;
1911
- toggle.checked = enabled;
1912
- toggle.setAriaLabel(accessibleLabel);
1913
- updateTabbability();
1914
- };
1915
- update();
1916
- disposables.add(
1917
- addDisposableGenericMouseDownListener(toggle.domNode, event => EventHelper.stop(event, true))
1918
- );
1919
- disposables.add(toggle.onChange(checked => {
1920
- const currentEntry = getEntry();
1921
- if (!currentEntry) {
1922
- update();
1923
- return;
1924
- }
1925
- enabled = checked;
1926
- this.setInstalledEntryEnabled(currentEntry, enabled);
1927
- update();
1928
- status(enabled ? ( localize(7037, "{0} enabled.", label)) : ( localize(7038, "{0} disabled.", label)));
1929
- }));
1930
- if (entry.type !== "session-server-item" && entry.localServer) {
1931
- disposables.add(autorun(reader => {
1932
- entry.localServer?.enablement.read(reader);
1933
- update();
1934
- }));
1935
- }
1936
- disposables.add(this.agentHostCustomizationService.onDidChangeCustomizations(update));
1937
- const more = disposables.add(( new Button(actions, {
1938
- ...getButtonStyles({
1939
- buttonSecondaryBackground: undefined,
1940
- buttonSecondaryBorder: undefined
1941
- }),
1942
- secondary: true,
1943
- supportIcons: true,
1944
- ariaLabel: ( localize(7039, "More actions for {0}", label))
1945
- })));
1946
- more.element.classList.add("plugin-card-icon-button");
1947
- more.label = `$(${Codicon.ellipsis.id})`;
1948
- registerMcpInlineButtonAction(disposables, more, () => {
1949
- const currentEntry = getEntry();
1950
- if (currentEntry) {
1951
- this.showMcpServerActions(currentEntry, more.element);
1952
- }
1953
- });
1954
- }
1955
- layoutMcpSectionLists() {
1956
- const content = this.sectionLayoutContainer;
1957
- if (!content || content.clientWidth === 0) {
1958
- return;
1959
- }
1960
- const heights = layoutVirtualizedSections(content, ( this.sectionLists.map(section => ({
1961
- container: section.container,
1962
- contentHeight: section.list.contentHeight,
1963
- minimumHeight: getVirtualizedSectionMinimumHeight(( section.entries.map((_entry, index) => index)), index => section.list.getElementHeight(index))
1964
- }))));
1965
- for (let index = 0; index < this.sectionLists.length; index++) {
1966
- const section = this.sectionLists[index];
1967
- const height = heights[index];
1968
- section.container.style.height = `${height}px`;
1969
- if (height > 0) {
1970
- section.list.layout(height, section.container.clientWidth || undefined);
1971
- for (const index of section.deferredMeasurements) {
1972
- if (index >= section.list.firstVisibleIndex && index <= section.list.lastVisibleIndex) {
1973
- section.deferredMeasurements.delete(index);
1974
- section.pendingMeasurements.add(index);
1975
- }
1976
- }
1977
- const pending = [...section.pendingMeasurements];
1978
- section.pendingMeasurements.clear();
1979
- for (const index of pending) {
1980
- if (index >= section.list.firstVisibleIndex && index <= section.list.lastVisibleIndex) {
1981
- section.list.updateElementHeight(index, undefined);
1982
- } else {
1983
- section.list.updateElementHeight(index, MCP_SECTION_ITEM_HEIGHT);
1984
- section.deferredMeasurements.add(index);
1985
- }
1986
- }
1987
- }
1988
- }
1989
- }
1990
- scheduleMcpSectionLayout() {
1991
- this.pendingSectionLayout.value = scheduleAtNextAnimationFrame(getWindow(this.element), () => {
1992
- this.layoutMcpSectionLists();
1993
- this.cardScrollable.scanDomNode();
1994
- });
1995
- }
1996
- renderMcpHome() {
1997
- if (this.searchQuery.trim()) {
1998
- return;
1999
- }
2000
- this.captureSectionScrollPositions();
2001
- this.cardDisposables.clear();
2002
- this.sectionLists = [];
2003
- this.installedAddButton = undefined;
2004
- this.firstCardFocusElement = undefined;
2005
- this.availableSection = undefined;
2006
- clearNode(this.cardContainer);
2007
- this.showCardSurface();
2008
- const content = this.createCardScrollContent("distributed-section-layout");
2009
- const installedList = this.renderCardSection(content, ( localize(7040, "Installed")), undefined, "installed-mcp-servers-section", this.installedEntries.length, header => this.renderInstalledSectionActions(header));
2010
- installedList.classList.add("plugin-inventory-list");
2011
- if (this.installedEntries.length === 0) {
2012
- const empty = append(installedList, $(".plugin-inventory-empty"));
2013
- empty.textContent = ( localize(7041, "No MCP servers are installed."));
2014
- } else {
2015
- this.createMcpSectionList(installedList, ( localize(7040, "Installed")), ( this.installedEntries.map(presentation => presentation.entry)));
2016
- }
2017
- this.renderAvailableServers(content, this.getAvailableGalleryServers(), true);
2018
- this.scheduleMcpSectionLayout();
2019
- }
2020
- renderInstalledSectionActions(header) {
2021
- const actions = append(header, $(".plugin-card-section-actions"));
2022
- const addLabel = ( localize(7042, "Add Server"));
2023
- const add = this.installedAddButton = this.cardDisposables.add(( new Button(actions, {
2024
- ...defaultButtonStyles,
2025
- secondary: true,
2026
- ariaLabel: addLabel
2027
- })));
2028
- add.element.classList.add("plugin-installed-action");
2029
- add.label = this.narrowLayout ? ( localize(7043, "Add")) : addLabel;
2030
- this.firstCardFocusElement ??= add.element;
2031
- this.cardDisposables.add(
2032
- add.onDidClick(() => this.commandService.executeCommand(McpCommandIds.AddConfiguration))
2033
- );
2034
- }
2035
- renderAvailableServers(parent, servers, showDescription) {
2036
- const availableList = this.renderCardSection(parent, ( localize(7044, "Available")), showDescription ? ( localize(7045, "Browse and install MCP servers from the marketplace.")) : undefined, "available-mcp-servers-section", servers.length);
2037
- this.availableSection = availableList.parentElement ?? undefined;
2038
- availableList.classList.add("plugin-inventory-list");
2039
- if (servers.length === 0) {
2040
- if (this.gallerySnapshotLoading) {
2041
- renderVirtualizedSectionLoadingPlaceholder(availableList, ( localize(7046, "Loading marketplace MCP servers...")), MCP_SECTION_ITEM_HEIGHT);
2042
- } else {
2043
- const empty = append(availableList, $(".plugin-inventory-empty"));
2044
- empty.textContent = ( localize(7047, "No marketplace MCP servers are available."));
2045
- }
2046
- this.cardListControllers.get(availableList)?.finalize();
2047
- return;
2048
- }
2049
- this.createMcpSectionList(availableList, ( localize(7044, "Available")), ( servers.map(server => ({
2050
- type: "marketplace-item",
2051
- server
2052
- }))));
2053
- }
2054
- appendInstalledServerRow(parent, presentation) {
2055
- let entry = presentation.entry;
2056
- const rowKey = getMcpRowKey(entry);
2057
- const label = getMcpEntryLabel(entry);
2058
- const row = append(parent, $(".plugin-list-item.plugin-home-row.mcp-installed-home-row"));
2059
- const enabled = this.isInstalledEntryEnabled(entry);
2060
- row.classList.toggle("disabled", !enabled);
2061
- const primaryAction = this.addSurfaceActivation(
2062
- row,
2063
- getMcpEntryAriaLabel(entry, this.workspaceService.isSessionsWindow),
2064
- () => this._onDidSelectServer.fire(createInstalledMcpServerDetailInput(entry))
2065
- );
2066
- const details = append(primaryAction, $(".plugin-list-item-details"));
2067
- const nameRow = append(details, $(".plugin-list-item-name-row"));
2068
- const name = append(nameRow, $(".plugin-list-item-name"));
2069
- name.textContent = formatDisplayName(label);
2070
- name.title = label;
2071
- const statusBadge = append(nameRow, $(".plugin-list-item-status.mcp-runtime-status-badge"));
2072
- const description = append(details, $(".plugin-list-item-description"));
2073
- const actions = append(row, $(".plugin-list-item-action"));
2074
- const getEntry = () => entry;
2075
- const signIn = this.appendInstalledServerSignIn(actions, getEntry);
2076
- const toggle = this.appendInstalledServerToggle(actions, getEntry);
2077
- const more = this.cardDisposables.add(( new Button(actions, {
2078
- ...getButtonStyles({
2079
- buttonSecondaryBackground: undefined,
2080
- buttonSecondaryBorder: undefined
2081
- }),
2082
- secondary: true,
2083
- supportIcons: true,
2084
- ariaLabel: ( localize(7039, "More actions for {0}", label))
2085
- })));
2086
- more.element.classList.add("plugin-card-icon-button");
2087
- more.label = `$(${Codicon.ellipsis.id})`;
2088
- this.cardDisposables.add(more.onDidClick(() => this.showMcpServerActions(entry, more.element)));
2089
- this.cardListControllers.get(parent)?.addItem({
2090
- row,
2091
- primaryAction,
2092
- label,
2093
- actions: [signIn?.element, toggle.element, more.element].filter(action => action !== undefined),
2094
- contextMenuAction: more.element
2095
- });
2096
- this.cardDisposables.add(autorun(reader => {
2097
- if (entry.type !== "session-server-item") {
2098
- entry.localServer?.connectionState.read(reader);
2099
- }
2100
- updateMcpCardRuntimePresentation(
2101
- statusBadge,
2102
- primaryAction,
2103
- description,
2104
- getMcpStatusKind(entry, this.workspaceService.isSessionsWindow),
2105
- getMcpDisabledReason(entry),
2106
- getMcpEntryAriaLabel(entry, this.workspaceService.isSessionsWindow),
2107
- this.getInstalledEntryDescription(entry)
2108
- );
2109
- }));
2110
- this.cardDisposables.add(this.agentHostCustomizationService.onDidChangeCustomizations(() => {
2111
- const updated = this.installedEntries.find(candidate => getMcpRowKey(candidate.entry) === rowKey)?.entry;
2112
- if (!updated) {
2113
- return;
2114
- }
2115
- entry = updated;
2116
- updateMcpCardRuntimePresentation(
2117
- statusBadge,
2118
- primaryAction,
2119
- description,
2120
- getMcpStatusKind(entry, this.workspaceService.isSessionsWindow),
2121
- getMcpDisabledReason(entry),
2122
- getMcpEntryAriaLabel(entry, this.workspaceService.isSessionsWindow),
2123
- this.getInstalledEntryDescription(entry)
2124
- );
2125
- signIn?.update();
2126
- toggle.update();
2127
- row.classList.toggle("disabled", !this.isInstalledEntryEnabled(entry));
2128
- }));
2129
- }
2130
- appendInstalledServerSignIn(parent, getEntry) {
2131
- if (getActiveSessionServer(getEntry()) === undefined) {
2132
- return undefined;
2133
- }
2134
- const label = getMcpEntryLabel(getEntry());
2135
- const signInButton = createMcpSignInButton(parent, this.cardDisposables, label);
2136
- registerMcpInlineButtonAction(this.cardDisposables, signInButton, async () => {
2137
- const activeSessionServer = getActiveSessionServer(getEntry());
2138
- if (!activeSessionServer) {
2139
- return;
2140
- }
2141
- signInButton.enabled = false;
2142
- try {
2143
- await authenticateMcpServer(
2144
- this.agentHostCustomizationService,
2145
- this.customizationHarnessService.activeSessionResource.get(),
2146
- activeSessionServer.id
2147
- );
2148
- } catch (error) {
2149
- this.notificationService.error(( localize(7048, "Unable to sign in to {0}: {1}", label, getErrorMessage(error))));
2150
- } finally {
2151
- signInButton.enabled = true;
2152
- }
2153
- });
2154
- const update = () => {
2155
- signInButton.element.style.display = getMcpStatusKind(getEntry(), this.workspaceService.isSessionsWindow) === McpServerStatus.AuthRequired ? "" : "none";
2156
- };
2157
- update();
2158
- return {
2159
- element: signInButton.element,
2160
- update
2161
- };
2162
- }
2163
- appendInstalledServerToggle(parent, getEntry) {
2164
- const label = getMcpEntryLabel(getEntry());
2165
- let enabled = this.isInstalledEntryEnabled(getEntry());
2166
- const toggle = this.cardDisposables.add(( new Switch({
2167
- ariaLabel: label,
2168
- checked: enabled
2169
- })));
2170
- const switchElement = toggle.domNode;
2171
- append(parent, switchElement);
2172
- const updateLabel = () => {
2173
- const blockedByPlugin = getMcpDisabledReason(getEntry())?.source === "plugin";
2174
- const toggleLabel = enabled ? ( localize(7034, "Disable {0}", label)) : ( localize(7035, "Enable {0}", label));
2175
- const accessibleLabel = blockedByPlugin ? ( localize(7036, "{0} is disabled by its plugin", label)) : toggleLabel;
2176
- toggle.setAriaLabel(accessibleLabel);
2177
- };
2178
- updateLabel();
2179
- this.cardDisposables.add(toggle.onChange(checked => {
2180
- enabled = checked;
2181
- updateLabel();
2182
- this.setInstalledEntryEnabled(getEntry(), enabled);
2183
- status(enabled ? ( localize(7037, "{0} enabled.", label)) : ( localize(7038, "{0} disabled.", label)));
2184
- }));
2185
- const update = () => {
2186
- enabled = this.isInstalledEntryEnabled(getEntry());
2187
- toggle.disabled = getMcpDisabledReason(getEntry())?.source === "plugin";
2188
- toggle.checked = enabled;
2189
- updateLabel();
2190
- };
2191
- update();
2192
- return {
2193
- element: switchElement,
2194
- update
2195
- };
2196
- }
2197
- appendMarketplaceServerRow(parent, server) {
2198
- const row = append(parent, $(".plugin-list-item.plugin-home-row.plugin-marketplace-home-row"));
2199
- const primaryAction = this.addSurfaceActivation(row, ( localize(7031, "{0}. Available to install from the MCP marketplace.", server.label)), () => this._onDidSelectServer.fire(createWorkbenchMcpServerDetailInput(server)));
2200
- const details = append(primaryAction, $(".plugin-list-item-details"));
2201
- const nameRow = append(details, $(".plugin-list-item-name-row"));
2202
- const name = append(nameRow, $(".plugin-list-item-name"));
2203
- name.textContent = server.label;
2204
- name.title = server.label;
2205
- const description = append(details, $(".plugin-list-item-description"));
2206
- description.textContent = truncateToFirstLine(server.description || ( localize(6998, "No description provided.")));
2207
- const actions = append(row, $(".plugin-list-item-action"));
2208
- const install = this.cardDisposables.add(( new Button(actions, {
2209
- ...defaultButtonStyles,
2210
- ariaLabel: ( localize(7049, "Install {0}", server.label))
2211
- })));
2212
- install.element.classList.add("plugin-list-item-install-button");
2213
- install.label = ( localize(6999, "Install"));
2214
- this.cardDisposables.add(install.onDidClick(() => this.installMarketplaceServer(server, install)));
2215
- this.cardListControllers.get(parent)?.addItem({
2216
- row,
2217
- primaryAction,
2218
- label: server.label,
2219
- actions: [install.element]
2220
- });
2221
- }
2222
- async installMarketplaceServer(server, button) {
2223
- button.label = ( localize(7050, "Installing..."));
2224
- button.enabled = false;
2225
- try {
2226
- await this.mcpWorkbenchService.install(server);
2227
- status(( localize(7051, "{0} installed.", server.label)));
2228
- await this.refresh();
2229
- } catch (error) {
2230
- button.label = ( localize(6999, "Install"));
2231
- button.enabled = true;
2232
- this.notificationService.error(( localize(7052, "Unable to install MCP server: {0}", getErrorMessage(error))));
2233
- }
2234
- }
2235
- getAvailableGalleryServers() {
2236
- const installedKeys = ( new Set());
2237
- for (const presentation of this.installedEntries) {
2238
- const entry = presentation.entry;
2239
- if (entry.type === "server-item") {
2240
- for (const key of getWorkbenchServerMatchKeys(entry.server)) {
2241
- installedKeys.add(key.toLowerCase());
2242
- }
2243
- } else if (entry.type === "builtin-item") {
2244
- installedKeys.add(entry.label.toLowerCase());
2245
- if (entry.localServer) {
2246
- for (const key of getRuntimeServerMatchKeys(entry.localServer)) {
2247
- installedKeys.add(key.toLowerCase());
2248
- }
2249
- }
2250
- } else {
2251
- installedKeys.add(entry.server.name.toLowerCase());
2252
- }
2253
- }
2254
- return this.galleryServers.filter(
2255
- server => server.installState === McpServerInstallState.Uninstalled && !( getWorkbenchServerMatchKeys(server).some(key => ( installedKeys.has(key.toLowerCase()))))
2256
- );
2257
- }
2258
- matchesGalleryServerQuery(server, query) {
2259
- return server.label.toLowerCase().includes(query) || server.description.toLowerCase().includes(query) || server.publisherDisplayName?.toLowerCase().includes(query) === true;
2260
- }
2261
- getInstalledEntryDescription(entry) {
2262
- const description = entry.type === "server-item" ? entry.server.description : entry.type === "builtin-item" ? entry.description : "";
2263
- return truncateToFirstLine(description || ( localize(6998, "No description provided.")));
2264
- }
2265
- isInstalledEntryEnabled(entry) {
2266
- const activeSessionServer = getActiveSessionServer(entry);
2267
- const localServer = entry.type === "session-server-item" ? undefined : entry.localServer;
2268
- const serverId = localServer?.definition.id ?? (entry.type === "server-item" ? entry.server.id : undefined);
2269
- return isPrimaryMcpServerEnabled(this.mcpService, serverId, activeSessionServer);
2270
- }
2271
- setInstalledEntryEnabled(entry, enabled) {
2272
- const activeSessionServer = getActiveSessionServer(entry);
2273
- const localServer = entry.type === "session-server-item" ? undefined : entry.localServer;
2274
- const serverId = localServer?.definition.id ?? (entry.type === "server-item" ? entry.server.id : undefined);
2275
- setPrimaryMcpServerEnablement(
2276
- this.mcpService,
2277
- this.agentHostCustomizationService,
2278
- this.customizationHarnessService.activeSessionResource.get(),
2279
- serverId,
2280
- activeSessionServer,
2281
- enabled
2282
- );
2283
- }
2284
- updateSearchResults() {
2285
- const available = this.getAvailableGalleryServers();
2286
- if (this.installedEntries.length === 0 && available.length === 0) {
2287
- this.showEmptySurface(this.gallerySearchLoading ? ( localize(7053, "Searching the MCP marketplace...")) : ( localize(7054, "No servers match '{0}'", this.searchQuery)), this.gallerySearchLoading ? "" : ( localize(7055, "Try a different search term")));
2288
- return;
2289
- }
2290
- this.captureSectionScrollPositions();
2291
- this.cardDisposables.clear();
2292
- this.sectionLists = [];
2293
- this.installedAddButton = undefined;
2294
- this.firstCardFocusElement = undefined;
2295
- this.availableSection = undefined;
2296
- clearNode(this.cardContainer);
2297
- this.showCardSurface();
2298
- const content = this.createCardScrollContent("plugin-search-results", "distributed-section-layout");
2299
- if (this.installedEntries.length > 0) {
2300
- const installedList = this.renderCardSection(content, ( localize(7056, "Installed")), undefined, "installed-mcp-servers-section", this.installedEntries.length);
2301
- installedList.classList.add("plugin-inventory-list");
2302
- this.createMcpSectionList(installedList, ( localize(7056, "Installed")), ( this.installedEntries.map(presentation => presentation.entry)));
2303
- }
2304
- if (available.length > 0) {
2305
- this.renderAvailableServers(content, available, false);
2306
- }
2307
- this.scheduleMcpSectionLayout();
2308
- }
2309
- filterServers(render = true) {
2310
- const query = this.searchQuery.toLowerCase().trim();
2311
- const activeSessionResource = this.customizationHarnessService.activeSessionResource.get();
2312
- const activeSessionMatcher = ( new ActiveSessionMcpServerMatcher(this.agentHostCustomizationService.getMcpServers(activeSessionResource)));
2313
- const localServerMatcher = ( new LocalMcpServerMatcher(this.mcpService.servers.get()));
2314
- if (query) {
2315
- this.filteredServers = this.mcpWorkbenchService.local.filter(
2316
- server => server.label.toLowerCase().includes(query) || (server.description?.toLowerCase().includes(query))
2317
- );
2318
- } else {
2319
- this.filteredServers = [...this.mcpWorkbenchService.local];
2320
- }
2321
- const localIds = ( new Set(( this.filteredServers.map(s => s.id))));
2322
- const hiddenCollectionIds = this.customizationHarnessService.getActiveDescriptor().hiddenMcpServerCollectionIds;
2323
- const builtinServers = this.mcpService.servers.get().filter(s => !( localIds.has(s.definition.id))).filter(s => isMcpServerCollectionVisible(s.collection.id, hiddenCollectionIds)).filter(s => !query || s.definition.label.toLowerCase().includes(query));
2324
- const groups = [{
2325
- entries: []
2326
- }, {
2327
- entries: []
2328
- }];
2329
- for (const server of this.filteredServers) {
2330
- const entry = {
2331
- type: "server-item",
2332
- server,
2333
- activeSessionServer: activeSessionMatcher.take(getWorkbenchServerMatchKeys(server)),
2334
- localServer: localServerMatcher.find(getWorkbenchServerMatchKeys(server))
2335
- };
2336
- const scope = server.local?.scope;
2337
- if (scope === LocalMcpServerScope.Workspace) {
2338
- groups[0].entries.push(entry);
2339
- } else {
2340
- groups[1].entries.push(entry);
2341
- }
2342
- }
2343
- const collectionSources = ( new Map(( this.mcpRegistry.collections.get().map(c => [c.id, c.source]))));
2344
- const pluginServers = [];
2345
- const extensionServers = [];
2346
- const otherBuiltinServers = [];
2347
- for (const server of builtinServers) {
2348
- const entry = {
2349
- server,
2350
- activeSessionServer: activeSessionMatcher.take(getRuntimeServerMatchKeys(server))
2351
- };
2352
- const source = collectionSources.get(server.collection.id);
2353
- if (server.collection.id.startsWith(PLUGIN_COLLECTION_PREFIX)) {
2354
- pluginServers.push(entry);
2355
- } else if (source instanceof ExtensionIdentifier && !isCopilotExtension(source)) {
2356
- extensionServers.push(entry);
2357
- } else {
2358
- otherBuiltinServers.push(entry);
2359
- }
2360
- }
2361
- const activeSessionOnlyServers = activeSessionMatcher.unmatched(query);
2362
- const activeSessionBuiltinEntries = createBuiltinActiveSessionMcpEntries(activeSessionOnlyServers);
2363
- this.installedEntries = [...groups.flatMap(group => ( group.entries.map(entry => ({
2364
- entry
2365
- })))), ...( pluginServers.map((
2366
- {
2367
- server,
2368
- activeSessionServer
2369
- }
2370
- ) => ({
2371
- entry: createBuiltinEntry(server, activeSessionServer)
2372
- }))), ...( extensionServers.map((
2373
- {
2374
- server,
2375
- activeSessionServer
2376
- }
2377
- ) => ({
2378
- entry: createBuiltinEntry(server, activeSessionServer)
2379
- }))), ...( otherBuiltinServers.map((
2380
- {
2381
- server,
2382
- activeSessionServer
2383
- }
2384
- ) => ({
2385
- entry: createBuiltinEntry(server, activeSessionServer)
2386
- }))), ...( activeSessionBuiltinEntries.map(entry => ({
2387
- entry
2388
- })))];
2389
- this.filteredBuiltinCount = builtinServers.length;
2390
- this.filteredActiveSessionCount = activeSessionOnlyServers.length;
2391
- this._onDidChangeItemCount.fire(this.itemCount);
2392
- if (render) {
2393
- this.renderFilteredServers();
2394
- }
2395
- }
2396
- renderFilteredServers() {
2397
- if (this.searchQuery.trim()) {
2398
- this.updateSearchResults();
2399
- } else {
2400
- this.renderMcpHome();
2401
- }
2402
- }
2403
- getInstalledEntryMembershipSignature() {
2404
- return ( this.installedEntries.map((
2405
- {
2406
- entry
2407
- }
2408
- ) => [
2409
- getMcpRowKey(entry),
2410
- getActiveSessionServer(entry) ? "session" : "",
2411
- entry.type !== "session-server-item" && entry.localServer ? "local" : ""
2412
- ].join(":"))).join("|");
2413
- }
2414
- get itemCount() {
2415
- return this.filteredServers.length + this.filteredBuiltinCount + this.filteredActiveSessionCount;
2416
- }
2417
- fireItemCount() {
2418
- this._onDidChangeItemCount.fire(this.itemCount);
2419
- }
2420
- isInBrowseMode() {
2421
- return false;
2422
- }
2423
- exitBrowseMode() {}
2424
- layout(height, width) {
2425
- this.lastHeight = height;
2426
- this.lastWidth = width;
2427
- if (!this.visible || this.element.parentElement?.style.display === "none") {
2428
- return;
2429
- }
2430
- this.element.style.height = `${height}px`;
2431
- this.updateResponsiveLayout(width);
2432
- const availableHeight = this.element.clientHeight || height;
2433
- const searchBarHeight = this.searchAndButtonContainer.offsetHeight;
2434
- if (searchBarHeight === 0 && !this._layoutDeferred) {
2435
- this._layoutDeferred = true;
2436
- getWindow(this.element).requestAnimationFrame(() => {
2437
- try {
2438
- this.layout(this.lastHeight, this.lastWidth);
2439
- } finally {
2440
- this._layoutDeferred = false;
2441
- }
2442
- });
2443
- return;
2444
- }
2445
- const headerHeight = this.sectionTitleHeader.offsetHeight;
2446
- this.lastHeaderHeight = headerHeight;
2447
- const listHeight = Math.max(0, availableHeight - searchBarHeight - headerHeight);
2448
- this.cardScrollableNode.style.height = `${listHeight}px`;
2449
- this.scheduleMcpSectionLayout();
2450
- }
2451
- focusSearch() {
2452
- this.searchInput.focus();
2453
- }
2454
- revealLastItem() {
2455
- const reveal = () => {
2456
- const section = this.sectionLists.at(-1);
2457
- if (section?.entries.length) {
2458
- section.list.reveal(section.entries.length - 1);
2459
- }
2460
- this.cardScrollable.scanDomNode();
2461
- this.cardScrollable.setScrollPosition({
2462
- scrollTop: this.cardContainer.scrollHeight
2463
- });
2464
- };
2465
- reveal();
2466
- this.revealLastItemScheduler.value = scheduleAtNextAnimationFrame(getWindow(this.element), reveal);
2467
- }
2468
- focus() {
2469
- if (this.cardScrollableNode.style.display !== "none") {
2470
- if (this.firstCardFocusElement) {
2471
- this.firstCardFocusElement.focus();
2472
- } else {
2473
- const section = this.sectionLists[0];
2474
- if (section?.entries.length) {
2475
- section.list.setFocus([0]);
2476
- section.list.domFocus();
2477
- }
2478
- }
2479
- }
2480
- }
2481
- updateResponsiveLayout(width) {
2482
- const narrow = width < 500;
2483
- const wide = width >= 600;
2484
- if (this.narrowLayout === narrow && this.wideLayout === wide) {
2485
- return;
2486
- }
2487
- this.narrowLayout = narrow;
2488
- this.wideLayout = wide;
2489
- this.element.classList.toggle("narrow-layout", narrow);
2490
- this.element.classList.toggle("wide-layout", wide);
2491
- if (this.installedAddButton) {
2492
- this.installedAddButton.label = narrow ? ( localize(7043, "Add")) : ( localize(7042, "Add Server"));
2493
- }
2494
- }
2495
- showMcpServerActions(entry, anchor) {
2496
- const disposables = ( new DisposableStore());
2497
- const actions = this.getMcpServerActions(entry, disposables);
2498
- if (actions.length === 0) {
2499
- disposables.dispose();
2500
- return;
2501
- }
2502
- this.contextMenuService.showContextMenu({
2503
- getAnchor: () => anchor,
2504
- getActions: () => actions,
2505
- onHide: () => disposables.dispose()
2506
- });
2507
- }
2508
- getMcpServerActions(entry, disposables) {
2509
- const sessionResource = this.customizationHarnessService.activeSessionResource.get();
2510
- const currentEntry = resolveMcpEntry(entry, this.agentHostCustomizationService, sessionResource);
2511
- if (!currentEntry) {
2512
- return [];
2513
- }
2514
- entry = currentEntry;
2515
- const activeSessionServer = getActiveSessionServer(entry);
2516
- const actions = this.getMcpServerManagementActions(entry, disposables);
2517
- if (!activeSessionServer && entry.type === "server-item") {
2518
- return actions;
2519
- }
2520
- const showOutput = activeSessionServer ? getMcpServerOutputHandler(
2521
- this.outputService,
2522
- undefined,
2523
- activeSessionServer,
2524
- undefined,
2525
- () => this.agentHostCustomizationService.showMcpServerLog(sessionResource, activeSessionServer.id)
2526
- ) : getMcpServerOutputHandler(
2527
- this.outputService,
2528
- entry.type === "session-server-item" ? undefined : entry.localServer,
2529
- undefined
2530
- );
2531
- const outputIndex = actions.findIndex(action => action instanceof ShowServerOutputAction);
2532
- if (outputIndex !== -1) {
2533
- actions.splice(outputIndex, 1);
2534
- }
2535
- if (showOutput) {
2536
- const outputAction = disposables.add(( new Action("mcpServer.showOutput", ( localize(7057, "Show Output")), undefined, true, showOutput)));
2537
- if (outputIndex !== -1) {
2538
- actions.splice(outputIndex, 0, outputAction);
2539
- } else {
2540
- if (actions.length > 0) {
2541
- actions.push(( new Separator()));
2542
- }
2543
- actions.push(outputAction);
2544
- }
2545
- }
2546
- return actions;
2547
- }
2548
- getMcpServerManagementActions(entry, disposables) {
2549
- if (entry.type === "session-server-item") {
2550
- const actions = getActiveSessionServerOptionsActions(
2551
- this.commandService,
2552
- this.agentHostCustomizationService,
2553
- this.agentPluginService,
2554
- this.customizationHarnessService.activeSessionResource.get(),
2555
- entry.server
2556
- );
2557
- actions.forEach(action => isDisposable(action) && disposables.add(action));
2558
- return actions;
2559
- }
2560
- if (entry.type === "builtin-item") {
2561
- const collectionId = entry.collectionId;
2562
- const pluginUriStr = getPluginUriFromCollectionId(collectionId);
2563
- const plugin = pluginUriStr ? this.agentPluginService.plugins.get().find(p => ( p.uri.toString()) === pluginUriStr) : undefined;
2564
- const actions = [];
2565
- const lifecycleAction = entry.activeSessionServer !== undefined ? getActiveSessionServerLifecycleAction(entry.activeSessionServer) : undefined;
2566
- if (lifecycleAction) {
2567
- actions.push(disposables.add(lifecycleAction));
2568
- }
2569
- if (entry.localServer) {
2570
- const isEmptyWorkbench = this.workspaceService.getActiveProjectRoot() === undefined;
2571
- const enablementActions = getBuiltinMcpServerEnablementActions(
2572
- this.mcpService,
2573
- entry.localServer.definition.id,
2574
- isEmptyWorkbench,
2575
- this.agentHostCustomizationService,
2576
- this.agentPluginService,
2577
- this.customizationHarnessService.activeSessionResource.get(),
2578
- entry.activeSessionServer
2579
- );
2580
- if (enablementActions.length > 0) {
2581
- if (actions.length > 0) {
2582
- actions.push(( new Separator()));
2583
- }
2584
- for (const enablementAction of enablementActions) {
2585
- if (isDisposable(enablementAction)) {
2586
- disposables.add(enablementAction);
2587
- }
2588
- actions.push(enablementAction);
2589
- }
2590
- }
2591
- }
2592
- if (plugin) {
2593
- if (actions.length > 0) {
2594
- actions.push(( new Separator()));
2595
- }
2596
- actions.push(disposables.add(( new Action("mcpServer.showPlugin", ( localize(7058, "Show Plugin")), undefined, true, async () => {
2597
- const item = {
2598
- kind: AgentPluginItemKind.Installed,
2599
- name: plugin.label,
2600
- description: plugin.fromMarketplace?.description ?? "",
2601
- marketplace: plugin.fromMarketplace?.marketplace,
2602
- plugin
2603
- };
2604
- this._onDidRequestShowPlugin.fire(item);
2605
- }))));
2606
- actions.push(disposables.add(( new Action("mcpServer.uninstallPlugin", ( localize(7059, "Uninstall Plugin")), undefined, true, async () => {
2607
- const result = await this.dialogService.confirm({
2608
- message: ( localize(7060, "This MCP server is provided by the plugin '{0}'", plugin.label)),
2609
- detail: ( localize(
2610
- 7061,
2611
- "Individual MCP servers from a plugin cannot be removed separately. Would you like to uninstall the entire plugin?"
2612
- )),
2613
- primaryButton: ( localize(7062, "Uninstall Plugin")),
2614
- type: "question"
2615
- });
2616
- if (result.confirmed) {
2617
- await plugin.remove?.();
2618
- }
2619
- }))));
2620
- }
2621
- return actions;
2622
- }
2623
- const mcpServer = this.mcpWorkbenchService.local.find(local => local.id === entry.server.id) || entry.server;
2624
- const groups = getContextMenuActions(mcpServer, false, this.instantiationService);
2625
- const activeSessionServer = entry.activeSessionServer;
2626
- const activeSessionLifecycleAction = activeSessionServer !== undefined ? getActiveSessionServerLifecycleAction(activeSessionServer) : undefined;
2627
- const agentHostEnablementActions = activeSessionServer !== undefined ? getAgentHostMcpServerEnablementActions(
2628
- this.agentHostCustomizationService,
2629
- this.agentPluginService,
2630
- this.customizationHarnessService.activeSessionResource.get(),
2631
- activeSessionServer,
2632
- ["workspace", "session"]
2633
- ) : [];
2634
- for (const menuActions of groups) {
2635
- for (const menuAction of menuActions) {
2636
- if (isDisposable(menuAction)) {
2637
- disposables.add(menuAction);
2638
- }
2639
- }
2640
- }
2641
- for (const action of [activeSessionLifecycleAction, ...agentHostEnablementActions]) {
2642
- if (action && isDisposable(action)) {
2643
- disposables.add(action);
2644
- }
2645
- }
2646
- return getServerItemContextMenuActions(
2647
- groups,
2648
- activeSessionServer,
2649
- activeSessionLifecycleAction,
2650
- agentHostEnablementActions
2651
- );
2652
- }
2653
- };
2654
- McpListWidget = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IMcpWorkbenchService)), ( __param(2, IMcpService)), ( __param(3, IMcpRegistry)), ( __param(4, ICommandService)), ( __param(5, IOpenerService)), ( __param(6, IContextViewService)), ( __param(7, IContextMenuService)), ( __param(8, IAgentPluginService)), ( __param(9, IDialogService)), ( __param(10, IConfigurationService)), ( __param(11, ICustomizationHarnessService)), ( __param(12, IAgentHostCustomizationService)), ( __param(13, IAICustomizationWorkspaceService)), ( __param(14, INotificationService)), ( __param(15, IOutputService)), ( __param(16, IMcpGalleryManifestService))], McpListWidget));
2655
-
2656
- export { MCP_ERROR_PREVIEW_LENGTH, McpListWidget, McpServerItemRenderer, authenticateMcpServer, createBuiltinActiveSessionMcpEntries, createInstalledMcpServerDetailInput, getActiveSessionServerLifecycleAction, getActiveSessionServerOptionsActions, getActiveSessionServerPresentation, getAgentHostMcpServerEnablementActions, getBuiltinMcpServerEnablementActions, getLocalMcpServerEnablementActions, getMcpErrorPreview, getMcpServerOutputHandler, getMcpStatusPresentation, getMcpStatusRenderSignature, getServerItemContextMenuActions, getToggledMcpEnablementState, hasSameMcpMembership, isMcpServerCollectionVisible, isPrimaryMcpServerEnabled, registerMcpInlineButtonAction, setPrimaryMcpServerEnablement, shouldLoadMcpGallerySnapshot, updateMcpCardRuntimePresentation };