@codingame/monaco-vscode-katex-common 24.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/empty.js +1 -0
  2. package/package.json +45 -0
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +37 -0
  4. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +127 -0
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +27 -0
  6. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +81 -0
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +44 -0
  8. package/vscode/src/vs/platform/actions/browser/buttonbar.js +172 -0
  9. package/vscode/src/vs/platform/editor/browser/editor.d.ts +12 -0
  10. package/vscode/src/vs/platform/editor/browser/editor.js +51 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +41 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +295 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.d.ts +2 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +60 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +65 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +650 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +2 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +364 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +38 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +207 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.d.ts +17 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +216 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.d.ts +24 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +114 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.d.ts +34 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.js +141 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.d.ts +169 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.js +951 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.d.ts +19 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.js +109 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.d.ts +12 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.js +47 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.d.ts +13 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.js +49 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.d.ts +27 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +160 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.d.ts +40 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.js +286 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.d.ts +13 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +49 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.d.ts +34 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.js +101 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.d.ts +14 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +30 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.d.ts +11 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +37 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.d.ts +17 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +69 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.d.ts +116 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +417 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.d.ts +20 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.js +66 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.d.ts +25 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.js +123 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.d.ts +18 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.js +60 -0
  57. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.d.ts +16 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.js +46 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.d.ts +19 -0
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.js +57 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.d.ts +94 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +567 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.d.ts +34 -0
  64. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.js +224 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.d.ts +34 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.js +259 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.d.ts +38 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +160 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.d.ts +16 -0
  70. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.js +55 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.d.ts +17 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.js +117 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.d.ts +66 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +528 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.d.ts +31 -0
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.js +160 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.d.ts +17 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +49 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.d.ts +18 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +91 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.d.ts +13 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.js +6 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.d.ts +54 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.js +429 -0
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.d.ts +40 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.js +347 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.d.ts +56 -0
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.js +164 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.d.ts +32 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.js +224 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.d.ts +35 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +173 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css +341 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatExtensionsContent.css +27 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMarkdownPart.css +23 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMcpServersInteractionContent.css +14 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatPullRequestContent.css +75 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css +221 -0
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatThinkingContent.css +162 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +41 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +94 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +15 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +96 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +18 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +147 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +14 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.js +23 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +68 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +353 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +100 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +1085 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +39 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +275 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +32 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +119 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +19 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +36 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +21 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.js +130 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +25 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +225 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +24 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.js +101 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.d.ts +42 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.js +127 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.d.ts +43 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +388 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +49 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +721 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.d.ts +13 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +52 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.d.ts +39 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +409 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.d.ts +334 -0
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +2008 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.d.ts +52 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.js +93 -0
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.d.ts +217 -0
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1573 -0
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.d.ts +43 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +249 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.d.ts +50 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +84 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.d.ts +32 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.js +174 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +31 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +101 -0
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +19 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +76 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionAction.css +39 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.d.ts +292 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +2014 -0
  153. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css +171 -0
  154. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.d.ts +173 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +797 -0
  156. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.d.ts +54 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.js +345 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.d.ts +10 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1069 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +34 -0
  161. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +139 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css +2880 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +87 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatCodeBlockPill.css +139 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css +61 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css +209 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.d.ts +28 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.js +135 -0
  169. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.d.ts +28 -0
  170. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.js +147 -0
  171. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +71 -0
  172. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +279 -0
  173. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.d.ts +28 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +28 -0
  175. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.d.ts +13 -0
  176. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +38 -0
  177. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +55 -0
  178. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +176 -0
  179. package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.d.ts +45 -0
  180. package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +207 -0
  181. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +48 -0
  182. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +373 -0
  183. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +171 -0
  184. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +1442 -0
  185. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +199 -0
  186. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +482 -0
  187. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +28 -0
  188. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +37 -0
  189. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +95 -0
  190. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +497 -0
  191. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +76 -0
  192. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +464 -0
  193. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +124 -0
  194. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +562 -0
  195. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +42 -0
  196. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +279 -0
  197. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +411 -0
  198. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +13 -0
  199. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +66 -0
  200. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +61 -0
  201. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +154 -0
  202. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.d.ts +19 -0
  203. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +201 -0
  204. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
  205. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +372 -0
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +594 -0
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1746 -0
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +269 -0
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +806 -0
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +116 -0
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +62 -0
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +295 -0
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +241 -0
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +146 -0
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +90 -0
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +41 -0
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +42 -0
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +77 -0
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +823 -0
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +29 -0
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +567 -0
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +189 -0
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +439 -0
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +263 -0
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +48 -0
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
  255. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
  256. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +89 -0
  257. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
  258. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
  259. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
  260. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +108 -0
  261. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +34 -0
  262. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +145 -0
