@codingame/monaco-vscode-api 1.85.0 → 1.85.1

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 (239) hide show
  1. package/README.md +19 -10
  2. package/contributions.js +1 -0
  3. package/missing-services.js +91 -5
  4. package/monaco-editor-treemending.patch +957 -950
  5. package/package.json +6 -6
  6. package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
  9. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
  10. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
  11. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
  31. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
  34. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
  37. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
  38. package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
  39. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
  40. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
  41. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
  42. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
  43. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
  44. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
  45. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
  46. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  47. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
  48. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
  49. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
  50. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
  51. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
  52. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
  53. package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
  54. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
  55. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
  56. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
  57. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
  58. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
  59. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
  60. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
  61. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
  62. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
  63. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
  64. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
  65. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
  66. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
  67. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
  68. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
  69. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
  70. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
  71. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
  72. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
  73. package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
  85. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
  86. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
  87. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
  95. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
  96. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
  97. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
  98. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
  99. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
  100. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
  101. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
  102. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
  103. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
  104. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
  105. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
  106. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
  107. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
  108. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
  109. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
  110. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
  111. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
  112. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
  113. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
  114. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
  115. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
  116. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
  117. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
  118. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
  119. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
  120. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
  121. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
  122. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
  123. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
  175. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
  176. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
  177. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
  178. package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
  179. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
  180. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
  181. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
  182. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
  183. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
  184. package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
  185. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
  186. package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
  187. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
  188. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
  189. package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
  190. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
  191. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
  192. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
  193. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
  194. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
  195. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
  196. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
  197. package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
  198. package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
  199. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
  200. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
  201. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
  202. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
  203. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
  204. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
  205. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
  206. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
  207. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
  208. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
  209. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
  210. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
  211. package/assets/break.mp3 +0 -0
  212. package/assets/chatRequestSent.mp3 +0 -0
  213. package/assets/chatResponsePending.mp3 +0 -0
  214. package/assets/chatResponseReceived1.mp3 +0 -0
  215. package/assets/chatResponseReceived2.mp3 +0 -0
  216. package/assets/chatResponseReceived3.mp3 +0 -0
  217. package/assets/chatResponseReceived4.mp3 +0 -0
  218. package/assets/clear.mp3 +0 -0
  219. package/assets/defaultIcon.png +0 -0
  220. package/assets/diffLineDeleted.mp3 +0 -0
  221. package/assets/diffLineInserted.mp3 +0 -0
  222. package/assets/diffLineModified.mp3 +0 -0
  223. package/assets/error.mp3 +0 -0
  224. package/assets/fake.html +0 -10
  225. package/assets/foldedAreas.mp3 +0 -0
  226. package/assets/format.mp3 +0 -0
  227. package/assets/index-no-csp.html +0 -1226
  228. package/assets/index.html +0 -1227
  229. package/assets/quickFixes.mp3 +0 -0
  230. package/assets/save.mp3 +0 -0
  231. package/assets/service-worker.js +0 -457
  232. package/assets/taskCompleted.mp3 +0 -0
  233. package/assets/taskFailed.mp3 +0 -0
  234. package/assets/terminalBell.mp3 +0 -0
  235. package/assets/warning.mp3 +0 -0
  236. package/assets/webWorkerExtensionHostIframe.html +0 -123
  237. package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
  238. package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
  239. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
