@codingame/monaco-vscode-chat-service-override 31.0.0 → 32.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 (341) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +21 -5
  3. package/package.json +5 -5
  4. package/vscode/src/vs/base/common/defaultAccount.d.ts +69 -0
  5. package/vscode/src/vs/base/common/defaultAccount.js +12 -0
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +91 -22
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +301 -68
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +24 -5
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +89 -16
  10. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +17 -5
  11. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +73 -10
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +32 -6
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +32 -20
  14. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.d.ts +37 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.js +15 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +242 -201
  17. package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
  18. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +35 -0
  19. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +106 -0
  20. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +38 -30
  21. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +2 -1
  22. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +114 -4
  23. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +10 -10
  24. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +52 -19
  25. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +42 -0
  26. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +7 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +42 -41
  28. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +6 -6
  29. package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +15 -0
  30. package/vscode/src/vs/platform/agentHost/common/transportConstants.js +6 -0
  31. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +4 -3
  32. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +4 -3
  33. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
  34. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +15 -7
  35. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.d.ts +19 -0
  36. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.js +17 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -10
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +64 -59
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +31 -16
  44. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +18 -9
  45. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +16 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  47. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +30 -5
  48. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +8 -7
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +27 -18
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
  58. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  59. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -20
  60. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +22 -22
  61. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.d.ts +12 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +171 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +1 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +4 -4
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +1 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -10
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +28 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +99 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +2 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +11 -4
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +9 -3
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +63 -53
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +10 -7
  78. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +3 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  80. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  81. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -4
  83. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -48
  84. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  85. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  86. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +8 -4
  88. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +99 -39
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -30
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +78 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +38 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +35 -37
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +347 -326
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +6 -2
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +1 -11
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +113 -109
  98. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +37 -15
  99. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +436 -134
  100. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +2 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +52 -26
  103. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +13 -5
  106. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +23 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +60 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +25 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +93 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -2
  111. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +73 -104
  112. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +272 -41
  113. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +12 -2
  114. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +30 -1
  115. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +430 -185
  116. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +5 -2
  117. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +44 -3
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +480 -279
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.d.ts +138 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +221 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +84 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +1216 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +2 -1
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +32 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +26 -19
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +28 -25
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -24
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -1
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +68 -33
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +650 -6
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +2 -2
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +29 -0
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +390 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +18 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +11 -11
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -2
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -7
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +1 -7
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +6 -87
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -1
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +116 -182
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -39
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +61 -41
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +27 -27
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -0
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -13
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +20 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +106 -36
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +25 -7
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +629 -425
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +9 -1
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +105 -29
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +175 -148
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -33
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +9 -2
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  188. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  189. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  190. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  191. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  192. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.d.ts +58 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +339 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +160 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +9 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +123 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +37 -0
  199. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +572 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +36 -0
  201. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +167 -0
  202. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +49 -7
  203. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +315 -19
  204. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +45 -24
  205. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  206. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  207. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  208. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +44 -40
  209. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  210. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  211. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  213. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  214. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  215. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  216. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  217. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  218. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  219. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +9 -1
  220. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +111 -52
  221. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +3 -7
  222. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +13 -47
  223. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +3 -2
  224. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +4 -8
  225. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +18 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +56 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -7
  228. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +14 -52
  229. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  230. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
  231. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +17 -2
  232. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
  233. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +23 -12
  234. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +39 -0
  235. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +136 -0
  236. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +72 -0
  237. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +56 -0
  238. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +7 -0
  239. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +14 -1
  240. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +41 -26
  241. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +30 -12
  242. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  244. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +2 -5
  245. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +25 -6
  246. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  247. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -2
  248. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +5 -4
  249. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -0
  250. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +108 -45
  251. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -3
  252. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +3 -1
  253. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +20 -1
  254. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +65 -26
  255. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
  256. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +38 -11
  257. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -1
  258. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +165 -16
  259. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +1 -0
  260. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +62 -1
  261. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  262. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -1
  263. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  264. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -3
  265. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +15 -21
  266. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +1 -3
  267. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +18 -24
  268. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +4 -2
  269. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +203 -180
  270. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  271. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +30 -0
  272. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +35 -0
  273. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +2 -1
  274. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +27 -2
  275. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
  276. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +14 -49
  277. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +0 -16
  278. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +35 -177
  279. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -8
  280. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -2
  281. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -3
  282. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +4 -4
  283. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
  284. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +13 -13
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  289. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  290. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  291. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  292. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +29 -3
  293. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +129 -3
  294. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -2
  295. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +2 -1
  296. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -6
  297. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +1 -4
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +12 -38
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +12 -7
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +77 -70
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.d.ts +32 -0
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +232 -0
  311. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +83 -0
  312. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.js +243 -0
  313. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +0 -749
  314. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +0 -14
  315. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +0 -17
  316. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +0 -5
  317. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +0 -40
  318. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +0 -14
  319. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +0 -61
  320. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +0 -638
  321. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -131
  322. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -363
  323. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -24
  324. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -306
  325. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -23
  326. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +0 -97
  327. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css +0 -57
  328. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -50
  329. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -29
  330. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  331. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
  332. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  333. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  334. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  335. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  336. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -242
  337. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1701
  338. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -191
  339. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -728
  340. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +0 -14
  341. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +0 -69
@@ -2,13 +2,14 @@
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
4
  import * as aiCustomizationManagement from './media/aiCustomizationManagement.css';
