@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,216 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { marked } from 'marked';
4
+ import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
5
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
6
+ import { IAccessibleViewService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleView.service';
7
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
8
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
10
+ import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
11
+ import { migrateLegacyTerminalToolSpecificData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
12
+ import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService';
13
+ import { isRequestVM, isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
14
+ import { toolContentToA11yString } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
15
+ import { CancelChatActionId } from './actions/chatExecuteActions.js';
16
+ import { AcceptToolConfirmationActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
17
+
18
+ const getToolConfirmationAlert = (accessor, toolInvocation) => {
19
+ const keybindingService = accessor.get(IKeybindingService);
20
+ const contextKeyService = accessor.get(IContextKeyService);
21
+ const acceptKb = keybindingService.lookupKeybinding(AcceptToolConfirmationActionId, contextKeyService)?.getAriaLabel();
22
+ const cancelKb = keybindingService.lookupKeybinding(CancelChatActionId, contextKeyService)?.getAriaLabel();
23
+ const text = ( toolInvocation.map(v => {
24
+ const state = v.state.get();
25
+ if (state.type === IChatToolInvocation.StateKind.WaitingForPostApproval) {
26
+ return {
27
+ title: ( localize(4991, "Approve results of tool")),
28
+ detail: toolContentToA11yString(state.contentForModel),
29
+ };
30
+ }
31
+ if (!(v.confirmationMessages?.message && state.type === IChatToolInvocation.StateKind.WaitingForConfirmation)) {
32
+ return;
33
+ }
34
+ let input = '';
35
+ if (v.toolSpecificData) {
36
+ if (v.toolSpecificData.kind === 'terminal') {
37
+ const terminalData = migrateLegacyTerminalToolSpecificData(v.toolSpecificData);
38
+ input = terminalData.commandLine.toolEdited ?? terminalData.commandLine.original;
39
+ }
40
+ else if (v.toolSpecificData.kind === 'extensions') {
41
+ input = JSON.stringify(v.toolSpecificData.extensions);
42
+ }
43
+ else if (v.toolSpecificData.kind === 'input') {
44
+ input = JSON.stringify(v.toolSpecificData.rawInput);
45
+ }
46
+ }
47
+ const titleObj = v.confirmationMessages?.title;
48
+ const title = typeof titleObj === 'string' ? titleObj : titleObj?.value || '';
49
+ return {
50
+ title: (title + (input ? ': ' + input : '')).trim(),
51
+ detail: undefined,
52
+ };
53
+ })).filter(isDefined);
54
+ let message = acceptKb && cancelKb
55
+ ? ( localize(
56
+ 4992,
57
+ "Chat confirmation required: {0}. Press {1} to accept or {2} to cancel.",
58
+ ( text.map(t => t.title)).join(', '),
59
+ acceptKb,
60
+ cancelKb
61
+ ))
62
+ : ( localize(
63
+ 4993,
64
+ "Chat confirmation required: {0}",
65
+ ( text.map(t => t.title)).join(', ')
66
+ ));
67
+ if (( text.some(t => t.detail))) {
68
+ message += ' ' + ( localize(4994, "Details: {0}", ( text.map(t => t.detail ? t.detail : '')).join(' ')));
69
+ }
70
+ return message;
71
+ };
72
+ let ChatAccessibilityProvider = class ChatAccessibilityProvider {
73
+ constructor(_accessibleViewService, _instantiationService) {
74
+ this._accessibleViewService = _accessibleViewService;
75
+ this._instantiationService = _instantiationService;
76
+ }
77
+ getWidgetRole() {
78
+ return 'list';
79
+ }
80
+ getRole(element) {
81
+ return 'listitem';
82
+ }
83
+ getWidgetAriaLabel() {
84
+ return localize(4995, "Chat");
85
+ }
86
+ getAriaLabel(element) {
87
+ if (isRequestVM(element)) {
88
+ return element.messageText;
89
+ }
90
+ if (isResponseVM(element)) {
91
+ return this._getLabelWithInfo(element);
92
+ }
93
+ return '';
94
+ }
95
+ _getLabelWithInfo(element) {
96
+ const accessibleViewHint = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.Chat);
97
+ let label = '';
98
+ const toolInvocation = element.response.value.filter(v => v.kind === 'toolInvocation');
99
+ let toolInvocationHint = '';
100
+ if (toolInvocation.length) {
101
+ const waitingForConfirmation = toolInvocation.filter(v => {
102
+ const state = v.state.get().type;
103
+ return state === IChatToolInvocation.StateKind.WaitingForConfirmation || state === IChatToolInvocation.StateKind.WaitingForPostApproval;
104
+ });
105
+ if (waitingForConfirmation.length) {
106
+ toolInvocationHint = this._instantiationService.invokeFunction(getToolConfirmationAlert, toolInvocation);
107
+ }
108
+ }
109
+ const tableCount = marked.lexer(( element.response.toString())).filter(token => token.type === 'table')?.length ?? 0;
110
+ let tableCountHint = '';
111
+ switch (tableCount) {
112
+ case 0:
113
+ break;
114
+ case 1:
115
+ tableCountHint = ( localize(4996, "1 table "));
116
+ break;
117
+ default:
118
+ tableCountHint = ( localize(4997, "{0} tables ", tableCount));
119
+ break;
120
+ }
121
+ const fileTreeCount = element.response.value.filter(v => v.kind === 'treeData').length ?? 0;
122
+ let fileTreeCountHint = '';
123
+ switch (fileTreeCount) {
124
+ case 0:
125
+ break;
126
+ case 1:
127
+ fileTreeCountHint = ( localize(4998, "1 file tree "));
128
+ break;
129
+ default:
130
+ fileTreeCountHint = ( localize(4999, "{0} file trees ", fileTreeCount));
131
+ break;
132
+ }
133
+ const elicitationCount = element.response.value.filter(v => v.kind === 'elicitation2' || v.kind === 'elicitationSerialized');
134
+ let elicitationHint = '';
135
+ for (const elicitation of elicitationCount) {
136
+ const title = typeof elicitation.title === 'string' ? elicitation.title : elicitation.title.value;
137
+ const message = typeof elicitation.message === 'string' ? elicitation.message : elicitation.message.value;
138
+ elicitationHint += title + ' ' + message;
139
+ }
140
+ const codeBlockCount = marked.lexer(( element.response.toString())).filter(token => token.type === 'code')?.length ?? 0;
141
+ switch (codeBlockCount) {
142
+ case 0:
143
+ label = accessibleViewHint
144
+ ? ( localize(
145
+ 5000,
146
+ "{0}{1}{2}{3}{4} {5}",
147
+ toolInvocationHint,
148
+ fileTreeCountHint,
149
+ elicitationHint,
150
+ tableCountHint,
151
+ (element.response.toString()),
152
+ accessibleViewHint
153
+ ))
154
+ : ( localize(
155
+ 5001,
156
+ "{0}{1}{2} {3}",
157
+ fileTreeCountHint,
158
+ elicitationHint,
159
+ tableCountHint,
160
+ (element.response.toString())
161
+ ));
162
+ break;
163
+ case 1:
164
+ label = accessibleViewHint
165
+ ? ( localize(
166
+ 5002,
167
+ "{0}{1}{2}1 code block: {3} {4}{5}",
168
+ toolInvocationHint,
169
+ fileTreeCountHint,
170
+ elicitationHint,
171
+ tableCountHint,
172
+ (element.response.toString()),
173
+ accessibleViewHint
174
+ ))
175
+ : ( localize(
176
+ 5003,
177
+ "{0}{1}1 code block: {2} {3}",
178
+ fileTreeCountHint,
179
+ elicitationHint,
180
+ tableCountHint,
181
+ (element.response.toString())
182
+ ));
183
+ break;
184
+ default:
185
+ label = accessibleViewHint
186
+ ? ( localize(
187
+ 5004,
188
+ "{0}{1}{2}{3} code blocks: {4}{5} {6}",
189
+ toolInvocationHint,
190
+ fileTreeCountHint,
191
+ elicitationHint,
192
+ tableCountHint,
193
+ codeBlockCount,
194
+ (element.response.toString()),
195
+ accessibleViewHint
196
+ ))
197
+ : ( localize(
198
+ 5005,
199
+ "{0}{1}{2} code blocks: {3} {4}",
200
+ fileTreeCountHint,
201
+ elicitationHint,
202
+ codeBlockCount,
203
+ tableCountHint,
204
+ (element.response.toString())
205
+ ));
206
+ break;
207
+ }
208
+ return label;
209
+ }
210
+ };
211
+ ChatAccessibilityProvider = ( __decorate([
212
+ ( __param(0, IAccessibleViewService)),
213
+ ( __param(1, IInstantiationService))
214
+ ], ChatAccessibilityProvider));
215
+
216
+ export { ChatAccessibilityProvider, getToolConfirmationAlert };
@@ -0,0 +1,24 @@
1
+ import { IManagedHoverOptions } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hover";
2
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
5
+ import { IChatAgentData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents";
6
+ import { IChatAgentNameService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
7
+ import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
8
+ import { IExtensionsWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service";
9
+ export declare class ChatAgentHover extends Disposable {
10
+ private readonly chatAgentService;
11
+ private readonly extensionService;
12
+ private readonly chatAgentNameService;
13
+ readonly domNode: HTMLElement;
14
+ private readonly icon;
15
+ private readonly name;
16
+ private readonly extensionName;
17
+ private readonly publisherName;
18
+ private readonly description;
19
+ private readonly _onDidChangeContents;
20
+ readonly onDidChangeContents: Event<void>;
21
+ constructor(chatAgentService: IChatAgentService, extensionService: IExtensionsWorkbenchService, chatAgentNameService: IChatAgentNameService);
22
+ setAgent(id: string): void;
23
+ }
24
+ export declare function getChatAgentHoverOptions(getAgent: () => IChatAgentData | undefined, commandService: ICommandService): IManagedHoverOptions;
@@ -0,0 +1,114 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { h, $, append } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { renderIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
5
+ import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
6
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
7
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
9
+ import { FileAccess } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
10
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
11
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
12
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
13
+ import { getFullyQualifiedId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
14
+ import { IChatAgentService, IChatAgentNameService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
15
+ import { showExtensionsWithIdsCommandId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
16
+ import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
17
+ import { verifiedPublisherIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionsIcons';
18
+
19
+ let ChatAgentHover = class ChatAgentHover extends Disposable {
20
+ constructor(chatAgentService, extensionService, chatAgentNameService) {
21
+ super();
22
+ this.chatAgentService = chatAgentService;
23
+ this.extensionService = extensionService;
24
+ this.chatAgentNameService = chatAgentNameService;
25
+ this._onDidChangeContents = this._register(( new Emitter()));
26
+ this.onDidChangeContents = this._onDidChangeContents.event;
27
+ const hoverElement = h('.chat-agent-hover@root', [
28
+ h('.chat-agent-hover-header', [
29
+ h('.chat-agent-hover-icon@icon'),
30
+ h('.chat-agent-hover-details', [
31
+ h('.chat-agent-hover-name@name'),
32
+ h('.chat-agent-hover-extension', [
33
+ h('.chat-agent-hover-extension-name@extensionName'),
34
+ h('.chat-agent-hover-separator@separator'),
35
+ h('.chat-agent-hover-publisher@publisher'),
36
+ ]),
37
+ ]),
38
+ ]),
39
+ h('.chat-agent-hover-warning@warning'),
40
+ h('span.chat-agent-hover-description@description'),
41
+ ]);
42
+ this.domNode = hoverElement.root;
43
+ this.icon = hoverElement.icon;
44
+ this.name = hoverElement.name;
45
+ this.extensionName = hoverElement.extensionName;
46
+ this.description = hoverElement.description;
47
+ hoverElement.separator.textContent = '|';
48
+ const verifiedBadge = $('span.extension-verified-publisher', undefined, renderIcon(verifiedPublisherIcon));
49
+ this.publisherName = $('span.chat-agent-hover-publisher-name');
50
+ append(hoverElement.publisher, verifiedBadge, this.publisherName);
51
+ hoverElement.warning.appendChild(renderIcon(Codicon.warning));
52
+ hoverElement.warning.appendChild($('span', undefined, ( localize(5009, "This chat extension is using a reserved name."))));
53
+ }
54
+ setAgent(id) {
55
+ const agent = this.chatAgentService.getAgent(id);
56
+ if (agent.metadata.icon instanceof URI) {
57
+ const avatarIcon = $('img.icon');
58
+ avatarIcon.src = ( FileAccess.uriToBrowserUri(agent.metadata.icon).toString(true));
59
+ this.icon.replaceChildren($('.avatar', undefined, avatarIcon));
60
+ }
61
+ else if (agent.metadata.themeIcon) {
62
+ const avatarIcon = $(ThemeIcon.asCSSSelector(agent.metadata.themeIcon));
63
+ this.icon.replaceChildren($('.avatar.codicon-avatar', undefined, avatarIcon));
64
+ }
65
+ this.domNode.classList.toggle('noExtensionName', !!agent.isDynamic);
66
+ const isAllowed = this.chatAgentNameService.getAgentNameRestriction(agent);
67
+ this.name.textContent = isAllowed ? `@${agent.name}` : getFullyQualifiedId(agent);
68
+ this.extensionName.textContent = agent.extensionDisplayName;
69
+ this.publisherName.textContent = agent.publisherDisplayName ?? agent.extensionPublisherId;
70
+ let description = agent.description ?? '';
71
+ if (description) {
72
+ if (!description.match(/[\.\?\!] *$/)) {
73
+ description += '.';
74
+ }
75
+ }
76
+ this.description.textContent = description;
77
+ this.domNode.classList.toggle('allowedName', isAllowed);
78
+ this.domNode.classList.toggle('verifiedPublisher', false);
79
+ if (!agent.isDynamic) {
80
+ const cancel = this._register(( new CancellationTokenSource()));
81
+ this.extensionService.getExtensions([{ id: agent.extensionId.value }], cancel.token).then(extensions => {
82
+ cancel.dispose();
83
+ const extension = extensions[0];
84
+ if (extension?.publisherDomain?.verified) {
85
+ this.domNode.classList.toggle('verifiedPublisher', true);
86
+ this._onDidChangeContents.fire();
87
+ }
88
+ });
89
+ }
90
+ }
91
+ };
92
+ ChatAgentHover = ( __decorate([
93
+ ( __param(0, IChatAgentService)),
94
+ ( __param(1, IExtensionsWorkbenchService)),
95
+ ( __param(2, IChatAgentNameService))
96
+ ], ChatAgentHover));
97
+ function getChatAgentHoverOptions(getAgent, commandService) {
98
+ return {
99
+ actions: [
100
+ {
101
+ commandId: showExtensionsWithIdsCommandId,
102
+ label: ( localize(5010, "View Extension")),
103
+ run: () => {
104
+ const agent = getAgent();
105
+ if (agent) {
106
+ commandService.executeCommand(showExtensionsWithIdsCommandId, [agent.extensionId.value]);
107
+ }
108
+ },
109
+ }
110
+ ]
111
+ };
112
+ }
113
+
114
+ export { ChatAgentHover, getChatAgentHoverOptions };
@@ -0,0 +1,34 @@
1
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
+ import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
3
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IChatRequestFileEntry, IChatRequestVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries";
5
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
6
+ import { ISharedWebContentExtractorService } from "@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service";
7
+ import { IChatAttachmentResolveService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service";
8
+ export interface IChatAttachmentChangeEvent {
9
+ readonly deleted: readonly string[];
10
+ readonly added: readonly IChatRequestVariableEntry[];
11
+ readonly updated: readonly IChatRequestVariableEntry[];
12
+ }
13
+ export declare class ChatAttachmentModel extends Disposable {
14
+ private readonly fileService;
15
+ private readonly webContentExtractorService;
16
+ private readonly chatAttachmentResolveService;
17
+ private readonly _attachments;
18
+ private _onDidChange;
19
+ readonly onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<IChatAttachmentChangeEvent>;
20
+ constructor(fileService: IFileService, webContentExtractorService: ISharedWebContentExtractorService, chatAttachmentResolveService: IChatAttachmentResolveService);
21
+ get attachments(): ReadonlyArray<IChatRequestVariableEntry>;
22
+ get size(): number;
23
+ get fileAttachments(): URI[];
24
+ getAttachmentIDs(): Set<string>;
25
+ addFile(uri: URI, range?: IRange): Promise<void>;
26
+ addFolder(uri: URI): void;
27
+ clear(clearStickyAttachments?: boolean): void;
28
+ addContext(...attachments: IChatRequestVariableEntry[]): void;
29
+ clearAndSetContext(...attachments: IChatRequestVariableEntry[]): void;
30
+ delete(...variableEntryIds: string[]): void;
31
+ updateContext(toDelete: Iterable<string>, upsert: Iterable<IChatRequestVariableEntry>): void;
32
+ asFileVariableEntry(uri: URI, range?: IRange): IChatRequestFileEntry;
33
+ asImageVariableEntry(uri: URI): Promise<IChatRequestVariableEntry | undefined>;
34
+ }
@@ -0,0 +1,141 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
4
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
6
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { isPromptFileVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries';
8
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
9
+ import { ISharedWebContentExtractorService } from '@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service';
10
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
11
+ import { IChatAttachmentResolveService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service';
12
+ import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
13
+ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
14
+ import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
15
+
16
+ let ChatAttachmentModel = class ChatAttachmentModel extends Disposable {
17
+ constructor(fileService, webContentExtractorService, chatAttachmentResolveService) {
18
+ super();
19
+ this.fileService = fileService;
20
+ this.webContentExtractorService = webContentExtractorService;
21
+ this.chatAttachmentResolveService = chatAttachmentResolveService;
22
+ this._attachments = ( new Map());
23
+ this._onDidChange = this._register(( new Emitter()));
24
+ this.onDidChange = this._onDidChange.event;
25
+ }
26
+ get attachments() {
27
+ return Array.from(( this._attachments.values()));
28
+ }
29
+ get size() {
30
+ return this._attachments.size;
31
+ }
32
+ get fileAttachments() {
33
+ return ( this.attachments.filter(file => file.kind === 'file' && URI.isUri(file.value))
34
+ .map(file => file.value));
35
+ }
36
+ getAttachmentIDs() {
37
+ return ( new Set(( this._attachments.keys())));
38
+ }
39
+ async addFile(uri, range) {
40
+ if (/\.(png|jpe?g|gif|bmp|webp)$/i.test(uri.path)) {
41
+ const context = await this.asImageVariableEntry(uri);
42
+ if (context) {
43
+ this.addContext(context);
44
+ }
45
+ return;
46
+ }
47
+ else {
48
+ this.addContext(this.asFileVariableEntry(uri, range));
49
+ }
50
+ }
51
+ addFolder(uri) {
52
+ this.addContext({
53
+ kind: 'directory',
54
+ value: uri,
55
+ id: ( uri.toString()),
56
+ name: basename(uri),
57
+ });
58
+ }
59
+ clear(clearStickyAttachments = false) {
60
+ if (clearStickyAttachments) {
61
+ const deleted = Array.from(( this._attachments.keys()));
62
+ this._attachments.clear();
63
+ this._onDidChange.fire({ deleted, added: [], updated: [] });
64
+ }
65
+ else {
66
+ const deleted = [];
67
+ const allIds = Array.from(( this._attachments.keys()));
68
+ for (const id of allIds) {
69
+ const entry = this._attachments.get(id);
70
+ if (entry && !isPromptFileVariableEntry(entry)) {
71
+ this._attachments.delete(id);
72
+ deleted.push(id);
73
+ }
74
+ }
75
+ this._onDidChange.fire({ deleted, added: [], updated: [] });
76
+ }
77
+ }
78
+ addContext(...attachments) {
79
+ attachments = attachments.filter(attachment => !( this._attachments.has(attachment.id)));
80
+ this.updateContext(Iterable.empty(), attachments);
81
+ }
82
+ clearAndSetContext(...attachments) {
83
+ this.updateContext(Array.from(( this._attachments.keys())), attachments);
84
+ }
85
+ delete(...variableEntryIds) {
86
+ this.updateContext(variableEntryIds, Iterable.empty());
87
+ }
88
+ updateContext(toDelete, upsert) {
89
+ const deleted = [];
90
+ const added = [];
91
+ const updated = [];
92
+ for (const id of toDelete) {
93
+ const item = this._attachments.get(id);
94
+ if (item) {
95
+ this._attachments.delete(id);
96
+ deleted.push(id);
97
+ }
98
+ }
99
+ for (const item of upsert) {
100
+ const oldItem = this._attachments.get(item.id);
101
+ if (!oldItem) {
102
+ this._attachments.set(item.id, item);
103
+ added.push(item);
104
+ }
105
+ else if (!equals(oldItem, item)) {
106
+ this._attachments.set(item.id, item);
107
+ updated.push(item);
108
+ }
109
+ }
110
+ if (deleted.length > 0 || added.length > 0 || updated.length > 0) {
111
+ this._onDidChange.fire({ deleted, added, updated });
112
+ }
113
+ }
114
+ asFileVariableEntry(uri, range) {
115
+ return {
116
+ kind: 'file',
117
+ value: range ? { uri, range } : uri,
118
+ id: ( uri.toString()) + (range?.toString() ?? ''),
119
+ name: basename(uri),
120
+ };
121
+ }
122
+ async asImageVariableEntry(uri) {
123
+ if (uri.scheme === Schemas.file && (await this.fileService.canHandleResource(uri))) {
124
+ return await this.chatAttachmentResolveService.resolveImageEditorAttachContext(uri);
125
+ }
126
+ else if (uri.scheme === Schemas.http || uri.scheme === Schemas.https) {
127
+ const extractedImages = await this.webContentExtractorService.readImage(uri, CancellationToken.None);
128
+ if (extractedImages) {
129
+ return await this.chatAttachmentResolveService.resolveImageEditorAttachContext(uri, extractedImages);
130
+ }
131
+ }
132
+ return undefined;
133
+ }
134
+ };
135
+ ChatAttachmentModel = ( __decorate([
136
+ ( __param(0, IFileService)),
137
+ ( __param(1, ISharedWebContentExtractorService)),
138
+ ( __param(2, IChatAttachmentResolveService))
139
+ ], ChatAttachmentModel));
140
+
141
+ export { ChatAttachmentModel };