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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (459) hide show
  1. package/index.js +26 -5
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +1 -1
  4. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1 -1
  5. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +74 -0
  6. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +90 -0
  7. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.d.ts +8 -0
  8. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.js +16 -0
  9. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +53 -53
  10. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +16 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +14 -0
  12. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +7 -7
  13. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.d.ts +24 -0
  14. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.js +13 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +22 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +21 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.d.ts +114 -0
  18. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +56 -0
  19. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +15 -1
  20. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.d.ts +73 -0
  21. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +141 -0
  22. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +42 -1
  23. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.d.ts +27 -0
  24. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.js +14 -0
  25. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.d.ts +14 -0
  26. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.js +11 -0
  27. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +13 -13
  28. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +1 -1
  29. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -1
  30. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.d.ts +4 -0
  31. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.js +6 -0
  32. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  33. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +104 -0
  34. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +827 -0
  35. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +15 -0
  36. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +71 -0
  37. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +16 -0
  38. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +95 -0
  39. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +22 -0
  40. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +286 -0
  41. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +10 -0
  42. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +38 -0
  43. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
  44. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
  45. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +130 -0
  46. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +907 -0
  47. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +10 -0
  48. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +28 -0
  49. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +27 -0
  50. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +167 -0
  51. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +46 -0
  52. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +356 -0
  53. package/vscode/src/vs/workbench/browser/chatChangesPill.js +2 -2
  54. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +28 -28
  55. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  56. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +18 -18
  57. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +4 -4
  58. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  59. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  60. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
  61. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  62. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  63. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  64. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  65. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  66. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  67. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +28 -28
  68. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +18 -18
  70. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  71. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +93 -93
  72. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  74. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  75. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  76. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +7 -7
  77. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  78. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
  79. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  80. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  81. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  82. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  83. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
  84. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +16 -16
  85. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  86. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
  87. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  88. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  89. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
  90. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +10 -10
  91. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +5 -5
  92. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  93. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +3 -3
  94. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  95. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +2 -2
  96. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -1
  97. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +14 -14
  98. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -16
  99. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +34 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +229 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +57 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +460 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +1 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.d.ts +1 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +92 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +1 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.d.ts +23 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.js +46 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.d.ts +142 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +746 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +77 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +474 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.d.ts +169 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.js +261 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +20 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +90 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +35 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +73 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.d.ts +20 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +61 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +112 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +192 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +1 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +6 -6
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +21 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +137 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +301 -12
  128. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +84 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.js +96 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +884 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +5870 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +19 -19
  133. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.d.ts +27 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +129 -0
  135. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +42 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +221 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +125 -0
  138. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +345 -0
  139. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +1 -1
  140. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.d.ts +1 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +68 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.d.ts +62 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +163 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.d.ts +54 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +219 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.d.ts +10 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.js +50 -0
  148. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.d.ts +42 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +132 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.d.ts +1 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +85 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +79 -0
  153. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +161 -0
  154. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.d.ts +18 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +13 -0
  156. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.d.ts +28 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.js +71 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +35 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +205 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +1 -1
  161. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +1 -1
  162. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +51 -51
  163. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +1 -1
  164. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +4 -4
  165. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +1 -1
  166. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -1
  167. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  168. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +1 -1
  169. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -5
  170. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +1 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +2 -2
  172. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -5
  173. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +23 -23
  174. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  175. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  176. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +6 -6
  177. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +2 -2
  178. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +7 -7
  179. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
  180. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -15
  181. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +1 -1
  182. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +1 -1
  183. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -3
  184. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +126 -126
  185. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +44 -44
  186. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +138 -138
  187. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +3 -3
  188. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +1 -1
  189. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +6 -6
  190. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +37 -37
  191. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +1 -1
  193. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -1
  194. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +1 -1
  196. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +6 -6
  197. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +146 -146
  198. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +29 -29
  199. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +9 -9
  200. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +1 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +40 -40
  202. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  203. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +8 -8
  204. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +5 -5
  205. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +76 -76
  206. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -1
  207. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +116 -116
  208. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +1 -1
  209. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +4 -4
  210. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +50 -50
  211. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +2 -2
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +356 -356
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +38 -38
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +5 -5
  216. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +1 -1
  217. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  218. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +1 -1
  219. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
  220. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  221. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +1 -1
  222. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  223. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  224. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
  225. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
  226. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  227. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +1 -1
  228. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +8 -8
  229. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  230. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  231. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  233. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  234. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +1 -1
  235. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +18 -18
  236. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +1 -1
  237. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  238. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +1 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  240. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +1 -1
  241. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  242. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +36 -36
  243. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +1 -1
  244. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  245. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +40 -40
  246. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  247. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  248. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  249. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  250. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  251. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  252. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  253. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
  254. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
  257. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
  258. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +1 -1
  259. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  260. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +3 -3
  261. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +3 -3
  262. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  263. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  264. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +63 -63
  265. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  266. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  267. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +12 -12
  268. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
  269. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  270. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +35 -35
  271. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +2 -2
  272. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +27 -27
  273. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  274. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +2 -0
  275. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +57 -0
  276. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +21 -21
  277. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +1 -1
  278. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +11 -11
  279. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +1 -1
  280. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  281. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +27 -27
  282. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +1 -1
  283. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +17 -17
  284. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +20 -20
  285. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +62 -62
  286. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +10 -10
  287. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  288. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  289. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
  290. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  291. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  292. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  293. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  294. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +1 -1
  295. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +1 -1
  296. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +1 -1
  297. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  298. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
  299. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
  300. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  301. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +29 -29
  302. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
  303. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +16 -16
  304. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +7 -7
  305. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
  306. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +30 -30
  307. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +4 -4
  308. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  309. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  310. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  311. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  312. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  313. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  314. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  315. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +5 -5
  316. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  317. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +4 -4
  318. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +3 -3
  319. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +1 -1
  320. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
  321. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +21 -21
  322. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +18 -18
  323. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +2 -2
  324. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
  325. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  326. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +26 -26
  327. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +9 -9
  328. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +1 -1
  329. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +8 -8
  330. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  331. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  332. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +1 -1
  333. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +17 -17
  334. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  335. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
  336. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +2 -2
  337. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +1 -1
  338. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +12 -12
  339. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
  340. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +13 -5
  341. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +1 -1
  342. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  343. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  344. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -1
  345. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +11 -11
  346. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  347. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +1 -1
  348. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +253 -0
  349. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +20 -0
  350. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +1 -1
  351. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +1 -1
  352. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +10 -10
  353. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +300 -0
  354. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +272 -0
  355. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
  356. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +25 -0
  357. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +178 -0
  358. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +78 -0
  359. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +51 -0
  360. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -2
  361. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +14 -14
  362. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +67 -0
  363. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +195 -0
  364. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +67 -0
  365. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +294 -0
  366. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +212 -0
  367. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +955 -0
  368. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
  369. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
  370. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
  371. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +1 -1
  372. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  373. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +65 -0
  374. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +698 -0
  375. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +50 -0
  376. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +78 -0
  377. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +77 -0
  378. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +120 -0
  379. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +10 -0
  380. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +23 -0
  381. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  382. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  383. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  384. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +154 -154
  385. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +92 -0
  386. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +335 -0
  387. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +235 -0
  388. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +1673 -0
  389. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +202 -0
  390. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +872 -0
  391. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +9 -9
  392. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +36 -0
  393. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +239 -0
  394. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +21 -0
  395. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +143 -0
  396. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +24 -0
  397. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +298 -0
  398. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +25 -0
  399. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +177 -0
  400. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +73 -0
  401. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +577 -0
  402. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +11 -0
  403. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +90 -0
  404. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +16 -0
  405. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +130 -0
  406. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +12 -0
  407. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +53 -0
  408. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +5 -0
  409. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +12 -0
  410. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +10 -0
  411. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +91 -0
  412. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +38 -0
  413. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +518 -0
  414. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +6 -0
  415. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +231 -0
  416. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  417. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  418. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  419. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  420. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  421. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  422. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +1 -1
  423. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  424. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  425. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  426. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +11 -11
  427. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +9 -9
  428. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  429. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  430. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +10 -10
  431. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  432. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  433. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  434. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  435. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
  436. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  437. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  438. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  439. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
  440. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
  441. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
  442. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
  443. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  444. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +5 -5
  445. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +74 -74
  446. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +11 -11
  447. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
  448. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
  449. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
  450. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  451. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.d.ts +1 -1
  452. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.js +1 -1
  453. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +1 -1
  454. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +4 -4
  455. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
  456. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +0 -30
  457. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +0 -87
  458. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +0 -205
  459. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +0 -1580