5
- import { $ as $$1, append, Dimension, addDisposableListener } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
+ import { $ as $$1, append, addDisposableListener, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
+ import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
6
7
  import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
7
- import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
8
8
  import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
9
9
  import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
10
10
  import { DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
11
11
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
12
+ import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
12
13
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
13
14
  import { SplitView, Sizing } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/splitview/splitview';
14
15
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
@@ -40,6 +41,8 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/sear
40
41
  import { PANEL_BORDER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
41
42
  import { AICustomizationManagementEditorInput } from './aiCustomizationManagementEditorInput.js';
42
43
  import { AICustomizationListWidget } from './aiCustomizationListWidget.js';
44
+ import { ITEMS_MODEL_SECTIONS } from './aiCustomizationItemsModel.js';
45
+ import { IAICustomizationItemsModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service';
43
46
  import { McpListWidget } from './mcpListWidget.js';
44
47
  import { PluginListWidget } from './pluginListWidget.js';
45
48
  import { AI_CUSTOMIZATION_MANAGEMENT_EDITOR_ID, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_EDITOR, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_SECTION, CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_HARNESS, AI_CUSTOMIZATION_MANAGEMENT_SELECTED_SECTION_KEY, AI_CUSTOMIZATION_MANAGEMENT_SIDEBAR_WIDTH_KEY, SIDEBAR_DEFAULT_WIDTH, SIDEBAR_MAX_WIDTH, SIDEBAR_MIN_WIDTH, CONTENT_MIN_WIDTH } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement';
@@ -49,6 +52,7 @@ import { PromptsType, Target } from '@codingame/monaco-vscode-api/vscode/vs/work
49
52
  import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
50
53
  import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
51
54
  import { AGENT_MD_FILENAME } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
55
+ import { getTarget, getAttributeDefinition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes';
52
56
  import { NEW_SKILL_COMMAND_ID, NEW_AGENT_COMMAND_ID, NEW_INSTRUCTIONS_COMMAND_ID, NEW_PROMPT_COMMAND_ID } from '@codingame/monaco-vscode-xterm-addons-common/vscode/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions';
53
57
  import { showConfigureHooksQuickPick } from '../promptSyntax/hookActions.js';
54
58
  import { resolveWorkspaceTargetDirectory, resolveUserTargetDirectory } from './customizationCreatorService.js';
@@ -63,20 +67,20 @@ import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/w
63
67
  import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
64
68
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
65
69
  import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
70
+ import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
66
71
  import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
67
72
  import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
68
73
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
69
74
  import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
70
- import { McpServerEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpServerEditorInput';
71
- import { McpServerEditor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/browser/mcpServerEditor';
72
75
  import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
73
- import { AgentPluginEditor } from '../agentPluginEditor/agentPluginEditor.js';
74
- import { AgentPluginEditorInput } from '../agentPluginEditor/agentPluginEditorInput.js';
75
- import { CustomizationHarness, matchesWorkspaceSubpath } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService';
76
+ import { EmbeddedMcpServerDetail } from './embeddedMcpServerDetail.js';
77
+ import { EmbeddedAgentPluginDetail } from './embeddedAgentPluginDetail.js';
78
+ import { matchesWorkspaceSubpath } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService';
76
79
  import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
77
80
  import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
78
81
  import { AICustomizationWelcomePage } from './aiCustomizationWelcomePage.js';
79
82
  import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
83
+ import { SessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
80
84
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
81
85
  import { Orientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
82
86
  import { AICustomizationManagementSection, BUILTIN_STORAGE } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
@@ -85,7 +89,7 @@ var AICustomizationManagementEditor_1;
85
89
  registerCss(aiCustomizationManagement);
86
90
  const $ = $$1;
87
91
  const aiCustomizationManagementSashBorder = registerColor("aiCustomizationManagement.sashBorder", PANEL_BORDER, ( localize(
88
- 5410,
92
+ 5490,
89
93
  "The color of the Agent Customizations editor splitview sash border."
90
94
  )));
91
95
  class SectionItemDelegate {
@@ -159,13 +163,15 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
159
163
  configurationService,
160
164
  workingCopyService,
161
165
  hoverService,
166
+ markdownRendererService,
162
167
  modelService,
163
168
  quickInputService,
164
169
  contextMenuService,
165
170
  fileService,
166
171
  notificationService,
167
172
  harnessService,
168
- viewsService
173
+ viewsService,
174
+ itemsModel
169
175
  ) {
170
176
  super(
171
177
  AICustomizationManagementEditor_1.ID,
@@ -184,6 +190,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
184
190
  this.configurationService = configurationService;
185
191
  this.workingCopyService = workingCopyService;
186
192
  this.hoverService = hoverService;
193
+ this.markdownRendererService = markdownRendererService;
187
194
  this.modelService = modelService;
188
195
  this.quickInputService = quickInputService;
189
196
  this.contextMenuService = contextMenuService;
@@ -191,16 +198,24 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
191
198
  this.notificationService = notificationService;
192
199
  this.harnessService = harnessService;
193
200
  this.viewsService = viewsService;
201
+ this.itemsModel = itemsModel;
194
202
  this.editorActionButtonInProgress = false;
203
+ this.editorDisplayMode = "preview";
195
204
  this.editorModelChangeDisposables = this._register(( new DisposableStore()));
205
+ this.editorPreviewDisposables = this._register(( new DisposableStore()));
206
+ this.editorPreviewRenderScheduler = this._register(( new RunOnceScheduler(() => {
207
+ if (this.viewMode === "editor" && this.editorDisplayMode === "preview") {
208
+ this.renderCurrentEditorPreview();
209
+ }
210
+ }, 200)));
196
211
  this.builtinEditingSessions = ( new Map());
212
+ this.currentEditingReadOnly = false;
197
213
  this.viewMode = "list";
198
214
  this.mcpDetailDisposables = this._register(( new DisposableStore()));
199
215
  this.pluginDetailDisposables = this._register(( new DisposableStore()));
200
216
  this.sections = [];
201
217
  this.allSections = [];
202
218
  this.editorDisposables = this._register(( new DisposableStore()));
203
- this.promptsSectionCountScheduler = this._register(( new RunOnceScheduler(() => this._doRefreshAllPromptsSectionCounts(), 100)));
204
219
  this._editorContentChanged = false;
205
220
  this.inEditorContextKey = CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_EDITOR.bindTo(contextKeyService);
206
221
  this.sectionContextKey = CONTEXT_AI_CUSTOMIZATION_MANAGEMENT_SECTION.bindTo(contextKeyService);
@@ -218,62 +233,62 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
218
233
  this._register(toDisposable(() => this.disposeBuiltinEditingSessions()));
219
234
  const sectionInfo = {
220
235
  [AICustomizationManagementSection.Agents]: {
221
- label: ( localize(5411, "Agents")),
236
+ label: ( localize(5491, "Agents")),
222
237
  icon: agentIcon,
223
238
  description: ( localize(
224
- 5412,
239
+ 5492,
225
240
  "Define custom agents with specialized personas, tool access, and instructions for specific tasks."
226
241
  ))
227
242
  },
228
243
  [AICustomizationManagementSection.Skills]: {
229
- label: ( localize(5413, "Skills")),
244
+ label: ( localize(5493, "Skills")),
230
245
  icon: skillIcon,
231
246
  description: ( localize(
232
- 5414,
247
+ 5494,
233
248
  "Create reusable skill files that provide domain-specific knowledge and workflows."
234
249
  ))
235
250
  },
236
251
  [AICustomizationManagementSection.Instructions]: {
237
- label: ( localize(5415, "Instructions")),
252
+ label: ( localize(5495, "Instructions")),
238
253
  icon: instructionsIcon,
239
254
  description: ( localize(
240
- 5416,
255
+ 5496,
241
256
  "Set always-on instructions that guide AI behavior across your workspace or user profile."
242
257
  ))
243
258
  },
244
259
  [AICustomizationManagementSection.Prompts]: {
245
- label: ( localize(5417, "Prompts")),
260
+ label: ( localize(5497, "Prompts")),
246
261
  icon: promptIcon,
247
- description: ( localize(5418, "Reusable prompt templates that can be invoked as slash commands."))
262
+ description: ( localize(5498, "Reusable prompt templates that can be invoked as slash commands."))
248
263
  },
249
264
  [AICustomizationManagementSection.Hooks]: {
250
- label: ( localize(5419, "Hooks")),
265
+ label: ( localize(5499, "Hooks")),
251
266
  icon: hookIcon,
252
267
  description: ( localize(
253
- 5420,
268
+ 5500,
254
269
  "Configure automated actions triggered by events like saving files or running tasks."
255
270
  ))
256
271
  },
257
272
  [AICustomizationManagementSection.McpServers]: {
258
- label: ( localize(5421, "MCP Servers")),
273
+ label: ( localize(5501, "MCP Servers")),
259
274
  icon: Codicon.server,
260
275
  description: ( localize(
261
- 5422,
276
+ 5502,
262
277
  "Connect external tool servers that extend AI capabilities with custom tools and data sources."
263
278
  ))
264
279
  },
265
280
  [AICustomizationManagementSection.Plugins]: {
266
- label: ( localize(5423, "Plugins")),
281
+ label: ( localize(5503, "Plugins")),
267
282
  icon: pluginIcon,
268
283
  description: ( localize(
269
- 5424,
284
+ 5504,
270
285
  "Install and manage agent plugins that add additional tools, skills, and integrations."
271
286
  ))
272
287
  },
273
288
  [AICustomizationManagementSection.Models]: {
274
- label: ( localize(5425, "Models")),
289
+ label: ( localize(5505, "Models")),
275
290
  icon: Codicon.vm,
276
- description: ( localize(5426, "Configure and manage language models available for use."))
291
+ description: ( localize(5506, "Configure and manage language models available for use."))
277
292
  }
278
293
  };
279
294
  for (const id of this.workspaceService.managementSections) {
@@ -323,7 +338,8 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
323
338
  layout: (width, _, height) => {
324
339
  this.sidebarContainer.style.width = `${width}px`;
325
340
  if (height !== undefined) {
326
- this.sectionsList.layout(height - 8, width);
341
+ const headerHeight = this.sidebarHeaderContainer?.offsetHeight ?? 0;
342
+ this.sectionsList.layout(Math.max(0, height - 8 - headerHeight), width);
327
343
  }
328
344
  }
329
345
  }, savedWidth, undefined, true);
@@ -348,14 +364,6 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
348
364
  height: Math.max(0, height - editorHeaderHeight - padding)
349
365
  });
350
366
  }
351
- if (this.viewMode === "mcpDetail" && this.embeddedMcpEditor) {
352
- const backHeaderHeight = 40;
353
- this.embeddedMcpEditor.layout(new Dimension(width, Math.max(0, height - backHeaderHeight)));
354
- }
355
- if (this.viewMode === "pluginDetail" && this.embeddedPluginEditor) {
356
- const backHeaderHeight = 40;
357
- this.embeddedPluginEditor.layout(new Dimension(width, Math.max(0, height - backHeaderHeight)));
358
- }
359
367
  }
360
368
  }
361
369
  }, Sizing.Distribute, undefined, true);
@@ -381,7 +389,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
381
389
  let hidden;
382
390
  if (this.isHarnessSelectorEnabled) {
383
391
  const activeId = this.harnessService.activeHarness.get();
384
- const descriptor = this.harnessService.availableHarnesses.get().find(h => h.id === activeId);
392
+ const descriptor = this.harnessService.findHarnessById(activeId);
385
393
  hidden = ( new Set(descriptor?.hiddenSections ?? []));
386
394
  } else {
387
395
  hidden = ( new Set());
@@ -417,8 +425,8 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
417
425
  setRowLineHeight: false,
418
426
  horizontalScrolling: false,
419
427
  accessibilityProvider: {
420
- getAriaLabel: item => item.label,
421
- getWidgetAriaLabel: () => ( localize(5427, "Agent Customization Sections"))
428
+ getAriaLabel: item => item.count > 0 ? ( localize(5507, "{0}, {1} items", item.label, item.count)) : item.label,
429
+ getWidgetAriaLabel: () => ( localize(5508, "Agent Customization Sections"))
422
430
  },
423
431
  openOnSingleClick: true,
424
432
  identityProvider: {
@@ -454,31 +462,33 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
454
462
  }
455
463
  }
456
464
  this._previousActiveHarnessId = activeId;
457
- this.refreshAllPromptsSectionCounts();
458
465
  }));
