@codingame/monaco-vscode-katex-common 30.0.1 → 31.0.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 (276) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +16 -0
  3. package/vscode/src/vs/platform/actions/browser/actionbar.js +22 -0
  4. package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
  5. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
  6. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
  7. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
  8. package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
  9. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
  10. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
  11. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +73 -0
  12. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +3 -1
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +51 -24
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +2 -1
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +64 -72
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +2 -1
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -14
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +17 -18
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +5 -2
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +5 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +73 -9
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  29. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +32 -32
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.d.ts +1 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +20 -2
  32. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +1 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +73 -49
  34. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +0 -6
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +41 -99
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +13 -9
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +14 -15
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +11 -12
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +339 -161
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +9 -2
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +9 -4
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +33 -5
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +43 -1
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +147 -2
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +4 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +55 -6
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +1 -1
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +7 -5
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +1 -3
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +42 -10
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animation.d.ts +18 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.d.ts +15 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.js +16 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.d.ts +13 -0
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.js +33 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/buffer.d.ts +46 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.d.ts +11 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.js +12 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.d.ts +9 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.js +12 -0
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +23 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +37 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.d.ts +34 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.js +68 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +77 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +170 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/media/chatIncrementalRendering.css +112 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +3 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -16
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +24 -6
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +111 -145
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +425 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +16 -7
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +68 -25
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +101 -45
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +36 -4
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +217 -25
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +23 -3
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +168 -60
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +10 -10
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +18 -17
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -5
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +7 -18
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +1 -5
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +7 -19
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +24 -19
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +104 -78
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +11 -2
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +257 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +19 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +30 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +1 -1
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +12 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +286 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -11
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -7
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +25 -47
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +29 -53
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +258 -321
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +53 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +392 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -3
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +24 -30
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +2 -3
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +9 -8
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +6 -3
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +2 -3
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +38 -11
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +577 -113
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +0 -7
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +4 -7
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -8
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +58 -75
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +44 -12
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +362 -188
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +0 -2
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -5
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +42 -95
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +2 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +9 -10
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +57 -38
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +21 -15
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/{modelPickerActionItem2.js → modelPickerActionItem.js} +5 -7
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +38 -31
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +4 -5
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +94 -40
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  166. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +16 -0
  167. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +218 -0
  168. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
  169. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +6 -1
  170. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
  171. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +12 -21
  172. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -32
  173. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +355 -156
  174. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +2 -13
  175. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +72 -65
  176. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +4 -43
  177. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +238 -204
  178. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +4 -19
  179. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +128 -115
  180. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +6 -9
  181. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +152 -49
  182. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +64 -0
  183. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +40 -40
  184. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  194. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  196. package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +2 -0
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +45 -0
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +165 -0
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +53 -0
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +163 -0
  206. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
  207. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +142 -0
  208. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +29 -0
  209. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +144 -0
  210. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +42 -0
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +256 -0
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +42 -0
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +94 -0
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +221 -0
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +52 -0
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +19 -0
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +168 -0
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +22 -0
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +47 -0
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
  248. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
  249. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +24 -0
  250. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
  251. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +32 -0
  252. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +108 -0
  253. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +412 -0
  254. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
  255. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
  256. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
  257. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +192 -0
  258. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2258 -0
  259. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +22 -0
  260. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +43 -0
  261. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
  262. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
  263. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
  264. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
  265. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +1 -0
  266. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +25 -0
  267. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +141 -0
  268. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +85 -0
  269. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +608 -0
  270. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +0 -40
  271. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +0 -196
  272. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +0 -29
  273. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +0 -46
  274. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +0 -215
  275. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +0 -18
  276. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +0 -107
@@ -1,23 +1,29 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { $, clearNode, append } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
4
5
  import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
