@codingame/monaco-vscode-api 16.1.1 → 17.1.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 (604) hide show
  1. package/missing-services.js +105 -0
  2. package/monaco.d.ts +2 -2
  3. package/package.json +10 -9
  4. package/services.d.ts +4 -4
  5. package/services.js +3 -3
  6. package/vscode/product.json.js +3 -0
  7. package/vscode/src/vs/base/browser/dom.d.ts +1 -0
  8. package/vscode/src/vs/base/browser/dom.js +6 -1
  9. package/vscode/src/vs/base/browser/mouseEvent.d.ts +2 -0
  10. package/vscode/src/vs/base/browser/mouseEvent.js +1 -0
  11. package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  12. package/vscode/src/vs/base/browser/ui/dropdown/dropdown.d.ts +2 -3
  13. package/vscode/src/vs/base/browser/ui/dropdown/dropdown.js +1 -1
  14. package/vscode/src/vs/base/browser/ui/hover/hover.d.ts +1 -0
  15. package/vscode/src/vs/base/browser/ui/hover/hoverDelegate2.js +6 -1
  16. package/vscode/src/vs/base/browser/ui/list/listPaging.d.ts +2 -1
  17. package/vscode/src/vs/base/browser/ui/severityIcon/media/severityIcon.css +1 -3
  18. package/vscode/src/vs/base/browser/ui/toggle/toggle.d.ts +5 -1
  19. package/vscode/src/vs/base/browser/ui/toggle/toggle.js +17 -4
  20. package/vscode/src/vs/base/common/arrays.d.ts +1 -0
  21. package/vscode/src/vs/base/common/arrays.js +5 -2
  22. package/vscode/src/vs/base/common/async.js +9 -2
  23. package/vscode/src/vs/base/common/codicons.d.ts +5 -0
  24. package/vscode/src/vs/base/common/codiconsLibrary.d.ts +5 -0
  25. package/vscode/src/vs/base/common/codiconsLibrary.js +5 -0
  26. package/vscode/src/vs/base/common/color.d.ts +1 -0
  27. package/vscode/src/vs/base/common/color.js +10 -0
  28. package/vscode/src/vs/base/common/comparers.d.ts +2 -2
  29. package/vscode/src/vs/base/common/decorators.d.ts +1 -1
  30. package/vscode/src/vs/base/common/glob.d.ts +3 -0
  31. package/vscode/src/vs/base/common/glob.js +10 -1
  32. package/vscode/src/vs/base/common/marshallingIds.d.ts +2 -1
  33. package/vscode/src/vs/base/common/marshallingIds.js +1 -0
  34. package/vscode/src/vs/base/common/observableInternal/autorun.d.ts +6 -8
  35. package/vscode/src/vs/base/common/observableInternal/autorun.js +15 -11
  36. package/vscode/src/vs/base/common/observableInternal/base.d.ts +0 -10
  37. package/vscode/src/vs/base/common/observableInternal/changeTracker.d.ts +23 -0
  38. package/vscode/src/vs/base/common/observableInternal/changeTracker.js +30 -0
  39. package/vscode/src/vs/base/common/observableInternal/derived.d.ts +18 -13
  40. package/vscode/src/vs/base/common/observableInternal/derived.js +47 -18
  41. package/vscode/src/vs/base/common/observableInternal/index.d.ts +6 -5
  42. package/vscode/src/vs/base/common/observableInternal/index.js +2 -2
  43. package/vscode/src/vs/base/common/observableInternal/logging/logging.d.ts +2 -2
  44. package/vscode/src/vs/base/common/observableInternal/promise.d.ts +28 -0
  45. package/vscode/src/vs/base/common/observableInternal/promise.js +65 -0
  46. package/vscode/src/vs/base/common/observableInternal/reducer.d.ts +16 -0
  47. package/vscode/src/vs/base/common/observableInternal/reducer.js +36 -0
  48. package/vscode/src/vs/base/common/observableInternal/utils.d.ts +2 -0
  49. package/vscode/src/vs/base/common/observableInternal/utils.js +19 -11
  50. package/vscode/src/vs/base/common/product.d.ts +5 -0
  51. package/vscode/src/vs/base/common/sseParser.d.ts +26 -0
  52. package/vscode/src/vs/base/common/sseParser.js +134 -0
  53. package/vscode/src/vs/base/common/stopwatch.js +2 -2
  54. package/vscode/src/vs/base/common/strings.d.ts +1 -0
  55. package/vscode/src/vs/base/common/strings.js +8 -19
  56. package/vscode/src/vs/base/common/ternarySearchTree.d.ts +1 -0
  57. package/vscode/src/vs/base/common/ternarySearchTree.js +55 -13
  58. package/vscode/src/vs/editor/browser/config/editorConfiguration.d.ts +1 -0
  59. package/vscode/src/vs/editor/browser/config/editorConfiguration.js +3 -1
  60. package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.css +1 -1
  61. package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.d.ts +6 -3
  62. package/vscode/src/vs/editor/browser/controller/editContext/native/nativeEditContext.js +86 -54
  63. package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.d.ts +0 -1
  64. package/vscode/src/vs/editor/browser/controller/editContext/native/screenReaderSupport.js +12 -8
  65. package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.d.ts +0 -1
  66. package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +9 -6
  67. package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextInput.js +3 -3
  68. package/vscode/src/vs/editor/browser/controller/mouseTarget.js +2 -2
  69. package/vscode/src/vs/editor/browser/editorBrowser.d.ts +1 -1
  70. package/vscode/src/vs/editor/browser/gpu/objectCollectionBuffer.d.ts +1 -1
  71. package/vscode/src/vs/editor/browser/services/abstractCodeEditorService.js +2 -0
  72. package/vscode/src/vs/editor/browser/services/hoverService/hover.css +8 -0
  73. package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.d.ts +1 -0
  74. package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +6 -1
  75. package/vscode/src/vs/editor/browser/view/renderingContext.d.ts +1 -0
  76. package/vscode/src/vs/editor/browser/view/renderingContext.js +3 -0
  77. package/vscode/src/vs/editor/browser/view/viewLayer.d.ts +3 -1
  78. package/vscode/src/vs/editor/browser/view/viewLayer.js +13 -6
  79. package/vscode/src/vs/editor/browser/view/viewOverlays.js +4 -1
  80. package/vscode/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +4 -5
  81. package/vscode/src/vs/editor/browser/viewParts/glyphMargin/glyphMargin.js +4 -2
  82. package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursor.d.ts +0 -1
  83. package/vscode/src/vs/editor/browser/viewParts/viewCursors/viewCursor.js +6 -6
  84. package/vscode/src/vs/editor/browser/viewParts/viewLines/viewLine.js +3 -0
  85. package/vscode/src/vs/editor/browser/viewParts/viewLines/viewLines.js +2 -2
  86. package/vscode/src/vs/editor/browser/viewParts/viewLinesGpu/viewLinesGpu.js +1 -1
  87. package/vscode/src/vs/editor/browser/viewParts/whitespace/whitespace.js +1 -1
  88. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.d.ts +5 -2
  89. package/vscode/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +15 -1
  90. package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +7 -5
  91. package/vscode/src/vs/editor/browser/widget/diffEditor/diffEditorOptions.d.ts +1 -1
  92. package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +10 -8
  93. package/vscode/src/vs/editor/browser/widget/diffEditor/utils.js +19 -15
  94. package/vscode/src/vs/editor/common/codecs/frontMatterCodec/tokens/index.d.ts +5 -0
  95. package/vscode/src/vs/editor/common/codecs/simpleCodec/tokens/index.d.ts +20 -0
  96. package/vscode/src/vs/editor/common/config/editorOptions.d.ts +24 -23
  97. package/vscode/src/vs/editor/common/config/editorOptions.js +1 -2
  98. package/vscode/src/vs/editor/common/core/columnRange.d.ts +11 -0
  99. package/vscode/src/vs/editor/common/core/columnRange.js +32 -0
  100. package/vscode/src/vs/editor/common/core/offsetEdit.d.ts +1 -0
  101. package/vscode/src/vs/editor/common/core/offsetEdit.js +10 -0
  102. package/vscode/src/vs/editor/common/core/offsetRange.d.ts +1 -0
  103. package/vscode/src/vs/editor/common/core/offsetRange.js +3 -0
  104. package/vscode/src/vs/editor/common/core/positionToOffset.d.ts +15 -3
  105. package/vscode/src/vs/editor/common/core/positionToOffset.js +45 -11
  106. package/vscode/src/vs/editor/common/core/rangeSingleLine.d.ts +9 -0
  107. package/vscode/src/vs/editor/common/core/rangeSingleLine.js +27 -0
  108. package/vscode/src/vs/editor/common/core/textEdit.d.ts +1 -0
  109. package/vscode/src/vs/editor/common/core/textEdit.js +41 -0
  110. package/vscode/src/vs/editor/common/editorCommon.d.ts +1 -0
  111. package/vscode/src/vs/editor/common/languages/modesRegistry.d.ts +2 -2
  112. package/vscode/src/vs/editor/common/languages/modesRegistry.js +4 -2
  113. package/vscode/src/vs/editor/common/languages.d.ts +22 -1
  114. package/vscode/src/vs/editor/common/languages.js +7 -1
  115. package/vscode/src/vs/editor/common/model/textModel.d.ts +5 -1
  116. package/vscode/src/vs/editor/common/model/textModel.js +80 -18
  117. package/vscode/src/vs/editor/common/model/tokenizationTextModelPart.js +1 -1
  118. package/vscode/src/vs/editor/common/model.d.ts +2 -1
  119. package/vscode/src/vs/editor/common/standalone/standaloneEnums.d.ts +5 -0
  120. package/vscode/src/vs/editor/common/standalone/standaloneEnums.js +7 -1
  121. package/vscode/src/vs/editor/common/textModelEvents.d.ts +11 -0
  122. package/vscode/src/vs/editor/common/textModelEvents.js +14 -1
  123. package/vscode/src/vs/editor/common/tokens/common.d.ts +7 -0
  124. package/vscode/src/vs/editor/common/tokens/common.js +18 -0
  125. package/vscode/src/vs/editor/common/tokens/contiguousTokensEditing.d.ts +1 -1
  126. package/vscode/src/vs/editor/common/tokens/lineTokens.d.ts +1 -0
  127. package/vscode/src/vs/editor/common/tokens/lineTokens.js +3 -0
  128. package/vscode/src/vs/editor/common/tokens/sparseMultilineTokens.d.ts +2 -0
  129. package/vscode/src/vs/editor/common/tokens/sparseMultilineTokens.js +20 -0
  130. package/vscode/src/vs/editor/common/tokens/sparseTokensStore.d.ts +2 -1
  131. package/vscode/src/vs/editor/common/tokens/sparseTokensStore.js +9 -4
  132. package/vscode/src/vs/editor/common/tokens/tokenArray.d.ts +1 -0
  133. package/vscode/src/vs/editor/common/tokens/tokenArray.js +4 -0
  134. package/vscode/src/vs/editor/common/tokens/tokenWithTextArray.d.ts +25 -0
  135. package/vscode/src/vs/editor/common/tokens/tokenWithTextArray.js +73 -0
  136. package/vscode/src/vs/editor/common/viewLayout/lineHeights.d.ts +35 -0
  137. package/vscode/src/vs/editor/common/viewLayout/lineHeights.js +339 -0
  138. package/vscode/src/vs/editor/common/viewLayout/linesLayout.d.ts +8 -6
  139. package/vscode/src/vs/editor/common/viewLayout/linesLayout.js +42 -49
  140. package/vscode/src/vs/editor/common/viewLayout/viewLayout.d.ts +6 -3
  141. package/vscode/src/vs/editor/common/viewLayout/viewLayout.js +16 -5
  142. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.d.ts +1 -0
  143. package/vscode/src/vs/editor/common/viewModel/viewModelImpl.js +44 -7
  144. package/vscode/src/vs/editor/common/viewModel.d.ts +5 -0
  145. package/vscode/src/vs/editor/common/viewModelEventDispatcher.d.ts +11 -3
  146. package/vscode/src/vs/editor/common/viewModelEventDispatcher.js +14 -1
  147. package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +20 -14
  148. package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +3 -1
  149. package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionModel.js +3 -1
  150. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorDetector.d.ts +1 -1
  151. package/vscode/src/vs/editor/contrib/colorPicker/browser/colorDetector.js +4 -3
  152. package/vscode/src/vs/editor/contrib/find/browser/findController.d.ts +1 -3
  153. package/vscode/src/vs/editor/contrib/find/browser/findController.js +5 -11
  154. package/vscode/src/vs/editor/contrib/find/browser/findWidget.d.ts +1 -7
  155. package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +2 -15
  156. package/vscode/src/vs/editor/contrib/folding/browser/folding.d.ts +1 -1
  157. package/vscode/src/vs/editor/contrib/folding/browser/folding.js +24 -23
  158. package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
  159. package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
  160. package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
  161. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
  162. package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
  163. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
  164. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  165. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
  166. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
  167. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
  168. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
  169. package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +5 -5
  170. package/vscode/src/vs/editor/contrib/gpu/browser/gpuActions.js +4 -4
  171. package/vscode/src/vs/editor/contrib/hover/browser/contentHoverRendered.js +3 -3
  172. package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
  173. package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
  174. package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +24 -24
  175. package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +14 -12
  176. package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
  177. package/vscode/src/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
  178. package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +21 -21
  179. package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
  180. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.d.ts +0 -4
  181. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +29 -41
  182. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +11 -11
  183. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.d.ts +1 -0
  184. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +11 -6
  185. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
  186. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +6 -6
  187. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletions.contribution.js +1 -2
  188. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.d.ts +4 -4
  189. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsAccessibleView.js +1 -2
  190. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.d.ts +10 -0
  191. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/changeRecorder.js +31 -2
  192. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/ghostText.d.ts +1 -1
  193. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.d.ts +16 -16
  194. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +156 -202
  195. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.d.ts +21 -49
  196. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +135 -431
  197. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineEdit.d.ts +3 -3
  198. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.d.ts +98 -0
  199. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js +487 -0
  200. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.d.ts +34 -32
  201. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/provideInlineCompletions.js +141 -132
  202. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.d.ts +1 -1
  203. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/model/suggestWidgetAdapter.js +2 -2
  204. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/structuredLogger.d.ts +26 -0
  205. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.d.ts +2 -7
  206. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/utils.js +21 -20
  207. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +19 -7
  208. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineCompletionsView.js +1 -1
  209. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +17 -9
  210. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.d.ts +5 -13
  211. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +139 -188
  212. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.d.ts +8 -6
  213. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditWithChanges.js +9 -3
  214. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.d.ts +4 -4
  215. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +6 -6
  216. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.d.ts +23 -0
  217. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsNewUsers.js +157 -0
  218. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.d.ts +2 -0
  219. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsView.js +37 -20
  220. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewInterface.d.ts +3 -2
  221. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViewProducer.js +3 -4
  222. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.d.ts +6 -1
  223. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCollapsedView.js +28 -5
  224. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.d.ts +21 -0
  225. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.js +215 -0
  226. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.js +0 -1
  227. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.js +0 -1
  228. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +2 -2
  229. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.d.ts +1 -3
  230. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.js +3 -4
  231. package/vscode/src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +22 -21
  232. package/vscode/src/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
  233. package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
  234. package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +30 -30
  235. package/vscode/src/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
  236. package/vscode/src/vs/editor/contrib/links/browser/links.js +10 -10
  237. package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
  238. package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
  239. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
  240. package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
  241. package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +17 -17
  242. package/vscode/src/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
  243. package/vscode/src/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
  244. package/vscode/src/vs/editor/contrib/rename/browser/rename.js +23 -49
  245. package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
  246. package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
  247. package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
  248. package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
  249. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
  250. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.js +8 -0
  251. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollModelProvider.js +1 -1
  252. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollProvider.js +2 -2
  253. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.d.ts +1 -0
  254. package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.js +24 -14
  255. package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
  256. package/vscode/src/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
  257. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +19 -18
  258. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
  259. package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
  260. package/vscode/src/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
  261. package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
  262. package/vscode/src/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
  263. package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
  264. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +5 -10
  265. package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
  266. package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
  267. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
  268. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
  269. package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
  270. package/vscode/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.js +1 -1
  271. package/vscode/src/vs/editor/standalone/browser/standaloneServices.d.ts +2 -2
  272. package/vscode/src/vs/editor/standalone/browser/standaloneServices.js +2 -2
  273. package/vscode/src/vs/platform/accessibility/browser/accessibleView.d.ts +1 -1
  274. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.d.ts +3 -0
  275. package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +23 -14
  276. package/vscode/src/vs/platform/actionWidget/browser/actionList.d.ts +2 -0
  277. package/vscode/src/vs/platform/actionWidget/browser/actionList.js +17 -3
  278. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +6 -1
  279. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.d.ts +2 -1
  280. package/vscode/src/vs/platform/actionWidget/browser/actionWidget.service.d.ts +2 -1
  281. package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
  282. package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
  283. package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -1
  284. package/vscode/src/vs/platform/actions/common/actions.js +2 -0
  285. package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
  286. package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
  287. package/vscode/src/vs/platform/clipboard/browser/clipboardService.d.ts +1 -0
  288. package/vscode/src/vs/platform/clipboard/browser/clipboardService.js +3 -0
  289. package/vscode/src/vs/platform/clipboard/common/clipboardService.service.d.ts +1 -0
  290. package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +15 -13
  291. package/vscode/src/vs/platform/configuration/common/configurations.js +1 -1
  292. package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
  293. package/vscode/src/vs/platform/contextkey/common/contextkey.js +11 -11
  294. package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
  295. package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
  296. package/vscode/src/vs/platform/dialogs/common/dialogs.service.d.ts +1 -1
  297. package/vscode/src/vs/platform/dnd/browser/dnd.d.ts +5 -0
  298. package/vscode/src/vs/platform/dnd/browser/dnd.js +6 -2
  299. package/vscode/src/vs/platform/editor/common/editor.d.ts +1 -0
  300. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +8 -2
  301. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +94 -4
  302. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.service.d.ts +3 -2
  303. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.d.ts +3 -2
  304. package/vscode/src/vs/platform/extensionManagement/common/extensionManagementUtil.js +10 -7
  305. package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
  306. package/vscode/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.js +1 -1
  307. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.d.ts +0 -1
  308. package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +10 -11
  309. package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
  310. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -0
  311. package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.d.ts +7 -6
  312. package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +9 -8
  313. package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
  314. package/vscode/src/vs/platform/files/common/files.js +6 -6
  315. package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
  316. package/vscode/src/vs/platform/jsonschemas/common/jsonContributionRegistry.js +5 -4
  317. package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +5 -5
  318. package/vscode/src/vs/platform/label/common/label.service.d.ts +1 -1
  319. package/vscode/src/vs/platform/languagePacks/common/languagePacks.service.d.ts +1 -1
  320. package/vscode/src/vs/platform/list/browser/listService.d.ts +1 -1
  321. package/vscode/src/vs/platform/list/browser/listService.js +27 -27
  322. package/vscode/src/vs/platform/log/common/log.js +6 -6
  323. package/vscode/src/vs/platform/markers/common/markerService.d.ts +2 -7
  324. package/vscode/src/vs/platform/markers/common/markerService.js +5 -5
  325. package/vscode/src/vs/platform/markers/common/markers.d.ts +7 -0
  326. package/vscode/src/vs/platform/markers/common/markers.js +6 -6
  327. package/vscode/src/vs/platform/markers/common/markers.service.d.ts +2 -7
  328. package/vscode/src/vs/platform/native/common/native.d.ts +168 -0
  329. package/vscode/src/vs/platform/notification/common/notification.d.ts +6 -2
  330. package/vscode/src/vs/platform/notification/common/notification.js +3 -2
  331. package/vscode/src/vs/platform/notification/common/notification.service.d.ts +2 -3
  332. package/vscode/src/vs/platform/product/common/product.js +7 -90
  333. package/vscode/src/vs/platform/quickinput/browser/media/quickInput.css +4 -19
  334. package/vscode/src/vs/platform/quickinput/browser/quickInput.d.ts +6 -3
  335. package/vscode/src/vs/platform/quickinput/browser/quickInput.js +33 -10
  336. package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +3 -3
  337. package/vscode/src/vs/platform/quickinput/browser/quickInputBox.d.ts +2 -0
  338. package/vscode/src/vs/platform/quickinput/browser/quickInputBox.js +6 -0
  339. package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +25 -18
  340. package/vscode/src/vs/platform/quickinput/browser/quickInputTree.d.ts +5 -5
  341. package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +58 -43
  342. package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
  343. package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +1 -1
  344. package/vscode/src/vs/platform/registry/common/platform.js +9 -1
  345. package/vscode/src/vs/platform/request/common/request.d.ts +1 -1
  346. package/vscode/src/vs/platform/request/common/request.js +18 -18
  347. package/vscode/src/vs/platform/request/common/request.service.d.ts +1 -1
  348. package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +1 -1
  349. package/vscode/src/vs/platform/terminal/common/terminal.d.ts +14 -1
  350. package/vscode/src/vs/platform/terminal/common/terminal.js +14 -1
  351. package/vscode/src/vs/platform/theme/browser/defaultStyles.d.ts +1 -2
  352. package/vscode/src/vs/platform/theme/browser/defaultStyles.js +4 -2
  353. package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +7 -1
  354. package/vscode/src/vs/platform/theme/common/colorUtils.js +12 -4
  355. package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
  356. package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
  357. package/vscode/src/vs/platform/theme/common/colors/editorColors.js +94 -94
  358. package/vscode/src/vs/platform/theme/common/colors/inputColors.d.ts +2 -0
  359. package/vscode/src/vs/platform/theme/common/colors/inputColors.js +49 -47
  360. package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
  361. package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
  362. package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
  363. package/vscode/src/vs/platform/theme/common/colors/miscColors.js +15 -15
  364. package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
  365. package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
  366. package/vscode/src/vs/platform/theme/common/iconRegistry.js +10 -8
  367. package/vscode/src/vs/platform/theme/common/themeService.d.ts +0 -8
  368. package/vscode/src/vs/platform/theme/common/themeService.js +4 -3
  369. package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
  370. package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
  371. package/vscode/src/vs/platform/userDataSync/common/userDataSync.d.ts +1 -1
  372. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
  373. package/vscode/src/vs/platform/userDataSync/common/userDataSync.service.d.ts +2 -2
  374. package/vscode/src/vs/platform/window/common/window.d.ts +4 -0
  375. package/vscode/src/vs/platform/window/common/window.js +2 -1
  376. package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
  377. package/vscode/src/vs/platform/workspaces/common/workspaces.service.d.ts +2 -2
  378. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +27 -20
  379. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +54 -19
  380. package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -0
  381. package/vscode/src/vs/workbench/api/common/extHostAiSettingsSearch.d.ts +14 -0
  382. package/vscode/src/vs/workbench/api/common/extHostAiSettingsSearch.js +38 -0
  383. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -0
  384. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.d.ts +2 -1
  385. package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +30 -17
  386. package/vscode/src/vs/workbench/api/common/extHostCodeMapper.js +2 -0
  387. package/vscode/src/vs/workbench/api/common/extHostCommands.d.ts +0 -1
  388. package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -2
  389. package/vscode/src/vs/workbench/api/common/extHostCustomEditors.d.ts +1 -1
  390. package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
  391. package/vscode/src/vs/workbench/api/common/extHostExtensionService.d.ts +2 -0
  392. package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +15 -4
  393. package/vscode/src/vs/workbench/api/common/extHostLabelService.d.ts +1 -1
  394. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.d.ts +4 -0
  395. package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +31 -6
  396. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.d.ts +2 -3
  397. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +60 -14
  398. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.d.ts +1 -1
  399. package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +15 -9
  400. package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
  401. package/vscode/src/vs/workbench/api/common/extHostMcp.d.ts +4 -3
  402. package/vscode/src/vs/workbench/api/common/extHostMcp.js +279 -82
  403. package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
  404. package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +3 -0
  405. package/vscode/src/vs/workbench/api/common/extHostQuickDiff.d.ts +2 -1
  406. package/vscode/src/vs/workbench/api/common/extHostQuickDiff.js +4 -2
  407. package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.d.ts +1 -1
  408. package/vscode/src/vs/workbench/api/common/extHostSCM.d.ts +1 -0
  409. package/vscode/src/vs/workbench/api/common/extHostSCM.js +21 -0
  410. package/vscode/src/vs/workbench/api/common/extHostSearch.js +1 -1
  411. package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
  412. package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -1
  413. package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
  414. package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
  415. package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
  416. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.d.ts +27 -9
  417. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +201 -29
  418. package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +67 -27
  419. package/vscode/src/vs/workbench/api/common/extHostTypes.js +79 -28
  420. package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.d.ts +1 -1
  421. package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +7 -4
  422. package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +34 -9
  423. package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
  424. package/vscode/src/vs/workbench/api/worker/extHostExtensionService.d.ts +1 -0
  425. package/vscode/src/vs/workbench/api/worker/extHostExtensionService.js +3 -0
  426. package/vscode/src/vs/workbench/browser/actions/developerActions.js +31 -31
  427. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
  428. package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbs.service.d.ts +1 -1
  429. package/vscode/src/vs/workbench/common/configuration.js +10 -16
  430. package/vscode/src/vs/workbench/common/contextkeys.d.ts +3 -0
  431. package/vscode/src/vs/workbench/common/contextkeys.js +73 -71
  432. package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +1 -1
  433. package/vscode/src/vs/workbench/common/editor.d.ts +13 -9
  434. package/vscode/src/vs/workbench/common/editor.js +4 -4
  435. package/vscode/src/vs/workbench/common/theme.js +160 -160
  436. package/vscode/src/vs/workbench/common/views.js +4 -4
  437. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +164 -147
  438. package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
  439. package/vscode/src/vs/workbench/contrib/chat/browser/chat.service.d.ts +2 -2
  440. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentParts.d.ts +2 -2
  441. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.service.d.ts +1 -1
  442. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +15 -14
  443. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.d.ts +245 -0
  444. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +435 -0
  445. package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.service.d.ts +1 -1
  446. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.d.ts +6 -9
  447. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +51 -49
  448. package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.d.ts +19 -26
  449. package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.js +16 -23
  450. package/vscode/src/vs/workbench/contrib/chat/common/chatEditingService.service.d.ts +1 -1
  451. package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementService.service.d.ts +2 -2
  452. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.d.ts +585 -0
  453. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +1179 -0
  454. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.d.ts +116 -0
  455. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +211 -0
  456. package/vscode/src/vs/workbench/contrib/chat/common/chatService.d.ts +19 -6
  457. package/vscode/src/vs/workbench/contrib/chat/common/chatService.service.d.ts +4 -4
  458. package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.service.d.ts +3 -1
  459. package/vscode/src/vs/workbench/contrib/chat/common/chatVariables.d.ts +1 -2
  460. package/vscode/src/vs/workbench/contrib/chat/common/chatVariables.service.d.ts +2 -7
  461. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.service.d.ts +1 -1
  462. package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +2 -3
  463. package/vscode/src/vs/workbench/contrib/chat/common/constants.js +12 -4
  464. package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.d.ts +33 -5
  465. package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +14 -3
  466. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.d.ts +18 -3
  467. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +6 -6
  468. package/vscode/src/vs/workbench/contrib/chat/common/modelPicker/modelPickerWidget.d.ts +4 -0
  469. package/vscode/src/vs/workbench/contrib/chat/common/modelPicker/modelPickerWidget.js +6 -0
  470. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/types.d.ts +3 -1
  471. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/promptHeader/metadata/index.d.ts +3 -0
  472. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/types.d.ts +14 -4
  473. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/types.d.ts +28 -1
  474. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/types.service.d.ts +10 -4
  475. package/vscode/src/vs/workbench/contrib/chat/common/tools/editFileTool.d.ts +8 -25
  476. package/vscode/src/vs/workbench/contrib/chat/common/tools/editFileTool.js +11 -97
  477. package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +0 -3
  478. package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +13 -13
  479. package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
  480. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
  481. package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
  482. package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
  483. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.d.ts +1 -1
  484. package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
  485. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
  486. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +4 -4
  487. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
  488. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
  489. package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
  490. package/vscode/src/vs/workbench/contrib/comments/browser/commentService.service.d.ts +1 -1
  491. package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
  492. package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +11 -11
  493. package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
  494. package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +1 -1
  495. package/vscode/src/vs/workbench/contrib/debug/common/debug.js +64 -64
  496. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.d.ts +171 -0
  497. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +85 -0
  498. package/vscode/src/vs/workbench/contrib/extensions/common/extensions.service.d.ts +2 -3
  499. package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.d.ts +10 -0
  500. package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +127 -0
  501. package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
  502. package/vscode/src/vs/workbench/contrib/files/browser/files.service.d.ts +3 -3
  503. package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
  504. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
  505. package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
  506. package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
  507. package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
  508. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +2 -2
  509. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service.d.ts +3 -1
  510. package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
  511. package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
  512. package/vscode/src/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service.d.ts +1 -0
  513. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.d.ts +19 -8
  514. package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +12 -10
  515. package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service.d.ts +1 -1
  516. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +2 -2
  517. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +8 -4
  518. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +16 -1
  519. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
  520. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
  521. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
  522. package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +2 -2
  523. package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.service.d.ts +4 -1
  524. package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.d.ts +11 -3
  525. package/vscode/src/vs/workbench/contrib/scm/common/quickDiffService.js +77 -16
  526. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
  527. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
  528. package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
  529. package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
  530. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
  531. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
  532. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +3 -2
  533. package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
  534. package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
  535. package/vscode/src/vs/workbench/contrib/webview/browser/webview.service.d.ts +1 -1
  536. package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service.d.ts +2 -2
  537. package/vscode/src/vs/workbench/services/accounts/common/defaultAccount.js +1 -1
  538. package/vscode/src/vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.service.d.ts +1 -1
  539. package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.d.ts +17 -0
  540. package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.js +10 -0
  541. package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.service.d.ts +13 -0
  542. package/vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.service.js +6 -0
  543. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverExpression.d.ts +2 -0
  544. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverExpression.js +61 -12
  545. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.d.ts +3 -2
  546. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +25 -29
  547. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +4 -1
  548. package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.service.d.ts +1 -0
  549. package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
  550. package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +1 -1
  551. package/vscode/src/vs/workbench/services/editor/common/editorService.service.d.ts +2 -2
  552. package/vscode/src/vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service.d.ts +1 -1
  553. package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.service.d.ts +1 -1
  554. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +1 -1
  555. package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +3 -2
  556. package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +84 -84
  557. package/vscode/src/vs/workbench/services/host/browser/host.service.d.ts +4 -1
  558. package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
  559. package/vscode/src/vs/workbench/services/layout/browser/layoutService.service.d.ts +2 -4
  560. package/vscode/src/vs/workbench/services/localization/common/locale.service.d.ts +1 -1
  561. package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
  562. package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.d.ts +1 -0
  563. package/vscode/src/vs/workbench/services/notebook/common/notebookDocumentService.js +2 -0
  564. package/vscode/src/vs/workbench/services/outline/browser/outline.service.d.ts +1 -1
  565. package/vscode/src/vs/workbench/services/output/common/output.js +6 -4
  566. package/vscode/src/vs/workbench/services/preferences/common/preferences.service.d.ts +1 -1
  567. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
  568. package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
  569. package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
  570. package/vscode/src/vs/workbench/services/search/common/search.d.ts +2 -1
  571. package/vscode/src/vs/workbench/services/search/common/searchExtTypes.d.ts +5 -0
  572. package/vscode/src/vs/workbench/services/search/common/searchExtTypes.js +6 -1
  573. package/vscode/src/vs/workbench/services/search/common/textSearchManager.d.ts +2 -2
  574. package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +31 -23
  575. package/vscode/src/vs/workbench/services/textfile/common/encoding.d.ts +64 -0
  576. package/vscode/src/vs/workbench/services/textfile/common/encoding.js +560 -0
  577. package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +165 -0
  578. package/vscode/src/vs/workbench/services/textfile/common/textfiles.js +74 -0
  579. package/vscode/src/vs/workbench/services/textfile/common/textfiles.service.d.ts +12 -2
  580. package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +22 -22
  581. package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
  582. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +12 -12
  583. package/vscode/src/vs/workbench/services/workspaces/common/workspaceEditing.service.d.ts +1 -1
  584. package/vscode-dts/vscode.d.ts +204 -9
  585. package/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts +30 -0
  586. package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +18 -16
  587. package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +84 -5
  588. package/vscode-dts/vscode.proposed.chatProvider.d.ts +18 -16
  589. package/vscode-dts/vscode.proposed.chatStatusItem.d.ts +1 -1
  590. package/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts +1 -1
  591. package/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts +1 -1
  592. package/vscode-dts/vscode.proposed.d.ts +2 -2
  593. package/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts +2 -2
  594. package/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts +46 -8
  595. package/vscode-dts/vscode.proposed.languageModelDataPart.d.ts +106 -16
  596. package/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts +2 -0
  597. package/vscode-dts/vscode.proposed.mcpConfigurationProvider.d.ts +115 -21
  598. package/vscode-dts/vscode.proposed.quickDiffProvider.d.ts +7 -3
  599. package/vscode-dts/vscode.proposed.textSearchProvider2.d.ts +23 -1
  600. package/vscode-dts/vscode.proposed.toolProgress.d.ts +25 -0
  601. package/vscode-dts/vscode.proposed.tunnelFactory.d.ts +1 -1
  602. package/workbench.d.ts +1 -1
  603. package/vscode-dts/vscode.proposed.languageModelToolsForAgent.d.ts +0 -8
  604. package/vscode-dts/vscode.proposed.textDocumentEncoding.d.ts +0 -170