459
466
  if (!this.isHarnessSelectorEnabled) {
460
- this.harnessService.setActiveHarness(CustomizationHarness.VSCode);
467
+ this.harnessService.setActiveHarness(SessionType.Local);
461
468
  }
462
469
  this.editorDisposables.add(this.configurationService.onDidChangeConfiguration(e => {
463
470
  if (e.affectsConfiguration(ChatConfiguration.ChatCustomizationHarnessSelectorEnabled)) {
464
471
  if (!this.isHarnessSelectorEnabled) {
465
- this.harnessService.setActiveHarness(CustomizationHarness.VSCode);
472
+ this.harnessService.setActiveHarness(SessionType.Local);
466
473
  }
467
474
  }
475
+ if (e.affectsConfiguration(ChatConfiguration.ChatCustomizationsStructuredPreviewEnabled)) {
476
+ this.onStructuredPreviewSettingChanged();
477
+ }
468
478
  }));
469
479
  }
470
480
  createSidebarHeader(sidebarContent) {
471
481
  const headerRow = this.sidebarHeaderContainer = append(sidebarContent, $(".sidebar-header-row"));
472
482
  const homeButton = this.homeButton = append(headerRow, $("button.sidebar-home-button"));
473
- homeButton.setAttribute("aria-label", ( localize(5428, "Overview")));
483
+ homeButton.setAttribute("aria-label", ( localize(5509, "Overview")));
474
484
  this.editorDisposables.add(
475
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), homeButton, ( localize(5429, "Back to overview")))
485
+ this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), homeButton, ( localize(5510, "Back to overview")))
476
486
  );
477
487
  const homeIcon = append(homeButton, $("span.sidebar-home-icon"));
478
488
  homeIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.home));
479
489
  homeIcon.setAttribute("aria-hidden", "true");
480
490
  const homeLabel = this.homeButtonLabel = append(homeButton, $("span.sidebar-home-label"));
481
- homeLabel.textContent = ( localize(5430, "Overview"));
491
+ homeLabel.textContent = ( localize(5511, "Overview"));
482
492
  this.editorDisposables.add(addDisposableListener(homeButton, "click", () => {
483
493
  this.showWelcomePage();
484
494
  }));
@@ -491,11 +501,11 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
491
501
  }
492
502
  const container = this.harnessDropdownContainer = append(parent, $(".sidebar-harness-dropdown"));
493
503
  this.harnessDropdownButton = append(container, $("button.harness-dropdown-button"));
494
- this.harnessDropdownButton.setAttribute("aria-label", ( localize(5431, "Select customization target")));
504
+ this.harnessDropdownButton.setAttribute("aria-label", ( localize(5512, "Select customization target")));
495
505
  this.harnessDropdownButton.setAttribute("aria-haspopup", "listbox");
496
506
  this.editorDisposables.add(
497
507
  this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), this.harnessDropdownButton, () => {
498
- const descriptor = this.harnessService.availableHarnesses.get().find(h => h.id === this.harnessService.activeHarness.get());
508
+ const descriptor = this.harnessService.findHarnessById(this.harnessService.activeHarness.get());
499
509
  return descriptor?.label ?? "";
500
510
  })
501
511
  );
@@ -606,23 +616,27 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
606
616
  }, this.commandService, this.workspaceService, this.hoverService)));
607
617
  this.welcomePage.rebuildCards(( new Set(( this.sections.map(s => s.id)))));
608
618
  }
609
- createBackArrowButton() {
619
+ createBackArrowButton(onClick) {
610
620
  const button = $("button.section-back-arrow-button");
611
621
  button.type = "button";
612
- button.setAttribute("aria-label", ( localize(5432, "Back to overview")));
622
+ button.setAttribute("aria-label", ( localize(5513, "Back to overview")));
613
623
  this.editorDisposables.add(
614
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), button, ( localize(5433, "Back to overview")))
624
+ this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), button, ( localize(5514, "Back to overview")))
615
625
  );
616
626
  const icon = append(button, $("span.section-back-arrow-icon"));
617
627
  icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.arrowLeft));
618
628
  icon.setAttribute("aria-hidden", "true");
619
629
  this.editorDisposables.add(addDisposableListener(button, "click", () => {
620
- this.showWelcomePage();
630
+ if (onClick) {
631
+ onClick();
632
+ } else {
633
+ this.showWelcomePage();
634
+ }
621
635
  }));
622
636
  return button;
623
637
  }
