@codingame/monaco-vscode-chat-service-override 37.6.1 → 38.0.1

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 (690) hide show
  1. package/common.js +64 -2
  2. package/index.js +3 -3
  3. package/package.json +5 -5
  4. package/session.js +5 -1
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +13 -2
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +164 -12
  7. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +4 -2
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +8 -2
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +34 -4
  10. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +345 -48
  11. package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.d.ts +135 -0
  12. package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.js +510 -0
  13. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +4 -1
  14. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +12 -2
  15. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +2 -11
  16. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +14 -27
  17. package/vscode/src/vs/platform/agentHost/common/agentHostOperatingSystem.d.ts +6 -0
  18. package/vscode/src/vs/platform/agentHost/common/agentHostOperatingSystem.js +43 -0
  19. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +158 -73
  20. package/vscode/src/vs/platform/agentHost/common/artifactToolsConfiguration.d.ts +16 -0
  21. package/vscode/src/vs/platform/agentHost/common/artifactToolsConfiguration.js +26 -0
  22. package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.d.ts +273 -0
  23. package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.js +61 -0
  24. package/vscode/src/vs/platform/agentHost/common/codexAccountPlan.d.ts +3 -0
  25. package/vscode/src/vs/platform/agentHost/common/codexAccountPlan.js +30 -0
  26. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +8 -8
  27. package/vscode/src/vs/platform/agentHost/common/meta/agentHostChatInputState.d.ts +2 -0
  28. package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.d.ts +7 -0
  29. package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.js +17 -0
  30. package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.d.ts +12 -0
  31. package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.js +48 -0
  32. package/vscode/src/vs/platform/agentHost/common/meta/{agentCustomizationMeta.js → vscode/agentCustomizationMeta.js} +2 -2
  33. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentHostChatInputState.d.ts +16 -0
  34. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentHostChatInputState.js +16 -0
  35. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelConfigurationMeta.d.ts +8 -0
  36. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelConfigurationMeta.js +20 -0
  37. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.d.ts +8 -0
  38. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js +11 -0
  39. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.js +141 -0
  40. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentPermissionResponseMeta.d.ts +12 -0
  41. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentPermissionResponseMeta.js +25 -0
  42. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentSandboxDiagnostics.d.ts +5 -0
  43. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentSandboxDiagnostics.js +11 -0
  44. package/vscode/src/vs/platform/agentHost/common/meta/{clientPluginCustomizationMeta.d.ts → vscode/clientPluginCustomizationMeta.d.ts} +10 -0
  45. package/vscode/src/vs/platform/agentHost/common/meta/{clientPluginCustomizationMeta.js → vscode/clientPluginCustomizationMeta.js} +7 -1
  46. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +35 -24
  47. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +85 -20
  48. package/vscode/src/vs/platform/agentHost/common/sessionDataService.d.ts +440 -0
  49. package/vscode/src/vs/platform/agentHost/common/sessionDataService.js +11 -0
  50. package/vscode/src/vs/platform/agentHost/common/sessionDataService.service.d.ts +104 -0
  51. package/vscode/src/vs/platform/agentHost/common/taskEventReplay.d.ts +48 -0
  52. package/vscode/src/vs/platform/agentHost/common/taskEventReplay.js +238 -0
  53. package/vscode/src/vs/platform/agentHost/common/titleGenerationConfiguration.d.ts +35 -0
  54. package/vscode/src/vs/platform/agentHost/common/titleGenerationConfiguration.js +49 -0
  55. package/vscode/src/vs/platform/agentHost/common/vscodeSandboxPaths.d.ts +9 -0
  56. package/vscode/src/vs/platform/agentHost/common/vscodeSandboxPaths.js +13 -0
  57. package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.d.ts +102 -0
  58. package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.js +260 -0
  59. package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.d.ts +102 -0
  60. package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.js +115 -0
  61. package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.d.ts +46 -0
  62. package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.js +92 -0
  63. package/vscode/src/vs/platform/customizationMarketplace/common/mcpGalleryMarketplaceProvider.d.ts +22 -0
  64. package/vscode/src/vs/platform/customizationMarketplace/common/mcpGalleryMarketplaceProvider.js +158 -0
  65. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
  66. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +12 -5
  67. package/vscode/src/vs/platform/otel/common/chatUserInteraction.d.ts +20 -0
  68. package/vscode/src/vs/platform/otel/common/chatUserInteraction.js +45 -0
  69. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +1 -4
  70. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +0 -9
  71. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +1 -4
  72. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -15
  73. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +1 -1
  74. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +6 -24
  75. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +51 -109
  76. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +1 -1
  77. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +1 -1
  78. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.js +7 -7
  79. package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.js +8 -8
  80. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +1 -1
  81. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +11 -10
  82. package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.js +2 -2
  83. package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.js +6 -6
  84. package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.js +460 -94
  85. package/vscode/src/vs/sessions/contrib/chat/browser/chatBackgroundTint.d.ts +35 -0
  86. package/vscode/src/vs/sessions/contrib/chat/browser/chatBackgroundTint.js +652 -0
  87. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +9 -0
  88. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionAction.d.ts +11 -0
  89. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionAction.js +118 -0
  90. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.js +4 -4
  91. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionOnboardingTargets.d.ts +7 -0
  92. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionOnboardingTargets.js +36 -0
  93. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionPickerTryout.d.ts +26 -0
  94. package/vscode/src/vs/sessions/contrib/chat/browser/newSessionPickerTryout.js +145 -0
  95. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.d.ts +1 -1
  96. package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.js +24 -6
  97. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.js +94 -89
  98. package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.js +21 -21
  99. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.d.ts +0 -1
  100. package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.js +28 -29
  101. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.d.ts +7 -0
  102. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.js +501 -107
  103. package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +5 -1
  104. package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.d.ts +3 -3
  105. package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.js +4 -4
  106. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.d.ts +8 -1
  107. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.js +214 -17
  108. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.js +16 -9
  109. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.js +4 -4
  110. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.js +7 -6
  111. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.js +4 -4
  112. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputPresenter.js +226 -0
  113. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.js +1 -1
  114. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openSubagentChat.d.ts +11 -0
  115. package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openSubagentChat.js +122 -0
  116. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +67 -0
  117. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +695 -0
  118. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +4 -0
  119. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +39 -0
  120. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +39 -22
  121. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +1 -19
  122. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +42 -158
  123. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +87 -0
  124. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +176 -0
  125. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +422 -0
  126. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +2444 -0
  127. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +91 -0
  128. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +620 -0
  129. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.d.ts +5 -4
  130. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.js +21 -12
  131. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +2 -11
  132. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +46 -0
  133. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +321 -0
  134. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +104 -0
  135. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +345 -0
  136. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.d.ts +14 -1
  137. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.js +20 -3
  138. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.d.ts +7 -1
  139. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.js +8 -12
  140. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.d.ts +8 -4
  141. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.js +88 -84
  142. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.js +74 -20
  143. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.js +2 -2
  144. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostFilter.css +34 -19
  145. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostPickerSheet.css +35 -3
  146. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.d.ts +37 -0
  147. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +305 -0
  148. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.d.ts +4 -1
  149. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.js +75 -20
  150. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.d.ts +1 -80
  151. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js +19 -548
  152. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.d.ts +4 -0
  153. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +218 -122
  154. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.d.ts +5 -4
  155. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.js +43 -8
  156. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js +1 -1
  157. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/media/sessionWorktreeCleanupEditor.css +223 -0
  158. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionStorageCleanupConfiguration.d.ts +2 -0
  159. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionStorageCleanupConfiguration.js +16 -0
  160. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.d.ts +15 -0
  161. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupAccessibilityHelp.js +49 -0
  162. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.d.ts +66 -0
  163. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditor.js +458 -0
  164. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditorInput.d.ts +13 -0
  165. package/vscode/src/vs/sessions/contrib/sessionInputBanners/browser/sessionWorktreeCleanupEditorInput.js +35 -0
  166. package/vscode/src/vs/sessions/contrib/sessions/browser/customizationMcpServerCount.d.ts +15 -0
  167. package/vscode/src/vs/sessions/contrib/sessions/browser/customizationMcpServerCount.js +37 -0
  168. package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.js +4 -4
  169. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.d.ts +1 -1
  170. package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.js +5 -1
  171. package/vscode/src/vs/sessions/skills/create-draft-pr/SKILL.md +1 -1
  172. package/vscode/src/vs/sessions/skills/create-pr/SKILL.md +1 -1
  173. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +1 -0
  174. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +2 -2
  175. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
  176. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +56 -31
  177. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  178. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +21 -21
  179. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +3 -3
  180. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  181. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  182. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +14 -14
  183. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  184. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  185. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  186. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  187. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  188. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  189. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +30 -29
  190. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
  191. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +3 -1
  192. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +44 -8
  193. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatBackgroundShellOutputAccessibleView.d.ts +11 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatBackgroundShellOutputAccessibleView.js +34 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +1 -1
  196. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +85 -29
  197. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatTerminalOutputAccessibleView.js +33 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  199. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
  200. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +318 -103
  201. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  202. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +60 -28
  203. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +41 -16
  204. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +49 -10
  205. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +7 -7
  206. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  207. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
  208. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +5 -10
  209. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  210. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +15 -21
  211. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +16 -15
  212. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  213. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  214. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +24 -23
  215. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  216. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +5 -1
  217. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +44 -31
  218. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
  219. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +6 -6
  220. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  221. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +3 -1
  222. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +22 -26
  223. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  224. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +9 -0
  225. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +180 -26
  226. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +6 -2
  227. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +82 -69
  228. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +4 -1
  229. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +32 -10
  230. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +12 -0
  231. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +5 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +37 -12
  233. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +6 -1
  234. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +53 -7
  235. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputState.d.ts +25 -0
  236. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputState.js +144 -0
  237. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +6 -1
  238. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +88 -12
  239. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationMarketplaceInstallProvider.d.ts +51 -0
  240. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationMarketplaceInstallProvider.js +642 -0
  241. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFirstResponseTelemetry.d.ts +118 -0
  242. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFirstResponseTelemetry.js +35 -0
  243. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +9 -1
  244. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +49 -7
  245. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +21 -17
  246. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +38 -10
  247. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerMigrationProvider.d.ts +50 -0
  248. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerMigrationProvider.js +415 -0
  249. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +12 -2
  250. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +124 -31
  251. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.d.ts +7 -2
  252. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.js +116 -5
  253. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +3 -1
  254. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +6 -6
  255. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  256. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +4 -4
  257. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRemoteByokNotification.d.ts +23 -0
  258. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRemoteByokNotification.js +134 -0
  259. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +14 -36
  260. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +286 -126
  261. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +1 -1
  262. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.js +3 -2
  263. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.d.ts +17 -0
  264. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotification.js +94 -0
  265. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotifications.d.ts +14 -0
  266. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSandboxNotifications.js +63 -0
  267. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +52 -88
  268. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +1030 -349
  269. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +20 -4
  270. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +722 -114
  271. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +3 -2
  273. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +88 -9
  274. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +16 -1
  275. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +87 -10
  276. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +1 -1
  277. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +2 -2
  278. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +4 -4
  279. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +4 -4
  280. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +4 -3
  281. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +2 -1
  282. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +12 -4
  283. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +191 -60
  284. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +4 -3
  285. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +6 -6
  286. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.d.ts +4 -0
  287. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +27 -17
  288. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.d.ts +2 -0
  289. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +2 -2
  290. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuation.contribution.d.ts +1 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuation.contribution.js +127 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuationGuide.d.ts +44 -0
  293. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuationGuide.js +415 -0
  294. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuationPresenter.d.ts +25 -0
  295. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/codexContinuationPresenter.js +160 -0
  296. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.d.ts +3 -1
  297. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.js +5 -1
  298. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +7 -2
  299. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +122 -34
  300. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +22 -4
  301. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +74 -39
  302. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +1 -1
  303. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +4 -0
  304. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +89 -68
  305. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +3 -3
  306. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  307. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  308. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  309. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  310. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -25
  311. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  312. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  313. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +4 -2
  314. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +50 -22
  315. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.d.ts +21 -0
  316. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.js +122 -0
  317. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.d.ts +81 -1
  318. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +213 -13
  319. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +136 -100
  320. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationUrlHandler.d.ts +16 -0
  321. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationUrlHandler.js +76 -0
  322. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -1
  323. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +2 -2
  324. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotConnectorsService.d.ts +139 -0
  325. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/copilotConnectorsService.js +944 -0
  326. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplace.contribution.d.ts +1 -0
  327. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplace.contribution.js +119 -0
  328. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallService.d.ts +110 -0
  329. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallService.js +1485 -0
  330. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallationAssociation.d.ts +38 -0
  331. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceInstallationAssociation.js +48 -0
  332. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceWorkbenchService.d.ts +50 -0
  333. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMarketplaceWorkbenchService.js +213 -0
  334. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +19 -12
  335. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +6 -22
  336. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +87 -263
  337. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationsTelemetryService.d.ts +25 -0
  338. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationsTelemetryService.js +217 -0
  339. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/githubMcpRegistryIcons.d.ts +4 -0
  340. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/githubMcpRegistryIcons.js +605 -0
  341. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +11 -4
  342. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +377 -184
  343. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -0
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +753 -617
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +1 -1
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +118 -40
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +35 -35
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.d.ts +4 -2
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +47 -42
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +29 -6
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +2 -1
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +6 -3
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -3
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +10 -7
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +5 -3
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +11 -5
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +4 -3
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +10 -7
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +10 -10
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +24 -11
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +2 -2
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +16 -20
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +2 -2
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +2 -2
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.js +1 -1
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +12 -4
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +52 -61
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +17 -11
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +2 -0
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +3 -0
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatNetworkConfiguration.d.ts +4 -0
  397. package/vscode/src/vs/workbench/contrib/chat/browser/chatNetworkConfiguration.js +136 -0
  398. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  399. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +52 -30
  400. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +71 -17
  401. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.d.ts +12 -5
  402. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +104 -16
  403. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.d.ts +5 -1
  404. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  405. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.d.ts +3 -1
  406. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +84 -64
  407. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetColorsWidget.d.ts +29 -0
  408. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetColorsWidget.js +221 -0
  409. package/vscode/src/vs/workbench/contrib/chat/browser/chatProgressConfiguration.d.ts +27 -0
  410. package/vscode/src/vs/workbench/contrib/chat/browser/chatProgressConfiguration.js +72 -0
  411. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.d.ts +4 -0
  412. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +4 -2
  413. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
  414. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  415. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +2 -2
  416. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +1 -0
  417. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +52 -32
  418. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +3 -1
  419. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +65 -57
  420. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  421. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.d.ts +82 -0
  422. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.js +213 -0
  423. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -27
  424. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +5 -12
  425. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +93 -45
  426. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -1
  427. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +54 -55
  428. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +5 -1
  429. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +51 -15
  430. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusPromo.d.ts +43 -0
  431. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusPromo.js +230 -0
  432. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/codexStatusEntry.d.ts +20 -0
  433. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/codexStatusEntry.js +101 -0
  434. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +30 -19
  435. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +4 -2
  436. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.d.ts +2 -0
  437. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.js +1 -0
  438. package/vscode/src/vs/workbench/contrib/chat/browser/chatUserInteractionOTel.d.ts +27 -0
  439. package/vscode/src/vs/workbench/contrib/chat/browser/chatUserInteractionOTel.js +88 -0
  440. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
  441. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  442. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  443. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  444. package/vscode/src/vs/workbench/contrib/chat/browser/editorChatUsage.contribution.d.ts +34 -0
  445. package/vscode/src/vs/workbench/contrib/chat/browser/editorChatUsage.contribution.js +121 -0
  446. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  447. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatHarnessSwitchFeedbackSurveyService.d.ts +34 -0
  448. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatHarnessSwitchFeedbackSurveyService.js +192 -0
  449. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.js +11 -24
  450. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +3 -3
  451. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatPetAchievements.css +232 -1
  452. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/modelPickerTryout.contribution.d.ts +3 -0
  453. package/vscode/src/vs/workbench/contrib/chat/browser/onboarding/modelPickerTryout.contribution.js +85 -0
  454. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
  455. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +0 -7
  456. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +11 -28
  457. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitHubAuthentication.d.ts +6 -0
  458. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitHubAuthentication.js +18 -0
  459. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +13 -6
  460. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +250 -92
  461. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +2 -1
  462. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +39 -47
  463. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  464. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
  465. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  466. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  467. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  468. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  469. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  470. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  471. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  472. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +5 -5
  473. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  474. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +4 -4
  475. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +3 -3
  476. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +1 -1
  477. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
  478. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  479. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.d.ts +40 -0
  480. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.js +561 -0
  481. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.d.ts +133 -0
  482. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.js +1176 -0
  483. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.d.ts +17 -0
  484. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.js +76 -0
  485. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.d.ts +54 -0
  486. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.js +220 -0
  487. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.d.ts +21 -0
  488. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.js +184 -0
  489. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.d.ts +8 -0
  490. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.js +165 -0
  491. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.d.ts +43 -0
  492. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.js +162 -0
  493. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.d.ts +40 -0
  494. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.js +129 -0
  495. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.d.ts +166 -0
  496. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.js +838 -0
  497. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.d.ts +40 -0
  498. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.js +604 -0
  499. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +45 -0
  500. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +251 -0
  501. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.d.ts +289 -0
  502. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.js +497 -0
  503. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +46 -0
  504. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +277 -0
  505. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.d.ts +6 -0
  506. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.js +41 -0
  507. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.d.ts +1 -0
  508. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +178 -0
  509. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.d.ts +73 -0
  510. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.js +398 -0
  511. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.d.ts +45 -0
  512. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.js +296 -0
  513. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.d.ts +1 -0
  514. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +96 -0
  515. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostAuthentication.d.ts +8 -0
  516. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostAuthentication.js +15 -0
  517. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.d.ts +75 -0
  518. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +559 -0
  519. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostConnectionCustomization.d.ts +43 -0
  520. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostConnectionCustomization.js +26 -0
  521. package/vscode/src/vs/{sessions/contrib/providers/remoteAgentHost/browser → workbench/contrib/chat/browser/remoteAgentHost}/remoteAgentHostCustomizationHarness.d.ts +1 -1
  522. package/vscode/src/vs/{sessions/contrib/providers/remoteAgentHost/browser → workbench/contrib/chat/browser/remoteAgentHost}/remoteAgentHostCustomizationHarness.js +8 -8
  523. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +26 -10
  524. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  525. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +45 -31
  526. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +8 -8
  527. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +1 -1
  528. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  529. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  530. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatUpdateRequiredView.d.ts +22 -0
  531. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatUpdateRequiredView.js +110 -0
  532. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  533. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +1 -1
  534. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  535. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +39 -35
  536. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
  537. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +5 -1
  538. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +68 -16
  539. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +1 -1
  540. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +16 -1
  541. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +23 -18
  542. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
  543. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +7 -5
  544. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatPet/all_/_.png.js +4 -0
  545. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatPet/buddy-painting-insiders-96.png +0 -0
  546. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatPet/buddy-painting-insiders-96.spritesheet.png +0 -0
  547. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatPet/buddy-painting-stable-96.png +0 -0
  548. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatPet/buddy-painting-stable-96.spritesheet.png +0 -0
  549. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  550. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +15 -18
  551. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +17 -1
  552. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +122 -21
  553. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +7 -1
  554. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +46 -11
  555. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +16 -0
  556. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewTitleControl.css +18 -3
  557. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +24 -7
  558. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +406 -193
  559. package/vscode/src/vs/workbench/contrib/chat/common/customizationMarketplaceInstallService.d.ts +58 -0
  560. package/vscode/src/vs/workbench/contrib/chat/common/customizationMarketplaceInstallService.js +60 -0
  561. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +6 -0
  562. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -1
  563. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
  564. package/vscode/src/vs/workbench/contrib/chat/common/onboarding/modelPickerTryout.d.ts +4 -0
  565. package/vscode/src/vs/workbench/contrib/chat/common/onboarding/modelPickerTryout.js +8 -0
  566. package/vscode/src/vs/workbench/contrib/chat/common/onboarding/newSessionPickerTryout.d.ts +3 -0
  567. package/vscode/src/vs/workbench/contrib/chat/common/onboarding/newSessionPickerTryout.js +8 -0
  568. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -22
  569. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +455 -237
  570. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  571. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +4 -2
  572. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +25 -17
  573. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  574. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  575. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +11 -14
  576. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.d.ts +1 -1
  577. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +2 -1
  578. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +1 -1
  579. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +156 -155
  580. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationTelemetryService.d.ts +43 -0
  581. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationTelemetryService.js +225 -0
  582. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +10 -10
  583. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +7 -7
  584. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +6 -0
  585. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +65 -9
  586. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +3 -3
  587. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +4 -4
  588. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +4 -0
  589. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +11 -3
  590. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +22 -22
  591. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  592. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +4 -3
  593. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +46 -24
  594. package/vscode/src/vs/workbench/contrib/github/browser/githubCommitResolver.d.ts +15 -0
  595. package/vscode/src/vs/workbench/contrib/github/browser/githubCommitResolver.js +92 -0
  596. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  597. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.d.ts +1 -0
  598. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +22 -15
  599. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  600. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  601. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  602. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +1 -1
  603. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.js +1 -1
  604. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  605. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  606. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  607. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  608. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  609. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  610. package/vscode/src/vs/workbench/contrib/onboarding/browser/onboarding.d.ts +4 -0
  611. package/vscode/src/vs/workbench/contrib/onboarding/browser/spotlight/spotlightStep.d.ts +10 -0
  612. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  613. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +10 -10
  614. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  615. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  616. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.js +1 -1
  617. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  618. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +0 -1
  619. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +3 -25
  620. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  621. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -5
  622. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  623. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  624. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  625. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +1 -1
  626. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  627. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  628. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  629. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  630. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +4 -4
  631. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  632. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -1
  633. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +79 -82
  634. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +3 -3
  635. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  636. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.d.ts +9 -1
  637. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +103 -26
  638. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  639. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  640. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  641. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +1 -1
  642. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +2 -2
  643. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +8 -4
  644. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -5
  645. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +16 -60
  646. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
  647. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.d.ts +1 -1
  648. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.js +1 -1
  649. package/vscode/src/vs/workbench/services/agentHost/browser/codexContinuation.d.ts +31 -0
  650. package/vscode/src/vs/workbench/services/agentHost/browser/codexContinuation.js +86 -0
  651. package/vscode/src/vs/workbench/services/agentHost/browser/codexContinuationService.d.ts +76 -0
  652. package/vscode/src/vs/workbench/services/agentHost/browser/codexContinuationService.js +409 -0
  653. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +14 -2
  654. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +56 -7
  655. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.d.ts +0 -8
  656. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +0 -19
  657. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.d.ts +0 -24
  658. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.js +0 -13
  659. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +0 -53
  660. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.d.ts +0 -53
  661. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.js +0 -45
  662. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +0 -108
  663. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +0 -15
  664. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.d.ts +0 -31
  665. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.js +0 -150
  666. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.js +0 -37
  667. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.d.ts +0 -26
  668. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.js +0 -86
  669. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +0 -8
  670. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +0 -241
  671. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.d.ts +0 -142
  672. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +0 -746
  673. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +0 -164
  674. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +0 -485
  675. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.d.ts +0 -137
  676. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +0 -714
  677. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentOpenChat.css +0 -379
  678. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +0 -219
  679. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +0 -222
  680. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +0 -16
  681. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +0 -39
  682. /package/vscode/src/vs/platform/agentHost/common/meta/{agentChatSurfaceMeta.d.ts → vscode/agentChatSurfaceMeta.d.ts} +0 -0
  683. /package/vscode/src/vs/platform/agentHost/common/meta/{agentChatSurfaceMeta.js → vscode/agentChatSurfaceMeta.js} +0 -0
  684. /package/vscode/src/vs/platform/agentHost/common/meta/{agentCustomizationMeta.d.ts → vscode/agentCustomizationMeta.d.ts} +0 -0
  685. /package/vscode/src/vs/platform/agentHost/common/meta/{agentEphemeralSessionMeta.d.ts → vscode/agentEphemeralSessionMeta.d.ts} +0 -0
  686. /package/vscode/src/vs/platform/agentHost/common/meta/{agentEphemeralSessionMeta.js → vscode/agentEphemeralSessionMeta.js} +0 -0
  687. /package/vscode/src/vs/platform/agentHost/common/{agentModelPricing.d.ts → meta/vscode/agentModelPricing.d.ts} +0 -0
  688. /package/vscode/src/vs/sessions/contrib/providers/{copilotChatSessions/browser/mobilePermissionPicker.contribution.d.ts → agentHost/browser/mobile/mobileChatPhoneInputPresenter.d.ts} +0 -0
  689. /package/vscode/src/vs/{sessions/contrib/providers/remoteAgentHost/browser → workbench/contrib/chat/browser/remoteAgentHost}/remoteAgentHostLogForwarder.d.ts +0 -0
  690. /package/vscode/src/vs/{sessions/contrib/providers/remoteAgentHost/browser → workbench/contrib/chat/browser/remoteAgentHost}/remoteAgentHostLogForwarder.js +0 -0