@@ -0,0 +1,1179 @@
1
+
2
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
3
+ import { asArray } from '../../../../base/common/arrays.js';
4
+ import { DeferredPromise } from '../../../../base/common/async.js';
5
+ import { Codicon } from '../../../../base/common/codicons.js';
6
+ import { Emitter } from '../../../../base/common/event.js';
7
+ import { isMarkdownString, MarkdownString } from '../../../../base/common/htmlContent.js';
8
+ import { Disposable } from '../../../../base/common/lifecycle.js';
9
+ import { ResourceMap } from '../../../../base/common/map.js';
10
+ import { revive } from '../../../../base/common/marshalling.js';
11
+ import { Schemas } from '../../../../base/common/network.js';
12
+ import { equals } from '../../../../base/common/objects.js';
13
+ import '../../../../base/common/observableInternal/index.js';
14
+ import { basename, isEqual } from '../../../../base/common/resources.js';
15
+ import { URI, isUriComponents } from '../../../../base/common/uri.js';
16
+ import { generateUuid } from '../../../../base/common/uuid.js';
17
+ import { OffsetRange } from '../../../../editor/common/core/offsetRange.js';
18
+ import { TextEdit } from '../../../../editor/common/languages.js';
19
+ import { localize } from '../../../../nls.js';
20
+ import { ILogService } from '../../../../platform/log/common/log.service.js';
21
+ import { CellUri } from '../../notebook/common/notebookCommon.js';
22
+ import { reviveSerializedAgent } from './chatAgents.js';
23
+ import { IChatAgentService } from './chatAgents.service.js';
24
+ import { IChatEditingService } from './chatEditingService.service.js';
25
+ import { reviveParsedChatRequest, ChatRequestTextPart } from './chatParserTypes.js';
26
+ import { isIUsedContext } from './chatService.js';
27
+ import { ChatAgentLocation, ChatMode } from './constants.js';
28
+ import { ObservablePromise } from '../../../../base/common/observableInternal/promise.js';
29
+ import { observableValue } from '../../../../base/common/observableInternal/base.js';
30
+
31
+ var ChatModel_1;
32
+ var OmittedState;
33
+ (function (OmittedState) {
34
+ OmittedState[OmittedState["NotOmitted"] = 0] = "NotOmitted";
35
+ OmittedState[OmittedState["Partial"] = 1] = "Partial";
36
+ OmittedState[OmittedState["Full"] = 2] = "Full";
37
+ })(OmittedState || (OmittedState = {}));
38
+ var IDiagnosticVariableEntryFilterData;
39
+ (function (IDiagnosticVariableEntryFilterData) {
40
+ IDiagnosticVariableEntryFilterData.icon = Codicon.error;
41
+ function fromMarker(marker) {
42
+ return {
43
+ filterUri: marker.resource,
44
+ owner: marker.owner,
45
+ problemMessage: marker.message,
46
+ filterRange: { startLineNumber: marker.startLineNumber, endLineNumber: marker.endLineNumber, startColumn: marker.startColumn, endColumn: marker.endColumn }
47
+ };
48
+ }
49
+ IDiagnosticVariableEntryFilterData.fromMarker = fromMarker;
50
+ function toEntry(data) {
51
+ return {
52
+ id: id(data),
53
+ name: label(data),
54
+ icon: IDiagnosticVariableEntryFilterData.icon,
55
+ value: data,
56
+ kind: 'diagnostic',
57
+ ...data,
58
+ };
59
+ }
60
+ IDiagnosticVariableEntryFilterData.toEntry = toEntry;
61
+ function id(data) {
62
+ return [data.filterUri, data.owner, data.filterSeverity, data.filterRange?.startLineNumber].join(':');
63
+ }
64
+ IDiagnosticVariableEntryFilterData.id = id;
65
+ function label(data) {
66
+ let TrimThreshold;
67
+ (function (TrimThreshold) {
68
+ TrimThreshold[TrimThreshold["MaxChars"] = 30] = "MaxChars";
69
+ TrimThreshold[TrimThreshold["MaxSpaceLookback"] = 10] = "MaxSpaceLookback";
70
+ })(TrimThreshold || (TrimThreshold = {}));
71
+ if (data.problemMessage) {
72
+ if (data.problemMessage.length < TrimThreshold.MaxChars) {
73
+ return data.problemMessage;
74
+ }
75
+ const lastSpace = data.problemMessage.lastIndexOf(' ', TrimThreshold.MaxChars);
76
+ if (lastSpace === -1 || lastSpace + TrimThreshold.MaxSpaceLookback < TrimThreshold.MaxChars) {
77
+ return data.problemMessage.substring(0, TrimThreshold.MaxChars) + '…';
78
+ }
79
+ return data.problemMessage.substring(0, lastSpace) + '…';
80
+ }
81
+ let labelStr = ( localize(5048, "All Problems"));
82
+ if (data.filterUri) {
83
+ labelStr = ( localize(5049, "Problems in {0}", basename(data.filterUri)));
84
+ }
85
+ return labelStr;
86
+ }
87
+ IDiagnosticVariableEntryFilterData.label = label;
88
+ })(IDiagnosticVariableEntryFilterData || (IDiagnosticVariableEntryFilterData = {}));
89
+ function isPasteVariableEntry(obj) {
90
+ return obj.kind === 'paste';
91
+ }
92
+ function isImageVariableEntry(obj) {
93
+ return obj.kind === 'image';
94
+ }
95
+ function isNotebookOutputVariableEntry(obj) {
96
+ return obj.kind === 'notebookOutput';
97
+ }
98
+ function isElementVariableEntry(obj) {
99
+ return obj.kind === 'element';
100
+ }
101
+ function isChatRequestFileEntry(obj) {
102
+ return obj.kind === 'file';
103
+ }
104
+ function isCellTextEditOperation(value) {
105
+ const candidate = value;
106
+ return !!candidate && !!candidate.edit && !!candidate.uri && URI.isUri(candidate.uri);
107
+ }
108
+ const nonHistoryKinds = ( new Set(['toolInvocation', 'toolInvocationSerialized']));
109
+ function isChatProgressHistoryResponseContent(content) {
110
+ return !( nonHistoryKinds.has(content.kind));
111
+ }
112
+ function toChatHistoryContent(content) {
113
+ return content.filter(isChatProgressHistoryResponseContent);
114
+ }
115
+ const defaultChatResponseModelChangeReason = { reason: 'other' };
116
+ class ChatRequestModel {
117
+ get session() {
118
+ return this._session;
119
+ }
120
+ get username() {
121
+ return this.session.requesterUsername;
122
+ }
123
+ get avatarIconUri() {
124
+ return this.session.requesterAvatarIconUri;
125
+ }
126
+ get attempt() {
127
+ return this._attempt;
128
+ }
129
+ get variableData() {
130
+ return this._variableData;
131
+ }
132
+ set variableData(v) {
133
+ this._variableData = v;
134
+ }
135
+ get confirmation() {
136
+ return this._confirmation;
137
+ }
138
+ get locationData() {
139
+ return this._locationData;
140
+ }
141
+ get attachedContext() {
142
+ return this._attachedContext;
143
+ }
144
+ get editedFileEvents() {
145
+ return this._editedFileEvents;
146
+ }
147
+ constructor(params) {
148
+ this._session = params.session;
149
+ this.message = params.message;
150
+ this._variableData = params.variableData;
151
+ this.timestamp = params.timestamp;
152
+ this._attempt = params.attempt ?? 0;
153
+ this._confirmation = params.confirmation;
154
+ this._locationData = params.locationData;
155
+ this._attachedContext = params.attachedContext;
156
+ this.isCompleteAddedRequest = params.isCompleteAddedRequest ?? false;
157
+ this.modelId = params.modelId;
158
+ this.id = params.restoredId ?? 'request_' + generateUuid();
159
+ this._editedFileEvents = params.editedFileEvents;
160
+ }
161
+ adoptTo(session) {
162
+ this._session = session;
163
+ }
164
+ }
165
+ class AbstractResponse {
166
+ get value() {
167
+ return this._responseParts;
168
+ }
169
+ constructor(value) {
170
+ this._responseRepr = '';
171
+ this._markdownContent = '';
172
+ this._responseParts = value;
173
+ this._updateRepr();
174
+ }
175
+ toString() {
176
+ return this._responseRepr;
177
+ }
178
+ getMarkdown() {
179
+ return this._markdownContent;
180
+ }
181
+ _updateRepr() {
182
+ this._responseRepr = this.partsToRepr(this._responseParts);
183
+ this._markdownContent = ( this._responseParts.map(part => {
184
+ if (part.kind === 'inlineReference') {
185
+ return this.inlineRefToRepr(part);
186
+ }
187
+ else if (part.kind === 'markdownContent' || part.kind === 'markdownVuln') {
188
+ return part.content.value;
189
+ }
190
+ else {
191
+ return '';
192
+ }
193
+ }))
194
+ .filter(s => s.length > 0)
195
+ .join('');
196
+ }
197
+ partsToRepr(parts) {
198
+ const blocks = [];
199
+ let currentBlockSegments = [];
200
+ for (const part of parts) {
201
+ let segment;
202
+ switch (part.kind) {
203
+ case 'treeData':
204
+ case 'progressMessage':
205
+ case 'codeblockUri':
206
+ case 'toolInvocation':
207
+ case 'toolInvocationSerialized':
208
+ case 'extensions':
209
+ case 'undoStop':
210
+ continue;
211
+ case 'inlineReference':
212
+ segment = { text: this.inlineRefToRepr(part) };
213
+ break;
214
+ case 'command':
215
+ segment = { text: part.command.title, isBlock: true };
216
+ break;
217
+ case 'textEditGroup':
218
+ case 'notebookEditGroup':
219
+ segment = { text: ( localize(5050, "Made changes.")), isBlock: true };
220
+ break;
221
+ case 'confirmation':
222
+ segment = { text: `${part.title}\n${part.message}`, isBlock: true };
223
+ break;
224
+ default:
225
+ segment = { text: part.content.value };
226
+ break;
227
+ }
228
+ if (segment.isBlock) {
229
+ if (currentBlockSegments.length) {
230
+ blocks.push(currentBlockSegments.join(''));
231
+ currentBlockSegments = [];
232
+ }
233
+ blocks.push(segment.text);
234
+ }
235
+ else {
236
+ currentBlockSegments.push(segment.text);
237
+ }
238
+ }
239
+ if (currentBlockSegments.length) {
240
+ blocks.push(currentBlockSegments.join(''));
241
+ }
242
+ return blocks.join('\n\n');
243
+ }
244
+ inlineRefToRepr(part) {
245
+ if ('uri' in part.inlineReference) {
246
+ return this.uriToRepr(part.inlineReference.uri);
247
+ }
248
+ return 'name' in part.inlineReference
249
+ ? '`' + part.inlineReference.name + '`'
250
+ : this.uriToRepr(part.inlineReference);
251
+ }
252
+ uriToRepr(uri) {
253
+ if (uri.scheme === Schemas.http || uri.scheme === Schemas.https) {
254
+ return ( uri.toString(false));
255
+ }
256
+ return basename(uri);
257
+ }
258
+ }
259
+ class ResponseView extends AbstractResponse {
260
+ constructor(_response, undoStop) {
261
+ const idx = _response.value.findIndex(v => v.kind === 'undoStop' && v.id === undoStop);
262
+ super(idx === -1 ? _response.value.slice() : _response.value.slice(0, idx));
263
+ this.undoStop = undoStop;
264
+ }
265
+ }
266
+ class Response extends AbstractResponse {
267
+ get onDidChangeValue() {
268
+ return this._onDidChangeValue.event;
269
+ }
270
+ constructor(value) {
271
+ super(( asArray(value).map((v) => (isMarkdownString(v) ?
272
+ { content: v, kind: 'markdownContent' } :
273
+ 'kind' in v ? v : { kind: 'treeData', treeData: v }))));
274
+ this._onDidChangeValue = ( new Emitter());
275
+ this._citations = [];
276
+ }
277
+ dispose() {
278
+ this._onDidChangeValue.dispose();
279
+ }
280
+ clear() {
281
+ this._responseParts = [];
282
+ this._updateRepr(true);
283
+ }
284
+ updateContent(progress, quiet) {
285
+ if (progress.kind === 'markdownContent') {
286
+ const lastResponsePart = this._responseParts
287
+ .filter(p => p.kind !== 'textEditGroup')
288
+ .at(-1);
289
+ if (!lastResponsePart || lastResponsePart.kind !== 'markdownContent' || !canMergeMarkdownStrings(lastResponsePart.content, progress.content)) {
290
+ this._responseParts.push(progress);
291
+ }
292
+ else {
293
+ const idx = this._responseParts.indexOf(lastResponsePart);
294
+ this._responseParts[idx] = { ...lastResponsePart, content: appendMarkdownString(lastResponsePart.content, progress.content) };
295
+ }
296
+ this._updateRepr(quiet);
297
+ }
298
+ else if (progress.kind === 'textEdit' || progress.kind === 'notebookEdit') {
299
+ const useOldApproachForInlineNotebook = progress.uri.scheme === Schemas.vscodeNotebookCell && !this._responseParts.find(part => part.kind === 'notebookEditGroup');
300
+ const notebookUri = useOldApproachForInlineNotebook ? undefined : CellUri.parse(progress.uri)?.notebook;
301
+ const uri = notebookUri ?? progress.uri;
302
+ let found = false;
303
+ const groupKind = progress.kind === 'textEdit' && !notebookUri ? 'textEditGroup' : 'notebookEditGroup';
304
+ const edits = groupKind === 'textEditGroup' ? progress.edits : ( progress.edits.map(edit => TextEdit.isTextEdit(edit) ? { uri: progress.uri, edit } : edit));
305
+ for (let i = 0; !found && i < this._responseParts.length; i++) {
306
+ const candidate = this._responseParts[i];
307
+ if (candidate.kind === groupKind && !candidate.done && isEqual(candidate.uri, uri)) {
308
+ candidate.edits.push(edits);
309
+ candidate.done = progress.done;
310
+ found = true;
311
+ }
312
+ }
313
+ if (!found) {
314
+ this._responseParts.push({
315
+ kind: groupKind,
316
+ uri,
317
+ edits: groupKind === 'textEditGroup' ? [edits] : edits,
318
+ done: progress.done
319
+ });
320
+ }
321
+ this._updateRepr(quiet);
322
+ }
323
+ else if (progress.kind === 'progressTask') {
324
+ const responsePosition = this._responseParts.push(progress) - 1;
325
+ this._updateRepr(quiet);
326
+ const disp = progress.onDidAddProgress(() => {
327
+ this._updateRepr(false);
328
+ });
329
+ progress.task?.().then((content) => {
330
+ disp.dispose();
331
+ if (typeof content === 'string') {
332
+ this._responseParts[responsePosition].content = ( new MarkdownString(content));
333
+ }
334
+ this._updateRepr(false);
335
+ });
336
+ }
337
+ else if (progress.kind === 'toolInvocation') {
338
+ if (progress.confirmationMessages) {
339
+ progress.confirmed.p.then(() => {
340
+ this._updateRepr(false);
341
+ });
342
+ }
343
+ progress.isCompletePromise.then(() => {
344
+ this._updateRepr(false);
345
+ });
346
+ this._responseParts.push(progress);
347
+ this._updateRepr(quiet);
348
+ }
349
+ else {
350
+ this._responseParts.push(progress);
351
+ this._updateRepr(quiet);
352
+ }
353
+ }
354
+ addCitation(citation) {
355
+ this._citations.push(citation);
356
+ this._updateRepr();
357
+ }
358
+ _updateRepr(quiet) {
359
+ super._updateRepr();
360
+ if (!this._onDidChangeValue) {
361
+ return;
362
+ }
363
+ this._responseRepr += this._citations.length ? '\n\n' + getCodeCitationsMessage(this._citations) : '';
364
+ if (!quiet) {
365
+ this._onDidChangeValue.fire();
366
+ }
367
+ }
368
+ }
369
+ class ChatResponseModel extends Disposable {
370
+ get session() {
371
+ return this._session;
372
+ }
373
+ get shouldBeRemovedOnSend() {
374
+ return this._shouldBeRemovedOnSend;
375
+ }
376
+ get isComplete() {
377
+ return this._isComplete;
378
+ }
379
+ set shouldBeRemovedOnSend(disablement) {
380
+ this._shouldBeRemovedOnSend = disablement;
381
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
382
+ }
383
+ get isCanceled() {
384
+ return this._isCanceled;
385
+ }
386
+ get vote() {
387
+ return this._vote;
388
+ }
389
+ get voteDownReason() {
390
+ return this._voteDownReason;
391
+ }
392
+ get followups() {
393
+ return this._followups;
394
+ }
395
+ get entireResponse() {
396
+ return this._finalizedResponse || this._response;
397
+ }
398
+ get result() {
399
+ return this._result;
400
+ }
401
+ get username() {
402
+ return this.session.responderUsername;
403
+ }
404
+ get avatarIcon() {
405
+ return this.session.responderAvatarIcon;
406
+ }
407
+ get agent() {
408
+ return this._agent;
409
+ }
410
+ get slashCommand() {
411
+ return this._slashCommand;
412
+ }
413
+ get agentOrSlashCommandDetected() {
414
+ return this._agentOrSlashCommandDetected ?? false;
415
+ }
416
+ get usedContext() {
417
+ return this._usedContext;
418
+ }
419
+ get contentReferences() {
420
+ return Array.from(this._contentReferences);
421
+ }
422
+ get codeCitations() {
423
+ return this._codeCitations;
424
+ }
425
+ get progressMessages() {
426
+ return this._progressMessages;
427
+ }
428
+ get isStale() {
429
+ return this._isStale;
430
+ }
431
+ get isPaused() {
432
+ return this._isPaused;
433
+ }
434
+ get isPendingConfirmation() {
435
+ return ( this._response.value.some(part => part.kind === 'toolInvocation' && part.isConfirmed === undefined
436
+ || part.kind === 'confirmation' && part.isUsed === false));
437
+ }
438
+ get response() {
439
+ const undoStop = this._shouldBeRemovedOnSend?.afterUndoStop;
440
+ if (!undoStop) {
441
+ return this._finalizedResponse || this._response;
442
+ }
443
+ if (this._responseView?.undoStop !== undoStop) {
444
+ this._responseView = ( new ResponseView(this._response, undoStop));
445
+ }
446
+ return this._responseView;
447
+ }
448
+ constructor(params) {
449
+ super();
450
+ this._onDidChange = this._register(( new Emitter()));
451
+ this.onDidChange = this._onDidChange.event;
452
+ this._contentReferences = [];
453
+ this._codeCitations = [];
454
+ this._progressMessages = [];
455
+ this._isStale = false;
456
+ this._isPaused = observableValue('isPaused', false);
457
+ this._session = params.session;
458
+ this._agent = params.agent;
459
+ this._slashCommand = params.slashCommand;
460
+ this.requestId = params.requestId;
461
+ this._isComplete = params.isComplete ?? false;
462
+ this._isCanceled = params.isCanceled ?? false;
463
+ this._vote = params.vote;
464
+ this._voteDownReason = params.voteDownReason;
465
+ this._result = params.result;
466
+ this._followups = params.followups ? [...params.followups] : undefined;
467
+ this.isCompleteAddedRequest = params.isCompleteAddedRequest ?? false;
468
+ this._shouldBeRemovedOnSend = params.shouldBeRemovedOnSend;
469
+ this._isStale = Array.isArray(params.responseContent) && (params.responseContent.length !== 0 || isMarkdownString(params.responseContent) && params.responseContent.value.length !== 0);
470
+ this._response = this._register(( new Response(params.responseContent)));
471
+ this._register(this._response.onDidChangeValue(() => this._onDidChange.fire(defaultChatResponseModelChangeReason)));
472
+ this.id = params.restoredId ?? 'response_' + generateUuid();
473
+ }
474
+ updateContent(responsePart, quiet) {
475
+ this.bufferWhenPaused(() => this._response.updateContent(responsePart, quiet));
476
+ }
477
+ addUndoStop(undoStop) {
478
+ this.bufferWhenPaused(() => {
479
+ this._onDidChange.fire({ reason: 'undoStop', id: undoStop.id });
480
+ this._response.updateContent(undoStop, true);
481
+ });
482
+ }
483
+ applyReference(progress) {
484
+ if (progress.kind === 'usedContext') {
485
+ this._usedContext = progress;
486
+ }
487
+ else if (progress.kind === 'reference') {
488
+ this._contentReferences.push(progress);
489
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
490
+ }
491
+ }
492
+ applyCodeCitation(progress) {
493
+ this._codeCitations.push(progress);
494
+ this._response.addCitation(progress);
495
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
496
+ }
497
+ setAgent(agent, slashCommand) {
498
+ this._agent = agent;
499
+ this._slashCommand = slashCommand;
500
+ this._agentOrSlashCommandDetected = !agent.isDefault || !!slashCommand;
501
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
502
+ }
503
+ setResult(result) {
504
+ this._result = result;
505
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
506
+ }
507
+ complete() {
508
+ if (this._result?.errorDetails?.responseIsRedacted) {
509
+ this._response.clear();
510
+ }
511
+ this._isComplete = true;
512
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
513
+ }
514
+ cancel() {
515
+ this._isComplete = true;
516
+ this._isCanceled = true;
517
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
518
+ }
519
+ setFollowups(followups) {
520
+ this._followups = followups;
521
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
522
+ }
523
+ setVote(vote) {
524
+ this._vote = vote;
525
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
526
+ }
527
+ setVoteDownReason(reason) {
528
+ this._voteDownReason = reason;
529
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
530
+ }
531
+ setEditApplied(edit, editCount) {
532
+ if (!this.response.value.includes(edit)) {
533
+ return false;
534
+ }
535
+ if (!edit.state) {
536
+ return false;
537
+ }
538
+ edit.state.applied = editCount;
539
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
540
+ return true;
541
+ }
542
+ adoptTo(session) {
543
+ this._session = session;
544
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
545
+ }
546
+ setPaused(isPause, tx) {
547
+ this._isPaused.set(isPause, tx);
548
+ this._onDidChange.fire(defaultChatResponseModelChangeReason);
549
+ this.bufferedPauseContent?.forEach(f => f());
550
+ this.bufferedPauseContent = undefined;
551
+ }
552
+ finalizeUndoState() {
553
+ this._finalizedResponse = this.response;
554
+ this._responseView = undefined;
555
+ this._shouldBeRemovedOnSend = undefined;
556
+ }
557
+ bufferWhenPaused(apply) {
558
+ if (!this._isPaused.get()) {
559
+ apply();
560
+ }
561
+ else {
562
+ this.bufferedPauseContent ??= [];
563
+ this.bufferedPauseContent.push(apply);
564
+ }
565
+ }
566
+ }
567
+ var ChatPauseState;
568
+ (function (ChatPauseState) {
569
+ ChatPauseState[ChatPauseState["NotPausable"] = 0] = "NotPausable";
570
+ ChatPauseState[ChatPauseState["Paused"] = 1] = "Paused";
571
+ ChatPauseState[ChatPauseState["Unpaused"] = 2] = "Unpaused";
572
+ })(ChatPauseState || (ChatPauseState = {}));
573
+ function normalizeSerializableChatData(raw) {
574
+ normalizeOldFields(raw);
575
+ if (!('version' in raw)) {
576
+ return {
577
+ version: 3,
578
+ ...raw,
579
+ lastMessageDate: raw.creationDate,
580
+ customTitle: undefined,
581
+ };
582
+ }
583
+ if (raw.version === 2) {
584
+ return {
585
+ ...raw,
586
+ version: 3,
587
+ customTitle: raw.computedTitle
588
+ };
589
+ }
590
+ return raw;
591
+ }
592
+ function normalizeOldFields(raw) {
593
+ if (!raw.sessionId) {
594
+ raw.sessionId = generateUuid();
595
+ }
596
+ if (!raw.creationDate) {
597
+ raw.creationDate = getLastYearDate();
598
+ }
599
+ if ('version' in raw && (raw.version === 2 || raw.version === 3)) {
600
+ if (!raw.lastMessageDate) {
601
+ raw.lastMessageDate = getLastYearDate();
602
+ }
603
+ }
604
+ if (raw.initialLocation === 'editing-session') {
605
+ raw.initialLocation = ChatAgentLocation.Panel;
606
+ }
607
+ }
608
+ function getLastYearDate() {
609
+ const lastYearDate = ( new Date());
610
+ lastYearDate.setFullYear(lastYearDate.getFullYear() - 1);
611
+ return lastYearDate.getTime();
612
+ }
613
+ function isExportableSessionData(obj) {
614
+ const data = obj;
615
+ return typeof data === 'object' &&
616
+ typeof data.requesterUsername === 'string';
617
+ }
618
+ function isSerializableSessionData(obj) {
619
+ const data = obj;
620
+ return isExportableSessionData(obj) &&
621
+ typeof data.creationDate === 'number' &&
622
+ typeof data.sessionId === 'string' &&
623
+ obj.requests.every((request) => !request.usedContext || isIUsedContext(request.usedContext));
624
+ }
625
+ var ChatRequestRemovalReason;
626
+ (function (ChatRequestRemovalReason) {
627
+ ChatRequestRemovalReason[ChatRequestRemovalReason["Removal"] = 0] = "Removal";
628
+ ChatRequestRemovalReason[ChatRequestRemovalReason["Resend"] = 1] = "Resend";
629
+ ChatRequestRemovalReason[ChatRequestRemovalReason["Adoption"] = 2] = "Adoption";
630
+ })(ChatRequestRemovalReason || (ChatRequestRemovalReason = {}));
631
+ var ChatModelInitState;
632
+ (function (ChatModelInitState) {
633
+ ChatModelInitState[ChatModelInitState["Created"] = 0] = "Created";
634
+ ChatModelInitState[ChatModelInitState["Initializing"] = 1] = "Initializing";
635
+ ChatModelInitState[ChatModelInitState["Initialized"] = 2] = "Initialized";
636
+ })(ChatModelInitState || (ChatModelInitState = {}));
637
+ let ChatModel = ChatModel_1 = class ChatModel extends Disposable {
638
+ static getDefaultTitle(requests) {
639
+ const firstRequestMessage = requests.at(0)?.message ?? '';
640
+ const message = typeof firstRequestMessage === 'string' ?
641
+ firstRequestMessage :
642
+ firstRequestMessage.text;
643
+ return message.split('\n')[0].substring(0, 50);
644
+ }
645
+ get sampleQuestions() {
646
+ return this._sampleQuestions;
647
+ }
648
+ get sessionId() {
649
+ return this._sessionId;
650
+ }
651
+ get requestInProgress() {
652
+ const lastRequest = this.lastRequest;
653
+ if (!lastRequest?.response) {
654
+ return false;
655
+ }
656
+ if (lastRequest.response.isPendingConfirmation) {
657
+ return false;
658
+ }
659
+ return !lastRequest.response.isComplete;
660
+ }
661
+ get requestPausibility() {
662
+ const lastRequest = this.lastRequest;
663
+ if (!lastRequest?.response?.agent || lastRequest.response.isComplete || lastRequest.response.isPendingConfirmation) {
664
+ return ChatPauseState.NotPausable;
665
+ }
666
+ return lastRequest.response.isPaused.get() ? ChatPauseState.Paused : ChatPauseState.Unpaused;
667
+ }
668
+ get hasRequests() {
669
+ return this._requests.length > 0;
670
+ }
671
+ get lastRequest() {
672
+ return this._requests.at(-1);
673
+ }
674
+ get creationDate() {
675
+ return this._creationDate;
676
+ }
677
+ get lastMessageDate() {
678
+ return this._lastMessageDate;
679
+ }
680
+ get _defaultAgent() {
681
+ return this.chatAgentService.getDefaultAgent(ChatAgentLocation.Panel, ChatMode.Ask);
682
+ }
683
+ get requesterUsername() {
684
+ return this._defaultAgent?.metadata.requester?.name ??
685
+ this.initialData?.requesterUsername ?? '';
686
+ }
687
+ get responderUsername() {
688
+ return this._defaultAgent?.fullName ??
689
+ this.initialData?.responderUsername ?? '';
690
+ }
691
+ get requesterAvatarIconUri() {
692
+ return this._defaultAgent?.metadata.requester?.icon ??
693
+ this._initialRequesterAvatarIconUri;
694
+ }
695
+ get responderAvatarIcon() {
696
+ return this._defaultAgent?.metadata.themeIcon ??
697
+ this._initialResponderAvatarIconUri;
698
+ }
699
+ get initState() {
700
+ return this._initState;
701
+ }
702
+ get isImported() {
703
+ return this._isImported;
704
+ }
705
+ get customTitle() {
706
+ return this._customTitle;
707
+ }
708
+ get title() {
709
+ return this._customTitle || ChatModel_1.getDefaultTitle(this._requests);
710
+ }
711
+ get initialLocation() {
712
+ return this._initialLocation;
713
+ }
714
+ get editingSessionObs() {
715
+ return this._editingSession;
716
+ }
717
+ get editingSession() {
718
+ return this._editingSession?.promiseResult.get()?.data;
719
+ }
720
+ constructor(initialData, _initialLocation, logService, chatAgentService, chatEditingService) {
721
+ super();
722
+ this.initialData = initialData;
723
+ this._initialLocation = _initialLocation;
724
+ this.logService = logService;
725
+ this.chatAgentService = chatAgentService;
726
+ this.chatEditingService = chatEditingService;
727
+ this._onDidDispose = this._register(( new Emitter()));
728
+ this.onDidDispose = this._onDidDispose.event;
729
+ this._onDidChange = this._register(( new Emitter()));
730
+ this.onDidChange = this._onDidChange.event;
731
+ this._initState = ChatModelInitState.Created;
732
+ this._isInitializedDeferred = ( new DeferredPromise());
733
+ this._isImported = false;
734
+ this.currentEditedFileEvents = ( new ResourceMap());
735
+ this._checkpoint = undefined;
736
+ const isValid = isSerializableSessionData(initialData);
737
+ if (initialData && !isValid) {
738
+ this.logService.warn(`ChatModel#constructor: Loaded malformed session data: ${JSON.stringify(initialData)}`);
739
+ }
740
+ this._isImported = (!!initialData && !isValid) || (initialData?.isImported ?? false);
741
+ this._sessionId = (isValid && initialData.sessionId) || generateUuid();
742
+ this._requests = initialData ? this._deserialize(initialData) : [];
743
+ this._creationDate = (isValid && initialData.creationDate) || Date.now();
744
+ this._lastMessageDate = (isValid && initialData.lastMessageDate) || this._creationDate;
745
+ this._customTitle = isValid ? initialData.customTitle : undefined;
746
+ this._initialRequesterAvatarIconUri = initialData?.requesterAvatarIconUri && URI.revive(initialData.requesterAvatarIconUri);
747
+ this._initialResponderAvatarIconUri = isUriComponents(initialData?.responderAvatarIconUri) ? URI.revive(initialData.responderAvatarIconUri) : initialData?.responderAvatarIconUri;
748
+ }
749
+ startEditingSession(isGlobalEditingSession) {
750
+ const editingSessionPromise = isGlobalEditingSession ?
751
+ this.chatEditingService.startOrContinueGlobalEditingSession(this) :
752
+ this.chatEditingService.createEditingSession(this);
753
+ this._editingSession = ( new ObservablePromise(editingSessionPromise));
754
+ this._editingSession.promise.then(editingSession => {
755
+ this._store.isDisposed ? editingSession.dispose() : this._register(editingSession);
756
+ });
757
+ }
758
+ notifyEditingAction(action) {
759
+ const state = action.outcome === 'accepted' ? ChatRequestEditedFileEventKind.Keep :
760
+ action.outcome === 'rejected' ? ChatRequestEditedFileEventKind.Undo :
761
+ action.outcome === 'userModified' ? ChatRequestEditedFileEventKind.UserModification : null;
762
+ if (state === null) {
763
+ return;
764
+ }
765
+ if (!( this.currentEditedFileEvents.has(action.uri)) || this.currentEditedFileEvents.get(action.uri)?.eventKind === ChatRequestEditedFileEventKind.Keep) {
766
+ this.currentEditedFileEvents.set(action.uri, { eventKind: state, uri: action.uri });
767
+ }
768
+ }
769
+ _deserialize(obj) {
770
+ const requests = obj.requests;
771
+ if (!Array.isArray(requests)) {
772
+ this.logService.error(`Ignoring malformed session data: ${JSON.stringify(obj)}`);
773
+ return [];
774
+ }
775
+ try {
776
+ return ( requests.map((raw) => {
777
+ const parsedRequest = typeof raw.message === 'string'
778
+ ? this.getParsedRequestFromString(raw.message)
779
+ : reviveParsedChatRequest(raw.message);
780
+ const variableData = this.reviveVariableData(raw.variableData);
781
+ const request = ( new ChatRequestModel({
782
+ session: this,
783
+ message: parsedRequest,
784
+ variableData,
785
+ timestamp: raw.timestamp ?? -1,
786
+ restoredId: raw.requestId,
787
+ confirmation: raw.confirmation,
788
+ editedFileEvents: raw.editedFileEvents,
789
+ }));
790
+ request.shouldBeRemovedOnSend = raw.isHidden ? { requestId: raw.requestId } : raw.shouldBeRemovedOnSend;
791
+ if (raw.response || raw.result || raw.responseErrorDetails) {
792
+ const agent = (raw.agent && 'metadata' in raw.agent) ?
793
+ reviveSerializedAgent(raw.agent) : undefined;
794
+ const result = 'responseErrorDetails' in raw ?
795
+ { errorDetails: raw.responseErrorDetails } : raw.result;
796
+ request.response = ( new ChatResponseModel({
797
+ responseContent: raw.response ?? [( new MarkdownString(raw.response))],
798
+ session: this,
799
+ agent,
800
+ slashCommand: raw.slashCommand,
801
+ requestId: request.id,
802
+ isComplete: true,
803
+ isCanceled: raw.isCanceled,
804
+ vote: raw.vote,
805
+ voteDownReason: raw.voteDownReason,
806
+ result,
807
+ followups: raw.followups,
808
+ restoredId: raw.responseId
809
+ }));
810
+ request.response.shouldBeRemovedOnSend = raw.isHidden ? { requestId: raw.requestId } : raw.shouldBeRemovedOnSend;
811
+ if (raw.usedContext) {
812
+ request.response.applyReference(revive(raw.usedContext));
813
+ }
814
+ raw.contentReferences?.forEach(r => request.response.applyReference(revive(r)));
815
+ raw.codeCitations?.forEach(c => request.response.applyCodeCitation(revive(c)));
816
+ }
817
+ return request;
818
+ }));
819
+ }
820
+ catch (error) {
821
+ this.logService.error('Failed to parse chat data', error);
822
+ return [];
823
+ }
824
+ }
825
+ reviveVariableData(raw) {
826
+ const variableData = raw && Array.isArray(raw.variables)
827
+ ? raw :
828
+ { variables: [] };
829
+ variableData.variables = ( variableData.variables.map((v) => {
830
+ if (v && 'values' in v && Array.isArray(v.values)) {
831
+ return {
832
+ kind: 'generic',
833
+ id: v.id ?? '',
834
+ name: v.name,
835
+ value: v.values[0]?.value,
836
+ range: v.range,
837
+ modelDescription: v.modelDescription,
838
+ references: v.references
839
+ };
840
+ }
841
+ else {
842
+ return v;
843
+ }
844
+ }));
845
+ return variableData;
846
+ }
847
+ getParsedRequestFromString(message) {
848
+ const parts = [( new ChatRequestTextPart(( new OffsetRange(0, message.length)), { startColumn: 1, startLineNumber: 1, endColumn: 1, endLineNumber: 1 }, message))];
849
+ return {
850
+ text: message,
851
+ parts
852
+ };
853
+ }
854
+ toggleLastRequestPaused(isPaused) {
855
+ if (this.requestPausibility !== ChatPauseState.NotPausable && this.lastRequest?.response?.agent) {
856
+ const pausedValue = isPaused ?? !this.lastRequest.response.isPaused.get();
857
+ this.lastRequest.response.setPaused(pausedValue);
858
+ this.chatAgentService.setRequestPaused(this.lastRequest.response.agent.id, this.lastRequest.id, pausedValue);
859
+ this._onDidChange.fire({ kind: 'changedRequest', request: this.lastRequest });
860
+ }
861
+ }
862
+ startInitialize() {
863
+ if (this.initState !== ChatModelInitState.Created) {
864
+ throw ( new Error(
865
+ `ChatModel is in the wrong state for startInitialize: ${ChatModelInitState[this.initState]}`
866
+ ));
867
+ }
868
+ this._initState = ChatModelInitState.Initializing;
869
+ }
870
+ deinitialize() {
871
+ this._initState = ChatModelInitState.Created;
872
+ this._isInitializedDeferred = ( new DeferredPromise());
873
+ }
874
+ initialize(sampleQuestions) {
875
+ if (this.initState !== ChatModelInitState.Initializing) {
876
+ throw ( new Error(
877
+ `ChatModel is in the wrong state for initialize: ${ChatModelInitState[this.initState]}`
878
+ ));
879
+ }
880
+ this._initState = ChatModelInitState.Initialized;
881
+ this._sampleQuestions = sampleQuestions;
882
+ this._isInitializedDeferred.complete();
883
+ this._onDidChange.fire({ kind: 'initialize' });
884
+ }
885
+ setInitializationError(error) {
886
+ if (this.initState !== ChatModelInitState.Initializing) {
887
+ throw ( new Error(
888
+ `ChatModel is in the wrong state for setInitializationError: ${ChatModelInitState[this.initState]}`
889
+ ));
890
+ }
891
+ if (!this._isInitializedDeferred.isSettled) {
892
+ this._isInitializedDeferred.error(error);
893
+ }
894
+ }
895
+ waitForInitialization() {
896
+ return this._isInitializedDeferred.p;
897
+ }
898
+ getRequests() {
899
+ return this._requests;
900
+ }
901
+ get checkpoint() {
902
+ return this._checkpoint;
903
+ }
904
+ setDisabledRequests(requestIds) {
905
+ this._requests.forEach((request) => {
906
+ const shouldBeRemovedOnSend = requestIds.find(r => r.requestId === request.id);
907
+ request.shouldBeRemovedOnSend = shouldBeRemovedOnSend;
908
+ if (request.response) {
909
+ request.response.shouldBeRemovedOnSend = shouldBeRemovedOnSend;
910
+ }
911
+ });
912
+ this._onDidChange.fire({
913
+ kind: 'setHidden',
914
+ hiddenRequestIds: requestIds,
915
+ });
916
+ }
917
+ addRequest(message, variableData, attempt, chatAgent, slashCommand, confirmation, locationData, attachments, isCompleteAddedRequest, modelId) {
918
+ const editedFileEvents = [...( this.currentEditedFileEvents.values())];
919
+ this.currentEditedFileEvents.clear();
920
+ const request = ( new ChatRequestModel({
921
+ session: this,
922
+ message,
923
+ variableData,
924
+ timestamp: Date.now(),
925
+ attempt,
926
+ confirmation,
927
+ locationData,
928
+ attachedContext: attachments,
929
+ isCompleteAddedRequest,
930
+ modelId,
931
+ editedFileEvents: editedFileEvents.length ? editedFileEvents : undefined,
932
+ }));
933
+ request.response = ( new ChatResponseModel({
934
+ responseContent: [],
935
+ session: this,
936
+ agent: chatAgent,
937
+ slashCommand,
938
+ requestId: request.id,
939
+ isCompleteAddedRequest
940
+ }));
941
+ this._requests.push(request);
942
+ this._lastMessageDate = Date.now();
943
+ this._onDidChange.fire({ kind: 'addRequest', request });
944
+ return request;
945
+ }
946
+ setCustomTitle(title) {
947
+ this._customTitle = title;
948
+ }
949
+ updateRequest(request, variableData) {
950
+ request.variableData = variableData;
951
+ this._onDidChange.fire({ kind: 'changedRequest', request });
952
+ }
953
+ adoptRequest(request) {
954
+ const oldOwner = request.session;
955
+ const index = oldOwner._requests.findIndex((candidate) => candidate.id === request.id);
956
+ if (index === -1) {
957
+ return;
958
+ }
959
+ oldOwner._requests.splice(index, 1);
960
+ request.adoptTo(this);
961
+ request.response?.adoptTo(this);
962
+ this._requests.push(request);
963
+ oldOwner._onDidChange.fire({ kind: 'removeRequest', requestId: request.id, responseId: request.response?.id, reason: ChatRequestRemovalReason.Adoption });
964
+ this._onDidChange.fire({ kind: 'addRequest', request });
965
+ }
966
+ acceptResponseProgress(request, progress, quiet) {
967
+ if (!request.response) {
968
+ request.response = ( new ChatResponseModel({
969
+ responseContent: [],
970
+ session: this,
971
+ requestId: request.id
972
+ }));
973
+ }
974
+ if (request.response.isComplete) {
975
+ throw ( new Error('acceptResponseProgress: Adding progress to a completed response'));
976
+ }
977
+ if (progress.kind === 'markdownContent' ||
978
+ progress.kind === 'treeData' ||
979
+ progress.kind === 'inlineReference' ||
980
+ progress.kind === 'codeblockUri' ||
981
+ progress.kind === 'markdownVuln' ||
982
+ progress.kind === 'progressMessage' ||
983
+ progress.kind === 'command' ||
984
+ progress.kind === 'textEdit' ||
985
+ progress.kind === 'notebookEdit' ||
986
+ progress.kind === 'warning' ||
987
+ progress.kind === 'progressTask' ||
988
+ progress.kind === 'confirmation' ||
989
+ progress.kind === 'extensions' ||
990
+ progress.kind === 'toolInvocation') {
991
+ request.response.updateContent(progress, quiet);
992
+ }
993
+ else if (progress.kind === 'usedContext' || progress.kind === 'reference') {
994
+ request.response.applyReference(progress);
995
+ }
996
+ else if (progress.kind === 'codeCitation') {
997
+ request.response.applyCodeCitation(progress);
998
+ }
999
+ else if (progress.kind === 'move') {
1000
+ this._onDidChange.fire({ kind: 'move', target: progress.uri, range: progress.range });
1001
+ }
1002
+ else if (progress.kind === 'undoStop') {
1003
+ request.response.addUndoStop(progress);
1004
+ }
1005
+ else {
1006
+ this.logService.error(`Couldn't handle progress: ${JSON.stringify(progress)}`);
1007
+ }
1008
+ }
1009
+ removeRequest(id, reason = ChatRequestRemovalReason.Removal) {
1010
+ const index = this._requests.findIndex(request => request.id === id);
1011
+ const request = this._requests[index];
1012
+ if (index !== -1) {
1013
+ this._onDidChange.fire({ kind: 'removeRequest', requestId: request.id, responseId: request.response?.id, reason });
1014
+ this._requests.splice(index, 1);
1015
+ request.response?.dispose();
1016
+ }
1017
+ }
1018
+ cancelRequest(request) {
1019
+ if (request.response) {
1020
+ request.response.cancel();
1021
+ }
1022
+ }
1023
+ setResponse(request, result) {
1024
+ if (!request.response) {
1025
+ request.response = ( new ChatResponseModel({
1026
+ responseContent: [],
1027
+ session: this,
1028
+ requestId: request.id
1029
+ }));
1030
+ }
1031
+ request.response.setResult(result);
1032
+ }
1033
+ completeResponse(request) {
1034
+ if (!request.response) {
1035
+ throw ( new Error('Call setResponse before completeResponse'));
1036
+ }
1037
+ request.response.complete();
1038
+ this._onDidChange.fire({ kind: 'completedRequest', request });
1039
+ }
1040
+ setFollowups(request, followups) {
1041
+ if (!request.response) {
1042
+ return;
1043
+ }
1044
+ request.response.setFollowups(followups);
1045
+ }
1046
+ setResponseModel(request, response) {
1047
+ request.response = response;
1048
+ this._onDidChange.fire({ kind: 'addResponse', response });
1049
+ }
1050
+ toExport() {
1051
+ return {
1052
+ requesterUsername: this.requesterUsername,
1053
+ requesterAvatarIconUri: this.requesterAvatarIconUri,
1054
+ responderUsername: this.responderUsername,
1055
+ responderAvatarIconUri: this.responderAvatarIcon,
1056
+ initialLocation: this.initialLocation,
1057
+ requests: ( this._requests.map((r) => {
1058
+ const message = {
1059
+ ...r.message,
1060
+ parts: ( r.message.parts.map((p) => p && 'toJSON' in p ? p.toJSON() : p))
1061
+ };
1062
+ const agent = r.response?.agent;
1063
+ const agentJson = agent && 'toJSON' in agent ? agent.toJSON() :
1064
+ agent ? { ...agent } : undefined;
1065
+ return {
1066
+ requestId: r.id,
1067
+ message,
1068
+ variableData: r.variableData,
1069
+ response: r.response ?
1070
+ ( r.response.entireResponse.value.map(item => {
1071
+ if (item.kind === 'treeData') {
1072
+ return item.treeData;
1073
+ }
1074
+ else if (item.kind === 'markdownContent') {
1075
+ return item.content;
1076
+ }
1077
+ else {
1078
+ return item;
1079
+ }
1080
+ }))
1081
+ : undefined,
1082
+ responseId: r.response?.id,
1083
+ shouldBeRemovedOnSend: r.shouldBeRemovedOnSend,
1084
+ result: r.response?.result,
1085
+ followups: r.response?.followups,
1086
+ isCanceled: r.response?.isCanceled,
1087
+ vote: r.response?.vote,
1088
+ voteDownReason: r.response?.voteDownReason,
1089
+ agent: agentJson,
1090
+ slashCommand: r.response?.slashCommand,
1091
+ usedContext: r.response?.usedContext,
1092
+ contentReferences: r.response?.contentReferences,
1093
+ codeCitations: r.response?.codeCitations,
1094
+ timestamp: r.timestamp,
1095
+ confirmation: r.confirmation,
1096
+ editedFileEvents: r.editedFileEvents,
1097
+ };
1098
+ })),
1099
+ };
1100
+ }
1101
+ toJSON() {
1102
+ return {
1103
+ version: 3,
1104
+ ...this.toExport(),
1105
+ sessionId: this.sessionId,
1106
+ creationDate: this._creationDate,
1107
+ isImported: this._isImported,
1108
+ lastMessageDate: this._lastMessageDate,
1109
+ customTitle: this._customTitle
1110
+ };
1111
+ }
1112
+ dispose() {
1113
+ this._requests.forEach(r => r.response?.dispose());
1114
+ this._onDidDispose.fire();
1115
+ super.dispose();
1116
+ }
1117
+ };
1118
+ ChatModel = ChatModel_1 = ( __decorate([
1119
+ ( __param(2, ILogService)),
1120
+ ( __param(3, IChatAgentService)),
1121
+ ( __param(4, IChatEditingService))
1122
+ ], ChatModel));
1123
+ function updateRanges(variableData, diff) {
1124
+ return {
1125
+ variables: ( variableData.variables.map(v => ({
1126
+ ...v,
1127
+ range: v.range && {
1128
+ start: v.range.start - diff,
1129
+ endExclusive: v.range.endExclusive - diff
1130
+ }
1131
+ })))
1132
+ };
1133
+ }
1134
+ function canMergeMarkdownStrings(md1, md2) {
1135
+ if (md1.baseUri && md2.baseUri) {
1136
+ const baseUriEquals = md1.baseUri.scheme === md2.baseUri.scheme
1137
+ && md1.baseUri.authority === md2.baseUri.authority
1138
+ && md1.baseUri.path === md2.baseUri.path
1139
+ && md1.baseUri.query === md2.baseUri.query
1140
+ && md1.baseUri.fragment === md2.baseUri.fragment;
1141
+ if (!baseUriEquals) {
1142
+ return false;
1143
+ }
1144
+ }
1145
+ else if (md1.baseUri || md2.baseUri) {
1146
+ return false;
1147
+ }
1148
+ return equals(md1.isTrusted, md2.isTrusted) &&
1149
+ md1.supportHtml === md2.supportHtml &&
1150
+ md1.supportThemeIcons === md2.supportThemeIcons;
1151
+ }
1152
+ function appendMarkdownString(md1, md2) {
1153
+ const appendedValue = typeof md2 === 'string' ? md2 : md2.value;
1154
+ return {
1155
+ value: md1.value + appendedValue,
1156
+ isTrusted: md1.isTrusted,
1157
+ supportThemeIcons: md1.supportThemeIcons,
1158
+ supportHtml: md1.supportHtml,
1159
+ baseUri: md1.baseUri
1160
+ };
1161
+ }
1162
+ function getCodeCitationsMessage(citations) {
1163
+ if (citations.length === 0) {
1164
+ return '';
1165
+ }
1166
+ const licenseTypes = citations.reduce((set, c) => set.add(c.license), ( new Set()));
1167
+ const label = licenseTypes.size === 1 ?
1168
+ ( localize(5051, "Similar code found with 1 license type", licenseTypes.size)) :
1169
+ ( localize(5052, "Similar code found with {0} license types", licenseTypes.size));
1170
+ return label;
1171
+ }
1172
+ var ChatRequestEditedFileEventKind;
1173
+ (function (ChatRequestEditedFileEventKind) {
1174
+ ChatRequestEditedFileEventKind[ChatRequestEditedFileEventKind["Keep"] = 1] = "Keep";
1175
+ ChatRequestEditedFileEventKind[ChatRequestEditedFileEventKind["Undo"] = 2] = "Undo";
1176
+ ChatRequestEditedFileEventKind[ChatRequestEditedFileEventKind["UserModification"] = 3] = "UserModification";
1177
+ })(ChatRequestEditedFileEventKind || (ChatRequestEditedFileEventKind = {}));
1178
+
1179
+ export { ChatModel, ChatModelInitState, ChatPauseState, ChatRequestEditedFileEventKind, ChatRequestModel, ChatRequestRemovalReason, ChatResponseModel, IDiagnosticVariableEntryFilterData, OmittedState, Response, appendMarkdownString, canMergeMarkdownStrings, getCodeCitationsMessage, isCellTextEditOperation, isChatRequestFileEntry, isElementVariableEntry, isExportableSessionData, isImageVariableEntry, isNotebookOutputVariableEntry, isPasteVariableEntry, isSerializableSessionData, normalizeSerializableChatData, toChatHistoryContent, updateRanges };