624
- injectBackArrowIntoSearchRow(widget) {
625
- widget.prependToSearchRow(this.createBackArrowButton());
638
+ injectBackArrowIntoSearchRow(widget, onClick) {
639
+ widget.prependToSearchRow(this.createBackArrowButton(onClick));
626
640
  }
627
641
  createContent() {
628
642
  const contentInner = append(this.contentContainer, $(".content-inner"));
@@ -671,11 +685,11 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
671
685
  this.modelsFooterElement = append(this.modelsContentContainer, $(".section-footer"));
672
686
  const modelsDescription = append(this.modelsFooterElement, $("p.section-footer-description"));
673
687
  modelsDescription.textContent = ( localize(
674
- 5434,
688
+ 5515,
675
689
  "Browse and manage language models from different providers. Select models for use in chat, code completion, and other AI features."
676
690
  ));
677
691
  const modelsLink = append(this.modelsFooterElement, $("a.section-footer-link"));
678
- modelsLink.textContent = ( localize(5435, "Learn more about language models"));
692
+ modelsLink.textContent = ( localize(5516, "Learn more about language models"));
679
693
  modelsLink.href = "https://code.visualstudio.com/docs/copilot/customization/language-models";
680
694
  this.editorDisposables.add(addDisposableListener(modelsLink, "click", e => {
681
695
  e.preventDefault();
@@ -686,7 +700,13 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
686
700
  this.mcpContentContainer = append(contentInner, $(".mcp-content-container"));
687
701
  this.mcpListWidget = this.editorDisposables.add(this.instantiationService.createInstance(McpListWidget));
688
702
  this.mcpContentContainer.appendChild(this.mcpListWidget.element);
689
- this.injectBackArrowIntoSearchRow(this.mcpListWidget);
703
+ this.injectBackArrowIntoSearchRow(this.mcpListWidget, () => {
704
+ if (this.mcpListWidget.isInBrowseMode()) {
705
+ this.mcpListWidget.exitBrowseMode();
706
+ } else {
707
+ this.showWelcomePage();
708
+ }
709
+ });
690
710
  this.mcpDetailContainer = append(contentInner, $(".mcp-detail-container"));
691
711
  this.createEmbeddedMcpDetail();
692
712
  this.editorDisposables.add(this.mcpListWidget.onDidSelectServer(server => {
@@ -700,7 +720,13 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
700
720
  this.pluginContentContainer = append(contentInner, $(".plugin-content-container"));
701
721
  this.pluginListWidget = this.editorDisposables.add(this.instantiationService.createInstance(PluginListWidget));
702
722
  this.pluginContentContainer.appendChild(this.pluginListWidget.element);
703
- this.injectBackArrowIntoSearchRow(this.pluginListWidget);
723
+ this.injectBackArrowIntoSearchRow(this.pluginListWidget, () => {
724
+ if (this.pluginListWidget.isInBrowseMode()) {
725
+ this.pluginListWidget.exitBrowseMode();
726
+ } else {
727
+ this.showWelcomePage();
728
+ }
729
+ });
704
730
  this.pluginDetailContainer = append(contentInner, $(".plugin-detail-container"));
705
731
  this.createEmbeddedPluginDetail();
706
732
  this.editorDisposables.add(this.pluginListWidget.onDidSelectPlugin(item => {
@@ -734,19 +760,12 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
734
760
  }));
735
761
  this.modelsWidget.fireItemCount();
736
762
  }
737
- this.editorDisposables.add(
738
- this.promptsService.onDidChangeCustomAgents(() => this.refreshAllPromptsSectionCounts())
739
- );
740
- this.editorDisposables.add(
741
- this.promptsService.onDidChangeSkills(() => this.refreshAllPromptsSectionCounts())
742
- );
743
- this.editorDisposables.add(
744
- this.promptsService.onDidChangeInstructions(() => this.refreshAllPromptsSectionCounts())
745
- );
746
- this.editorDisposables.add(
747
- this.promptsService.onDidChangeSlashCommands(() => this.refreshAllPromptsSectionCounts())
748
- );
749
- this.refreshAllPromptsSectionCounts();
763
+ for (const section of ITEMS_MODEL_SECTIONS) {
764
+ const observable = this.itemsModel.getCount(section);
765
+ this.editorDisposables.add(autorun(reader => {
766
+ this.updateSectionCount(section, observable.read(reader));
767
+ }));
768
+ }
750
769
  if (this.isPromptsSection(this.selectedSection)) {
751
770
  void this.listWidget.setSection(this.selectedSection);
752
771
  }
@@ -763,18 +782,6 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
763
782
  this.sectionsList.splice(0, this.sectionsList.length, this.sections);
764
783
  this.ensureSectionsListReflectsActiveSection();
765
784
  }
766
- refreshAllPromptsSectionCounts() {
767
- this.promptsSectionCountScheduler.schedule();
768
- }
769
- _doRefreshAllPromptsSectionCounts() {
770
- for (const section of this.sections) {
771
- if (this.isPromptsSection(section.id)) {
772
- this.listWidget.computeItemCountForSection(section.id).then(count => {
773
- this.updateSectionCount(section.id, count);
774
- }, onUnexpectedError);
775
- }
776
- }
777
- }
778
785
  showWelcomePage() {
779
786
  if (this.viewMode === "editor") {
780
787
  this.goBackToList();
@@ -791,6 +798,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
791
798
  this.welcomePage?.reset();
792
799
  this.updateContentVisibility();
793
800
  this.ensureSectionsListReflectsActiveSection(undefined);
801
+ this.welcomePage?.focus();
794
802
  }
795
803
  selectSection(section, options) {
796
804
  if (this.selectedSection === section && !options?.showMarketplace) {
@@ -821,6 +829,9 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
821
829
  if (this.isPromptsSection(section)) {
822
830
  void this.listWidget.setSection(section);
823
831
  }
832
+ if (this.dimension) {
833
+ this.layout(this.dimension);
834
+ }
824
835
  this.ensureSectionsListReflectsActiveSection(section);
825
836
  if (options?.showMarketplace) {
826
837
  if (section === AICustomizationManagementSection.McpServers) {
@@ -829,6 +840,15 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
829
840
  this.pluginListWidget?.showBrowseMarketplace();
830
841
  }
831
842
  }
843
+ if (section === AICustomizationManagementSection.McpServers) {
844
+ this.mcpListWidget?.focusSearch();
845
+ } else if (section === AICustomizationManagementSection.Plugins) {
846
+ this.pluginListWidget?.focusSearch();
847
+ } else if (section === AICustomizationManagementSection.Models) {
848
+ this.modelsWidget?.focusSearch();
849
+ } else {
850
+ this.listWidget?.focusSearch();
851
+ }
832
852
  }
833
853
  ensureSectionsListReflectsActiveSection(section = this.selectedSection) {
834
854
  if (!this.sectionsList) {
@@ -926,7 +946,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
926
946
  await this.fileService.createFile(fileUri);
927
947
  await this.showEmbeddedEditor(fileUri, fileName, PromptsType.instructions, PromptsStorage.local, true);
928
948
  }
929
- void this.listWidget.refresh();
949
+ this.listWidget.refresh();
930
950
  return;
931
951
  }
932
952
  if (type === PromptsType.hook) {
@@ -987,7 +1007,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
987
1007
  return;
988
1008
  }
989
1009
  await this.commandService.executeCommand(commandId, options);
990
- void this.listWidget.refresh();
1010
+ this.listWidget.refresh();
991
1011
  }
992
1012
  async resolveTargetDirectoryWithPicker(type, target) {
993
1013
  const allFolders = await this.promptsService.getSourceFolders(type);
@@ -1034,7 +1054,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1034
1054
  uri: folder.uri
1035
1055
  })));
1036
1056
  const picked = await this.quickInputService.pick(items, {
1037
- placeHolder: ( localize(5436, "Select a directory for the new customization file"))
1057
+ placeHolder: ( localize(5517, "Select a directory for the new customization file"))
1038
1058
  });
1039
1059
  return picked?.uri ?? null;
1040
1060
  }
@@ -1089,7 +1109,11 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1089
1109
  focus() {
1090
1110
  super.focus();
1091
1111
  if (this.viewMode === "editor") {
1092
- this.embeddedEditor?.focus();
1112
+ if (this.editorDisplayMode === "raw") {
1113
+ this.embeddedEditor?.focus();
1114
+ } else {
1115
+ this.editorModeButton?.focus();
1116
+ }
1093
1117
  return;
1094
1118
  }
1095
1119
  if (this.selectedSection === undefined) {
@@ -1144,7 +1168,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1144
1168
  }
1145
1169
  }
1146
1170
  refreshList() {
1147
- void this.listWidget.refresh();
1171
+ this.listWidget.refresh();
1148
1172
  }
1149
1173
  revealLastItem() {
1150
1174
  if (this.selectedSection === AICustomizationManagementSection.McpServers) {
@@ -1164,11 +1188,11 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1164
1188
  }
1165
1189
  const editorHeader = append(this.editorContentContainer, $(".editor-header"));
1166
1190
  this.editorActionButton = append(editorHeader, $("button.editor-back-button"));
1167
- this.editorActionButton.setAttribute("aria-label", ( localize(5437, "Back to list")));
1191
+ this.editorActionButton.setAttribute("aria-label", ( localize(5518, "Back to list")));
1168
1192
  this.editorDisposables.add(this.hoverService.setupManagedHover(
1169
1193
  getDefaultHoverDelegate("element"),
1170
1194
  this.editorActionButton,
1171
- ( localize(5438, "Back to list"))
1195
+ ( localize(5519, "Back to list"))
1172
1196
  ));
1173
1197
  this.editorActionButtonIcon = append(
1174
1198
  this.editorActionButton,
@@ -1178,21 +1202,47 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1178
1202
  this.editorDisposables.add(addDisposableListener(this.editorActionButton, "click", () => {
1179
1203
  void this.handleEditorActionButton().catch(error => {
1180
1204
  console.error("Failed to handle editor back action:", error);
1181
- this.notificationService.error(( localize(5439, "Failed to finish the prompt action.")));
1205
+ this.notificationService.error(( localize(5520, "Failed to finish the prompt action.")));
1182
1206
  });
1183
1207
  }));
1184
1208
  const itemInfo = append(editorHeader, $(".editor-item-info"));
1185
1209
  this.editorItemNameElement = append(itemInfo, $(".editor-item-name"));
1186
1210
  this.editorItemPathElement = append(itemInfo, $(".editor-item-path"));
1211
+ this.editorModeButton = append(editorHeader, $("button.editor-mode-button"));
1212
+ this.editorModeButton.type = "button";
1213
+ this.editorModeButton.setAttribute("aria-pressed", "false");
1214
+ this.editorDisposables.add(this.hoverService.setupManagedHover(
1215
+ getDefaultHoverDelegate("element"),
1216
+ this.editorModeButton,
1217
+ () => this.getEditorModeButtonTooltip()
1218
+ ));
1219
+ this.editorDisposables.add(addDisposableListener(this.editorModeButton, "click", () => {
1220
+ this.toggleEditorDisplayMode();
1221
+ }));
1187
1222
  this.editorSaveIndicator = append(editorHeader, $(".editor-save-indicator"));
1188
- const embeddedEditorContainer = append(this.editorContentContainer, $(".embedded-editor-container"));
1223
+ this.editorPreviewContainer = append(this.editorContentContainer, $(".editor-preview-container"));
1224
+ this.editorPreviewScrollContainer = append(this.editorPreviewContainer, $(".editor-preview-scroll-container"));
1225
+ this.editorPreviewScrollContainer.setAttribute("role", "region");
1226
+ this.editorPreviewScrollContainer.setAttribute("aria-label", ( localize(5521, "Customization preview")));
1227
+ this.editorPreviewIssuesContainer = append(this.editorPreviewScrollContainer, $(".editor-preview-issues"));
1228
+ const frontMatterSection = append(
1229
+ this.editorPreviewScrollContainer,
1230
+ $(".editor-preview-section.editor-preview-frontmatter-section")
1231
+ );
1232
+ this.editorPreviewFrontMatterContainer = append(frontMatterSection, $(".editor-preview-frontmatter-list"));
1233
+ const bodySection = append(
1234
+ this.editorPreviewScrollContainer,
1235
+ $(".editor-preview-section.editor-preview-body-section")
1236
+ );
1237
+ this.editorPreviewBodyContainer = append(bodySection, $(".editor-preview-body-content"));
1238
+ this.embeddedEditorContainer = append(this.editorContentContainer, $(".embedded-editor-container"));
1189
1239
  const overflowWidgetsDomNode = append(
1190
1240
  this.editorContentContainer,
1191
1241
  $(".embedded-editor-overflow-widgets.monaco-editor")
1192
1242
  );
1193
1243
  this.editorDisposables.add(toDisposable(() => overflowWidgetsDomNode.remove()));
1194
1244
  this.embeddedEditor = this.editorDisposables.add(
1195
- this.instantiationService.createInstance(CodeEditorWidget, embeddedEditorContainer, {
1245
+ this.instantiationService.createInstance(CodeEditorWidget, this.embeddedEditorContainer, {
1196
1246
  ...getSimpleEditorOptions(this.configurationService),
1197
1247
  readOnly: false,
1198
1248
  minimap: {
@@ -1213,6 +1263,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1213
1263
  isSimpleWidget: false
1214
1264
  })
1215
1265
  );
1266
+ this.updateEditorDisplayMode();
1216
1267
  }
1217
1268
  async showEmbeddedEditor(
1218
1269
  uri,
@@ -1225,16 +1276,21 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1225
1276
  this.currentModelRef?.dispose();
1226
1277
  this.currentModelRef = undefined;
1227
1278
  this.editorModelChangeDisposables.clear();
1279
+ this.editorPreviewDisposables.clear();
1280
+ this.editorPreviewRenderScheduler.cancel();
1228
1281
  this.currentEditingUri = uri;
1229
1282
  this.currentEditingProjectRoot = isWorkspaceFile ? this.workspaceService.getActiveProjectRoot() : undefined;
1230
1283
  this.currentEditingStorage = storage;
1231
1284
  this.currentEditingPromptType = promptType;
1285
+ this.currentEditingReadOnly = isReadOnly;
1286
+ this.editorDisplayMode = this.isStructuredPreviewSupported(promptType) ? "preview" : "raw";
1232
1287
  this.viewMode = "editor";
1233
1288
  this.editorItemNameElement.textContent = displayName;
1234
1289
  this.editorItemPathElement.textContent = basename(uri);
1235
1290
  this._editorContentChanged = false;
1236
1291
  this.resetEditorSaveIndicator();
1237
1292
  this.updateEditorActionButton();
1293
+ this.updateEditorDisplayMode();
1238
1294
  this.updateContentVisibility();
1239
1295
  try {
1240
1296
  if (storage === BUILTIN_STORAGE && (promptType === PromptsType.prompt || promptType === PromptsType.skill)) {
@@ -1247,13 +1303,19 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1247
1303
  readOnly: false
1248
1304
  });
1249
1305
  this._editorContentChanged = session.model.getValue() !== session.originalContent;
1306
+ this.renderCurrentEditorPreview();
1250
1307
  this.updateEditorActionButton();
1251
1308
  if (this.dimension) {
1252
1309
  this.layout(this.dimension);
1253
1310
  }
1254
- this.embeddedEditor.focus();
1311
+ if (this.editorDisplayMode === "raw") {
1312
+ this.embeddedEditor.focus();
1313
+ } else {
1314
+ this.editorModeButton?.focus();
1315
+ }
1255
1316
  this.editorModelChangeDisposables.add(session.model.onDidChangeContent(() => {
1256
1317
  this._editorContentChanged = session.model.getValue() !== session.originalContent;
1318
+ this.scheduleCurrentEditorPreviewRender();
1257
1319
  this.updateEditorActionButton();
1258
1320
  }));
1259
1321
  return;
@@ -1268,13 +1330,19 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1268
1330
  this.embeddedEditor.updateOptions({
1269
1331
  readOnly: isReadOnly
1270
1332
  });
1333
+ this.renderCurrentEditorPreview();
1271
1334
  if (this.dimension) {
1272
1335
  this.layout(this.dimension);
1273
1336
  }
1274
- this.embeddedEditor.focus();
1337
+ if (this.editorDisplayMode === "raw") {
1338
+ this.embeddedEditor.focus();
1339
+ } else {
1340
+ this.editorModeButton?.focus();
1341
+ }
1275
1342
  this._editorContentChanged = this.workingCopyService.isDirty(uri);
1276
1343
  this.editorModelChangeDisposables.add(ref.object.textEditorModel.onDidChangeContent(() => {
1277
1344
  this._editorContentChanged = true;
1345
+ this.scheduleCurrentEditorPreviewRender();
1278
1346
  this.resetEditorSaveIndicator();
1279
1347
  }));
1280
1348
  this.editorModelChangeDisposables.add(this.workingCopyService.onDidSave(e => {
@@ -1282,7 +1350,9 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1282
1350
  this._editorContentChanged = this.workingCopyService.isDirty(uri);
1283
1351
  this.editorSaveIndicator.className = "editor-save-indicator visible saved";
1284
1352
  this.editorSaveIndicator.classList.add(...ThemeIcon.asClassNameArray(Codicon.check));
1285
- this.editorSaveIndicator.title = ( localize(5440, "Saved"));
1353
+ this.editorSaveIndicator.title = ( localize(5522, "Saved"));
1354
+ this.editorSaveIndicator.setAttribute("aria-label", ( localize(5522, "Saved")));
1355
+ status(( localize(5522, "Saved")));
1286
1356
  }
1287
1357
  }));
1288
1358
  } catch (error) {
@@ -1311,10 +1381,15 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1311
1381
  this.currentEditingProjectRoot = undefined;
1312
1382
  this.currentEditingStorage = undefined;
1313
1383
  this.currentEditingPromptType = undefined;
1384
+ this.currentEditingReadOnly = false;
1385
+ this.editorDisplayMode = "preview";
1314
1386
  this._editorContentChanged = false;
1315
1387
  this.editorModelChangeDisposables.clear();
1388
+ this.editorPreviewRenderScheduler.cancel();
1389
+ this.clearEditorPreview();
1316
1390
  this.resetEditorSaveIndicator();
1317
1391
  this.updateEditorActionButton();
1392
+ this.updateEditorDisplayMode();
1318
1393
  this.embeddedEditor?.setModel(null);
1319
1394
  this.viewMode = "list";
1320
1395
  this.updateContentVisibility();
@@ -1327,7 +1402,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1327
1402
  const saveRequest = backgroundSaveRequest;
1328
1403
  void this.saveExistingCustomization(saveRequest).catch(error => {
1329
1404
  console.error("Failed to save customization changes on exit:", error);
1330
- this.notificationService.warn(( localize(5441, "Could not save changes to {0}.", basename(saveRequest.fileUri))));
1405
+ this.notificationService.warn(( localize(5523, "Could not save changes to {0}.", basename(saveRequest.fileUri))));
1331
1406
  });
1332
1407
  }
1333
1408
  }
@@ -1420,7 +1495,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1420
1495
  const workspaceFolder = resolveWorkspaceTargetDirectory(this.workspaceService, promptType);
1421
1496
  if (workspaceFolder) {
1422
1497
  items.push({
1423
- label: ( localize(5442, "Workspace")),
1498
+ label: ( localize(5524, "Workspace")),
1424
1499
  description: workspaceFolder.fsPath,
1425
1500
  target: "workspace",
1426
1501
  folder: workspaceFolder
@@ -1429,19 +1504,19 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1429
1504
  const userFolder = await resolveUserTargetDirectory(this.promptsService, promptType);
1430
1505
  if (userFolder) {
1431
1506
  items.push({
1432
- label: ( localize(5443, "User")),
1507
+ label: ( localize(5525, "User")),
1433
1508
  description: userFolder.fsPath,
1434
1509
  target: "user",
1435
1510
  folder: userFolder
1436
1511
  });
1437
1512
  }
1438
1513
  items.push({
1439
- label: ( localize(5444, "Cancel")),
1514
+ label: ( localize(5526, "Cancel")),
1440
1515
  target: "cancel"
1441
1516
  });
1442
1517
  return this.quickInputService.pick(items, {
1443
1518
  canPickMany: false,
1444
- placeHolder: ( localize(5445, "Select Workspace, User, or Cancel")),
1519
+ placeHolder: ( localize(5527, "Select Workspace, User, or Cancel")),
1445
1520
  matchOnDescription: true
1446
1521
  });
1447
1522
  }
@@ -1474,7 +1549,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1474
1549
  void this.listWidget?.refresh();
1475
1550
  }, error => {
1476
1551
  console.error("Failed to save built-in override:", error);
1477
- this.notificationService.warn(saveRequest.target === "workspace" ? ( localize(5446, "Could not save the override to the workspace.")) : ( localize(5447, "Could not save the override to your user folder.")));
1552
+ this.notificationService.warn(saveRequest.target === "workspace" ? ( localize(5528, "Could not save the override to the workspace.")) : ( localize(5529, "Could not save the override to your user folder.")));
1478
1553
  });
1479
1554
  }
1480
1555
  } finally {
@@ -1490,8 +1565,8 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1490
1565
  const shouldShowBuiltinSaveAction = this.shouldShowBuiltinSaveAction();
1491
1566
  this.editorActionButtonIcon.className = `codicon codicon-${shouldShowBuiltinSaveAction ? Codicon.save.id : Codicon.arrowLeft.id} editor-action-button-icon`;
1492
1567
  this.editorActionButton.disabled = this.editorActionButtonInProgress;
1493
- this.editorActionButton.setAttribute("aria-label", shouldShowBuiltinSaveAction ? ( localize(5448, "Save override")) : ( localize(5437, "Back to list")));
1494
- this.editorActionButton.title = shouldShowBuiltinSaveAction ? ( localize(5449, "Save override (choose Workspace, User, or Cancel)")) : ( localize(5437, "Back to list"));
1568
+ this.editorActionButton.setAttribute("aria-label", shouldShowBuiltinSaveAction ? ( localize(5530, "Save override")) : ( localize(5518, "Back to list")));
1569
+ this.editorActionButton.title = shouldShowBuiltinSaveAction ? ( localize(5531, "Save override (choose Workspace, User, or Cancel)")) : ( localize(5518, "Back to list"));
1495
1570
  }
1496
1571
  shouldShowBuiltinSaveAction() {
1497
1572
  return this._editorContentChanged && this.currentEditingStorage === BUILTIN_STORAGE && (this.currentEditingPromptType === PromptsType.prompt || this.currentEditingPromptType === PromptsType.skill);
@@ -1526,13 +1601,252 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1526
1601
  return true;
1527
1602
  } catch (error) {
1528
1603
  console.error("Failed to save built-in override:", error);
1529
- this.notificationService.warn(target.target === "workspace" ? ( localize(5446, "Could not save the override to the workspace.")) : ( localize(5447, "Could not save the override to your user folder.")));
1604
+ this.notificationService.warn(target.target === "workspace" ? ( localize(5528, "Could not save the override to the workspace.")) : ( localize(5529, "Could not save the override to your user folder.")));
1530
1605
  return false;
1531
1606
  }
1532
1607
  }
1533
1608
  resetEditorSaveIndicator() {
1534
1609
  this.editorSaveIndicator.className = "editor-save-indicator";
1535
1610
  this.editorSaveIndicator.title = "";
1611
+ this.editorSaveIndicator.removeAttribute("aria-label");
1612
+ }
1613
+ isStructuredPreviewSupported(promptType) {
1614
+ if (this.configurationService.getValue(ChatConfiguration.ChatCustomizationsStructuredPreviewEnabled) !== true) {
1615
+ return false;
1616
+ }
1617
+ return promptType === PromptsType.agent || promptType === PromptsType.skill || promptType === PromptsType.instructions || promptType === PromptsType.prompt;
1618
+ }
1619
+ onStructuredPreviewSettingChanged() {
1620
+ if (this.viewMode !== "editor") {
1621
+ return;
1622
+ }
1623
+ const supportsStructuredPreview = this.isStructuredPreviewSupported(this.currentEditingPromptType);
1624
+ if (!supportsStructuredPreview) {
1625
+ this.editorDisplayMode = "raw";
1626
+ this.editorPreviewRenderScheduler.cancel();
1627
+ this.clearEditorPreview();
1628
+ } else if (this.editorDisplayMode === "preview") {
1629
+ this.editorPreviewRenderScheduler.schedule();
1630
+ }
1631
+ this.updateEditorDisplayMode();
1632
+ if (this.dimension) {
1633
+ this.layout(this.dimension);
1634
+ }
1635
+ }
1636
+ getCurrentEditingModel() {
1637
+ if (!this.currentEditingUri) {
1638
+ return undefined;
1639
+ }
1640
+ if (this.currentEditingStorage === BUILTIN_STORAGE) {
1641
+ return this.builtinEditingSessions.get(( this.currentEditingUri.toString()))?.model;
1642
+ }
1643
+ return this.currentModelRef?.object.textEditorModel;
1644
+ }
1645
+ toggleEditorDisplayMode() {
1646
+ if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
1647
+ return;
1648
+ }
1649
+ this.editorDisplayMode = this.editorDisplayMode === "preview" ? "raw" : "preview";
1650
+ if (this.editorDisplayMode === "preview") {
1651
+ this.editorPreviewRenderScheduler.cancel();
1652
+ this.renderCurrentEditorPreview();
1653
+ }
1654
+ this.updateEditorDisplayMode();
1655
+ if (this.dimension) {
1656
+ this.layout(this.dimension);
1657
+ }
1658
+ if (this.editorDisplayMode === "raw") {
1659
+ this.embeddedEditor?.focus();
1660
+ } else {
1661
+ this.editorModeButton?.focus();
1662
+ }
1663
+ }
1664
+ updateEditorDisplayMode() {
1665
+ const supportsStructuredPreview = this.isStructuredPreviewSupported(this.currentEditingPromptType);
1666
+ const showPreview = supportsStructuredPreview && this.editorDisplayMode === "preview";
1667
+ if (this.editorModeButton) {
1668
+ this.editorModeButton.style.display = supportsStructuredPreview ? "" : "none";
1669
+ this.editorModeButton.textContent = this.getEditorModeButtonLabel();
1670
+ this.editorModeButton.setAttribute("aria-label", this.getEditorModeButtonTooltip());
1671
+ this.editorModeButton.setAttribute("aria-pressed", String(this.editorDisplayMode === "raw"));
1672
+ this.editorModeButton.title = this.getEditorModeButtonTooltip();
1673
+ }
1674
+ if (this.editorPreviewContainer) {
1675
+ this.editorPreviewContainer.style.display = showPreview ? "" : "none";
1676
+ }
1677
+ if (this.embeddedEditorContainer) {
1678
+ this.embeddedEditorContainer.style.display = showPreview ? "none" : "";
1679
+ }
1680
+ }
1681
+ getEditorModeButtonLabel() {
1682
+ if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
1683
+ return "";
1684
+ }
1685
+ if (this.editorDisplayMode === "raw") {
1686
+ return localize(5532, "Preview");
1687
+ }
1688
+ return this.canEditCurrentRaw() ? ( localize(5533, "Edit")) : ( localize(5534, "View Raw"));
1689
+ }
1690
+ getEditorModeButtonTooltip() {
1691
+ if (!this.isStructuredPreviewSupported(this.currentEditingPromptType)) {
1692
+ return "";
1693
+ }
1694
+ if (this.editorDisplayMode === "raw") {
1695
+ return localize(5535, "Show structured preview");
1696
+ }
1697
+ return this.canEditCurrentRaw() ? ( localize(5536, "Edit the raw markdown file")) : ( localize(5537, "Show the raw markdown file"));
1698
+ }
1699
+ canEditCurrentRaw() {
1700
+ const promptType = this.currentEditingPromptType;
1701
+ if (!promptType) {
1702
+ return false;
1703
+ }
1704
+ return (this.currentEditingStorage === BUILTIN_STORAGE && (promptType === PromptsType.prompt || promptType === PromptsType.skill)) || !this.currentEditingReadOnly;
1705
+ }
1706
+ scheduleCurrentEditorPreviewRender() {
1707
+ if (this.editorDisplayMode !== "preview") {
1708
+ return;
1709
+ }
1710
+ this.editorPreviewRenderScheduler.schedule();
1711
+ }
1712
+ renderCurrentEditorPreview() {
1713
+ const model = this.getCurrentEditingModel();
1714
+ const promptType = this.currentEditingPromptType;
1715
+ if (!model || !promptType || this.editorDisplayMode !== "preview" || !this.isStructuredPreviewSupported(promptType)) {
1716
+ this.clearEditorPreview();
1717
+ return;
1718
+ }
1719
+ const parsedPromptFile = this.promptsService.getParsedPromptFile(model);
1720
+ this.renderEditorPreview(parsedPromptFile, promptType);
1721
+ }
1722
+ renderEditorPreview(parsedPromptFile, promptType) {
1723
+ if (!this.editorPreviewIssuesContainer || !this.editorPreviewFrontMatterContainer || !this.editorPreviewBodyContainer) {
1724
+ return;
1725
+ }
1726
+ this.editorPreviewDisposables.clear();
1727
+ clearNode(this.editorPreviewIssuesContainer);
1728
+ clearNode(this.editorPreviewFrontMatterContainer);
1729
+ clearNode(this.editorPreviewBodyContainer);
1730
+ const target = getTarget(promptType, parsedPromptFile.header ?? parsedPromptFile.uri);
1731
+ this.renderPreviewIssues(parsedPromptFile);
1732
+ this.renderPreviewFrontMatter(parsedPromptFile, promptType, target);
1733
+ this.renderPreviewBody(parsedPromptFile);
1734
+ }
1735
+ renderPreviewIssues(parsedPromptFile) {
1736
+ if (!this.editorPreviewIssuesContainer || !parsedPromptFile.header?.errors.length) {
1737
+ return;
1738
+ }
1739
+ const issuesContainer = append(this.editorPreviewIssuesContainer, $(".editor-preview-issues-box"));
1740
+ append(issuesContainer, $("div.editor-preview-issues-title")).textContent = ( localize(5538, "Header issues detected"));
1741
+ append(issuesContainer, $("div.editor-preview-issues-description")).textContent = ( localize(5539, "Switch to raw view to fix invalid or unsupported metadata entries."));
1742
+ const list = append(issuesContainer, $("ul.editor-preview-issues-list"));
1743
+ for (const error of parsedPromptFile.header.errors) {
1744
+ append(list, $("li.editor-preview-issues-item")).textContent = error.message;
1745
+ }
1746
+ }
1747
+ renderPreviewFrontMatter(parsedPromptFile, promptType, target) {
1748
+ if (!this.editorPreviewFrontMatterContainer) {
1749
+ return;
1750
+ }
1751
+ const attributes = parsedPromptFile.header?.attributes ?? [];
1752
+ if (!attributes.length) {
1753
+ append(
1754
+ this.editorPreviewFrontMatterContainer,
1755
+ $("div.editor-preview-empty-state")
1756
+ ).textContent = ( localize(5540, "No metadata found in this file."));
1757
+ return;
1758
+ }
1759
+ for (const attribute of attributes) {
1760
+ this.renderPreviewAttribute(attribute, promptType, target);
1761
+ }
1762
+ }
1763
+ renderPreviewAttribute(attribute, promptType, target) {
1764
+ if (!this.editorPreviewFrontMatterContainer) {
1765
+ return;
1766
+ }
1767
+ const row = append(this.editorPreviewFrontMatterContainer, $(".editor-preview-row"));
1768
+ const header = append(row, $(".editor-preview-row-header"));
1769
+ append(header, $("div.editor-preview-row-key")).textContent = attribute.key;
1770
+ const helpButton = append(header, $("button.editor-preview-row-help"));
1771
+ helpButton.type = "button";
1772
+ helpButton.setAttribute("aria-label", ( localize(5541, "Show help for '{0}'", attribute.key)));
1773
+ const helpIcon = append(helpButton, $("span.editor-preview-row-help-icon"));
1774
+ helpIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.info));
1775
+ helpIcon.setAttribute("aria-hidden", "true");
1776
+ const description = getAttributeDefinition(attribute.key, promptType, target)?.description ?? ( localize(5542, "Custom metadata field `{0}`.", attribute.key));
1777
+ const helpHover = this.editorPreviewDisposables.add(
1778
+ this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), helpButton, {
1779
+ markdown: ( new MarkdownString(description)),
1780
+ markdownNotSupportedFallback: description
1781
+ })
1782
+ );
1783
+ this.editorPreviewDisposables.add(addDisposableListener(helpButton, "click", e => {
1784
+ e.preventDefault();
1785
+ e.stopPropagation();
1786
+ helpHover.show(true);
1787
+ }));
1788
+ const valueElement = append(row, $("div.editor-preview-row-value"));
1789
+ const valueText = this.stringifyPreviewValue(attribute.value);
1790
+ valueElement.textContent = valueText;
1791
+ valueElement.classList.toggle("multiline", valueText.includes("\n"));
1792
+ }
1793
+ renderPreviewBody(parsedPromptFile) {
1794
+ if (!this.editorPreviewBodyContainer) {
1795
+ return;
1796
+ }
1797
+ const bodyContent = parsedPromptFile.body?.getContent() ?? "";
1798
+ if (!bodyContent.trim()) {
1799
+ append(this.editorPreviewBodyContainer, $("div.editor-preview-empty-state")).textContent = ( localize(5543, "No markdown body found in this file."));
1800
+ return;
1801
+ }
1802
+ const markdown = ( new MarkdownString(bodyContent, {
1803
+ supportThemeIcons: true
1804
+ }));
1805
+ markdown.baseUri = parsedPromptFile.uri;
1806
+ const renderedMarkdown = this.editorPreviewDisposables.add(this.markdownRendererService.render(markdown));
1807
+ this.editorPreviewBodyContainer.appendChild(renderedMarkdown.element);
1808
+ }
1809
+ stringifyPreviewValue(value) {
1810
+ switch (value.type) {
1811
+ case "scalar":
1812
+ return value.value;
1813
+ case "sequence":
1814
+ if (value.items.every(item => item.type === "scalar")) {
1815
+ return ( value.items.map(item => item.value)).join("\n");
1816
+ }
1817
+ return JSON.stringify(this.toPreviewObject(value), null, 2);
1818
+ case "map":
1819
+ return JSON.stringify(this.toPreviewObject(value), null, 2);
1820
+ }
1821
+ }
1822
+ toPreviewObject(value) {
1823
+ switch (value.type) {
1824
+ case "scalar":
1825
+ return value.value;
1826
+ case "sequence":
1827
+ return ( value.items.map(item => this.toPreviewObject(item)));
1828
+ case "map":
1829
+ {
1830
+ const entries = {};
1831
+ for (const property of value.properties) {
1832
+ entries[property.key.value] = this.toPreviewObject(property.value);
1833
+ }
1834
+ return entries;
1835
+ }
1836
+ }
1837
+ }
1838
+ clearEditorPreview() {
1839
+ this.editorPreviewRenderScheduler.cancel();
1840
+ this.editorPreviewDisposables.clear();
1841
+ if (this.editorPreviewIssuesContainer) {
1842
+ clearNode(this.editorPreviewIssuesContainer);
1843
+ }
1844
+ if (this.editorPreviewFrontMatterContainer) {
1845
+ clearNode(this.editorPreviewFrontMatterContainer);
1846
+ }
1847
+ if (this.editorPreviewBodyContainer) {
1848
+ clearNode(this.editorPreviewBodyContainer);
1849
+ }
1536
1850
  }
