@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,721 @@
1
+
2
+ import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
3
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
4
+ import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
5
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
6
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
7
+ import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
8
+ import { Position } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position';
9
+ import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
10
+ import { isLocation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
11
+ import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
12
+ import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
13
+ import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
14
+ import { Action2, registerAction2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
15
+ import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
16
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
17
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
18
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
19
+ import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
20
+ import { EditorActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
21
+ import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
22
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
23
+ import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
24
+ import { isChatViewTitleActionContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatActions';
25
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
26
+ import { chatEditingWidgetFileStateContextKey, ModifiedFileEntryState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, chatEditingResourceContextKey, decidedChatEditingResourceContextKey, applyingChatEditsFailedContextKey, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
27
+ import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
28
+ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
29
+ import { isRequestVM, isResponseVM, isChatTreeItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
30
+ import { ChatAgentLocation, ChatConfiguration, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
31
+ import { CHAT_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
32
+ import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
33
+
34
+ class EditingSessionAction extends Action2 {
35
+ constructor(opts) {
36
+ super({
37
+ category: CHAT_CATEGORY,
38
+ ...opts
39
+ });
40
+ }
41
+ run(accessor, ...args) {
42
+ const context = getEditingSessionContext(accessor, args);
43
+ if (!context || !context.editingSession) {
44
+ return;
45
+ }
46
+ return this.runEditingSessionAction(accessor, context.editingSession, context.chatWidget, ...args);
47
+ }
48
+ }
49
+ function getEditingSessionContext(accessor, args) {
50
+ const arg0 = args.at(0);
51
+ const context = isChatViewTitleActionContext(arg0) ? arg0 : undefined;
52
+ const chatWidgetService = accessor.get(IChatWidgetService);
53
+ const chatEditingService = accessor.get(IChatEditingService);
54
+ let chatWidget = context ? chatWidgetService.getWidgetBySessionResource(context.sessionResource) : undefined;
55
+ if (!chatWidget) {
56
+ chatWidget = chatWidgetService.lastFocusedWidget ?? chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Chat).find(w => w.supportsChangingModes);
57
+ }
58
+ if (!chatWidget?.viewModel) {
59
+ return;
60
+ }
61
+ const editingSession = chatEditingService.getEditingSession(chatWidget.viewModel.model.sessionResource);
62
+ return { editingSession, chatWidget };
63
+ }
64
+ class WorkingSetAction extends EditingSessionAction {
65
+ runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
66
+ const uris = [];
67
+ if (URI.isUri(args[0])) {
68
+ uris.push(args[0]);
69
+ }
70
+ else if (chatWidget) {
71
+ uris.push(...chatWidget.input.selectedElements);
72
+ }
73
+ if (!uris.length) {
74
+ return;
75
+ }
76
+ return this.runWorkingSetAction(accessor, editingSession, chatWidget, ...uris);
77
+ }
78
+ }
79
+ registerAction2(class OpenFileInDiffAction extends WorkingSetAction {
80
+ constructor() {
81
+ super({
82
+ id: 'chatEditing.openFileInDiff',
83
+ title: ( localize2(5186, 'Open Changes in Diff Editor')),
84
+ icon: Codicon.diffSingle,
85
+ menu: [{
86
+ id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
87
+ when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
88
+ order: 2,
89
+ group: 'navigation'
90
+ }],
91
+ });
92
+ }
93
+ async runWorkingSetAction(accessor, currentEditingSession, _chatWidget, ...uris) {
94
+ const editorService = accessor.get(IEditorService);
95
+ for (const uri of uris) {
96
+ let pane = editorService.activeEditorPane;
97
+ if (!pane) {
98
+ pane = await editorService.openEditor({ resource: uri });
99
+ }
100
+ if (!pane) {
101
+ return;
102
+ }
103
+ const editedFile = currentEditingSession.getEntry(uri);
104
+ editedFile?.getEditorIntegration(pane).toggleDiff(undefined, true);
105
+ }
106
+ }
107
+ });
108
+ registerAction2(class AcceptAction extends WorkingSetAction {
109
+ constructor() {
110
+ super({
111
+ id: 'chatEditing.acceptFile',
112
+ title: ( localize2(5187, 'Keep')),
113
+ icon: Codicon.check,
114
+ menu: [{
115
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('resourceScheme', CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(chatEditingResourceContextKey.key, decidedChatEditingResourceContextKey.key))),
116
+ id: MenuId.MultiDiffEditorFileToolbar,
117
+ order: 0,
118
+ group: 'navigation',
119
+ }, {
120
+ id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
121
+ when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
122
+ order: 0,
123
+ group: 'navigation'
124
+ }],
125
+ });
126
+ }
127
+ async runWorkingSetAction(accessor, currentEditingSession, chatWidget, ...uris) {
128
+ await currentEditingSession.accept(...uris);
129
+ }
130
+ });
131
+ registerAction2(class DiscardAction extends WorkingSetAction {
132
+ constructor() {
133
+ super({
134
+ id: 'chatEditing.discardFile',
135
+ title: ( localize2(5188, 'Undo')),
136
+ icon: Codicon.discard,
137
+ menu: [{
138
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('resourceScheme', CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(chatEditingResourceContextKey.key, decidedChatEditingResourceContextKey.key))),
139
+ id: MenuId.MultiDiffEditorFileToolbar,
140
+ order: 2,
141
+ group: 'navigation',
142
+ }, {
143
+ id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
144
+ when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
145
+ order: 1,
146
+ group: 'navigation'
147
+ }],
148
+ });
149
+ }
150
+ async runWorkingSetAction(accessor, currentEditingSession, chatWidget, ...uris) {
151
+ await currentEditingSession.reject(...uris);
152
+ }
153
+ });
154
+ class ChatEditingAcceptAllAction extends EditingSessionAction {
155
+ constructor() {
156
+ super({
157
+ id: 'chatEditing.acceptAllFiles',
158
+ title: ( localize(5189, 'Keep')),
159
+ icon: Codicon.check,
160
+ tooltip: ( localize(5190, 'Keep All Edits')),
161
+ precondition: hasUndecidedChatEditingResourceContextKey,
162
+ keybinding: {
163
+ primary: KeyMod.CtrlCmd | KeyCode.Enter,
164
+ when: ( ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey, ChatContextKeys.inChatInput)),
165
+ weight: KeybindingWeight.WorkbenchContrib,
166
+ },
167
+ menu: [
168
+ {
169
+ id: MenuId.ChatEditingWidgetToolbar,
170
+ group: 'navigation',
171
+ order: 0,
172
+ when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey))))
173
+ }
174
+ ]
175
+ });
176
+ }
177
+ async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
178
+ await editingSession.accept();
179
+ }
180
+ }
181
+ registerAction2(ChatEditingAcceptAllAction);
182
+ class ChatEditingDiscardAllAction extends EditingSessionAction {
183
+ constructor() {
184
+ super({
185
+ id: 'chatEditing.discardAllFiles',
186
+ title: ( localize(5191, 'Undo')),
187
+ icon: Codicon.discard,
188
+ tooltip: ( localize(5192, 'Undo All Edits')),
189
+ precondition: hasUndecidedChatEditingResourceContextKey,
190
+ menu: [
191
+ {
192
+ id: MenuId.ChatEditingWidgetToolbar,
193
+ group: 'navigation',
194
+ order: 1,
195
+ when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), hasUndecidedChatEditingResourceContextKey))
196
+ }
197
+ ],
198
+ keybinding: {
199
+ when: ( ContextKeyExpr.and(
200
+ hasUndecidedChatEditingResourceContextKey,
201
+ ChatContextKeys.inChatInput,
202
+ ( ChatContextKeys.inputHasText.negate())
203
+ )),
204
+ weight: KeybindingWeight.WorkbenchContrib,
205
+ primary: KeyMod.CtrlCmd | KeyCode.Backspace,
206
+ },
207
+ });
208
+ }
209
+ async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
210
+ await discardAllEditsWithConfirmation(accessor, editingSession);
211
+ }
212
+ }
213
+ registerAction2(ChatEditingDiscardAllAction);
214
+ async function discardAllEditsWithConfirmation(accessor, currentEditingSession) {
215
+ const dialogService = accessor.get(IDialogService);
216
+ const entries = currentEditingSession.entries.get();
217
+ if (entries.length > 0) {
218
+ const confirmation = await dialogService.confirm({
219
+ title: ( localize(5193, "Undo all edits?")),
220
+ message: entries.length === 1
221
+ ? ( localize(
222
+ 5194,
223
+ "This will undo changes made in {0}. Do you want to proceed?",
224
+ basename(entries[0].modifiedURI)
225
+ ))
226
+ : ( localize(
227
+ 5195,
228
+ "This will undo changes made in {0} files. Do you want to proceed?",
229
+ entries.length
230
+ )),
231
+ primaryButton: ( localize(5196, "Yes")),
232
+ type: 'info'
233
+ });
234
+ if (!confirmation.confirmed) {
235
+ return false;
236
+ }
237
+ }
238
+ await currentEditingSession.reject();
239
+ return true;
240
+ }
241
+ class ChatEditingShowChangesAction extends EditingSessionAction {
242
+ static { this.ID = 'chatEditing.viewChanges'; }
243
+ static { this.LABEL = ( localize(5197, 'View All Edits')); }
244
+ constructor() {
245
+ super({
246
+ id: ChatEditingShowChangesAction.ID,
247
+ title: { value: ChatEditingShowChangesAction.LABEL, original: ChatEditingShowChangesAction.LABEL },
248
+ tooltip: ChatEditingShowChangesAction.LABEL,
249
+ f1: true,
250
+ icon: Codicon.diffMultiple,
251
+ precondition: hasUndecidedChatEditingResourceContextKey,
252
+ menu: [
253
+ {
254
+ id: MenuId.ChatEditingWidgetToolbar,
255
+ group: 'navigation',
256
+ order: 4,
257
+ when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasAppliedChatEditsContextKey, hasUndecidedChatEditingResourceContextKey))))
258
+ }
259
+ ],
260
+ });
261
+ }
262
+ async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
263
+ await editingSession.show();
264
+ }
265
+ }
266
+ registerAction2(ChatEditingShowChangesAction);
267
+ class ViewAllSessionChangesAction extends Action2 {
268
+ static { this.ID = 'chatEditing.viewAllSessionChanges'; }
269
+ constructor() {
270
+ super({
271
+ id: ViewAllSessionChangesAction.ID,
272
+ title: ( localize2(5198, 'View All Changes')),
273
+ icon: Codicon.diffMultiple,
274
+ category: CHAT_CATEGORY,
275
+ precondition: ChatContextKeys.hasAgentSessionChanges,
276
+ menu: [
277
+ {
278
+ id: MenuId.ChatEditingSessionChangesToolbar,
279
+ group: 'navigation',
280
+ order: 10,
281
+ when: ChatContextKeys.hasAgentSessionChanges
282
+ }
283
+ ],
284
+ });
285
+ }
286
+ async run(accessor, sessionResource) {
287
+ const agentSessionsService = accessor.get(IAgentSessionsService);
288
+ const commandService = accessor.get(ICommandService);
289
+ if (!URI.isUri(sessionResource)) {
290
+ return;
291
+ }
292
+ const session = agentSessionsService.getSession(sessionResource);
293
+ const changes = session?.changes;
294
+ if (!(changes instanceof Array)) {
295
+ return;
296
+ }
297
+ const resources = ( changes
298
+ .filter(d => d.originalUri)
299
+ .map(d => ({ originalUri: d.originalUri, modifiedUri: d.modifiedUri })));
300
+ if (resources.length > 0) {
301
+ await commandService.executeCommand('_workbench.openMultiDiffEditor', {
302
+ multiDiffSourceUri: sessionResource.with({ scheme: sessionResource.scheme + '-worktree-changes' }),
303
+ title: ( localize(5199, 'All Session Changes')),
304
+ resources,
305
+ });
306
+ }
307
+ }
308
+ }
309
+ registerAction2(ViewAllSessionChangesAction);
310
+ async function restoreSnapshotWithConfirmation(accessor, item) {
311
+ const configurationService = accessor.get(IConfigurationService);
312
+ const dialogService = accessor.get(IDialogService);
313
+ const chatWidgetService = accessor.get(IChatWidgetService);
314
+ const widget = chatWidgetService.getWidgetBySessionResource(item.sessionResource);
315
+ const chatService = accessor.get(IChatService);
316
+ const chatModel = chatService.getSession(item.sessionResource);
317
+ if (!chatModel) {
318
+ return;
319
+ }
320
+ const session = chatModel.editingSession;
321
+ if (!session) {
322
+ return;
323
+ }
324
+ const requestId = isRequestVM(item) ? item.id :
325
+ isResponseVM(item) ? item.requestId : undefined;
326
+ if (requestId) {
327
+ const chatRequests = chatModel.getRequests();
328
+ const itemIndex = chatRequests.findIndex(request => request.id === requestId);
329
+ const editsToUndo = chatRequests.length - itemIndex;
330
+ const requestsToRemove = chatRequests.slice(itemIndex);
331
+ const requestIdsToRemove = ( new Set(( requestsToRemove.map(request => request.id))));
332
+ const entriesModifiedInRequestsToRemove = session.entries.get().filter((entry) => ( requestIdsToRemove.has(entry.lastModifyingRequestId))) ?? [];
333
+ const shouldPrompt = entriesModifiedInRequestsToRemove.length > 0 && configurationService.getValue('chat.editing.confirmEditRequestRemoval') === true;
334
+ let message;
335
+ if (editsToUndo === 1) {
336
+ if (entriesModifiedInRequestsToRemove.length === 1) {
337
+ message = ( localize(
338
+ 5200,
339
+ "This will remove your last request and undo the edits made to {0}. Do you want to proceed?",
340
+ basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
341
+ ));
342
+ }
343
+ else {
344
+ message = ( localize(
345
+ 5201,
346
+ "This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
347
+ entriesModifiedInRequestsToRemove.length
348
+ ));
349
+ }
350
+ }
351
+ else {
352
+ if (entriesModifiedInRequestsToRemove.length === 1) {
353
+ message = ( localize(
354
+ 5202,
355
+ "This will remove all subsequent requests and undo edits made to {0}. Do you want to proceed?",
356
+ basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
357
+ ));
358
+ }
359
+ else {
360
+ message = ( localize(
361
+ 5203,
362
+ "This will remove all subsequent requests and undo edits made to {0} files in your working set. Do you want to proceed?",
363
+ entriesModifiedInRequestsToRemove.length
364
+ ));
365
+ }
366
+ }
367
+ const confirmation = shouldPrompt
368
+ ? await dialogService.confirm({
369
+ title: editsToUndo === 1
370
+ ? ( localize(5204, "Do you want to undo your last edit?"))
371
+ : ( localize(5205, "Do you want to undo {0} edits?", editsToUndo)),
372
+ message: message,
373
+ primaryButton: ( localize(5206, "Yes")),
374
+ checkbox: { label: ( localize(5207, "Don't ask again")), checked: false },
375
+ type: 'info'
376
+ })
377
+ : { confirmed: true };
378
+ if (!confirmation.confirmed) {
379
+ widget?.viewModel?.model.setCheckpoint(undefined);
380
+ return;
381
+ }
382
+ if (confirmation.checkboxChecked) {
383
+ await configurationService.updateValue('chat.editing.confirmEditRequestRemoval', false);
384
+ }
385
+ const snapshotRequestId = chatRequests[itemIndex].id;
386
+ await session.restoreSnapshot(snapshotRequestId, undefined);
387
+ }
388
+ }
389
+ registerAction2(class RemoveAction extends Action2 {
390
+ constructor() {
391
+ super({
392
+ id: 'workbench.action.chat.undoEdits',
393
+ title: ( localize2(5208, "Undo Requests")),
394
+ f1: false,
395
+ category: CHAT_CATEGORY,
396
+ icon: Codicon.discard,
397
+ keybinding: {
398
+ primary: KeyCode.Delete,
399
+ mac: {
400
+ primary: KeyMod.CtrlCmd | KeyCode.Backspace,
401
+ },
402
+ when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
403
+ weight: KeybindingWeight.WorkbenchContrib,
404
+ },
405
+ menu: [
406
+ {
407
+ id: MenuId.ChatMessageTitle,
408
+ group: 'navigation',
409
+ order: 2,
410
+ when: ( ContextKeyExpr.and(( ( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'input')).negate()), ( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, false)), ( ChatContextKeys.lockedToCodingAgent.negate()))),
411
+ }
412
+ ]
413
+ });
414
+ }
415
+ async run(accessor, ...args) {
416
+ let item = args[0];
417
+ const chatWidgetService = accessor.get(IChatWidgetService);
418
+ const configurationService = accessor.get(IConfigurationService);
419
+ const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
420
+ if (!isResponseVM(item) && !isRequestVM(item)) {
421
+ item = widget?.getFocus();
422
+ }
423
+ if (!item) {
424
+ return;
425
+ }
426
+ await restoreSnapshotWithConfirmation(accessor, item);
427
+ if (isRequestVM(item) && configurationService.getValue('chat.undoRequests.restoreInput')) {
428
+ widget?.focusInput();
429
+ widget?.input.setValue(item.messageText, false);
430
+ }
431
+ }
432
+ });
433
+ registerAction2(class RestoreCheckpointAction extends Action2 {
434
+ constructor() {
435
+ super({
436
+ id: 'workbench.action.chat.restoreCheckpoint',
437
+ title: ( localize2(5209, "Restore Checkpoint")),
438
+ tooltip: ( localize2(5210, "Restores workspace and chat to this point")),
439
+ f1: false,
440
+ category: CHAT_CATEGORY,
441
+ keybinding: {
442
+ primary: KeyCode.Delete,
443
+ mac: {
444
+ primary: KeyMod.CtrlCmd | KeyCode.Backspace,
445
+ },
446
+ when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
447
+ weight: KeybindingWeight.WorkbenchContrib,
448
+ },
449
+ menu: [
450
+ {
451
+ id: MenuId.ChatMessageCheckpoint,
452
+ group: 'navigation',
453
+ order: 2,
454
+ when: ( ContextKeyExpr.and(ChatContextKeys.isRequest, ( ChatContextKeys.lockedToCodingAgent.negate())))
455
+ }
456
+ ]
457
+ });
458
+ }
459
+ async run(accessor, ...args) {
460
+ let item = args[0];
461
+ const chatWidgetService = accessor.get(IChatWidgetService);
462
+ const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
463
+ if (!isResponseVM(item) && !isRequestVM(item)) {
464
+ item = widget?.getFocus();
465
+ }
466
+ if (!item) {
467
+ return;
468
+ }
469
+ if (isRequestVM(item)) {
470
+ widget?.focusInput();
471
+ widget?.input.setValue(item.messageText, false);
472
+ }
473
+ widget?.viewModel?.model.setCheckpoint(item.id);
474
+ await restoreSnapshotWithConfirmation(accessor, item);
475
+ }
476
+ });
477
+ registerAction2(class RestoreLastCheckpoint extends Action2 {
478
+ constructor() {
479
+ super({
480
+ id: 'workbench.action.chat.restoreLastCheckpoint',
481
+ title: ( localize2(5211, "Restore to Last Checkpoint")),
482
+ f1: false,
483
+ category: CHAT_CATEGORY,
484
+ icon: Codicon.discard,
485
+ menu: [
486
+ {
487
+ id: MenuId.ChatMessageFooter,
488
+ group: 'navigation',
489
+ order: 1,
490
+ when: ( ContextKeyExpr.and(
491
+ ContextKeyExpr.in(ChatContextKeys.itemId.key, ChatContextKeys.lastItemId.key),
492
+ ( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, true)),
493
+ ( ChatContextKeys.lockedToCodingAgent.negate())
494
+ )),
495
+ }
496
+ ]
497
+ });
498
+ }
499
+ async run(accessor, ...args) {
500
+ let item = args[0];
501
+ const chatWidgetService = accessor.get(IChatWidgetService);
502
+ const chatService = accessor.get(IChatService);
503
+ const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
504
+ if (!isResponseVM(item) && !isRequestVM(item)) {
505
+ item = widget?.getFocus();
506
+ }
507
+ if (!item) {
508
+ return;
509
+ }
510
+ const chatModel = chatService.getSession(item.sessionResource);
511
+ if (!chatModel) {
512
+ return;
513
+ }
514
+ const session = chatModel.editingSession;
515
+ if (!session) {
516
+ return;
517
+ }
518
+ await restoreSnapshotWithConfirmation(accessor, item);
519
+ if (isResponseVM(item)) {
520
+ widget?.viewModel?.model.setCheckpoint(item.requestId);
521
+ const request = chatModel.getRequests().find(request => request.id === item.requestId);
522
+ if (request) {
523
+ widget?.focusInput();
524
+ widget?.input.setValue(request.message.text, false);
525
+ }
526
+ }
527
+ }
528
+ });
529
+ registerAction2(class EditAction extends Action2 {
530
+ constructor() {
531
+ super({
532
+ id: 'workbench.action.chat.editRequests',
533
+ title: ( localize2(5212, "Edit Request")),
534
+ f1: false,
535
+ category: CHAT_CATEGORY,
536
+ icon: Codicon.edit,
537
+ keybinding: {
538
+ primary: KeyCode.Enter,
539
+ when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
540
+ weight: KeybindingWeight.WorkbenchContrib,
541
+ },
542
+ menu: [
543
+ {
544
+ id: MenuId.ChatMessageTitle,
545
+ group: 'navigation',
546
+ order: 2,
547
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'hover')), ( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'input'))))))
548
+ }
549
+ ]
550
+ });
551
+ }
552
+ async run(accessor, ...args) {
553
+ let item = args[0];
554
+ const chatWidgetService = accessor.get(IChatWidgetService);
555
+ const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
556
+ if (!isResponseVM(item) && !isRequestVM(item)) {
557
+ item = widget?.getFocus();
558
+ }
559
+ if (!item) {
560
+ return;
561
+ }
562
+ if (isRequestVM(item)) {
563
+ widget?.startEditing(item.id);
564
+ }
565
+ }
566
+ });
567
+ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
568
+ static { this.id = 'chat.openFileUpdatedBySnapshot'; }
569
+ constructor() {
570
+ super({
571
+ id: OpenWorkingSetHistoryAction.id,
572
+ title: ( localize(5213, "Open File")),
573
+ menu: [{
574
+ id: MenuId.ChatEditingCodeBlockContext,
575
+ group: 'navigation',
576
+ order: 0,
577
+ },]
578
+ });
579
+ }
580
+ async run(accessor, ...args) {
581
+ const context = args[0];
582
+ if (!context?.sessionResource) {
583
+ return;
584
+ }
585
+ const editorService = accessor.get(IEditorService);
586
+ await editorService.openEditor({ resource: context.uri });
587
+ }
588
+ });
589
+ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
590
+ static { this.id = 'chat.openFileSnapshot'; }
591
+ constructor() {
592
+ super({
593
+ id: OpenWorkingSetHistoryAction.id,
594
+ title: ( localize(5214, "Open File Snapshot")),
595
+ menu: [{
596
+ id: MenuId.ChatEditingCodeBlockContext,
597
+ group: 'navigation',
598
+ order: 1,
599
+ },]
600
+ });
601
+ }
602
+ async run(accessor, ...args) {
603
+ const context = args[0];
604
+ if (!context?.sessionResource) {
605
+ return;
606
+ }
607
+ const chatService = accessor.get(IChatService);
608
+ const chatEditingService = accessor.get(IChatEditingService);
609
+ const editorService = accessor.get(IEditorService);
610
+ const chatModel = chatService.getSession(context.sessionResource);
611
+ if (!chatModel) {
612
+ return;
613
+ }
614
+ const snapshot = chatEditingService.getEditingSession(chatModel.sessionResource)?.getSnapshotUri(context.requestId, context.uri, context.stopId);
615
+ if (snapshot) {
616
+ const editor = await editorService.openEditor({ resource: snapshot, label: ( localize(5215, '{0} (Snapshot)', basename(context.uri))), options: { activation: EditorActivation.ACTIVATE } });
617
+ if (isCodeEditor(editor)) {
618
+ editor.updateOptions({ readOnly: true });
619
+ }
620
+ }
621
+ }
622
+ });
623
+ registerAction2(class ResolveSymbolsContextAction extends EditingSessionAction {
624
+ constructor() {
625
+ super({
626
+ id: 'workbench.action.edits.addFilesFromReferences',
627
+ title: ( localize2(5216, "Add Files From References")),
628
+ f1: false,
629
+ category: CHAT_CATEGORY,
630
+ menu: {
631
+ id: MenuId.ChatInputSymbolAttachmentContext,
632
+ group: 'navigation',
633
+ order: 1,
634
+ when: ( ContextKeyExpr.and(( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Ask)), EditorContextKeys.hasReferenceProvider))
635
+ }
636
+ });
637
+ }
638
+ async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
639
+ if (args.length === 0 || !isLocation(args[0])) {
640
+ return;
641
+ }
642
+ const textModelService = accessor.get(ITextModelService);
643
+ const languageFeaturesService = accessor.get(ILanguageFeaturesService);
644
+ const symbol = args[0];
645
+ const modelReference = await textModelService.createModelReference(symbol.uri);
646
+ const textModel = modelReference.object.textEditorModel;
647
+ if (!textModel) {
648
+ return;
649
+ }
650
+ const position = ( new Position(symbol.range.startLineNumber, symbol.range.startColumn));
651
+ const [references, definitions, implementations] = await Promise.all([
652
+ this.getReferences(position, textModel, languageFeaturesService),
653
+ this.getDefinitions(position, textModel, languageFeaturesService),
654
+ this.getImplementations(position, textModel, languageFeaturesService)
655
+ ]);
656
+ const attachments = [];
657
+ for (const reference of [...definitions, ...implementations, ...references]) {
658
+ attachments.push(chatWidget.attachmentModel.asFileVariableEntry(reference.uri));
659
+ }
660
+ chatWidget.attachmentModel.addContext(...attachments);
661
+ }
662
+ async getReferences(position, textModel, languageFeaturesService) {
663
+ const referenceProviders = languageFeaturesService.referenceProvider.all(textModel);
664
+ const references = await Promise.all(( referenceProviders.map(async (referenceProvider) => {
665
+ return (await referenceProvider.provideReferences(textModel, position, { includeDeclaration: true }, CancellationToken.None)) ?? [];
666
+ })));
667
+ return references.flat();
668
+ }
669
+ async getDefinitions(position, textModel, languageFeaturesService) {
670
+ const definitionProviders = languageFeaturesService.definitionProvider.all(textModel);
671
+ const definitions = await Promise.all(( definitionProviders.map(async (definitionProvider) => {
672
+ return (await definitionProvider.provideDefinition(textModel, position, CancellationToken.None)) ?? [];
673
+ })));
674
+ return definitions.flat();
675
+ }
676
+ async getImplementations(position, textModel, languageFeaturesService) {
677
+ const implementationProviders = languageFeaturesService.implementationProvider.all(textModel);
678
+ const implementations = await Promise.all(( implementationProviders.map(async (implementationProvider) => {
679
+ return (await implementationProvider.provideImplementation(textModel, position, CancellationToken.None)) ?? [];
680
+ })));
681
+ return implementations.flat();
682
+ }
683
+ });
684
+ class ViewPreviousEditsAction extends EditingSessionAction {
685
+ static { this.Id = 'chatEditing.viewPreviousEdits'; }
686
+ static { this.Label = ( localize(5217, 'View Previous Edits')); }
687
+ constructor() {
688
+ super({
689
+ id: ViewPreviousEditsAction.Id,
690
+ title: { value: ViewPreviousEditsAction.Label, original: ViewPreviousEditsAction.Label },
691
+ tooltip: ViewPreviousEditsAction.Label,
692
+ f1: true,
693
+ icon: Codicon.diffMultiple,
694
+ precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( hasUndecidedChatEditingResourceContextKey.negate()))),
695
+ menu: [
696
+ {
697
+ id: MenuId.ChatEditingWidgetToolbar,
698
+ group: 'navigation',
699
+ order: 4,
700
+ when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasAppliedChatEditsContextKey, ( hasUndecidedChatEditingResourceContextKey.negate())))))
701
+ }
702
+ ],
703
+ });
704
+ }
705
+ async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
706
+ await editingSession.show(true);
707
+ }
708
+ }
709
+ registerAction2(ViewPreviousEditsAction);
710
+ CommandsRegistry.registerCommand('_chat.editSessions.accept', async (accessor, resources) => {
711
+ if (resources.length === 0) {
712
+ return;
713
+ }
714
+ const uris = ( resources.map(resource => URI.revive(resource)));
715
+ const chatEditingService = accessor.get(IChatEditingService);
716
+ for (const editingSession of chatEditingService.editingSessionsObs.get()) {
717
+ await editingSession.accept(...uris);
718
+ }
719
+ });
720
+
721
+ export { ChatEditingAcceptAllAction, ChatEditingDiscardAllAction, ChatEditingShowChangesAction, EditingSessionAction, ViewAllSessionChangesAction, ViewPreviousEditsAction, discardAllEditsWithConfirmation, getEditingSessionContext };