@@ -0,0 +1,28 @@
1
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
+ import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
3
+ import { Position } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position";
4
+ import { Selection } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/selection";
5
+ import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
6
+ import { IChatEditingSession } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
7
+ import { IChatModel, IChatModelInputState, IChatRequestModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel";
8
+ import { Session } from "./inlineChatSession.js";
9
+ export interface ISessionKeyComputer {
10
+ getComparisonKey(editor: ICodeEditor, uri: URI): string;
11
+ }
12
+ export interface IInlineChatSessionEvent {
13
+ readonly editor: ICodeEditor;
14
+ readonly session: Session;
15
+ }
16
+ export interface IInlineChatSessionEndEvent extends IInlineChatSessionEvent {
17
+ readonly endedByExternalCause: boolean;
18
+ }
19
+ export interface IInlineChatSession2 {
20
+ readonly initialPosition: Position;
21
+ readonly initialSelection: Selection;
22
+ readonly uri: URI;
23
+ readonly chatModel: IChatModel;
24
+ readonly editingSession: IChatEditingSession;
25
+ dispose(): void;
26
+ }
27
+ export declare function moveToPanelChat(accessor: ServicesAccessor, model: IChatModel | undefined, resend: boolean): Promise<void>;
28
+ export declare function askInPanelChat(accessor: ServicesAccessor, request: IChatRequestModel, state: IChatModelInputState | undefined): Promise<void>;
@@ -0,0 +1,37 @@
1
+
2
+ import { ChatViewPaneTarget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
3
+ import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
4
+ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
5
+ import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
6
+
7
+ async function moveToPanelChat(accessor, model, resend) {
8
+ const chatService = accessor.get(IChatService);
9
+ const widgetService = accessor.get(IChatWidgetService);
10
+ const widget = await widgetService.revealWidget();
11
+ if (widget && widget.viewModel && model) {
12
+ let lastRequest;
13
+ for (const request of model.getRequests().slice()) {
14
+ await chatService.adoptRequest(widget.viewModel.model.sessionResource, request);
15
+ lastRequest = request;
16
+ }
17
+ if (lastRequest && resend) {
18
+ chatService.resendRequest(lastRequest, { location: widget.location });
19
+ }
20
+ widget.focusResponseItem();
21
+ }
22
+ }
23
+ async function askInPanelChat(accessor, request, state) {
24
+ const widgetService = accessor.get(IChatWidgetService);
25
+ const chatService = accessor.get(IChatService);
26
+ if (!request) {
27
+ return;
28
+ }
29
+ const newModelRef = chatService.startSession(ChatAgentLocation.Chat);
30
+ const newModel = newModelRef.object;
31
+ newModel.inputModel.setState({ ...state });
32
+ const widget = await widgetService.openSession(newModelRef.object.sessionResource, ChatViewPaneTarget);
33
+ newModelRef.dispose();
34
+ widget?.acceptInput(request.message.text);
35
+ }
36
+
37
+ export { askInPanelChat, moveToPanelChat };
@@ -0,0 +1,95 @@
1
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
2
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
+ import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
5
+ import { IActiveCodeEditor, ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
6
+ import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service";
7
+ import { Range } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
8
+ import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
9
+ import { IValidEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
10
+ import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
11
+ import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
12
+ import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
13
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
14
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
15
+ import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
16
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
17
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
18
+ import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
19
+ import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
20
+ import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
21
+ import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
22
+ import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
23
+ import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
24
+ import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
25
+ import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service";
26
+ import { Session, StashedSession } from "./inlineChatSession.js";
27
+ import { IInlineChatSession2, IInlineChatSessionEndEvent, IInlineChatSessionEvent, ISessionKeyComputer } from "./inlineChatSessionService.js";
28
+ import { IInlineChatSessionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service";
29
+ export declare class InlineChatError extends Error {
30
+ static readonly code = "InlineChatError";
31
+ constructor(message: string);
32
+ }
33
+ export declare class InlineChatSessionServiceImpl implements IInlineChatSessionService {
34
+ private readonly _telemetryService;
35
+ private readonly _modelService;
36
+ private readonly _textModelService;
37
+ private readonly _editorWorkerService;
38
+ private readonly _logService;
39
+ private readonly _instaService;
40
+ private readonly _editorService;
41
+ private readonly _textFileService;
42
+ private readonly _languageService;
43
+ private readonly _chatService;
44
+ private readonly _chatAgentService;
45
+ private readonly _chatWidgetService;
46
+ _serviceBrand: undefined;
47
+ private readonly _store;
48
+ private readonly _onWillStartSession;
49
+ readonly onWillStartSession: Event<IActiveCodeEditor>;
50
+ private readonly _onDidMoveSession;
51
+ readonly onDidMoveSession: Event<IInlineChatSessionEvent>;
52
+ private readonly _onDidEndSession;
53
+ readonly onDidEndSession: Event<IInlineChatSessionEndEvent>;
54
+ private readonly _onDidStashSession;
55
+ readonly onDidStashSession: Event<IInlineChatSessionEvent>;
56
+ private readonly _sessions;
57
+ private readonly _keyComputers;
58
+ constructor(_telemetryService: ITelemetryService, _modelService: IModelService, _textModelService: ITextModelService, _editorWorkerService: IEditorWorkerService, _logService: ILogService, _instaService: IInstantiationService, _editorService: IEditorService, _textFileService: ITextFileService, _languageService: ILanguageService, _chatService: IChatService, _chatAgentService: IChatAgentService, _chatWidgetService: IChatWidgetService);
59
+ dispose(): void;
60
+ createSession(editor: IActiveCodeEditor, options: {
61
+ headless?: boolean;
62
+ wholeRange?: Range;
63
+ session?: Session;
64
+ }, token: CancellationToken): Promise<Session | undefined>;
65
+ moveSession(session: Session, target: ICodeEditor): void;
66
+ releaseSession(session: Session): void;
67
+ private _releaseSession;
68
+ stashSession(session: Session, editor: ICodeEditor, undoCancelEdits: IValidEditOperation[]): StashedSession;
69
+ getCodeEditor(session: Session): ICodeEditor;
70
+ getSession(editor: ICodeEditor, uri: URI): Session | undefined;
71
+ private _key;
72
+ registerSessionKeyComputer(scheme: string, value: ISessionKeyComputer): IDisposable;
73
+ private readonly _sessions2;
74
+ private readonly _onDidChangeSessions;
75
+ readonly onDidChangeSessions: Event<this>;
76
+ createSession2(editor: ICodeEditor, uri: URI, token: CancellationToken): Promise<IInlineChatSession2>;
77
+ getSession2(uri: URI): IInlineChatSession2 | undefined;
78
+ getSessionBySessionUri(sessionResource: URI): IInlineChatSession2 | undefined;
79
+ }
80
+ export declare class InlineChatEnabler {
81
+ static Id: string;
82
+ private readonly _ctxHasProvider2;
83
+ private readonly _ctxHasNotebookInline;
84
+ private readonly _ctxHasNotebookProvider;
85
+ private readonly _ctxPossible;
86
+ private readonly _store;
87
+ constructor(contextKeyService: IContextKeyService, chatAgentService: IChatAgentService, editorService: IEditorService, configService: IConfigurationService);
88
+ dispose(): void;
89
+ }
90
+ export declare class InlineChatEscapeToolContribution extends Disposable {
91
+ static readonly Id = "inlineChat.escapeTool";
92
+ static readonly DONT_ASK_AGAIN_KEY = "inlineChat.dontAskMoveToPanelChat";
93
+ private static readonly _data;
94
+ constructor(lmTools: ILanguageModelToolsService, inlineChatSessionService: IInlineChatSessionService, dialogService: IDialogService, codeEditorService: ICodeEditorService, chatService: IChatService, logService: ILogService, storageService: IStorageService, instaService: IInstantiationService);
95
+ }
@@ -0,0 +1,497 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
+ import { DisposableStore, MutableDisposable, toDisposable, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
6
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
7
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
9
+ import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
10
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
11
+ import { isCodeEditor, isDiffEditor, isCompositeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
12
+ import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
13
+ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
14
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
15
+ import { createTextBufferFactoryFromSnapshot } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
16
+ import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
17
+ import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
18
+ import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
19
+ import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
20
+ import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
21
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
22
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
23
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
24
+ import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
25
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
26
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
27
+ import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
28
+ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
29
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
30
+ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
31
+ import { DEFAULT_EDITOR_ASSOCIATION } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
32
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
33
+ import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
34
+ import { UntitledTextEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/untitled/common/untitledTextEditorInput';
35
+ import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
36
+ import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
37
+ import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
38
+ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
39
+ import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
40
+ import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
41
+ import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
42
+ import { CTX_INLINE_CHAT_HAS_AGENT2, CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE, CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT, CTX_INLINE_CHAT_POSSIBLE, InlineChatConfigKeys } from '../common/inlineChat.js';
43
+ import { Session, SessionWholeRange, HunkData, StashedSession } from './inlineChatSession.js';
44
+ import { askInPanelChat } from './inlineChatSessionService.js';
45
+ import { IInlineChatSessionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service';
46
+ import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
47
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
48
+
49
+ var InlineChatEscapeToolContribution_1;
50
+ class InlineChatError extends Error {
51
+ static { this.code = 'InlineChatError'; }
52
+ constructor(message) {
53
+ super(message);
54
+ this.name = InlineChatError.code;
55
+ }
56
+ }
57
+ let InlineChatSessionServiceImpl = class InlineChatSessionServiceImpl {
58
+ constructor(_telemetryService, _modelService, _textModelService, _editorWorkerService, _logService, _instaService, _editorService, _textFileService, _languageService, _chatService, _chatAgentService, _chatWidgetService) {
59
+ this._telemetryService = _telemetryService;
60
+ this._modelService = _modelService;
61
+ this._textModelService = _textModelService;
62
+ this._editorWorkerService = _editorWorkerService;
63
+ this._logService = _logService;
64
+ this._instaService = _instaService;
65
+ this._editorService = _editorService;
66
+ this._textFileService = _textFileService;
67
+ this._languageService = _languageService;
68
+ this._chatService = _chatService;
69
+ this._chatAgentService = _chatAgentService;
70
+ this._chatWidgetService = _chatWidgetService;
71
+ this._store = ( new DisposableStore());
72
+ this._onWillStartSession = this._store.add(( new Emitter()));
73
+ this.onWillStartSession = this._onWillStartSession.event;
74
+ this._onDidMoveSession = this._store.add(( new Emitter()));
75
+ this.onDidMoveSession = this._onDidMoveSession.event;
76
+ this._onDidEndSession = this._store.add(( new Emitter()));
77
+ this.onDidEndSession = this._onDidEndSession.event;
78
+ this._onDidStashSession = this._store.add(( new Emitter()));
79
+ this.onDidStashSession = this._onDidStashSession.event;
80
+ this._sessions = ( new Map());
81
+ this._keyComputers = ( new Map());
82
+ this._sessions2 = ( new ResourceMap());
83
+ this._onDidChangeSessions = this._store.add(( new Emitter()));
84
+ this.onDidChangeSessions = this._onDidChangeSessions.event;
85
+ }
86
+ dispose() {
87
+ this._store.dispose();
88
+ this._sessions.forEach(x => x.store.dispose());
89
+ this._sessions.clear();
90
+ }
91
+ async createSession(editor, options, token) {
92
+ const agent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.EditorInline);
93
+ if (!agent) {
94
+ this._logService.trace('[IE] NO agent found');
95
+ return undefined;
96
+ }
97
+ this._onWillStartSession.fire(editor);
98
+ const textModel = editor.getModel();
99
+ const selection = editor.getSelection();
100
+ const store = ( new DisposableStore());
101
+ this._logService.trace(`[IE] creating NEW session for ${editor.getId()}, ${agent.extensionId}`);
102
+ const chatModelRef = options.session ? undefined : this._chatService.startSession(ChatAgentLocation.EditorInline);
103
+ const chatModel = options.session?.chatModel ?? chatModelRef?.object;
104
+ if (!chatModel) {
105
+ this._logService.trace('[IE] NO chatModel found');
106
+ chatModelRef?.dispose();
107
+ return undefined;
108
+ }
109
+ if (chatModelRef) {
110
+ store.add(chatModelRef);
111
+ }
112
+ const lastResponseListener = store.add(( new MutableDisposable()));
113
+ store.add(chatModel.onDidChange(e => {
114
+ if (e.kind !== 'addRequest' || !e.request.response) {
115
+ return;
116
+ }
117
+ const { response } = e.request;
118
+ session.markModelVersion(e.request);
119
+ lastResponseListener.value = response.onDidChange(() => {
120
+ if (!response.isComplete) {
121
+ return;
122
+ }
123
+ lastResponseListener.clear();
124
+ for (const part of response.response.value) {
125
+ if (part.kind !== 'textEditGroup' || part.uri.scheme !== Schemas.untitled || isEqual(part.uri, session.textModelN.uri)) {
126
+ continue;
127
+ }
128
+ const langSelection = this._languageService.createByFilepathOrFirstLine(part.uri, undefined);
129
+ const untitledTextModel = this._textFileService.untitled.create({
130
+ associatedResource: part.uri,
131
+ languageId: langSelection.languageId
132
+ });
133
+ untitledTextModel.resolve();
134
+ this._textModelService.createModelReference(part.uri).then(ref => {
135
+ store.add(ref);
136
+ });
137
+ }
138
+ });
139
+ }));
140
+ store.add(this._chatAgentService.onDidChangeAgents(e => {
141
+ if (e === undefined && (!this._chatAgentService.getAgent(agent.id) || !( this._chatAgentService.getActivatedAgents().map(agent => agent.id)).includes(agent.id))) {
142
+ this._logService.trace(`[IE] provider GONE for ${editor.getId()}, ${agent.extensionId}`);
143
+ this._releaseSession(session, true);
144
+ }
145
+ }));
146
+ const id = generateUuid();
147
+ const targetUri = textModel.uri;
148
+ store.add((await this._textModelService.createModelReference(textModel.uri)));
149
+ const textModelN = textModel;
150
+ const textModel0 = store.add(this._modelService.createModel(createTextBufferFactoryFromSnapshot(textModel.createSnapshot()), { languageId: textModel.getLanguageId(), onDidChange: Event.None }, targetUri.with({ scheme: Schemas.vscode, authority: 'inline-chat', path: '', query: ( ( new URLSearchParams({ id, 'textModel0': '' })).toString()) }), true));
151
+ if (targetUri.scheme === Schemas.untitled) {
152
+ store.add(this._editorService.onDidCloseEditor(() => {
153
+ if (!this._editorService.isOpened({ resource: targetUri, typeId: UntitledTextEditorInput.ID, editorId: DEFAULT_EDITOR_ASSOCIATION.id })) {
154
+ this._releaseSession(session, true);
155
+ }
156
+ }));
157
+ }
158
+ let wholeRange = options.wholeRange;
159
+ if (!wholeRange) {
160
+ wholeRange = ( new Range(
161
+ selection.selectionStartLineNumber,
162
+ selection.selectionStartColumn,
163
+ selection.positionLineNumber,
164
+ selection.positionColumn
165
+ ));
166
+ }
167
+ if (token.isCancellationRequested) {
168
+ store.dispose();
169
+ return undefined;
170
+ }
171
+ const session = ( new Session(
172
+ options.headless ?? false,
173
+ targetUri,
174
+ textModel0,
175
+ textModelN,
176
+ agent,
177
+ store.add(( new SessionWholeRange(textModelN, wholeRange))),
178
+ store.add(( new HunkData(this._editorWorkerService, textModel0, textModelN))),
179
+ chatModel,
180
+ options.session?.versionsByRequest
181
+ ));
182
+ const key = this._key(editor, session.targetUri);
183
+ if (( this._sessions.has(key))) {
184
+ store.dispose();
185
+ throw ( new Error(`Session already stored for ${key}`));
186
+ }
187
+ this._sessions.set(key, { session, editor, store });
188
+ return session;
189
+ }
190
+ moveSession(session, target) {
191
+ const newKey = this._key(target, session.targetUri);
192
+ const existing = this._sessions.get(newKey);
193
+ if (existing) {
194
+ if (existing.session !== session) {
195
+ throw ( new Error(`Cannot move session because the target editor already/still has one`));
196
+ }
197
+ else {
198
+ return;
199
+ }
200
+ }
201
+ let found = false;
202
+ for (const [oldKey, data] of this._sessions) {
203
+ if (data.session === session) {
204
+ found = true;
205
+ this._sessions.delete(oldKey);
206
+ this._sessions.set(newKey, { ...data, editor: target });
207
+ this._logService.trace(`[IE] did MOVE session for ${data.editor.getId()} to NEW EDITOR ${target.getId()}, ${session.agent.extensionId}`);
208
+ this._onDidMoveSession.fire({ session, editor: target });
209
+ break;
210
+ }
211
+ }
212
+ if (!found) {
213
+ throw ( new Error(`Cannot move session because it is not stored`));
214
+ }
215
+ }
216
+ releaseSession(session) {
217
+ this._releaseSession(session, false);
218
+ }
219
+ _releaseSession(session, byServer) {
220
+ let tuple;
221
+ for (const candidate of this._sessions) {
222
+ if (candidate[1].session === session) {
223
+ tuple = candidate;
224
+ break;
225
+ }
226
+ }
227
+ if (!tuple) {
228
+ return;
229
+ }
230
+ this._telemetryService.publicLog2('interactiveEditor/session', session.asTelemetryData());
231
+ const [key, value] = tuple;
232
+ this._sessions.delete(key);
233
+ this._logService.trace(`[IE] did RELEASED session for ${value.editor.getId()}, ${session.agent.extensionId}`);
234
+ this._onDidEndSession.fire({ editor: value.editor, session, endedByExternalCause: byServer });
235
+ value.store.dispose();
236
+ }
237
+ stashSession(session, editor, undoCancelEdits) {
238
+ const result = this._instaService.createInstance(StashedSession, editor, session, undoCancelEdits);
239
+ this._onDidStashSession.fire({ editor, session });
240
+ this._logService.trace(`[IE] did STASH session for ${editor.getId()}, ${session.agent.extensionId}`);
241
+ return result;
242
+ }
243
+ getCodeEditor(session) {
244
+ for (const [, data] of this._sessions) {
245
+ if (data.session === session) {
246
+ return data.editor;
247
+ }
248
+ }
249
+ throw ( new Error('session not found'));
250
+ }
251
+ getSession(editor, uri) {
252
+ const key = this._key(editor, uri);
253
+ return this._sessions.get(key)?.session;
254
+ }
255
+ _key(editor, uri) {
256
+ const item = this._keyComputers.get(uri.scheme);
257
+ return item
258
+ ? item.getComparisonKey(editor, uri)
259
+ : `${editor.getId()}@${( uri.toString())}`;
260
+ }
261
+ registerSessionKeyComputer(scheme, value) {
262
+ this._keyComputers.set(scheme, value);
263
+ return toDisposable(() => this._keyComputers.delete(scheme));
264
+ }
265
+ async createSession2(editor, uri, token) {
266
+ assertType(editor.hasModel());
267
+ if (( this._sessions2.has(uri))) {
268
+ throw ( new Error('Session already exists'));
269
+ }
270
+ this._onWillStartSession.fire(editor);
271
+ const chatModelRef = this._chatService.startSession(ChatAgentLocation.EditorInline, { canUseTools: false });
272
+ const chatModel = chatModelRef.object;
273
+ chatModel.startEditingSession(false);
274
+ const widget = this._chatWidgetService.getWidgetBySessionResource(chatModel.sessionResource);
275
+ await widget?.attachmentModel.addFile(uri);
276
+ const store = ( new DisposableStore());
277
+ store.add(toDisposable(() => {
278
+ this._chatService.cancelCurrentRequestForSession(chatModel.sessionResource);
279
+ chatModel.editingSession?.reject();
280
+ this._sessions2.delete(uri);
281
+ this._onDidChangeSessions.fire(this);
282
+ }));
283
+ store.add(chatModelRef);
284
+ store.add(autorun(r => {
285
+ const entries = chatModel.editingSession?.entries.read(r);
286
+ if (!entries?.length) {
287
+ return;
288
+ }
289
+ const state = entries.find(entry => isEqual(entry.modifiedURI, uri))?.state.read(r);
290
+ if (state === ModifiedFileEntryState.Accepted || state === ModifiedFileEntryState.Rejected) {
291
+ const response = chatModel.getRequests().at(-1)?.response;
292
+ if (response) {
293
+ this._chatService.notifyUserAction({
294
+ sessionResource: response.session.sessionResource,
295
+ requestId: response.requestId,
296
+ agentId: response.agent?.id,
297
+ command: response.slashCommand?.name,
298
+ result: response.result,
299
+ action: {
300
+ kind: 'inlineChat',
301
+ action: state === ModifiedFileEntryState.Accepted ? 'accepted' : 'discarded'
302
+ }
303
+ });
304
+ }
305
+ }
306
+ const allSettled = entries.every(entry => {
307
+ const state = entry.state.read(r);
308
+ return (state === ModifiedFileEntryState.Accepted || state === ModifiedFileEntryState.Rejected)
309
+ && !entry.isCurrentlyBeingModifiedBy.read(r);
310
+ });
311
+ if (allSettled && !chatModel.requestInProgress.read(undefined)) {
312
+ store.dispose();
313
+ }
314
+ }));
315
+ const result = {
316
+ uri,
317
+ initialPosition: editor.getSelection().getStartPosition().delta(-1),
318
+ initialSelection: editor.getSelection(),
319
+ chatModel,
320
+ editingSession: chatModel.editingSession,
321
+ dispose: store.dispose.bind(store)
322
+ };
323
+ this._sessions2.set(uri, result);
324
+ this._onDidChangeSessions.fire(this);
325
+ return result;
326
+ }
327
+ getSession2(uri) {
328
+ let result = this._sessions2.get(uri);
329
+ if (!result) {
330
+ for (const [_, candidate] of this._sessions2) {
331
+ const entry = candidate.editingSession.getEntry(uri);
332
+ if (entry) {
333
+ result = candidate;
334
+ break;
335
+ }
336
+ }
337
+ }
338
+ return result;
339
+ }
340
+ getSessionBySessionUri(sessionResource) {
341
+ for (const session of ( this._sessions2.values())) {
342
+ if (isEqual(session.chatModel.sessionResource, sessionResource)) {
343
+ return session;
344
+ }
345
+ }
346
+ return undefined;
347
+ }
348
+ };
349
+ InlineChatSessionServiceImpl = ( __decorate([
350
+ ( __param(0, ITelemetryService)),
351
+ ( __param(1, IModelService)),
352
+ ( __param(2, ITextModelService)),
353
+ ( __param(3, IEditorWorkerService)),
354
+ ( __param(4, ILogService)),
355
+ ( __param(5, IInstantiationService)),
356
+ ( __param(6, IEditorService)),
357
+ ( __param(7, ITextFileService)),
358
+ ( __param(8, ILanguageService)),
359
+ ( __param(9, IChatService)),
360
+ ( __param(10, IChatAgentService)),
361
+ ( __param(11, IChatWidgetService))
362
+ ], InlineChatSessionServiceImpl));
363
+ let InlineChatEnabler = class InlineChatEnabler {
364
+ static { this.Id = 'inlineChat.enabler'; }
365
+ constructor(contextKeyService, chatAgentService, editorService, configService) {
366
+ this._store = ( new DisposableStore());
367
+ this._ctxHasProvider2 = CTX_INLINE_CHAT_HAS_AGENT2.bindTo(contextKeyService);
368
+ this._ctxHasNotebookInline = CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE.bindTo(contextKeyService);
369
+ this._ctxHasNotebookProvider = CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT.bindTo(contextKeyService);
370
+ this._ctxPossible = CTX_INLINE_CHAT_POSSIBLE.bindTo(contextKeyService);
371
+ const agentObs = observableFromEvent(this, chatAgentService.onDidChangeAgents, () => chatAgentService.getDefaultAgent(ChatAgentLocation.EditorInline));
372
+ const notebookAgentObs = observableFromEvent(this, chatAgentService.onDidChangeAgents, () => chatAgentService.getDefaultAgent(ChatAgentLocation.Notebook));
373
+ const notebookAgentConfigObs = observableConfigValue(InlineChatConfigKeys.notebookAgent, false, configService);
374
+ this._store.add(autorun(r => {
375
+ const agent = agentObs.read(r);
376
+ if (!agent) {
377
+ this._ctxHasProvider2.reset();
378
+ }
379
+ else {
380
+ this._ctxHasProvider2.set(true);
381
+ }
382
+ }));
383
+ this._store.add(autorun(r => {
384
+ this._ctxHasNotebookInline.set(!notebookAgentConfigObs.read(r) && !!agentObs.read(r));
385
+ this._ctxHasNotebookProvider.set(notebookAgentConfigObs.read(r) && !!notebookAgentObs.read(r));
386
+ }));
387
+ const updateEditor = () => {
388
+ const ctrl = editorService.activeEditorPane?.getControl();
389
+ const isCodeEditorLike = isCodeEditor(ctrl) || isDiffEditor(ctrl) || isCompositeEditor(ctrl);
390
+ this._ctxPossible.set(isCodeEditorLike);
391
+ };
392
+ this._store.add(editorService.onDidActiveEditorChange(updateEditor));
393
+ updateEditor();
394
+ }
395
+ dispose() {
396
+ this._ctxPossible.reset();
397
+ this._ctxHasProvider2.reset();
398
+ this._store.dispose();
399
+ }
400
+ };
401
+ InlineChatEnabler = ( __decorate([
402
+ ( __param(0, IContextKeyService)),
403
+ ( __param(1, IChatAgentService)),
404
+ ( __param(2, IEditorService)),
405
+ ( __param(3, IConfigurationService))
406
+ ], InlineChatEnabler));
407
+ let InlineChatEscapeToolContribution = class InlineChatEscapeToolContribution extends Disposable {
408
+ static { InlineChatEscapeToolContribution_1 = this; }
409
+ static { this.Id = 'inlineChat.escapeTool'; }
410
+ static { this.DONT_ASK_AGAIN_KEY = 'inlineChat.dontAskMoveToPanelChat'; }
411
+ static { this._data = {
412
+ id: 'inline_chat_exit',
413
+ source: ToolDataSource.Internal,
414
+ canBeReferencedInPrompt: false,
415
+ alwaysDisplayInputOutput: false,
416
+ displayName: ( localize(8312, "Inline Chat to Panel Chat")),
417
+ modelDescription: 'Moves the inline chat session to the richer panel chat which supports edits across files, creating and deleting files, multi-turn conversations between the user and the assistant, and access to more IDE tools, like retrieve problems, interact with source control, run terminal commands etc.',
418
+ }; }
419
+ constructor(lmTools, inlineChatSessionService, dialogService, codeEditorService, chatService, logService, storageService, instaService) {
420
+ super();
421
+ this._store.add(lmTools.registerTool(InlineChatEscapeToolContribution_1._data, {
422
+ invoke: async (invocation, _tokenCountFn, _progress, _token) => {
423
+ const sessionResource = invocation.context?.sessionResource;
424
+ if (!sessionResource) {
425
+ logService.warn('InlineChatEscapeToolContribution: no sessionId in tool invocation context');
426
+ return { content: [{ kind: 'text', value: 'Cancel' }] };
427
+ }
428
+ const session = inlineChatSessionService.getSessionBySessionUri(sessionResource);
429
+ if (!session) {
430
+ logService.warn(`InlineChatEscapeToolContribution: no session found for id ${sessionResource}`);
431
+ return { content: [{ kind: 'text', value: 'Cancel' }] };
432
+ }
433
+ const dontAskAgain = storageService.getBoolean(InlineChatEscapeToolContribution_1.DONT_ASK_AGAIN_KEY, StorageScope.PROFILE);
434
+ let result;
435
+ if (dontAskAgain !== undefined) {
436
+ result = { confirmed: dontAskAgain, checkboxChecked: false };
437
+ }
438
+ else {
439
+ result = await dialogService.confirm({
440
+ type: 'question',
441
+ title: ( localize(8313, "Do you want to continue in Chat view?")),
442
+ message: ( localize(8314, "Do you want to continue in Chat view?")),
443
+ detail: ( localize(
444
+ 8315,
445
+ "Inline chat is designed for making single-file code changes. Continue your request in the Chat view or rephrase it for inline chat."
446
+ )),
447
+ primaryButton: ( localize(8316, "Continue in Chat view")),
448
+ cancelButton: ( localize(8317, "Cancel")),
449
+ checkbox: { label: ( localize(8318, "Don't ask again")), checked: false },
450
+ });
451
+ }
452
+ const editor = codeEditorService.getFocusedCodeEditor();
453
+ if (!editor || result.confirmed) {
454
+ logService.trace('InlineChatEscapeToolContribution: moving session to panel chat');
455
+ await instaService.invokeFunction(askInPanelChat, session.chatModel.getRequests().at(-1), session.chatModel.inputModel.state.get());
456
+ session.dispose();
457
+ }
458
+ else {
459
+ logService.trace('InlineChatEscapeToolContribution: rephrase prompt');
460
+ const lastRequest = session.chatModel.getRequests().at(-1);
461
+ chatService.removeRequest(session.chatModel.sessionResource, lastRequest.id);
462
+ session.chatModel.inputModel.setState({ inputText: lastRequest.message.text });
463
+ }
464
+ if (result.checkboxChecked) {
465
+ storageService.store(InlineChatEscapeToolContribution_1.DONT_ASK_AGAIN_KEY, result.confirmed, StorageScope.PROFILE, StorageTarget.USER);
466
+ logService.trace('InlineChatEscapeToolContribution: stored don\'t ask again preference');
467
+ }
468
+ return { content: [{ kind: 'text', value: 'Success' }] };
469
+ }
470
+ }));
471
+ }
472
+ };
473
+ InlineChatEscapeToolContribution = InlineChatEscapeToolContribution_1 = ( __decorate([
474
+ ( __param(0, ILanguageModelToolsService)),
475
+ ( __param(1, IInlineChatSessionService)),
476
+ ( __param(2, IDialogService)),
477
+ ( __param(3, ICodeEditorService)),
478
+ ( __param(4, IChatService)),
479
+ ( __param(5, ILogService)),
480
+ ( __param(6, IStorageService)),
481
+ ( __param(7, IInstantiationService))
482
+ ], InlineChatEscapeToolContribution));
483
+ registerAction2(class ResetMoveToPanelChatChoice extends Action2 {
484
+ constructor() {
485
+ super({
486
+ id: 'inlineChat.resetMoveToPanelChatChoice',
487
+ precondition: ( ( ContextKeyExpr.has('config.chat.disableAIFeatures')).negate()),
488
+ title: ( localize2(8319, "Reset Choice for 'Move Inline Chat to Panel Chat'")),
489
+ f1: true
490
+ });
491
+ }
492
+ run(accessor) {
493
+ accessor.get(IStorageService).remove(InlineChatEscapeToolContribution.DONT_ASK_AGAIN_KEY, StorageScope.PROFILE);
494
+ }
495
+ });
496
+
497
+ export { InlineChatEnabler, InlineChatError, InlineChatEscapeToolContribution, InlineChatSessionServiceImpl };