1537
1851
  disposeBuiltinEditingSessions() {
1538
1852
  for (const session of ( this.builtinEditingSessions.values())) {
@@ -1555,41 +1869,35 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1555
1869
  }
1556
1870
  const detailHeader = append(this.mcpDetailContainer, $(".editor-header"));
1557
1871
  const backButton = append(detailHeader, $("button.editor-back-button"));
1558
- backButton.setAttribute("aria-label", ( localize(5450, "Back to MCP servers")));
1872
+ backButton.setAttribute("aria-label", ( localize(5544, "Back to MCP servers")));
1559
1873
  this.editorDisposables.add(
1560
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(5451, "Back to MCP servers")))
1874
+ this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(5545, "Back to MCP servers")))
1561
1875
  );
1562
1876
  const backIconEl = append(backButton, $(`.codicon.codicon-${Codicon.arrowLeft.id}`));
1563
1877
  backIconEl.setAttribute("aria-hidden", "true");
1564
1878
  this.editorDisposables.add(addDisposableListener(backButton, "click", () => {
1565
1879
  this.goBackFromMcpDetail();
1566
1880
  }));
1567
- const editorContainer = append(this.mcpDetailContainer, $(".mcp-detail-editor-container"));
1568
- this.embeddedMcpEditor = this.editorDisposables.add(this.instantiationService.createInstance(McpServerEditor, this.group));
1569
- this.embeddedMcpEditor.create(editorContainer);
1881
+ const detailBody = append(this.mcpDetailContainer, $(".mcp-detail-editor-container"));
1882
+ this.embeddedMcpDetail = this.editorDisposables.add(
1883
+ this.instantiationService.createInstance(EmbeddedMcpServerDetail, detailBody)
1884
+ );
1570
1885
  }
