@codingame/monaco-vscode-chat-service-override 36.2.7 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (725) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +92 -10
  3. package/package.json +5 -5
  4. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +10 -3
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +54 -17
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.d.ts +14 -0
  7. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +46 -0
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +7 -2
  9. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +34 -2
  10. package/vscode/src/vs/platform/agentHost/browser/{remoteAgentHostProtocolClient.d.ts → agentHostProtocolClient.d.ts} +240 -60
  11. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1911 -0
  12. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +30 -33
  13. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +381 -315
  14. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +3 -1
  15. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +9 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +20 -0
  18. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +144 -0
  19. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +20 -0
  20. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +14 -6
  21. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +14 -10
  22. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
  23. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +47 -0
  24. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +75 -0
  25. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +68 -0
  26. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +161 -0
  27. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +288 -45
  28. package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +261 -0
  29. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +67 -0
  30. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.d.ts +53 -0
  31. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.js +45 -0
  32. package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +130 -0
  33. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +27 -0
  34. package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +8 -2
  35. package/vscode/src/vs/platform/agentHost/common/customAgents.js +7 -0
  36. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.d.ts +39 -0
  37. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.js +25 -0
  38. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +110 -0
  39. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +38 -0
  40. package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +4 -0
  41. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.d.ts +7 -0
  42. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +14 -0
  43. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +3 -3
  44. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +16 -24
  45. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.d.ts +8 -0
  46. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.js +8 -0
  47. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +75 -0
  48. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +84 -0
  49. package/vscode/src/vs/platform/agentHost/common/shellInitScript.d.ts +24 -0
  50. package/vscode/src/vs/platform/agentHost/common/shellInitScript.js +63 -0
  51. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +71 -20
  52. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +187 -26
  53. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +30 -0
  54. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +87 -0
  55. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +2 -2
  56. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +4 -0
  57. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +37 -0
  58. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +4 -0
  59. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +45 -0
  60. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +5 -4
  61. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +100 -35
  62. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +193 -49
  63. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +161 -40
  64. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +1 -1
  65. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +5 -1
  66. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
  67. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +1 -0
  68. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +7 -0
  69. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
  70. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +114 -3
  71. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +28 -5
  72. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -2
  73. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +34 -0
  74. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.js +28 -0
  75. package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +24 -0
  76. package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +15 -0
  77. package/vscode/src/vs/platform/browserView/common/browserChatToolReferenceNames.d.ts +1 -1
  78. package/vscode/src/vs/platform/chat/common/aiAgentEnv.d.ts +18 -0
  79. package/vscode/src/vs/platform/chat/common/aiAgentEnv.js +6 -0
  80. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +5 -1
  81. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +77 -5
  82. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +1 -1
  83. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +9 -5
  84. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +1 -5
  85. package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -4
  86. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +19 -7
  87. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +49 -37
  88. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +2 -1
  89. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +12 -0
  90. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +1 -2
  91. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +1 -0
  92. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.d.ts +5 -0
  93. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.js +7 -0
  94. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.d.ts +5 -0
  95. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.js +8 -0
  96. package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.d.ts +1 -2
  97. package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +29 -0
  98. package/vscode/src/vs/workbench/browser/chatChangesPill.js +84 -0
  99. package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +19 -0
  100. package/vscode/src/vs/workbench/common/chatPullRequest.js +53 -0
  101. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +342 -155
  102. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  103. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +25 -2
  104. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +150 -67
  105. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +5 -3
  106. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +5 -1
  107. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +39 -9
  108. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
  109. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  110. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  111. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +4 -2
  112. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +54 -17
  113. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  114. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
  115. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  116. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
  117. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  118. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +6 -0
  119. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +5 -1
  120. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
  121. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
  122. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  123. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +252 -0
  124. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  125. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  126. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +146 -0
  127. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +889 -0
  128. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +2 -2
  129. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +2 -7
  130. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +3 -54
  131. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +32 -3
  132. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +214 -161
  133. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +10 -9
  134. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +2 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +256 -72
  136. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.d.ts +2 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +11 -12
  139. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +19 -15
  140. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +30 -14
  141. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +19 -10
  142. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +9 -9
  143. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  144. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.d.ts +6 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +237 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -6
  147. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  148. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +10 -10
  149. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.d.ts +6 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +68 -61
  151. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +17 -21
  152. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +17 -21
  153. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  154. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +68 -14
  156. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
  157. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -19
  158. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +7 -2
  159. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +222 -72
  160. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +64 -17
  161. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +530 -305
  162. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.d.ts +25 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +63 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +30 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +37 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.d.ts +6 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +95 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +10 -6
  169. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  170. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +2 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +18 -1
  172. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +86 -47
  173. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +61 -47
  174. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +43 -24
  175. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +326 -76
  176. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +112 -5
  177. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +33 -7
  178. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.d.ts +20 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.js +26 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +28 -10
  181. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +110 -126
  182. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +131 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +638 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.d.ts +41 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.js +202 -0
  186. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +24 -1
  187. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +26 -5
  188. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +10 -7
  189. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.d.ts +20 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +55 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +62 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +40 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +59 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +624 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +90 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +207 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +31 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +140 -0
  199. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +4 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +5 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +5 -4
  202. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +74 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +511 -171
  204. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.d.ts +32 -0
  205. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +48 -0
  206. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +55 -6
  207. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +210 -20
  208. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +43 -24
  209. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +46 -10
  210. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +216 -110
  211. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +9 -4
  212. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +26 -17
  213. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  215. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  216. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  217. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +30 -26
  218. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +5 -2
  219. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/unifiedQuickAccess.css +6 -6
  220. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  221. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  222. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +3 -0
  223. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +62 -0
  224. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +104 -0
  225. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +115 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +168 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +24 -0
  228. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +32 -0
  229. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +56 -0
  230. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -4
  231. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +16 -17
  232. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +7 -3
  233. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +1 -0
  234. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +2 -0
  235. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +10 -1
  236. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +48 -1
  237. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +913 -220
  238. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.d.ts +1 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +148 -84
  240. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +161 -17
  241. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +2367 -247
  242. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +5 -2
  243. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +21 -13
  244. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +26 -0
  245. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +34 -0
  246. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +2 -0
  247. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +23 -0
  248. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +15 -0
  249. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +3 -0
  250. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +10 -2
  251. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +143 -68
  252. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -0
  253. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +10 -5
  254. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +40 -0
  255. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +302 -0
  256. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +1 -2
  257. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +49 -8
  258. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +3 -3
  259. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +38 -0
  260. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +240 -0
  261. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.d.ts +1 -0
  262. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +53 -0
  263. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +82 -0
  264. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +762 -0
  265. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +80 -0
  266. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +279 -0
  267. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +44 -0
  268. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +437 -0
  269. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +85 -6
  270. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +697 -15
  271. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  272. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +40 -10
  273. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +164 -42
  274. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +6 -9
  275. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +260 -31
  276. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +2097 -589
  277. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +32 -0
  278. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +860 -0
  279. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2229 -1338
  280. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +79 -26
  281. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +354 -0
  282. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +85 -9
  283. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +1550 -357
  284. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +2 -4
  285. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +13 -27
  286. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +38 -26
  287. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +637 -319
  288. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +28 -10
  289. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.d.ts +10 -0
  290. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.js +22 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.d.ts +15 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +38 -0
  293. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.d.ts +8 -0
  294. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +38 -0
  295. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +4 -1
  296. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +1675 -633
  297. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +93 -6
  298. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +823 -52
  299. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.d.ts +132 -0
  300. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +446 -0
  301. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +183 -0
  302. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +218 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +45 -42
  304. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +11 -0
  305. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +163 -136
  306. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  307. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +7 -7
  308. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +22 -2
  309. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +105 -14
  310. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  311. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.d.ts +32 -0
  312. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +49 -0
  313. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  314. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  315. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  316. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  317. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +27 -22
  318. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +6 -0
  319. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +22 -23
  320. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  321. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -25
  322. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  323. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  324. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +7 -2
  325. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +76 -43
  326. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  327. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  328. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  329. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.d.ts +145 -0
  330. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +839 -0
  331. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +277 -3
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +6 -6
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +16 -16
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -4
  339. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  340. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +8 -4
  341. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  342. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -3
  343. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +35 -19
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +16 -9
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -3
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +4 -4
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +4 -0
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +7 -2
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +5 -5
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +3 -3
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +86 -0
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +282 -0
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +14 -10
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +5 -0
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +37 -25
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +7 -5
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +135 -82
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -3
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.d.ts +17 -0
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.js +28 -0
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +5 -5
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +7 -0
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +114 -0
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.d.ts +45 -0
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +326 -0
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.d.ts +33 -0
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +99 -0
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.d.ts +17 -0
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +46 -0
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.d.ts +27 -0
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +301 -0
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.d.ts +22 -0
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +103 -0
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +9 -36
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +103 -196
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +36 -30
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +2 -0
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +51 -12
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +31 -27
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +65 -20
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +291 -138
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/chatSetup.css +9 -0
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-dark.svg +1 -0
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-light.svg +1 -0
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.d.ts +9 -0
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.js +24 -0
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -1
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +59 -35
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +7 -2
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +221 -145
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +15 -29
  397. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +21 -3
  398. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.d.ts +22 -0
  399. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.js +27 -0
  400. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +9 -0
  401. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +23 -21
  402. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +6 -1
  403. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +62 -6
  404. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +15 -1
  405. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +97 -8
  406. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  407. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +6 -6
  408. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.d.ts +11 -2
  409. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +24 -16
  410. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  411. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  412. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +44 -0
  413. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +232 -0
  414. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.d.ts +36 -0
  415. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +127 -0
  416. package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.js +1 -1
  417. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.d.ts +18 -0
  418. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.js +55 -0
  419. package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +4 -3
  420. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  421. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatPetAchievements.css +236 -0
  422. package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.js +1 -1
  423. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.d.ts +9 -0
  424. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +260 -0
  425. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +39 -5
  426. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +155 -56
  427. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +10 -14
  428. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +29 -14
  429. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +2 -0
  430. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +76 -24
  431. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  432. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +53 -32
  433. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
  434. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +17 -17
  435. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +8 -7
  436. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
  437. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +29 -71
  438. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +3 -0
  439. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +36 -40
  440. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +3 -0
  441. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  442. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  443. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  444. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  445. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  446. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +9 -16
  447. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  448. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +5 -13
  449. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/media/promptTimeline.css +820 -0
  450. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.d.ts +38 -0
  451. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +100 -0
  452. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.d.ts +1 -0
  453. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +51 -0
  454. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.d.ts +30 -0
  455. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +113 -0
  456. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.d.ts +146 -0
  457. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +440 -0
  458. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.d.ts +16 -0
  459. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.js +5 -0
  460. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.d.ts +194 -0
  461. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +525 -0
  462. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRail.d.ts +33 -0
  463. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.d.ts +128 -0
  464. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +460 -0
  465. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.d.ts +38 -0
  466. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +120 -0
  467. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.d.ts +53 -0
  468. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +160 -0
  469. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +25 -22
  470. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +13 -0
  471. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +52 -0
  472. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +22 -0
  473. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +58 -0
  474. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +63 -0
  475. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +361 -0
  476. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.d.ts +35 -0
  477. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +90 -0
  478. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +25 -18
  479. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
  480. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +77 -41
  481. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +60 -43
  482. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +4 -1
  483. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +60 -16
  484. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +10 -8
  485. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +13 -4
  486. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -1
  487. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +44 -24
  488. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +4 -4
  489. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  490. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +52 -6
  491. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +446 -79
  492. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +11 -0
  493. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +13 -0
  494. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +66 -0
  495. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +297 -0
  496. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.d.ts +137 -0
  497. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +714 -0
  498. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentOpenChat.css +379 -0
  499. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.d.ts +10 -0
  500. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +78 -0
  501. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +36 -0
  502. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +172 -0
  503. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +5 -1
  504. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +8 -1
  505. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +15 -0
  506. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +30 -0
  507. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +11 -1
  508. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +41 -13
  509. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +5 -2
  510. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +133 -3
  511. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +3 -2
  512. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +11 -2
  513. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatEditorInputContentProvider.js +4 -4
  514. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.d.ts +1 -0
  515. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +96 -0
  516. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
  517. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +36 -1
  518. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +67 -17
  519. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +23 -37
  520. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.d.ts +18 -0
  521. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +72 -3
  522. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +11 -0
  523. package/vscode/src/vs/workbench/contrib/{agentsVoice/common/agentsVoiceColors.js → chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js} +17 -15
  524. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +3 -0
  525. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +16 -0
  526. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
  527. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +6 -4
  528. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +21 -13
  529. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +48 -8
  530. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +457 -142
  531. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +1 -1
  532. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +22 -14
  533. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +6 -22
  534. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +22 -0
  535. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +163 -0
  536. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +27 -5
  537. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +79 -32
  538. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +6 -0
  539. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +12 -0
  540. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +44 -11
  541. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +404 -51
  542. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +64 -4
  543. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +33 -2
  544. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.d.ts +68 -0
  545. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.js +70 -0
  546. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -2
  547. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +18 -5
  548. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +43 -14
  549. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +4 -0
  550. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +4 -9
  551. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +164 -71
  552. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
  553. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +1 -1
  554. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  555. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  556. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  557. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  558. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.d.ts +3 -1
  559. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +19 -10
  560. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +3 -1
  561. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +172 -159
  562. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +115 -0
  563. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +69 -0
  564. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +60 -0
  565. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +139 -0
  566. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  567. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +5 -0
  568. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +21 -1
  569. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +25 -2
  570. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +55 -18
  571. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  572. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  573. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  574. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +1 -0
  575. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  576. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  577. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.d.ts +59 -0
  578. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +323 -0
  579. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.d.ts +30 -0
  580. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.js +79 -0
  581. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +6 -2
  582. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +118 -13
  583. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  584. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  585. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  586. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  587. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  588. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +8 -8
  589. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +1 -0
  590. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +81 -0
  591. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +85 -0
  592. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  593. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  594. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +23 -23
  595. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  596. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +17 -3
  597. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +81 -7
  598. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.d.ts +30 -0
  599. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.js +86 -0
  600. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +10 -2
  601. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +97 -18
  602. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +2 -22
  603. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +10 -8
  604. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +2 -1
  605. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +2 -0
  606. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +42 -36
  607. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +8 -0
  608. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +10 -0
  609. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
  610. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
  611. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  612. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +25 -16
  613. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +4 -3
  614. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.d.ts +70 -0
  615. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +4316 -0
  616. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  617. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  618. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  619. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  620. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +4 -4
  621. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  622. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  623. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +6 -1
  624. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +188 -148
  625. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  626. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  627. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  628. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  629. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  630. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +7 -0
  631. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -3
  632. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +5 -6
  633. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -42
  634. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.d.ts +2 -0
  635. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.js +8 -0
  636. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -0
  637. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +27 -8
  638. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +205 -0
  639. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +1580 -0
  640. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.d.ts +30 -0
  641. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +175 -0
  642. package/vscode/src/vs/workbench/services/agentEditorComments/browser/media/agentEditorCommentsOverlayWidget.css +65 -0
  643. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.d.ts +47 -0
  644. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.js +129 -0
  645. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +26 -8
  646. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +89 -27
  647. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.d.ts +8 -0
  648. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.js +28 -0
  649. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +5 -1
  650. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +18 -18
  651. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +159 -60
  652. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.d.ts +47 -0
  653. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +362 -0
  654. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +0 -1
  655. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +0 -40
  656. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +0 -1110
  657. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +0 -76
  658. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.d.ts +0 -63
  659. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.js +0 -25
  660. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +0 -254
  661. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +0 -451
  662. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +0 -1294
  663. package/vscode/src/vs/platform/agentHost/common/agentService.js +0 -92
  664. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.d.ts +0 -186
  665. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.js +0 -10
  666. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +0 -42
  667. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +0 -7
  668. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +0 -15
  669. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +0 -15
  670. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +0 -2
  671. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +0 -19
  672. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +0 -243
  673. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.d.ts +0 -24
  674. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +0 -77
  675. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +0 -92
  676. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +0 -224
  677. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +0 -23
  678. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +0 -52
  679. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.d.ts +0 -16
  680. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +0 -96
  681. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +0 -27
  682. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +0 -152
  683. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +0 -87
  684. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +0 -772
  685. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +0 -30
  686. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +0 -29
  687. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.d.ts +0 -20
  688. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +0 -40
  689. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +0 -160
  690. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +0 -9
  691. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +0 -123
  692. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +0 -37
  693. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +0 -572
  694. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +0 -125
  695. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +0 -399
  696. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +0 -321
  697. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +0 -2117
  698. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +0 -57
  699. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +0 -367
  700. package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +0 -78
  701. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +0 -13
  702. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +0 -11
  703. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +0 -6
  704. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +0 -16
  705. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +0 -6
  706. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +0 -46
  707. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +0 -36
  708. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +0 -6
  709. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +0 -12
  710. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +0 -6
  711. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +0 -9
  712. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +0 -6
  713. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -15
  714. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -177
  715. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  716. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  717. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -65
  718. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -264
  719. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -190
  720. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -865
  721. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  722. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  723. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  724. /package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.js +0 -0
  725. /package/vscode/src/vs/{platform/agentHost/common/agentHost.config.contribution.d.ts → workbench/contrib/chat/browser/agentSessionsConfiguration.d.ts} +0 -0