@@ -0,0 +1,1485 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { cancelOnDispose, CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
4
+ import { getErrorMessage, CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
+ import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
+ import { isWeb } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
9
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
10
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
11
+ import { CopilotConnectorsError } from '@codingame/monaco-vscode-api/vscode/vs/platform/copilotConnectors/common/copilotConnectorsRequestService';
12
+ import { getCustomizationMarketplaceResourceKey, isCustomizationMarketplaceIconEqual, CustomizationMarketplaceMediaType } from '@codingame/monaco-vscode-api/vscode/vs/platform/customizationMarketplace/common/customizationMarketplaceService';
13
+ import { ICustomizationMarketplaceService } from '@codingame/monaco-vscode-api/vscode/vs/platform/customizationMarketplace/common/customizationMarketplaceService.service';
14
+ import { normalizeMcpGalleryUrl } from '../../../../../platform/customizationMarketplace/common/mcpGalleryMarketplaceProvider.js';
15
+ import { affectsCustomizationMarketplaceSources, CustomizationMarketplaceConfiguration, getVisibleCustomizationMarketplaceSources, CustomizationMarketplaceSources } from '@codingame/monaco-vscode-api/vscode/vs/platform/customizationMarketplace/common/customizationMarketplaceSources';
16
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
17
+ import { toFileOperationResult, FileOperationResult } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
18
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
19
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
20
+ import { mcpGalleryServiceUrlConfig } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpManagement';
21
+ import { IMcpGalleryManifestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpGalleryManifest.service';
22
+ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
23
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
24
+ import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
25
+ import { McpServerInstallState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
26
+ import { IMcpWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
27
+ import { createCustomizationMarketplaceInstallationSnapshot } from '../../common/customizationMarketplaceInstallService.js';
28
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
29
+ import { runCustomizationMarketplaceInstallWithTelemetry, getCustomizationMarketplaceInstallTelemetryContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationMarketplaceInstallTelemetry';
30
+ import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
31
+ import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
32
+ import { IPluginInstallService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service';
33
+ import { parseMarketplaceReference } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/marketplaceReference';
34
+ import { IPluginMarketplaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service';
35
+ import { getConnectorRowPresentation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/connectorPresentation';
36
+ import { toCopilotConnectorMarketplaceEntry } from './copilotConnectorsService.js';
37
+ import { ICopilotConnectorsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/copilotConnectorsService.service';
38
+ import { getGitHubMcpRegistryResourceIdentity, getGitHubMcpRegistryIdentity } from './githubMcpRegistryIcons.js';
39
+ import { getPluginCustomizationMarketplaceSourceIdFromIdentifier, getPluginMarketplaceIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/pluginCustomizationMarketplaceProvider';
40
+ import { removeLegacyCustomizationMarketplaceInstallationRecords, CustomizationMarketplaceInstallationAssociationCache, toAssociatedMarketplaceResource, getInstallationAssociationResourceKey } from './customizationMarketplaceInstallationAssociation.js';
41
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
42
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
43
+
44
+ let CustomizationMarketplaceInstallService = class CustomizationMarketplaceInstallService extends Disposable {
45
+ constructor(
46
+ pluginInstallService,
47
+ pluginMarketplaceService,
48
+ agentPluginService,
49
+ mcpWorkbenchService,
50
+ copilotConnectorsService,
51
+ mcpGalleryManifestService,
52
+ harnessService,
53
+ entitlementService,
54
+ customizationMarketplaceService,
55
+ configurationService,
56
+ fileService,
57
+ logService,
58
+ telemetryService,
59
+ storageService
60
+ ) {
61
+ super();
62
+ this.pluginInstallService = pluginInstallService;
63
+ this.pluginMarketplaceService = pluginMarketplaceService;
64
+ this.agentPluginService = agentPluginService;
65
+ this.mcpWorkbenchService = mcpWorkbenchService;
66
+ this.copilotConnectorsService = copilotConnectorsService;
67
+ this.mcpGalleryManifestService = mcpGalleryManifestService;
68
+ this.harnessService = harnessService;
69
+ this.entitlementService = entitlementService;
70
+ this.customizationMarketplaceService = customizationMarketplaceService;
71
+ this.configurationService = configurationService;
72
+ this.fileService = fileService;
73
+ this.logService = logService;
74
+ this.telemetryService = telemetryService;
75
+ this._onDidChange = this._register(( new Emitter()));
76
+ this.onDidChange = this._onDidChange.event;
77
+ this.pending = ( new Map());
78
+ this.pendingRepairs = ( new Map());
79
+ this.pendingUninstalls = ( new Map());
80
+ this.recordStates = ( new Map());
81
+ this.reconciliationVersions = ( new Map());
82
+ this.lifetimeToken = cancelOnDispose(this._store);
83
+ this.enabledDisposables = this._register(( new DisposableStore()));
84
+ this.connectorListeners = this._register(( new MutableDisposable()));
85
+ this.providerRequest = this._register(( new MutableDisposable()));
86
+ this.providerInstallations = [];
87
+ this.knownResources = ( new Map());
88
+ this.providerChangeScheduled = false;
89
+ this.observingInstallations = false;
90
+ removeLegacyCustomizationMarketplaceInstallationRecords(storageService);
91
+ this.recordStore = this._register(( new CustomizationMarketplaceInstallationAssociationCache()));
92
+ for (const record of ( this.recordStore.associations.values())) {
93
+ this.recordStates.set(record.id, {
94
+ kind: "checking"
95
+ });
96
+ }
97
+ this.installations = observableFromEvent(this, this.onDidChange, () => this.getInstallationSnapshot());
98
+ this._register(this.configurationService.onDidChangeConfiguration(event => {
99
+ if (affectsCustomizationMarketplaceSources(
100
+ event,
101
+ this.customizationMarketplaceService.allSources ?? this.customizationMarketplaceService.sources
102
+ )) {
103
+ this.updateEnablement();
104
+ } else if (this.isEnabled() && (event.affectsConfiguration(ChatConfiguration.PluginsEnabled) || event.affectsConfiguration(CustomizationMarketplaceConfiguration.CopilotConnectorsEnabled))) {
105
+ this.emitChange();
106
+ }
107
+ }));
108
+ if (this.customizationMarketplaceService.onDidChangeSources) {
109
+ this._register(
110
+ this.customizationMarketplaceService.onDidChangeSources(() => this.updateEnablement())
111
+ );
112
+ }
113
+ this._register(autorun(reader => {
114
+ this.harnessService.activeHarness.read(reader);
115
+ this.harnessService.activeSessionResource.read(reader);
116
+ this.bindInstallProvider();
117
+ }));
118
+ this.updateEnablement();
119
+ }
120
+ emitChange() {
121
+ this.installationSnapshot = undefined;
122
+ this._onDidChange.fire();
123
+ }
124
+ getInstallationSnapshot() {
125
+ const associations = this.getRelevantRecords().map(record => {
126
+ const resource = toAssociatedMarketplaceResource(record);
127
+ return {
128
+ resource,
129
+ state: this.getRecordedInstallState(record, resource)
130
+ };
131
+ });
132
+ const providerInstallations = this.providerInstallations.map(installation => {
133
+ const resource = this.findKnownResource(installation.resource) ?? installation.resource;
134
+ return resource === installation.resource ? installation : {
135
+ ...installation,
136
+ resource
137
+ };
138
+ });
139
+ return this.installationSnapshot ??= createCustomizationMarketplaceInstallationSnapshot(
140
+ [...providerInstallations, ...associations],
141
+ (recorded, resource) => this.isLegacyConfiguredPluginResource(recorded, resource)
142
+ );
143
+ }
144
+ bindInstallProvider() {
145
+ this.providerRequest.clear();
146
+ const hadInstallations = this.providerInstallations.length > 0;
147
+ this.providerInstallations = [];
148
+ if (hadInstallations) {
149
+ this.emitChange();
150
+ }
151
+ const provider = this.harnessService.getActiveDescriptor().marketplaceInstallProvider;
152
+ if (!provider) {
153
+ this.providerBinding = undefined;
154
+ return;
155
+ }
156
+ const binding = {
157
+ provider,
158
+ session: this.harnessService.activeSessionResource.get(),
159
+ refreshVersion: 0
160
+ };
161
+ this.providerBinding = binding;
162
+ const store = ( new DisposableStore());
163
+ this.providerRequest.value = store;
164
+ store.add(
165
+ provider.onDidChange(() => void this.refreshProviderInstallations(binding))
166
+ );
167
+ void this.refreshProviderInstallations(binding);
168
+ }
169
+ async refreshProviderInstallations(binding) {
170
+ const refreshVersion = ++binding.refreshVersion;
171
+ const store = ( new DisposableStore());
172
+ const cancellation = store.add(( new CancellationTokenSource(this.lifetimeToken)));
173
+ try {
174
+ const installations = await binding.provider.getInstallations(binding.session, cancellation.token);
175
+ if (binding !== this.providerBinding || refreshVersion !== binding.refreshVersion || cancellation.token.isCancellationRequested || this._store.isDisposed) {
176
+ return;
177
+ }
178
+ this.providerInstallations = installations;
179
+ this.emitChange();
180
+ } catch (error) {
181
+ if (!cancellation.token.isCancellationRequested) {
182
+ this.logService.error(
183
+ "[CustomizationMarketplace] Unable to load provider-owned installations",
184
+ error
185
+ );
186
+ }
187
+ } finally {
188
+ store.dispose();
189
+ }
190
+ }
191
+ rememberResource(resource) {
192
+ const key = getCustomizationMarketplaceResourceKey(resource);
193
+ const previous = this.knownResources.get(key);
194
+ if (previous && isCustomizationMarketplaceIconEqual(previous.icon, resource.icon)) {
195
+ return;
196
+ }
197
+ this.knownResources.set(key, resource);
198
+ while (this.knownResources.size > 1000) {
199
+ this.knownResources.delete(( this.knownResources.keys()).next().value);
200
+ }
201
+ if (!this.providerChangeScheduled && ( this.providerInstallations.some(
202
+ installation => this.matchesProviderInstallation(installation.resource, resource)
203
+ ))) {
204
+ this.providerChangeScheduled = true;
205
+ queueMicrotask(() => {
206
+ this.providerChangeScheduled = false;
207
+ if (!this._store.isDisposed) {
208
+ this.emitChange();
209
+ }
210
+ });
211
+ }
212
+ }
213
+ findKnownResource(resource) {
214
+ const resourceKey = getCustomizationMarketplaceResourceKey(resource);
215
+ let exactResource;
216
+ for (const candidate of ( this.knownResources.values())) {
217
+ if (!this.matchesProviderInstallation(resource, candidate)) {
218
+ continue;
219
+ }
220
+ if (getCustomizationMarketplaceResourceKey(candidate) !== resourceKey) {
221
+ return candidate;
222
+ }
223
+ exactResource ??= candidate;
224
+ }
225
+ return exactResource;
226
+ }
227
+ matchesProviderInstallation(installed, resource) {
228
+ if (getCustomizationMarketplaceResourceKey(installed) === getCustomizationMarketplaceResourceKey(resource)) {
229
+ return true;
230
+ }
231
+ const versionsCompatible = installed.version === undefined || resource.version === undefined || installed.version === resource.version;
232
+ if (versionsCompatible && installed.externalUrl && resource.externalUrl && installed.externalUrl === resource.externalUrl) {
233
+ return true;
234
+ }
235
+ const installedRegistryIdentity = this.getGitHubMcpRegistryIdentity(installed);
236
+ const resourceRegistryIdentity = this.getGitHubMcpRegistryIdentity(resource);
237
+ if (versionsCompatible && installedRegistryIdentity && resourceRegistryIdentity && installedRegistryIdentity === resourceRegistryIdentity) {
238
+ return true;
239
+ }
240
+ const installedSource = installed.installation;
241
+ const resourceSource = resource.installation;
242
+ if (installedSource?.kind === "configuredPlugin" && (resourceSource?.kind === "configuredPlugin" || resourceSource?.kind === "providerPlugin")) {
243
+ return versionsCompatible && installedSource.name === resourceSource.name && installedSource.marketplace === resourceSource.marketplace;
244
+ }
245
+ if (installedSource?.kind === "plugin" && resourceSource?.kind === "plugin") {
246
+ return installedSource.repository.toLowerCase() === resourceSource.repository.toLowerCase() && installedSource.path === resourceSource.path && installedSource.ref === resourceSource.ref && versionsCompatible;
247
+ }
248
+ return false;
249
+ }
250
+ getGitHubMcpRegistryIdentity(resource) {
251
+ const installation = resource.installation;
252
+ const itemUrl = installation?.kind === "providerCatalog" ? installation.itemUrl : undefined;
253
+ return getGitHubMcpRegistryResourceIdentity(resource.identifier)?.toLowerCase() ?? getGitHubMcpRegistryIdentity(
254
+ itemUrl ?? resource.externalUrl ?? resource.url?.toString(true) ?? resource.identifier
255
+ )?.toLowerCase();
256
+ }
257
+ isEnabled() {
258
+ return getVisibleCustomizationMarketplaceSources(this.configurationService, this.customizationMarketplaceService.sources).length > 0;
259
+ }
260
+ isSourceEnabled(sourceId) {
261
+ return ( getVisibleCustomizationMarketplaceSources(this.configurationService, this.customizationMarketplaceService.sources).some(source => source.id === sourceId));
262
+ }
263
+ getInstalledGalleryMcpServer(source) {
264
+ const registryUrl = normalizeMcpGalleryUrl(source.registryUrl);
265
+ return registryUrl ? this.mcpWorkbenchService.local.find(
266
+ server => server.name === source.name && server.local?.name === source.name && normalizeMcpGalleryUrl(server.local.galleryUrl) === registryUrl && server.gallery?.name === source.name && normalizeMcpGalleryUrl(server.gallery.galleryUrl) === registryUrl && server.installState === McpServerInstallState.Installed
267
+ ) : undefined;
268
+ }
269
+ isMcpGallerySourceCurrent(source) {
270
+ return source.registry === "default" ? true : normalizeMcpGalleryUrl(this.configurationService.getValue(mcpGalleryServiceUrlConfig)) === normalizeMcpGalleryUrl(source.registryUrl);
271
+ }
272
+ updateEnablement() {
273
+ if (this.isSourceEnabled(CustomizationMarketplaceSources.CopilotConnectors.id)) {
274
+ if (!this.connectorListeners.value) {
275
+ const listeners = ( new DisposableStore());
276
+ this.connectorListeners.value = listeners;
277
+ listeners.add(this.copilotConnectorsService.onDidChange(() => {
278
+ this.emitChange();
279
+ void this.synchronizeConnectedConnectorRecords();
280
+ }));
281
+ listeners.add(this.copilotConnectorsService.onDidChangeAccount(() => {
282
+ this.synchronizeRecordStates();
283
+ this.emitChange();
284
+ void this.reconcileRecords(this.getApplicableConnectorRecords());
285
+ }));
286
+ listeners.add(this.copilotConnectorsService.onDidDisconnect(name => {
287
+ const account = this.copilotConnectorsService.account;
288
+ const record = account ? this.findConnectorRecord(name, account) : undefined;
289
+ if (record) {
290
+ this.removeRecord(record);
291
+ this.emitChange();
292
+ }
293
+ }));
294
+ }
295
+ } else {
296
+ this.connectorListeners.clear();
297
+ }
298
+ const enabled = this.isEnabled();
299
+ if (enabled === this.observingInstallations) {
300
+ this.emitChange();
301
+ void this.synchronizeConnectedConnectorRecords();
302
+ return;
303
+ }
304
+ this.observingInstallations = enabled;
305
+ this.enabledDisposables.clear();
306
+ if (!enabled) {
307
+ this.emitChange();
308
+ return;
309
+ }
310
+ this.enabledDisposables.add(autorun(reader => {
311
+ this.pluginMarketplaceService.installedPlugins.read(reader);
312
+ this.agentPluginService.plugins.read(reader);
313
+ this.emitChange();
314
+ void this.reconcileRecords(this.getRecordsByKind("plugin"));
315
+ }));
316
+ this.enabledDisposables.add(this.mcpWorkbenchService.onChange(() => {
317
+ this.emitChange();
318
+ void this.reconcileRecords(this.getRecordsByKind("mcp"));
319
+ }));
320
+ this.enabledDisposables.add(this.mcpWorkbenchService.onReset(() => {
321
+ this.emitChange();
322
+ void this.reconcileRecords(this.getRecordsByKind("mcp"));
323
+ }));
324
+ this.enabledDisposables.add(this.entitlementService.onDidChangeSentiment(() => this.emitChange()));
325
+ void this.reconcileRecords(this.getRecordsByKind("mcp"));
326
+ void this.synchronizeConnectedConnectorRecords();
327
+ }
328
+ synchronizeRecordStates(reset = false) {
329
+ for (const id of [...( this.recordStates.keys())]) {
330
+ if (!( this.recordStore.associations.has(id))) {
331
+ this.recordStates.delete(id);
332
+ this.reconciliationVersions.delete(id);
333
+ }
334
+ }
335
+ for (const record of ( this.recordStore.associations.values())) {
336
+ if (reset || !( this.recordStates.has(record.id))) {
337
+ this.recordStates.set(record.id, {
338
+ kind: "checking"
339
+ });
340
+ }
341
+ }
342
+ }
343
+ getRecordsByKind(kind) {
344
+ return [...( this.recordStore.associations.values())].filter(record => record.target.kind === kind);
345
+ }
346
+ getApplicableConnectorRecords() {
347
+ return this.configurationService.getValue(CustomizationMarketplaceConfiguration.CopilotConnectorsEnabled) === true ? this.getRecordsByKind("copilotConnector").filter(record => this.isRecordApplicable(record)) : [];
348
+ }
349
+ getRelevantRecords() {
350
+ return [
351
+ ...this.getRecordsByKind("plugin"),
352
+ ...this.getRecordsByKind("mcp"),
353
+ ...this.getApplicableConnectorRecords()
354
+ ].filter(record => !this.isProviderManagedInstallation(record.installation));
355
+ }
356
+ async synchronizeConnectedConnectorRecords() {
357
+ if (!this.isSourceEnabled(CustomizationMarketplaceSources.CopilotConnectors.id)) {
358
+ return;
359
+ }
360
+ const account = this.copilotConnectorsService.account;
361
+ if (!account) {
362
+ return;
363
+ }
364
+ for (const connector of this.copilotConnectorsService.connectors) {
365
+ if (connector.connectionStatus !== "connected") {
366
+ continue;
367
+ }
368
+ try {
369
+ const resource = {
370
+ ...toCopilotConnectorMarketplaceEntry(connector),
371
+ sourceId: CustomizationMarketplaceSources.CopilotConnectors.id
372
+ };
373
+ const existing = this.findConnectorRecord(connector.name, account);
374
+ const record = await this.createConnectorRecord(resource, account, existing?.id);
375
+ const didChange = !existing || existing.version !== record.version || existing.displayName !== record.displayName || existing.description !== record.description || !isCustomizationMarketplaceIconEqual(existing.icon, record.icon);
376
+ if (didChange) {
377
+ this.recordStore.upsert(record);
378
+ this.recordStates.set(record.id, {
379
+ kind: "checking"
380
+ });
381
+ this.emitChange();
382
+ }
383
+ } catch (error) {
384
+ this.logService.error(
385
+ `[CustomizationMarketplace] Unable to record connected Copilot connector '${connector.name}'`,
386
+ error
387
+ );
388
+ }
389
+ }
390
+ await this.reconcileRecords(this.getApplicableConnectorRecords());
391
+ }
392
+ async createConnectorRecord(resource, account, existingId) {
393
+ const installation = resource.installation;
394
+ if (installation?.kind !== "copilotConnector") {
395
+ throw ( new Error(( localize(10684, "Copilot connector installation metadata is unavailable."))));
396
+ }
397
+ return {
398
+ id: existingId ?? (await createInstallationRecordId([
399
+ getCustomizationMarketplaceResourceKey(resource),
400
+ account.providerId,
401
+ account.enterprise ? "enterprise" : "public",
402
+ account.accountName
403
+ ])),
404
+ sourceId: resource.sourceId,
405
+ identifier: resource.identifier,
406
+ version: resource.version,
407
+ displayName: resource.displayName,
408
+ description: resource.description,
409
+ mediaType: resource.mediaType,
410
+ icon: resource.icon,
411
+ installation,
412
+ target: {
413
+ kind: "copilotConnector",
414
+ name: installation.name,
415
+ providerId: account.providerId,
416
+ accountName: account.accountName,
417
+ enterprise: account.enterprise
418
+ }
419
+ };
420
+ }
421
+ findConnectorRecord(name, account) {
422
+ return this.getRecordsByKind("copilotConnector").find(
423
+ record => record.target.kind === "copilotConnector" && record.target.name === name && isConnectorAccountEqual(record.target, account)
424
+ );
425
+ }
426
+ async addRecord(record) {
427
+ this.recordStore.upsert(record);
428
+ this.recordStates.delete(record.id);
429
+ await this.reconcileRecords([record]);
430
+ }
431
+ removeRecord(record) {
432
+ this.recordStore.delete(record);
433
+ this.recordStates.delete(record.id);
434
+ this.reconciliationVersions.delete(record.id);
435
+ }
436
+ findRecord(resource) {
437
+ if (this.getInstallProviderBinding(resource)) {
438
+ return undefined;
439
+ }
440
+ if (resource.installation?.kind === "copilotConnector") {
441
+ const account = this.copilotConnectorsService.account;
442
+ return account ? this.findConnectorRecord(resource.installation.name, account) : undefined;
443
+ }
444
+ const resourceKey = getCustomizationMarketplaceResourceKey(resource);
445
+ return [...( this.recordStore.associations.values())].find(
446
+ record => this.isRecordApplicable(record) && (getInstallationAssociationResourceKey(record) === resourceKey || this.isLegacyConfiguredPluginRecord(record, resource))
447
+ );
448
+ }
449
+ isLegacyConfiguredPluginRecord(record, resource) {
450
+ return this.isLegacyConfiguredPluginResource(record, resource);
451
+ }
452
+ isLegacyConfiguredPluginResource(recorded, resource) {
453
+ return recorded.sourceId === CustomizationMarketplaceSources.PluginMarketplaces.id && recorded.installation?.kind === "configuredPlugin" && resource.installation?.kind === "configuredPlugin" && recorded.identifier === resource.identifier && recorded.version === resource.version;
454
+ }
455
+ getRecordSourceId(record) {
456
+ return record.sourceId === CustomizationMarketplaceSources.PluginMarketplaces.id && record.installation.kind === "configuredPlugin" ? getPluginCustomizationMarketplaceSourceIdFromIdentifier(record.identifier) ?? record.sourceId : record.sourceId;
457
+ }
458
+ isRecordApplicable(record) {
459
+ if (record.target.kind === "copilotConnector") {
460
+ const account = this.copilotConnectorsService.account;
461
+ return !!account && isConnectorAccountEqual(record.target, account);
462
+ }
463
+ return true;
464
+ }
465
+ toInstallationTarget(record) {
466
+ switch (record.target.kind) {
467
+ case "plugin":
468
+ return {
469
+ kind: "plugin",
470
+ uri: record.target.uri
471
+ };
472
+ case "mcp":
473
+ return {
474
+ kind: "mcp",
475
+ id: record.target.id
476
+ };
477
+ case "copilotConnector":
478
+ return {
479
+ kind: "copilotConnector",
480
+ name: record.target.name
481
+ };
482
+ }
483
+ }
484
+ async reconcileRecords(records) {
485
+ await Promise.all(records.map(record => this.reconcileRecord(record)));
486
+ }
487
+ async reconcileRecord(original) {
488
+ const version = (this.reconciliationVersions.get(original.id) ?? 0) + 1;
489
+ this.reconciliationVersions.set(original.id, version);
490
+ let record = original;
491
+ let state;
492
+ try {
493
+ if (record.target.kind === "copilotConnector") {
494
+ const target = record.target;
495
+ const connector = this.copilotConnectorsService.connectors.find(candidate => candidate.name === target.name);
496
+ state = {
497
+ kind: !this.copilotConnectorsService.connectionStateKnown || connector?.connectionStatus === "unknown" ? "checking" : connector?.connectionStatus === "connected" ? "installed" : "missing"
498
+ };
499
+ } else if (record.target.kind === "plugin") {
500
+ const target = record.target;
501
+ const installed = await this.getExistingInstalledPlugin(record);
502
+ state = {
503
+ kind: installed ? "installed" : "missing"
504
+ };
505
+ if (installed && !isEqual(installed.pluginUri, target.uri)) {
506
+ record = {
507
+ ...record,
508
+ target: {
509
+ ...target,
510
+ uri: installed.pluginUri
511
+ }
512
+ };
513
+ }
514
+ } else {
515
+ const target = record.target;
516
+ const installed = this.mcpWorkbenchService.local.find(
517
+ server => server.id === target.id && server.installState === McpServerInstallState.Installed
518
+ ) ?? (record.installation.kind === "mcpGallery" ? this.getInstalledGalleryMcpServer(record.installation) : undefined);
519
+ state = {
520
+ kind: installed ? "installed" : "missing"
521
+ };
522
+ if (installed && installed.id !== target.id) {
523
+ record = {
524
+ ...record,
525
+ target: {
526
+ kind: "mcp",
527
+ id: installed.id
528
+ }
529
+ };
530
+ }
531
+ }
532
+ } catch (error) {
533
+ this.logService.error(
534
+ `[CustomizationMarketplace] Unable to verify installation '${original.id}'`,
535
+ error
536
+ );
537
+ state = {
538
+ kind: "error",
539
+ message: ( localize(
540
+ 10685,
541
+ "Could not verify this customization installation. {0}",
542
+ getErrorMessage(error)
543
+ ))
544
+ };
545
+ }
546
+ if (this.reconciliationVersions.get(original.id) !== version || this._store.isDisposed || this.recordStore.associations.get(original.id) !== original) {
547
+ return;
548
+ }
549
+ const didUpdateRecord = record !== original;
550
+ if (didUpdateRecord) {
551
+ this.recordStore.upsert(record);
552
+ }
553
+ const previous = this.recordStates.get(record.id);
554
+ if (didUpdateRecord || !previous || previous.kind !== state.kind || previous.kind === "error" && state.kind === "error" && previous.message !== state.message) {
555
+ this.recordStates.set(record.id, state);
556
+ this.emitChange();
557
+ }
558
+ }
559
+ getSourceUnavailableMessage(sourceId) {
560
+ const source = (this.customizationMarketplaceService.allSources ?? this.customizationMarketplaceService.sources).find(candidate => candidate.id === sourceId);
561
+ if (!source) {
562
+ return localize(
563
+ 10686,
564
+ "This resource's marketplace source is no longer available, so it cannot be repaired."
565
+ );
566
+ }
567
+ return this.configurationService.getValue(source.enablementSetting) === true ? undefined : ( localize(10687, "Enable this resource's marketplace source to install it."));
568
+ }
569
+ getRepairUnavailableMessage(record) {
570
+ if (!this.configurationService.getValue(CustomizationMarketplaceConfiguration.MarketplaceEnabled)) {
571
+ return localize(10688, "Enable the customization marketplace to install this resource.");
572
+ }
573
+ const sourceUnavailableMessage = this.getSourceUnavailableMessage(this.getRecordSourceId(record));
574
+ if (sourceUnavailableMessage) {
575
+ return sourceUnavailableMessage;
576
+ }
577
+ if (this.entitlementService.sentiment.hidden) {
578
+ return localize(10689, "Enable AI features to install customizations.");
579
+ }
580
+ if ((record.installation.kind === "plugin" || record.installation.kind === "configuredPlugin") && !this.configurationService.getValue(ChatConfiguration.PluginsEnabled)) {
581
+ return localize(10690, "Enable agent plugins to install this resource.");
582
+ }
583
+ if (record.target.kind === "copilotConnector") {
584
+ const target = record.target;
585
+ const connector = this.copilotConnectorsService.connectors.find(candidate => candidate.name === target.name);
586
+ if (!connector) {
587
+ return localize(
588
+ 10691,
589
+ "This connector is no longer available from the Copilot Connectors catalog."
590
+ );
591
+ }
592
+ const presentation = getConnectorRowPresentation(connector);
593
+ if (connector.connectionStatus !== "connected" && !presentation.action) {
594
+ return localize(
595
+ 10692,
596
+ "This connector cannot be reconnected while its status is '{0}'.",
597
+ presentation.statusLabel
598
+ );
599
+ }
600
+ }
601
+ return undefined;
602
+ }
603
+ getRecordedInstallState(record, resource) {
604
+ const target = this.toInstallationTarget(record);
605
+ if (( this.pendingUninstalls.has(
606
+ record.target.kind === "copilotConnector" ? getConnectorOperationKey(resource) : record.id
607
+ ))) {
608
+ return {
609
+ kind: "uninstalling",
610
+ target
611
+ };
612
+ }
613
+ if (( this.pendingRepairs.has(record.id))) {
614
+ return {
615
+ kind: "repairing",
616
+ target
617
+ };
618
+ }
619
+ const state = this.recordStates.get(record.id) ?? {
620
+ kind: "checking"
621
+ };
622
+ if (state.kind === "error") {
623
+ return {
624
+ ...state,
625
+ target
626
+ };
627
+ }
628
+ return state.kind === "missing" ? {
629
+ kind: "missing",
630
+ target,
631
+ repairUnavailableMessage: this.getRepairUnavailableMessage(record)
632
+ } : {
633
+ kind: state.kind,
634
+ target
635
+ };
636
+ }
637
+ getInstallState(resource) {
638
+ this.rememberResource(resource);
639
+ if (resource.installation?.kind === "copilotConnector" && this.configurationService.getValue(CustomizationMarketplaceConfiguration.CopilotConnectorsEnabled) !== true) {
640
+ return {
641
+ kind: "unavailable",
642
+ message: ( localize(
643
+ 10693,
644
+ "Enable the Copilot connectors experiment to connect this resource."
645
+ ))
646
+ };
647
+ }
648
+ const providerInstallation = this.providerInstallations.find(
649
+ installation => this.matchesProviderInstallation(installation.resource, resource)
650
+ );
651
+ if (providerInstallation) {
652
+ return this.getProviderInstallState(providerInstallation);
653
+ }
654
+ const providerBinding = this.getInstallProviderBinding(resource);
655
+ const ownerAssociation = this.findRecord(resource);
656
+ if (ownerAssociation?.id.startsWith("owner:") && !this.isOwnerAssociationCurrent(resource, ownerAssociation)) {
657
+ this.removeRecord(ownerAssociation);
658
+ this.installationSnapshot = undefined;
659
+ }
660
+ const recorded = providerBinding ? undefined : this.installations.get().findByResource(resource);
661
+ if (recorded) {
662
+ return recorded.state;
663
+ }
664
+ if (!this.configurationService.getValue(CustomizationMarketplaceConfiguration.MarketplaceEnabled)) {
665
+ return {
666
+ kind: "unavailable",
667
+ message: ( localize(10688, "Enable the customization marketplace to install this resource."))
668
+ };
669
+ }
670
+ const sourceUnavailableMessage = this.getSourceUnavailableMessage(resource.sourceId);
671
+ if (sourceUnavailableMessage) {
672
+ return {
673
+ kind: "unavailable",
674
+ message: sourceUnavailableMessage
675
+ };
676
+ }
677
+ if (this.entitlementService.sentiment.hidden) {
678
+ return {
679
+ kind: "unavailable",
680
+ message: ( localize(10689, "Enable AI features to install customizations."))
681
+ };
682
+ }
683
+ const operationKey = resource.installation?.kind === "copilotConnector" ? getConnectorOperationKey(resource) : getCustomizationMarketplaceResourceKey(resource);
684
+ if (( this.pending.has(operationKey))) {
685
+ return {
686
+ kind: "installing"
687
+ };
688
+ }
689
+ const source = resource.installation;
690
+ const providerUnavailableMessage = providerBinding?.provider.getInstallUnavailableMessage?.(resource);
691
+ if (providerUnavailableMessage) {
692
+ return {
693
+ kind: "unavailable",
694
+ message: providerUnavailableMessage
695
+ };
696
+ }
697
+ if (source?.kind === "configuredPlugin") {
698
+ if (isWeb) {
699
+ return {
700
+ kind: "unavailable",
701
+ message: ( localize(
702
+ 10694,
703
+ "Installing configured marketplace plugins is not available in VS Code for the Web."
704
+ ))
705
+ };
706
+ }
707
+ if (!this.configurationService.getValue(ChatConfiguration.PluginsEnabled)) {
708
+ return {
709
+ kind: "unavailable",
710
+ message: ( localize(10690, "Enable agent plugins to install this resource."))
711
+ };
712
+ }
713
+ const installed = providerBinding ? undefined : this.pluginMarketplaceService.installedPlugins.get().find((
714
+ {
715
+ plugin
716
+ }
717
+ ) => getPluginMarketplaceIdentifier(plugin) === resource.identifier);
718
+ if (installed) {
719
+ const target = {
720
+ kind: "plugin",
721
+ uri: installed.pluginUri
722
+ };
723
+ this.associateInstalledResource(resource, target);
724
+ return {
725
+ kind: "installed",
726
+ target
727
+ };
728
+ }
729
+ return {
730
+ kind: "available"
731
+ };
732
+ }
733
+ if (!source) {
734
+ return {
735
+ kind: "unavailable",
736
+ message: resource.mediaType === CustomizationMarketplaceMediaType.CursorPlugin ? ( localize(
737
+ 10695,
738
+ "Cursor plugins cannot be installed in VS Code. Open the resource to view its installation instructions."
739
+ )) : ( localize(10696, "This resource does not provide a supported installation source."))
740
+ };
741
+ }
742
+ if (source.kind === "skill" || source.kind === "mcp" || source.kind === "plugin" || source.kind === "providerPlugin" || source.kind === "providerCatalog") {
743
+ if ((source.kind === "plugin" || source.kind === "providerPlugin") && !this.configurationService.getValue(ChatConfiguration.PluginsEnabled)) {
744
+ return {
745
+ kind: "unavailable",
746
+ message: ( localize(10690, "Enable agent plugins to install this resource."))
747
+ };
748
+ }
749
+ return providerBinding ? {
750
+ kind: "available"
751
+ } : {
752
+ kind: "unavailable",
753
+ message: ( localize(10697, "The active agent cannot install this catalog resource."))
754
+ };
755
+ }
756
+ if (source.kind === "copilotConnector") {
757
+ const target = {
758
+ kind: "copilotConnector",
759
+ name: source.name
760
+ };
761
+ if (( this.pendingUninstalls.has(operationKey))) {
762
+ return {
763
+ kind: "uninstalling",
764
+ target
765
+ };
766
+ }
767
+ if (this.configurationService.getValue(CustomizationMarketplaceConfiguration.CopilotConnectorsEnabled) !== true) {
768
+ return {
769
+ kind: "unavailable",
770
+ message: ( localize(
771
+ 10693,
772
+ "Enable the Copilot connectors experiment to connect this resource."
773
+ ))
774
+ };
775
+ }
776
+ const connector = this.copilotConnectorsService.connectors.find(connector => connector.name === source.name);
777
+ if (!connector) {
778
+ return {
779
+ kind: "unavailable",
780
+ message: ( localize(
781
+ 10698,
782
+ "This connector is no longer available. Refresh Discover and try again."
783
+ ))
784
+ };
785
+ }
786
+ if (connector.connectionStatus === "connected") {
787
+ return {
788
+ kind: "installed",
789
+ target
790
+ };
791
+ }
792
+ const presentation = getConnectorRowPresentation(connector);
793
+ return presentation.action ? {
794
+ kind: "available"
795
+ } : {
796
+ kind: "unavailable",
797
+ message: ( localize(
798
+ 10699,
799
+ "This connector cannot be connected while its status is '{0}'. Refresh and try again.",
800
+ presentation.statusLabel
801
+ ))
802
+ };
803
+ }
804
+ if (source.kind === "mcpGallery") {
805
+ if (!this.isMcpGallerySourceCurrent(source)) {
806
+ return {
807
+ kind: "unavailable",
808
+ message: ( localize(
809
+ 10700,
810
+ "The MCP registry changed after '{0}' was discovered. Refresh Discover and try again.",
811
+ source.name
812
+ ))
813
+ };
814
+ }
815
+ const installed = this.getInstalledGalleryMcpServer(source);
816
+ if (installed) {
817
+ const target = {
818
+ kind: "mcp",
819
+ id: installed.id
820
+ };
821
+ this.associateInstalledResource(resource, target);
822
+ return {
823
+ kind: "installed",
824
+ target
825
+ };
826
+ }
827
+ return {
828
+ kind: "available"
829
+ };
830
+ }
831
+ return {
832
+ kind: "available"
833
+ };
834
+ }
835
+ isOwnerAssociationCurrent(resource, association) {
836
+ const source = resource.installation;
837
+ if (association.target.kind === "plugin") {
838
+ return source?.kind === "configuredPlugin" && ( this.pluginMarketplaceService.installedPlugins.get().some((
839
+ {
840
+ plugin
841
+ }
842
+ ) => getPluginMarketplaceIdentifier(plugin) === resource.identifier));
843
+ }
844
+ if (association.target.kind === "mcp") {
845
+ return source?.kind === "mcpGallery" && !!this.getInstalledGalleryMcpServer(source);
846
+ }
847
+ return true;
848
+ }
849
+ getProviderInstallState(installation) {
850
+ const key = installation.installationId ?? getCustomizationMarketplaceResourceKey(installation.resource);
851
+ if (( this.pendingUninstalls.has(key))) {
852
+ return {
853
+ kind: "uninstalling",
854
+ target: installation.state.target
855
+ };
856
+ }
857
+ if (( this.pendingRepairs.has(key))) {
858
+ return {
859
+ kind: "repairing",
860
+ target: installation.state.target
861
+ };
862
+ }
863
+ return installation.state;
864
+ }
865
+ getInstallProviderBinding(resource) {
866
+ const binding = this.providerBinding;
867
+ const provider = binding?.provider;
868
+ const kind = resource.installation?.kind;
869
+ return binding && provider && (kind === "skill" || kind === "mcp" || kind === "plugin" || kind === "configuredPlugin" || kind === "providerPlugin" || kind === "providerCatalog" || ( this.providerInstallations.some(
870
+ installation => this.matchesProviderInstallation(installation.resource, resource)
871
+ ))) ? binding : undefined;
872
+ }
873
+ isProviderManagedInstallation(installation) {
874
+ return !!this.providerBinding && (installation.kind === "skill" || installation.kind === "mcp" || installation.kind === "plugin" || installation.kind === "configuredPlugin" || installation.kind === "providerPlugin" || installation.kind === "providerCatalog");
875
+ }
876
+ associateInstalledResource(resource, target) {
877
+ if (!resource.installation) {
878
+ return;
879
+ }
880
+ const id = `owner:${getCustomizationMarketplaceResourceKey(resource)}`;
881
+ if (( this.recordStore.associations.has(id))) {
882
+ return;
883
+ }
884
+ this.recordStore.upsert({
885
+ id,
886
+ sourceId: resource.sourceId,
887
+ identifier: resource.identifier,
888
+ version: resource.version,
889
+ displayName: resource.displayName,
890
+ description: resource.description,
891
+ mediaType: resource.mediaType,
892
+ installation: resource.installation,
893
+ icon: resource.icon,
894
+ target
895
+ });
896
+ this.installationSnapshot = undefined;
897
+ this.recordStates.set(id, {
898
+ kind: "installed"
899
+ });
900
+ if (!this.providerChangeScheduled) {
901
+ this.providerChangeScheduled = true;
902
+ queueMicrotask(() => {
903
+ this.providerChangeScheduled = false;
904
+ if (!this._store.isDisposed) {
905
+ this.emitChange();
906
+ }
907
+ });
908
+ }
909
+ }
910
+ async install(resource) {
911
+ const state = this.getInstallState(resource);
912
+ if (state.kind === "unavailable") {
913
+ throw ( new Error(state.message));
914
+ }
915
+ const key = resource.installation?.kind === "copilotConnector" ? getConnectorOperationKey(resource) : getCustomizationMarketplaceResourceKey(resource);
916
+ const pending = this.pending.get(key);
917
+ if (pending) {
918
+ return pending.promise;
919
+ }
920
+ if (state.kind !== "available") {
921
+ return;
922
+ }
923
+ const connector = resource.installation?.kind === "copilotConnector" ? resource.installation : undefined;
924
+ const providerBinding = this.getInstallProviderBinding(resource);
925
+ const operationDisposables = ( new DisposableStore());
926
+ const token = cancelOnDispose(operationDisposables);
927
+ const requiresMarketplaceTrust = resource.installation?.kind === "configuredPlugin" || resource.installation?.kind === "providerPlugin";
928
+ operationDisposables.add(
929
+ this.lifetimeToken.onCancellationRequested(() => operationDisposables.dispose())
930
+ );
931
+ if (requiresMarketplaceTrust) {
932
+ operationDisposables.add(
933
+ this.pluginMarketplaceService.onDidChangeMarketplaces(() => operationDisposables.dispose())
934
+ );
935
+ }
936
+ operationDisposables.add(this.configurationService.onDidChangeConfiguration(event => {
937
+ if (!this.isSourceEnabled(resource.sourceId) || (requiresMarketplaceTrust && (event.affectsConfiguration(ChatConfiguration.StrictMarketplaces))) || (resource.installation?.kind === "mcpGallery" && resource.installation.registry === "custom" && event.affectsConfiguration(mcpGalleryServiceUrlConfig))) {
938
+ operationDisposables.dispose();
939
+ }
940
+ }));
941
+ const operation = runCustomizationMarketplaceInstallWithTelemetry(
942
+ this.telemetryService,
943
+ getCustomizationMarketplaceInstallTelemetryContext("marketplace", resource.installation),
944
+ async () => {
945
+ if (providerBinding) {
946
+ if (resource.installation?.kind === "configuredPlugin" || resource.installation?.kind === "providerPlugin") {
947
+ const marketplaceReference = resource.installation.kind === "configuredPlugin" ? (await this.resolveConfiguredPlugin(resource, token)).marketplaceReference : this.resolveProviderPluginMarketplaceReference(resource);
948
+ if (!(await this.pluginInstallService.ensureMarketplaceTrusted(marketplaceReference, token))) {
949
+ throw ( new CancellationError());
950
+ }
951
+ }
952
+ await providerBinding.provider.install(providerBinding.session, resource, token);
953
+ if (providerBinding === this.providerBinding) {
954
+ await this.refreshProviderInstallations(providerBinding);
955
+ }
956
+ return;
957
+ }
958
+ if (!connector) {
959
+ const record = await this.doInstall(resource, token);
960
+ await this.addRecord(record);
961
+ return;
962
+ }
963
+ await this.runConnectorOperation(
964
+ resource.sourceId,
965
+ operationToken => this.copilotConnectorsService.connect(connector.name, operationToken),
966
+ token
967
+ );
968
+ const account = this.copilotConnectorsService.account;
969
+ if (!account) {
970
+ throw ( new Error(( localize(
971
+ 10701,
972
+ "The GitHub account used to connect this resource is no longer available."
973
+ ))));
974
+ }
975
+ await this.addRecord(await this.createConnectorRecord(resource, account));
976
+ },
977
+ token
978
+ );
979
+ this.pending.set(key, {
980
+ promise: operation,
981
+ cancel: () => operationDisposables.dispose()
982
+ });
983
+ this.emitChange();
984
+ let didComplete = false;
985
+ try {
986
+ await operation;
987
+ didComplete = true;
988
+ } catch (error) {
989
+ if (token.isCancellationRequested || this.lifetimeToken.isCancellationRequested || !this.isSourceEnabled(resource.sourceId)) {
990
+ throw ( new CancellationError());
991
+ }
992
+ throw error;
993
+ } finally {
994
+ operationDisposables.dispose();
995
+ this.pending.delete(key);
996
+ if (!didComplete) {
997
+ this.emitChange();
998
+ }
999
+ }
1000
+ }
1001
+ async repair(resource) {
1002
+ const providerBinding = this.getInstallProviderBinding(resource);
1003
+ const providerInstallation = providerBinding ? this.providerInstallations.find(
1004
+ installation => this.matchesProviderInstallation(installation.resource, resource)
1005
+ ) : undefined;
1006
+ if (providerBinding && providerInstallation) {
1007
+ if (providerInstallation.state.kind !== "missing" && providerInstallation.state.kind !== "error") {
1008
+ return;
1009
+ }
1010
+ const key = providerInstallation.installationId ?? getCustomizationMarketplaceResourceKey(providerInstallation.resource);
1011
+ const pending = this.pendingRepairs.get(key);
1012
+ if (pending) {
1013
+ return pending.promise;
1014
+ }
1015
+ const operationDisposables = ( new DisposableStore());
1016
+ const token = cancelOnDispose(operationDisposables);
1017
+ const operation = (async () => {
1018
+ await providerBinding.provider.repair(providerBinding.session, providerInstallation, token);
1019
+ if (providerBinding === this.providerBinding) {
1020
+ await this.refreshProviderInstallations(providerBinding);
1021
+ }
1022
+ })();
1023
+ this.pendingRepairs.set(key, {
1024
+ promise: operation,
1025
+ cancel: () => operationDisposables.dispose()
1026
+ });
1027
+ this.emitChange();
1028
+ try {
1029
+ await operation;
1030
+ } finally {
1031
+ operationDisposables.dispose();
1032
+ this.pendingRepairs.delete(key);
1033
+ this.emitChange();
1034
+ }
1035
+ return;
1036
+ }
1037
+ if (providerBinding) {
1038
+ return;
1039
+ }
1040
+ const record = this.findRecord(resource);
1041
+ if (!record || this.recordStates.get(record.id)?.kind !== "missing") {
1042
+ return;
1043
+ }
1044
+ const unavailableMessage = this.getRepairUnavailableMessage(record);
1045
+ if (unavailableMessage) {
1046
+ throw ( new Error(unavailableMessage));
1047
+ }
1048
+ const pending = this.pendingRepairs.get(record.id);
1049
+ if (pending) {
1050
+ return pending.promise;
1051
+ }
1052
+ const operationDisposables = ( new DisposableStore());
1053
+ const token = cancelOnDispose(operationDisposables);
1054
+ operationDisposables.add(
1055
+ this.lifetimeToken.onCancellationRequested(() => operationDisposables.dispose())
1056
+ );
1057
+ operationDisposables.add(this.configurationService.onDidChangeConfiguration(() => {
1058
+ if (!this.isSourceEnabled(this.getRecordSourceId(record))) {
1059
+ operationDisposables.dispose();
1060
+ }
1061
+ }));
1062
+ const operation = (async () => {
1063
+ const repaired = await this.doRepair(resource, record, token);
1064
+ this.recordStore.upsert(repaired);
1065
+ this.recordStates.set(record.id, {
1066
+ kind: "checking"
1067
+ });
1068
+ await this.reconcileRecords([repaired]);
1069
+ if (this.recordStates.get(record.id)?.kind !== "installed") {
1070
+ throw ( new Error(record.target.kind === "copilotConnector" ? ( localize(
1071
+ 10702,
1072
+ "The connector could not be reconnected. Refresh its status and try again."
1073
+ )) : ( localize(
1074
+ 10703,
1075
+ "The customization could not be fully repaired. Review the installation and try again."
1076
+ ))));
1077
+ }
1078
+ })();
1079
+ this.pendingRepairs.set(record.id, {
1080
+ promise: operation,
1081
+ cancel: () => operationDisposables.dispose()
1082
+ });
1083
+ this.emitChange();
1084
+ try {
1085
+ await operation;
1086
+ } catch (error) {
1087
+ if (token.isCancellationRequested || this.lifetimeToken.isCancellationRequested || !this.isSourceEnabled(this.getRecordSourceId(record))) {
1088
+ throw ( new CancellationError());
1089
+ }
1090
+ throw error;
1091
+ } finally {
1092
+ operationDisposables.dispose();
1093
+ this.pendingRepairs.delete(record.id);
1094
+ this.emitChange();
1095
+ }
1096
+ }
1097
+ cancelConnectorOperation(resource) {
1098
+ if (resource.installation?.kind !== "copilotConnector") {
1099
+ return;
1100
+ }
1101
+ this.pending.get(getConnectorOperationKey(resource))?.cancel();
1102
+ const record = this.findRecord(resource);
1103
+ if (record) {
1104
+ this.pendingRepairs.get(record.id)?.cancel();
1105
+ }
1106
+ }
1107
+ async uninstall(resource) {
1108
+ const providerBinding = this.getInstallProviderBinding(resource);
1109
+ const providerInstallation = providerBinding ? this.providerInstallations.find(
1110
+ installation => this.matchesProviderInstallation(installation.resource, resource)
1111
+ ) : undefined;
1112
+ if (providerBinding && providerInstallation) {
1113
+ const key = providerInstallation.installationId ?? getCustomizationMarketplaceResourceKey(providerInstallation.resource);
1114
+ const pending = this.pendingUninstalls.get(key);
1115
+ if (pending) {
1116
+ return pending;
1117
+ }
1118
+ const operationDisposables = ( new DisposableStore());
1119
+ const token = cancelOnDispose(operationDisposables);
1120
+ const operation = (async () => {
1121
+ await providerBinding.provider.uninstall(providerBinding.session, providerInstallation, token);
1122
+ if (providerBinding === this.providerBinding) {
1123
+ await this.refreshProviderInstallations(providerBinding);
1124
+ }
1125
+ })();
1126
+ this.pendingUninstalls.set(key, operation);
1127
+ this.emitChange();
1128
+ try {
1129
+ await operation;
1130
+ } finally {
1131
+ operationDisposables.dispose();
1132
+ this.pendingUninstalls.delete(key);
1133
+ this.emitChange();
1134
+ }
1135
+ return;
1136
+ }
1137
+ if (providerBinding) {
1138
+ return;
1139
+ }
1140
+ const connector = resource.installation?.kind === "copilotConnector" ? resource.installation : undefined;
1141
+ if (connector) {
1142
+ const record = this.findRecord(resource);
1143
+ const key = getConnectorOperationKey(resource);
1144
+ const pending = this.pendingUninstalls.get(key);
1145
+ if (pending) {
1146
+ return pending;
1147
+ }
1148
+ const state = this.getInstallState(resource);
1149
+ if (state.kind === "unavailable") {
1150
+ throw ( new Error(state.message));
1151
+ }
1152
+ if (state.kind !== "installed" && state.kind !== "missing" && state.kind !== "error") {
1153
+ return;
1154
+ }
1155
+ if (record && this.copilotConnectorsService.connectionStateKnown && !( this.copilotConnectorsService.connectors.some(candidate => candidate.name === connector.name))) {
1156
+ this.removeRecord(record);
1157
+ this.emitChange();
1158
+ return;
1159
+ }
1160
+ const operation = (async () => {
1161
+ try {
1162
+ await this.runConnectorOperation(
1163
+ resource.sourceId,
1164
+ token => this.copilotConnectorsService.disconnect(connector.name, token),
1165
+ this.lifetimeToken
1166
+ );
1167
+ if (record && ( this.recordStore.associations.has(record.id))) {
1168
+ this.removeRecord(record);
1169
+ this.emitChange();
1170
+ }
1171
+ } catch (error) {
1172
+ if (!record || !(error instanceof CopilotConnectorsError) || error.statusCode !== 404) {
1173
+ throw error;
1174
+ }
1175
+ this.removeRecord(record);
1176
+ this.emitChange();
1177
+ }
1178
+ })();
1179
+ this.pendingUninstalls.set(key, operation);
1180
+ this.emitChange();
1181
+ try {
1182
+ await operation;
1183
+ } finally {
1184
+ this.pendingUninstalls.delete(key);
1185
+ this.emitChange();
1186
+ }
1187
+ return;
1188
+ }
1189
+ const record = this.findRecord(resource);
1190
+ if (!record) {
1191
+ return;
1192
+ }
1193
+ const state = this.recordStates.get(record.id) ?? {
1194
+ kind: "checking"
1195
+ };
1196
+ const pending = this.pendingUninstalls.get(record.id);
1197
+ if (pending) {
1198
+ return pending;
1199
+ }
1200
+ if (state.kind !== "checking" && state.kind !== "installed" && state.kind !== "missing" && state.kind !== "error") {
1201
+ return;
1202
+ }
1203
+ const operation = (async () => {
1204
+ await this.doUninstall(record);
1205
+ this.removeRecord(record);
1206
+ })();
1207
+ this.pendingUninstalls.set(record.id, operation);
1208
+ this.emitChange();
1209
+ try {
1210
+ await operation;
1211
+ } finally {
1212
+ this.pendingUninstalls.delete(record.id);
1213
+ this.emitChange();
1214
+ }
1215
+ }
1216
+ async doUninstall(record) {
1217
+ const source = record.installation;
1218
+ if (source.kind === "mcpGallery") {
1219
+ const targetId = record.target.kind === "mcp" ? record.target.id : undefined;
1220
+ const server = this.mcpWorkbenchService.local.find(candidate => candidate.id === targetId) ?? this.getInstalledGalleryMcpServer(source);
1221
+ if (server) {
1222
+ await this.mcpWorkbenchService.uninstall(server);
1223
+ }
1224
+ return;
1225
+ }
1226
+ if (source.kind === "configuredPlugin") {
1227
+ const targetUri = record.target.kind === "plugin" ? record.target.uri : undefined;
1228
+ const installed = (targetUri ? this.pluginMarketplaceService.installedPlugins.get().find(candidate => isEqual(candidate.pluginUri, targetUri)) : undefined) ?? this.getInstalledPlugin(record);
1229
+ if (!installed) {
1230
+ return;
1231
+ }
1232
+ const plugin = this.agentPluginService.plugins.get().find(candidate => isEqual(candidate.uri, installed.pluginUri));
1233
+ if (plugin?.remove) {
1234
+ if (!(await plugin.remove())) {
1235
+ throw ( new CancellationError());
1236
+ }
1237
+ return;
1238
+ }
1239
+ this.agentPluginService.enablementModel.remove(( installed.pluginUri.toString()));
1240
+ await this.pluginInstallService.uninstallPlugin(installed.pluginUri);
1241
+ return;
1242
+ }
1243
+ }
1244
+ async runConnectorOperation(sourceId, operation, token) {
1245
+ this.checkEnabled(sourceId, token);
1246
+ const operationDisposables = ( new DisposableStore());
1247
+ const cancellation = operationDisposables.add(( new CancellationTokenSource(token)));
1248
+ operationDisposables.add(this.entitlementService.onDidChangeSentiment(() => {
1249
+ if (this.entitlementService.sentiment.hidden) {
1250
+ cancellation.cancel();
1251
+ }
1252
+ }));
1253
+ operationDisposables.add(this.configurationService.onDidChangeConfiguration(() => {
1254
+ if (!this.isSourceEnabled(sourceId)) {
1255
+ cancellation.cancel();
1256
+ }
1257
+ }));
1258
+ try {
1259
+ await operation(cancellation.token);
1260
+ this.checkEnabled(sourceId, cancellation.token);
1261
+ } finally {
1262
+ operationDisposables.dispose();
1263
+ }
1264
+ }
1265
+ async doInstall(resource, token) {
1266
+ this.checkEnabled(resource.sourceId, token);
1267
+ const source = resource.installation;
1268
+ if (!source) {
1269
+ throw ( new Error(( localize(10696, "This resource does not provide a supported installation source."))));
1270
+ }
1271
+ if (source.kind === "copilotConnector") {
1272
+ throw ( new Error(( localize(10704, "Copilot connectors do not have a local installation target."))));
1273
+ }
1274
+ if (source.kind === "providerCatalog") {
1275
+ throw ( new Error(( localize(10697, "The active agent cannot install this catalog resource."))));
1276
+ }
1277
+ const target = await this.installTarget({
1278
+ ...resource,
1279
+ installation: source
1280
+ }, token);
1281
+ return {
1282
+ id: await createInstallationRecordId([getCustomizationMarketplaceResourceKey(resource)]),
1283
+ sourceId: resource.sourceId,
1284
+ identifier: resource.identifier,
1285
+ version: resource.version,
1286
+ displayName: resource.displayName,
1287
+ description: resource.description,
1288
+ mediaType: resource.mediaType,
1289
+ icon: resource.icon,
1290
+ installation: source,
1291
+ target
1292
+ };
1293
+ }
1294
+ async doRepair(resource, record, token) {
1295
+ const sourceId = this.getRecordSourceId(record);
1296
+ this.checkEnabled(sourceId, token);
1297
+ if (record.target.kind === "copilotConnector" && record.installation.kind === "copilotConnector") {
1298
+ const target = record.target;
1299
+ await this.runConnectorOperation(
1300
+ sourceId,
1301
+ operationToken => this.copilotConnectorsService.connect(target.name, operationToken),
1302
+ token
1303
+ );
1304
+ return record;
1305
+ }
1306
+ const target = await this.installTarget({
1307
+ ...resource,
1308
+ sourceId,
1309
+ identifier: record.identifier,
1310
+ version: record.version,
1311
+ installation: record.installation
1312
+ }, token);
1313
+ return {
1314
+ ...record,
1315
+ target
1316
+ };
1317
+ }
1318
+ async resolveConfiguredPlugin(resource, token) {
1319
+ const source = resource.installation;
1320
+ if (source?.kind !== "configuredPlugin") {
1321
+ throw ( new Error(( localize(10705, "This plugin does not provide configured marketplace identity."))));
1322
+ }
1323
+ const discoveredReference = source.marketplaceSource ? parseMarketplaceReference(source.marketplaceSource) : undefined;
1324
+ if (source.marketplaceId && (!discoveredReference || discoveredReference.canonicalId !== source.marketplaceId)) {
1325
+ throw ( new Error(( localize(
1326
+ 10706,
1327
+ "This plugin's marketplace identity changed after discovery. Refresh Discover and try again."
1328
+ ))));
1329
+ }
1330
+ const currentReference = source.marketplaceId ? this.pluginMarketplaceService.getMarketplaceReferences().find(reference => reference.canonicalId === source.marketplaceId) : undefined;
1331
+ if (source.marketplaceId && !currentReference) {
1332
+ if (discoveredReference && this.pluginMarketplaceService.isStrictMarketplacePolicyActive() && !(await this.pluginInstallService.ensureMarketplaceTrusted(discoveredReference, token))) {
1333
+ throw ( new CancellationError());
1334
+ }
1335
+ throw ( new Error(( localize(
1336
+ 10707,
1337
+ "This plugin is no longer available from a configured marketplace. Refresh Discover and try again."
1338
+ ))));
1339
+ }
1340
+ const marketplaceIds = source.marketplaceId ? ( new Set([source.marketplaceId])) : undefined;
1341
+ const plugins = await this.pluginMarketplaceService.fetchMarketplacePlugins(token, marketplaceIds);
1342
+ this.checkEnabled(resource.sourceId, token);
1343
+ const plugin = plugins.find(plugin => getPluginMarketplaceIdentifier(plugin) === resource.identifier);
1344
+ if (!plugin || source.name && plugin.name !== source.name || source.marketplace && plugin.marketplaceName !== source.marketplace) {
1345
+ throw ( new Error(( localize(
1346
+ 10707,
1347
+ "This plugin is no longer available from a configured marketplace. Refresh Discover and try again."
1348
+ ))));
1349
+ }
1350
+ return plugin;
1351
+ }
1352
+ resolveProviderPluginMarketplaceReference(resource) {
1353
+ const source = resource.installation;
1354
+ if (source?.kind !== "providerPlugin" || !source.marketplaceSource) {
1355
+ throw ( new Error(( localize(10708, "This plugin does not provide provider marketplace identity."))));
1356
+ }
1357
+ const directReference = parseMarketplaceReference(source.marketplaceSource);
1358
+ const githubSource = /^GitHub:\s+(?<source>.+)$/.exec(source.marketplaceSource)?.groups?.source;
1359
+ const marketplaceReference = directReference ?? (githubSource ? parseMarketplaceReference(githubSource) : undefined);
1360
+ if (!marketplaceReference) {
1361
+ throw ( new Error(( localize(
1362
+ 10709,
1363
+ "This featured plugin is no longer available from a registered marketplace. Refresh Discover and try again."
1364
+ ))));
1365
+ }
1366
+ return marketplaceReference;
1367
+ }
1368
+ async installTarget(resource, token) {
1369
+ const source = resource.installation;
1370
+ if (!source) {
1371
+ throw ( new Error(( localize(10696, "This resource does not provide a supported installation source."))));
1372
+ }
1373
+ if (source.kind === "configuredPlugin") {
1374
+ const plugin = await this.resolveConfiguredPlugin(resource, token);
1375
+ await this.pluginInstallService.installPlugin(plugin, token);
1376
+ this.checkEnabled(resource.sourceId, token);
1377
+ const uri = this.pluginInstallService.getPluginInstallUri(plugin);
1378
+ if (!( this.pluginMarketplaceService.installedPlugins.get().some(candidate => isEqual(candidate.pluginUri, uri)))) {
1379
+ throw ( new Error(( localize(
1380
+ 10710,
1381
+ "The plugin could not be installed. Review the installation error and try again."
1382
+ ))));
1383
+ }
1384
+ return {
1385
+ kind: "plugin",
1386
+ uri
1387
+ };
1388
+ }
1389
+ if (source.kind === "mcpGallery") {
1390
+ const manifest = await this.getMcpGalleryManifest(source);
1391
+ this.checkEnabled(resource.sourceId, token);
1392
+ const server = await this.mcpWorkbenchService.getMcpServerFromGallery(source.name, manifest);
1393
+ this.checkEnabled(resource.sourceId, token);
1394
+ if (!server || server.gallery?.name !== source.name || normalizeMcpGalleryUrl(server.gallery.galleryUrl) !== normalizeMcpGalleryUrl(source.registryUrl)) {
1395
+ throw ( new Error(( localize(
1396
+ 10711,
1397
+ "The MCP server '{0}' is not available in the configured registry.",
1398
+ source.name
1399
+ ))));
1400
+ }
1401
+ const canInstall = this.mcpWorkbenchService.canInstall(server);
1402
+ if (canInstall !== true) {
1403
+ throw ( new Error(canInstall.value));
1404
+ }
1405
+ const installed = await this.mcpWorkbenchService.install(server);
1406
+ if (installed.installState !== McpServerInstallState.Installed) {
1407
+ throw ( new Error(( localize(
1408
+ 10712,
1409
+ "The MCP server could not be installed. Review the installation error and try again."
1410
+ ))));
1411
+ }
1412
+ return {
1413
+ kind: "mcp",
1414
+ id: installed.id
1415
+ };
1416
+ }
1417
+ if (source.kind === "copilotConnector") {
1418
+ throw ( new Error(( localize(10704, "Copilot connectors do not have a local installation target."))));
1419
+ }
1420
+ throw ( new Error(( localize(10697, "The active agent cannot install this catalog resource."))));
1421
+ }
1422
+ async getMcpGalleryManifest(source) {
1423
+ const manifest = source.registry === "default" ? (await this.mcpGalleryManifestService.getDefaultMcpGalleryManifest()) ?? (await this.mcpGalleryManifestService.getMcpGalleryManifest()) : await this.mcpGalleryManifestService.getMcpGalleryManifest();
1424
+ const sourceRegistryUrl = normalizeMcpGalleryUrl(source.registryUrl);
1425
+ const configuredRegistryUrl = source.registry === "custom" ? normalizeMcpGalleryUrl(this.configurationService.getValue(mcpGalleryServiceUrlConfig)) : sourceRegistryUrl;
1426
+ if (!manifest || !sourceRegistryUrl || normalizeMcpGalleryUrl(manifest.url) !== sourceRegistryUrl || configuredRegistryUrl !== sourceRegistryUrl) {
1427
+ throw ( new Error(( localize(
1428
+ 10700,
1429
+ "The MCP registry changed after '{0}' was discovered. Refresh Discover and try again.",
1430
+ source.name
1431
+ ))));
1432
+ }
1433
+ return manifest;
1434
+ }
1435
+ async getExistingInstalledPlugin(record) {
1436
+ const target = record.target;
1437
+ const recorded = target.kind === "plugin" ? this.pluginMarketplaceService.installedPlugins.get().find(candidate => isEqual(candidate.pluginUri, target.uri)) : undefined;
1438
+ const candidates = recorded ? [
1439
+ recorded,
1440
+ ...this.getInstalledPlugins(record).filter(candidate => !isEqual(candidate.pluginUri, recorded.pluginUri))
1441
+ ] : this.getInstalledPlugins(record);
1442
+ for (const candidate of candidates) {
1443
+ try {
1444
+ if ((await this.fileService.resolve(candidate.pluginUri)).isDirectory) {
1445
+ return candidate;
1446
+ }
1447
+ } catch (error) {
1448
+ if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
1449
+ throw error;
1450
+ }
1451
+ }
1452
+ }
1453
+ return undefined;
1454
+ }
1455
+ getInstalledPlugin(record) {
1456
+ return this.getInstalledPlugins(record)[0];
1457
+ }
1458
+ getInstalledPlugins(record) {
1459
+ const source = record.installation;
1460
+ return source.kind === "configuredPlugin" ? this.pluginMarketplaceService.installedPlugins.get().filter((
1461
+ {
1462
+ plugin
1463
+ }
1464
+ ) => getPluginMarketplaceIdentifier(plugin) === record.identifier) : [];
1465
+ }
1466
+ checkEnabled(sourceId, token) {
1467
+ if (token.isCancellationRequested || this.lifetimeToken.isCancellationRequested || !this.isSourceEnabled(sourceId) || this.entitlementService.sentiment.hidden) {
1468
+ throw ( new CancellationError());
1469
+ }
1470
+ }
1471
+ };
1472
+ CustomizationMarketplaceInstallService = ( __decorate([( __param(0, IPluginInstallService)), ( __param(1, IPluginMarketplaceService)), ( __param(2, IAgentPluginService)), ( __param(3, IMcpWorkbenchService)), ( __param(4, ICopilotConnectorsService)), ( __param(5, IMcpGalleryManifestService)), ( __param(6, ICustomizationHarnessService)), ( __param(7, IChatEntitlementService)), ( __param(8, ICustomizationMarketplaceService)), ( __param(9, IConfigurationService)), ( __param(10, IFileService)), ( __param(11, ILogService)), ( __param(12, ITelemetryService)), ( __param(13, IStorageService))], CustomizationMarketplaceInstallService));
1473
+ function isConnectorAccountEqual(target, account) {
1474
+ return target.providerId === account.providerId && target.accountName === account.accountName && target.enterprise === account.enterprise;
1475
+ }
1476
+ function getConnectorOperationKey(resource) {
1477
+ const connectorName = resource.installation?.kind === "copilotConnector" ? resource.installation.name : resource.identifier;
1478
+ return JSON.stringify([resource.sourceId, "copilotConnector", connectorName]);
1479
+ }
1480
+ async function createInstallationRecordId(slot) {
1481
+ const digest = await crypto.subtle.digest("SHA-256", ( new TextEncoder()).encode(JSON.stringify(slot)));
1482
+ return [...( new Uint8Array(digest))].map(value => ( value.toString(16)).padStart(2, "0")).join("");
1483
+ }
1484
+
1485
+ export { CustomizationMarketplaceInstallService };