1571
1886
  async showEmbeddedMcpDetail(server) {
1572
- if (!this.embeddedMcpEditor) {
1887
+ if (!this.embeddedMcpDetail) {
1573
1888
  return;
1574
1889
  }
1575
1890
  this.viewMode = "mcpDetail";
1576
1891
  this.updateContentVisibility();
1577
- const input = this.instantiationService.createInstance(McpServerEditorInput, server);
1578
1892
  this.mcpDetailDisposables.clear();
1579
- this.mcpDetailDisposables.add(input);
1580
- try {
1581
- await this.embeddedMcpEditor.setInput(input, undefined, {}, CancellationToken.None);
1582
- } catch {
1583
- this.goBackFromMcpDetail();
1584
- return;
1585
- }
1893
+ this.embeddedMcpDetail.setInput(server);
1586
1894
  if (this.dimension) {
1587
1895
  this.layout(this.dimension);
1588
1896
  }
1589
1897
  }
1590
1898
  goBackFromMcpDetail() {
1591
1899
  this.mcpDetailDisposables.clear();
1592
- this.embeddedMcpEditor?.clearInput();
1900
+ this.embeddedMcpDetail?.clearInput();
1593
1901
  this.viewMode = "list";
1594
1902
  this.updateContentVisibility();
1595
1903
  if (this.dimension) {
@@ -1603,34 +1911,28 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1603
1911
  }
1604
1912
  const detailHeader = append(this.pluginDetailContainer, $(".editor-header"));
1605
1913
  const backButton = append(detailHeader, $("button.editor-back-button"));
1606
- backButton.setAttribute("aria-label", ( localize(5452, "Back to plugins")));
1914
+ backButton.setAttribute("aria-label", ( localize(5546, "Back to plugins")));
1607
1915
  this.editorDisposables.add(
1608
- this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(5453, "Back to plugins")))
1916
+ this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), backButton, ( localize(5547, "Back to plugins")))
1609
1917
  );
