@codingame/monaco-vscode-chat-service-override 28.4.0 → 29.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/index.js +18 -12
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +300 -0
  4. package/vscode/src/vs/platform/agentHost/common/agentService.js +31 -0
  5. package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +84 -0
  6. package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +16 -0
  7. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +488 -0
  8. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +424 -0
  9. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +50 -0
  10. package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +202 -0
  11. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +114 -0
  12. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +723 -0
  13. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +33 -0
  14. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +40 -0
  15. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +22 -0
  16. package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +13 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  19. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +29 -15
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -3
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  28. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +76 -10
  29. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +11 -11
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.d.ts +1 -1
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +162 -4
  35. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +167 -4
  36. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  37. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +1 -1
  38. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +52 -20
  39. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +82 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +195 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +5 -1
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +97 -88
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +3 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +4 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +5 -3
  50. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +78 -35
  51. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +7 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +174 -170
  53. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +7 -4
  54. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +12 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +118 -52
  56. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +7 -7
  57. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  58. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +5 -1
  59. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +13 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  61. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +0 -3
  62. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -10
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +9 -10
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +23 -25
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +341 -196
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +79 -7
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +5 -4
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +22 -10
  72. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +4 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -14
  76. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +85 -5
  77. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +668 -214
  78. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +10 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +18 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +306 -39
  81. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +84 -4
  82. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +651 -81
  83. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +6 -2
  85. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +31 -1
  86. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +9 -20
  87. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +11 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -142
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.d.ts +43 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +63 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +11 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +44 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +25 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +297 -123
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +153 -31
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +17 -1
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +111 -171
  98. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +1 -3
  99. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +5 -30
  100. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +277 -186
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +4 -2
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +31 -23
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.d.ts +3 -7
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.js +4 -16
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +18 -2
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +112 -17
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +3 -3
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +16 -27
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +41 -19
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +7 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +35 -23
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +1 -8
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +8 -51
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.d.ts +1 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +13 -8
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +29 -36
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +14 -7
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +5 -1
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +79 -26
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +19 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +125 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +11 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +113 -82
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +18 -7
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +54 -15
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +8 -3
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +103 -28
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +48 -37
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +28 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +62 -20
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +21 -37
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +2 -1
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +4 -3
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +17 -4
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +5 -5
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +4 -1
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +43 -5
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +59 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +194 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +9 -10
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +13 -13
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +2 -1
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +8 -4
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +11 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +81 -50
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -18
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +2 -2
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +9 -7
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -26
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +0 -2
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +19 -27
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -4
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +105 -172
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +80 -65
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -27
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  178. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.d.ts +16 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +70 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  181. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.d.ts +20 -0
  182. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +40 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.d.ts +31 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +53 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +33 -2
  186. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +21 -2
  187. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +362 -18
  188. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +15 -4
  189. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +90 -43
  190. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +35 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +146 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  193. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
  194. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  195. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  196. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  197. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -9
  198. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  199. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  200. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  201. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +1 -1
  202. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +33 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -0
  204. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +200 -55
  205. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +7 -0
  206. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +90 -45
  207. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +4 -2
  208. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +21 -10
  209. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +22 -16
  210. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +4 -2
  211. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +28 -13
  212. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  213. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
  214. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
  215. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +20 -16
  216. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +68 -5
  217. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  218. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  219. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  220. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -0
  221. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +57 -20
  222. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  223. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +21 -5
  224. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +171 -57
  225. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +7 -5
  226. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +206 -35
  227. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +4 -3
  228. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +7 -7
  229. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +7 -1
  230. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +11 -3
  231. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +44 -22
  232. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +450 -301
  233. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +23 -0
  234. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +165 -0
  235. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +34 -20
  236. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +209 -144
  237. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +20 -0
  238. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +205 -0
  239. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +17 -17
  240. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.d.ts +33 -0
  241. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.js +47 -0
  242. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalSkill.d.ts +30 -0
  243. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  244. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  245. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  246. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +1 -1
  247. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +191 -159
  248. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +6 -7
  249. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +210 -233
  250. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +19 -26
  251. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +183 -193
  252. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -0
  253. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +75 -0
  254. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  255. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +8 -5
  256. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +8 -0
  257. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +97 -35
  258. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  259. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +16 -0
  260. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +67 -0
  261. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +2 -2
  262. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +62 -23
  263. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +8 -8
  269. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  270. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  271. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
  272. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +3 -1
  273. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +23 -9
  274. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +1 -1
  275. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +2 -2
  276. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +3 -1
  277. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +50 -9
  278. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +3 -1
  279. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +21 -7
  280. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +20 -1
  281. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +124 -1
  282. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +20 -5
  283. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +5 -0
  284. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +10 -7
  285. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +2 -1
  286. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +46 -31
  287. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +18 -1
  288. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +74 -37
  289. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
  290. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  291. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
  292. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +24 -14
  293. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  294. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +1 -1
  295. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +3 -2
  296. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +1 -1
  297. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +2 -0
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +5 -1
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +1 -2
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +66 -64
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +1 -0
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +1 -0
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +5 -2
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -2
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +390 -114
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +14 -0
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +21 -11
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +70 -51
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +61 -51
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +94 -76
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +19 -1
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +112 -21
  318. package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.d.ts +0 -53
  319. package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.js +0 -219
  320. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +0 -89
  321. package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +0 -251
  322. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -123
  323. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +0 -278
  324. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +0 -76
  325. package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +0 -299
  326. package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +0 -67
  327. package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +0 -263
  328. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +0 -85
  329. package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +0 -397
  330. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +0 -56
  331. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +0 -26
  332. package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.d.ts +0 -5
  333. package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.js +0 -30
  334. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +0 -40
  335. package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +0 -28
  336. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -190
  337. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -11
  338. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -16
  339. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -20
@@ -1,15 +1,17 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
4
5
  import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
5
6
  import { untildify } from '@codingame/monaco-vscode-api/vscode/vs/base/common/labels';
6
7
  import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
8
  import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