@@ -0,0 +1,955 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { ThrottledDelayer, runWhenGlobalIdle } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
5
+ import { isCancellationError, onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
6
+ import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
7
+ import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
8
+ import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
9
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
10
+ import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
11
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
12
+ import { joinPath, isEqualOrParent, isEqual, normalizePath, relativePath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
13
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
14
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
15
+ import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
16
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
17
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
18
+ import { IMeteredConnectionService } from '@codingame/monaco-vscode-api/vscode/vs/platform/meteredConnection/common/meteredConnection.service';
19
+ import { observableMemento } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/observableMemento';
20
+ import { asJson } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request';
21
+ import { IRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/request/common/request.service';
22
+ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
23
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
24
+ import { AutoUpdateConfigurationKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions';
25
+ import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
26
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
27
+ import { IAgentPluginRepositoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service';
28
+ import { FileBackedInstalledPluginsStore } from './fileBackedInstalledPluginsStore.js';
29
+ import { IWorkspacePluginSettingsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.service';
30
+ import { IWorkspaceTrustManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
31
+ import { readAgentPluginManifest } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentPlugins/common/agentPluginParser';
32
+ import { readConfiguredMarketplaces, parseMarketplaceReferences, deduplicateMarketplaceReferences, parseMarketplaceReference, parseMarketplaceObjectEntry, MarketplaceReferenceKind } from './marketplaceReference.js';
33
+ import { getStrictKnownMarketplaces, isMarketplaceReferenceAllowed } from './strictKnownMarketplaces.js';
34
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
35
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
36
+ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
37
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
38
+
39
+ var MarketplaceType;
40
+ (function(MarketplaceType) {
41
+ MarketplaceType["Copilot"] = "copilot";
42
+ MarketplaceType["Claude"] = "claude";
43
+ MarketplaceType["OpenPlugin"] = "openPlugin";
44
+ })(MarketplaceType || (MarketplaceType = {}));
45
+ var PluginSourceKind;
46
+ (function(PluginSourceKind) {
47
+ PluginSourceKind["RelativePath"] = "relativePath";
48
+ PluginSourceKind["GitHub"] = "github";
49
+ PluginSourceKind["GitUrl"] = "url";
50
+ PluginSourceKind["Npm"] = "npm";
51
+ PluginSourceKind["Pip"] = "pip";
52
+ })(PluginSourceKind || (PluginSourceKind = {}));
53
+ const MARKETPLACE_DEFINITIONS = [{
54
+ type: MarketplaceType.OpenPlugin,
55
+ path: "marketplace.json"
56
+ }, {
57
+ type: MarketplaceType.OpenPlugin,
58
+ path: ".plugin/marketplace.json"
59
+ }, {
60
+ type: MarketplaceType.Copilot,
61
+ path: ".github/plugin/marketplace.json"
62
+ }, {
63
+ type: MarketplaceType.Claude,
64
+ path: ".claude-plugin/marketplace.json"
65
+ }];
66
+ const SINGLE_PLUGIN_MANIFEST_DEFINITIONS = [{
67
+ type: MarketplaceType.OpenPlugin,
68
+ path: ".plugin/plugin.json"
69
+ }, {
70
+ type: MarketplaceType.Claude,
71
+ path: ".claude-plugin/plugin.json"
72
+ }, {
73
+ type: MarketplaceType.Copilot,
74
+ path: "plugin.json"
75
+ }];
76
+ const GITHUB_MARKETPLACE_CACHE_TTL_MS = 8 * 60 * 60 * 1000;
77
+ const GITHUB_MARKETPLACE_CACHE_STORAGE_KEY = "chat.plugins.marketplaces.githubCache.v1";
78
+ const PLUGIN_UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
79
+ const PLUGIN_UPDATE_LAST_CHECK_STORAGE_KEY = "chat.plugins.lastUpdateCheck.v1";
80
+ function ensureSourceDescriptor(plugin) {
81
+ if (plugin.sourceDescriptor) {
82
+ return plugin;
83
+ }
84
+ return {
85
+ ...plugin,
86
+ sourceDescriptor: {
87
+ kind: PluginSourceKind.RelativePath,
88
+ path: plugin.source
89
+ }
90
+ };
91
+ }
92
+ const trustedMarketplacesMemento = observableMemento({
93
+ defaultValue: [],
94
+ key: "chat.plugins.trustedMarketplaces.v1",
95
+ toStorage: value => JSON.stringify(value),
96
+ fromStorage: value => {
97
+ const parsed = JSON.parse(value);
98
+ return Array.isArray(parsed) ? parsed : [];
99
+ }
100
+ });
101
+ const lastFetchedPluginsMemento = observableMemento({
102
+ defaultValue: {
103
+ plugins: [],
104
+ fetchedAt: 0
105
+ },
106
+ key: "chat.plugins.lastFetchedPlugins.v2",
107
+ toStorage: value => JSON.stringify(value),
108
+ fromStorage: value => {
109
+ const parsed = JSON.parse(value);
110
+ if (parsed && Array.isArray(parsed.plugins)) {
111
+ return parsed;
112
+ }
113
+ return {
114
+ plugins: [],
115
+ fetchedAt: 0
116
+ };
117
+ }
118
+ });
119
+ let PluginMarketplaceService = class PluginMarketplaceService extends Disposable {
120
+ constructor(
121
+ _configurationService,
122
+ _requestService,
123
+ environmentService,
124
+ _fileService,
125
+ _pluginRepositoryService,
126
+ _logService,
127
+ _storageService,
128
+ _workspacePluginSettingsService,
129
+ _workspaceTrustService,
130
+ _extensionsWorkbenchService,
131
+ _meteredConnectionService
132
+ ) {
133
+ super();
134
+ this._configurationService = _configurationService;
135
+ this._requestService = _requestService;
136
+ this._fileService = _fileService;
137
+ this._pluginRepositoryService = _pluginRepositoryService;
138
+ this._logService = _logService;
139
+ this._storageService = _storageService;
140
+ this._workspacePluginSettingsService = _workspacePluginSettingsService;
141
+ this._workspaceTrustService = _workspaceTrustService;
142
+ this._extensionsWorkbenchService = _extensionsWorkbenchService;
143
+ this._meteredConnectionService = _meteredConnectionService;
144
+ this._gitHubMarketplaceCache = ( new Lazy(() => this._loadPersistedGitHubMarketplaceCache()));
145
+ this._pluginMetadata = ( new Map());
146
+ this._marketplacesWithUpdates = observableValue("marketplacesWithUpdates", ( new Set()));
147
+ this._updateCheckDelayer = this._register(( new ThrottledDelayer(PLUGIN_UPDATE_CHECK_INTERVAL_MS)));
148
+ this._updateChecksInitialized = false;
149
+ this._updateCheckRunning = false;
150
+ this.marketplacesWithUpdates = this._marketplacesWithUpdates;
151
+ const oldCacheRoot = joinPath(environmentService.cacheHome, "agentPlugins");
152
+ this._installedPluginsStore = this._register(( new FileBackedInstalledPluginsStore(
153
+ _pluginRepositoryService.agentPluginsHome,
154
+ oldCacheRoot,
155
+ _fileService,
156
+ _logService,
157
+ _storageService
158
+ )));
159
+ this._trustedMarketplacesStore = this._register(
160
+ trustedMarketplacesMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
161
+ );
162
+ this._lastFetchedPluginsStore = this._register(
163
+ lastFetchedPluginsMemento(StorageScope.APPLICATION, StorageTarget.MACHINE, _storageService)
164
+ );
165
+ this.lastFetchedPlugins = ( this._lastFetchedPluginsStore.map(s => {
166
+ const revived = revive(s);
167
+ return ( revived.plugins.map(ensureSourceDescriptor));
168
+ }));
169
+ this.installedPlugins = ( this._installedPluginsStore.value.map(entries => {
170
+ const result = [];
171
+ for (const e of entries) {
172
+ const plugin = this._pluginMetadata.get(( e.pluginUri.toString()));
173
+ if (plugin) {
174
+ result.push({
175
+ pluginUri: e.pluginUri,
176
+ plugin
177
+ });
178
+ }
179
+ }
180
+ return result;
181
+ }));
182
+ const workspaceTrusted = observableFromEvent(
183
+ this,
184
+ this._workspaceTrustService.onDidChangeTrust,
185
+ () => this._workspaceTrustService.isWorkspaceTrusted()
186
+ );
187
+ this.recommendedPlugins = derived(reader => {
188
+ if (!workspaceTrusted.read(reader)) {
189
+ return ( new Set());
190
+ }
191
+ const enabledMap = this._workspacePluginSettingsService.enabledPlugins.read(reader);
192
+ const keys = ( new Set());
193
+ for (const [key, value] of enabledMap) {
194
+ if (value) {
195
+ keys.add(key);
196
+ }
197
+ }
198
+ return keys;
199
+ });
200
+ this.onDidChangeMarketplaces = Event.any(Event.filter(
201
+ _configurationService.onDidChangeConfiguration,
202
+ e => e.affectsConfiguration(ChatConfiguration.PluginsEnabled) || e.affectsConfiguration(ChatConfiguration.PluginMarketplaces) || e.affectsConfiguration(ChatConfiguration.ExtraMarketplaces)
203
+ ), Event.fromObservableLight(this._workspacePluginSettingsService.extraMarketplaces), ( Event.map(this._workspaceTrustService.onDidChangeTrust, () => {})));
204
+ this._register(runWhenGlobalIdle(() => {
205
+ this._updateChecksInitialized = true;
206
+ this._scheduleUpdateCheck();
207
+ this._register(Event.filter(
208
+ _configurationService.onDidChangeConfiguration,
209
+ e => e.affectsConfiguration(AutoUpdateConfigurationKey) || e.affectsConfiguration(ChatConfiguration.ExtraMarketplaces) || e.affectsConfiguration(ChatConfiguration.StrictMarketplaces)
210
+ )(() => {
211
+ this._marketplacesWithUpdates.set(( new Set()), undefined);
212
+ this._scheduleUpdateCheck(0);
213
+ }));
214
+ this._register(
215
+ this._meteredConnectionService.onDidChangeIsConnectionMetered(isMetered => {
216
+ if (isMetered) {
217
+ this._updateCheckDelayer.cancel();
218
+ } else if (!this._updateCheckRunning && !this._updateCheckDelayer.isTriggered()) {
219
+ this._scheduleUpdateCheck();
220
+ }
221
+ })
222
+ );
223
+ }));
224
+ this._register(autorun(reader => {
225
+ const entries = this._installedPluginsStore.value.read(reader);
226
+ const unhydrated = entries.filter(e => !( this._pluginMetadata.has(( e.pluginUri.toString()))));
227
+ if (unhydrated.length > 0) {
228
+ this._hydratePluginMetadata(unhydrated);
229
+ }
230
+ }));
231
+ }
232
+ clearUpdatesAvailable(marketplaceIds) {
233
+ const remaining = marketplaceIds ? ( new Set([...this._marketplacesWithUpdates.get()].filter(id => !( marketplaceIds.has(id))))) : ( new Set());
234
+ this._marketplacesWithUpdates.set(remaining, undefined);
235
+ if (remaining.size === 0 && this._updateChecksInitialized && !this._updateCheckRunning && !this._updateCheckDelayer.isTriggered()) {
236
+ this._scheduleUpdateCheck();
237
+ }
238
+ }
239
+ async fetchMarketplacePlugins(token, marketplaceIds, options) {
240
+ if (!this._configurationService.getValue(ChatConfiguration.PluginsEnabled)) {
241
+ return [];
242
+ }
243
+ const {
244
+ effectiveValues
245
+ } = readConfiguredMarketplaces(this._configurationService);
246
+ const configRefs = parseMarketplaceReferences(effectiveValues);
247
+ let allRefs;
248
+ if (this._workspaceTrustService.isWorkspaceTrusted()) {
249
+ const workspaceEntries = this._workspacePluginSettingsService.extraMarketplaces.get();
250
+ allRefs = deduplicateMarketplaceReferences(( workspaceEntries.map(e => e.reference)), configRefs);
251
+ } else {
252
+ allRefs = configRefs;
253
+ }
254
+ for (const value of effectiveValues) {
255
+ const parsed = typeof value === "string" ? parseMarketplaceReference(value) : (value && typeof value === "object" ? parseMarketplaceObjectEntry(value) : undefined);
256
+ if (!parsed) {
257
+ this._logService.debug(
258
+ `[PluginMarketplaceService] Ignoring invalid marketplace entry: ${String(value)}`
259
+ );
260
+ }
261
+ }
262
+ const refsToFetch = allRefs.filter(ref => (!marketplaceIds || ( marketplaceIds.has(ref.canonicalId))) && this._isMarketplaceAllowedByStrictPolicy(ref));
263
+ const results = await Promise.all(( refsToFetch.map(ref => {
264
+ if (ref.kind === MarketplaceReferenceKind.GitHubShorthand && ref.githubRepo) {
265
+ return this._fetchFromGitHubRepo(ref, ref.githubRepo, token, options);
266
+ }
267
+ return this._fetchFromClonedRepo(ref, token, options);
268
+ })));
269
+ const plugins = results.flat();
270
+ if (token.isCancellationRequested) {
271
+ return plugins;
272
+ }
273
+ const storedPlugins = marketplaceIds ? [...this.lastFetchedPlugins.get().filter(plugin => !( marketplaceIds.has(plugin.marketplaceReference.canonicalId))), ...plugins] : plugins;
274
+ this._lastFetchedPluginsStore.set({
275
+ plugins: storedPlugins,
276
+ fetchedAt: Date.now()
277
+ }, undefined);
278
+ return plugins;
279
+ }
280
+ async _fetchFromGitHubRepo(reference, repo, token, options) {
281
+ const cache = this._gitHubMarketplaceCache.value;
282
+ const cached = options?.refresh ? undefined : this._getCachedGitHubMarketplacePlugins(cache, reference.canonicalId);
283
+ if (cached) {
284
+ return ( cached.map(c => {
285
+ const plugin = ensureSourceDescriptor(c);
286
+ return {
287
+ ...plugin,
288
+ marketplace: reference.displayLabel,
289
+ marketplaceReference: reference,
290
+ readmeUri: getMarketplaceReadmeUri(plugin.sourceDescriptor, reference, plugin.source)
291
+ };
292
+ }));
293
+ }
294
+ let repoMayBePrivate = true;
295
+ const plugins = await this._readPluginsFromDefinitions(reference, async defPath => {
296
+ if (token.isCancellationRequested) {
297
+ return undefined;
298
+ }
299
+ const ref = encodeURIComponent(reference.ref ?? "main");
300
+ const url = `https://raw.githubusercontent.com/${repo}/${ref}/${defPath}`;
301
+ try {
302
+ const context = await this._requestService.request({
303
+ type: "GET",
304
+ url,
305
+ callSite: "pluginMarketplaceService.fetchPluginList"
306
+ }, token);
307
+ const statusCode = context.res.statusCode;
308
+ if (statusCode !== 200) {
309
+ repoMayBePrivate &&= statusCode !== undefined && statusCode >= 400 && statusCode < 500;
310
+ this._logService.debug(
311
+ `[PluginMarketplaceService] ${url} returned status ${statusCode}, skipping`
312
+ );
313
+ return undefined;
314
+ }
315
+ return (await asJson(context)) ?? undefined;
316
+ } catch (err) {
317
+ this._logService.debug(
318
+ `[PluginMarketplaceService] Failed to fetch marketplace.json from ${url}:`,
319
+ err
320
+ );
321
+ return undefined;
322
+ }
323
+ });
324
+ if (plugins.length > 0) {
325
+ cache.set(reference.canonicalId, {
326
+ plugins,
327
+ expiresAt: Date.now() + GITHUB_MARKETPLACE_CACHE_TTL_MS,
328
+ referenceRawValue: reference.rawValue
329
+ });
330
+ this._savePersistedGitHubMarketplaceCache(cache);
331
+ return plugins;
332
+ }
333
+ if (repoMayBePrivate) {
334
+ this._logService.debug(
335
+ `[PluginMarketplaceService] ${repo} may be private, attempting clone-based marketplace discovery`
336
+ );
337
+ if (cache.delete(reference.canonicalId)) {
338
+ this._savePersistedGitHubMarketplaceCache(cache);
339
+ }
340
+ return this._fetchFromClonedRepo(reference, token, options);
341
+ }
342
+ this._logService.debug(`[PluginMarketplaceService] No marketplace.json found in ${repo}`);
343
+ return [];
344
+ }
345
+ _getCachedGitHubMarketplacePlugins(cache, cacheKey) {
346
+ const cached = cache.get(cacheKey);
347
+ if (!cached) {
348
+ return undefined;
349
+ }
350
+ if (cached.expiresAt <= Date.now()) {
351
+ cache.delete(cacheKey);
352
+ this._savePersistedGitHubMarketplaceCache(cache);
353
+ return undefined;
354
+ }
355
+ return [...cached.plugins];
356
+ }
357
+ _loadPersistedGitHubMarketplaceCache() {
358
+ const cache = ( new Map());
359
+ const now = Date.now();
360
+ const stored = this._storageService.getObject(GITHUB_MARKETPLACE_CACHE_STORAGE_KEY, StorageScope.APPLICATION);
361
+ if (!stored) {
362
+ return cache;
363
+ }
364
+ const revived = revive(stored);
365
+ for (const [cacheKey, entry] of Object.entries(revived)) {
366
+ if (!entry || !Array.isArray(entry.plugins) || typeof entry.expiresAt !== "number" || entry.expiresAt <= now || typeof entry.referenceRawValue !== "string") {
367
+ continue;
368
+ }
369
+ const reference = parseMarketplaceReference(entry.referenceRawValue);
370
+ if (!reference) {
371
+ continue;
372
+ }
373
+ const plugins = ( entry.plugins.map(plugin => ensureSourceDescriptor({
374
+ ...plugin,
375
+ marketplace: reference.displayLabel,
376
+ marketplaceReference: reference
377
+ })));
378
+ cache.set(cacheKey, {
379
+ plugins,
380
+ expiresAt: entry.expiresAt,
381
+ referenceRawValue: entry.referenceRawValue
382
+ });
383
+ }
384
+ return cache;
385
+ }
386
+ _savePersistedGitHubMarketplaceCache(cache) {
387
+ const serialized = {};
388
+ for (const [cacheKey, entry] of cache) {
389
+ if (!entry.plugins.length || entry.expiresAt <= Date.now()) {
390
+ continue;
391
+ }
392
+ serialized[cacheKey] = {
393
+ expiresAt: entry.expiresAt,
394
+ referenceRawValue: entry.referenceRawValue,
395
+ plugins: entry.plugins
396
+ };
397
+ }
398
+ if (( Object.keys(serialized)).length === 0) {
399
+ this._storageService.remove(GITHUB_MARKETPLACE_CACHE_STORAGE_KEY, StorageScope.APPLICATION);
400
+ return;
401
+ }
402
+ this._storageService.store(
403
+ GITHUB_MARKETPLACE_CACHE_STORAGE_KEY,
404
+ JSON.stringify(serialized),
405
+ StorageScope.APPLICATION,
406
+ StorageTarget.MACHINE
407
+ );
408
+ }
409
+ getMarketplacePluginMetadata(pluginUri) {
410
+ return this._pluginMetadata.get(( pluginUri.toString())) ?? [...this._pluginMetadata.entries()].find(([key]) => isEqualOrParent(pluginUri, ( URI.parse(key))))?.[1];
411
+ }
412
+ addInstalledPlugin(pluginUri, plugin) {
413
+ this._pluginMetadata.set(( pluginUri.toString()), plugin);
414
+ const entry = {
415
+ pluginUri,
416
+ marketplace: plugin.marketplaceReference.rawValue,
417
+ name: plugin.name
418
+ };
419
+ const current = this._installedPluginsStore.get();
420
+ const existing = current.find(e => isEqual(e.pluginUri, pluginUri));
421
+ if (existing) {
422
+ this._installedPluginsStore.set(( current.map(c => c === existing ? entry : c)), undefined);
423
+ } else {
424
+ this._installedPluginsStore.set([...current, entry], undefined);
425
+ }
426
+ }
427
+ removeInstalledPlugin(pluginUri) {
428
+ this._pluginMetadata.delete(( pluginUri.toString()));
429
+ const current = this._installedPluginsStore.get();
430
+ this._installedPluginsStore.set(current.filter(e => !isEqual(e.pluginUri, pluginUri)), undefined);
431
+ }
432
+ isMarketplaceTrusted(ref) {
433
+ const allowlist = getStrictKnownMarketplaces(this._configurationService.getValue(ChatConfiguration.StrictMarketplaces));
434
+ if (allowlist !== undefined) {
435
+ return isMarketplaceReferenceAllowed(allowlist, ref);
436
+ }
437
+ return this._trustedMarketplacesStore.get().includes(ref.canonicalId);
438
+ }
439
+ isStrictMarketplacePolicyActive() {
440
+ return getStrictKnownMarketplaces(this._configurationService.getValue(ChatConfiguration.StrictMarketplaces)) !== undefined;
441
+ }
442
+ isMarketplaceAutoUpdateEnabled(ref) {
443
+ const {
444
+ extraValues
445
+ } = readConfiguredMarketplaces(this._configurationService);
446
+ const managedRef = parseMarketplaceReferences(extraValues).find(candidate => candidate.canonicalId === ref.canonicalId);
447
+ return managedRef?.autoUpdate ?? this._extensionsWorkbenchService.getAutoUpdateValue() !== "off";
448
+ }
449
+ _isMarketplaceAllowedByStrictPolicy(ref) {
450
+ return !this.isStrictMarketplacePolicyActive() || this.isMarketplaceTrusted(ref);
451
+ }
452
+ async _hydratePluginMetadata(entries) {
453
+ let hydrated = 0;
454
+ for (const entry of entries) {
455
+ const key = ( entry.pluginUri.toString());
456
+ if (( this._pluginMetadata.has(key))) {
457
+ continue;
458
+ }
459
+ const reference = parseMarketplaceReference(entry.marketplace);
460
+ if (!reference) {
461
+ this._logService.debug(
462
+ `[PluginMarketplaceService] Cannot parse marketplace reference '${entry.marketplace}' for ${key}`
463
+ );
464
+ continue;
465
+ }
466
+ try {
467
+ const plugins = await this._readPluginsForInstalledEntry(reference, CancellationToken.None);
468
+ const match = plugins.length === 0 ? await this.readSinglePluginManifest(entry.pluginUri, reference) : plugins.find(
469
+ p => entry.name ? p.name === entry.name : isEqual(this._pluginRepositoryService.getPluginInstallUri(p), entry.pluginUri)
470
+ );
471
+ if (match) {
472
+ this._pluginMetadata.set(key, match);
473
+ hydrated++;
474
+ }
475
+ } catch (err) {
476
+ this._logService.debug(`[PluginMarketplaceService] Failed to hydrate metadata for ${key}:`, err);
477
+ }
478
+ }
479
+ if (hydrated > 0) {
480
+ const current = this._installedPluginsStore.get();
481
+ this._installedPluginsStore.set([...current], undefined);
482
+ }
483
+ }
484
+ async _readPluginsForInstalledEntry(reference, token) {
485
+ if (reference.kind === MarketplaceReferenceKind.GitHubShorthand && reference.githubRepo) {
486
+ return this._fetchFromGitHubRepo(reference, reference.githubRepo, token);
487
+ }
488
+ return this._readPluginsFromDirectory(
489
+ this._pluginRepositoryService.getRepositoryUri(reference),
490
+ reference,
491
+ token
492
+ );
493
+ }
494
+ _parseMarketplacePlugins(json, reference, marketplaceType, repoDir) {
495
+ if (!json.plugins || !Array.isArray(json.plugins)) {
496
+ return [];
497
+ }
498
+ return json.plugins.filter(p => typeof p.name === "string" && !!p.name).flatMap(p => {
499
+ const sourceDescriptor = parsePluginSource(p.source, json.metadata?.pluginRoot, {
500
+ pluginName: p.name,
501
+ logService: this._logService,
502
+ logPrefix: "[PluginMarketplaceService]"
503
+ });
504
+ if (!sourceDescriptor) {
505
+ return [];
506
+ }
507
+ const source = sourceDescriptor.kind === PluginSourceKind.RelativePath ? sourceDescriptor.path : "";
508
+ return [{
509
+ name: p.name,
510
+ description: p.description ?? "",
511
+ version: p.version ?? "",
512
+ source,
513
+ sourceDescriptor,
514
+ marketplace: reference.displayLabel,
515
+ marketplaceReference: reference,
516
+ marketplaceType,
517
+ readmeUri: getMarketplaceReadmeUri(sourceDescriptor, reference, source, repoDir)
518
+ }];
519
+ });
520
+ }
521
+ trustMarketplace(ref) {
522
+ const current = this._trustedMarketplacesStore.get();
523
+ if (!current.includes(ref.canonicalId)) {
524
+ this._trustedMarketplacesStore.set([...current, ref.canonicalId], undefined);
525
+ }
526
+ }
527
+ _hasAutoUpdateEnabledMarketplace() {
528
+ if (this._extensionsWorkbenchService.getAutoUpdateValue() !== "off") {
529
+ return true;
530
+ }
531
+ const {
532
+ extraValues
533
+ } = readConfiguredMarketplaces(this._configurationService);
534
+ return ( parseMarketplaceReferences(extraValues).some(ref => ref.autoUpdate === true));
535
+ }
536
+ _scheduleUpdateCheck(delayOverride) {
537
+ this._updateCheckDelayer.cancel();
538
+ if (this._store.isDisposed || this._meteredConnectionService.isConnectionMetered || this._marketplacesWithUpdates.get().size > 0 || !this._hasAutoUpdateEnabledMarketplace()) {
539
+ return;
540
+ }
541
+ const lastCheck = this._storageService.getNumber(PLUGIN_UPDATE_LAST_CHECK_STORAGE_KEY, StorageScope.APPLICATION, 0);
542
+ const elapsed = Date.now() - lastCheck;
543
+ const delay = delayOverride ?? Math.max(0, PLUGIN_UPDATE_CHECK_INTERVAL_MS - elapsed);
544
+ this._updateCheckDelayer.trigger(async () => {
545
+ this._updateCheckRunning = true;
546
+ try {
547
+ await this._doRunUpdateCheck();
548
+ } finally {
549
+ this._updateCheckRunning = false;
550
+ if (!this._updateCheckDelayer.isTriggered()) {
551
+ this._scheduleUpdateCheck(PLUGIN_UPDATE_CHECK_INTERVAL_MS);
552
+ }
553
+ }
554
+ }, delay).catch(error => {
555
+ if (!isCancellationError(error)) {
556
+ onUnexpectedError(error);
557
+ }
558
+ });
559
+ }
560
+ async _doRunUpdateCheck() {
561
+ if (this._meteredConnectionService.isConnectionMetered) {
562
+ return;
563
+ }
564
+ try {
565
+ const installed = this.installedPlugins.get();
566
+ if (installed.length === 0) {
567
+ return;
568
+ }
569
+ const seenMarketplaces = ( new Set());
570
+ const marketplacesWithUpdates = ( new Set());
571
+ for (const entry of installed) {
572
+ const ref = entry.plugin.marketplaceReference;
573
+ if (( seenMarketplaces.has(ref.canonicalId)) || !this.isMarketplaceAutoUpdateEnabled(ref) || !this._isMarketplaceAllowedByStrictPolicy(ref)) {
574
+ continue;
575
+ }
576
+ seenMarketplaces.add(ref.canonicalId);
577
+ try {
578
+ const behind = await this._pluginRepositoryService.fetchRepository(ref);
579
+ if (behind) {
580
+ marketplacesWithUpdates.add(ref.canonicalId);
581
+ }
582
+ } catch (err) {
583
+ this._logService.debug(
584
+ `[PluginMarketplaceService] Update check failed for ${ref.displayLabel}:`,
585
+ err
586
+ );
587
+ }
588
+ }
589
+ this._marketplacesWithUpdates.set(marketplacesWithUpdates, undefined);
590
+ this._storageService.store(
591
+ PLUGIN_UPDATE_LAST_CHECK_STORAGE_KEY,
592
+ Date.now(),
593
+ StorageScope.APPLICATION,
594
+ StorageTarget.MACHINE
595
+ );
596
+ } catch (err) {
597
+ this._logService.debug("[PluginMarketplaceService] Periodic update check failed:", err);
598
+ }
599
+ }
600
+ async _fetchFromClonedRepo(reference, token, options) {
601
+ let repoDir;
602
+ try {
603
+ repoDir = await this._pluginRepositoryService.ensureRepository(reference, {
604
+ refreshIfOlderThanMs: options?.refresh ? 0 : GITHUB_MARKETPLACE_CACHE_TTL_MS,
605
+ token
606
+ });
607
+ } catch (err) {
608
+ this._logService.debug(
609
+ `[PluginMarketplaceService] Failed to prepare marketplace repository ${reference.rawValue}:`,
610
+ err
611
+ );
612
+ options?.onMarketplaceError?.(reference, err);
613
+ return [];
614
+ }
615
+ return this._readPluginsFromDirectory(repoDir, reference, token);
616
+ }
617
+ async readPluginsFromDirectory(repoDir, reference) {
618
+ return this._readPluginsFromDirectory(repoDir, reference);
619
+ }
620
+ async readSinglePluginManifest(repoDir, reference) {
621
+ if (reference.kind !== MarketplaceReferenceKind.GitHubShorthand && reference.kind !== MarketplaceReferenceKind.GitUri) {
622
+ return undefined;
623
+ }
624
+ const sourceDescriptor = reference.kind === MarketplaceReferenceKind.GitHubShorthand ? {
625
+ kind: PluginSourceKind.GitHub,
626
+ repo: reference.githubRepo
627
+ } : {
628
+ kind: PluginSourceKind.GitUrl,
629
+ url: reference.cloneUrl
630
+ };
631
+ const agentManifest = await readAgentPluginManifest(repoDir, this._fileService);
632
+ if (agentManifest) {
633
+ return {
634
+ name: agentManifest.name ?? reference.displayLabel,
635
+ description: agentManifest.description ?? "",
636
+ version: agentManifest.version ?? "",
637
+ source: "",
638
+ sourceDescriptor,
639
+ marketplace: reference.displayLabel,
640
+ marketplaceReference: reference,
641
+ marketplaceType: MarketplaceType.OpenPlugin
642
+ };
643
+ }
644
+ for (const def of SINGLE_PLUGIN_MANIFEST_DEFINITIONS) {
645
+ const manifestUri = joinPath(repoDir, def.path);
646
+ let manifest;
647
+ try {
648
+ const contents = await this._fileService.readFile(manifestUri);
649
+ const parsed = parse(( contents.value.toString()));
650
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
651
+ manifest = parsed;
652
+ }
653
+ } catch {
654
+ continue;
655
+ }
656
+ if (!manifest) {
657
+ continue;
658
+ }
659
+ const manifestName = typeof manifest["name"] === "string" && manifest["name"] ? manifest["name"] : reference.displayLabel;
660
+ const manifestDescription = typeof manifest["description"] === "string" ? manifest["description"] : "";
661
+ const manifestVersion = typeof manifest["version"] === "string" ? manifest["version"] : "";
662
+ return {
663
+ name: manifestName,
664
+ description: manifestDescription,
665
+ version: manifestVersion,
666
+ source: "",
667
+ sourceDescriptor,
668
+ marketplace: reference.displayLabel,
669
+ marketplaceReference: reference,
670
+ marketplaceType: def.type
671
+ };
672
+ }
673
+ this._logService.debug(
674
+ `[PluginMarketplaceService] No single-plugin manifest found in ${reference.rawValue}`
675
+ );
676
+ return undefined;
677
+ }
678
+ async isPluginDirectory(repoDir) {
679
+ if (await readAgentPluginManifest(repoDir, this._fileService)) {
680
+ return true;
681
+ }
682
+ for (const def of SINGLE_PLUGIN_MANIFEST_DEFINITIONS) {
683
+ if (await this._fileService.exists(joinPath(repoDir, def.path))) {
684
+ return true;
685
+ }
686
+ }
687
+ return false;
688
+ }
689
+ async _readPluginsFromDirectory(repoDir, reference, token) {
690
+ return this._readPluginsFromDefinitions(reference, async defPath => {
691
+ if (token?.isCancellationRequested) {
692
+ return undefined;
693
+ }
694
+ const definitionUri = joinPath(repoDir, defPath);
695
+ try {
696
+ const contents = await this._fileService.readFile(definitionUri);
697
+ return parse(( contents.value.toString()));
698
+ } catch {
699
+ return undefined;
700
+ }
701
+ }, repoDir);
702
+ }
703
+ async _readPluginsFromDefinitions(reference, readJson, repoDir) {
704
+ for (const def of MARKETPLACE_DEFINITIONS) {
705
+ const json = await readJson(def.path);
706
+ if (!json?.plugins || !Array.isArray(json.plugins)) {
707
+ continue;
708
+ }
709
+ return this._parseMarketplacePlugins(json, reference, def.type, repoDir);
710
+ }
711
+ this._logService.debug(
712
+ `[PluginMarketplaceService] No marketplace.json found in ${reference.rawValue}`
713
+ );
714
+ return [];
715
+ }
716
+ };
717
+ PluginMarketplaceService = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IRequestService)), ( __param(2, IEnvironmentService)), ( __param(3, IFileService)), ( __param(4, IAgentPluginRepositoryService)), ( __param(5, ILogService)), ( __param(6, IStorageService)), ( __param(7, IWorkspacePluginSettingsService)), ( __param(8, IWorkspaceTrustManagementService)), ( __param(9, IExtensionsWorkbenchService)), ( __param(10, IMeteredConnectionService))], PluginMarketplaceService));
718
+ function normalizeMarketplacePath(value) {
719
+ let normalized = value.trim().replace(/\\/g, "/");
720
+ normalized = normalized.replace(/^\.?\/+/, "").replace(/\/+$/g, "");
721
+ return normalized;
722
+ }
723
+ function resolvePluginSource(pluginRoot, source) {
724
+ const normalizedRoot = pluginRoot ? normalizeMarketplacePath(pluginRoot) : "";
725
+ const normalizedSource = normalizeMarketplacePath(source);
726
+ const repoRoot = URI.file("/");
727
+ const pluginRootUri = normalizedRoot ? normalizePath(joinPath(repoRoot, normalizedRoot)) : repoRoot;
728
+ if (normalizedRoot && (normalizedSource === normalizedRoot || normalizedSource.startsWith(`${normalizedRoot}/`))) {
729
+ return normalizedSource;
730
+ }
731
+ const resolvedUri = normalizePath(joinPath(pluginRootUri, normalizedSource));
732
+ return relativePath(repoRoot, resolvedUri) ?? undefined;
733
+ }
734
+ function parsePluginSource(rawSource, pluginRoot, logContext) {
735
+ if (rawSource === undefined || rawSource === null) {
736
+ const resolved = resolvePluginSource(pluginRoot, "");
737
+ if (resolved === undefined) {
738
+ return undefined;
739
+ }
740
+ return {
741
+ kind: PluginSourceKind.RelativePath,
742
+ path: resolved
743
+ };
744
+ }
745
+ if (typeof rawSource === "string") {
746
+ const resolved = resolvePluginSource(pluginRoot, rawSource);
747
+ if (resolved === undefined) {
748
+ return undefined;
749
+ }
750
+ return {
751
+ kind: PluginSourceKind.RelativePath,
752
+ path: resolved
753
+ };
754
+ }
755
+ if (typeof rawSource !== "object" || typeof rawSource.source !== "string") {
756
+ logContext.logService.warn(
757
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': source object is missing a 'source' discriminant`
758
+ );
759
+ return undefined;
760
+ }
761
+ switch (rawSource.source) {
762
+ case "github":
763
+ {
764
+ if (typeof rawSource.repo !== "string" || !rawSource.repo) {
765
+ logContext.logService.warn(
766
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source is missing required 'repo' field`
767
+ );
768
+ return undefined;
769
+ }
770
+ if (!isValidGitHubRepo(rawSource.repo)) {
771
+ logContext.logService.warn(
772
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source repo must be in 'owner/repo' format`
773
+ );
774
+ return undefined;
775
+ }
776
+ if (!isOptionalString(rawSource.ref)) {
777
+ logContext.logService.warn(
778
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source 'ref' must be a string when provided`
779
+ );
780
+ return undefined;
781
+ }
782
+ if (!isOptionalGitSha(rawSource.sha)) {
783
+ logContext.logService.warn(
784
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source 'sha' must be a full 40-character commit hash when provided`
785
+ );
786
+ return undefined;
787
+ }
788
+ if (!isOptionalString(rawSource.path)) {
789
+ logContext.logService.warn(
790
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': github source 'path' must be a string when provided`
791
+ );
792
+ return undefined;
793
+ }
794
+ return {
795
+ kind: PluginSourceKind.GitHub,
796
+ repo: rawSource.repo,
797
+ ref: rawSource.ref,
798
+ sha: rawSource.sha,
799
+ path: rawSource.path
800
+ };
801
+ }
802
+ case "url":
803
+ case "git-subdir":
804
+ {
805
+ if (typeof rawSource.url !== "string" || !rawSource.url) {
806
+ logContext.logService.warn(
807
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': ${rawSource.source} source is missing required 'url' field`
808
+ );
809
+ return undefined;
810
+ }
811
+ if (rawSource.source === "url" && !rawSource.url.toLowerCase().endsWith(".git")) {
812
+ logContext.logService.warn(
813
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source must end with '.git'`
814
+ );
815
+ return undefined;
816
+ }
817
+ if (!isOptionalString(rawSource.ref)) {
818
+ logContext.logService.warn(
819
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': ${rawSource.source} source 'ref' must be a string when provided`
820
+ );
821
+ return undefined;
822
+ }
823
+ if (!isOptionalGitSha(rawSource.sha)) {
824
+ logContext.logService.warn(
825
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': ${rawSource.source} source 'sha' must be a full 40-character commit hash when provided`
826
+ );
827
+ return undefined;
828
+ }
829
+ if (rawSource.source === "git-subdir") {
830
+ if (typeof rawSource.path !== "string" || !rawSource.path) {
831
+ logContext.logService.warn(
832
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': git-subdir source is missing required 'path' field`
833
+ );
834
+ return undefined;
835
+ }
836
+ } else if (!isOptionalString(rawSource.path)) {
837
+ logContext.logService.warn(
838
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': url source 'path' must be a string when provided`
839
+ );
840
+ return undefined;
841
+ }
842
+ return {
843
+ kind: PluginSourceKind.GitUrl,
844
+ url: rawSource.url,
845
+ ref: rawSource.ref,
846
+ sha: rawSource.sha,
847
+ path: rawSource.path
848
+ };
849
+ }
850
+ case "npm":
851
+ {
852
+ if (typeof rawSource.package !== "string" || !rawSource.package) {
853
+ logContext.logService.warn(
854
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': npm source is missing required 'package' field`
855
+ );
856
+ return undefined;
857
+ }
858
+ if (!isOptionalString(rawSource.version) || !isOptionalString(rawSource.registry)) {
859
+ logContext.logService.warn(
860
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': npm source 'version' and 'registry' must be strings when provided`
861
+ );
862
+ return undefined;
863
+ }
864
+ return {
865
+ kind: PluginSourceKind.Npm,
866
+ package: rawSource.package,
867
+ version: rawSource.version,
868
+ registry: rawSource.registry
869
+ };
870
+ }
871
+ case "pip":
872
+ {
873
+ if (typeof rawSource.package !== "string" || !rawSource.package) {
874
+ logContext.logService.warn(
875
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': pip source is missing required 'package' field`
876
+ );
877
+ return undefined;
878
+ }
879
+ if (!isOptionalString(rawSource.version) || !isOptionalString(rawSource.registry)) {
880
+ logContext.logService.warn(
881
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': pip source 'version' and 'registry' must be strings when provided`
882
+ );
883
+ return undefined;
884
+ }
885
+ return {
886
+ kind: PluginSourceKind.Pip,
887
+ package: rawSource.package,
888
+ version: rawSource.version,
889
+ registry: rawSource.registry
890
+ };
891
+ }
892
+ default:
893
+ logContext.logService.warn(
894
+ `${logContext.logPrefix} Skipping plugin '${logContext.pluginName}': unknown source kind '${rawSource.source}'`
895
+ );
896
+ return undefined;
897
+ }
898
+ }
899
+ function isOptionalString(value) {
900
+ return value === undefined || typeof value === "string";
901
+ }
902
+ function isOptionalGitSha(value) {
903
+ return value === undefined || (typeof value === "string" && /^[0-9a-fA-F]{40}$/.test(value));
904
+ }
905
+ function isValidGitHubRepo(repo) {
906
+ return /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(repo);
907
+ }
908
+ function hasSourceChanged(installed, marketplace) {
909
+ if (installed.kind !== marketplace.kind) {
910
+ return true;
911
+ }
912
+ switch (installed.kind) {
913
+ case PluginSourceKind.GitHub:
914
+ return installed.ref !== marketplace.ref || installed.sha !== marketplace.sha || installed.path !== marketplace.path;
915
+ case PluginSourceKind.GitUrl:
916
+ return installed.ref !== marketplace.ref || installed.sha !== marketplace.sha || installed.path !== marketplace.path;
917
+ case PluginSourceKind.Npm:
918
+ return installed.version !== marketplace.version;
919
+ case PluginSourceKind.Pip:
920
+ return installed.version !== marketplace.version;
921
+ default:
922
+ return false;
923
+ }
924
+ }
925
+ function getMarketplaceReadmeUri(sourceDescriptor, reference, source, repoDir) {
926
+ if (sourceDescriptor.kind === PluginSourceKind.GitHub) {
927
+ const ref = sourceDescriptor.sha ?? sourceDescriptor.ref ?? "main";
928
+ const normalizedPath = sourceDescriptor.path?.trim().replace(/^\.?\/+|\/+$/g, "");
929
+ const readmePath = normalizedPath ? `${normalizedPath}/README.md` : "README.md";
930
+ return ( URI.parse(`https://github.com/${sourceDescriptor.repo}/blob/${ref}/${readmePath}`));
931
+ }
932
+ if (sourceDescriptor.kind === PluginSourceKind.GitUrl && sourceDescriptor.url.startsWith("https://github.com/")) {
933
+ const repo = sourceDescriptor.url.replace(/^https:\/\/github\.com\//, "").replace(/\.git$/, "");
934
+ const ref = sourceDescriptor.sha ?? sourceDescriptor.ref ?? "main";
935
+ const normalizedPath = sourceDescriptor.path?.trim().replace(/^\.?\/+|\/+$/g, "");
936
+ const readmePath = normalizedPath ? `${normalizedPath}/README.md` : "README.md";
937
+ return ( URI.parse(`https://github.com/${repo}/blob/${ref}/${readmePath}`));
938
+ }
939
+ if (repoDir) {
940
+ return getMarketplaceReadmeFileUri(repoDir, source);
941
+ }
942
+ if (!reference.githubRepo) {
943
+ return undefined;
944
+ }
945
+ const normalizedSource = source.trim().replace(/^\.?\/+|\/+$/g, "");
946
+ const readmePath = normalizedSource ? `${normalizedSource}/README.md` : "README.md";
947
+ const ref = reference.ref ?? "main";
948
+ return ( URI.parse(`https://github.com/${reference.githubRepo}/blob/${ref}/${readmePath}`));
949
+ }
950
+ function getMarketplaceReadmeFileUri(repoDir, source) {
951
+ const normalizedSource = source.trim().replace(/^\.?\/+|\/+$/g, "");
952
+ return normalizedSource ? joinPath(repoDir, normalizedSource, "README.md") : joinPath(repoDir, "README.md");
953
+ }
954
+
955
+ export { MarketplaceReferenceKind, MarketplaceType, PluginMarketplaceService, PluginSourceKind, deduplicateMarketplaceReferences, hasSourceChanged, parseMarketplaceReference, parseMarketplaceReferences, parsePluginSource, readConfiguredMarketplaces };