@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,364 @@
1
+
2
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
3
+ import { marked } from 'marked';
4
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
5
+ import { IBulkEditService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service';
6
+ import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
+ import { registerAction2, Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
8
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
9
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
10
+ import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
11
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
12
+ import { ResourceNotebookCellEdit } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
13
+ import { MENU_INLINE_CHAT_WIDGET_SECONDARY } from '../../../inlineChat/common/inlineChat.js';
14
+ import { NOTEBOOK_EDITOR_ID, CellKind, CellEditType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
15
+ import { NOTEBOOK_IS_ACTIVE_EDITOR } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
16
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
17
+ import { applyingChatEditsFailedContextKey, isChatEditingActionContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
18
+ import { ChatAgentVoteDirection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService';
19
+ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
20
+ import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
21
+ import { ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
22
+ import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
23
+ import { CHAT_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
24
+
25
+ const MarkUnhelpfulActionId = 'workbench.action.chat.markUnhelpful';
26
+ const enableFeedbackConfig = 'config.telemetry.feedback.enabled';
27
+ function registerChatTitleActions() {
28
+ registerAction2(class MarkHelpfulAction extends Action2 {
29
+ constructor() {
30
+ super({
31
+ id: 'workbench.action.chat.markHelpful',
32
+ title: ( localize2(4784, "Helpful")),
33
+ f1: false,
34
+ category: CHAT_CATEGORY,
35
+ icon: Codicon.thumbsup,
36
+ toggled: ( ChatContextKeys.responseVote.isEqualTo('up')),
37
+ menu: [{
38
+ id: MenuId.ChatMessageFooter,
39
+ group: 'navigation',
40
+ order: 2,
41
+ when: ( ContextKeyExpr.and(
42
+ ChatContextKeys.extensionParticipantRegistered,
43
+ ChatContextKeys.isResponse,
44
+ ( ChatContextKeys.responseHasError.negate()),
45
+ ( ContextKeyExpr.has(enableFeedbackConfig))
46
+ ))
47
+ }, {
48
+ id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
49
+ group: 'navigation',
50
+ order: 1,
51
+ when: ( ContextKeyExpr.and(
52
+ ChatContextKeys.extensionParticipantRegistered,
53
+ ChatContextKeys.isResponse,
54
+ ( ChatContextKeys.responseHasError.negate()),
55
+ ( ContextKeyExpr.has(enableFeedbackConfig))
56
+ ))
57
+ }]
58
+ });
59
+ }
60
+ run(accessor, ...args) {
61
+ const item = args[0];
62
+ if (!isResponseVM(item)) {
63
+ return;
64
+ }
65
+ const chatService = accessor.get(IChatService);
66
+ chatService.notifyUserAction({
67
+ agentId: item.agent?.id,
68
+ command: item.slashCommand?.name,
69
+ sessionResource: item.session.sessionResource,
70
+ requestId: item.requestId,
71
+ result: item.result,
72
+ action: {
73
+ kind: 'vote',
74
+ direction: ChatAgentVoteDirection.Up,
75
+ reason: undefined
76
+ }
77
+ });
78
+ item.setVote(ChatAgentVoteDirection.Up);
79
+ item.setVoteDownReason(undefined);
80
+ }
81
+ });
82
+ registerAction2(class MarkUnhelpfulAction extends Action2 {
83
+ constructor() {
84
+ super({
85
+ id: MarkUnhelpfulActionId,
86
+ title: ( localize2(4785, "Unhelpful")),
87
+ f1: false,
88
+ category: CHAT_CATEGORY,
89
+ icon: Codicon.thumbsdown,
90
+ toggled: ( ChatContextKeys.responseVote.isEqualTo('down')),
91
+ menu: [{
92
+ id: MenuId.ChatMessageFooter,
93
+ group: 'navigation',
94
+ order: 3,
95
+ when: ( ContextKeyExpr.and(
96
+ ChatContextKeys.extensionParticipantRegistered,
97
+ ChatContextKeys.isResponse,
98
+ ( ContextKeyExpr.has(enableFeedbackConfig))
99
+ ))
100
+ }, {
101
+ id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
102
+ group: 'navigation',
103
+ order: 2,
104
+ when: ( ContextKeyExpr.and(
105
+ ChatContextKeys.extensionParticipantRegistered,
106
+ ChatContextKeys.isResponse,
107
+ ( ChatContextKeys.responseHasError.negate()),
108
+ ( ContextKeyExpr.has(enableFeedbackConfig))
109
+ ))
110
+ }]
111
+ });
112
+ }
113
+ run(accessor, ...args) {
114
+ const item = args[0];
115
+ if (!isResponseVM(item)) {
116
+ return;
117
+ }
118
+ const reason = args[1];
119
+ if (typeof reason !== 'string') {
120
+ return;
121
+ }
122
+ item.setVote(ChatAgentVoteDirection.Down);
123
+ item.setVoteDownReason(reason);
124
+ const chatService = accessor.get(IChatService);
125
+ chatService.notifyUserAction({
126
+ agentId: item.agent?.id,
127
+ command: item.slashCommand?.name,
128
+ sessionResource: item.session.sessionResource,
129
+ requestId: item.requestId,
130
+ result: item.result,
131
+ action: {
132
+ kind: 'vote',
133
+ direction: ChatAgentVoteDirection.Down,
134
+ reason: item.voteDownReason
135
+ }
136
+ });
137
+ }
138
+ });
139
+ registerAction2(class ReportIssueForBugAction extends Action2 {
140
+ constructor() {
141
+ super({
142
+ id: 'workbench.action.chat.reportIssueForBug',
143
+ title: ( localize2(4786, "Report Issue")),
144
+ f1: false,
145
+ category: CHAT_CATEGORY,
146
+ icon: Codicon.report,
147
+ menu: [{
148
+ id: MenuId.ChatMessageFooter,
149
+ group: 'navigation',
150
+ order: 4,
151
+ when: ( ContextKeyExpr.and(
152
+ ChatContextKeys.responseSupportsIssueReporting,
153
+ ChatContextKeys.isResponse,
154
+ ( ContextKeyExpr.has(enableFeedbackConfig))
155
+ ))
156
+ }, {
157
+ id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
158
+ group: 'navigation',
159
+ order: 3,
160
+ when: ( ContextKeyExpr.and(
161
+ ChatContextKeys.responseSupportsIssueReporting,
162
+ ChatContextKeys.isResponse,
163
+ ( ContextKeyExpr.has(enableFeedbackConfig))
164
+ ))
165
+ }]
166
+ });
167
+ }
168
+ run(accessor, ...args) {
169
+ const item = args[0];
170
+ if (!isResponseVM(item)) {
171
+ return;
172
+ }
173
+ const chatService = accessor.get(IChatService);
174
+ chatService.notifyUserAction({
175
+ agentId: item.agent?.id,
176
+ command: item.slashCommand?.name,
177
+ sessionResource: item.session.sessionResource,
178
+ requestId: item.requestId,
179
+ result: item.result,
180
+ action: {
181
+ kind: 'bug'
182
+ }
183
+ });
184
+ }
185
+ });
186
+ registerAction2(class RetryChatAction extends Action2 {
187
+ constructor() {
188
+ super({
189
+ id: 'workbench.action.chat.retry',
190
+ title: ( localize2(4787, "Retry")),
191
+ f1: false,
192
+ category: CHAT_CATEGORY,
193
+ icon: Codicon.refresh,
194
+ menu: [
195
+ {
196
+ id: MenuId.ChatMessageFooter,
197
+ group: 'navigation',
198
+ when: ( ContextKeyExpr.and(
199
+ ChatContextKeys.isResponse,
200
+ ContextKeyExpr.in(ChatContextKeys.itemId.key, ChatContextKeys.lastItemId.key)
201
+ ))
202
+ },
203
+ {
204
+ id: MenuId.ChatEditingWidgetToolbar,
205
+ group: 'navigation',
206
+ when: applyingChatEditsFailedContextKey,
207
+ order: 0
208
+ }
209
+ ]
210
+ });
211
+ }
212
+ async run(accessor, ...args) {
213
+ const chatWidgetService = accessor.get(IChatWidgetService);
214
+ let item = args[0];
215
+ if (isChatEditingActionContext(item)) {
216
+ item = chatWidgetService.getWidgetBySessionResource(item.sessionResource)?.viewModel?.getItems().at(-1);
217
+ }
218
+ if (!isResponseVM(item)) {
219
+ return;
220
+ }
221
+ const chatService = accessor.get(IChatService);
222
+ const chatModel = chatService.getSession(item.sessionResource);
223
+ const chatRequests = chatModel?.getRequests();
224
+ if (!chatRequests) {
225
+ return;
226
+ }
227
+ const itemIndex = chatRequests?.findIndex(request => request.id === item.requestId);
228
+ const widget = chatWidgetService.getWidgetBySessionResource(item.sessionResource);
229
+ const mode = widget?.input.currentModeKind;
230
+ if (chatModel && (mode === ChatModeKind.Edit || mode === ChatModeKind.Agent)) {
231
+ const configurationService = accessor.get(IConfigurationService);
232
+ const dialogService = accessor.get(IDialogService);
233
+ const currentEditingSession = widget?.viewModel?.model.editingSession;
234
+ if (!currentEditingSession) {
235
+ return;
236
+ }
237
+ const entriesModifiedInLastRequest = currentEditingSession.entries.get().filter((entry) => entry.lastModifyingRequestId === item.requestId);
238
+ const shouldPrompt = entriesModifiedInLastRequest.length > 0 && configurationService.getValue('chat.editing.confirmEditRequestRetry') === true;
239
+ const confirmation = shouldPrompt
240
+ ? await dialogService.confirm({
241
+ title: ( localize(4788, "Do you want to retry your last request?")),
242
+ message: entriesModifiedInLastRequest.length === 1
243
+ ? ( localize(
244
+ 4789,
245
+ "This will undo edits made to {0} since this request.",
246
+ basename(entriesModifiedInLastRequest[0].modifiedURI)
247
+ ))
248
+ : ( localize(
249
+ 4790,
250
+ "This will undo edits made to {0} files in your working set since this request. Do you want to proceed?",
251
+ entriesModifiedInLastRequest.length
252
+ )),
253
+ primaryButton: ( localize(4791, "Yes")),
254
+ checkbox: { label: ( localize(4792, "Don't ask again")), checked: false },
255
+ type: 'info'
256
+ })
257
+ : { confirmed: true };
258
+ if (!confirmation.confirmed) {
259
+ return;
260
+ }
261
+ if (confirmation.checkboxChecked) {
262
+ await configurationService.updateValue('chat.editing.confirmEditRequestRetry', false);
263
+ }
264
+ const snapshotRequest = chatRequests[itemIndex];
265
+ if (snapshotRequest) {
266
+ await currentEditingSession.restoreSnapshot(snapshotRequest.id, undefined);
267
+ }
268
+ }
269
+ const request = chatModel?.getRequests().find(candidate => candidate.id === item.requestId);
270
+ const languageModelId = widget?.input.currentLanguageModel;
271
+ chatService.resendRequest(request, {
272
+ userSelectedModelId: languageModelId,
273
+ attempt: (request?.attempt ?? -1) + 1,
274
+ ...widget?.getModeRequestOptions(),
275
+ });
276
+ }
277
+ });
278
+ registerAction2(class InsertToNotebookAction extends Action2 {
279
+ constructor() {
280
+ super({
281
+ id: 'workbench.action.chat.insertIntoNotebook',
282
+ title: ( localize2(4793, "Insert into Notebook")),
283
+ f1: false,
284
+ category: CHAT_CATEGORY,
285
+ icon: Codicon.insert,
286
+ menu: {
287
+ id: MenuId.ChatMessageFooter,
288
+ group: 'navigation',
289
+ isHiddenByDefault: true,
290
+ when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ChatContextKeys.isResponse, ( ChatContextKeys.responseIsFiltered.negate())))
291
+ }
292
+ });
293
+ }
294
+ async run(accessor, ...args) {
295
+ const item = args[0];
296
+ if (!isResponseVM(item)) {
297
+ return;
298
+ }
299
+ const editorService = accessor.get(IEditorService);
300
+ if (editorService.activeEditorPane?.getId() === NOTEBOOK_EDITOR_ID) {
301
+ const notebookEditor = editorService.activeEditorPane.getControl();
302
+ if (!notebookEditor.hasModel()) {
303
+ return;
304
+ }
305
+ if (notebookEditor.isReadOnly) {
306
+ return;
307
+ }
308
+ const value = ( item.response.toString());
309
+ const splitContents = splitMarkdownAndCodeBlocks(value);
310
+ const focusRange = notebookEditor.getFocus();
311
+ const index = Math.max(focusRange.end, 0);
312
+ const bulkEditService = accessor.get(IBulkEditService);
313
+ await bulkEditService.apply([
314
+ ( new ResourceNotebookCellEdit(notebookEditor.textModel.uri, {
315
+ editType: CellEditType.Replace,
316
+ index: index,
317
+ count: 0,
318
+ cells: ( splitContents.map(content => {
319
+ const kind = content.type === 'markdown' ? CellKind.Markup : CellKind.Code;
320
+ const language = content.type === 'markdown' ? 'markdown' : content.language;
321
+ const mime = content.type === 'markdown' ? 'text/markdown' : `text/x-${content.language}`;
322
+ return {
323
+ cellKind: kind,
324
+ language,
325
+ mime,
326
+ source: content.content,
327
+ outputs: [],
328
+ metadata: {}
329
+ };
330
+ }))
331
+ }))
332
+ ], { quotableLabel: 'Insert into Notebook' });
333
+ }
334
+ }
335
+ });
336
+ }
337
+ function splitMarkdownAndCodeBlocks(markdown) {
338
+ const lexer = new marked.Lexer();
339
+ const tokens = lexer.lex(markdown);
340
+ const splitContent = [];
341
+ let markdownPart = '';
342
+ tokens.forEach((token) => {
343
+ if (token.type === 'code') {
344
+ if (markdownPart.trim()) {
345
+ splitContent.push({ type: 'markdown', content: markdownPart });
346
+ markdownPart = '';
347
+ }
348
+ splitContent.push({
349
+ type: 'code',
350
+ language: token.lang || '',
351
+ content: token.text,
352
+ });
353
+ }
354
+ else {
355
+ markdownPart += token.raw;
356
+ }
357
+ });
358
+ if (markdownPart.trim()) {
359
+ splitContent.push({ type: 'markdown', content: markdownPart });
360
+ }
361
+ return splitContent;
362
+ }
363
+
364
+ export { MarkUnhelpfulActionId, registerChatTitleActions };
@@ -0,0 +1,38 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
3
+ import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
4
+ import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
5
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
6
+ import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
7
+ import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service";
8
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
9
+ import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
10
+ import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
11
+ import { ResourceLabels } from "@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels";
12
+ import { IChatRequestImplicitVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries";
13
+ import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
14
+ import { ChatAttachmentModel } from "../chatAttachmentModel.js";
15
+ import { IChatContextService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextService.service";
16
+ export declare class ImplicitContextAttachmentWidget extends Disposable {
17
+ private readonly widgetRef;
18
+ private readonly attachment;
19
+ private readonly resourceLabels;
20
+ private readonly attachmentModel;
21
+ private readonly contextKeyService;
22
+ private readonly contextMenuService;
23
+ private readonly labelService;
24
+ private readonly menuService;
25
+ private readonly fileService;
26
+ private readonly languageService;
27
+ private readonly modelService;
28
+ private readonly hoverService;
29
+ private readonly configService;
30
+ private readonly chatContextService;
31
+ readonly domNode: HTMLElement;
32
+ private readonly renderDisposables;
33
+ constructor(widgetRef: () => IChatWidget | undefined, attachment: IChatRequestImplicitVariableEntry, resourceLabels: ResourceLabels, attachmentModel: ChatAttachmentModel, contextKeyService: IContextKeyService, contextMenuService: IContextMenuService, labelService: ILabelService, menuService: IMenuService, fileService: IFileService, languageService: ILanguageService, modelService: IModelService, hoverService: IHoverService, configService: IConfigurationService, chatContextService: IChatContextService);
34
+ private render;
35
+ private renderString;
36
+ private renderResource;
37
+ private convertToRegularAttachment;
38
+ }
@@ -0,0 +1,207 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { $, clearNode, addDisposableListener, EventType, getWindow, EventHelper } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
5
+ import { StandardMouseEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/mouseEvent';
6
+ import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
7
+ import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
8
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
9
+ import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
10
+ import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
11
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
12
+ import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
13
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
14
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
15
+ import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
16
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
17
+ import { getFlatContextMenuActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
18
+ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
19
+ import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
20
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
21
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
22
+ import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
23
+ import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
24
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
25
+ import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
26
+ import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
27
+ import { ResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
28
+ import { isStringImplicitContextValue } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries';
29
+ import { IChatContextService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextService.service';
30
+
31
+ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget extends Disposable {
32
+ constructor(widgetRef, attachment, resourceLabels, attachmentModel, contextKeyService, contextMenuService, labelService, menuService, fileService, languageService, modelService, hoverService, configService, chatContextService) {
33
+ super();
34
+ this.widgetRef = widgetRef;
35
+ this.attachment = attachment;
36
+ this.resourceLabels = resourceLabels;
37
+ this.attachmentModel = attachmentModel;
38
+ this.contextKeyService = contextKeyService;
39
+ this.contextMenuService = contextMenuService;
40
+ this.labelService = labelService;
41
+ this.menuService = menuService;
42
+ this.fileService = fileService;
43
+ this.languageService = languageService;
44
+ this.modelService = modelService;
45
+ this.hoverService = hoverService;
46
+ this.configService = configService;
47
+ this.chatContextService = chatContextService;
48
+ this.renderDisposables = this._register(( new DisposableStore()));
49
+ this.domNode = $('.chat-attached-context-attachment.show-file-icons.implicit');
50
+ this.render();
51
+ }
52
+ render() {
53
+ clearNode(this.domNode);
54
+ this.renderDisposables.clear();
55
+ this.domNode.classList.toggle('disabled', !this.attachment.enabled);
56
+ const label = this.resourceLabels.create(this.domNode, { supportIcons: true });
57
+ const file = this.attachment.uri;
58
+ const attachmentTypeName = file?.scheme === Schemas.vscodeNotebookCell ? ( localize(4875, "cell")) : ( localize(4876, "file"));
59
+ let title;
60
+ if (isStringImplicitContextValue(this.attachment.value)) {
61
+ title = this.renderString(label);
62
+ }
63
+ else {
64
+ title = this.renderResource(this.attachment.value, label);
65
+ }
66
+ const isSuggestedEnabled = this.configService.getValue('chat.implicitContext.suggestedContext');
67
+ this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), this.domNode, title));
68
+ if (isSuggestedEnabled) {
69
+ if (!this.attachment.isSelection) {
70
+ const buttonMsg = this.attachment.enabled ? ( localize(4877, "Disable current {0} context", attachmentTypeName)) : '';
71
+ const toggleButton = this.renderDisposables.add(( new Button(this.domNode, { supportIcons: true, title: buttonMsg })));
72
+ toggleButton.icon = this.attachment.enabled ? Codicon.x : Codicon.plus;
73
+ this.renderDisposables.add(toggleButton.onDidClick(async (e) => {
74
+ e.stopPropagation();
75
+ e.preventDefault();
76
+ if (!this.attachment.enabled) {
77
+ await this.convertToRegularAttachment();
78
+ }
79
+ this.attachment.enabled = false;
80
+ }));
81
+ }
82
+ if (!this.attachment.enabled && this.attachment.isSelection) {
83
+ this.domNode.classList.remove('disabled');
84
+ }
85
+ this.renderDisposables.add(addDisposableListener(this.domNode, EventType.CLICK, async (e) => {
86
+ if (!this.attachment.enabled && !this.attachment.isSelection) {
87
+ await this.convertToRegularAttachment();
88
+ }
89
+ }));
90
+ this.renderDisposables.add(addDisposableListener(this.domNode, EventType.KEY_DOWN, async (e) => {
91
+ const event = ( new StandardKeyboardEvent(e));
92
+ if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
93
+ if (!this.attachment.enabled && !this.attachment.isSelection) {
94
+ e.preventDefault();
95
+ e.stopPropagation();
96
+ await this.convertToRegularAttachment();
97
+ }
98
+ }
99
+ }));
100
+ }
101
+ else {
102
+ const buttonMsg = this.attachment.enabled ? ( localize(4877, "Disable current {0} context", attachmentTypeName)) : ( localize(4878, "Enable current {0} context", attachmentTypeName));
103
+ const toggleButton = this.renderDisposables.add(( new Button(this.domNode, { supportIcons: true, title: buttonMsg })));
104
+ toggleButton.icon = this.attachment.enabled ? Codicon.eye : Codicon.eyeClosed;
105
+ this.renderDisposables.add(toggleButton.onDidClick((e) => {
106
+ e.stopPropagation();
107
+ this.attachment.enabled = !this.attachment.enabled;
108
+ }));
109
+ }
110
+ const scopedContextKeyService = this.renderDisposables.add(this.contextKeyService.createScoped(this.domNode));
111
+ const resourceContextKey = this.renderDisposables.add(( new ResourceContextKey(
112
+ scopedContextKeyService,
113
+ this.fileService,
114
+ this.languageService,
115
+ this.modelService
116
+ )));
117
+ resourceContextKey.set(file);
118
+ this.renderDisposables.add(addDisposableListener(this.domNode, EventType.CONTEXT_MENU, async (domEvent) => {
119
+ const event = ( new StandardMouseEvent(getWindow(domEvent), domEvent));
120
+ EventHelper.stop(domEvent, true);
121
+ this.contextMenuService.showContextMenu({
122
+ contextKeyService: scopedContextKeyService,
123
+ getAnchor: () => event,
124
+ getActions: () => {
125
+ const menu = this.menuService.getMenuActions(MenuId.ChatInputResourceAttachmentContext, scopedContextKeyService, { arg: file });
126
+ return getFlatContextMenuActions(menu);
127
+ },
128
+ });
129
+ }));
130
+ }
131
+ renderString(resourceLabel) {
132
+ const label = this.attachment.name;
133
+ const icon = this.attachment.icon;
134
+ const title = ( localize(4879, "Current file context"));
135
+ resourceLabel.setLabel(label, undefined, { iconPath: icon, title });
136
+ return title;
137
+ }
138
+ renderResource(attachmentValue, label) {
139
+ const file = URI.isUri(attachmentValue) ? attachmentValue : attachmentValue.uri;
140
+ const range = URI.isUri(attachmentValue) || !this.attachment.isSelection ? undefined : attachmentValue.range;
141
+ const attachmentTypeName = file.scheme === Schemas.vscodeNotebookCell ? ( localize(4875, "cell")) : ( localize(4876, "file"));
142
+ const fileBasename = basename(file);
143
+ const fileDirname = dirname(file);
144
+ const friendlyName = `${fileBasename} ${fileDirname}`;
145
+ const ariaLabel = range ? ( localize(
146
+ 4880,
147
+ "Attached {0}, {1}, line {2} to line {3}",
148
+ attachmentTypeName,
149
+ friendlyName,
150
+ range.startLineNumber,
151
+ range.endLineNumber
152
+ )) : ( localize(4881, "Attached {0}, {1}", attachmentTypeName, friendlyName));
153
+ const uriLabel = this.labelService.getUriLabel(file, { relative: true });
154
+ const currentFile = ( localize(4882, "Current {0} context", attachmentTypeName));
155
+ const inactive = ( localize(4883, "Enable current {0} context", attachmentTypeName));
156
+ const currentFileHint = this.attachment.enabled || this.attachment.isSelection ? currentFile : inactive;
157
+ const title = `${currentFileHint}\n${uriLabel}`;
158
+ label.setFile(file, {
159
+ fileKind: FileKind.FILE,
160
+ hidePath: true,
161
+ range,
162
+ title
163
+ });
164
+ this.domNode.ariaLabel = ariaLabel;
165
+ this.domNode.tabIndex = 0;
166
+ return title;
167
+ }
168
+ async convertToRegularAttachment() {
169
+ if (!this.attachment.value) {
170
+ return;
171
+ }
172
+ if (isStringImplicitContextValue(this.attachment.value)) {
173
+ if (this.attachment.value.value === undefined) {
174
+ await this.chatContextService.resolveChatContext(this.attachment.value);
175
+ }
176
+ const context = {
177
+ kind: 'string',
178
+ value: this.attachment.value.value,
179
+ id: this.attachment.id,
180
+ name: this.attachment.name,
181
+ icon: this.attachment.value.icon,
182
+ modelDescription: this.attachment.value.modelDescription,
183
+ uri: this.attachment.value.uri
184
+ };
185
+ this.attachmentModel.addContext(context);
186
+ }
187
+ else {
188
+ const file = URI.isUri(this.attachment.value) ? this.attachment.value : this.attachment.value.uri;
189
+ this.attachmentModel.addFile(file);
190
+ }
191
+ this.widgetRef()?.focusInput();
192
+ }
193
+ };
194
+ ImplicitContextAttachmentWidget = ( __decorate([
195
+ ( __param(4, IContextKeyService)),
196
+ ( __param(5, IContextMenuService)),
197
+ ( __param(6, ILabelService)),
198
+ ( __param(7, IMenuService)),
199
+ ( __param(8, IFileService)),
200
+ ( __param(9, ILanguageService)),
201
+ ( __param(10, IModelService)),
202
+ ( __param(11, IHoverService)),
203
+ ( __param(12, IConfigurationService)),
204
+ ( __param(13, IChatContextService))
205
+ ], ImplicitContextAttachmentWidget));
206
+
207
+ export { ImplicitContextAttachmentWidget };
@@ -0,0 +1,17 @@
1
+ import { AriaRole } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria";
2
+ import { IListAccessibilityProvider } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/list/listWidget";
3
+ import { IAccessibleViewService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleView.service";
4
+ import { IInstantiationService, ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
5
+ import { IChatToolInvocation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
6
+ import { ChatTreeItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
7
+ export declare const getToolConfirmationAlert: (accessor: ServicesAccessor, toolInvocation: IChatToolInvocation[]) => string;
8
+ export declare class ChatAccessibilityProvider implements IListAccessibilityProvider<ChatTreeItem> {
9
+ private readonly _accessibleViewService;
10
+ private readonly _instantiationService;
11
+ constructor(_accessibleViewService: IAccessibleViewService, _instantiationService: IInstantiationService);
12
+ getWidgetRole(): AriaRole;
13
+ getRole(element: ChatTreeItem): AriaRole | undefined;
14
+ getWidgetAriaLabel(): string;
15
+ getAriaLabel(element: ChatTreeItem): string;
16
+ private _getLabelWithInfo;
17
+ }