@@ -2,61 +2,82 @@
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
4
  import * as aiCustomizationManagement from './media/aiCustomizationManagement.css';
5
- import { $ as $$1, append, createTextNode, addDisposableListener, getWindow, DisposableResizeObserver, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
- import { DisposableStore, Disposable, MutableDisposable, isDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
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
7
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
8
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
9
9
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
- import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
11
10
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
12
11
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
13
12
  import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
14
- import { defaultInputBoxStyles, defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
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
15
  import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
16
16
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
17
17
  import { mcpAccessConfig, McpAccessValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement';
18
- import { McpConnectionState, McpServerInstallState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
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';
19
20
  import { IMcpWorkbenchService, IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
20
21
  import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
21
- import { MCP_PLUGIN_COLLECTION_ID_PREFIX } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery';
22
+ import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/discovery/pluginMcpDiscovery';
22
23
  import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
23
- import { isContributionDisabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
24
+ import { ContributionEnablementState, isContributionDisabled, isContributionEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
24
25
  import { McpCommandIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpCommandIds';
25
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';
26
28
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
27
29
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
28
- import { InputBox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/inputbox/inputBox';
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';
29
32
  import { IContextViewService, IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
30
33
  import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
31
34
  import { Delayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
32
35
  import { Action, Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
33
- import { getContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpServerActions';
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';
34
37
  import { LocalMcpServerScope } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/mcp/common/mcpWorkbenchManagementService';
35
38
  import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
36
39
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
37
- import { mcpServerIcon, workspaceIcon, userIcon, pluginIcon, extensionIcon, builtinIcon } from './aiCustomizationIcons.js';
40
+ import { mcpServerIcon } from './aiCustomizationIcons.js';
38
41
  import { formatDisplayName } from './aiCustomizationListWidget.js';
39
42
  import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
40
43
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
41
44
  import { IAICustomizationWorkspaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service';
42
- import { CUSTOMIZATION_GROUP_HEADER_HEIGHT, CUSTOMIZATION_GROUP_HEADER_HEIGHT_WITH_SEPARATOR, CustomizationGroupHeaderRenderer } from './customizationGroupHeaderRenderer.js';
43
45
  import { AgentPluginItemKind } from '../agentPluginEditor/agentPluginItems.js';
46
+ import { getCustomizationDisabledLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService';
44
47
  import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
45
48
  import { IAgentHostCustomizationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service';
46
49
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
47
- import { McpServerStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
50
+ import { McpServerStatus, CustomizationEnablementKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
48
51
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
49
52
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
50
53
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
51
54
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
52
- import { GalleryItemInstallState, GalleryItemRenderer } from './galleryItemRenderer.js';
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';
53
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';
54
73
  import { truncateToFirstLine } from './aiCustomizationListWidgetUtils.js';
74
+ import { observableSignal } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignal';
55
75
 
56
76
  registerCss(aiCustomizationManagement);
57
77
  const $ = $$1;
58
- const MCP_ITEM_HEIGHT = 36;
59
78
  const PLUGIN_COLLECTION_PREFIX = MCP_PLUGIN_COLLECTION_ID_PREFIX;
79
+ const MCP_SECTION_ITEM_HEIGHT = 66;
80
+ const MCP_ERROR_PREVIEW_LENGTH = 300;
60
81
  const COPILOT_EXTENSION_IDS = ["github.copilot", "github.copilot-chat"];
61
82
  function isCopilotExtension(id) {
62
83
  return ( COPILOT_EXTENSION_IDS.some(copilotId => ExtensionIdentifier.equals(id, copilotId)));
@@ -64,57 +85,181 @@ function isCopilotExtension(id) {
64
85
  function getPluginUriFromCollectionId(collectionId) {
65
86
  return collectionId?.startsWith(PLUGIN_COLLECTION_PREFIX) ? collectionId.slice(PLUGIN_COLLECTION_PREFIX.length) : undefined;
66
87
  }
67
- class McpServerItemDelegate {
68
- getHeight(element) {
69
- if (element.type === "group-header") {
70
- return element.isFirst ? CUSTOMIZATION_GROUP_HEADER_HEIGHT : CUSTOMIZATION_GROUP_HEADER_HEIGHT_WITH_SEPARATOR;
71
- }
72
- if (element.type === "server-item" && element.server.gallery && (element.marketplace || !element.server.local)) {
73
- return 62;
74
- }
75
- return MCP_ITEM_HEIGHT;
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;
76
100
  }
77
101
  getTemplateId(element) {
78
- if (element.type === "group-header") {
79
- return "mcpGroupHeader";
80
- }
81
- if (element.type === "builtin-item") {
82
- return "mcpServerItem";
83
- }
84
- if (element.type === "session-server-item") {
85
- return "mcpServerItem";
86
- }
87
- const server = element.server;
88
- return server.gallery && (element.marketplace || !server.local) ? MCP_GALLERY_ITEM_TEMPLATE_ID : "mcpServerItem";
102
+ return element.type === "marketplace-item" ? "mcpMarketplaceItem" : "mcpServerItem";
103
+ }
104
+ hasDynamicHeight(element) {
105
+ return element.type !== "marketplace-item";
89
106
  }
90
107
  }
91
- let McpServerItemRenderer = class McpServerItemRenderer {
92
- constructor(workspaceService, agentPluginService, hoverService) {
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;
93
131
  this.workspaceService = workspaceService;
94
132
  this.agentPluginService = agentPluginService;
95
133
  this.hoverService = hoverService;
134
+ this.agentHostCustomizationService = agentHostCustomizationService;
135
+ this.customizationHarnessService = customizationHarnessService;
96
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
+ ));
97
172
  }
98
173
  renderTemplate(container) {
174
+ const templateDisposables = ( new DisposableStore());
99
175
  container.classList.add("mcp-server-item");
176
+ container.style.minHeight = `${MCP_SECTION_ITEM_HEIGHT}px`;
100
177
  const typeIcon = append(container, $(".mcp-server-icon"));
101
178
  typeIcon.classList.add(...ThemeIcon.asClassNameArray(mcpServerIcon));
102
179
  const details = append(container, $(".mcp-server-details"));
103
180
  const nameRow = append(details, $(".mcp-server-name-row"));
104
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");
105
184
  const description = append(details, $(".mcp-server-description"));
106
- const status = append(container, $(".mcp-server-status"));
107
- return {
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 = {
108
202
  container,
109
203
  typeIcon,
110
204
  name,
205
+ statusBadge,
111
206
  description,
112
- status,
113
- disposables: ( new DisposableStore())
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
114
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;
115
243
  }
116
244
  renderElement(element, index, templateData) {
117
- templateData.disposables.clear();
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();
118
263
  if (element.type === "builtin-item") {
119
264
  templateData.container.classList.add("builtin");
120
265
  templateData.container.classList.toggle("has-detail", false);
@@ -123,16 +268,17 @@ let McpServerItemRenderer = class McpServerItemRenderer {
123
268
  templateData.description.textContent = truncateToFirstLine(element.description);
124
269
  templateData.description.style.display = "";
125
270
  } else {
271
+ templateData.description.textContent = "";
126
272
  templateData.description.style.display = "none";
127
273
  }
128
- this.updateKnownServerStatus(templateData, element.localServer, element.activeSessionServer);
274
+ this.updateKnownServerStatus(templateData, element);
129
275
  const pluginUriStr = getPluginUriFromCollectionId(element.collectionId);
130
276
  if (pluginUriStr) {
131
- templateData.disposables.add(this.hoverService.setupDelayedHover(templateData.container, () => {
277
+ templateData.elementDisposables.add(this.hoverService.setupDelayedHover(templateData.container, () => {
132
278
  const plugin = this.agentPluginService.plugins.get().find(p => ( p.uri.toString()) === pluginUriStr);
133
279
  if (plugin) {
134
280
  return {
135
- content: `${element.label}\n${( localize(6023, "Plugin: {0}", plugin.label))}`,
281
+ content: `${element.label}\n${( localize(6862, "Plugin: {0}", plugin.label))}`,
136
282
  appearance: {
137
283
  compact: true,
138
284
  skipFadeInAnimation: true
@@ -154,8 +300,9 @@ let McpServerItemRenderer = class McpServerItemRenderer {
154
300
  templateData.container.classList.remove("builtin");
155
301
  templateData.container.classList.toggle("has-detail", false);
156
302
  templateData.name.textContent = formatDisplayName(element.server.name);
303
+ templateData.description.textContent = "";
157
304
  templateData.description.style.display = "none";
158
- this.updateActiveSessionStatus(templateData, element.server);
305
+ this.updateActiveSessionStatus(templateData, element);
159
306
  return;
160
307
  }
161
308
  templateData.container.classList.remove("builtin");
@@ -168,127 +315,532 @@ let McpServerItemRenderer = class McpServerItemRenderer {
168
315
  templateData.description.textContent = truncateToFirstLine(description);
169
316
  templateData.description.style.display = "";
170
317
  } else {
318
+ templateData.description.textContent = "";
171
319
  templateData.description.style.display = "none";
172
320
  }
173
- if (element.activeSessionServer) {
174
- this.updateKnownServerStatus(templateData, element.localServer, element.activeSessionServer);
321
+ if (element.activeSessionServer !== undefined) {
322
+ this.updateKnownServerStatus(templateData, element);
175
323
  } else if (this.workspaceService.isSessionsWindow) {
176
- this.updateKnownServerStatus(templateData, element.localServer, undefined);
324
+ this.updateKnownServerStatus(templateData, element);
177
325
  } else {
178
- templateData.disposables.add(autorun(reader => {
326
+ templateData.elementDisposables.add(autorun(reader => {
179
327
  const disabled = element.localServer ? isContributionDisabled(element.localServer.enablement.read(reader)) : false;
180
328
  const connectionState = element.localServer?.connectionState.read(reader);
181
329
  templateData.container.classList.toggle("disabled", disabled);
182
- this.updateStatus(templateData.status, disabled ? "disabled" : connectionState?.state);
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
+ );
183
338
  }));
184
339
  }
185
340
  }
186
- updateKnownServerStatus(templateData, localServer, activeSessionServer) {
187
- templateData.disposables.add(autorun(reader => {
188
- const localDisabled = localServer ? isContributionDisabled(localServer.enablement.read(reader)) : false;
189
- templateData.container.classList.toggle("disabled", localDisabled || activeSessionServer?.enabled === false);
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;
190
366
  this.updateStatus(
191
- templateData.status,
192
- localDisabled ? "disabled" : activeSessionServer ? (activeSessionServer.enabled ? activeSessionServer.status : "disabled") : undefined
367
+ templateData,
368
+ element,
369
+ currentEntry,
370
+ localDisabled ? "disabled" : localError?.state,
371
+ undefined,
372
+ localError?.message
193
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();
194
380
  }));
381
+ templateData.elementDisposables.add(this.agentHostCustomizationService.onDidChangeCustomizations(update));
195
382
  }
196
- updateActiveSessionStatus(templateData, server) {
197
- const disabled = server?.enabled === false;
198
- templateData.container.classList.toggle("disabled", disabled);
199
- this.updateStatus(templateData.status, disabled ? "disabled" : server?.status);
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));
200
407
  }
201
- updateStatus(statusElement, state) {
202
- statusElement.className = "mcp-server-status";
203
- const presentation = getMcpStatusPresentation(state);
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);
204
449
  if (!presentation) {
205
- statusElement.style.display = "none";
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) {
206
546
  return;
207
547
  }
208
- statusElement.style.display = "";
209
- statusElement.textContent = presentation.label;
210
- statusElement.classList.add(presentation.className);
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(6863, "Show Less")) : ( localize(6864, "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;
211
573
  }
212
574
  disposeTemplate(templateData) {
213
- templateData.disposables.dispose();
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();
214
583
  }
215
584
  };
216
- McpServerItemRenderer = ( __decorate([( __param(0, IAICustomizationWorkspaceService)), ( __param(1, IAgentPluginService)), ( __param(2, IHoverService))], McpServerItemRenderer));
217
- function getMcpStatusPresentation(state) {
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(6865, "No description provided.")));
626
+ templateData.installButton.label = ( localize(6866, "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(6867, "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(6868, "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) {
218
700
  if (state === undefined) {
219
701
  return undefined;
220
702
  }
221
703
  if (state === "disabled") {
222
704
  return {
223
- label: ( localize(6024, "Disabled")),
224
- className: "disabled"
705
+ label: getCustomizationDisabledLabel(disabledReason),
706
+ className: "disabled",
707
+ icon: Codicon.circleSlash
225
708
  };
226
709
  }
227
710
  switch (state) {
228
711
  case McpConnectionState.Kind.Running:
229
712
  case McpServerStatus.Ready:
230
713
  return {
231
- label: ( localize(6025, "Running")),
232
- className: "running"
714
+ label: ( localize(6869, "Running")),
715
+ className: "running",
716
+ icon: Codicon.check
233
717
  };
234
718
  case McpConnectionState.Kind.Starting:
235
719
  case McpServerStatus.Starting:
236
720
  return {
237
- label: ( localize(6026, "Starting")),
238
- className: "starting"
721
+ label: ( localize(6870, "Starting")),
722
+ className: "starting",
723
+ icon: ThemeIcon.modify(Codicon.loading, "spin")
239
724
  };
240
725
  case McpServerStatus.AuthRequired:
241
726
  return {
242
- label: ( localize(6027, "Authentication required")),
243
- className: "auth-required"
727
+ label: ( localize(6871, "Authentication required")),
728
+ className: "auth-required",
729
+ icon: Codicon.account
244
730
  };
245
731
  case McpConnectionState.Kind.Error:
246
732
  case McpServerStatus.Error:
247
733
  return {
248
- label: ( localize(6028, "Error")),
249
- className: "error"
734
+ label: ( localize(6872, "Error")),
735
+ className: "error",
736
+ icon: Codicon.error
250
737
  };
251
738
  case McpConnectionState.Kind.Stopped:
252
739
  case McpServerStatus.Stopped:
253
740
  default:
254
741
  return {
255
- label: ( localize(6029, "Stopped")),
742
+ label: ( localize(6873, "Stopped")),
256
743
  className: "stopped"
257
744
  };
258
745
  }
259
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(6874, "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
+ }
260
811
  function getMcpStatusKind(entry, isSessionsWindow) {
261
812
  if (entry.type === "session-server-item") {
262
- return entry.server.enabled ? entry.server.status : "disabled";
813
+ return getActiveSessionServerPresentation(entry.server).status;
814
+ }
815
+ if (entry.activeSessionServer !== undefined) {
816
+ return getActiveSessionServerPresentation(entry.activeSessionServer).status;
263
817
  }
264
818
  if (entry.localServer && isContributionDisabled(entry.localServer.enablement.get())) {
265
819
  return "disabled";
266
820
  }
267
- if (entry.activeSessionServer) {
268
- return entry.activeSessionServer.enabled ? entry.activeSessionServer.status : "disabled";
269
- }
270
821
  if (entry.type === "server-item" && !isSessionsWindow) {
271
822
  return entry.localServer?.connectionState.get().state;
272
823
  }
273
824
  return undefined;
274
825
  }
275
826
  function getMcpEntryAriaLabel(element, isSessionsWindow) {
276
- if (element.type === "group-header") {
277
- return localize(
278
- 6030,
279
- "{0}, {1} items, {2}",
280
- element.label,
281
- element.count,
282
- element.collapsed ? ( localize(6031, "collapsed")) : ( localize(6032, "expanded"))
283
- );
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(6875, "{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;
284
839
  }
285
- const label = element.type === "session-server-item" ? element.server.name : element.type === "builtin-item" ? element.label : element.server.label;
286
- const status = getMcpStatusPresentation(getMcpStatusKind(element, isSessionsWindow));
287
- return status ? ( localize(6033, "{0}, {1}", label, status.label)) : label;
840
+ return undefined;
288
841
  }
289
842
  function normalizeMcpMatchKey(value) {
290
- const key = value?.trim().toLowerCase();
291
- return key || undefined;
843
+ return value || undefined;
292
844
  }
293
845
  function getUniqueMcpMatchKeys(values) {
294
846
  const keys = ( new Set());
@@ -306,7 +858,9 @@ class ActiveSessionMcpServerMatcher {
306
858
  this.byKey = ( new Map());
307
859
  this.matchedIds = ( new Set());
308
860
  for (const server of servers) {
309
- for (const key of getUniqueMcpMatchKeys([server.id, server.name])) {
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])) {
310
864
  let bucket = this.byKey.get(key);
311
865
  if (!bucket) {
312
866
  bucket = [];
@@ -318,11 +872,10 @@ class ActiveSessionMcpServerMatcher {
318
872
  }
319
873
  take(keys) {
320
874
  for (const key of getUniqueMcpMatchKeys(keys)) {
321
- const matches = this.byKey.get(key);
322
- const match = matches?.find(server => !( this.matchedIds.has(server.id)));
323
- if (match) {
324
- this.matchedIds.add(match.id);
325
- return match;
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];
326
879
  }
327
880
  }
328
881
  return undefined;
@@ -336,15 +889,20 @@ class LocalMcpServerMatcher {
336
889
  this.byKey = ( new Map());
337
890
  for (const server of servers) {
338
891
  for (const key of getRuntimeServerMatchKeys(server)) {
339
- this.byKey.set(key, server);
892
+ let matches = this.byKey.get(key);
893
+ if (!matches) {
894
+ matches = [];
895
+ this.byKey.set(key, matches);
896
+ }
897
+ matches.push(server);
340
898
  }
341
899
  }
342
900
  }
343
901
  find(keys) {
344
902
  for (const key of getUniqueMcpMatchKeys(keys)) {
345
- const server = this.byKey.get(key);
346
- if (server) {
347
- return server;
903
+ const matches = this.byKey.get(key);
904
+ if (matches?.length === 1) {
905
+ return matches[0];
348
906
  }
349
907
  }
350
908
  return undefined;
@@ -362,17 +920,299 @@ function getWorkbenchServerMatchKeys(server) {
362
920
  function getRuntimeServerMatchKeys(server) {
363
921
  return getUniqueMcpMatchKeys([server.definition.id, server.definition.label]);
364
922
  }
365
- function getActiveSessionServerOptionsAction(commandService, sessionResource, server) {
366
- return (new Action(
367
- "mcpServer.activeSession.options",
368
- localize(6034, "Server Options"),
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(6876, "Start Server")), undefined, true, () => server.start())) : ( new Action("mcpServer.activeSession.stop", ( localize(6877, "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(6878, "Enable")),
967
+ disableLabel: () => ( localize(6879, "Disable"))
968
+ },
969
+ workspace: {
970
+ kind: CustomizationEnablementKind.Workspace,
971
+ enableLabel: () => ( localize(6880, "Enable (Workspace)")),
972
+ disableLabel: () => ( localize(6881, "Disable (Workspace)"))
973
+ },
974
+ session: {
975
+ kind: CustomizationEnablementKind.Session,
976
+ enableLabel: () => ( localize(6882, "Enable (Session)")),
977
+ disableLabel: () => ( localize(6883, "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(),
369
1087
  undefined,
370
1088
  true,
371
- async () => {
372
- await commandService.executeCommand(McpCommandIds.AgentHostServerOptions, sessionResource, server.id);
373
- }
1089
+ () => agentHostCustomizations.setCustomizationEnablement(sessionResource, server.id, server.enablement, actionInfo.kind, enabled)
374
1090
  ));
375
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(6884, "Enable")), undefined, true, () => {
1098
+ mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.EnabledProfile);
1099
+ })));
1100
+ if (includeWorkspace && !isEmptyWorkbench) {
1101
+ actions.push(( new Action("mcpServer.builtin.enableWorkspace", ( localize(6885, "Enable (Workspace)")), undefined, true, () => {
1102
+ mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.EnabledWorkspace);
1103
+ })));
1104
+ }
1105
+ } else {
1106
+ actions.push(( new Action("mcpServer.builtin.disable", ( localize(6886, "Disable")), undefined, true, () => {
1107
+ mcpService.enablementModel.setEnabled(serverId, ContributionEnablementState.DisabledProfile);
1108
+ })));
1109
+ if (includeWorkspace && !isEmptyWorkbench) {
1110
+ actions.push(( new Action("mcpServer.builtin.disableWorkspace", ( localize(6887, "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(6888, "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
+ }
376
1216
  function createBuiltinEntry(server, activeSessionServer) {
377
1217
  return {
378
1218
  type: "builtin-item",
@@ -384,43 +1224,57 @@ function createBuiltinEntry(server, activeSessionServer) {
384
1224
  localServer: server
385
1225
  };
386
1226
  }
387
- const MCP_GALLERY_ITEM_TEMPLATE_ID = "mcpGalleryItem";
388
- class McpGalleryItemProvider {
389
- constructor(mcpWorkbenchService) {
390
- this.mcpWorkbenchService = mcpWorkbenchService;
391
- }
392
- getLabel(element) {
393
- return element.server.label;
394
- }
395
- getPublisherDisplayName(element) {
396
- return element.server.publisherDisplayName;
397
- }
398
- getDescription(element) {
399
- return element.server.description;
400
- }
401
- getInstallState(element) {
402
- switch (element.server.installState) {
403
- case McpServerInstallState.Installed:
404
- return GalleryItemInstallState.Installed;
405
- case McpServerInstallState.Installing:
406
- return GalleryItemInstallState.Installing;
407
- default:
408
- return GalleryItemInstallState.Uninstalled;
409
- }
410
- }
411
- canInstall(element) {
412
- return this.mcpWorkbenchService.canInstall(element.server) === true;
1227
+ function createInstalledMcpServerDetailInput(entry) {
1228
+ if (entry.type === "server-item") {
1229
+ return createWorkbenchMcpServerDetailInput(entry.server);
413
1230
  }
414
- async install(element) {
415
- await this.mcpWorkbenchService.install(element.server);
416
- }
417
- onDidChangeInstallState(element, listener) {
418
- return this.mcpWorkbenchService.onChange(changed => {
419
- if (!changed || changed.id === element.server.id) {
420
- listener();
421
- }
422
- });
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
+ };
423
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
+ };
424
1278
  }
425
1279
  let McpListWidget = class McpListWidget extends Disposable {
426
1280
  constructor(
@@ -432,13 +1286,15 @@ let McpListWidget = class McpListWidget extends Disposable {
432
1286
  openerService,
433
1287
  contextViewService,
434
1288
  contextMenuService,
435
- hoverService,
436
1289
  agentPluginService,
437
1290
  dialogService,
438
1291
  configurationService,
439
1292
  customizationHarnessService,
440
1293
  agentHostCustomizationService,
441
- workspaceService
1294
+ workspaceService,
1295
+ notificationService,
1296
+ outputService,
1297
+ mcpGalleryManifestService
442
1298
  ) {
443
1299
  super();
444
1300
  this.instantiationService = instantiationService;
@@ -449,13 +1305,14 @@ let McpListWidget = class McpListWidget extends Disposable {
449
1305
  this.openerService = openerService;
450
1306
  this.contextViewService = contextViewService;
451
1307
  this.contextMenuService = contextMenuService;
452
- this.hoverService = hoverService;
453
1308
  this.agentPluginService = agentPluginService;
454
1309
  this.dialogService = dialogService;
455
1310
  this.configurationService = configurationService;
456
1311
  this.customizationHarnessService = customizationHarnessService;
457
1312
  this.agentHostCustomizationService = agentHostCustomizationService;
458
1313
  this.workspaceService = workspaceService;
1314
+ this.notificationService = notificationService;
1315
+ this.outputService = outputService;
459
1316
  this._onDidSelectServer = this._register(( new Emitter()));
460
1317
  this.onDidSelectServer = this._onDidSelectServer.event;
461
1318
  this._onDidChangeItemCount = this._register(( new Emitter()));
@@ -466,20 +1323,55 @@ let McpListWidget = class McpListWidget extends Disposable {
466
1323
  this.filteredServers = [];
467
1324
  this.filteredBuiltinCount = 0;
468
1325
  this.filteredActiveSessionCount = 0;
469
- this.displayEntries = [];
1326
+ this.installedEntries = [];
1327
+ this.gallerySnapshotServers = [];
470
1328
  this.galleryServers = [];
471
1329
  this.searchQuery = "";
472
- this.browseMode = false;
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;
473
1337
  this.lastHeight = 0;
474
1338
  this.lastWidth = 0;
475
1339
  this.lastHeaderHeight = 0;
476
1340
  this._layoutDeferred = false;
477
- this.collapsedGroups = ( new Set());
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());
478
1348
  this.delayedFilter = ( new Delayer(200));
479
1349
  this.delayedGallerySearch = ( new Delayer(400));
480
- this.element = $(".mcp-list-widget");
1350
+ this.agentHostCustomizationsChanged = observableSignalFromEvent(this, this.agentHostCustomizationService.onDidChangeCustomizations);
1351
+ this.element = $(".mcp-list-widget.plugin-list-widget");
481
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));
482
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();
483
1375
  this._register(this.configurationService.onDidChangeConfiguration(e => {
484
1376
  if (e.affectsConfiguration(mcpAccessConfig)) {
485
1377
  this.updateAccessState();
@@ -487,7 +1379,9 @@ let McpListWidget = class McpListWidget extends Disposable {
487
1379
  }));
488
1380
  this._register({
489
1381
  dispose: () => {
490
- this.galleryCts?.dispose();
1382
+ this.delayedFilter.cancel();
1383
+ this.delayedGallerySearch.cancel();
1384
+ this.galleryCts?.dispose(true);
491
1385
  }
492
1386
  });
493
1387
  }
@@ -495,16 +1389,16 @@ let McpListWidget = class McpListWidget extends Disposable {
495
1389
  this.sectionTitleHeader = append(this.element, $(".section-title-header"));
496
1390
  const titleRow = append(this.sectionTitleHeader, $(".section-title-row"));
497
1391
  const sectionTitle = append(titleRow, $("h2.section-title"));
498
- sectionTitle.textContent = ( localize(6035, "MCP Servers"));
1392
+ sectionTitle.textContent = ( localize(6889, "MCP Servers"));
499
1393
  const sectionTitleDescription = append(this.sectionTitleHeader, $("p.section-title-description"));
500
1394
  const sectionTitleDescriptionText = append(sectionTitleDescription, $("span.section-title-description-text"));
501
1395
  sectionTitleDescriptionText.textContent = ( localize(
502
- 6036,
1396
+ 6890,
503
1397
  "An open standard that lets AI use external tools and services. MCP servers provide tools for file operations, databases, APIs, and more."
504
1398
  ));
505
1399
  sectionTitleDescription.appendChild(createTextNode(" "));
506
1400
  this.sectionLink = append(sectionTitleDescription, $("a.section-title-link"));
507
- this.sectionLink.textContent = ( localize(6037, "Learn more about MCP servers"));
1401
+ this.sectionLink.textContent = ( localize(6891, "Learn more about MCP servers"));
508
1402
  this.sectionLink.href = "https://code.visualstudio.com/docs/agent-customization/mcp-servers?referrer=in-product";
509
1403
  this._register(addDisposableListener(this.sectionLink, "click", e => {
510
1404
  e.preventDefault();
@@ -530,150 +1424,106 @@ let McpListWidget = class McpListWidget extends Disposable {
530
1424
  this.searchAndButtonContainer = append(this.element, $(".list-search-and-button-container"));
531
1425
  const searchContainer = append(this.searchAndButtonContainer, $(".list-search-container"));
532
1426
  this.searchInput = this._register(( new InputBox(searchContainer, this.contextViewService, {
533
- placeholder: ( localize(6038, "Type to search...")),
1427
+ placeholder: ( localize(6892, "Type to search...")),
534
1428
  inputBoxStyles: defaultInputBoxStyles
535
1429
  })));
536
1430
  this._register(this.searchInput.onDidChange(() => {
537
1431
  this.searchQuery = this.searchInput.value;
538
- if (this.browseMode) {
539
- this.delayedGallerySearch.trigger(() => this.queryGallery());
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());
540
1446
  } else {
541
- this.delayedFilter.trigger(() => this.filterServers());
1447
+ this.gallerySearchLoading = false;
1448
+ this.delayedGallerySearch.cancel();
1449
+ if (this.visible && this.gallerySnapshotServers.length === 0) {
1450
+ this.delayedGallerySearch.trigger(() => this.queryGallerySnapshot());
1451
+ }
542
1452
  }
543
1453
  }));
544
- const buttonContainer = append(this.searchAndButtonContainer, $(".list-button-group"));
545
- const backButtonContainer = append(buttonContainer, $(".list-add-button-container"));
546
- this.backButton = this._register(( new Button(backButtonContainer, {
547
- ...defaultButtonStyles,
548
- secondary: true,
549
- supportIcons: true,
550
- title: ( localize(6039, "Back to installed servers")),
551
- ariaLabel: ( localize(6039, "Back to installed servers"))
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(6893, "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
552
1469
  })));
553
- this.backButton.label = `$(${Codicon.arrowLeft.id}) ${( localize(6040, "Back"))}`;
554
- this.backButton.element.classList.add("list-add-button");
555
- backButtonContainer.style.display = "none";
556
- this._register(this.backButton.onDidClick(() => {
557
- this.toggleBrowseMode(false);
558
- }));
559
- const browseButtonContainer = append(buttonContainer, $(".list-add-button-container"));
560
- this.browseButton = this._register(( new Button(browseButtonContainer, {
561
- ...defaultButtonStyles,
562
- secondary: true,
563
- supportIcons: true
564
- })));
565
- this.browseButton.label = `$(${Codicon.library.id}) ${( localize(6041, "Browse Marketplace"))}`;
566
- this.browseButton.element.classList.add("list-add-button");
567
- this._register(this.browseButton.onDidClick(() => {
568
- this.toggleBrowseMode(!this.browseMode);
569
- }));
570
- this.addButton = this._register(( new Button(buttonContainer, {
571
- ...defaultButtonStyles,
572
- secondary: true,
573
- supportIcons: true,
574
- title: ( localize(6042, "Add Server")),
575
- ariaLabel: ( localize(6042, "Add Server"))
576
- })));
577
- this.addButton.label = `$(${Codicon.add.id})`;
578
- this.addButton.element.classList.add("list-icon-button");
579
1470
  this._register(
580
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), this.addButton.element, ( localize(6043, "Add Server")))
1471
+ addDisposableListener(this.cardContainer, EventType.SCROLL, () => {
1472
+ this.cardScrollable.setScrollPosition({
1473
+ scrollTop: this.cardContainer.scrollTop
1474
+ });
1475
+ })
581
1476
  );
582
- this._register(this.addButton.onDidClick(() => {
583
- this.commandService.executeCommand(McpCommandIds.AddConfiguration);
584
- }));
585
- this.emptyContainer = append(this.element, $(".mcp-empty-state"));
586
- const emptyHeader = append(this.emptyContainer, $(".empty-state-header"));
587
- this.emptyText = append(emptyHeader, $(".empty-text"));
588
- this.emptySubtext = append(this.emptyContainer, $(".empty-subtext"));
589
- this.disabledContainer = append(this.element, $(".mcp-disabled-state"));
590
- const disabledHeader = append(this.disabledContainer, $(".empty-state-header"));
591
- this.disabledIcon = append(disabledHeader, $(".empty-icon"));
592
- const disabledText = append(disabledHeader, $(".empty-text"));
593
- disabledText.textContent = ( localize(6044, "MCP servers are disabled"));
594
- this.disabledMessage = append(this.disabledContainer, $(".empty-subtext"));
595
- this.listContainer = append(this.element, $(".mcp-list-container"));
596
- const delegate = ( new McpServerItemDelegate());
597
- const groupHeaderRenderer = ( new CustomizationGroupHeaderRenderer("mcpGroupHeader", this.hoverService));
598
- const localRenderer = this.instantiationService.createInstance(McpServerItemRenderer);
599
- const galleryRenderer = ( new GalleryItemRenderer(MCP_GALLERY_ITEM_TEMPLATE_ID, ( new McpGalleryItemProvider(this.mcpWorkbenchService))));
600
- this.list = this._register(this.instantiationService.createInstance(
601
- WorkbenchList,
602
- "McpManagementList",
603
- this.listContainer,
604
- delegate,
605
- [groupHeaderRenderer, localRenderer, galleryRenderer],
606
- {
607
- multipleSelectionSupport: false,
608
- setRowLineHeight: false,
609
- horizontalScrolling: false,
610
- accessibilityProvider: {
611
- getAriaLabel: element => {
612
- return getMcpEntryAriaLabel(element, this.workspaceService.isSessionsWindow);
613
- },
614
- getWidgetAriaLabel() {
615
- return localize(6045, "MCP Servers");
616
- }
617
- },
618
- openOnSingleClick: true,
619
- identityProvider: {
620
- getId(element) {
621
- if (element.type === "group-header") {
622
- return element.id;
623
- }
624
- if (element.type === "builtin-item") {
625
- return element.id;
626
- }
627
- return element.server.id;
628
- }
629
- }
630
- }
631
- ));
632
- this._register(this.list.onDidOpen(e => {
633
- if (e.element) {
634
- if (e.element.type === "group-header") {
635
- this.toggleGroup(e.element);
636
- } else if (e.element.type === "server-item") {
637
- const server = e.element.server;
638
- const isGallery = e.element.marketplace || !server.local;
639
- if (isGallery || server.description) {
640
- this._onDidSelectServer.fire(server);
641
- }
642
- } else if (e.element.type === "session-server-item") {
643
- this.openActiveSessionServerOptions(e.element.server);
644
- }
645
- }
646
- }));
647
- this._register(this.list.onContextMenu(e => this.onContextMenu(e)));
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));
648
1485
  this._register(this.mcpWorkbenchService.onChange(() => {
649
- if (!this.browseMode) {
650
- this.refresh();
651
- }
1486
+ this.refresh();
652
1487
  }));
653
1488
  this._register(autorun(reader => {
654
- this.mcpService.servers.read(reader);
655
- if (!this.browseMode) {
656
- this.refresh();
1489
+ const servers = this.mcpService.servers.read(reader);
1490
+ for (const server of servers) {
1491
+ server.enablement.read(reader);
657
1492
  }
1493
+ this.refresh();
658
1494
  }));
659
1495
  this._register(autorun(reader => {
660
1496
  this.customizationHarnessService.activeSessionResource.read(reader);
661
- if (!this.browseMode) {
662
- this.refresh();
663
- }
1497
+ this.refresh();
664
1498
  }));
665
1499
  this._register(this.agentHostCustomizationService.onDidChangeCustomizations(() => {
666
- if (!this.browseMode) {
667
- this.refresh();
1500
+ const previousMembership = this.getInstalledEntryMembershipSignature();
1501
+ this.filterServers(false);
1502
+ if (!hasSameMcpMembership(previousMembership, this.getInstalledEntryMembershipSignature())) {
1503
+ this.renderFilteredServers();
668
1504
  }
669
1505
  }));
670
- void this.refresh();
671
1506
  }
672
1507
  async refresh() {
673
- if (this.browseMode) {
674
- await this.queryGallery();
675
- } else {
676
- this.filterServers();
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();
677
1527
  }
678
1528
  }
679
1529
  updateAccessState() {
@@ -681,8 +1531,16 @@ let McpListWidget = class McpListWidget extends Disposable {
681
1531
  const value = inspect.value ?? inspect.defaultValue;
682
1532
  const disabled = value === McpAccessValue.None;
683
1533
  const policyLocked = inspect.policyValue === McpAccessValue.None;
1534
+ const accessChanged = this.mcpAccessEnabled === disabled;
1535
+ this.mcpAccessEnabled = !disabled;
684
1536
  this.element.classList.toggle("access-disabled", disabled);
685
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();
686
1544
  this.disabledIcon.className = "empty-icon";
687
1545
  this.disabledIcon.classList.add(
688
1546
  ...ThemeIcon.asClassNameArray(policyLocked ? Codicon.shield : mcpServerIcon)
@@ -691,13 +1549,13 @@ let McpListWidget = class McpListWidget extends Disposable {
691
1549
  this.disabledLinkListener.clear();
692
1550
  if (policyLocked) {
693
1551
  this.disabledMessage.textContent = ( localize(
694
- 6046,
1552
+ 6894,
695
1553
  "Access to MCP servers is disabled by your organization. Contact your organization administrator for more information."
696
1554
  ));
697
1555
  } else {
698
- this.disabledMessage.appendChild(createTextNode(( localize(6047, "MCP servers are disabled in settings. "))));
1556
+ this.disabledMessage.appendChild(createTextNode(( localize(6895, "MCP servers are disabled in settings. "))));
699
1557
  const link = append(this.disabledMessage, $("a.mcp-disabled-settings-link"));
700
- link.textContent = ( localize(6048, "Configure in settings."));
1558
+ link.textContent = ( localize(6896, "Configure in settings."));
701
1559
  link.href = "#";
702
1560
  link.setAttribute("role", "button");
703
1561
  this.disabledLinkListener.value = addDisposableListener(link, "click", e => {
@@ -705,81 +1563,750 @@ let McpListWidget = class McpListWidget extends Disposable {
705
1563
  this.commandService.executeCommand("workbench.action.openSettings", `@id:${mcpAccessConfig}`);
706
1564
  });
707
1565
  }
1566
+ } else if (accessChanged && this.visible) {
1567
+ if (this.searchQuery.trim()) {
1568
+ void this.queryMcpSearch();
1569
+ } else {
1570
+ void this.refresh();
1571
+ }
708
1572
  }
709
1573
  }
710
1574
  showBrowseMarketplace() {
711
- if (!this.browseMode) {
712
- this.toggleBrowseMode(true);
1575
+ if (!this.mcpAccessEnabled) {
1576
+ return;
713
1577
  }
714
- }
715
- toggleBrowseMode(browse) {
716
- this.browseMode = browse;
717
1578
  this.searchInput.value = "";
718
1579
  this.searchQuery = "";
719
- this.addButton.element.style.display = browse ? "none" : "";
720
- this.browseButton.element.parentElement.style.display = browse ? "none" : "";
721
- this.backButton.element.parentElement.style.display = browse ? "" : "none";
722
- this.searchInput.setPlaceHolder(browse ? ( localize(6049, "Search MCP marketplace...")) : ( localize(6038, "Type to search...")));
723
- if (browse) {
724
- void this.queryGallery();
725
- } else {
726
- this.galleryCts?.dispose(true);
727
- this.galleryServers = [];
728
- this.filterServers();
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();
729
1591
  }
730
- if (this.lastHeight > 0) {
731
- this.layout(this.lastHeight, this.lastWidth);
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
+ }
732
1619
  }
733
1620
  }
734
- async queryGallery() {
1621
+ async queryMcpSearch() {
1622
+ const query = this.searchQuery.trim();
1623
+ if (!query || !this.mcpAccessEnabled) {
1624
+ return;
1625
+ }
735
1626
  this.galleryCts?.dispose(true);
736
1627
  const cts = this.galleryCts = ( new CancellationTokenSource());
737
- this.emptyContainer.style.display = "flex";
738
- this.listContainer.style.display = "none";
739
- this.emptyText.textContent = ( localize(6050, "Loading marketplace..."));
740
- this.emptySubtext.textContent = "";
1628
+ this.gallerySearchLoading = true;
741
1629
  try {
742
1630
  const pager = await this.mcpWorkbenchService.queryGallery({
743
- text: this.searchQuery.trim() || undefined
1631
+ text: query
744
1632
  }, cts.token);
745
- if (cts.token.isCancellationRequested) {
1633
+ if (this.galleryCts !== cts || cts.token.isCancellationRequested || !this.mcpAccessEnabled || this.searchQuery.trim() !== query) {
746
1634
  return;
747
1635
  }
748
1636
  this.galleryServers = pager.firstPage.items;
749
- this.updateGalleryList();
1637
+ this.searchInput.hideMessage();
750
1638
  } catch {
751
- if (!cts.token.isCancellationRequested) {
752
- this.galleryServers = [];
753
- this.emptyContainer.style.display = "flex";
754
- this.listContainer.style.display = "none";
755
- this.emptyText.textContent = ( localize(6051, "Unable to load marketplace"));
756
- this.emptySubtext.textContent = ( localize(6052, "Check your connection and try again"));
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
+ 6897,
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();
757
1653
  }
758
1654
  }
759
1655
  }
760
- updateGalleryList() {
761
- if (this.galleryServers.length === 0) {
762
- this.emptyContainer.style.display = "flex";
763
- this.listContainer.style.display = "none";
764
- if (this.searchQuery.trim()) {
765
- this.emptyText.textContent = ( localize(6053, "No servers match '{0}'", this.searchQuery));
766
- this.emptySubtext.textContent = ( localize(6054, "Try a different search term"));
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);
767
1705
  } else {
768
- this.emptyText.textContent = ( localize(6055, "No MCP servers available"));
769
- this.emptySubtext.textContent = "";
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
+ 6898,
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();
770
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
+ 6899,
1883
+ "{0}, {1}, {2}. Use Show More to read the full error.",
1884
+ label,
1885
+ status.label,
1886
+ text
1887
+ )) : ( localize(6900, "{0}, {1}, {2}", label, status.label, text));
1888
+ }
1889
+ return status ? ( localize(6875, "{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(6901, "Disable {0}", label)) : ( localize(6902, "Enable {0}", label));
1909
+ const accessibleLabel = blockedByPlugin ? ( localize(6903, "{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(6904, "{0} enabled.", label)) : ( localize(6905, "{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(6906, "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(6907, "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(6908, "No MCP servers are installed."));
771
2014
  } else {
772
- this.emptyContainer.style.display = "none";
773
- this.listContainer.style.display = "";
2015
+ this.createMcpSectionList(installedList, ( localize(6907, "Installed")), ( this.installedEntries.map(presentation => presentation.entry)));
774
2016
  }
775
- const entries = ( this.galleryServers.map(server => ({
776
- type: "server-item",
777
- server,
778
- marketplace: true
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(6909, "Add Server"));
2023
+ const add = this.installedAddButton = this.cardDisposables.add(( new Button(actions, {
2024
+ ...defaultButtonStyles,
2025
+ secondary: true,
2026
+ ariaLabel: addLabel
779
2027
  })));
780
- this.list.splice(0, this.list.length, entries);
2028
+ add.element.classList.add("plugin-installed-action");
2029
+ add.label = this.narrowLayout ? ( localize(6910, "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(6911, "Available")), showDescription ? ( localize(6912, "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(6913, "Loading marketplace MCP servers...")), MCP_SECTION_ITEM_HEIGHT);
2042
+ } else {
2043
+ const empty = append(availableList, $(".plugin-inventory-empty"));
2044
+ empty.textContent = ( localize(6914, "No marketplace MCP servers are available."));
2045
+ }
2046
+ this.cardListControllers.get(availableList)?.finalize();
2047
+ return;
2048
+ }
2049
+ this.createMcpSectionList(availableList, ( localize(6911, "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(6906, "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(6915, "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(6901, "Disable {0}", label)) : ( localize(6902, "Enable {0}", label));
2175
+ const accessibleLabel = blockedByPlugin ? ( localize(6903, "{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(6904, "{0} enabled.", label)) : ( localize(6905, "{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(6898, "{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(6865, "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(6916, "Install {0}", server.label))
2211
+ })));
2212
+ install.element.classList.add("plugin-list-item-install-button");
2213
+ install.label = ( localize(6866, "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
+ });
781
2221
  }
782
- filterServers() {
2222
+ async installMarketplaceServer(server, button) {
2223
+ button.label = ( localize(6917, "Installing..."));
2224
+ button.enabled = false;
2225
+ try {
2226
+ await this.mcpWorkbenchService.install(server);
2227
+ status(( localize(6918, "{0} installed.", server.label)));
2228
+ await this.refresh();
2229
+ } catch (error) {
2230
+ button.label = ( localize(6866, "Install"));
2231
+ button.enabled = true;
2232
+ this.notificationService.error(( localize(6919, "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(6865, "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(6920, "Searching the MCP marketplace...")) : ( localize(6921, "No servers match '{0}'", this.searchQuery)), this.gallerySearchLoading ? "" : ( localize(6922, "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(6923, "Installed")), undefined, "installed-mcp-servers-section", this.installedEntries.length);
2301
+ installedList.classList.add("plugin-inventory-list");
2302
+ this.createMcpSectionList(installedList, ( localize(6923, "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) {
783
2310
  const query = this.searchQuery.toLowerCase().trim();
784
2311
  const activeSessionResource = this.customizationHarnessService.activeSessionResource.get();
785
2312
  const activeSessionMatcher = ( new ActiveSessionMcpServerMatcher(this.agentHostCustomizationService.getMcpServers(activeSessionResource)));
@@ -792,72 +2319,26 @@ let McpListWidget = class McpListWidget extends Disposable {
792
2319
  this.filteredServers = [...this.mcpWorkbenchService.local];
793
2320
  }
794
2321
  const localIds = ( new Set(( this.filteredServers.map(s => s.id))));
795
- const builtinServers = this.mcpService.servers.get().filter(s => !( localIds.has(s.definition.id))).filter(s => !query || s.definition.label.toLowerCase().includes(query));
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));
796
2324
  const groups = [{
797
- scope: LocalMcpServerScope.Workspace,
798
- label: ( localize(6056, "Workspace")),
799
- icon: workspaceIcon,
800
- description: ( localize(
801
- 6057,
802
- "MCP servers configured in your workspace settings, shared with your team via version control."
803
- )),
804
- servers: []
2325
+ entries: []
805
2326
  }, {
806
- scope: LocalMcpServerScope.User,
807
- label: ( localize(6058, "User")),
808
- icon: userIcon,
809
- description: ( localize(
810
- 6059,
811
- "MCP servers configured in your user settings. Private to you and available across all projects."
812
- )),
813
- servers: []
2327
+ entries: []
814
2328
  }];
815
2329
  for (const server of this.filteredServers) {
816
2330
  const entry = {
2331
+ type: "server-item",
817
2332
  server,
818
2333
  activeSessionServer: activeSessionMatcher.take(getWorkbenchServerMatchKeys(server)),
819
2334
  localServer: localServerMatcher.find(getWorkbenchServerMatchKeys(server))
820
2335
  };
821
2336
  const scope = server.local?.scope;
822
2337
  if (scope === LocalMcpServerScope.Workspace) {
823
- groups[0].servers.push(entry);
2338
+ groups[0].entries.push(entry);
824
2339
  } else {
825
- groups[1].servers.push(entry);
826
- }
827
- }
828
- const entries = [];
829
- let isFirst = true;
830
- for (const group of groups) {
831
- if (group.servers.length === 0) {
832
- continue;
833
- }
834
- const collapsed = ( this.collapsedGroups.has(group.scope));
835
- entries.push({
836
- type: "group-header",
837
- id: `mcp-group-${group.scope}`,
838
- scope: group.scope,
839
- label: group.label,
840
- icon: group.icon,
841
- count: group.servers.length,
842
- isFirst,
843
- description: group.description,
844
- collapsed
845
- });
846
- if (!collapsed) {
847
- for (const {
848
- server,
849
- activeSessionServer,
850
- localServer
851
- } of group.servers) {
852
- entries.push({
853
- type: "server-item",
854
- server,
855
- activeSessionServer,
856
- localServer
857
- });
858
- }
2340
+ groups[1].entries.push(entry);
859
2341
  }
860
- isFirst = false;
861
2342
  }
862
2343
  const collectionSources = ( new Map(( this.mcpRegistry.collections.get().map(c => [c.id, c.source]))));
863
2344
  const pluginServers = [];
@@ -878,117 +2359,57 @@ let McpListWidget = class McpListWidget extends Disposable {
878
2359
  }
879
2360
  }
880
2361
  const activeSessionOnlyServers = activeSessionMatcher.unmatched(query);
881
- if (this.filteredServers.length === 0 && builtinServers.length === 0 && activeSessionOnlyServers.length === 0) {
882
- this.emptyContainer.style.display = "flex";
883
- this.listContainer.style.display = "none";
884
- if (this.searchQuery.trim()) {
885
- this.emptyText.textContent = ( localize(6060, "No servers match '{0}'", this.searchQuery));
886
- this.emptySubtext.textContent = ( localize(6054, "Try a different search term"));
887
- } else {
888
- this.emptyText.textContent = ( localize(6061, "No MCP servers configured"));
889
- this.emptySubtext.textContent = ( localize(6062, "Add an MCP server configuration to get started"));
890
- }
891
- } else {
892
- this.emptyContainer.style.display = "none";
893
- this.listContainer.style.display = "";
894
- }
895
- if (activeSessionOnlyServers.length > 0) {
896
- const collapsed = ( this.collapsedGroups.has("active-session"));
897
- entries.push({
898
- type: "group-header",
899
- id: "mcp-group-active-session",
900
- scope: "active-session",
901
- label: ( localize(6063, "Active Session")),
902
- icon: mcpServerIcon,
903
- count: activeSessionOnlyServers.length,
904
- isFirst,
905
- description: ( localize(6064, "MCP servers reported by the active session.")),
906
- collapsed
907
- });
908
- if (!collapsed) {
909
- for (const server of activeSessionOnlyServers) {
910
- entries.push({
911
- type: "session-server-item",
912
- server
913
- });
914
- }
915
- }
916
- isFirst = false;
917
- }
918
- if (pluginServers.length > 0) {
919
- const collapsed = ( this.collapsedGroups.has("plugin"));
920
- entries.push({
921
- type: "group-header",
922
- id: "mcp-group-plugin",
923
- scope: "plugin",
924
- label: ( localize(6065, "Plugins")),
925
- icon: pluginIcon,
926
- count: pluginServers.length,
927
- isFirst,
928
- description: ( localize(6066, "MCP servers provided by installed plugins.")),
929
- collapsed
930
- });
931
- if (!collapsed) {
932
- for (const {
933
- server,
934
- activeSessionServer
935
- } of pluginServers) {
936
- entries.push(createBuiltinEntry(server, activeSessionServer));
937
- }
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
938
2369
  }
939
- isFirst = false;
940
- }
941
- if (extensionServers.length > 0) {
942
- const collapsed = ( this.collapsedGroups.has("extension"));
943
- entries.push({
944
- type: "group-header",
945
- id: "mcp-group-extension",
946
- scope: "extension",
947
- label: ( localize(6067, "Extensions")),
948
- icon: extensionIcon,
949
- count: extensionServers.length,
950
- isFirst,
951
- description: ( localize(6068, "MCP servers contributed by installed VS Code extensions.")),
952
- collapsed
953
- });
954
- if (!collapsed) {
955
- for (const {
956
- server,
957
- activeSessionServer
958
- } of extensionServers) {
959
- entries.push(createBuiltinEntry(server, activeSessionServer));
960
- }
2370
+ ) => ({
2371
+ entry: createBuiltinEntry(server, activeSessionServer)
2372
+ }))), ...( extensionServers.map((
2373
+ {
2374
+ server,
2375
+ activeSessionServer
961
2376
  }
962
- isFirst = false;
963
- }
964
- if (otherBuiltinServers.length > 0) {
965
- const collapsed = ( this.collapsedGroups.has("builtin"));
966
- entries.push({
967
- type: "group-header",
968
- id: "mcp-group-builtin",
969
- scope: "builtin",
970
- label: ( localize(6069, "Built-in")),
971
- icon: builtinIcon,
972
- count: otherBuiltinServers.length,
973
- isFirst,
974
- description: ( localize(6070, "MCP servers built into VS Code. These are available automatically.")),
975
- collapsed
976
- });
977
- if (!collapsed) {
978
- for (const {
979
- server,
980
- activeSessionServer
981
- } of otherBuiltinServers) {
982
- entries.push(createBuiltinEntry(server, activeSessionServer));
983
- }
2377
+ ) => ({
2378
+ entry: createBuiltinEntry(server, activeSessionServer)
2379
+ }))), ...( otherBuiltinServers.map((
2380
+ {
2381
+ server,
2382
+ activeSessionServer
984
2383
  }
985
- isFirst = false;
986
- }
987
- this.displayEntries = entries;
988
- this.list.splice(0, this.list.length, this.displayEntries);
2384
+ ) => ({
2385
+ entry: createBuiltinEntry(server, activeSessionServer)
2386
+ }))), ...( activeSessionBuiltinEntries.map(entry => ({
2387
+ entry
2388
+ })))];
989
2389
  this.filteredBuiltinCount = builtinServers.length;
990
2390
  this.filteredActiveSessionCount = activeSessionOnlyServers.length;
991
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("|");
992
2413
  }
993
2414
  get itemCount() {
994
2415
  return this.filteredServers.length + this.filteredBuiltinCount + this.filteredActiveSessionCount;
@@ -996,26 +2417,19 @@ let McpListWidget = class McpListWidget extends Disposable {
996
2417
  fireItemCount() {
997
2418
  this._onDidChangeItemCount.fire(this.itemCount);
998
2419
  }
999
- toggleGroup(entry) {
1000
- if (( this.collapsedGroups.has(entry.scope))) {
1001
- this.collapsedGroups.delete(entry.scope);
1002
- } else {
1003
- this.collapsedGroups.add(entry.scope);
1004
- }
1005
- this.filterServers();
1006
- }
1007
2420
  isInBrowseMode() {
1008
- return this.browseMode;
1009
- }
1010
- exitBrowseMode() {
1011
- if (this.browseMode) {
1012
- this.toggleBrowseMode(false);
1013
- }
2421
+ return false;
1014
2422
  }
2423
+ exitBrowseMode() {}
1015
2424
  layout(height, width) {
1016
2425
  this.lastHeight = height;
1017
2426
  this.lastWidth = width;
2427
+ if (!this.visible || this.element.parentElement?.style.display === "none") {
2428
+ return;
2429
+ }
1018
2430
  this.element.style.height = `${height}px`;
2431
+ this.updateResponsiveLayout(width);
2432
+ const availableHeight = this.element.clientHeight || height;
1019
2433
  const searchBarHeight = this.searchAndButtonContainer.offsetHeight;
1020
2434
  if (searchBarHeight === 0 && !this._layoutDeferred) {
1021
2435
  this._layoutDeferred = true;
@@ -1030,119 +2444,213 @@ let McpListWidget = class McpListWidget extends Disposable {
1030
2444
  }
1031
2445
  const headerHeight = this.sectionTitleHeader.offsetHeight;
1032
2446
  this.lastHeaderHeight = headerHeight;
1033
- const listHeight = Math.max(0, height - searchBarHeight - headerHeight);
1034
- this.listContainer.style.height = `${listHeight}px`;
1035
- this.list.layout(listHeight, width);
2447
+ const listHeight = Math.max(0, availableHeight - searchBarHeight - headerHeight);
2448
+ this.cardScrollableNode.style.height = `${listHeight}px`;
2449
+ this.scheduleMcpSectionLayout();
1036
2450
  }
1037
2451
  focusSearch() {
1038
2452
  this.searchInput.focus();
1039
2453
  }
1040
2454
  revealLastItem() {
1041
- if (this.list.length > 0) {
1042
- this.list.reveal(this.list.length - 1);
1043
- }
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);
1044
2467
  }
1045
2468
  focus() {
1046
- this.list.domFocus();
1047
- const servers = this.list.length;
1048
- if (servers > 0) {
1049
- this.list.setFocus([0]);
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
+ }
1050
2479
  }
1051
2480
  }
1052
- openActiveSessionServerOptions(server) {
1053
- void this.commandService.executeCommand(
1054
- McpCommandIds.AgentHostServerOptions,
1055
- this.customizationHarnessService.activeSessionResource.get(),
1056
- server.id
1057
- );
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(6910, "Add")) : ( localize(6909, "Add Server"));
2493
+ }
1058
2494
  }
1059
- onContextMenu(e) {
1060
- if (!e.element) {
2495
+ showMcpServerActions(entry, anchor) {
2496
+ const disposables = ( new DisposableStore());
2497
+ const actions = this.getMcpServerActions(entry, disposables);
2498
+ if (actions.length === 0) {
2499
+ disposables.dispose();
1061
2500
  return;
1062
2501
  }
1063
- if (e.element.type === "session-server-item") {
1064
- const disposables = ( new DisposableStore());
1065
- const optionsAction = disposables.add(getActiveSessionServerOptionsAction(
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(6924, "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(
1066
2551
  this.commandService,
2552
+ this.agentHostCustomizationService,
2553
+ this.agentPluginService,
1067
2554
  this.customizationHarnessService.activeSessionResource.get(),
1068
- e.element.server
1069
- ));
1070
- this.contextMenuService.showContextMenu({
1071
- getAnchor: () => e.anchor,
1072
- getActions: () => [optionsAction],
1073
- onHide: () => disposables.dispose()
1074
- });
1075
- return;
2555
+ entry.server
2556
+ );
2557
+ actions.forEach(action => isDisposable(action) && disposables.add(action));
2558
+ return actions;
1076
2559
  }
1077
- if (e.element.type === "builtin-item") {
1078
- const collectionId = e.element.collectionId;
2560
+ if (entry.type === "builtin-item") {
2561
+ const collectionId = entry.collectionId;
1079
2562
  const pluginUriStr = getPluginUriFromCollectionId(collectionId);
1080
- if (!pluginUriStr) {
1081
- return;
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));
1082
2568
  }
1083
- const plugin = this.agentPluginService.plugins.get().find(p => ( p.uri.toString()) === pluginUriStr);
1084
- if (!plugin) {
1085
- return;
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
+ }
1086
2591
  }
1087
- const disposables = ( new DisposableStore());
1088
- const showPluginAction = disposables.add(( new Action("mcpServer.showPlugin", ( localize(6071, "Show Plugin")), undefined, true, async () => {
1089
- const item = {
1090
- kind: AgentPluginItemKind.Installed,
1091
- name: plugin.label,
1092
- description: plugin.fromMarketplace?.description ?? "",
1093
- marketplace: plugin.fromMarketplace?.marketplace,
1094
- plugin
1095
- };
1096
- this._onDidRequestShowPlugin.fire(item);
1097
- })));
1098
- const uninstallAction = disposables.add(( new Action("mcpServer.uninstallPlugin", ( localize(6072, "Uninstall Plugin")), undefined, true, async () => {
1099
- const result = await this.dialogService.confirm({
1100
- message: ( localize(6073, "This MCP server is provided by the plugin '{0}'", plugin.label)),
1101
- detail: ( localize(
1102
- 6074,
1103
- "Individual MCP servers from a plugin cannot be removed separately. Would you like to uninstall the entire plugin?"
1104
- )),
1105
- primaryButton: ( localize(6075, "Uninstall Plugin")),
1106
- type: "question"
1107
- });
1108
- if (result.confirmed) {
1109
- plugin.remove?.();
2592
+ if (plugin) {
2593
+ if (actions.length > 0) {
2594
+ actions.push(( new Separator()));
1110
2595
  }
1111
- })));
1112
- this.contextMenuService.showContextMenu({
1113
- getAnchor: () => e.anchor,
1114
- getActions: () => [showPluginAction, uninstallAction],
1115
- onHide: () => disposables.dispose()
1116
- });
1117
- return;
1118
- }
1119
- if (e.element.type !== "server-item") {
1120
- return;
2596
+ actions.push(disposables.add(( new Action("mcpServer.showPlugin", ( localize(6925, "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(6926, "Uninstall Plugin")), undefined, true, async () => {
2607
+ const result = await this.dialogService.confirm({
2608
+ message: ( localize(6927, "This MCP server is provided by the plugin '{0}'", plugin.label)),
2609
+ detail: ( localize(
2610
+ 6928,
2611
+ "Individual MCP servers from a plugin cannot be removed separately. Would you like to uninstall the entire plugin?"
2612
+ )),
2613
+ primaryButton: ( localize(6929, "Uninstall Plugin")),
2614
+ type: "question"
2615
+ });
2616
+ if (result.confirmed) {
2617
+ await plugin.remove?.();
2618
+ }
2619
+ }))));
2620
+ }
2621
+ return actions;
1121
2622
  }
1122
- const serverEntry = e.element;
1123
- const disposables = ( new DisposableStore());
1124
- const mcpServer = this.mcpWorkbenchService.local.find(local => local.id === serverEntry.server.id) || serverEntry.server;
2623
+ const mcpServer = this.mcpWorkbenchService.local.find(local => local.id === entry.server.id) || entry.server;
1125
2624
  const groups = getContextMenuActions(mcpServer, false, this.instantiationService);
1126
- const actions = [];
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
+ ) : [];
1127
2634
  for (const menuActions of groups) {
1128
2635
  for (const menuAction of menuActions) {
1129
- actions.push(menuAction);
1130
2636
  if (isDisposable(menuAction)) {
1131
2637
  disposables.add(menuAction);
1132
2638
  }
1133
2639
  }
1134
- actions.push(( new Separator()));
1135
2640
  }
1136
- if (actions.length > 0 && actions[actions.length - 1] instanceof Separator) {
1137
- actions.pop();
2641
+ for (const action of [activeSessionLifecycleAction, ...agentHostEnablementActions]) {
2642
+ if (action && isDisposable(action)) {
2643
+ disposables.add(action);
2644
+ }
1138
2645
  }
1139
- this.contextMenuService.showContextMenu({
1140
- getAnchor: () => e.anchor,
1141
- getActions: () => actions,
1142
- onHide: () => disposables.dispose()
1143
- });
2646
+ return getServerItemContextMenuActions(
2647
+ groups,
2648
+ activeSessionServer,
2649
+ activeSessionLifecycleAction,
2650
+ agentHostEnablementActions
2651
+ );
1144
2652
  }
1145
2653
  };
1146
- 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, IHoverService)), ( __param(9, IAgentPluginService)), ( __param(10, IDialogService)), ( __param(11, IConfigurationService)), ( __param(12, ICustomizationHarnessService)), ( __param(13, IAgentHostCustomizationService)), ( __param(14, IAICustomizationWorkspaceService))], McpListWidget));
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));
1147
2655
 
1148
- export { McpListWidget };
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 };