1610
1918
  const backIconEl = append(backButton, $(`.codicon.codicon-${Codicon.arrowLeft.id}`));
1611
1919
  backIconEl.setAttribute("aria-hidden", "true");
1612
1920
  this.editorDisposables.add(addDisposableListener(backButton, "click", () => {
1613
1921
  this.goBackFromPluginDetail();
1614
1922
  }));
1615
- const editorContainer = append(this.pluginDetailContainer, $(".plugin-detail-editor-container"));
1616
- this.embeddedPluginEditor = this.editorDisposables.add(this.instantiationService.createInstance(AgentPluginEditor, this.group));
1617
- this.embeddedPluginEditor.create(editorContainer);
1923
+ const detailBody = append(this.pluginDetailContainer, $(".plugin-detail-editor-container"));
1924
+ this.embeddedPluginDetail = this.editorDisposables.add(
1925
+ this.instantiationService.createInstance(EmbeddedAgentPluginDetail, detailBody)
1926
+ );
1618
1927
  }
1619
1928
  async showEmbeddedPluginDetail(item) {
1620
- if (!this.embeddedPluginEditor) {
1929
+ if (!this.embeddedPluginDetail) {
1621
1930
  return;
1622
1931
  }
1623
1932
  this.viewMode = "pluginDetail";
1624
1933
  this.updateContentVisibility();
1625
- const input = ( new AgentPluginEditorInput(item));
1626
1934
  this.pluginDetailDisposables.clear();
1627
- this.pluginDetailDisposables.add(input);
1628
- try {
1629
- await this.embeddedPluginEditor.setInput(input, undefined, {}, CancellationToken.None);
1630
- } catch {
1631
- this.goBackFromPluginDetail();
1632
- return;
1633
- }
1935
+ this.embeddedPluginDetail.setInput(item);
1634
1936
  if (this.dimension) {
1635
1937
  this.layout(this.dimension);
1636
1938
  }
@@ -1643,7 +1945,7 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1643
1945
  }
1644
1946
  goBackFromPluginDetail() {
1645
1947
  this.pluginDetailDisposables.clear();
1646
- this.embeddedPluginEditor?.clearInput();
1948
+ this.embeddedPluginDetail?.clearInput();
1647
1949
  const returnSection = this.pluginDetailReturnSection;
1648
1950
  this.pluginDetailReturnSection = undefined;
1649
1951
  if (returnSection) {
@@ -1660,6 +1962,6 @@ let AICustomizationManagementEditor = class AICustomizationManagementEditor exte
1660
1962
  }
1661
1963
  }
1662
1964
  };