5
6
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
6
- import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
8
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
9
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
9
10
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
10
11
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
12
+ import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
11
13
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
14
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
12
15
  import { IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
13
16
  import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
14
17
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
15
18
  import { WorkbenchObjectTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
16
19
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
17
20
  import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
21
+ import { ChatMemoryFileResource } from '../../common/chatArtifactExtraction.js';
18
22
  import { IChatArtifactsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service';
19
23
  import { IChatImageCarouselService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatImageCarouselService.service';
20
24
  import { getEditorOverrideForChatResource } from './chatContentParts/chatInlineAnchorWidget.js';
25
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
26
+ import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
21
27
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
22
28
 
23
29
  var ChatArtifactsWidget_1;
@@ -27,7 +33,10 @@ const ARTIFACT_TYPE_ICONS = {
27
33
  plan: Codicon.book
28
34
  };
29
35
  function isGroupNode(element) {
30
- return "kind" in element && element.kind === "group";
36
+ return element.kind === "group";
37
+ }
38
+ function isLeafNode(element) {
39
+ return element.kind === "leaf";
31
40
  }
32
41
  let ChatArtifactsWidget = class ChatArtifactsWidget extends Disposable {
33
42
  static {
@@ -44,6 +53,7 @@ let ChatArtifactsWidget = class ChatArtifactsWidget extends Disposable {
44
53
  _instantiationService,
45
54
  _openerService,
46
55
  _configurationService,
56
+ _commandService,
47
57
  _fileService,
48
58
  _fileDialogService,
49
59
  _chatImageCarouselService
@@ -53,102 +63,104 @@ let ChatArtifactsWidget = class ChatArtifactsWidget extends Disposable {
53
63
  this._instantiationService = _instantiationService;
54
64
  this._openerService = _openerService;
55
65
  this._configurationService = _configurationService;
66
+ this._commandService = _commandService;
56
67
  this._fileService = _fileService;
57
68
  this._fileDialogService = _fileDialogService;
58
69
  this._chatImageCarouselService = _chatImageCarouselService;
59
- this._autorunDisposable = this._register(( new MutableDisposable()));
60
- this._isCollapsed = false;
61
- this._treeStore = this._register(( new DisposableStore()));
70
+ this._sessionResource = observableValue(this, undefined);
71
+ this._isCollapsed = observableValue(this, false);
72
+ this._currentArtifacts = derived(this, reader => {
73
+ const sr = this._sessionResource.read(reader);
74
+ return sr ? this._chatArtifactsService.getArtifacts(sr) : undefined;
75
+ });
76
+ this._treeData = derived(this, reader => {
77
+ const artifacts = this._currentArtifacts.read(reader);
78
+ if (!artifacts) {
79
+ return undefined;
80
+ }
81
+ const groups = artifacts.artifactGroups.read(reader);
82
+ const totalCount = groups.reduce((sum, g) => sum + g.artifacts.length, 0);
83
+ if (totalCount === 0) {
84
+ return undefined;
85
+ }
86
+ const multiSource = groups.length > 1;
87
+ const treeElements = buildTreeElementsFromGroups(groups, multiSource, source => this._clearSource(source));
88
+ const visibleCount = countVisibleRows(treeElements);
89
+ const itemsShown = Math.min(visibleCount, ChatArtifactsWidget_1.MAX_ITEMS_SHOWN);
90
+ return {
91
+ totalCount,
92
+ treeElements,
93
+ treeHeight: itemsShown * ChatArtifactsWidget_1.ELEMENT_HEIGHT
94
+ };
95
+ });
62
96
  this.domNode = $(".chat-artifacts-widget");
63
97
  this.domNode.style.display = "none";
64
- }
65
- render(sessionResource) {
66
- this._currentArtifacts = this._chatArtifactsService.getArtifacts(sessionResource);
67
- clearNode(this.domNode);
68
- this._treeStore.clear();
69
- const expandoContainer = $(".chat-artifacts-expand");
70
- const headerButton = this._treeStore.add(( new Button(expandoContainer, {
71
- supportIcons: true
72
- })));
73
- headerButton.element.setAttribute("aria-expanded", String(!this._isCollapsed));
74
- const titleSection = $(".chat-artifacts-title-section");
75
- this._expandIcon = $(".expand-icon.codicon");
76
- this._expandIcon.classList.add(this._isCollapsed ? "codicon-chevron-right" : "codicon-chevron-down");
77
- this._expandIcon.setAttribute("aria-hidden", "true");
78
- this._titleElement = $(".chat-artifacts-title");
79
- titleSection.appendChild(this._expandIcon);
80
- titleSection.appendChild(this._titleElement);
81
- headerButton.element.appendChild(titleSection);
82
- const clearButtonContainer = $(".artifacts-clear-button-container");
83
- this._clearButton = this._treeStore.add(( new Button(clearButtonContainer, {
84
- supportIcons: true,
85
- ariaLabel: ( localize(6710, "Clear all artifacts"))
86
- })));
87
- this._clearButton.element.tabIndex = 0;
88
- this._clearButton.icon = Codicon.clearAll;
89
- this._treeStore.add(this._clearButton.onDidClick(() => {
90
- this._clearAllArtifacts();
91
- }));
92
- headerButton.element.appendChild(clearButtonContainer);
93
- this.domNode.appendChild(expandoContainer);
94
- const listContainer = $(".chat-artifacts-list");
95
- listContainer.style.display = this._isCollapsed ? "none" : "block";
96
- this.domNode.appendChild(listContainer);
97
- this._tree = this._treeStore.add(
98
- this._instantiationService.createInstance(WorkbenchObjectTree, "ChatArtifactsTree", listContainer, ( new ChatArtifactsTreeDelegate()), [( new ChatArtifactGroupRenderer()), ( new ChatArtifactLeafRenderer(artifact => this._saveArtifact(artifact)))], {
99
- alwaysConsumeMouseWheel: false,
100
- accessibilityProvider: ( new ChatArtifactsAccessibilityProvider())
101
- })
102
- );
103
- this._treeStore.add(this._tree.onDidOpen(e => {
104
- if (!e.element) {
98
+ this._register(autorun(reader => {
99
+ const artifacts = this._currentArtifacts.read(reader);
100
+ clearNode(this.domNode);
101
+ if (!artifacts) {
102
+ this.domNode.style.display = "none";
105
103
  return;
106
104
  }
107
- if (isGroupNode(e.element)) {
108
- if (e.element.onlyShowGroup) {
109
- this._openGroupInCarousel(e.element);
105
+ const store = reader.store;
106
+ const expandoContainer = $(".chat-artifacts-expand");
107
+ const headerButton = store.add(( new Button(expandoContainer, {
108
+ supportIcons: true
109
+ })));
110
+ const titleSection = $(".chat-artifacts-title-section");
111
+ const expandIcon = $(".expand-icon.codicon");
112
+ expandIcon.setAttribute("aria-hidden", "true");
113
+ const titleElement = $(".chat-artifacts-title");
114
+ titleSection.appendChild(expandIcon);
115
+ titleSection.appendChild(titleElement);
116
+ headerButton.element.appendChild(titleSection);
117
+ this.domNode.appendChild(expandoContainer);
118
+ const listContainer = $(".chat-artifacts-list");
119
+ this.domNode.appendChild(listContainer);
120
+ const tree = store.add(
121
+ this._instantiationService.createInstance(WorkbenchObjectTree, "ChatArtifactsTree", listContainer, ( new ChatArtifactsTreeDelegate()), [( new ChatArtifactGroupRenderer()), ( new ChatArtifactLeafRenderer(artifact => this._saveArtifact(artifact)))], {
122
+ alwaysConsumeMouseWheel: false,
123
+ accessibilityProvider: ( new ChatArtifactsAccessibilityProvider())
124
+ })
125
+ );
126
+ store.add(tree.onDidOpen(e => {
127
+ if (!e.element) {
128
+ return;
110
129
  }
111
- } else {
112
- const artifact = e.element;
113
- if (artifact.type === "screenshot" && this._configurationService.getValue(ChatConfiguration.ImageCarouselEnabled)) {
114
- this._openScreenshotInCarousel(artifact);
115
- } else if (artifact.uri) {
116
- const uri = ( URI.parse(artifact.uri));
117
- const editorOverride = getEditorOverrideForChatResource(uri, this._configurationService);
118
- this._openerService.open(uri, {
119
- fromUserGesture: true,
120
- editorOptions: {
121
- override: editorOverride
122
- }
123
- });
130
+ if (isGroupNode(e.element)) {
131
+ if (e.element.onlyShowGroup) {
132
+ this._openGroupInCarousel(e.element);
133
+ }
134
+ } else if (isLeafNode(e.element)) {
135
+ this._openLeafArtifact(e.element.artifact);
124
136
  }
125
- }
126
- }));
127
- this._treeStore.add(headerButton.onDidClick(() => {
128
- this._isCollapsed = !this._isCollapsed;
129
- this._expandIcon.classList.toggle("codicon-chevron-down", !this._isCollapsed);
130
- this._expandIcon.classList.toggle("codicon-chevron-right", this._isCollapsed);
131
- headerButton.element.setAttribute("aria-expanded", String(!this._isCollapsed));
132
- listContainer.style.display = this._isCollapsed ? "none" : "block";
137
+ }));
138
+ store.add(headerButton.onDidClick(() => {
139
+ this._isCollapsed.set(!this._isCollapsed.read(undefined), undefined);
140
+ }));
141
+ store.add(autorun(reader => {
142
+ const collapsed = this._isCollapsed.read(reader);
143
+ expandIcon.classList.toggle("codicon-chevron-down", !collapsed);
144
+ expandIcon.classList.toggle("codicon-chevron-right", collapsed);
145
+ headerButton.element.setAttribute("aria-expanded", String(!collapsed));
146
+ listContainer.style.display = collapsed ? "none" : "block";
147
+ }));
148
+ store.add(autorun(reader => {
149
+ const data = this._treeData.read(reader);
150
+ if (!data) {
151
+ this.domNode.style.display = "none";
152
+ return;
153
+ }
154
+ this.domNode.style.display = "";
155
+ titleElement.textContent = data.totalCount === 1 ? ( localize(6793, "1 Artifact")) : ( localize(6794, "{0} Artifacts", data.totalCount));
156
+ tree.layout(data.treeHeight);
157
+ tree.getHTMLElement().style.height = `${data.treeHeight}px`;
158
+ tree.setChildren(null, data.treeElements);
159
+ }));
133
160
  }));
134
- this._autorunDisposable.value = autorun(reader => {
135
- const artifacts = this._currentArtifacts.artifacts.read(reader);
136
- const mutable = this._currentArtifacts.mutable.read(reader);
137
- if (artifacts.length === 0) {
138
- this.domNode.style.display = "none";
139
- return;
140
- }
141
- this.domNode.style.display = "";
142
- this._clearButton.element.style.display = mutable ? "" : "none";
143
- this._titleElement.textContent = artifacts.length === 1 ? ( localize(6711, "1 Artifact")) : ( localize(6712, "{0} Artifacts", artifacts.length));
144
- const treeElements = buildTreeElements(artifacts);
145
- const visibleCount = countVisibleRows(treeElements);
146
- const itemsShown = Math.min(visibleCount, ChatArtifactsWidget_1.MAX_ITEMS_SHOWN);
147
- const treeHeight = itemsShown * ChatArtifactsWidget_1.ELEMENT_HEIGHT;
148
- this._tree.layout(treeHeight);
149
- this._tree.getHTMLElement().style.height = `${treeHeight}px`;
150
- this._tree.setChildren(null, treeElements);
151
- });
161
+ }
162
+ setSessionResource(sessionResource) {
163
+ this._sessionResource.set(sessionResource, undefined);
152
164
  }
153
165
  async _openGroupInCarousel(group) {
154
166
  const first = group.artifacts[0];
@@ -156,16 +168,63 @@ let ChatArtifactsWidget = class ChatArtifactsWidget extends Disposable {
156
168
  await this._chatImageCarouselService.openCarouselAtResource(( URI.parse(first.uri)));
157
169
  }
158
170
  }
171
+ _openLeafArtifact(artifact) {
172
+ if (artifact.type === "screenshot" && this._configurationService.getValue(ChatConfiguration.ImageCarouselEnabled)) {
173
+ this._openScreenshotInCarousel(artifact);
174
+ } else if (artifact.uri) {
175
+ const uri = ( URI.parse(artifact.uri));
176
+ if (ChatMemoryFileResource.isChatMemoryFileUri(uri)) {
177
+ this._openMemoryFileArtifact(uri);
178
+ } else {
179
+ const editorOverride = getEditorOverrideForChatResource(uri, this._configurationService);
180
+ this._openerService.open(uri, {
181
+ fromUserGesture: true,
182
+ editorOptions: {
183
+ override: editorOverride
184
+ }
185
+ });
186
+ }
187
+ }
188
+ }
159
189
  async _openScreenshotInCarousel(clicked) {
160
190
  if (clicked.uri) {
161
191
  await this._chatImageCarouselService.openCarouselAtResource(( URI.parse(clicked.uri)));
162
192
  }
163
193
  }
164
- _clearAllArtifacts() {
165
- if (!this._currentArtifacts?.mutable.get()) {
194
+ async _openMemoryFileArtifact(uri) {
195
+ const {
196
+ memoryPath,
197
+ sessionResource
198
+ } = ChatMemoryFileResource.parse(uri);
199
+ const resolvedUriStr = await this._commandService.executeCommand(
200
+ "github.copilot.chat.tools.memory.resolveMemoryFileUri",
201
+ memoryPath,
202
+ sessionResource
203
+ );
204
+ if (resolvedUriStr) {
205
+ const resolvedUri = ( URI.parse(resolvedUriStr));
206
+ const editorOverride = getEditorOverrideForChatResource(resolvedUri, this._configurationService);
207
+ this._openerService.open(resolvedUri, {
208
+ fromUserGesture: true,
209
+ editorOptions: {
210
+ override: editorOverride
211
+ }
212
+ });
213
+ }
214
+ }
215
+ _clearSource(source) {
216
+ const artifacts = this._currentArtifacts.get();
217
+ if (!artifacts) {
166
218
  return;
167
219
  }
168
- this._currentArtifacts.clear();
220
+ switch (source.kind) {
221
+ case "agent":
222
+ artifacts.clearAgentArtifacts();
223
+ break;
224
+ case "subagent":
225
+ artifacts.clearSubagentArtifacts(source.invocationId);
226
+ break;
227
+ }
169
228
  }
170
229
  async _saveArtifact(artifact) {
171
230
  const sourceUri = ( URI.parse(artifact.uri));
@@ -174,70 +233,133 @@ let ChatArtifactsWidget = class ChatArtifactsWidget extends Disposable {
174
233
  const defaultUri = URI.joinPath(defaultPath, defaultFileName);
175
234
  const targetUri = await this._fileDialogService.showSaveDialog({
176
235
  defaultUri,
177
- title: ( localize(6713, "Save Artifact"))
236
+ title: ( localize(6795, "Save Artifact"))
178
237
  });
179
238
  if (targetUri) {
180
239
  const content = await this._fileService.readFile(sourceUri);
181
240
  await this._fileService.writeFile(targetUri, content.value);
182
241
  }
183
242
  }
184
- hide() {
185
- this._autorunDisposable.clear();
186
- this.domNode.style.display = "none";
187
- }
188
243
  };
189
- ChatArtifactsWidget = ChatArtifactsWidget_1 = ( __decorate([( __param(0, IChatArtifactsService)), ( __param(1, IInstantiationService)), ( __param(2, IOpenerService)), ( __param(3, IConfigurationService)), ( __param(4, IFileService)), ( __param(5, IFileDialogService)), ( __param(6, IChatImageCarouselService))], ChatArtifactsWidget));
190
- function buildTreeElements(artifacts) {
191
- const groups = ( new Map());
192
- const ungrouped = [];
193
- for (const artifact of artifacts) {
194
- if (artifact.groupName) {
195
- let group = groups.get(artifact.groupName);
196
- if (!group) {
197
- group = {
198
- config: {
199
- groupName: artifact.groupName,
200
- onlyShowGroup: artifact.onlyShowGroup ?? false
201
- },
202
- artifacts: []
203
- };
204
- groups.set(artifact.groupName, group);
205
- }
206
- group.artifacts.push(artifact);
207
- } else {
208
- ungrouped.push(artifact);
209
- }
244
+ ChatArtifactsWidget = ChatArtifactsWidget_1 = ( __decorate([( __param(0, IChatArtifactsService)), ( __param(1, IInstantiationService)), ( __param(2, IOpenerService)), ( __param(3, IConfigurationService)), ( __param(4, ICommandService)), ( __param(5, IFileService)), ( __param(6, IFileDialogService)), ( __param(7, IChatImageCarouselService))], ChatArtifactsWidget));
245
+ function sourceDisplayName(source) {
246
+ switch (source.kind) {
247
+ case "rules":
248
+ return localize(6796, "Rules");
249
+ case "agent":
250
+ return localize(6797, "Agent");
251
+ case "subagent":
252
+ return source.name ?? ( localize(6798, "Subagent"));
210
253
  }
254
+ }
255
+ function buildTreeElementsFromGroups(sourceGroups, multiSource, onClearSource) {
211
256
  const elements = [];
212
- for (const [, group] of groups) {
213
- const groupNode = {
214
- kind: "group",
215
- groupName: group.config.groupName,
216
- artifacts: group.artifacts,
217
- onlyShowGroup: group.config.onlyShowGroup
218
- };
219
- if (group.config.onlyShowGroup) {
220
- elements.push({
221
- element: groupNode,
222
- collapsible: false,
223
- collapsed: false
224
- });
257
+ for (const sourceGroup of sourceGroups) {
258
+ const prefix = multiSource ? sourceDisplayName(sourceGroup.source) : undefined;
259
+ const clearable = sourceGroup.source.kind !== "rules";
260
+ const onClear = clearable ? () => onClearSource(sourceGroup.source) : undefined;
261
+ const groups = ( new Map());
262
+ const ungrouped = [];
263
+ for (const artifact of sourceGroup.artifacts) {
264
+ if (artifact.groupName) {
265
+ let group = groups.get(artifact.groupName);
266
+ if (!group) {
267
+ group = {
268
+ config: {
269
+ groupName: artifact.groupName,
270
+ onlyShowGroup: artifact.onlyShowGroup ?? false
271
+ },
272
+ artifacts: []
273
+ };
274
+ groups.set(artifact.groupName, group);
275
+ }
276
+ group.artifacts.push(artifact);
277
+ } else {
278
+ ungrouped.push(artifact);
279
+ }
280
+ }
281
+ for (const [, group] of groups) {
282
+ const displayName = prefix ? `${prefix}: ${group.config.groupName}` : group.config.groupName;
283
+ if (group.artifacts.length === 1 && !group.config.onlyShowGroup) {
284
+ elements.push({
285
+ element: {
286
+ kind: "leaf",
287
+ artifact: group.artifacts[0],
288
+ description: displayName,
289
+ onClear
290
+ }
291
+ });
292
+ continue;
293
+ }
294
+ const groupNode = {
295
+ kind: "group",
296
+ groupName: displayName,
297
+ artifacts: group.artifacts,
298
+ onlyShowGroup: group.config.onlyShowGroup,
299
+ onClear
300
+ };
301
+ if (group.config.onlyShowGroup) {
302
+ elements.push({
303
+ element: groupNode,
304
+ collapsible: false,
305
+ collapsed: false
306
+ });
307
+ } else {
308
+ elements.push({
309
+ element: groupNode,
310
+ collapsible: true,
311
+ collapsed: false,
312
+ children: ( group.artifacts.map(a => ({
313
+ element: {
314
+ kind: "leaf",
315
+ artifact: a
316
+ }
317
+ })))
318
+ });
319
+ }
320
+ }
321
+ if (ungrouped.length > 0 && prefix) {
322
+ if (ungrouped.length === 1) {
323
+ elements.push({
324
+ element: {
325
+ kind: "leaf",
326
+ artifact: ungrouped[0],
327
+ description: prefix,
328
+ onClear
329
+ }
330
+ });
331
+ } else {
332
+ const groupNode = {
333
+ kind: "group",
334
+ groupName: prefix,
335
+ artifacts: ungrouped,
336
+ onlyShowGroup: false,
337
+ onClear
338
+ };
339
+ elements.push({
340
+ element: groupNode,
341
+ collapsible: true,
342
+ collapsed: false,
343
+ children: ( ungrouped.map(a => ({
344
+ element: {
345
+ kind: "leaf",
346
+ artifact: a
347
+ }
348
+ })))
349
+ });
350
+ }
225
351
  } else {
226
- elements.push({
227
- element: groupNode,
228
- collapsible: true,
229
- collapsed: false,
230
- children: ( group.artifacts.map(a => ({
231
- element: a
232
- })))
233
- });
352
+ for (const artifact of ungrouped) {
353
+ elements.push({
354
+ element: {
355
+ kind: "leaf",
356
+ artifact,
357
+ onClear
358
+ }
359
+ });
360
+ }
234
361
  }
235
362
  }
236
- for (const artifact of ungrouped) {
237
- elements.push({
238
- element: artifact
239
- });
240
- }
241
363
  return elements;
242
364
  }
243
365
  function countVisibleRows(elements) {
@@ -261,12 +383,12 @@ class ChatArtifactsTreeDelegate {
261
383
  class ChatArtifactsAccessibilityProvider {
262
384
  getAriaLabel(element) {
263
385
  if (isGroupNode(element)) {
264
- return localize(6714, "{0} ({1} items)", element.groupName, element.artifacts.length);
386
+ return localize(6799, "{0} ({1} items)", element.groupName, element.artifacts.length);
265
387
  }
266
- return element.label;
388
+ return element.artifact.label;
267
389
  }
268
390
  getWidgetAriaLabel() {
269
- return localize(6715, "Chat Artifacts");
391
+ return localize(6800, "Chat Artifacts");
270
392
  }
271
393
  }
272
394
  class ChatArtifactGroupRenderer {
@@ -280,10 +402,15 @@ class ChatArtifactGroupRenderer {
280
402
  const row = append(container, $(".chat-artifacts-list-row"));
281
403
  const iconElement = append(row, $(".chat-artifacts-list-icon"));
282
404
  const labelElement = append(row, $(".chat-artifacts-list-label"));
405
+ const actionsContainer = append(row, $(".chat-artifacts-list-actions"));
406
+ const elementDisposables = ( new DisposableStore());
407
+ const actionBar = ( new ActionBar(actionsContainer));
283
408
  return {
284
409
  container: row,
285
410
  iconElement,
286
- labelElement
411
+ labelElement,
412
+ actionBar,
413
+ elementDisposables
287
414
  };
288
415
  }
289
416
  renderElement(node, _index, templateData) {
@@ -291,13 +418,33 @@ class ChatArtifactGroupRenderer {
291
418
  if (!isGroupNode(group)) {
292
419
  return;
293
420
  }
421
+ templateData.elementDisposables.clear();
294
422
  const firstType = group.artifacts[0]?.type;
295
423
  const icon = (firstType && ARTIFACT_TYPE_ICONS[firstType]) || Codicon.archive;
296
424
  templateData.iconElement.className = "chat-artifacts-list-icon " + ThemeIcon.asClassName(icon);
297
425
  templateData.labelElement.textContent = `${group.groupName} (${group.artifacts.length})`;
298
426
  templateData.container.title = group.groupName;
427
+ templateData.actionBar.clear();
428
+ if (group.onClear) {
429
+ const clearFn = group.onClear;
430
+ templateData.actionBar.push(toAction({
431
+ id: "chatArtifacts.clearSource",
432
+ label: ( localize(6801, "Clear")),
433
+ class: ThemeIcon.asClassName(Codicon.close),
434
+ run: () => clearFn()
435
+ }), {
436
+ icon: true,
437
+ label: false
438
+ });
439
+ }
440
+ }
441
+ disposeElement(_element, _index, templateData) {
442
+ templateData.elementDisposables.clear();
443
+ }
444
+ disposeTemplate(templateData) {
445
+ templateData.elementDisposables.dispose();
446
+ templateData.actionBar.dispose();
299
447
  }
300
- disposeTemplate() {}
301
448
  }
302
449
  class ChatArtifactLeafRenderer {
303
450
  static {
@@ -311,33 +458,64 @@ class ChatArtifactLeafRenderer {
311
458
  const row = append(container, $(".chat-artifacts-list-row"));
312
459
  const iconElement = append(row, $(".chat-artifacts-list-icon"));
313
460
  const labelElement = append(row, $(".chat-artifacts-list-label"));
314
- const saveButton = append(
315
- row,
316
- $(".chat-artifacts-list-save" + ThemeIcon.asCSSSelector(Codicon.save))
317
- );
318
- saveButton.title = ( localize(6716, "Save artifact"));
461
+ const descriptionElement = append(row, $(".chat-artifacts-list-description"));
462
+ const actionsContainer = append(row, $(".chat-artifacts-list-actions"));
463
+ const elementDisposables = ( new DisposableStore());
464
+ const actionBar = ( new ActionBar(actionsContainer));
319
465
  return {
320
466
  container: row,
321
467
  iconElement,
322
468
  labelElement,
323
- saveButton
469
+ descriptionElement,
470
+ actionBar,
471
+ elementDisposables
324
472
  };
325
473
  }
326
474
  renderElement(node, _index, templateData) {
327
- const artifact = node.element;
328
- if (isGroupNode(artifact)) {
475
+ if (!isLeafNode(node.element)) {
329
476
  return;
330
477
  }
478
+ templateData.elementDisposables.clear();
479
+ const {
480
+ artifact,
481
+ description,
482
+ onClear
483
+ } = node.element;
331
484
  const icon = (artifact.type && ARTIFACT_TYPE_ICONS[artifact.type]) || Codicon.archive;
332
485
  templateData.iconElement.className = "chat-artifacts-list-icon " + ThemeIcon.asClassName(icon);
333
486
  templateData.labelElement.textContent = artifact.label;
487
+ templateData.descriptionElement.textContent = description ?? "";
488
+ templateData.descriptionElement.style.display = description ? "" : "none";
334
489
  templateData.container.title = artifact.uri;
335
- templateData.saveButton.onclick = e => {
336
- e.stopPropagation();
337
- this._onSave(artifact);
338
- };
490
+ templateData.actionBar.clear();
491
+ const actions = [];
492
+ if (onClear) {
493
+ const clearFn = onClear;
494
+ actions.push(toAction({
495
+ id: "chatArtifacts.clearSource",
496
+ label: ( localize(6801, "Clear")),
497
+ class: ThemeIcon.asClassName(Codicon.close),
498
+ run: () => clearFn()
499
+ }));
500
+ }
501
+ actions.push(toAction({
502
+ id: "chatArtifacts.save",
503
+ label: ( localize(6802, "Save artifact")),
504
+ class: ThemeIcon.asClassName(Codicon.save),
505
+ run: () => this._onSave(artifact)
506
+ }));
507
+ templateData.actionBar.push(actions, {
508
+ icon: true,
509
+ label: false
510
+ });
511
+ }
512
+ disposeElement(_element, _index, templateData) {
513
+ templateData.elementDisposables.clear();
514
+ }
515
+ disposeTemplate(templateData) {
516
+ templateData.elementDisposables.dispose();
517
+ templateData.actionBar.dispose();
339
518
  }
340
- disposeTemplate() {}
341
519
  }
342
520
 
343
521
  export { ChatArtifactsWidget };
@@ -9,6 +9,8 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
9
9
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
10
10
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
11
11
  import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
12
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
13
+ import { AGENT_HOST_SCHEME } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
12
14
 
13
15
  const _remoteImageDisallowed = () => false;
14
16
  const allowedChatMarkdownHtmlTags = ( Object.freeze([
@@ -69,14 +71,19 @@ let ChatContentMarkdownRenderer = class ChatContentMarkdownRenderer {
69
71
  },
70
72
  ...options?.sanitizerConfig,
71
73
  allowedLinkSchemes: {
72
- augment: [product.urlProtocol, "copilot-skill"]
74
+ augment: [
75
+ product.urlProtocol,
76
+ "copilot-skill",
77
+ Schemas.vscodeBrowser,
78
+ AGENT_HOST_SCHEME
79
+ ]
73
80
  },
74
81
  remoteImageIsAllowed: _remoteImageDisallowed
75
82
  }
76
83
  };
77
84
  const mdWithBody = (markdown && markdown.supportHtml) ? {
78
85
  ...markdown,
79
- value: `<body>\n\n${markdown.value}</body>`
86
+ value: `<body>\n\n${markdown.value}\n\n</body>`
80
87
  } : markdown;
81
88
  const result = this.markdownRendererService.render(mdWithBody, options, outElement);
82
89
  result.element.normalize();