@codingame/monaco-vscode-chat-service-override 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 (205) hide show
  1. package/index.js +15 -5
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +1 -1
  4. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +104 -0
  5. package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +827 -0
  6. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +15 -0
  7. package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +71 -0
  8. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +16 -0
  9. package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +95 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +22 -0
  11. package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +286 -0
  12. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +10 -0
  13. package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +38 -0
  14. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +9 -0
  15. package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +22 -0
  16. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +130 -0
  17. package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +907 -0
  18. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +10 -0
  19. package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +28 -0
  20. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +27 -0
  21. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +167 -0
  22. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +46 -0
  23. package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +356 -0
  24. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +1 -1
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +2 -2
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +1 -1
  29. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +2 -2
  30. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -1
  31. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +2 -2
  32. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +1 -1
  33. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +1 -1
  34. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +1 -1
  35. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +1 -1
  36. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +1 -1
  38. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +1 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +5 -3
  42. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +2 -2
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +1 -1
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +1 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +1 -1
  48. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +1 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +1 -1
  54. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +1 -1
  55. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  56. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +1 -1
  57. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +1 -1
  58. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +2 -2
  59. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +1 -1
  60. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +1 -1
  61. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -3
  62. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +1 -1
  63. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +1 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -1
  66. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +1 -1
  67. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +1 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +1 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +1 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +1 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +12 -12
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +1 -1
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +1 -1
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +1 -1
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +1 -1
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +1 -1
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +1 -1
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +1 -1
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +1 -1
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +1 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +1 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +1 -1
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +1 -1
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +1 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -1
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +1 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +2 -2
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +2 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +57 -0
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +2 -2
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +1 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +1 -1
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +1 -1
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +1 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +1 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +1 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +1 -1
  108. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +1 -1
  109. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +1 -1
  110. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  111. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +2 -2
  112. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
  113. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +1 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +1 -1
  115. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +3 -3
  116. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +1 -1
  117. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +1 -1
  118. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +1 -1
  119. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +1 -1
  120. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +1 -1
  121. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +1 -1
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +1 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +2 -2
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +10 -2
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +1 -1
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -1
  129. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +1 -1
  130. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +253 -0
  131. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +20 -0
  132. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +1 -1
  133. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +1 -1
  134. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +2 -2
  135. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +300 -0
  136. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +272 -0
  137. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +25 -0
  138. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +178 -0
  139. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +78 -0
  140. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +51 -0
  141. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -2
  142. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +2 -2
  143. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +67 -0
  144. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +195 -0
  145. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +67 -0
  146. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +294 -0
  147. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +212 -0
  148. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +955 -0
  149. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
  150. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
  151. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
  152. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +1 -1
  153. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +65 -0
  154. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +698 -0
  155. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +50 -0
  156. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +78 -0
  157. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +77 -0
  158. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +120 -0
  159. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +10 -0
  160. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +23 -0
  161. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +92 -0
  162. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +335 -0
  163. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +235 -0
  164. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +1673 -0
  165. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +202 -0
  166. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +872 -0
  167. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +36 -0
  168. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +239 -0
  169. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +21 -0
  170. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +143 -0
  171. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +24 -0
  172. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +298 -0
  173. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +25 -0
  174. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +177 -0
  175. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +73 -0
  176. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +577 -0
  177. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +11 -0
  178. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +90 -0
  179. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +16 -0
  180. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +130 -0
  181. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +12 -0
  182. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +53 -0
  183. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +5 -0
  184. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +12 -0
  185. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +10 -0
  186. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +91 -0
  187. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +38 -0
  188. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +518 -0
  189. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +6 -0
  190. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +231 -0
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +4 -4
  193. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +1 -1
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +1 -1
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +1 -1
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +1 -1
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +1 -1
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +1 -1
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +1 -1
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +1 -1
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +1 -1
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.d.ts +1 -1
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.js +1 -1
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +1 -1
@@ -0,0 +1,300 @@
1
+ import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
2
+ import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
4
+ import { ThemeIcon } from "@codingame/monaco-vscode-api/vscode/vs/base/common/themables";
5
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
6
+ import { AICustomizationSource } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService";
7
+ import { PromptsType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes";
8
+ import { IChatPromptSlashCommand, ICustomAgent, IResolvedChatPromptSlashCommand } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService";
9
+ import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
10
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
11
+ import { type CustomizationDisabledReason } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/customizationEnablement";
12
+ import { ICustomizationHarnessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service";
13
+ /**
14
+ * Override for a management section's create-button behavior.
15
+ */
16
+ export interface ISectionOverride {
17
+ /**
18
+ * Label for the primary button. Required when `commandId` or `rootFile`
19
+ * is set. Ignored otherwise (the widget uses its default label).
20
+ */
21
+ readonly label?: string;
22
+ /** When set, the primary button invokes this command (e.g. hooks quick pick). */
23
+ readonly commandId?: string;
24
+ /** When set, the primary button creates this file at the workspace root. */
25
+ readonly rootFile?: string;
26
+ /**
27
+ * Custom type label for the dropdown workspace/user create actions
28
+ * (e.g. "Rule" instead of "Instruction"). When undefined, the
29
+ * section's default type label is used.
30
+ */
31
+ readonly typeLabel?: string;
32
+ /**
33
+ * Root-level file shortcuts added to the dropdown (e.g. `['AGENTS.md']`).
34
+ * Each entry creates a "New {filename}" action that creates the file at
35
+ * the workspace root. Harnesses that don't support a file simply omit it.
36
+ */
37
+ readonly rootFileShortcuts?: readonly string[];
38
+ /**
39
+ * File extension override for new files created under this section.
40
+ * When set, files are created with this extension (e.g. `.md` for
41
+ * Claude rules) instead of the default for the prompt type
42
+ * (e.g. `.instructions.md`).
43
+ */
44
+ readonly fileExtension?: string;
45
+ }
46
+ export interface ICustomizationItemAction {
47
+ readonly id: string;
48
+ readonly label: string;
49
+ readonly tooltip?: string;
50
+ readonly icon?: ThemeIcon;
51
+ readonly enabled?: boolean;
52
+ run(): void | Promise<void>;
53
+ }
54
+ /**
55
+ * Describes a single harness option for the UI toggle.
56
+ */
57
+ export interface IHarnessDescriptor {
58
+ /**
59
+ * The harness/session-type identifier.
60
+ */
61
+ readonly id: string;
62
+ readonly label: string;
63
+ readonly icon: ThemeIcon;
64
+ /**
65
+ * Management sections that should be hidden when this harness is active.
66
+ * For example, Claude does not support prompt files so the Prompts
67
+ * section is hidden.
68
+ */
69
+ readonly hiddenSections?: readonly string[];
70
+ /**
71
+ * When `true`, the "Generate with AI" sparkle button is hidden and replaced
72
+ * with a plain "New X" manual-creation button (like sessions).
73
+ */
74
+ readonly hideGenerateButton?: boolean;
75
+ /**
76
+ * Per-section overrides for the create button behavior.
77
+ *
78
+ * A `commandId` entry replaces the button entirely with a command invocation.
79
+ *
80
+ * A `rootFile` entry makes the primary button create a specific file
81
+ * at the workspace root (e.g. Claude instructions → `CLAUDE.md`).
82
+ * When combined with `typeLabel`, the dropdown create actions use
83
+ * that label instead of the section's default (e.g. "Rule" instead
84
+ * of "Instruction").
85
+ */
86
+ readonly sectionOverrides?: ReadonlyMap<string, ISectionOverride>;
87
+ /**
88
+ * The chat agent ID that must be registered for this harness to appear.
89
+ * When `undefined`, the harness is always available (e.g. Local).
90
+ */
91
+ readonly requiredAgentId?: string;
92
+ /**
93
+ * When set, this harness is backed by an extension-contributed provider
94
+ * that can supply customization items directly (bypassing promptsService
95
+ * discovery and filtering).
96
+ */
97
+ readonly itemProvider?: ICustomizationItemProvider;
98
+ /**
99
+ * When `true`, the "Troubleshoot" action is available in item context
100
+ * menus. This opens chat with the `/troubleshoot` command pre-filled
101
+ * for the selected customization.
102
+ */
103
+ readonly supportsTroubleshoot?: boolean;
104
+ /**
105
+ * When set, this harness uses an opt-out sync model where all eligible
106
+ * local customizations are synced by default. The UI shows disable
107
+ * affordances when this harness is active.
108
+ */
109
+ readonly syncProvider?: ICustomizationSyncProvider;
110
+ /**
111
+ * Optional plugin-management actions shown in the Plugins section add menu.
112
+ * Harnesses can use these to add environment-specific commands alongside
113
+ * the default install-from-source action (for example, configuring plugins on
114
+ * a remote agent host). The create action remains a separate toolbar button.
115
+ */
116
+ readonly pluginActions?: readonly ICustomizationItemAction[];
117
+ /**
118
+ * Local MCP collection identifiers that do not apply to this harness.
119
+ * Host-published MCP servers remain visible even when their local counterpart
120
+ * belongs to a hidden collection.
121
+ */
122
+ readonly hiddenMcpServerCollectionIds?: readonly string[];
123
+ }
124
+ /**
125
+ * Represents a customization item provided by any source.
126
+ */
127
+ export interface ICustomizationItem {
128
+ /** Optional stable identity used by list widgets when URI alone is not unique. */
129
+ readonly itemKey?: string;
130
+ readonly uri: URI;
131
+ readonly type: string;
132
+ readonly name: string;
133
+ readonly description?: string;
134
+ /** Customization source (local, user, extension, plugin, builtin). Set by providers that know the source. */
135
+ readonly source: AICustomizationSource;
136
+ /** The extension identifier that contributed this customization, if any. */
137
+ readonly extensionId: string | undefined;
138
+ /** The URI of the plugin that contributed this customization, if any. */
139
+ readonly pluginUri: URI | undefined;
140
+ /** Human-readable name of the plugin that contributed this customization, if any. */
141
+ readonly pluginLabel?: string;
142
+ /** Server-reported loading status for this customization. */
143
+ readonly status?: "loading" | "loaded" | "degraded" | "error";
144
+ /** Human-readable status detail (e.g. error message or warning). */
145
+ readonly statusMessage?: string;
146
+ /** Whether this customization is currently enabled. */
147
+ readonly enabled?: boolean;
148
+ /** Host-published reason for a disabled customization. */
149
+ readonly disabledReason?: CustomizationDisabledReason;
150
+ /** When set, items with the same groupKey are displayed under a shared collapsible header. */
151
+ readonly groupKey?: string;
152
+ /** When set, shows a small inline badge next to the item name (e.g. an applyTo glob pattern). */
153
+ readonly badge?: string;
154
+ /** Tooltip shown when hovering the badge. */
155
+ readonly badgeTooltip?: string;
156
+ /**
157
+ * Whether this customization item can be invoked by the user.
158
+ * Relevant for prompt / skill and custom agents
159
+ */
160
+ readonly userInvocable?: boolean;
161
+ /** Optional inline/context-menu actions specific to this item. */
162
+ readonly actions?: readonly ICustomizationItemAction[];
163
+ }
164
+ export interface ICustomizationAgentRef {
165
+ readonly id: string;
166
+ readonly uri: URI;
167
+ /** Agent name (from frontmatter `name`, or file-derived) */
168
+ readonly name: string;
169
+ /** Optional short description for UI preview (from frontmatter `description`) */
170
+ readonly description?: string;
171
+ }
172
+ export declare function isPluginCustomizationItem(item: {
173
+ readonly type: string;
174
+ }): boolean;
175
+ export declare function getCustomizationDisabledLabel(reason: CustomizationDisabledReason | undefined): string;
176
+ /**
177
+ * Provider interface for extension-contributed harnesses that supply
178
+ * customization items directly from their SDK.
179
+ */
180
+ export interface ICustomizationItemProvider {
181
+ /**
182
+ * Event that fires when the provider's customizations change.
183
+ */
184
+ readonly onDidChange: Event<void>;
185
+ /**
186
+ * Provide the customization items this harness supports.
187
+ *
188
+ * @param sessionResource URI of the chat session whose
189
+ * customizations should be included. Providers that surface
190
+ * session-scoped state (e.g. an agent host) should read from
191
+ * this session.
192
+ */
193
+ provideChatSessionCustomizations(sessionResource: URI, token: CancellationToken): Promise<ICustomizationItem[] | undefined>;
194
+ /**
195
+ * Provide the custom agents this harness supports.
196
+ *
197
+ * @param sessionResource URI of the chat session whose
198
+ * customizations should be included. Providers that surface
199
+ * session-scoped state (e.g. an agent host) should read from
200
+ * this session.
201
+ */
202
+ provideCustomAgents?(sessionResource: URI, token: CancellationToken): Promise<readonly ICustomAgent[]>;
203
+ /**
204
+ * Provide the directories where new customization files of the given
205
+ * type can be created for this session. The result includes both
206
+ * workspace-scoped and user-scoped folders; the caller is responsible
207
+ * for partitioning them by storage target.
208
+ *
209
+ * @param sessionResource URI of the chat session whose
210
+ * creation locations should be returned.
211
+ */
212
+ provideSourceFolders?(sessionResource: URI, type: PromptsType, token: CancellationToken): Promise<readonly ICustomizationSourceFolder[] | undefined>;
213
+ }
214
+ /**
215
+ * A directory where new customization files of a given type can be created.
216
+ */
217
+ export interface ICustomizationSourceFolder {
218
+ readonly uri: URI;
219
+ /** Display label for the picker when multiple folders are offered. */
220
+ readonly label: string;
221
+ /** Customization source for this folder (typically 'local' or 'user' for writable creation locations). */
222
+ readonly source: AICustomizationSource;
223
+ /** Opaque provider-defined identity shared by folders that belong to the same destination. */
224
+ readonly destinationGroupId?: string;
225
+ }
226
+ /**
227
+ * Provider interface for harnesses that use an opt-out sync model.
228
+ *
229
+ * Every eligible local customization is synced by default; the user
230
+ * can disable individual items. The persisted set captures only the
231
+ * user's opt-outs.
232
+ */
233
+ export interface ICustomizationSyncProvider {
234
+ readonly onDidChange: Event<void>;
235
+ isDisabled(uri: URI): boolean;
236
+ setDisabled(uri: URI, disabled: boolean): void;
237
+ }
238
+ /**
239
+ * Minimal slash-command metadata resolved from the active harness.
240
+ */
241
+ export interface ICustomizationSlashCommand {
242
+ readonly uri: URI;
243
+ readonly type: PromptsType.prompt | PromptsType.skill;
244
+ readonly name: string;
245
+ readonly description?: string;
246
+ readonly userInvocable: boolean;
247
+ readonly sessionTypes?: readonly string[];
248
+ }
249
+ /**
250
+ * Builds the full source list from the base set (local, user, plugin)
251
+ * plus any additional sources specific to the window type.
252
+ *
253
+ * Core passes `[PromptsStorage.extension]`; sessions passes its
254
+ * BUILTIN_STORAGE constant.
255
+ */
256
+ /**
257
+ * Creates a "VS Code" harness descriptor that shows all storage sources
258
+ * with no user-root restrictions.
259
+ */
260
+ export declare function createVSCodeHarnessDescriptor(): IHarnessDescriptor;
261
+ /**
262
+ * Reusable base implementation of {@link ICustomizationHarnessService}.
263
+ * Concrete registrations only need to supply the list of harness
264
+ * descriptors and a default harness id.
265
+ */
266
+ export declare class CustomizationHarnessServiceBase implements ICustomizationHarnessService {
267
+ private readonly promptsService;
268
+ readonly _serviceBrand: undefined;
269
+ private readonly _onDidChangeSlashCommands;
270
+ readonly onDidChangeSlashCommands: Event<{
271
+ readonly sessionType: string;
272
+ }>;
273
+ private readonly _onDidChangeCustomAgents;
274
+ readonly onDidChangeCustomAgents: Event<{
275
+ readonly sessionType: string;
276
+ }>;
277
+ private readonly _providerListeners;
278
+ private _isDisposed;
279
+ private readonly _activeSessionResource;
280
+ readonly activeSessionResource: IObservable<URI>;
281
+ private readonly _activeHarness;
282
+ readonly activeHarness: IObservable<string>;
283
+ private readonly _staticHarnesses;
284
+ private readonly _externalHarnesses;
285
+ private readonly _availableHarnesses;
286
+ readonly availableHarnesses: IObservable<readonly IHarnessDescriptor[]>;
287
+ constructor(staticHarnesses: readonly IHarnessDescriptor[], defaultHarness: string, promptsService: IPromptsService);
288
+ private _getAllHarnesses;
289
+ private _refreshAvailableHarnesses;
290
+ private _rebindProviderListeners;
291
+ dispose(): void;
292
+ registerExternalHarness(descriptor: IHarnessDescriptor): IDisposable;
293
+ findHarnessById(id: string): IHarnessDescriptor | undefined;
294
+ setActiveSession(sessionResource: URI): void;
295
+ getActiveDescriptor(): IHarnessDescriptor;
296
+ getSlashCommands(sessionResource: URI, token: CancellationToken): Promise<readonly IChatPromptSlashCommand[]>;
297
+ getCustomAgents(sessionResource: URI, token: CancellationToken): Promise<readonly ICustomAgent[]>;
298
+ resolvePromptSlashCommand(name: string, sessionResource: URI, token: CancellationToken): Promise<IResolvedChatPromptSlashCommand | undefined>;
299
+ getSessionResourceForHarness(sessionType: string): URI;
300
+ }
@@ -0,0 +1,272 @@
1
+
2
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
3
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
4
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
6
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
7
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
+ import { AICustomizationManagementSection, BUILTIN_STORAGE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
9
+ import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
10
+ import { AGENT_MD_FILENAME } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
11
+ import { matchesSessionType, PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
12
+ import { SessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
13
+ import { CustomAgent } from './promptSyntax/service/promptsServiceImpl.js';
14
+ import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
15
+ import { getCanonicalPluginCommandId } from './plugins/agentPluginService.js';
16
+ import { getChatSessionType, LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
17
+ import { isAgentBuiltinCustomizationUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostCustomizationUri';
18
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
19
+ import { CustomizationEnablementKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
20
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
21
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
22
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
23
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
24
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation/state';
25
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation-run/state';
26
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
27
+ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
28
+
29
+ function isPluginCustomizationItem(item) {
30
+ return item.type === "plugin" || item.type === AICustomizationManagementSection.Plugins;
31
+ }
32
+ function getCustomizationDisabledLabel(reason) {
33
+ if (reason?.source === "plugin") {
34
+ return localize(10443, "Disabled (Plugin)");
35
+ }
36
+ switch (reason?.scope) {
37
+ case CustomizationEnablementKind.Workspace:
38
+ return localize(10444, "Disabled (Workspace)");
39
+ case CustomizationEnablementKind.Session:
40
+ return localize(10445, "Disabled (Session)");
41
+ case CustomizationEnablementKind.Global:
42
+ case undefined:
43
+ return localize(10446, "Disabled");
44
+ }
45
+ }
46
+ const EMPTY_DESCRIPTOR = {
47
+ id: "",
48
+ label: "",
49
+ icon: Codicon.sparkle
50
+ };
51
+ function createVSCodeHarnessDescriptor() {
52
+ return {
53
+ id: SessionType.Local,
54
+ label: ( localize(10447, "Local")),
55
+ icon: ThemeIcon.fromId(Codicon.vm.id),
56
+ supportsTroubleshoot: true,
57
+ hiddenSections: [AICustomizationManagementSection.Tools],
58
+ sectionOverrides: ( new Map([[AICustomizationManagementSection.Instructions, {
59
+ rootFileShortcuts: [AGENT_MD_FILENAME]
60
+ }]]))
61
+ };
62
+ }
63
+ class CustomizationHarnessServiceBase {
64
+ constructor(staticHarnesses, defaultHarness, promptsService) {
65
+ this.promptsService = promptsService;
66
+ this._onDidChangeSlashCommands = ( new Emitter());
67
+ this.onDidChangeSlashCommands = this._onDidChangeSlashCommands.event;
68
+ this._onDidChangeCustomAgents = ( new Emitter());
69
+ this.onDidChangeCustomAgents = this._onDidChangeCustomAgents.event;
70
+ this._providerListeners = [];
71
+ this._isDisposed = false;
72
+ this._externalHarnesses = [];
73
+ this._staticHarnesses = staticHarnesses;
74
+ this.promptsService = promptsService;
75
+ this._activeSessionResource = observableValue(this, this.getSessionResourceForHarness(defaultHarness));
76
+ this.activeSessionResource = this._activeSessionResource;
77
+ this._activeHarness = derived(
78
+ this,
79
+ reader => getChatSessionType(this._activeSessionResource.read(reader))
80
+ );
81
+ this.activeHarness = this._activeHarness;
82
+ this._availableHarnesses = observableValue(this, [...this._staticHarnesses]);
83
+ this.availableHarnesses = this._availableHarnesses;
84
+ this._rebindProviderListeners();
85
+ }
86
+ _getAllHarnesses() {
87
+ const externalIds = ( new Set(( this._externalHarnesses.map(h => h.id))));
88
+ return [...this._staticHarnesses.filter(h => !( externalIds.has(h.id))), ...this._externalHarnesses];
89
+ }
90
+ _refreshAvailableHarnesses() {
91
+ if (this._isDisposed) {
92
+ return;
93
+ }
94
+ this._availableHarnesses.set(this._getAllHarnesses(), undefined);
95
+ this._rebindProviderListeners();
96
+ }
97
+ _rebindProviderListeners() {
98
+ for (const listener of this._providerListeners) {
99
+ listener.dispose();
100
+ }
101
+ this._providerListeners.length = 0;
102
+ for (const harness of this._getAllHarnesses()) {
103
+ const provider = harness.itemProvider;
104
+ if (!provider) {
105
+ this._providerListeners.push(
106
+ this.promptsService.onDidChangeSlashCommands(() => this._onDidChangeSlashCommands.fire({
107
+ sessionType: harness.id
108
+ }))
109
+ );
110
+ this._providerListeners.push(
111
+ this.promptsService.onDidChangeCustomAgents(() => this._onDidChangeCustomAgents.fire({
112
+ sessionType: harness.id
113
+ }))
114
+ );
115
+ } else {
116
+ this._providerListeners.push(provider.onDidChange(() => this._onDidChangeSlashCommands.fire({
117
+ sessionType: harness.id
118
+ })));
119
+ this._providerListeners.push(provider.onDidChange(() => this._onDidChangeCustomAgents.fire({
120
+ sessionType: harness.id
121
+ })));
122
+ }
123
+ }
124
+ }
125
+ dispose() {
126
+ this._isDisposed = true;
127
+ for (const listener of this._providerListeners) {
128
+ listener.dispose();
129
+ }
130
+ this._providerListeners.length = 0;
131
+ this._onDidChangeSlashCommands.dispose();
132
+ this._onDidChangeCustomAgents.dispose();
133
+ }
134
+ registerExternalHarness(descriptor) {
135
+ this._externalHarnesses.push(descriptor);
136
+ this._refreshAvailableHarnesses();
137
+ return {
138
+ dispose: () => {
139
+ if (this._isDisposed) {
140
+ return;
141
+ }
142
+ const idx = this._externalHarnesses.indexOf(descriptor);
143
+ if (idx >= 0) {
144
+ this._externalHarnesses.splice(idx, 1);
145
+ this._refreshAvailableHarnesses();
146
+ }
147
+ }
148
+ };
149
+ }
150
+ findHarnessById(id) {
151
+ return this._getAllHarnesses().find(h => h.id === id);
152
+ }
153
+ setActiveSession(sessionResource) {
154
+ this._activeSessionResource.set(sessionResource, undefined);
155
+ }
156
+ getActiveDescriptor() {
157
+ const activeId = this._activeHarness.get();
158
+ const descriptor = this.findHarnessById(activeId);
159
+ return descriptor ?? EMPTY_DESCRIPTOR;
160
+ }
161
+ async getSlashCommands(sessionResource, token) {
162
+ const sessionType = getChatSessionType(sessionResource);
163
+ const harness = this.findHarnessById(sessionType);
164
+ if (!harness || !harness.itemProvider) {
165
+ const commands = await this.promptsService.getPromptSlashCommands(token);
166
+ return commands.filter(command => matchesSessionType(command.sessionTypes, sessionType));
167
+ }
168
+ const items = await harness.itemProvider.provideChatSessionCustomizations(sessionResource, token);
169
+ if (!items) {
170
+ return [];
171
+ }
172
+ const result = [];
173
+ for (const item of items) {
174
+ if ((item.enabled !== false) && (item.type === PromptsType.prompt || item.type === PromptsType.skill)) {
175
+ const storage = item.source;
176
+ const narrowStorage = storage !== undefined && storage !== BUILTIN_STORAGE ? storage : PromptsStorage.local;
177
+ result.push({
178
+ uri: item.uri,
179
+ type: item.type,
180
+ name: item.pluginUri ? getCanonicalPluginCommandId({
181
+ uri: item.pluginUri,
182
+ label: item.pluginLabel
183
+ }, item.name) : item.name,
184
+ description: item.description,
185
+ userInvocable: item.userInvocable ?? true,
186
+ storage: narrowStorage,
187
+ sessionTypes: [sessionType]
188
+ });
189
+ }
190
+ }
191
+ return result;
192
+ }
193
+ async getCustomAgents(sessionResource, token) {
194
+ const sessionType = getChatSessionType(sessionResource);
195
+ const harness = this.findHarnessById(sessionType);
196
+ if (!harness || !harness.itemProvider) {
197
+ const allAgents = await this.promptsService.getCustomAgents(token);
198
+ return allAgents.filter(agent => matchesSessionType(agent.sessionTypes, sessionType));
199
+ }
200
+ if (harness.itemProvider.provideCustomAgents) {
201
+ return harness.itemProvider.provideCustomAgents(sessionResource, token);
202
+ }
203
+ const items = await harness.itemProvider.provideChatSessionCustomizations(sessionResource, token);
204
+ if (!items || token.isCancellationRequested) {
205
+ return [];
206
+ }
207
+ const getSource = item => {
208
+ if (item.source === PromptsStorage.extension && item.extensionId) {
209
+ return {
210
+ storage: PromptsStorage.extension,
211
+ extensionId: ( new ExtensionIdentifier(item.extensionId))
212
+ };
213
+ } else if (item.source === PromptsStorage.plugin && item.pluginUri) {
214
+ return {
215
+ storage: PromptsStorage.plugin,
216
+ pluginUri: item.pluginUri
217
+ };
218
+ } else if (item.source === PromptsStorage.user) {
219
+ return {
220
+ storage: PromptsStorage.user
221
+ };
222
+ }
223
+ return {
224
+ storage: PromptsStorage.local
225
+ };
226
+ };
227
+ const result = [];
228
+ for (const item of items) {
229
+ if (item.type === PromptsType.agent) {
230
+ const promptFile = await this.promptsService.parseNew(item.uri, token);
231
+ const extra = {
232
+ name: item.name,
233
+ description: item.description,
234
+ sessionTypes: [sessionType],
235
+ hooks: undefined,
236
+ source: getSource(item),
237
+ type: PromptsType.agent,
238
+ enabled: item.enabled !== false
239
+ };
240
+ result.push(CustomAgent.fromParsedPromptFile(promptFile, extra));
241
+ }
242
+ }
243
+ return result;
244
+ }
245
+ async resolvePromptSlashCommand(name, sessionResource, token) {
246
+ const commands = await this.getSlashCommands(sessionResource, token);
247
+ const command = commands.find(cmd => cmd.name === name);
248
+ if (command) {
249
+ if (isAgentBuiltinCustomizationUri(command.uri)) {
250
+ return command;
251
+ }
252
+ const parsedPromptFile = await this.promptsService.parseNew(command.uri, token);
253
+ return {
254
+ ...command,
255
+ userInvocable: parsedPromptFile.header?.userInvocable ?? command.userInvocable,
256
+ parsedPromptFile
257
+ };
258
+ }
259
+ return undefined;
260
+ }
261
+ getSessionResourceForHarness(sessionType) {
262
+ if (sessionType === SessionType.Local) {
263
+ return LocalChatSessionUri.getNewSessionUri();
264
+ }
265
+ return ( URI.from({
266
+ scheme: sessionType,
267
+ path: "/untitled-2"
268
+ }));
269
+ }
270
+ }
271
+
272
+ export { CustomizationHarnessServiceBase, createVSCodeHarnessDescriptor, getCustomizationDisabledLabel, isPluginCustomizationItem };
@@ -0,0 +1,25 @@
1
+ import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
2
+ import { AgentPluginDiscoveryPriority, IAgentPlugin } from "./agentPluginService.js";
3
+ import { CollisionEnablementModel, IEnablementModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/enablement";
4
+ export interface IDiscoveredAgentPlugins {
5
+ readonly plugins: readonly IAgentPlugin[];
6
+ readonly priority: AgentPluginDiscoveryPriority;
7
+ readonly order: number;
8
+ }
9
+ export declare class AgentPluginCollisionEnablementModel extends CollisionEnablementModel {
10
+ constructor(base: IEnablementModel, collisionGroups: IObservable<ReadonlyMap<string, readonly string[]>>);
11
+ }
12
+ export declare function getSortedAgentPlugins(discoveries: readonly IDiscoveredAgentPlugins[]): readonly IAgentPlugin[];
13
+ export declare function getCanonicalAgentPluginCollisionGroups(discoveries: readonly IDiscoveredAgentPlugins[], isBlocked?: (plugin: IAgentPlugin) => boolean): ReadonlyMap<string, readonly string[]>;
14
+ /**
15
+ * Whether the `ChatEnabledPlugins` enterprise policy explicitly blocks this plugin.
16
+ *
17
+ * The policy is a **deny list**, not an allowlist: enterprise-managed `enabledPlugins` entries
18
+ * add to (never replace) the plugins a user has installed. A plugin is blocked only when its
19
+ * policy id is mapped to `false`; entries mapped to `true` enable the plugin, and a plugin the
20
+ * policy never mentions is left to the user's own enablement. This keeps a customer's existing
21
+ * plugins working when their enterprise deploys `enabledPlugins` for a different plugin.
22
+ */
23
+ export declare function isAgentPluginBlockedByPolicy(plugin: IAgentPlugin, enabledPluginsPolicy: Record<string, boolean> | undefined): boolean;
24
+ export declare function isAgentPluginForceEnabledByPolicy(plugin: IAgentPlugin, enabledPluginsPolicy: Record<string, boolean> | undefined): boolean;
25
+ export declare function getAgentPluginPolicyId(plugin: IAgentPlugin): string | undefined;