@codingame/monaco-vscode-api 37.1.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 (313) hide show
  1. package/missing-services.js +6 -26
  2. package/package.json +8 -8
  3. package/services.d.ts +1 -1
  4. package/services.js +3 -3
  5. package/tools.d.ts +4 -0
  6. package/tools.js +24 -1
  7. package/vscode/src/vs/platform/product/common/product.js +1 -1
  8. package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
  9. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
  11. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
  12. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
  13. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  14. package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
  25. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
  27. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
  41. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
  44. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
  45. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
  46. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
  49. package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
  50. package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
  52. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
  53. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
  55. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
  56. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
  57. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
  58. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
  59. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
  60. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
  61. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
  62. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
  63. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
  64. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
  65. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
  66. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
  67. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
  68. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
  71. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
  72. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
  73. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
  74. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
  85. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
  86. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
  87. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
  88. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
  89. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
  90. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
  91. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
  92. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
  93. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
  94. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
  95. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
  96. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
  97. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
  98. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
  99. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  100. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  101. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
  102. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
  103. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
  104. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
  105. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  106. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  107. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
  108. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
  109. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
  110. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
  111. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  112. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
  113. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
  123. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
  124. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
  125. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
  126. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
  127. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
  128. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
  129. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
  130. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
  131. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
  132. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
  133. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
  134. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
  135. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
  136. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
  137. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
  138. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
  139. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
  140. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
  141. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
  142. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
  143. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
  144. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
  145. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
  146. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
  147. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
  148. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
  149. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
  150. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
  151. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
  152. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
  195. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
  196. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
  197. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
  198. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
  199. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
  200. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
  201. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
  202. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
  203. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
  204. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
  205. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
  258. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
  259. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
  260. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
  261. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
  262. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
  304. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
  305. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
  306. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
  307. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
  308. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
  309. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
  310. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
  311. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
  312. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
  313. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
@@ -1,955 +0,0 @@
1
-
2
- import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
3
- import { ThrottledDelayer, runWhenGlobalIdle } from '../../../../../base/common/async.js';
4
- import { CancellationToken } from '../../../../../base/common/cancellation.js';
5
- import { isCancellationError, onUnexpectedError } from '../../../../../base/common/errors.js';
6
- import { Event } from '../../../../../base/common/event.js';
7
- import { parse } from '../../../../../base/common/json.js';
8
- import { Lazy } from '../../../../../base/common/lazy.js';
9
- import { Disposable } from '../../../../../base/common/lifecycle.js';
10
- import { revive } from '../../../../../base/common/marshalling.js';
11
- import '../../../../../base/common/observableInternal/index.js';
12
- import { joinPath, isEqualOrParent, isEqual, normalizePath, relativePath } from '../../../../../base/common/resources.js';
13
- import { URI } from '../../../../../base/common/uri.js';
14
- import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
15
- import { IEnvironmentService } from '../../../../../platform/environment/common/environment.service.js';
16
- import { IFileService } from '../../../../../platform/files/common/files.service.js';
17
- import { ILogService } from '../../../../../platform/log/common/log.service.js';
18
- import { IMeteredConnectionService } from '../../../../../platform/meteredConnection/common/meteredConnection.service.js';
19
- import { observableMemento } from '../../../../../platform/observable/common/observableMemento.js';
20
- import { asJson } from '../../../../../platform/request/common/request.js';
21
- import { IRequestService } from '../../../../../platform/request/common/request.service.js';
22
- import { StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js';
23
- import { IStorageService } from '../../../../../platform/storage/common/storage.service.js';
24
- import { AutoUpdateConfigurationKey } from '../../../extensions/common/extensions.js';
25
- import { IExtensionsWorkbenchService } from '../../../extensions/common/extensions.service.js';
26
- import { ChatConfiguration } from '../constants.js';
27
- import { IAgentPluginRepositoryService } from './agentPluginRepositoryService.service.js';
28
- import { FileBackedInstalledPluginsStore } from './fileBackedInstalledPluginsStore.js';
29
- import { IWorkspacePluginSettingsService } from './workspacePluginSettingsService.service.js';
30
- import { IWorkspaceTrustManagementService } from '../../../../../platform/workspace/common/workspaceTrust.service.js';
31
- import { readAgentPluginManifest } from '../../../../../platform/agentPlugins/common/agentPluginParser.js';
32
- import { readConfiguredMarketplaces, parseMarketplaceReferences, deduplicateMarketplaceReferences, parseMarketplaceReference, parseMarketplaceObjectEntry, MarketplaceReferenceKind } from './marketplaceReference.js';
33
- import { getStrictKnownMarketplaces, isMarketplaceReferenceAllowed } from './strictKnownMarketplaces.js';
34
- import { observableValue } from '../../../../../base/common/observableInternal/observables/observableValue.js';
35
- import { observableFromEvent } from '../../../../../base/common/observableInternal/observables/observableFromEvent.js';
36
- import { derived } from '../../../../../base/common/observableInternal/observables/derived.js';
37
- import { autorun } from '../../../../../base/common/observableInternal/reactions/autorun.js';
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 };