8
- import { cloneAndChange } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
9
+ import { cloneAndChange, equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
9
10
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
10
11
  import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
11
- import { joinPath, basename, extname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
12
+ import { joinPath, normalizePath, isEqualOrParent, basename, extname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
12
13
  import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
14
+ import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
13
15
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
14
16
  import { ConfigurationTarget, getConfigValueInTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
15
17
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
@@ -18,25 +20,31 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
18
20
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
19
21
  import { McpServerType } from '@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes';
20
22
  import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
23
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
21
24
  import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
22
25
  import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
23
26
  import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
27
+ import { EnablementModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement';
24
28
  import { parseClaudeHooks } from '../promptSyntax/hookClaudeCompat.js';
25
29
  import { parseCopilotHooks } from '../promptSyntax/hookCompatibility.js';
26
- import { agentPluginDiscoveryRegistry } from './agentPluginService.js';
27
30
  import { IAgentPluginRepositoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service';
31
+ import { agentPluginDiscoveryRegistry } from './agentPluginService.js';
28
32
  import { IPluginMarketplaceService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service';
29
33
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
30
34
  import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
31
- import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
35
+ import { derived, derivedOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
36
+ import { ObservablePromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/promise';
37
+ import { observableSignal } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignal';
32
38
 
33
39
  const COMMAND_FILE_SUFFIX = ".md";
40
+ const RULE_FILE_SUFFIXES = [".instructions.md", ".mdc", ".md"];
34
41
  var AgentPluginFormat;
35
42
  (function(AgentPluginFormat) {
36
43
  AgentPluginFormat[AgentPluginFormat["Copilot"] = 0] = "Copilot";
37
44
  AgentPluginFormat[AgentPluginFormat["Claude"] = 1] = "Claude";
45
+ AgentPluginFormat[AgentPluginFormat["OpenPlugin"] = 2] = "OpenPlugin";
38
46
  })(AgentPluginFormat || (AgentPluginFormat = {}));
39
- function mapParsedHooks(parsed) {
47
+ function mapParsedHooks(uri, parsed) {
40
48
  return ( [...parsed.entries()].map((
41
49
  [type, {
42
50
  hooks,
@@ -44,6 +52,7 @@ function mapParsedHooks(parsed) {
44
52
  }]
45
53
  ) => ({
46
54
  type,
55
+ uri,
47
56
  hooks,
48
57
  originalId
49
58
  })));
@@ -57,18 +66,19 @@ let CopilotPluginFormatAdapter = class CopilotPluginFormatAdapter {
57
66
  constructor(_workspaceContextService) {
58
67
  this._workspaceContextService = _workspaceContextService;
59
68
  this.format = AgentPluginFormat.Copilot;
60
- this.manifestPaths = ["plugin.json"];
61
- this.hookConfigPaths = ["hooks.json"];
62
- this.hookWatchPaths = ["hooks.json"];
69
+ this.manifestPath = "plugin.json";
70
+ this.hookConfigPath = "hooks.json";
71
+ this.pluginRootToken = undefined;
72
+ this.pluginRootEnvVar = undefined;
63
73
  }
64
- parseHooks(json, pluginUri, userHome) {
74
+ parseHooks(hookURI, json, pluginUri, userHome) {
65
75
  const workspaceRoot = resolveWorkspaceRoot(pluginUri, this._workspaceContextService);
66
- return mapParsedHooks(parseCopilotHooks(json, workspaceRoot, userHome));
76
+ return mapParsedHooks(hookURI, parseCopilotHooks(json, workspaceRoot, userHome));
67
77
  }
68
78
  };
69
79
  CopilotPluginFormatAdapter = ( __decorate([( __param(0, IWorkspaceContextService))], CopilotPluginFormatAdapter));
70
80
  const shellUnsafeChars = /[\s&|<>()^;!`"']/;
71
- function shellQuotePluginRootInCommand(command, fsPath, token = "${CLAUDE_PLUGIN_ROOT}") {
81
+ function shellQuotePluginRootInCommand(command, fsPath, token) {
72
82
  if (!command.includes(token)) {
73
83
  return command;
74
84
  }
@@ -86,87 +96,210 @@ function shellQuotePluginRootInCommand(command, fsPath, token = "${CLAUDE_PLUGIN
86
96
  return "\"" + fullPath.replace(/"/g, "\\\"") + "\"";
87
97
  });
88
98
  }
89
- let ClaudePluginFormatAdapter = class ClaudePluginFormatAdapter {
90
- constructor(_workspaceContextService) {
91
- this._workspaceContextService = _workspaceContextService;
92
- this.format = AgentPluginFormat.Claude;
93
- this.manifestPaths = [".claude-plugin/plugin.json"];
94
- this.hookConfigPaths = ["hooks/hooks.json"];
95
- this.hookWatchPaths = ["hooks"];
96
- }
97
- parseHooks(json, pluginUri, userHome) {
98
- const token = "${CLAUDE_PLUGIN_ROOT}";
99
- const fsPath = pluginUri.fsPath;
100
- const typedJson = json;
101
- const mutateHookCommand = hook => {
102
- for (const field of ["command", "windows", "linux", "osx"]) {
103
- if (typeof hook[field] === "string") {
104
- hook[field] = shellQuotePluginRootInCommand(hook[field], fsPath, token);
105
- }
99
+ function resolveMcpServersMap(raw) {
100
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
101
+ return undefined;
102
+ }
103
+ const obj = raw;
104
+ return Object.hasOwn(obj, "mcpServers") ? obj.mcpServers : obj;
105
+ }
106
+ function interpolateMcpPluginRoot(def, fsPath, token, envVar) {
107
+ const replace = s => s.replaceAll(token, fsPath);
108
+ const config = def.configuration;
109
+ let interpolated;
110
+ if (config.type === McpServerType.LOCAL) {
111
+ const local = {
112
+ ...config
113
+ };
114
+ local.command = replace(local.command);
115
+ if (local.args) {
116
+ local.args = ( local.args.map(replace));
117
+ }
118
+ if (local.cwd) {
119
+ local.cwd = replace(local.cwd);
120
+ }
121
+ local.env = {
122
+ ...local.env
123
+ };
124
+ for (const [k, v] of Object.entries(local.env)) {
125
+ if (typeof v === "string") {
126
+ local.env[k] = replace(v);
106
127
  }
107
- hook.env ??= {};
108
- hook.env.CLAUDE_PLUGIN_ROOT = fsPath;
128
+ }
129
+ local.env[envVar] = fsPath;
130
+ if (local.envFile) {
131
+ local.envFile = replace(local.envFile);
132
+ }
133
+ interpolated = local;
134
+ } else {
135
+ const remote = {
136
+ ...config
109
137
  };
110
- for (const lifecycle of ( Object.values(typedJson.hooks ?? {}))) {
111
- if (!Array.isArray(lifecycle)) {
138
+ remote.url = replace(remote.url);
139
+ if (remote.headers) {
140
+ remote.headers = Object.fromEntries(( Object.entries(remote.headers).map(([k, v]) => [k, replace(v)])));
141
+ }
142
+ interpolated = remote;
143
+ }
144
+ return {
145
+ name: def.name,
146
+ configuration: interpolated,
147
+ uri: def.uri
148
+ };
149
+ }
150
+ function parsePluginRootHooks(hookURI, json, pluginUri, userHome, workspaceContextService, token, envVar) {
151
+ const fsPath = pluginUri.fsPath;
152
+ const typedJson = json;
153
+ const mutateHookCommand = hook => {
154
+ for (const field of ["command", "windows", "linux", "osx"]) {
155
+ if (typeof hook[field] === "string") {
156
+ hook[field] = shellQuotePluginRootInCommand(hook[field], fsPath, token);
157
+ }
158
+ }
159
+ hook.env ??= {};
160
+ hook.env[envVar] = fsPath;
161
+ };
162
+ for (const lifecycle of ( Object.values(typedJson.hooks ?? {}))) {
163
+ if (!Array.isArray(lifecycle)) {
164
+ continue;
165
+ }
166
+ for (const lifecycleEntry of lifecycle) {
167
+ if (!lifecycleEntry || typeof lifecycleEntry !== "object") {
112
168
  continue;
113
169
  }
114
- for (const lifecycleEntry of lifecycle) {
115
- if (!lifecycleEntry || typeof lifecycleEntry !== "object") {
116
- continue;
117
- }
118
- const entry = lifecycleEntry;
119
- if (Array.isArray(entry.hooks)) {
120
- for (const hook of entry.hooks) {
121
- mutateHookCommand(hook);
122
- }
123
- } else {
124
- mutateHookCommand(entry);
170
+ const entry = lifecycleEntry;
171
+ if (Array.isArray(entry.hooks)) {
172
+ for (const hook of entry.hooks) {
173
+ mutateHookCommand(hook);
125
174
  }
175
+ } else {
176
+ mutateHookCommand(entry);
126
177
  }
127
178
  }
128
- const replacer = v => {
129
- return typeof v === "string" ? v.replaceAll("${CLAUDE_PLUGIN_ROOT}", pluginUri.fsPath) : undefined;
130
- };
131
- const workspaceRoot = resolveWorkspaceRoot(pluginUri, this._workspaceContextService);
132
- const {
133
- hooks,
134
- disabledAllHooks
135
- } = parseClaudeHooks(cloneAndChange(json, replacer), workspaceRoot, userHome);
136
- if (disabledAllHooks) {
137
- return [];
138
- }
139
- return mapParsedHooks(hooks);
179
+ }
180
+ const replacer = v => {
181
+ return typeof v === "string" ? v.replaceAll(token, pluginUri.fsPath) : undefined;
182
+ };
183
+ const workspaceRoot = resolveWorkspaceRoot(pluginUri, workspaceContextService);
184
+ const {
185
+ hooks,
186
+ disabledAllHooks
187
+ } = parseClaudeHooks(cloneAndChange(json, replacer), workspaceRoot, userHome);
188
+ if (disabledAllHooks) {
189
+ return [];
190
+ }
191
+ return mapParsedHooks(hookURI, hooks);
192
+ }
193
+ let ClaudePluginFormatAdapter = class ClaudePluginFormatAdapter {
194
+ constructor(_workspaceContextService) {
195
+ this._workspaceContextService = _workspaceContextService;
196
+ this.format = AgentPluginFormat.Claude;
197
+ this.manifestPath = ".claude-plugin/plugin.json";
198
+ this.hookConfigPath = "hooks/hooks.json";
199
+ this.pluginRootToken = "${CLAUDE_PLUGIN_ROOT}";
200
+ this.pluginRootEnvVar = "CLAUDE_PLUGIN_ROOT";
201
+ }
202
+ parseHooks(hookURI, json, pluginUri, userHome) {
203
+ return parsePluginRootHooks(
204
+ hookURI,
205
+ json,
206
+ pluginUri,
207
+ userHome,
208
+ this._workspaceContextService,
209
+ "${CLAUDE_PLUGIN_ROOT}",
210
+ "CLAUDE_PLUGIN_ROOT"
211
+ );
140
212
  }
141
213
  };
142
214
  ClaudePluginFormatAdapter = ( __decorate([( __param(0, IWorkspaceContextService))], ClaudePluginFormatAdapter));
215
+ let OpenPluginFormatAdapter = class OpenPluginFormatAdapter {
216
+ constructor(_workspaceContextService) {
217
+ this._workspaceContextService = _workspaceContextService;
218
+ this.format = AgentPluginFormat.OpenPlugin;
219
+ this.manifestPath = ".plugin/plugin.json";
220
+ this.hookConfigPath = "hooks/hooks.json";
221
+ this.pluginRootToken = "${PLUGIN_ROOT}";
222
+ this.pluginRootEnvVar = "PLUGIN_ROOT";
223
+ }
224
+ parseHooks(hookURI, json, pluginUri, userHome) {
225
+ return parsePluginRootHooks(
226
+ hookURI,
227
+ json,
228
+ pluginUri,
229
+ userHome,
230
+ this._workspaceContextService,
231
+ "${PLUGIN_ROOT}",
232
+ "PLUGIN_ROOT"
233
+ );
234
+ }
235
+ };
236
+ OpenPluginFormatAdapter = ( __decorate([( __param(0, IWorkspaceContextService))], OpenPluginFormatAdapter));
237
+ const emptyComponentPathConfig = {
238
+ paths: [],
239
+ exclusive: false
240
+ };
241
+ function parseComponentPathConfig(raw) {
242
+ if (raw === undefined || raw === null) {
243
+ return emptyComponentPathConfig;
244
+ }
245
+ if (typeof raw === "string") {
246
+ const trimmed = raw.trim();
247
+ return trimmed ? {
248
+ paths: [trimmed],
249
+ exclusive: false
250
+ } : emptyComponentPathConfig;
251
+ }
252
+ if (Array.isArray(raw)) {
253
+ const paths = ( raw.filter(v => typeof v === "string").map(v => v.trim())).filter(v => v.length > 0);
254
+ return {
255
+ paths,
256
+ exclusive: false
257
+ };
258
+ }
259
+ if (typeof raw === "object") {
260
+ const obj = raw;
261
+ if (Array.isArray(obj["paths"])) {
262
+ const paths = ( obj["paths"].filter(v => typeof v === "string").map(v => v.trim())).filter(v => v.length > 0);
263
+ const exclusive = obj["exclusive"] === true;
264
+ return {
265
+ paths,
266
+ exclusive
267
+ };
268
+ }
269
+ }
270
+ return emptyComponentPathConfig;
271
+ }
272
+ function resolveComponentDirs(pluginUri, defaultDir, config) {
273
+ const dirs = [];
274
+ if (!config.exclusive) {
275
+ dirs.push(joinPath(pluginUri, defaultDir));
276
+ }
277
+ for (const p of config.paths) {
278
+ const resolved = normalizePath(joinPath(pluginUri, p));
279
+ if (isEqualOrParent(resolved, pluginUri)) {
280
+ dirs.push(resolved);
281
+ }
282
+ }
283
+ return dirs;
284
+ }
143
285
  let AgentPluginService = class AgentPluginService extends Disposable {
144
- constructor(instantiationService, configurationService) {
286
+ constructor(instantiationService, configurationService, storageService) {
145
287
  super();
288
+ this.enablementModel = this._register(( new EnablementModel("agentPlugins.enablement", storageService)));
146
289
  const pluginsEnabled = observableConfigValue(ChatConfiguration.PluginsEnabled, true, configurationService);
147
290
  const discoveries = [];
148
291
  for (const descriptor of agentPluginDiscoveryRegistry.getAll()) {
149
292
  const discovery = instantiationService.createInstance(descriptor);
150
293
  this._register(discovery);
151
294
  discoveries.push(discovery);
152
- discovery.start();
295
+ discovery.start(this.enablementModel);
153
296
  }
154
- this.allPlugins = derived(read => {
297
+ this.plugins = derived(read => {
155
298
  if (!pluginsEnabled.read(read)) {
156
299
  return [];
157
300
  }
158
301
  return this._dedupeAndSort(discoveries.flatMap(d => d.plugins.read(read)));
159
302
  });
160
- this.plugins = derived(reader => {
161
- const all = this.allPlugins.read(reader);
162
- return all.filter(p => p.enabled.read(reader));
163
- });
164
- }
165
- setPluginEnabled(pluginUri, enabled) {
166
- const plugin = this.allPlugins.get().find(p => ( p.uri.toString()) === ( pluginUri.toString()));
167
- if (plugin) {
168
- plugin.setEnabled(enabled);
169
- }
170
303
  }
171
304
  _dedupeAndSort(plugins) {
172
305
  const unique = [];
@@ -182,7 +315,7 @@ let AgentPluginService = class AgentPluginService extends Disposable {
182
315
  return unique;
183
316
  }
184
317
  };
185
- AgentPluginService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IConfigurationService))], AgentPluginService));
318
+ AgentPluginService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IConfigurationService)), ( __param(2, IStorageService))], AgentPluginService));
186
319
  class AbstractAgentPluginDiscovery extends Disposable {
187
320
  constructor(_fileService, _pathService, _logService, _instantiationService) {
188
321
  super();
@@ -212,14 +345,9 @@ class AbstractAgentPluginDiscovery extends Disposable {
212
345
  if (!( seenPluginUris.has(key))) {
213
346
  seenPluginUris.add(key);
214
347
  const adapter = await this._detectPluginFormatAdapter(source.uri);
215
- plugins.push(this._toPlugin(
216
- source.uri,
217
- source.enabled,
218
- adapter,
219
- source.fromMarketplace,
220
- value => source.setEnabled(value),
221
- () => source.remove()
222
- ));
348
+ plugins.push(
349
+ this._toPlugin(source.uri, adapter, source.fromMarketplace, () => source.remove())
350
+ );
223
351
  }
224
352
  }
225
353
  this._disposePluginEntriesExcept(seenPluginUris);
@@ -227,6 +355,9 @@ class AbstractAgentPluginDiscovery extends Disposable {
227
355
  return plugins;
228
356
  }
229
357
  async _detectPluginFormatAdapter(pluginUri) {
358
+ if (await this._pathExists(joinPath(pluginUri, ".plugin", "plugin.json"))) {
359
+ return this._instantiationService.createInstance(OpenPluginFormatAdapter);
360
+ }
230
361
  const isInClaudeDirectory = pluginUri.path.split("/").includes(".claude");
231
362
  if (isInClaudeDirectory || (await this._pathExists(joinPath(pluginUri, ".claude-plugin", "plugin.json")))) {
232
363
  return this._instantiationService.createInstance(ClaudePluginFormatAdapter);
@@ -241,14 +372,7 @@ class AbstractAgentPluginDiscovery extends Disposable {
241
372
  return false;
242
373
  }
243
374
  }
244
- _toPlugin(
245
- uri,
246
- initialEnabled,
247
- adapter,
248
- fromMarketplace,
249
- setEnabledCallback,
250
- removeCallback
251
- ) {
375
+ _toPlugin(uri, adapter, fromMarketplace, removeCallback) {
252
376
  const key = ( uri.toString());
253
377
  const existing = this._pluginEntries.get(key);
254
378
  if (existing) {
@@ -256,72 +380,99 @@ class AbstractAgentPluginDiscovery extends Disposable {
256
380
  existing.store.dispose();
257
381
  this._pluginEntries.delete(key);
258
382
  } else {
259
- existing.plugin.enabled.set(initialEnabled, undefined);
260
383
  return existing.plugin;
261
384
  }
262
385
  }
263
386
  const store = ( new DisposableStore());
264
- const commands = observableValue("agentPluginCommands", []);
265
- const skills = observableValue("agentPluginSkills", []);
266
- const agents = observableValue("agentPluginAgents", []);
267
- const hooks = observableValue("agentPluginHooks", []);
268
- const mcpServerDefinitions = observableValue("agentPluginMcpServerDefinitions", []);
269
- const enabled = observableValue("agentPluginEnabled", initialEnabled);
270
- const commandsDir = joinPath(uri, "commands");
271
- const skillsDir = joinPath(uri, "skills");
272
- const agentsDir = joinPath(uri, "agents");
273
- const commandsScheduler = store.add(( new RunOnceScheduler(async () => {
274
- commands.set(await this._readCommands(uri), undefined);
275
- }, 200)));
276
- const skillsScheduler = store.add(( new RunOnceScheduler(async () => {
277
- skills.set(await this._readSkills(uri), undefined);
278
- }, 200)));
279
- const agentsScheduler = store.add(( new RunOnceScheduler(async () => {
280
- agents.set(await this._readAgents(uri), undefined);
281
- }, 200)));
282
- const hooksScheduler = store.add(( new RunOnceScheduler(async () => {
283
- hooks.set(await this._readHooks(uri, adapter), undefined);
284
- }, 200)));
285
- const mcpScheduler = store.add(( new RunOnceScheduler(async () => {
286
- mcpServerDefinitions.set(await this._readMcpDefinitions(uri, adapter), undefined);
287
- }, 200)));
288
- store.add(this._fileService.watch(uri, {
289
- recursive: true,
387
+ const enablement = derived(r => this._enablementModel.readEnabled(key, r));
388
+ const manifest = observableValue("agentPluginManifest", undefined);
389
+ const observeComponent = (prop, doRead, tryReadEmbedded, defaultPath = prop) => {
390
+ const secondObs = derivedOpts({
391
+ equalsFn: equals
392
+ }, reader => manifest.read(reader)?.[prop]);
393
+ const wrapped = derived(reader => {
394
+ const section = secondObs.read(reader);
395
+ if (tryReadEmbedded) {
396
+ if (section && typeof section === "object" && !Array.isArray(section) && !(hasKey(section, {
397
+ paths: true
398
+ }))) {
399
+ return {
400
+ kind: "const",
401
+ data: ( new ObservablePromise(tryReadEmbedded(section)))
402
+ };
403
+ }
404
+ }
405
+ const paths = parseComponentPathConfig(section);
406
+ const dirs = resolveComponentDirs(uri, defaultPath, paths);
407
+ for (const d of dirs) {
408
+ const watcher = this._fileService.createWatcher(d, {
409
+ recursive: false,
410
+ excludes: []
411
+ });
412
+ reader.store.add(watcher);
413
+ reader.store.add(watcher.onDidChange(() => changeTrigger.trigger(undefined)));
414
+ }
415
+ return {
416
+ kind: "dirs",
417
+ dirs: dirs
418
+ };
419
+ });
420
+ const changeTrigger = observableSignal("fileChange");
421
+ const promised = derived(reader => {
422
+ const w = wrapped.read(reader);
423
+ if (w.kind === "const") {
424
+ return w.data.promiseResult;
425
+ } else {
426
+ changeTrigger.read(reader);
427
+ const promise = ( new ObservablePromise(doRead(w.dirs)));
428
+ return promise.promiseResult;
429
+ }
430
+ });
431
+ const result = ( promised.map((w, r) => w.read(r)?.data ?? Iterable.empty()));
432
+ return result.recomputeInitiallyAndOnChange(store);
433
+ };
434
+ const manifestUri = joinPath(uri, adapter.manifestPath);
435
+ const commands = observeComponent("commands", d => this._readMarkdownComponents(d));
436
+ const skills = observeComponent("skills", d => this._readSkills(uri, d));
437
+ const agents = observeComponent("agents", d => this._readMarkdownComponents(d));
438
+ const instructions = observeComponent("rules", d => this._readRules(d));
439
+ const hooks = observeComponent(
440
+ "hooks",
441
+ paths => this._readHooksFromPaths(uri, paths, adapter),
442
+ async section => {
443
+ const userHome = (await this._pathService.userHome()).fsPath;
444
+ return adapter.parseHooks(manifestUri, section, uri, userHome);
445
+ },
446
+ adapter.hookConfigPath
447
+ );
448
+ const mcpServerDefinitions = observeComponent(
449
+ "mcpServers",
450
+ paths => this._readMcpDefinitionsFromPaths(paths, uri.fsPath, adapter),
451
+ async section => this._parseMcpServerDefinitionMap(manifestUri, {
452
+ mcpServers: section
453
+ }, uri.fsPath, adapter),
454
+ ".mcp.json"
455
+ );
456
+ const readManifest = async () => {
457
+ manifest.set(await this._readManifest(uri, adapter), undefined);
458
+ };
459
+ const manifestWatcher = this._fileService.createWatcher(manifestUri, {
460
+ recursive: false,
290
461
  excludes: []
291
- }));
292
- store.add(this._fileService.onDidFilesChange(e => {
293
- if (e.affects(commandsDir)) {
294
- commandsScheduler.schedule();
295
- }
296
- if (e.affects(skillsDir)) {
297
- skillsScheduler.schedule();
298
- }
299
- if (e.affects(agentsDir)) {
300
- agentsScheduler.schedule();
301
- }
302
- if (( adapter.hookWatchPaths.some(path => e.affects(joinPath(uri, path))))) {
303
- hooksScheduler.schedule();
304
- }
305
- if (e.affects(joinPath(uri, ".mcp.json")) || ( adapter.manifestPaths.some(path => e.affects(joinPath(uri, path))))) {
306
- mcpScheduler.schedule();
307
- hooksScheduler.schedule();
308
- }
309
- }));
310
- commandsScheduler.schedule();
311
- skillsScheduler.schedule();
312
- agentsScheduler.schedule();
313
- hooksScheduler.schedule();
314
- mcpScheduler.schedule();
462
+ });
463
+ store.add(manifestWatcher);
464
+ store.add(manifestWatcher.onDidChange(() => readManifest()));
465
+ readManifest();
315
466
  const plugin = {
316
467
  uri,
317
468
  label: fromMarketplace?.name ?? basename(uri),
318
- enabled,
319
- setEnabled: setEnabledCallback,
469
+ enablement,
320
470
  remove: removeCallback,
321
471
  hooks,
322
472
  commands,
323
473
  skills,
324
474
  agents,
475
+ instructions,
325
476
  mcpServerDefinitions,
326
477
  fromMarketplace
327
478
  };
@@ -332,53 +483,59 @@ class AbstractAgentPluginDiscovery extends Disposable {
332
483
  });
333
484
  return plugin;
334
485
  }
335
- async _readMcpDefinitions(pluginUri, adapter) {
336
- const mcpUri = joinPath(pluginUri, ".mcp.json");
337
- const mcpFileConfig = await this._readJsonFile(mcpUri);
338
- const fileDefinitions = this._parseMcpServerDefinitionMap(mcpFileConfig);
339
- const pluginJsonDefinitions = await this._readInlinePluginJsonMcpDefinitions(pluginUri, adapter);
340
- const merged = ( new Map());
341
- for (const definition of fileDefinitions) {
342
- merged.set(definition.name, definition.configuration);
486
+ async _readManifest(pluginUri, adapter) {
487
+ const json = await this._readJsonFile(joinPath(pluginUri, adapter.manifestPath));
488
+ if (json && typeof json === "object") {
489
+ return json;
343
490
  }
344
- for (const definition of pluginJsonDefinitions) {
345
- if (!( merged.has(definition.name))) {
346
- merged.set(definition.name, definition.configuration);
491
+ return undefined;
492
+ }
493
+ async _readHooksFromPaths(pluginUri, paths, adapter) {
494
+ const userHome = (await this._pathService.userHome()).fsPath;
495
+ for (const hookPath of paths) {
496
+ const json = await this._readJsonFile(hookPath);
497
+ if (json) {
498
+ try {
499
+ return adapter.parseHooks(hookPath, json, pluginUri, userHome);
500
+ } catch (e) {
501
+ this._logService.info(`[AgentPluginDiscovery] Failed to parse hooks from ${( hookPath.toString())}:`, e);
502
+ }
347
503
  }
348
504
  }
349
- const definitions = ( [...merged.entries()].map(([name, configuration]) => ({
350
- name,
351
- configuration
352
- }))).sort((a, b) => a.name.localeCompare(b.name));
353
- return definitions;
505
+ return [];
354
506
  }
355
- async _readInlinePluginJsonMcpDefinitions(pluginUri, adapter) {
356
- for (const manifestPath of ( adapter.manifestPaths.map(path => joinPath(pluginUri, path)))) {
357
- const manifest = await this._readJsonFile(manifestPath);
358
- if (!manifest || typeof manifest !== "object") {
359
- continue;
360
- }
361
- const definitions = this._parseMcpServerDefinitionMap(manifest);
362
- if (definitions.length > 0) {
363
- return definitions;
507
+ async _readMcpDefinitionsFromPaths(paths, pluginFsPath, adapter) {
508
+ const merged = ( new Map());
509
+ for (const mcpPath of paths) {
510
+ const json = await this._readJsonFile(mcpPath);
511
+ for (const def of this._parseMcpServerDefinitionMap(mcpPath, json, pluginFsPath, adapter)) {
512
+ if (!( merged.has(def.name))) {
513
+ merged.set(def.name, def);
514
+ }
364
515
  }
365
516
  }
366
- return [];
517
+ return [...( merged.values())].sort((a, b) => a.name.localeCompare(b.name));
367
518
  }
368
- _parseMcpServerDefinitionMap(raw) {
369
- if (!raw || typeof raw !== "object" || !raw.hasOwnProperty("mcpServers")) {
519
+ _parseMcpServerDefinitionMap(definitionURI, raw, pluginFsPath, adapter) {
520
+ const mcpServers = resolveMcpServersMap(raw);
521
+ if (!mcpServers) {
370
522
  return [];
371
523
  }
372
524
  const definitions = [];
373
- for (const [name, configValue] of Object.entries(raw.mcpServers)) {
525
+ for (const [name, configValue] of Object.entries(mcpServers)) {
374
526
  const configuration = this._normalizeMcpServerConfiguration(configValue);
375
527
  if (!configuration) {
376
528
  continue;
377
529
  }
378
- definitions.push({
530
+ let def = {
379
531
  name,
380
- configuration
381
- });
532
+ configuration,
533
+ uri: definitionURI
534
+ };
535
+ if (adapter.pluginRootToken && adapter.pluginRootEnvVar) {
536
+ def = interpolateMcpPluginRoot(def, pluginFsPath, adapter.pluginRootToken, adapter.pluginRootEnvVar);
537
+ }
538
+ definitions.push(def);
382
539
  }
383
540
  return definitions;
384
541
  }
@@ -428,41 +585,6 @@ class AbstractAgentPluginDiscovery extends Disposable {
428
585
  }
429
586
  return undefined;
430
587
  }
431
- async _readHooks(pluginUri, adapter) {
432
- const userHome = (await this._pathService.userHome()).fsPath;
433
- for (const hooksUri of ( adapter.hookConfigPaths.map(path => joinPath(pluginUri, path)))) {
434
- const json = await this._readJsonFile(hooksUri);
435
- if (json) {
436
- try {
437
- return adapter.parseHooks(json, pluginUri, userHome);
438
- } catch (e) {
439
- this._logService.info(
440
- `[ConfiguredAgentPluginDiscovery] Failed to parse hooks from ${( hooksUri.toString())}:`,
441
- e
442
- );
443
- }
444
- }
445
- }
446
- for (const manifestPath of ( adapter.manifestPaths.map(path => joinPath(pluginUri, path)))) {
447
- const manifest = await this._readJsonFile(manifestPath);
448
- if (manifest && typeof manifest === "object") {
449
- const hooks = manifest["hooks"];
450
- if (hooks && typeof hooks === "object") {
451
- try {
452
- return adapter.parseHooks({
453
- hooks
454
- }, pluginUri, userHome);
455
- } catch (e) {
456
- this._logService.info(
457
- `[ConfiguredAgentPluginDiscovery] Failed to parse hooks from manifest ${( manifestPath.toString())}:`,
458
- e
459
- );
460
- }
461
- }
462
- }
463
- }
464
- return [];
465
- }
466
588
  async _readJsonFile(uri) {
467
589
  try {
468
590
  const fileContents = await this._fileService.readFile(uri);
@@ -471,80 +593,133 @@ class AbstractAgentPluginDiscovery extends Disposable {
471
593
  return undefined;
472
594
  }
473
595
  }
474
- async _readSkills(uri) {
475
- const skillsDir = joinPath(uri, "skills");
476
- let stat;
477
- try {
478
- stat = await this._fileService.resolve(skillsDir);
479
- } catch {
480
- return [];
481
- }
482
- if (!stat.isDirectory || !stat.children) {
483
- return [];
484
- }
596
+ async _readSkills(pluginRoot, dirs) {
597
+ const seen = ( new Set());
485
598
  const skills = [];
486
- for (const child of stat.children) {
487
- const skillMd = URI.joinPath(child.resource, "SKILL.md");
488
- if (!(await this._pathExists(skillMd))) {
599
+ const addSkill = (name, skillMd) => {
600
+ if (!( seen.has(name))) {
601
+ seen.add(name);
602
+ skills.push({
603
+ uri: skillMd,
604
+ name
605
+ });
606
+ }
607
+ };
608
+ for (const dir of dirs) {
609
+ const skillMd = URI.joinPath(dir, "SKILL.md");
610
+ if (await this._pathExists(skillMd)) {
611
+ addSkill(basename(dir), skillMd);
489
612
  continue;
490
613
  }
491
- skills.push({
492
- uri: skillMd,
493
- name: basename(child.resource)
494
- });
614
+ let stat;
615
+ try {
616
+ stat = await this._fileService.resolve(dir);
617
+ } catch {
618
+ continue;
619
+ }
620
+ if (!stat.isDirectory || !stat.children) {
621
+ continue;
622
+ }
623
+ for (const child of stat.children) {
624
+ const childSkillMd = URI.joinPath(child.resource, "SKILL.md");
625
+ if (await this._pathExists(childSkillMd)) {
626
+ addSkill(basename(child.resource), childSkillMd);
627
+ }
628
+ }
629
+ }
630
+ if (skills.length === 0) {
631
+ const rootSkillMd = URI.joinPath(pluginRoot, "SKILL.md");
632
+ if (await this._pathExists(rootSkillMd)) {
633
+ addSkill(basename(pluginRoot), rootSkillMd);
634
+ }
495
635
  }
496
636
  skills.sort((a, b) => a.name.localeCompare(b.name));
497
637
  return skills;
498
638
  }
499
- async _readAgents(uri) {
500
- const agentsDir = joinPath(uri, "agents");
501
- let stat;
502
- try {
503
- stat = await this._fileService.resolve(agentsDir);
504
- } catch {
505
- return [];
506
- }
507
- if (!stat.isDirectory || !stat.children) {
508
- return [];
509
- }
510
- const agents = [];
511
- for (const child of stat.children) {
512
- if (!child.isFile || extname(child.resource).toLowerCase() !== COMMAND_FILE_SUFFIX) {
639
+ async _readRules(dirs) {
640
+ const seen = ( new Set());
641
+ const items = [];
642
+ const matchSuffix = filename => {
643
+ const lower = filename.toLowerCase();
644
+ return RULE_FILE_SUFFIXES.find(s => lower.endsWith(s));
645
+ };
646
+ const addItem = (name, uri) => {
647
+ if (!( seen.has(name))) {
648
+ seen.add(name);
649
+ items.push({
650
+ uri,
651
+ name
652
+ });
653
+ }
654
+ };
655
+ for (const dir of dirs) {
656
+ let stat;
657
+ try {
658
+ stat = await this._fileService.resolve(dir);
659
+ } catch {
513
660
  continue;
514
661
  }
515
- const name = basename(child.resource).slice(0, -COMMAND_FILE_SUFFIX.length);
516
- agents.push({
517
- uri: child.resource,
518
- name
519
- });
520
- }
521
- agents.sort((a, b) => a.name.localeCompare(b.name));
522
- return agents;
523
- }
524
- async _readCommands(uri) {
525
- const commandsDir = joinPath(uri, "commands");
526
- let stat;
527
- try {
528
- stat = await this._fileService.resolve(commandsDir);
529
- } catch {
530
- return [];
531
- }
532
- if (!stat.isDirectory || !stat.children) {
533
- return [];
662
+ if (stat.isFile) {
663
+ const suffix = matchSuffix(basename(dir));
664
+ if (suffix) {
665
+ addItem(basename(dir).slice(0, -suffix.length), dir);
666
+ }
667
+ continue;
668
+ }
669
+ if (!stat.isDirectory || !stat.children) {
670
+ continue;
671
+ }
672
+ for (const child of stat.children) {
673
+ if (!child.isFile) {
674
+ continue;
675
+ }
676
+ const suffix = matchSuffix(child.name);
677
+ if (suffix) {
678
+ addItem(child.name.slice(0, -suffix.length), child.resource);
679
+ }
680
+ }
534
681
  }
535
- const commands = [];
536
- for (const child of stat.children) {
537
- if (!child.isFile || extname(child.resource).toLowerCase() !== COMMAND_FILE_SUFFIX) {
682
+ items.sort((a, b) => a.name.localeCompare(b.name));
683
+ return items;
684
+ }
685
+ async _readMarkdownComponents(dirs) {
686
+ const seen = ( new Set());
687
+ const items = [];
688
+ const addItem = (name, uri) => {
689
+ if (!( seen.has(name))) {
690
+ seen.add(name);
691
+ items.push({
692
+ uri,
693
+ name
694
+ });
695
+ }
696
+ };
697
+ for (const dir of dirs) {
698
+ let stat;
699
+ try {
700
+ stat = await this._fileService.resolve(dir);
701
+ } catch {
538
702
  continue;
539
703
  }
540
- const name = basename(child.resource).slice(0, -COMMAND_FILE_SUFFIX.length);
541
- commands.push({
542
- uri: child.resource,
543
- name
544
- });
704
+ if (stat.isFile && extname(dir).toLowerCase() === COMMAND_FILE_SUFFIX) {
705
+ addItem(basename(dir).slice(0, -COMMAND_FILE_SUFFIX.length), dir);
706
+ continue;
707
+ }
708
+ if (!stat.isDirectory || !stat.children) {
709
+ continue;
710
+ }
711
+ for (const child of stat.children) {
712
+ if (!child.isFile || extname(child.resource).toLowerCase() !== COMMAND_FILE_SUFFIX) {
713
+ continue;
714
+ }
715
+ addItem(
716
+ basename(child.resource).slice(0, -COMMAND_FILE_SUFFIX.length),
717
+ child.resource
718
+ );
719
+ }
545
720
  }
546
- commands.sort((a, b) => a.name.localeCompare(b.name));
547
- return commands;
721
+ items.sort((a, b) => a.name.localeCompare(b.name));
722
+ return items;
548
723
  }
549
724
  _disposePluginEntriesExcept(keep) {
550
725
  for (const [key, entry] of this._pluginEntries) {
@@ -575,7 +750,8 @@ let ConfiguredAgentPluginDiscovery = class ConfiguredAgentPluginDiscovery extend
575
750
  this._workspaceContextService = _workspaceContextService;
576
751
  this._pluginLocationsConfig = observableConfigValue(ChatConfiguration.PluginLocations, {}, _configurationService);
577
752
  }
578
- start() {
753
+ start(enablementModel) {
754
+ this._enablementModel = enablementModel;
579
755
  const scheduler = this._register(( new RunOnceScheduler(() => this._refreshPlugins(), 0)));
580
756
  this._register(autorun(reader => {
581
757
  this._pluginLocationsConfig.read(reader);
@@ -588,7 +764,7 @@ let ConfiguredAgentPluginDiscovery = class ConfiguredAgentPluginDiscovery extend
588
764
  const config = this._pluginLocationsConfig.get();
589
765
  const userHome = await this._getUserHome();
590
766
  for (const [path, enabled] of Object.entries(config)) {
591
- if (!path.trim()) {
767
+ if (!path.trim() || enabled === false) {
592
768
  continue;
593
769
  }
594
770
  const resources = this._resolvePluginPath(path.trim(), userHome);
@@ -612,9 +788,7 @@ let ConfiguredAgentPluginDiscovery = class ConfiguredAgentPluginDiscovery extend
612
788
  const configKey = path;
613
789
  sources.push({
614
790
  uri: stat.resource,
615
- enabled,
616
791
  fromMarketplace,
617
- setEnabled: value => this._updatePluginPathEnabled(configKey, value),
618
792
  remove: () => this._removePluginPath(configKey)
619
793
  });
620
794
  }
@@ -634,32 +808,6 @@ let ConfiguredAgentPluginDiscovery = class ConfiguredAgentPluginDiscovery extend
634
808
  }
635
809
  return ( this._workspaceContextService.getWorkspace().folders.map(folder => joinPath(folder.uri, path)));
636
810
  }
637
- _updatePluginPathEnabled(configKey, value) {
638
- const inspected = this._configurationService.inspect(ChatConfiguration.PluginLocations);
639
- const targets = [
640
- ConfigurationTarget.WORKSPACE_FOLDER,
641
- ConfigurationTarget.WORKSPACE,
642
- ConfigurationTarget.USER_LOCAL,
643
- ConfigurationTarget.USER_REMOTE,
644
- ConfigurationTarget.USER,
645
- ConfigurationTarget.APPLICATION
646
- ];
647
- for (const target of targets) {
648
- const mapping = getConfigValueInTarget(inspected, target);
649
- if (mapping && Object.prototype.hasOwnProperty.call(mapping, configKey)) {
650
- this._configurationService.updateValue(ChatConfiguration.PluginLocations, {
651
- ...mapping,
652
- [configKey]: value
653
- }, target);
654
- return;
655
- }
656
- }
657
- const current = getConfigValueInTarget(inspected, ConfigurationTarget.USER_LOCAL) ?? {};
658
- this._configurationService.updateValue(ChatConfiguration.PluginLocations, {
659
- ...current,
660
- [configKey]: value
661
- }, ConfigurationTarget.USER_LOCAL);
662
- }
663
811
  _removePluginPath(configKey) {
664
812
  const inspected = this._configurationService.inspect(ChatConfiguration.PluginLocations);
665
813
  const targets = [
@@ -697,7 +845,8 @@ let MarketplaceAgentPluginDiscovery = class MarketplaceAgentPluginDiscovery exte
697
845
  this._pluginMarketplaceService = _pluginMarketplaceService;
698
846
  this._pluginRepositoryService = _pluginRepositoryService;
699
847
  }
700
- start() {
848
+ start(enablementModel) {
849
+ this._enablementModel = enablementModel;
701
850
  const scheduler = this._register(( new RunOnceScheduler(() => this._refreshPlugins(), 0)));
702
851
  this._register(autorun(reader => {
703
852
  this._pluginMarketplaceService.installedPlugins.read(reader);
@@ -726,12 +875,12 @@ let MarketplaceAgentPluginDiscovery = class MarketplaceAgentPluginDiscovery exte
726
875
  }
727
876
  sources.push({
728
877
  uri: stat.resource,
729
- enabled: entry.enabled,
730
878
  fromMarketplace: entry.plugin,
731
- setEnabled: value => this._pluginMarketplaceService.setInstalledPluginEnabled(entry.pluginUri, value),
732
879
  remove: () => {
880
+ this._enablementModel.remove(( stat.resource.toString()));
733
881
  this._pluginMarketplaceService.removeInstalledPlugin(entry.pluginUri);
734
- this._pluginRepositoryService.cleanupPluginSource(entry.plugin).catch(error => {
882
+ const remaining = this._pluginMarketplaceService.installedPlugins.get();
883
+ this._pluginRepositoryService.cleanupPluginSource(entry.plugin, ( remaining.map(e => e.plugin.sourceDescriptor))).catch(error => {
735
884
  this._logService.error(
736
885
  "[MarketplaceAgentPluginDiscovery] Failed to clean up plugin source",
737
886
  error
@@ -745,4 +894,4 @@ let MarketplaceAgentPluginDiscovery = class MarketplaceAgentPluginDiscovery exte
745
894
  };
746
895
  MarketplaceAgentPluginDiscovery = ( __decorate([( __param(0, IPluginMarketplaceService)), ( __param(1, IAgentPluginRepositoryService)), ( __param(2, IFileService)), ( __param(3, IPathService)), ( __param(4, ILogService)), ( __param(5, IInstantiationService))], MarketplaceAgentPluginDiscovery));
747
896
 
748
- export { AbstractAgentPluginDiscovery, AgentPluginService, ConfiguredAgentPluginDiscovery, MarketplaceAgentPluginDiscovery, shellQuotePluginRootInCommand };
897
+ export { AbstractAgentPluginDiscovery, AgentPluginService, ConfiguredAgentPluginDiscovery, MarketplaceAgentPluginDiscovery, resolveMcpServersMap, shellQuotePluginRootInCommand };