@codingame/monaco-vscode-api 18.4.0 → 19.0.0

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