1663
- AICustomizationManagementEditor = AICustomizationManagementEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IInstantiationService)), ( __param(5, IContextKeyService)), ( __param(6, IOpenerService)), ( __param(7, ICommandService)), ( __param(8, IAICustomizationWorkspaceService)), ( __param(9, IPromptsService)), ( __param(10, ITextModelService)), ( __param(11, IConfigurationService)), ( __param(12, IWorkingCopyService)), ( __param(13, IHoverService)), ( __param(14, IModelService)), ( __param(15, IQuickInputService)), ( __param(16, IContextMenuService)), ( __param(17, IFileService)), ( __param(18, INotificationService)), ( __param(19, ICustomizationHarnessService)), ( __param(20, IViewsService))], AICustomizationManagementEditor));
1965
+ AICustomizationManagementEditor = AICustomizationManagementEditor_1 = ( __decorate([( __param(1, ITelemetryService)), ( __param(2, IThemeService)), ( __param(3, IStorageService)), ( __param(4, IInstantiationService)), ( __param(5, IContextKeyService)), ( __param(6, IOpenerService)), ( __param(7, ICommandService)), ( __param(8, IAICustomizationWorkspaceService)), ( __param(9, IPromptsService)), ( __param(10, ITextModelService)), ( __param(11, IConfigurationService)), ( __param(12, IWorkingCopyService)), ( __param(13, IHoverService)), ( __param(14, IMarkdownRendererService)), ( __param(15, IModelService)), ( __param(16, IQuickInputService)), ( __param(17, IContextMenuService)), ( __param(18, IFileService)), ( __param(19, INotificationService)), ( __param(20, ICustomizationHarnessService)), ( __param(21, IViewsService)), ( __param(22, IAICustomizationItemsModel))], AICustomizationManagementEditor));
1664
1966
 
1665
1967
  export { AICustomizationManagementEditor, aiCustomizationManagementSashBorder };