@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,76 @@
1
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
2
+ import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
+ import { DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
5
+ import { ISingleEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/editOperation";
6
+ import { Position } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position";
7
+ import { IModelDeltaDecoration, IValidEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
8
+ import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
9
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
10
+ import { HunkInformation, Session } from "./inlineChatSession.js";
11
+ import { InlineChatZoneWidget } from "./inlineChatZoneWidget.js";
12
+ import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service";
13
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
14
+ import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
15
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
16
+ import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
17
+ import { VersionedExtensionId } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
18
+ export interface IEditObserver {
19
+ start(): void;
20
+ stop(): void;
21
+ }
22
+ export declare enum HunkAction {
23
+ Accept = 0,
24
+ Discard = 1,
25
+ MoveNext = 2,
26
+ MovePrev = 3,
27
+ ToggleDiff = 4
28
+ }
29
+ export declare class LiveStrategy {
30
+ protected readonly _session: Session;
31
+ protected readonly _editor: ICodeEditor;
32
+ protected readonly _zone: InlineChatZoneWidget;
33
+ private readonly _showOverlayToolbar;
34
+ protected readonly _editorWorkerService: IEditorWorkerService;
35
+ private readonly _accessibilityService;
36
+ private readonly _configService;
37
+ private readonly _menuService;
38
+ private readonly _contextService;
39
+ private readonly _textFileService;
40
+ protected readonly _instaService: IInstantiationService;
41
+ private readonly _decoInsertedText;
42
+ private readonly _decoInsertedTextRange;
43
+ protected readonly _store: DisposableStore;
44
+ protected readonly _onDidAccept: Emitter<void>;
45
+ protected readonly _onDidDiscard: Emitter<void>;
46
+ private readonly _ctxCurrentChangeHasDiff;
47
+ private readonly _ctxCurrentChangeShowsDiff;
48
+ private readonly _progressiveEditingDecorations;
49
+ private readonly _lensActionsFactory;
50
+ private _editCount;
51
+ private readonly _hunkData;
52
+ readonly onDidAccept: Event<void>;
53
+ readonly onDidDiscard: Event<void>;
54
+ constructor(_session: Session, _editor: ICodeEditor, _zone: InlineChatZoneWidget, _showOverlayToolbar: boolean, contextKeyService: IContextKeyService, _editorWorkerService: IEditorWorkerService, _accessibilityService: IAccessibilityService, _configService: IConfigurationService, _menuService: IMenuService, _contextService: IContextKeyService, _textFileService: ITextFileService, _instaService: IInstantiationService);
55
+ dispose(): void;
56
+ private _resetDiff;
57
+ apply(): Promise<void>;
58
+ cancel(): IValidEditOperation[];
59
+ makeChanges(edits: ISingleEditOperation[], obs: IEditObserver, undoStopBefore: boolean, metadata: IInlineChatMetadata): Promise<void>;
60
+ makeProgressiveChanges(edits: ISingleEditOperation[], obs: IEditObserver, opts: ProgressingEditsOptions, undoStopBefore: boolean, metadata: IInlineChatMetadata): Promise<void>;
61
+ private _makeChanges;
62
+ performHunkAction(hunk: HunkInformation | undefined, action: HunkAction): void;
63
+ private _findDisplayData;
64
+ renderChanges(): Promise<Position | undefined>;
65
+ getWholeRangeDecoration(): IModelDeltaDecoration[];
66
+ private _doApplyChanges;
67
+ }
68
+ export interface ProgressingEditsOptions {
69
+ duration: number;
70
+ token: CancellationToken;
71
+ }
72
+ export interface IInlineChatMetadata {
73
+ modelId: string | undefined;
74
+ extensionId: VersionedExtensionId | undefined;
75
+ requestId: string | undefined;
76
+ }
@@ -0,0 +1,464 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { WindowIntervalTimer, createElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
+ import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import { themeColorFromId, ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
7
+ import { StableEditorScrollState } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/stableEditorScroll';
8
+ import { RenderOptions, LineSource, renderLines } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines';
9
+ import { LineRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/lineRange';
10
+ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
11
+ import { MinimapPosition, OverviewRulerLane, TrackedRangeStickiness } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
12
+ import { ModelDecorationOptions } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
13
+ import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
14
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
15
+ import { Progress } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress';
16
+ import { SaveReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
17
+ import { countWords } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatWordCounter';
18
+ import { HunkState } from './inlineChatSession.js';
19
+ import { minimapInlineChatDiffInserted, overviewRulerInlineChatDiffInserted, CTX_INLINE_CHAT_CHANGE_HAS_DIFF, CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF, MENU_INLINE_CHAT_ZONE, ACTION_TOGGLE_DIFF, InlineChatConfigKeys } from '../common/inlineChat.js';
20
+ import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
21
+ import { asProgressiveEdit, performAsyncTextEdit } from './utils.js';
22
+ import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
23
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
24
+ import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
25
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
26
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
27
+ import { DefaultChatTextEditor } from '../../chat/browser/codeBlockPart.js';
28
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
29
+ import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
30
+ import { ConflictActionsFactory } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mergeEditor/browser/view/conflictActions';
31
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
32
+ import { MenuItemAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
33
+ import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
34
+ import { InlineDecoration, InlineDecorationType } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/viewModel/inlineDecorations';
35
+ import { EditSources } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEditSource';
36
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
37
+
38
+ var HunkAction;
39
+ (function (HunkAction) {
40
+ HunkAction[HunkAction["Accept"] = 0] = "Accept";
41
+ HunkAction[HunkAction["Discard"] = 1] = "Discard";
42
+ HunkAction[HunkAction["MoveNext"] = 2] = "MoveNext";
43
+ HunkAction[HunkAction["MovePrev"] = 3] = "MovePrev";
44
+ HunkAction[HunkAction["ToggleDiff"] = 4] = "ToggleDiff";
45
+ })(HunkAction || (HunkAction = {}));
46
+ let LiveStrategy = class LiveStrategy {
47
+ constructor(_session, _editor, _zone, _showOverlayToolbar, contextKeyService, _editorWorkerService, _accessibilityService, _configService, _menuService, _contextService, _textFileService, _instaService) {
48
+ this._session = _session;
49
+ this._editor = _editor;
50
+ this._zone = _zone;
51
+ this._showOverlayToolbar = _showOverlayToolbar;
52
+ this._editorWorkerService = _editorWorkerService;
53
+ this._accessibilityService = _accessibilityService;
54
+ this._configService = _configService;
55
+ this._menuService = _menuService;
56
+ this._contextService = _contextService;
57
+ this._textFileService = _textFileService;
58
+ this._instaService = _instaService;
59
+ this._decoInsertedText = ModelDecorationOptions.register({
60
+ description: 'inline-modified-line',
61
+ className: 'inline-chat-inserted-range-linehighlight',
62
+ isWholeLine: true,
63
+ overviewRuler: {
64
+ position: OverviewRulerLane.Full,
65
+ color: themeColorFromId(overviewRulerInlineChatDiffInserted),
66
+ },
67
+ minimap: {
68
+ position: MinimapPosition.Inline,
69
+ color: themeColorFromId(minimapInlineChatDiffInserted),
70
+ }
71
+ });
72
+ this._decoInsertedTextRange = ModelDecorationOptions.register({
73
+ description: 'inline-chat-inserted-range-linehighlight',
74
+ className: 'inline-chat-inserted-range',
75
+ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
76
+ });
77
+ this._store = ( new DisposableStore());
78
+ this._onDidAccept = this._store.add(( new Emitter()));
79
+ this._onDidDiscard = this._store.add(( new Emitter()));
80
+ this._editCount = 0;
81
+ this._hunkData = ( new Map());
82
+ this.onDidAccept = this._onDidAccept.event;
83
+ this.onDidDiscard = this._onDidDiscard.event;
84
+ this._ctxCurrentChangeHasDiff = CTX_INLINE_CHAT_CHANGE_HAS_DIFF.bindTo(contextKeyService);
85
+ this._ctxCurrentChangeShowsDiff = CTX_INLINE_CHAT_CHANGE_SHOWS_DIFF.bindTo(contextKeyService);
86
+ this._progressiveEditingDecorations = this._editor.createDecorationsCollection();
87
+ this._lensActionsFactory = this._store.add(( new ConflictActionsFactory(this._editor)));
88
+ }
89
+ dispose() {
90
+ this._resetDiff();
91
+ this._store.dispose();
92
+ }
93
+ _resetDiff() {
94
+ this._ctxCurrentChangeHasDiff.reset();
95
+ this._ctxCurrentChangeShowsDiff.reset();
96
+ this._zone.widget.updateStatus('');
97
+ this._progressiveEditingDecorations.clear();
98
+ for (const data of ( this._hunkData.values())) {
99
+ data.remove();
100
+ }
101
+ }
102
+ async apply() {
103
+ this._resetDiff();
104
+ if (this._editCount > 0) {
105
+ this._editor.pushUndoStop();
106
+ }
107
+ await this._doApplyChanges(true);
108
+ }
109
+ cancel() {
110
+ this._resetDiff();
111
+ return this._session.hunkData.discardAll();
112
+ }
113
+ async makeChanges(edits, obs, undoStopBefore, metadata) {
114
+ return this._makeChanges(edits, obs, undefined, undefined, undoStopBefore, metadata);
115
+ }
116
+ async makeProgressiveChanges(edits, obs, opts, undoStopBefore, metadata) {
117
+ const progress = ( new Progress(edits => {
118
+ const newLines = ( new Set());
119
+ for (const edit of edits) {
120
+ LineRange.fromRange(edit.range).forEach(line => newLines.add(line));
121
+ }
122
+ const existingRanges = ( this._progressiveEditingDecorations.getRanges().map(LineRange.fromRange));
123
+ for (const existingRange of existingRanges) {
124
+ existingRange.forEach(line => newLines.delete(line));
125
+ }
126
+ const newDecorations = [];
127
+ for (const line of newLines) {
128
+ newDecorations.push({ range: ( new Range(line, 1, line, Number.MAX_VALUE)), options: this._decoInsertedText });
129
+ }
130
+ this._progressiveEditingDecorations.append(newDecorations);
131
+ }));
132
+ return this._makeChanges(edits, obs, opts, progress, undoStopBefore, metadata);
133
+ }
134
+ async _makeChanges(edits, obs, opts, progress, undoStopBefore, metadata) {
135
+ if (undoStopBefore) {
136
+ this._editor.pushUndoStop();
137
+ }
138
+ this._editCount++;
139
+ const editSource = EditSources.inlineChatApplyEdit({
140
+ modelId: metadata.modelId,
141
+ extensionId: metadata.extensionId,
142
+ requestId: metadata.requestId,
143
+ sessionId: undefined,
144
+ languageId: this._session.textModelN.getLanguageId(),
145
+ });
146
+ if (opts) {
147
+ const durationInSec = opts.duration / 1000;
148
+ for (const edit of edits) {
149
+ const wordCount = countWords(edit.text ?? '');
150
+ const speed = wordCount / durationInSec;
151
+ const asyncEdit = asProgressiveEdit(( new WindowIntervalTimer(this._zone.domNode)), edit, speed, opts.token);
152
+ await performAsyncTextEdit(this._session.textModelN, asyncEdit, progress, obs, editSource);
153
+ }
154
+ }
155
+ else {
156
+ obs.start();
157
+ this._session.textModelN.pushEditOperations(null, edits, (undoEdits) => {
158
+ progress?.report(undoEdits);
159
+ return null;
160
+ }, undefined, editSource);
161
+ obs.stop();
162
+ }
163
+ }
164
+ performHunkAction(hunk, action) {
165
+ const displayData = this._findDisplayData(hunk);
166
+ if (!displayData) {
167
+ if (action === HunkAction.Accept) {
168
+ this._onDidAccept.fire();
169
+ }
170
+ else if (action === HunkAction.Discard) {
171
+ this._onDidDiscard.fire();
172
+ }
173
+ return;
174
+ }
175
+ if (action === HunkAction.Accept) {
176
+ displayData.acceptHunk();
177
+ }
178
+ else if (action === HunkAction.Discard) {
179
+ displayData.discardHunk();
180
+ }
181
+ else if (action === HunkAction.MoveNext) {
182
+ displayData.move(true);
183
+ }
184
+ else if (action === HunkAction.MovePrev) {
185
+ displayData.move(false);
186
+ }
187
+ else if (action === HunkAction.ToggleDiff) {
188
+ displayData.toggleDiff?.();
189
+ }
190
+ }
191
+ _findDisplayData(hunkInfo) {
192
+ let result;
193
+ if (hunkInfo) {
194
+ result = this._hunkData.get(hunkInfo);
195
+ }
196
+ if (!result && this._zone.position) {
197
+ const zoneLine = this._zone.position.lineNumber;
198
+ let distance = Number.MAX_SAFE_INTEGER;
199
+ for (const candidate of ( this._hunkData.values())) {
200
+ if (candidate.hunk.getState() !== HunkState.Pending) {
201
+ continue;
202
+ }
203
+ const hunkRanges = candidate.hunk.getRangesN();
204
+ if (hunkRanges.length === 0) {
205
+ continue;
206
+ }
207
+ const myDistance = zoneLine <= hunkRanges[0].startLineNumber
208
+ ? hunkRanges[0].startLineNumber - zoneLine
209
+ : zoneLine - hunkRanges[0].endLineNumber;
210
+ if (myDistance < distance) {
211
+ distance = myDistance;
212
+ result = candidate;
213
+ }
214
+ }
215
+ }
216
+ if (!result) {
217
+ result = Iterable.first(Iterable.filter(( this._hunkData.values()), candidate => candidate.hunk.getState() === HunkState.Pending));
218
+ }
219
+ return result;
220
+ }
221
+ async renderChanges() {
222
+ this._progressiveEditingDecorations.clear();
223
+ const renderHunks = () => {
224
+ let widgetData;
225
+ changeDecorationsAndViewZones(this._editor, (decorationsAccessor, viewZoneAccessor) => {
226
+ const keysNow = ( new Set(( this._hunkData.keys())));
227
+ widgetData = undefined;
228
+ for (const hunkData of this._session.hunkData.getInfo()) {
229
+ keysNow.delete(hunkData);
230
+ const hunkRanges = hunkData.getRangesN();
231
+ let data = this._hunkData.get(hunkData);
232
+ if (!data) {
233
+ const decorationIds = [];
234
+ for (let i = 0; i < hunkRanges.length; i++) {
235
+ decorationIds.push(decorationsAccessor.addDecoration(hunkRanges[i], i === 0
236
+ ? this._decoInsertedText
237
+ : this._decoInsertedTextRange));
238
+ }
239
+ const acceptHunk = () => {
240
+ hunkData.acceptChanges();
241
+ renderHunks();
242
+ };
243
+ const discardHunk = () => {
244
+ hunkData.discardChanges();
245
+ renderHunks();
246
+ };
247
+ const mightContainNonBasicASCII = this._session.textModel0.mightContainNonBasicASCII();
248
+ const mightContainRTL = this._session.textModel0.mightContainRTL();
249
+ const renderOptions = RenderOptions.fromEditor(this._editor);
250
+ const originalRange = hunkData.getRanges0()[0];
251
+ const source = ( new LineSource(
252
+ LineRange.fromRangeInclusive(originalRange).mapToLineArray(l => this._session.textModel0.tokenization.getLineTokens(l)),
253
+ [],
254
+ mightContainNonBasicASCII,
255
+ mightContainRTL
256
+ ));
257
+ const domNode = createElement('div');
258
+ domNode.className = 'inline-chat-original-zone2';
259
+ const result = renderLines(source, renderOptions, [( new InlineDecoration(( new Range(originalRange.startLineNumber, 1, originalRange.startLineNumber, 1)), '', InlineDecorationType.Regular))], domNode);
260
+ const viewZoneData = {
261
+ afterLineNumber: -1,
262
+ heightInLines: result.heightInLines,
263
+ domNode,
264
+ ordinal: 50000 + 2
265
+ };
266
+ const toggleDiff = () => {
267
+ const scrollState = StableEditorScrollState.capture(this._editor);
268
+ changeDecorationsAndViewZones(this._editor, (_decorationsAccessor, viewZoneAccessor) => {
269
+ assertType(data);
270
+ if (!data.diffViewZoneId) {
271
+ const [hunkRange] = hunkData.getRangesN();
272
+ viewZoneData.afterLineNumber = hunkRange.startLineNumber - 1;
273
+ data.diffViewZoneId = viewZoneAccessor.addZone(viewZoneData);
274
+ }
275
+ else {
276
+ viewZoneAccessor.removeZone(data.diffViewZoneId);
277
+ data.diffViewZoneId = undefined;
278
+ }
279
+ });
280
+ this._ctxCurrentChangeShowsDiff.set(typeof data?.diffViewZoneId === 'string');
281
+ scrollState.restore(this._editor);
282
+ };
283
+ let lensActions;
284
+ const lensActionsViewZoneIds = [];
285
+ if (this._showOverlayToolbar && hunkData.getState() === HunkState.Pending) {
286
+ lensActions = ( new DisposableStore());
287
+ const menu = this._menuService.createMenu(MENU_INLINE_CHAT_ZONE, this._contextService);
288
+ const makeActions = () => {
289
+ const actions = [];
290
+ const tuples = menu.getActions({ arg: hunkData });
291
+ for (const [, group] of tuples) {
292
+ for (const item of group) {
293
+ if (item instanceof MenuItemAction) {
294
+ let text = item.label;
295
+ if (item.id === ACTION_TOGGLE_DIFF) {
296
+ text = item.checked ? 'Hide Changes' : 'Show Changes';
297
+ }
298
+ else if (ThemeIcon.isThemeIcon(item.item.icon)) {
299
+ text = `$(${item.item.icon.id}) ${text}`;
300
+ }
301
+ actions.push({
302
+ text,
303
+ tooltip: item.tooltip,
304
+ action: async () => item.run(),
305
+ });
306
+ }
307
+ }
308
+ }
309
+ return actions;
310
+ };
311
+ const obs = observableValue(this, makeActions());
312
+ lensActions.add(menu.onDidChange(() => obs.set(makeActions(), undefined)));
313
+ lensActions.add(menu);
314
+ lensActions.add(this._lensActionsFactory.createWidget(viewZoneAccessor, hunkRanges[0].startLineNumber - 1, obs, lensActionsViewZoneIds));
315
+ }
316
+ const remove = () => {
317
+ changeDecorationsAndViewZones(this._editor, (decorationsAccessor, viewZoneAccessor) => {
318
+ assertType(data);
319
+ for (const decorationId of data.decorationIds) {
320
+ decorationsAccessor.removeDecoration(decorationId);
321
+ }
322
+ if (data.diffViewZoneId) {
323
+ viewZoneAccessor.removeZone(data.diffViewZoneId);
324
+ }
325
+ data.decorationIds = [];
326
+ data.diffViewZoneId = undefined;
327
+ data.lensActionsViewZoneIds?.forEach(viewZoneAccessor.removeZone);
328
+ data.lensActionsViewZoneIds = undefined;
329
+ });
330
+ lensActions?.dispose();
331
+ };
332
+ const move = (next) => {
333
+ const keys = Array.from(( this._hunkData.keys()));
334
+ const idx = keys.indexOf(hunkData);
335
+ const nextIdx = (idx + (next ? 1 : -1) + keys.length) % keys.length;
336
+ if (nextIdx !== idx) {
337
+ const nextData = this._hunkData.get(keys[nextIdx]);
338
+ this._zone.updatePositionAndHeight(nextData?.position);
339
+ renderHunks();
340
+ }
341
+ };
342
+ const zoneLineNumber = this._zone.position?.lineNumber ?? this._editor.getPosition().lineNumber;
343
+ const myDistance = zoneLineNumber <= hunkRanges[0].startLineNumber
344
+ ? hunkRanges[0].startLineNumber - zoneLineNumber
345
+ : zoneLineNumber - hunkRanges[0].endLineNumber;
346
+ data = {
347
+ hunk: hunkData,
348
+ decorationIds,
349
+ diffViewZoneId: '',
350
+ diffViewZone: viewZoneData,
351
+ lensActionsViewZoneIds,
352
+ distance: myDistance,
353
+ position: hunkRanges[0].getStartPosition().delta(-1),
354
+ acceptHunk,
355
+ discardHunk,
356
+ toggleDiff: !hunkData.isInsertion() ? toggleDiff : undefined,
357
+ remove,
358
+ move,
359
+ };
360
+ this._hunkData.set(hunkData, data);
361
+ }
362
+ else if (hunkData.getState() !== HunkState.Pending) {
363
+ data.remove();
364
+ }
365
+ else {
366
+ const zoneLineNumber = this._zone.position?.lineNumber ?? this._editor.getPosition().lineNumber;
367
+ const modifiedRangeNow = hunkRanges[0];
368
+ data.position = modifiedRangeNow.getStartPosition().delta(-1);
369
+ data.distance = zoneLineNumber <= modifiedRangeNow.startLineNumber
370
+ ? modifiedRangeNow.startLineNumber - zoneLineNumber
371
+ : zoneLineNumber - modifiedRangeNow.endLineNumber;
372
+ }
373
+ if (hunkData.getState() === HunkState.Pending && (!widgetData || data.distance < widgetData.distance)) {
374
+ widgetData = data;
375
+ }
376
+ }
377
+ for (const key of keysNow) {
378
+ const data = this._hunkData.get(key);
379
+ if (data) {
380
+ this._hunkData.delete(key);
381
+ data.remove();
382
+ }
383
+ }
384
+ });
385
+ if (widgetData) {
386
+ this._zone.reveal(widgetData.position);
387
+ const mode = this._configService.getValue(InlineChatConfigKeys.AccessibleDiffView);
388
+ if (mode === 'on' || mode === 'auto' && this._accessibilityService.isScreenReaderOptimized()) {
389
+ this._zone.widget.showAccessibleHunk(this._session, widgetData.hunk);
390
+ }
391
+ this._ctxCurrentChangeHasDiff.set(Boolean(widgetData.toggleDiff));
392
+ }
393
+ else if (this._hunkData.size > 0) {
394
+ let oneAccepted = false;
395
+ for (const hunkData of this._session.hunkData.getInfo()) {
396
+ if (hunkData.getState() === HunkState.Accepted) {
397
+ oneAccepted = true;
398
+ break;
399
+ }
400
+ }
401
+ if (oneAccepted) {
402
+ this._onDidAccept.fire();
403
+ }
404
+ else {
405
+ this._onDidDiscard.fire();
406
+ }
407
+ }
408
+ return widgetData;
409
+ };
410
+ return renderHunks()?.position;
411
+ }
412
+ getWholeRangeDecoration() {
413
+ return [];
414
+ }
415
+ async _doApplyChanges(ignoreLocal) {
416
+ const untitledModels = [];
417
+ const editor = this._instaService.createInstance(DefaultChatTextEditor);
418
+ for (const request of this._session.chatModel.getRequests()) {
419
+ if (!request.response?.response) {
420
+ continue;
421
+ }
422
+ for (const item of request.response.response.value) {
423
+ if (item.kind !== 'textEditGroup') {
424
+ continue;
425
+ }
426
+ if (ignoreLocal && isEqual(item.uri, this._session.textModelN.uri)) {
427
+ continue;
428
+ }
429
+ await editor.apply(request.response, item, undefined);
430
+ if (item.uri.scheme === Schemas.untitled) {
431
+ const untitled = this._textFileService.untitled.get(item.uri);
432
+ if (untitled) {
433
+ untitledModels.push(untitled);
434
+ }
435
+ }
436
+ }
437
+ }
438
+ for (const untitledModel of untitledModels) {
439
+ if (!untitledModel.isDisposed()) {
440
+ await untitledModel.resolve();
441
+ await untitledModel.save({ reason: SaveReason.EXPLICIT });
442
+ }
443
+ }
444
+ }
445
+ };
446
+ LiveStrategy = ( __decorate([
447
+ ( __param(4, IContextKeyService)),
448
+ ( __param(5, IEditorWorkerService)),
449
+ ( __param(6, IAccessibilityService)),
450
+ ( __param(7, IConfigurationService)),
451
+ ( __param(8, IMenuService)),
452
+ ( __param(9, IContextKeyService)),
453
+ ( __param(10, ITextFileService)),
454
+ ( __param(11, IInstantiationService))
455
+ ], LiveStrategy));
456
+ function changeDecorationsAndViewZones(editor, callback) {
457
+ editor.changeDecorations(decorationsAccessor => {
458
+ editor.changeViewZones(viewZoneAccessor => {
459
+ callback(decorationsAccessor, viewZoneAccessor);
460
+ });
461
+ });
462
+ }
463
+
464
+ export { HunkAction, LiveStrategy };
@@ -0,0 +1,124 @@
1
+ import { Dimension } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
2
+ import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
+ import { DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
5
+ import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
6
+ import { ICodeEditorViewState } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/editorCommon";
7
+ import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
8
+ import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
9
+ import { IAccessibleViewService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleView.service";
10
+ import { IAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service";
11
+ import { IWorkbenchButtonBarOptions } from "../../../../platform/actions/browser/buttonbar.js";
12
+ import { MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
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 { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
16
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
17
+ import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
18
+ import { ILayoutService } from "@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service";
19
+ import { IMarkdownRendererService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service";
20
+ import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
21
+ import { IChatWidgetViewOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
22
+ import { ChatWidget, IChatWidgetLocationOptions } from "../../chat/browser/chatWidget.js";
23
+ import { IChatModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel";
24
+ import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
25
+ import { HunkInformation, Session } from "./inlineChatSession.js";
26
+ export interface InlineChatWidgetViewState {
27
+ editorViewState: ICodeEditorViewState;
28
+ input: string;
29
+ placeholder: string;
30
+ }
31
+ export interface IInlineChatWidgetConstructionOptions {
32
+ /**
33
+ * The menu that rendered as button bar, use for accept, discard etc
34
+ */
35
+ statusMenuId: MenuId | {
36
+ menu: MenuId;
37
+ options: IWorkbenchButtonBarOptions;
38
+ };
39
+ secondaryMenuId?: MenuId;
40
+ /**
41
+ * The options for the chat widget
42
+ */
43
+ chatWidgetViewOptions?: IChatWidgetViewOptions;
44
+ inZoneWidget?: boolean;
45
+ }
46
+ export declare class InlineChatWidget {
47
+ private readonly _options;
48
+ protected readonly _instantiationService: IInstantiationService;
49
+ private readonly _contextKeyService;
50
+ private readonly _keybindingService;
51
+ private readonly _accessibilityService;
52
+ private readonly _configurationService;
53
+ private readonly _accessibleViewService;
54
+ protected readonly _textModelResolverService: ITextModelService;
55
+ private readonly _chatService;
56
+ private readonly _hoverService;
57
+ private readonly _chatEntitlementService;
58
+ private readonly _markdownRendererService;
59
+ protected readonly _elements: {
60
+ root: HTMLDivElement;
61
+ chatWidget: HTMLDivElement;
62
+ accessibleViewer: HTMLDivElement;
63
+ infoLabel: HTMLDivElement;
64
+ toolbar1: HTMLDivElement;
65
+ statusLabel: HTMLDivElement;
66
+ toolbar2: HTMLDivElement;
67
+ disclaimerLabel: HTMLDivElement;
68
+ status: HTMLDivElement;
69
+ };
70
+ protected readonly _store: DisposableStore;
71
+ private readonly _ctxInputEditorFocused;
72
+ private readonly _ctxResponseFocused;
73
+ private readonly _chatWidget;
74
+ protected readonly _onDidChangeHeight: Emitter<void>;
75
+ readonly onDidChangeHeight: Event<void>;
76
+ private readonly _requestInProgress;
77
+ readonly requestInProgress: IObservable<boolean>;
78
+ private _isLayouting;
79
+ readonly scopedContextKeyService: IContextKeyService;
80
+ constructor(location: IChatWidgetLocationOptions, _options: IInlineChatWidgetConstructionOptions, _instantiationService: IInstantiationService, _contextKeyService: IContextKeyService, _keybindingService: IKeybindingService, _accessibilityService: IAccessibilityService, _configurationService: IConfigurationService, _accessibleViewService: IAccessibleViewService, _textModelResolverService: ITextModelService, _chatService: IChatService, _hoverService: IHoverService, _chatEntitlementService: IChatEntitlementService, _markdownRendererService: IMarkdownRendererService);
81
+ private _updateAriaLabel;
82
+ private _setupDisclaimer;
83
+ dispose(): void;
84
+ get domNode(): HTMLElement;
85
+ get chatWidget(): ChatWidget;
86
+ saveState(): void;
87
+ layout(widgetDim: Dimension): void;
88
+ protected _doLayout(dimension: Dimension): void;
89
+ /**
90
+ * The content height of this widget is the size that would require no scrolling
91
+ */
92
+ get contentHeight(): number;
93
+ get minHeight(): number;
94
+ protected _getExtraHeight(): number;
95
+ get value(): string;
96
+ set value(value: string);
97
+ selectAll(): void;
98
+ set placeholder(value: string);
99
+ toggleStatus(show: boolean): void;
100
+ updateToolbar(show: boolean): void;
101
+ getCodeBlockInfo(codeBlockIndex: number): Promise<ITextModel | undefined>;
102
+ get responseContent(): string | undefined;
103
+ getChatModel(): IChatModel | undefined;
104
+ setChatModel(chatModel: IChatModel): void;
105
+ updateInfo(message: string): void;
106
+ updateStatus(message: string, ops?: {
107
+ classes?: string[];
108
+ resetAfter?: number;
109
+ keepMessage?: boolean;
110
+ title?: string;
111
+ }): void;
112
+ reset(): void;
113
+ focus(): void;
114
+ hasFocus(): boolean;
115
+ }
116
+ export declare class EditorBasedInlineChatWidget extends InlineChatWidget {
117
+ private readonly _parentEditor;
118
+ private readonly _accessibleViewer;
119
+ constructor(location: IChatWidgetLocationOptions, _parentEditor: ICodeEditor, options: IInlineChatWidgetConstructionOptions, contextKeyService: IContextKeyService, keybindingService: IKeybindingService, instantiationService: IInstantiationService, accessibilityService: IAccessibilityService, configurationService: IConfigurationService, accessibleViewService: IAccessibleViewService, textModelResolverService: ITextModelService, chatService: IChatService, hoverService: IHoverService, layoutService: ILayoutService, chatEntitlementService: IChatEntitlementService, markdownRendererService: IMarkdownRendererService);
120
+ get contentHeight(): number;
121
+ protected _doLayout(dimension: Dimension): void;
122
+ reset(): void;
123
+ showAccessibleHunk(session: Session, hunkData: HunkInformation): void;
124
+ }