@@ -0,0 +1,583 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
3
+ import { disposableTimeout } from 'monaco-editor/esm/vs/base/common/async.js';
4
+ import { toErrorMessage } from 'monaco-editor/esm/vs/base/common/errorMessage.js';
5
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
6
+ import { Disposable, DisposableStore, MutableDisposable, combinedDisposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
7
+ import { isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
8
+ import { isDefined } from 'monaco-editor/esm/vs/base/common/types.js';
9
+ import './media/chat.css.js';
10
+ import { MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
11
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
12
+ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
13
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
14
+ import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
15
+ import { WorkbenchObjectTree } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
16
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
17
+ import { IViewsService } from '../../../common/views.js';
18
+ import { IChatWidgetService, IChatAccessibilityService } from './chat.js';
19
+ import { ChatInputPart } from './chatInputPart.js';
20
+ import { ChatListDelegate, ChatListItemRenderer, ChatAccessibilityProvider } from './chatListRenderer.js';
21
+ import { ChatEditorOptions } from './chatOptions.js';
22
+ import { CONTEXT_IN_CHAT_SESSION, CONTEXT_CHAT_REQUEST_IN_PROGRESS, CONTEXT_RESPONSE_FILTERED } from '../common/chatContextKeys.js';
23
+ import { IChatContributionService } from '../common/chatContributionService.js';
24
+ import { ChatModelInitState } from '../common/chatModel.js';
25
+ import { IChatService } from '../common/chatService.js';
26
+ import { isResponseVM, isRequestVM, isWelcomeVM, ChatViewModel } from '../common/chatViewModel.js';
27
+ var ChatWidget_1;
28
+ const $ = dom.$;
29
+ function revealLastElement(list) {
30
+ list.scrollTop = list.scrollHeight - list.renderHeight;
31
+ }
32
+ let ChatWidget = class ChatWidget extends Disposable {
33
+ static { ChatWidget_1 = this; }
34
+ static { this.CONTRIBS = []; }
35
+ get visible() {
36
+ return this._visible;
37
+ }
38
+ set viewModel(viewModel) {
39
+ if (this._viewModel === viewModel) {
40
+ return;
41
+ }
42
+ this.viewModelDisposables.clear();
43
+ this._viewModel = viewModel;
44
+ if (viewModel) {
45
+ this.viewModelDisposables.add(viewModel);
46
+ }
47
+ this._onDidChangeViewModel.fire();
48
+ }
49
+ get viewModel() {
50
+ return this._viewModel;
51
+ }
52
+ constructor(viewContext, viewOptions, styles, contextKeyService, instantiationService, chatService, chatWidgetService, contextMenuService, _chatAccessibilityService, _instantiationService, _logService) {
53
+ super();
54
+ this.viewContext = viewContext;
55
+ this.viewOptions = viewOptions;
56
+ this.styles = styles;
57
+ this.contextKeyService = contextKeyService;
58
+ this.instantiationService = instantiationService;
59
+ this.chatService = chatService;
60
+ this.contextMenuService = contextMenuService;
61
+ this._chatAccessibilityService = _chatAccessibilityService;
62
+ this._instantiationService = _instantiationService;
63
+ this._logService = _logService;
64
+ this._onDidFocus = this._register(( new Emitter()));
65
+ this.onDidFocus = this._onDidFocus.event;
66
+ this._onDidChangeViewModel = this._register(( new Emitter()));
67
+ this.onDidChangeViewModel = this._onDidChangeViewModel.event;
68
+ this._onDidClear = this._register(( new Emitter()));
69
+ this.onDidClear = this._onDidClear.event;
70
+ this._onDidAcceptInput = this._register(( new Emitter()));
71
+ this.onDidAcceptInput = this._onDidAcceptInput.event;
72
+ this._onDidChangeHeight = this._register(( new Emitter()));
73
+ this.onDidChangeHeight = this._onDidChangeHeight.event;
74
+ this.contribs = [];
75
+ this.visibleChangeCount = 0;
76
+ this._visible = false;
77
+ this.previousTreeScrollHeight = 0;
78
+ this.viewModelDisposables = this._register(( new DisposableStore()));
79
+ CONTEXT_IN_CHAT_SESSION.bindTo(contextKeyService).set(true);
80
+ this.requestInProgress = CONTEXT_CHAT_REQUEST_IN_PROGRESS.bindTo(contextKeyService);
81
+ this._register(chatWidgetService.register(this));
82
+ }
83
+ get supportsFileReferences() {
84
+ return !!this.viewOptions.supportsFileReferences;
85
+ }
86
+ get providerId() {
87
+ return this.viewModel?.providerId || '';
88
+ }
89
+ get inputEditor() {
90
+ return this.inputPart.inputEditor;
91
+ }
92
+ get inputUri() {
93
+ return this.inputPart.inputUri;
94
+ }
95
+ render(parent) {
96
+ const viewId = 'viewId' in this.viewContext ? this.viewContext.viewId : undefined;
97
+ this.editorOptions = this._register(this.instantiationService.createInstance(ChatEditorOptions, viewId, this.styles.listForeground, this.styles.inputEditorBackground, this.styles.resultEditorBackground));
98
+ const renderInputOnTop = this.viewOptions.renderInputOnTop ?? false;
99
+ const renderStyle = this.viewOptions.renderStyle;
100
+ this.container = dom.append(parent, $('.interactive-session'));
101
+ if (renderInputOnTop) {
102
+ this.createInput(this.container, { renderFollowups: false, renderStyle });
103
+ this.listContainer = dom.append(this.container, $(`.interactive-list`));
104
+ }
105
+ else {
106
+ this.listContainer = dom.append(this.container, $(`.interactive-list`));
107
+ this.createInput(this.container);
108
+ }
109
+ this.createList(this.listContainer, { renderStyle });
110
+ this._register(this.editorOptions.onDidChange(() => this.onDidStyleChange()));
111
+ this.onDidStyleChange();
112
+ if (this.viewModel) {
113
+ this.onDidChangeItems();
114
+ revealLastElement(this.tree);
115
+ }
116
+ this.contribs = ( ChatWidget_1.CONTRIBS.map(contrib => {
117
+ try {
118
+ return this._register(this.instantiationService.createInstance(contrib, this));
119
+ }
120
+ catch (err) {
121
+ this._logService.error('Failed to instantiate chat widget contrib', toErrorMessage(err));
122
+ return undefined;
123
+ }
124
+ })).filter(isDefined);
125
+ }
126
+ getContrib(id) {
127
+ return this.contribs.find(c => c.id === id);
128
+ }
129
+ focusInput() {
130
+ this.inputPart.focus();
131
+ }
132
+ hasInputFocus() {
133
+ return this.inputPart.hasFocus();
134
+ }
135
+ moveFocus(item, type) {
136
+ const items = this.viewModel?.getItems();
137
+ if (!items) {
138
+ return;
139
+ }
140
+ const responseItems = items.filter(i => isResponseVM(i));
141
+ const targetIndex = responseItems.indexOf(item);
142
+ if (targetIndex === undefined) {
143
+ return;
144
+ }
145
+ const indexToFocus = type === 'next' ? targetIndex + 1 : targetIndex - 1;
146
+ if (indexToFocus < 0 || indexToFocus > responseItems.length - 1) {
147
+ return;
148
+ }
149
+ this.focus(responseItems[indexToFocus]);
150
+ }
151
+ clear() {
152
+ if (this._dynamicMessageLayoutData) {
153
+ this._dynamicMessageLayoutData.enabled = true;
154
+ }
155
+ this._onDidClear.fire();
156
+ }
157
+ onDidChangeItems(skipDynamicLayout) {
158
+ if (this.tree && this._visible) {
159
+ const treeItems = ( (this.viewModel?.getItems() ?? [])
160
+ .map(item => {
161
+ return {
162
+ element: item,
163
+ collapsed: false,
164
+ collapsible: false
165
+ };
166
+ }));
167
+ this.tree.setChildren(null, treeItems, {
168
+ diffIdentityProvider: {
169
+ getId: (element) => {
170
+ return ((isResponseVM(element) || isRequestVM(element)) ? element.dataId : element.id) +
171
+ ((isWelcomeVM(element) && this.viewModel) ? `_${ChatModelInitState[this.viewModel.initState]}` : '') +
172
+ `${(isRequestVM(element) || isWelcomeVM(element)) }` +
173
+ `${isResponseVM(element) && element.renderData ? `_${this.visibleChangeCount}` : ''}` +
174
+ (isResponseVM(element) ? `_${element.contentReferences.length}` : '');
175
+ },
176
+ }
177
+ });
178
+ if (!skipDynamicLayout && this._dynamicMessageLayoutData) {
179
+ this.layoutDynamicChatTreeItemMode();
180
+ }
181
+ const lastItem = treeItems[treeItems.length - 1]?.element;
182
+ if (lastItem && isResponseVM(lastItem) && lastItem.isComplete) {
183
+ this.renderFollowups(lastItem.replyFollowups, lastItem);
184
+ }
185
+ else if (lastItem && isWelcomeVM(lastItem)) {
186
+ this.renderFollowups(lastItem.sampleQuestions);
187
+ }
188
+ else {
189
+ this.renderFollowups(undefined);
190
+ }
191
+ }
192
+ }
193
+ async renderFollowups(items, response) {
194
+ this.inputPart.renderFollowups(items, response);
195
+ if (this.bodyDimension) {
196
+ this.layout(this.bodyDimension.height, this.bodyDimension.width);
197
+ }
198
+ }
199
+ setVisible(visible) {
200
+ this._visible = visible;
201
+ this.visibleChangeCount++;
202
+ this.renderer.setVisible(visible);
203
+ if (visible) {
204
+ this._register(disposableTimeout(() => {
205
+ if (this._visible) {
206
+ this.onDidChangeItems(true);
207
+ }
208
+ }, 0));
209
+ }
210
+ }
211
+ createList(listContainer, options) {
212
+ const scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.contextKeyService])));
213
+ const delegate = scopedInstantiationService.createInstance(ChatListDelegate);
214
+ const rendererDelegate = {
215
+ getListLength: () => this.tree.getNode(null).visibleChildrenCount,
216
+ };
217
+ this.renderer = this._register(scopedInstantiationService.createInstance(ChatListItemRenderer, this.editorOptions, options, rendererDelegate));
218
+ this._register(this.renderer.onDidClickFollowup(item => {
219
+ this.acceptInput(item.message);
220
+ }));
221
+ this.tree = scopedInstantiationService.createInstance(WorkbenchObjectTree, 'Chat', listContainer, delegate, [this.renderer], {
222
+ identityProvider: { getId: (e) => e.id },
223
+ horizontalScrolling: false,
224
+ supportDynamicHeights: true,
225
+ hideTwistiesOfChildlessElements: true,
226
+ accessibilityProvider: this._instantiationService.createInstance(ChatAccessibilityProvider),
227
+ keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e) => isRequestVM(e) ? e.message : isResponseVM(e) ? e.response.value : '' },
228
+ setRowLineHeight: false,
229
+ overrideStyles: {
230
+ listFocusBackground: this.styles.listBackground,
231
+ listInactiveFocusBackground: this.styles.listBackground,
232
+ listActiveSelectionBackground: this.styles.listBackground,
233
+ listFocusAndSelectionBackground: this.styles.listBackground,
234
+ listInactiveSelectionBackground: this.styles.listBackground,
235
+ listHoverBackground: this.styles.listBackground,
236
+ listBackground: this.styles.listBackground,
237
+ listFocusForeground: this.styles.listForeground,
238
+ listHoverForeground: this.styles.listForeground,
239
+ listInactiveFocusForeground: this.styles.listForeground,
240
+ listInactiveSelectionForeground: this.styles.listForeground,
241
+ listActiveSelectionForeground: this.styles.listForeground,
242
+ listFocusAndSelectionForeground: this.styles.listForeground,
243
+ }
244
+ });
245
+ this.tree.onContextMenu(e => this.onContextMenu(e));
246
+ this._register(this.tree.onDidChangeContentHeight(() => {
247
+ this.onDidChangeTreeContentHeight();
248
+ }));
249
+ this._register(this.renderer.onDidChangeItemHeight(e => {
250
+ this.tree.updateElementHeight(e.element, e.height);
251
+ }));
252
+ this._register(this.tree.onDidFocus(() => {
253
+ this._onDidFocus.fire();
254
+ }));
255
+ }
256
+ onContextMenu(e) {
257
+ e.browserEvent.preventDefault();
258
+ e.browserEvent.stopPropagation();
259
+ const selected = e.element;
260
+ const scopedContextKeyService = this.contextKeyService.createOverlay([
261
+ [CONTEXT_RESPONSE_FILTERED.key, isResponseVM(selected) && !!selected.errorDetails?.responseIsFiltered]
262
+ ]);
263
+ this.contextMenuService.showContextMenu({
264
+ menuId: MenuId.ChatContext,
265
+ menuActionOptions: { shouldForwardArgs: true },
266
+ contextKeyService: scopedContextKeyService,
267
+ getAnchor: () => e.anchor,
268
+ getActionsContext: () => selected,
269
+ });
270
+ }
271
+ onDidChangeTreeContentHeight() {
272
+ if (this.tree.scrollHeight !== this.previousTreeScrollHeight) {
273
+ const lastElementWasVisible = this.tree.scrollTop + this.tree.renderHeight >= this.previousTreeScrollHeight - 2;
274
+ if (lastElementWasVisible) {
275
+ dom.scheduleAtNextAnimationFrame(dom.getWindow(this.listContainer), () => {
276
+ revealLastElement(this.tree);
277
+ }, 0);
278
+ }
279
+ }
280
+ this.previousTreeScrollHeight = this.tree.scrollHeight;
281
+ }
282
+ createInput(container, options) {
283
+ this.inputPart = this._register(this.instantiationService.createInstance(ChatInputPart, {
284
+ renderFollowups: options?.renderFollowups ?? true,
285
+ renderStyle: options?.renderStyle,
286
+ }));
287
+ this.inputPart.render(container, '', this);
288
+ this._register(this.inputPart.onDidLoadInputState(state => {
289
+ this.contribs.forEach(c => {
290
+ if (c.setInputState && typeof state === 'object' && state?.[c.id]) {
291
+ c.setInputState(state[c.id]);
292
+ }
293
+ });
294
+ }));
295
+ this._register(this.inputPart.onDidFocus(() => this._onDidFocus.fire()));
296
+ this._register(this.inputPart.onDidAcceptFollowup(e => {
297
+ if (!this.viewModel) {
298
+ return;
299
+ }
300
+ this.acceptInput(e.followup.message);
301
+ if (!e.response) {
302
+ return;
303
+ }
304
+ this.chatService.notifyUserAction({
305
+ providerId: this.viewModel.providerId,
306
+ sessionId: this.viewModel.sessionId,
307
+ requestId: e.response.requestId,
308
+ agentId: e.response?.agent?.id,
309
+ action: {
310
+ kind: 'followUp',
311
+ followup: e.followup
312
+ },
313
+ });
314
+ }));
315
+ this._register(this.inputPart.onDidChangeHeight(() => this.bodyDimension && this.layout(this.bodyDimension.height, this.bodyDimension.width)));
316
+ }
317
+ onDidStyleChange() {
318
+ this.container.style.setProperty('--vscode-interactive-result-editor-background-color', this.editorOptions.configuration.resultEditor.backgroundColor?.toString() ?? '');
319
+ this.container.style.setProperty('--vscode-interactive-session-foreground', this.editorOptions.configuration.foreground?.toString() ?? '');
320
+ }
321
+ setModel(model, viewState) {
322
+ if (!this.container) {
323
+ throw new Error('Call render() before setModel()');
324
+ }
325
+ this.container.setAttribute('data-session-id', model.sessionId);
326
+ this.viewModel = this.instantiationService.createInstance(ChatViewModel, model);
327
+ this.viewModelDisposables.add(this.viewModel.onDidChange(e => {
328
+ this.requestInProgress.set(this.viewModel.requestInProgress);
329
+ this.onDidChangeItems();
330
+ if (e?.kind === 'addRequest') {
331
+ revealLastElement(this.tree);
332
+ this.focusInput();
333
+ }
334
+ }));
335
+ this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(() => {
336
+ this.inputPart.saveState();
337
+ this.viewModel = undefined;
338
+ this.onDidChangeItems();
339
+ }));
340
+ this.inputPart.setState(model.providerId, viewState.inputValue);
341
+ this.contribs.forEach(c => {
342
+ if (c.setInputState && viewState.inputState?.[c.id]) {
343
+ c.setInputState(viewState.inputState?.[c.id]);
344
+ }
345
+ });
346
+ if (this.tree) {
347
+ this.onDidChangeItems();
348
+ revealLastElement(this.tree);
349
+ }
350
+ }
351
+ getFocus() {
352
+ return this.tree.getFocus()[0] ?? undefined;
353
+ }
354
+ reveal(item) {
355
+ this.tree.reveal(item);
356
+ }
357
+ focus(item) {
358
+ const items = this.tree.getNode(null).children;
359
+ const node = items.find(i => i.element?.id === item.id);
360
+ if (!node) {
361
+ return;
362
+ }
363
+ this.tree.setFocus([node.element]);
364
+ this.tree.domFocus();
365
+ }
366
+ setInputPlaceholder(placeholder) {
367
+ this.viewModel?.setInputPlaceholder(placeholder);
368
+ }
369
+ resetInputPlaceholder() {
370
+ this.viewModel?.resetInputPlaceholder();
371
+ }
372
+ updateInput(value = '') {
373
+ this.inputPart.setValue(value);
374
+ }
375
+ getInput() {
376
+ return this.inputPart.inputEditor.getValue();
377
+ }
378
+ async acceptInput(query) {
379
+ this._acceptInput(query ? { query } : undefined);
380
+ }
381
+ async acceptInputWithPrefix(prefix) {
382
+ this._acceptInput({ prefix });
383
+ }
384
+ collectInputState() {
385
+ const inputState = {};
386
+ this.contribs.forEach(c => {
387
+ if (c.getInputState) {
388
+ inputState[c.id] = c.getInputState();
389
+ }
390
+ });
391
+ return inputState;
392
+ }
393
+ async _acceptInput(opts) {
394
+ if (this.viewModel) {
395
+ this._onDidAcceptInput.fire();
396
+ const editorValue = this.getInput();
397
+ const requestId = this._chatAccessibilityService.acceptRequest();
398
+ const input = !opts ? editorValue :
399
+ 'query' in opts ? opts.query :
400
+ `${opts.prefix} ${editorValue}`;
401
+ const isUserQuery = !opts || 'query' in opts;
402
+ const result = await this.chatService.sendRequest(this.viewModel.sessionId, input);
403
+ if (result) {
404
+ const inputState = this.collectInputState();
405
+ this.inputPart.acceptInput(isUserQuery ? input : undefined, isUserQuery ? inputState : undefined);
406
+ result.responseCompletePromise.then(async () => {
407
+ const responses = this.viewModel?.getItems().filter(isResponseVM);
408
+ const lastResponse = responses?.[responses.length - 1];
409
+ this._chatAccessibilityService.acceptResponse(lastResponse, requestId);
410
+ });
411
+ }
412
+ else {
413
+ this._chatAccessibilityService.acceptResponse(undefined, requestId);
414
+ }
415
+ }
416
+ }
417
+ getCodeBlockInfosForResponse(response) {
418
+ return this.renderer.getCodeBlockInfosForResponse(response);
419
+ }
420
+ getCodeBlockInfoForEditor(uri) {
421
+ return this.renderer.getCodeBlockInfoForEditor(uri);
422
+ }
423
+ getFileTreeInfosForResponse(response) {
424
+ return this.renderer.getFileTreeInfosForResponse(response);
425
+ }
426
+ getLastFocusedFileTreeForResponse(response) {
427
+ return this.renderer.getLastFocusedFileTreeForResponse(response);
428
+ }
429
+ focusLastMessage() {
430
+ if (!this.viewModel) {
431
+ return;
432
+ }
433
+ const items = this.tree.getNode(null).children;
434
+ const lastItem = items[items.length - 1];
435
+ if (!lastItem) {
436
+ return;
437
+ }
438
+ this.tree.setFocus([lastItem.element]);
439
+ this.tree.domFocus();
440
+ }
441
+ layout(height, width) {
442
+ width = Math.min(width, 850);
443
+ this.bodyDimension = new dom.Dimension(width, height);
444
+ const inputPartHeight = this.inputPart.layout(height, width);
445
+ const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight;
446
+ const listHeight = height - inputPartHeight;
447
+ this.tree.layout(listHeight, width);
448
+ this.tree.getHTMLElement().style.height = `${listHeight}px`;
449
+ this.renderer.layout(width);
450
+ if (lastElementVisible) {
451
+ revealLastElement(this.tree);
452
+ }
453
+ this.listContainer.style.height = `${height - inputPartHeight}px`;
454
+ this._onDidChangeHeight.fire(height);
455
+ }
456
+ setDynamicChatTreeItemLayout(numOfChatTreeItems, maxHeight) {
457
+ this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
458
+ this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode()));
459
+ const mutableDisposable = this._register(( new MutableDisposable()));
460
+ this._register(this.tree.onDidScroll((e) => {
461
+ if (!this._dynamicMessageLayoutData?.enabled) {
462
+ return;
463
+ }
464
+ mutableDisposable.value = dom.scheduleAtNextAnimationFrame(dom.getWindow(this.listContainer), () => {
465
+ if (!e.scrollTopChanged || e.heightChanged || e.scrollHeightChanged) {
466
+ return;
467
+ }
468
+ const renderHeight = e.height;
469
+ const diff = e.scrollHeight - renderHeight - e.scrollTop;
470
+ if (diff === 0) {
471
+ return;
472
+ }
473
+ const possibleMaxHeight = (this._dynamicMessageLayoutData?.maxHeight ?? maxHeight);
474
+ const width = this.bodyDimension?.width ?? this.container.offsetWidth;
475
+ const inputPartHeight = this.inputPart.layout(possibleMaxHeight, width);
476
+ const newHeight = Math.min(renderHeight + diff, possibleMaxHeight - inputPartHeight);
477
+ this.layout(newHeight + inputPartHeight, width);
478
+ });
479
+ }));
480
+ }
481
+ updateDynamicChatTreeItemLayout(numOfChatTreeItems, maxHeight) {
482
+ this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
483
+ let hasChanged = false;
484
+ let height = this.bodyDimension.height;
485
+ let width = this.bodyDimension.width;
486
+ if (maxHeight < this.bodyDimension.height) {
487
+ height = maxHeight;
488
+ hasChanged = true;
489
+ }
490
+ const containerWidth = this.container.offsetWidth;
491
+ if (this.bodyDimension?.width !== containerWidth) {
492
+ width = containerWidth;
493
+ hasChanged = true;
494
+ }
495
+ if (hasChanged) {
496
+ this.layout(height, width);
497
+ }
498
+ }
499
+ get isDynamicChatTreeItemLayoutEnabled() {
500
+ return this._dynamicMessageLayoutData?.enabled ?? false;
501
+ }
502
+ set isDynamicChatTreeItemLayoutEnabled(value) {
503
+ if (!this._dynamicMessageLayoutData) {
504
+ return;
505
+ }
506
+ this._dynamicMessageLayoutData.enabled = value;
507
+ }
508
+ layoutDynamicChatTreeItemMode() {
509
+ if (!this.viewModel || !this._dynamicMessageLayoutData?.enabled) {
510
+ return;
511
+ }
512
+ const width = this.bodyDimension?.width ?? this.container.offsetWidth;
513
+ const inputHeight = this.inputPart.layout(this._dynamicMessageLayoutData.maxHeight, width);
514
+ const totalMessages = this.viewModel.getItems();
515
+ const messages = totalMessages.slice(-this._dynamicMessageLayoutData.numOfMessages);
516
+ const needsRerender = ( messages.some(m => m.currentRenderedHeight === undefined));
517
+ const listHeight = needsRerender
518
+ ? this._dynamicMessageLayoutData.maxHeight
519
+ : messages.reduce((acc, message) => acc + message.currentRenderedHeight, 0);
520
+ this.layout(Math.min(
521
+ inputHeight + listHeight + (totalMessages.length > 2 ? 18 : 0), this._dynamicMessageLayoutData.maxHeight), width);
522
+ if (needsRerender || !listHeight) {
523
+ revealLastElement(this.tree);
524
+ }
525
+ }
526
+ saveState() {
527
+ this.inputPart.saveState();
528
+ }
529
+ getViewState() {
530
+ this.inputPart.saveState();
531
+ return { inputValue: this.getInput(), inputState: this.collectInputState() };
532
+ }
533
+ };
534
+ ChatWidget = ChatWidget_1 = ( __decorate([
535
+ ( __param(3, IContextKeyService)),
536
+ ( __param(4, IInstantiationService)),
537
+ ( __param(5, IChatService)),
538
+ ( __param(6, IChatWidgetService)),
539
+ ( __param(7, IContextMenuService)),
540
+ ( __param(8, IChatAccessibilityService)),
541
+ ( __param(9, IInstantiationService)),
542
+ ( __param(10, ILogService))
543
+ ], ChatWidget));
544
+ let ChatWidgetService = class ChatWidgetService {
545
+ get lastFocusedWidget() {
546
+ return this._lastFocusedWidget;
547
+ }
548
+ constructor(viewsService, chatContributionService) {
549
+ this.viewsService = viewsService;
550
+ this.chatContributionService = chatContributionService;
551
+ this._widgets = [];
552
+ this._lastFocusedWidget = undefined;
553
+ }
554
+ getWidgetByInputUri(uri) {
555
+ return this._widgets.find(w => isEqual(w.inputUri, uri));
556
+ }
557
+ getWidgetBySessionId(sessionId) {
558
+ return this._widgets.find(w => w.viewModel?.sessionId === sessionId);
559
+ }
560
+ async revealViewForProvider(providerId) {
561
+ const viewId = this.chatContributionService.getViewIdForProvider(providerId);
562
+ const view = await this.viewsService.openView(viewId);
563
+ return view?.widget;
564
+ }
565
+ setLastFocusedWidget(widget) {
566
+ if (widget === this._lastFocusedWidget) {
567
+ return;
568
+ }
569
+ this._lastFocusedWidget = widget;
570
+ }
571
+ register(newWidget) {
572
+ if (( this._widgets.some(widget => widget === newWidget))) {
573
+ throw new Error('Cannot register the same widget multiple times');
574
+ }
575
+ this._widgets.push(newWidget);
576
+ return combinedDisposable(newWidget.onDidFocus(() => this.setLastFocusedWidget(newWidget)), toDisposable(() => this._widgets.splice(this._widgets.indexOf(newWidget), 1)));
577
+ }
578
+ };
579
+ ChatWidgetService = ( __decorate([
580
+ ( __param(0, IViewsService)),
581
+ ( __param(1, IChatContributionService))
582
+ ], ChatWidgetService));
583
+ export { ChatWidget, ChatWidgetService };
@@ -0,0 +1,4 @@
1
+ import n from '../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
2
+ var css = ".interactive-result-code-block{position:relative}.interactive-result-code-block .monaco-toolbar{background-color:var(--vscode-interactive-result-editor-background-color,var(--vscode-editor-background));border:1px solid var(--vscode-chat-requestBorder);display:none;height:26px;position:absolute;right:10px;top:-13px;z-index:100}.interactive-result-code-block .monaco-toolbar .action-item{height:24px;margin:1px 2px;width:24px}.interactive-result-code-block .monaco-toolbar .action-item .codicon{margin:1px}.interactive-result-code-block .monaco-toolbar:focus-within,.interactive-result-code-block.focused .monaco-toolbar,.interactive-result-code-block:hover .monaco-toolbar{border-radius:2px;display:initial}.interactive-result-code-block .interactive-result-code-block-toolbar.force-visibility .monaco-toolbar{display:initial!important}.interactive-result-code-block{background-color:var(--vscode-interactive-result-editor-background-color);border:1px solid var(--vscode-input-border,transparent);margin:16px 0}.interactive-result-code-block:has(.monaco-editor.focused){border-color:var(--vscode-focusBorder,transparent)}.interactive-result-code-block,.interactive-result-code-block .monaco-editor,.interactive-result-code-block .monaco-editor .overflow-guard{border-radius:4px}.interactive-result-code-block .interactive-result-vulns{font-size:.9em;padding:0 8px 2px}.interactive-result-code-block .interactive-result-vulns-header{display:flex;height:22px}.interactive-result-code-block .interactive-result-vulns-header,.interactive-result-code-block .interactive-result-vulns-list{opacity:.8}.interactive-result-code-block .interactive-result-vulns-list{margin:0;padding-bottom:3px;padding-left:16px!important}.interactive-result-code-block.chat-vulnerabilities-collapsed .interactive-result-vulns-list{display:none}.interactive-result-code-block .interactive-result-vulns-list .chat-vuln-title{font-weight:700}.interactive-result-code-block.no-vulns .interactive-result-vulns{display:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-button{border:none;color:var(--vscode-foreground)!important;display:inline-flex;justify-content:normal;padding:0;text-align:initial;user-select:none;width:100%}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus{outline:none}.interactive-result-code-block .interactive-result-vulns-header .monaco-text-button:focus-visible{outline:1px solid var(--vscode-focusBorder)}";
3
+ n(css,{});
4
+ export { css, css as default };