@codingame/monaco-vscode-katex-common 25.1.1 → 26.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 (317) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +23 -2
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
  4. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
  6. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
  8. package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
  9. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
  29. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
  32. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
  33. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
  34. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
  54. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
  172. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
  173. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
  174. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
  175. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
  176. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
  177. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
  179. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
  180. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
  181. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
  182. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
  183. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
  184. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
  185. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
  186. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
  187. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
  188. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
  191. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
  192. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
  198. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
  199. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
  200. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
  201. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +80 -19
  202. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
  203. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
  204. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
  205. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
  206. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
  207. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
  208. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
  209. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
  210. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
  211. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
  212. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
  213. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
  214. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
  215. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
  216. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
  217. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
  219. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
  220. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
  221. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
  222. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
  223. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
  224. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
  225. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
  226. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
  227. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
  228. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
  229. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
  230. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
  231. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
  232. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
  239. package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
  240. package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
  241. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
  242. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
  243. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
  244. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
  245. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
  246. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
  247. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
  248. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
  249. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
  250. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
  251. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
  252. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
  253. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
  254. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
  255. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
  256. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
  257. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
  258. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
  259. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
  260. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
  261. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
  262. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
  304. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
  305. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
  306. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
  307. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
  308. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
  309. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
  310. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
  311. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
  312. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
  313. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
  314. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
  315. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
  316. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
  317. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
@@ -1,20 +1,26 @@
1
1
 
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
- import { h, addDisposableListener, EventType, clearNode, getActiveWindow, getComputedStyle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { h, addDisposableListener, EventType, clearNode, getActiveWindow, getComputedStyle, createTextNode, createElement, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
5
  import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
6
6
  import { MarkdownString, isMarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
7
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
7
8
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
8
10
  import { migrateLegacyTerminalToolSpecificData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
11
+ import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
9
12
  import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
10
13
  import { ChatQueryTitlePart } from '../chatConfirmationWidget.js';
11
14
  import { ChatMarkdownContentPart } from '../chatMarkdownContentPart.js';
12
15
  import { ChatProgressSubPart } from '../chatProgressContentPart.js';
13
16
  import { BaseChatToolInvocationSubPart } from './chatToolInvocationSubPart.js';
17
+ import { TerminalToolAutoExpand } from './terminalToolAutoExpand.js';
18
+ import { ChatCollapsibleContentPart } from '../chatCollapsibleContentPart.js';
14
19
  import * as chatTerminalToolProgressPart from '../media/chatTerminalToolProgressPart.css';
15
20
  import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
21
+ import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
16
22
  import { ITerminalChatService, ITerminalService, ITerminalConfigurationService, ITerminalEditorService, ITerminalGroupService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
17
- import { Disposable, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
23
+ import { Disposable, MutableDisposable, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
18
24
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
19
25
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
20
26
  import { getTerminalCommandDecorationTooltip, getTerminalCommandDecorationState, DecorationSelector } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles';
@@ -60,7 +66,10 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
60
66
  super();
61
67
  this._options = _options;
62
68
  this._hoverService = _hoverService;
63
- const decorationElements = h('span.chat-terminal-command-decoration@decoration', { role: 'img', tabIndex: 0 });
69
+ const decorationElements = h("span.chat-terminal-command-decoration@decoration", {
70
+ role: "img",
71
+ tabIndex: 0
72
+ });
64
73
  this._element = decorationElements.decoration;
65
74
  this._attachElementToContainer();
66
75
  }
@@ -73,9 +82,8 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
73
82
  if (!decoration.isConnected || decoration.parentElement !== container) {
74
83
  const icon = this._options.getIconElement();
75
84
  if (icon && icon.parentElement === container) {
76
- icon.insertAdjacentElement('afterend', decoration);
77
- }
78
- else {
85
+ icon.insertAdjacentElement("afterend", decoration);
86
+ } else {
79
87
  container.insertBefore(decoration, container.firstElementChild ?? null);
80
88
  }
81
89
  }
@@ -87,7 +95,7 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
87
95
  _getHoverText() {
88
96
  const command = this._options.getResolvedCommand();
89
97
  const storedState = this._options.terminalData.terminalCommandState;
90
- return getTerminalCommandDecorationTooltip(command, storedState) || '';
98
+ return getTerminalCommandDecorationTooltip(command, storedState) || "";
91
99
  }
92
100
  update(command) {
93
101
  this._attachElementToContainer();
@@ -107,10 +115,12 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
107
115
  duration: command.duration ?? existingState.duration
108
116
  };
109
117
  storedState = terminalData.terminalCommandState;
110
- }
111
- else if (!storedState) {
118
+ } else if (!storedState) {
112
119
  const now = Date.now();
113
- terminalData.terminalCommandState = { exitCode: undefined, timestamp: now };
120
+ terminalData.terminalCommandState = {
121
+ exitCode: undefined,
122
+ timestamp: now
123
+ };
114
124
  storedState = terminalData.terminalCommandState;
115
125
  }
116
126
  const decorationState = getTerminalCommandDecorationState(command, storedState);
@@ -124,17 +134,15 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
124
134
  const isInteractive = !decoration.classList.contains(DecorationSelector.Default);
125
135
  decoration.tabIndex = isInteractive ? 0 : -1;
126
136
  if (isInteractive) {
127
- decoration.removeAttribute('aria-disabled');
128
- }
129
- else {
130
- decoration.setAttribute('aria-disabled', 'true');
137
+ decoration.removeAttribute("aria-disabled");
138
+ } else {
139
+ decoration.setAttribute("aria-disabled", "true");
131
140
  }
132
141
  const hoverText = tooltip || decorationState.hoverMessage;
133
142
  if (hoverText) {
134
- decoration.setAttribute('aria-label', hoverText);
135
- }
136
- else {
137
- decoration.removeAttribute('aria-label');
143
+ decoration.setAttribute("aria-label", hoverText);
144
+ } else {
145
+ decoration.removeAttribute("aria-label");
138
146
  }
139
147
  }
140
148
  _attachInteractionHandlers(decoration) {
@@ -144,9 +152,7 @@ let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposab
144
152
  this._interactionElement = decoration;
145
153
  }
146
154
  };
147
- TerminalCommandDecoration = ( __decorate([
148
- ( __param(1, IHoverService))
149
- ], TerminalCommandDecoration));
155
+ TerminalCommandDecoration = ( __decorate([( __param(1, IHoverService))], TerminalCommandDecoration));
150
156
  let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends BaseChatToolInvocationSubPart {
151
157
  get codeblocks() {
152
158
  return this.markdownPart?.codeblocks ?? [];
@@ -157,7 +163,23 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
157
163
  get contentIndex() {
158
164
  return this._contentIndex;
159
165
  }
160
- constructor(toolInvocation, terminalData, context, renderer, editorPool, currentWidthDelegate, codeBlockStartIndex, codeBlockModelCollection, _instantiationService, _terminalChatService, _terminalService, _contextKeyService, _chatWidgetService, _keybindingService) {
166
+ constructor(
167
+ toolInvocation,
168
+ terminalData,
169
+ context,
170
+ renderer,
171
+ editorPool,
172
+ currentWidthDelegate,
173
+ codeBlockStartIndex,
174
+ codeBlockModelCollection,
175
+ _instantiationService,
176
+ _terminalChatService,
177
+ _terminalService,
178
+ _contextKeyService,
179
+ _chatWidgetService,
180
+ _keybindingService,
181
+ _configurationService
182
+ ) {
161
183
  super(toolInvocation);
162
184
  this._instantiationService = _instantiationService;
163
185
  this._terminalChatService = _terminalChatService;
@@ -165,25 +187,27 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
165
187
  this._contextKeyService = _contextKeyService;
166
188
  this._chatWidgetService = _chatWidgetService;
167
189
  this._keybindingService = _keybindingService;
190
+ this._configurationService = _configurationService;
168
191
  this._showOutputAction = this._register(( new MutableDisposable()));
169
192
  this._showOutputActionAdded = false;
170
193
  this._focusAction = this._register(( new MutableDisposable()));
194
+ this._continueInBackgroundAction = this._register(( new MutableDisposable()));
195
+ this._userToggledOutput = false;
196
+ this._isInThinkingContainer = false;
171
197
  this._elementIndex = context.elementIndex;
172
198
  this._contentIndex = context.contentIndex;
173
199
  this._sessionResource = context.element.sessionResource;
174
200
  terminalData = migrateLegacyTerminalToolSpecificData(terminalData);
175
201
  this._terminalData = terminalData;
176
202
  this._terminalCommandUri = terminalData.terminalCommandUri ? URI.revive(terminalData.terminalCommandUri) : undefined;
177
- this._storedCommandId = this._terminalCommandUri ? ( new URLSearchParams(this._terminalCommandUri.query ?? '')).get('command') ?? undefined : undefined;
178
- this._isSerializedInvocation = (toolInvocation.kind === 'toolInvocationSerialized');
179
- const elements = h('.chat-terminal-content-part@container', [
180
- h('.chat-terminal-content-title@title', [
181
- h('.chat-terminal-command-block@commandBlock')
182
- ]),
183
- h('.chat-terminal-content-message@message')
184
- ]);
203
+ this._storedCommandId = this._terminalCommandUri ? ( new URLSearchParams(this._terminalCommandUri.query ?? "")).get("command") ?? undefined : undefined;
204
+ this._isSerializedInvocation = (toolInvocation.kind === "toolInvocationSerialized");
205
+ const elements = h(".chat-terminal-content-part@container", [h(
206
+ ".chat-terminal-content-title@title",
207
+ [h(".chat-terminal-command-block@commandBlock")]
208
+ ), h(".chat-terminal-content-message@message")]);
185
209
  this._titleElement = elements.title;
186
- const command = (terminalData.commandLine.userEdited ?? terminalData.commandLine.toolEdited ?? terminalData.commandLine.original).trimStart();
210
+ const command = (terminalData.commandLine.forDisplay ?? terminalData.commandLine.userEdited ?? terminalData.commandLine.toolEdited ?? terminalData.commandLine.original).trimStart();
187
211
  this._commandText = command;
188
212
  this._terminalOutputContextKey = ChatContextKeys.inChatTerminalToolOutput.bindTo(this._contextKeyService);
189
213
  this._decoration = this._register(this._instantiationService.createInstance(TerminalCommandDecoration, {
@@ -192,16 +216,28 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
192
216
  getIconElement: () => undefined,
193
217
  getResolvedCommand: () => this._getResolvedCommand()
194
218
  }));
195
- const titlePart = this._register(_instantiationService.createInstance(ChatQueryTitlePart, elements.commandBlock, ( new MarkdownString([
196
- `\`\`\`${terminalData.language}`,
197
- `${command.replaceAll('```', '\\`\\`\\`')}`,
198
- `\`\`\``
199
- ].join('\n'), { supportThemeIcons: true })), undefined));
219
+ const displayCommand = terminalData.presentationOverrides?.commandLine ?? command;
220
+ const displayLanguage = terminalData.presentationOverrides?.language ?? terminalData.language;
221
+ const titlePart = this._register(
222
+ _instantiationService.createInstance(ChatQueryTitlePart, elements.commandBlock, ( new MarkdownString([
223
+ `\`\`\`${displayLanguage}`,
224
+ `${displayCommand.replaceAll("```", "\\`\\`\\`")}`,
225
+ `\`\`\``
226
+ ].join("\n"), {
227
+ supportThemeIcons: true
228
+ })), undefined)
229
+ );
200
230
  this._register(titlePart.onDidChangeHeight(() => {
201
231
  this._decoration.update();
202
- this._onDidChangeHeight.fire();
203
232
  }));
204
- this._outputView = this._register(this._instantiationService.createInstance(ChatTerminalToolOutputSection, () => this._onDidChangeHeight.fire(), () => this._ensureTerminalInstance(), () => this._getResolvedCommand(), () => this._terminalData.terminalCommandOutput, () => this._commandText, () => this._terminalData.terminalTheme));
233
+ this._outputView = this._register(this._instantiationService.createInstance(
234
+ ChatTerminalToolOutputSection,
235
+ () => this._ensureTerminalInstance(),
236
+ () => this._getResolvedCommand(),
237
+ () => this._terminalData.terminalCommandOutput,
238
+ () => this._commandText,
239
+ () => this._terminalData.terminalTheme
240
+ ));
205
241
  elements.container.append(this._outputView.domNode);
206
242
  this._register(this._outputView.onDidFocus(() => this._handleOutputFocus()));
207
243
  this._register(this._outputView.onDidBlur(e => this._handleOutputBlur(e)));
@@ -210,48 +246,96 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
210
246
  this._focusAction.value?.refreshKeybindingTooltip();
211
247
  this._showOutputAction.value?.refreshKeybindingTooltip();
212
248
  }));
213
- const actionBarEl = h('.chat-terminal-action-bar@actionBar');
249
+ const actionBarEl = h(".chat-terminal-action-bar@actionBar");
214
250
  elements.title.append(actionBarEl.root);
215
251
  this._actionBar = this._register(( new ActionBar(actionBarEl.actionBar, {})));
216
252
  this._initializeTerminalActions();
217
253
  this._terminalService.whenConnected.then(() => this._initializeTerminalActions());
218
254
  let pastTenseMessage;
219
255
  if (toolInvocation.pastTenseMessage) {
220
- pastTenseMessage = `${typeof toolInvocation.pastTenseMessage === 'string' ? toolInvocation.pastTenseMessage : toolInvocation.pastTenseMessage.value}`;
256
+ pastTenseMessage = `${typeof toolInvocation.pastTenseMessage === "string" ? toolInvocation.pastTenseMessage : toolInvocation.pastTenseMessage.value}`;
221
257
  }
222
258
  const markdownContent = ( new MarkdownString(pastTenseMessage, {
223
259
  supportThemeIcons: true,
224
- isTrusted: isMarkdownString(toolInvocation.pastTenseMessage) ? toolInvocation.pastTenseMessage.isTrusted : false,
260
+ isTrusted: isMarkdownString(toolInvocation.pastTenseMessage) ? toolInvocation.pastTenseMessage.isTrusted : false
225
261
  }));
226
262
  const chatMarkdownContent = {
227
- kind: 'markdownContent',
228
- content: markdownContent,
263
+ kind: "markdownContent",
264
+ content: markdownContent
229
265
  };
230
266
  const codeBlockRenderOptions = {
231
267
  hideToolbar: true,
232
268
  reserveWidth: 19,
233
269
  verticalPadding: 5,
234
270
  editorOptions: {
235
- wordWrap: 'on'
271
+ wordWrap: "on"
236
272
  }
237
273
  };
238
274
  const markdownOptions = {
239
275
  codeBlockRenderOptions,
240
276
  accessibilityOptions: pastTenseMessage ? {
241
- statusMessage: ( localize(5733, '{0}', stripIcons(pastTenseMessage)))
277
+ statusMessage: ( localize(5986, "{0}", stripIcons(pastTenseMessage)))
242
278
  } : undefined
243
279
  };
244
- this.markdownPart = this._register(_instantiationService.createInstance(ChatMarkdownContentPart, chatMarkdownContent, context, editorPool, false, codeBlockStartIndex, renderer, {}, currentWidthDelegate(), codeBlockModelCollection, markdownOptions));
245
- this._register(this.markdownPart.onDidChangeHeight(() => this._onDidChangeHeight.fire()));
280
+ this.markdownPart = this._register(_instantiationService.createInstance(
281
+ ChatMarkdownContentPart,
282
+ chatMarkdownContent,
283
+ context,
284
+ editorPool,
285
+ false,
286
+ codeBlockStartIndex,
287
+ renderer,
288
+ {},
289
+ currentWidthDelegate(),
290
+ codeBlockModelCollection,
291
+ markdownOptions
292
+ ));
246
293
  elements.message.append(this.markdownPart.domNode);
247
- const progressPart = this._register(_instantiationService.createInstance(ChatProgressSubPart, elements.container, this.getIcon(), terminalData.autoApproveInfo));
248
- this.domNode = progressPart.domNode;
294
+ const progressPart = this._register(_instantiationService.createInstance(
295
+ ChatProgressSubPart,
296
+ elements.container,
297
+ this.getIcon(),
298
+ terminalData.autoApproveInfo
299
+ ));
249
300
  this._decoration.update();
250
- if (expandedStateByInvocation.get(toolInvocation)) {
301
+ const terminalToolsInThinking = this._configurationService.getValue(ChatConfiguration.TerminalToolsInThinking);
302
+ const requiresConfirmation = toolInvocation.kind === "toolInvocation" && IChatToolInvocation.getConfirmationMessages(toolInvocation);
303
+ if (terminalToolsInThinking && !requiresConfirmation) {
304
+ this._isInThinkingContainer = true;
305
+ this.domNode = this._createCollapsibleWrapper(progressPart.domNode, command, toolInvocation, context);
306
+ } else {
307
+ this.domNode = progressPart.domNode;
308
+ }
309
+ const hasStoredOutput = !!terminalData.terminalCommandOutput;
310
+ if (expandedStateByInvocation.get(toolInvocation) || (this._isInThinkingContainer && IChatToolInvocation.isComplete(toolInvocation) && hasStoredOutput)) {
251
311
  void this._toggleOutput(true);
252
312
  }
253
313
  this._register(this._terminalChatService.registerProgressPart(this));
254
314
  }
315
+ _createCollapsibleWrapper(contentElement, commandText, toolInvocation, context) {
316
+ const maxCommandLength = 50;
317
+ const truncatedCommand = commandText.length > maxCommandLength ? commandText.substring(0, maxCommandLength) + "..." : commandText;
318
+ const isComplete = IChatToolInvocation.isComplete(toolInvocation);
319
+ const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
320
+ const hasError = autoExpandFailures && this._terminalData.terminalCommandState?.exitCode !== undefined && this._terminalData.terminalCommandState.exitCode !== 0;
321
+ const initialExpanded = !isComplete || hasError;
322
+ const wrapper = this._register(this._instantiationService.createInstance(
323
+ ChatTerminalThinkingCollapsibleWrapper,
324
+ truncatedCommand,
325
+ contentElement,
326
+ context,
327
+ initialExpanded,
328
+ isComplete
329
+ ));
330
+ this._thinkingCollapsibleWrapper = wrapper;
331
+ return wrapper.domNode;
332
+ }
333
+ expandCollapsibleWrapper() {
334
+ this._thinkingCollapsibleWrapper?.expand();
335
+ }
336
+ markCollapsibleWrapperComplete() {
337
+ this._thinkingCollapsibleWrapper?.markComplete();
338
+ }
255
339
  async _initializeTerminalActions() {
256
340
  if (this._store.isDisposed) {
257
341
  return;
@@ -261,7 +345,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
261
345
  this._addActions();
262
346
  return;
263
347
  }
264
- const attachInstance = async (instance) => {
348
+ const attachInstance = async instance => {
265
349
  if (this._store.isDisposed) {
266
350
  return;
267
351
  }
@@ -288,7 +372,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
288
372
  return;
289
373
  }
290
374
  if (!this._terminalSessionRegistration) {
291
- const listener = this._terminalChatService.onDidRegisterTerminalInstanceWithToolSession(async (instance) => {
375
+ const listener = this._terminalChatService.onDidRegisterTerminalInstanceWithToolSession(async instance => {
292
376
  const registeredInstance = await this._terminalChatService.getTerminalInstanceByToolSessionId(terminalToolSessionId);
293
377
  if (instance !== registeredInstance) {
294
378
  return;
@@ -299,6 +383,12 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
299
383
  });
300
384
  this._terminalSessionRegistration = this._store.add(listener);
301
385
  }
386
+ this._store.add(this._terminalChatService.onDidContinueInBackground(sessionId => {
387
+ if (sessionId === terminalToolSessionId) {
388
+ this._terminalData.didContinueInBackground = true;
389
+ this._removeContinueInBackgroundAction();
390
+ }
391
+ }));
302
392
  }
303
393
  _addActions(terminalInstance, terminalToolSessionId) {
304
394
  if (this._store.isDisposed) {
@@ -307,11 +397,35 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
307
397
  const actionBar = this._actionBar;
308
398
  this._removeFocusAction();
309
399
  const resolvedCommand = this._getResolvedCommand(terminalInstance);
400
+ this._removeContinueInBackgroundAction();
310
401
  if (terminalInstance) {
311
402
  const isTerminalHidden = terminalInstance && terminalToolSessionId ? this._terminalChatService.isBackgroundTerminal(terminalToolSessionId) : false;
312
- const focusAction = this._instantiationService.createInstance(FocusChatInstanceAction, terminalInstance, resolvedCommand, this._terminalCommandUri, this._storedCommandId, isTerminalHidden);
403
+ const focusAction = this._instantiationService.createInstance(
404
+ FocusChatInstanceAction,
405
+ terminalInstance,
406
+ resolvedCommand,
407
+ this._terminalCommandUri,
408
+ this._storedCommandId,
409
+ isTerminalHidden
410
+ );
313
411
  this._focusAction.value = focusAction;
314
- actionBar.push(focusAction, { icon: true, label: false, index: 0 });
412
+ actionBar.push(focusAction, {
413
+ icon: true,
414
+ label: false,
415
+ index: 0
416
+ });
417
+ if (terminalToolSessionId && !this._terminalData.isBackground && !this._terminalData.didContinueInBackground) {
418
+ const isStillRunning = resolvedCommand?.exitCode === undefined && this._terminalData.terminalCommandState?.exitCode === undefined;
419
+ if (isStillRunning) {
420
+ const continueAction = this._instantiationService.createInstance(ContinueInBackgroundAction, terminalToolSessionId);
421
+ this._continueInBackgroundAction.value = continueAction;
422
+ actionBar.push(continueAction, {
423
+ icon: true,
424
+ label: false,
425
+ index: 0
426
+ });
427
+ }
428
+ }
315
429
  }
316
430
  this._ensureShowOutputAction(resolvedCommand);
317
431
  this._decoration.update(resolvedCommand);
@@ -327,6 +441,9 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
327
441
  if (this._store.isDisposed) {
328
442
  return;
329
443
  }
444
+ if (this._isInThinkingContainer) {
445
+ return;
446
+ }
330
447
  const resolvedCommand = command ?? this._getResolvedCommand();
331
448
  const hasSnapshot = !!this._terminalData.terminalCommandOutput;
332
449
  if (!resolvedCommand && !hasSnapshot) {
@@ -336,8 +453,9 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
336
453
  if (!showOutputAction) {
337
454
  showOutputAction = this._instantiationService.createInstance(ToggleChatTerminalOutputAction, () => this._toggleOutputFromAction());
338
455
  this._showOutputAction.value = showOutputAction;
456
+ const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
339
457
  const exitCode = resolvedCommand?.exitCode ?? this._terminalData.terminalCommandState?.exitCode;
340
- if (exitCode) {
458
+ if (exitCode !== undefined && exitCode !== 0 && autoExpandFailures) {
341
459
  this._toggleOutput(true);
342
460
  }
343
461
  }
@@ -348,15 +466,17 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
348
466
  if (existingIndex >= 0 && existingIndex !== actionBar.length() - 1) {
349
467
  actionBar.pull(existingIndex);
350
468
  this._showOutputActionAdded = false;
351
- }
352
- else if (existingIndex >= 0) {
469
+ } else if (existingIndex >= 0) {
353
470
  return;
354
471
  }
355
472
  }
356
473
  if (this._showOutputActionAdded) {
357
474
  return;
358
475
  }
359
- actionBar.push([showOutputAction], { icon: true, label: false });
476
+ actionBar.push([showOutputAction], {
477
+ icon: true,
478
+ label: false
479
+ });
360
480
  this._showOutputActionAdded = true;
361
481
  }
362
482
  _clearCommandAssociation(options) {
@@ -379,32 +499,91 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
379
499
  this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
380
500
  return resolvedCommand;
381
501
  };
382
- const attachCommandDetection = async (commandDetection) => {
502
+ const attachCommandDetection = async commandDetection => {
383
503
  commandDetectionListener.clear();
384
504
  if (!commandDetection) {
385
505
  await tryResolveCommand();
386
506
  return;
387
507
  }
388
- commandDetectionListener.value = commandDetection.onCommandFinished(() => {
508
+ const store = ( new DisposableStore());
509
+ let receivedDataCount = 0;
510
+ const hasRealOutput = () => {
511
+ if (this._terminalData.terminalCommandOutput?.text?.trim()) {
512
+ return true;
513
+ }
514
+ const command = this._getResolvedCommand(terminalInstance);
515
+ if (!command?.executedMarker || terminalInstance.isDisposed) {
516
+ return false;
517
+ }
518
+ const buffer = terminalInstance.xterm?.raw.buffer.active;
519
+ if (!buffer) {
520
+ return false;
521
+ }
522
+ const cursorLine = buffer.baseY + buffer.cursorY;
523
+ if (cursorLine > command.executedMarker.line) {
524
+ return true;
525
+ }
526
+ return receivedDataCount > 2;
527
+ };
528
+ const autoExpand = store.add(( new TerminalToolAutoExpand({
529
+ commandDetection,
530
+ onWillData: terminalInstance.onWillData,
531
+ shouldAutoExpand: () => !this._outputView.isExpanded && !this._userToggledOutput && !this._store.isDisposed && !expandedStateByInvocation.get(this.toolInvocation),
532
+ hasRealOutput
533
+ })));
534
+ store.add(autoExpand.onDidRequestExpand(() => {
535
+ if (this._isInThinkingContainer) {
536
+ this.expandCollapsibleWrapper();
537
+ }
538
+ this._toggleOutput(true);
539
+ }));
540
+ store.add(terminalInstance.onWillData(() => {
541
+ receivedDataCount++;
542
+ }));
543
+ store.add(commandDetection.onCommandExecuted(() => {
544
+ this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
545
+ }));
546
+ store.add(commandDetection.onCommandFinished(() => {
389
547
  this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
390
548
  const resolvedCommand = this._getResolvedCommand(terminalInstance);
549
+ this.markCollapsibleWrapperComplete();
550
+ if (resolvedCommand?.exitCode === 0 && this._outputView.isExpanded && !this._userToggledOutput) {
551
+ this._toggleOutput(false);
552
+ }
553
+ const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
554
+ if (autoExpandFailures && resolvedCommand?.exitCode !== undefined && resolvedCommand.exitCode !== 0 && this._thinkingCollapsibleWrapper) {
555
+ this.expandCollapsibleWrapper();
556
+ }
391
557
  if (resolvedCommand?.endMarker) {
392
558
  commandDetectionListener.clear();
393
559
  }
394
- });
560
+ }));
561
+ commandDetectionListener.value = store;
395
562
  const resolvedImmediately = await tryResolveCommand();
396
563
  if (resolvedImmediately?.endMarker) {
397
564
  commandDetectionListener.clear();
565
+ this.markCollapsibleWrapperComplete();
566
+ if (resolvedImmediately.exitCode === 0 && this._outputView.isExpanded && !this._userToggledOutput) {
567
+ this._toggleOutput(false);
568
+ }
569
+ const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
570
+ if (autoExpandFailures && resolvedImmediately.exitCode !== undefined && resolvedImmediately.exitCode !== 0 && this._thinkingCollapsibleWrapper) {
571
+ this.expandCollapsibleWrapper();
572
+ }
398
573
  return;
399
574
  }
400
575
  };
401
576
  attachCommandDetection(terminalInstance.capabilities.get(TerminalCapability.CommandDetection));
402
- this._register(terminalInstance.capabilities.onDidAddCommandDetectionCapability(cd => attachCommandDetection(cd)));
577
+ this._register(
578
+ terminalInstance.capabilities.onDidAddCommandDetectionCapability(cd => attachCommandDetection(cd))
579
+ );
403
580
  const instanceListener = this._register(terminalInstance.onDisposed(() => {
404
581
  if (this._terminalInstance === terminalInstance) {
405
582
  this._terminalInstance = undefined;
406
583
  }
407
- this._clearCommandAssociation({ clearPersistentData: true });
584
+ this._clearCommandAssociation({
585
+ clearPersistentData: true
586
+ });
408
587
  commandDetectionListener.clear();
409
588
  if (!this._store.isDisposed) {
410
589
  this._actionBar.clear();
@@ -430,10 +609,24 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
430
609
  }
431
610
  this._focusAction.clear();
432
611
  }
612
+ _removeContinueInBackgroundAction() {
613
+ if (this._store.isDisposed) {
614
+ return;
615
+ }
616
+ const actionBar = this._actionBar;
617
+ const continueAction = this._continueInBackgroundAction.value;
618
+ if (actionBar && continueAction) {
619
+ const existingIndex = actionBar.viewItems.findIndex(item => item.action === continueAction);
620
+ if (existingIndex >= 0) {
621
+ actionBar.pull(existingIndex);
622
+ }
623
+ }
624
+ this._continueInBackgroundAction.clear();
625
+ }
433
626
  async _toggleOutput(expanded) {
434
627
  const didChange = await this._outputView.toggle(expanded);
435
628
  const isExpanded = this._outputView.isExpanded;
436
- this._titleElement.classList.toggle('chat-terminal-content-title-no-bottom-radius', isExpanded);
629
+ this._titleElement.classList.toggle("chat-terminal-content-title-no-bottom-radius", isExpanded);
437
630
  this._showOutputAction.value?.syncPresentation(isExpanded);
438
631
  if (didChange) {
439
632
  expandedStateByInvocation.set(this.toolInvocation, isExpanded);
@@ -489,6 +682,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
489
682
  }
490
683
  }
491
684
  async toggleOutputFromKeyboard() {
685
+ this._userToggledOutput = true;
492
686
  if (!this._outputView.isExpanded) {
493
687
  await this._toggleOutput(true);
494
688
  this.focusOutput();
@@ -497,6 +691,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
497
691
  await this._collapseOutputAndFocusInput();
498
692
  }
499
693
  async _toggleOutputFromAction() {
694
+ this._userToggledOutput = true;
500
695
  if (!this._outputView.isExpanded) {
501
696
  await this._toggleOutput(true);
502
697
  return;
@@ -514,30 +709,51 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
514
709
  return undefined;
515
710
  }
516
711
  const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
517
- const commands = commandDetection?.commands;
518
- if (!commands || commands.length === 0) {
712
+ if (!commandDetection) {
519
713
  return undefined;
520
714
  }
521
- return commands.find(c => c.id === this._terminalData.terminalCommandId);
715
+ const targetId = this._terminalData.terminalCommandId;
716
+ if (!targetId) {
717
+ return undefined;
718
+ }
719
+ const commands = commandDetection.commands;
720
+ if (commands && commands.length > 0) {
721
+ const fromHistory = commands.find(c => c.id === targetId);
722
+ if (fromHistory) {
723
+ return fromHistory;
724
+ }
725
+ }
726
+ const executing = commandDetection.executingCommandObject;
727
+ if (executing && executing.id === targetId) {
728
+ return executing;
729
+ }
730
+ return undefined;
522
731
  }
523
732
  };
524
- ChatTerminalToolProgressPart = ( __decorate([
525
- ( __param(8, IInstantiationService)),
526
- ( __param(9, ITerminalChatService)),
527
- ( __param(10, ITerminalService)),
528
- ( __param(11, IContextKeyService)),
529
- ( __param(12, IChatWidgetService)),
530
- ( __param(13, IKeybindingService))
531
- ], ChatTerminalToolProgressPart));
733
+ ChatTerminalToolProgressPart = ( __decorate([( __param(8, IInstantiationService)), ( __param(9, ITerminalChatService)), ( __param(10, ITerminalService)), ( __param(11, IContextKeyService)), ( __param(12, IChatWidgetService)), ( __param(13, IKeybindingService)), ( __param(14, IConfigurationService))], ChatTerminalToolProgressPart));
532
734
  let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends Disposable {
533
735
  get isExpanded() {
534
- return this.domNode.classList.contains('expanded');
535
- }
536
- get onDidFocus() { return this._onDidFocusEmitter.event; }
537
- get onDidBlur() { return this._onDidBlurEmitter.event; }
538
- constructor(_onDidChangeHeight, _ensureTerminalInstance, _resolveCommand, _getTerminalCommandOutput, _getCommandText, _getStoredTheme, _accessibleViewService, _instantiationService, _terminalConfigurationService, _themeService, _contextKeyService) {
736
+ return this.domNode.classList.contains("expanded");
737
+ }
738
+ get onDidFocus() {
739
+ return this._onDidFocusEmitter.event;
740
+ }
741
+ get onDidBlur() {
742
+ return this._onDidBlurEmitter.event;
743
+ }
744
+ constructor(
745
+ _ensureTerminalInstance,
746
+ _resolveCommand,
747
+ _getTerminalCommandOutput,
748
+ _getCommandText,
749
+ _getStoredTheme,
750
+ _accessibleViewService,
751
+ _instantiationService,
752
+ _terminalConfigurationService,
753
+ _themeService,
754
+ _contextKeyService
755
+ ) {
539
756
  super();
540
- this._onDidChangeHeight = _onDidChangeHeight;
541
757
  this._ensureTerminalInstance = _ensureTerminalInstance;
542
758
  this._resolveCommand = _resolveCommand;
543
759
  this._getTerminalCommandOutput = _getTerminalCommandOutput;
@@ -548,30 +764,39 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
548
764
  this._terminalConfigurationService = _terminalConfigurationService;
549
765
  this._themeService = _themeService;
550
766
  this._contextKeyService = _contextKeyService;
767
+ this._isAtBottom = true;
768
+ this._isProgrammaticScroll = false;
551
769
  this._onDidFocusEmitter = this._register(( new Emitter()));
552
770
  this._onDidBlurEmitter = this._register(( new Emitter()));
553
- const containerElements = h('.chat-terminal-output-container@container', [
554
- h('.chat-terminal-output-body@body', [
555
- h('.chat-terminal-output-content@content', [
556
- h('.chat-terminal-output-terminal@terminal'),
557
- h('.chat-terminal-output-empty@empty')
558
- ])
559
- ])
560
- ]);
771
+ const containerElements = h(".chat-terminal-output-container@container", [h(
772
+ ".chat-terminal-output-body@body",
773
+ [h(".chat-terminal-output-content@content", [
774
+ h(".chat-terminal-output-terminal@terminal"),
775
+ h(".chat-terminal-output-empty@empty")
776
+ ])]
777
+ )]);
561
778
  this.domNode = containerElements.container;
562
- this.domNode.classList.add('collapsed');
779
+ this.domNode.classList.add("collapsed");
563
780
  this._outputBody = containerElements.body;
564
781
  this._contentContainer = containerElements.content;
565
782
  this._terminalContainer = containerElements.terminal;
566
783
  this._emptyElement = containerElements.empty;
567
784
  this._contentContainer.appendChild(this._emptyElement);
568
- this._register(addDisposableListener(this.domNode, EventType.FOCUS_IN, () => this._onDidFocusEmitter.fire()));
569
- this._register(addDisposableListener(this.domNode, EventType.FOCUS_OUT, event => this._onDidBlurEmitter.fire(event)));
785
+ this._register(
786
+ addDisposableListener(this.domNode, EventType.FOCUS_IN, () => this._onDidFocusEmitter.fire())
787
+ );
788
+ this._register(addDisposableListener(
789
+ this.domNode,
790
+ EventType.FOCUS_OUT,
791
+ event => this._onDidBlurEmitter.fire(event)
792
+ ));
570
793
  const resizeObserver = ( new ResizeObserver(() => this._handleResize()));
571
794
  resizeObserver.observe(this.domNode);
572
795
  this._register(toDisposable(() => resizeObserver.disconnect()));
573
796
  this._applyBackgroundColor();
574
- this._register(this._themeService.onDidColorThemeChange(() => this._applyBackgroundColor()));
797
+ this._register(
798
+ this._themeService.onDidColorThemeChange(() => this._applyBackgroundColor())
799
+ );
575
800
  }
576
801
  async toggle(expanded) {
577
802
  const currentlyExpanded = this.isExpanded;
@@ -581,16 +806,16 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
581
806
  }
582
807
  return false;
583
808
  }
584
- this._setExpanded(expanded);
585
809
  if (!expanded) {
586
- this._renderedOutputHeight = undefined;
587
- this._onDidChangeHeight();
810
+ this._setExpanded(false);
811
+ this._isAtBottom = true;
588
812
  return true;
589
813
  }
590
814
  if (!this._scrollableContainer) {
591
815
  await this._createScrollableContainer();
592
816
  }
593
817
  await this._updateTerminalContent();
818
+ this._setExpanded(true);
594
819
  this._layoutOutput();
595
820
  this._scrollOutputToBottom();
596
821
  this._scheduleOutputRelayout();
@@ -611,14 +836,12 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
611
836
  if (!commandText) {
612
837
  return;
613
838
  }
614
- const ariaLabel = ( localize(5734, 'Terminal output for {0}', commandText));
839
+ const ariaLabel = ( localize(5987, "Terminal output for {0}", commandText));
615
840
  const scrollableDomNode = this._scrollableContainer.getDomNode();
616
- scrollableDomNode.setAttribute('role', 'region');
841
+ scrollableDomNode.setAttribute("role", "region");
617
842
  const accessibleViewHint = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.TerminalChatOutput);
618
- const label = accessibleViewHint
619
- ? ariaLabel + ', ' + accessibleViewHint
620
- : ariaLabel;
621
- scrollableDomNode.setAttribute('aria-label', label);
843
+ const label = accessibleViewHint ? ariaLabel + ", " + accessibleViewHint : ariaLabel;
844
+ scrollableDomNode.setAttribute("aria-label", label);
622
845
  }
623
846
  getCommandAndOutputAsText() {
624
847
  const command = this._resolveCommand();
@@ -626,43 +849,69 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
626
849
  if (!commandText) {
627
850
  return undefined;
628
851
  }
629
- const commandHeader = ( localize(5735, 'Command: {0}', commandText));
852
+ const commandHeader = ( localize(5988, "Command: {0}", commandText));
630
853
  if (command) {
631
854
  const rawOutput = command.getOutput();
632
855
  if (!rawOutput || rawOutput.trim().length === 0) {
633
- return `${commandHeader}\n${( localize(5736, 'No output was produced by the command.'))}`;
856
+ return `${commandHeader}\n${( localize(5989, "No output was produced by the command."))}`;
634
857
  }
635
- const lines = rawOutput.split('\n');
636
- return `${commandHeader}\n${lines.join('\n').trimEnd()}`;
858
+ const lines = rawOutput.split("\n");
859
+ return `${commandHeader}\n${lines.join("\n").trimEnd()}`;
637
860
  }
638
861
  const snapshot = this._getTerminalCommandOutput();
639
862
  if (!snapshot) {
640
- return `${commandHeader}\n${( localize(5737, 'Command output is no longer available.'))}`;
863
+ return `${commandHeader}\n${( localize(5990, "Command output is no longer available."))}`;
641
864
  }
642
- const plain = removeAnsiEscapeCodes((snapshot.text ?? ''));
865
+ const plain = removeAnsiEscapeCodes((snapshot.text ?? ""));
643
866
  if (!plain.trim().length) {
644
- return `${commandHeader}\n${( localize(5736, 'No output was produced by the command.'))}`;
867
+ return `${commandHeader}\n${( localize(5989, "No output was produced by the command."))}`;
645
868
  }
646
869
  let outputText = plain.trimEnd();
647
870
  if (snapshot.truncated) {
648
- outputText += `\n${( localize(5738, 'Output truncated.'))}`;
871
+ outputText += `\n${( localize(5991, "Output truncated."))}`;
649
872
  }
650
873
  return `${commandHeader}\n${outputText}`;
651
874
  }
652
875
  _setExpanded(expanded) {
653
- this.domNode.classList.toggle('expanded', expanded);
654
- this.domNode.classList.toggle('collapsed', !expanded);
876
+ this.domNode.classList.toggle("expanded", expanded);
877
+ this.domNode.classList.toggle("collapsed", !expanded);
655
878
  }
656
879
  async _createScrollableContainer() {
657
880
  this._scrollableContainer = this._register(( new DomScrollableElement(this._outputBody, {
658
881
  vertical: ScrollbarVisibility.Hidden,
659
- horizontal: ScrollbarVisibility.Auto,
882
+ horizontal: ScrollbarVisibility.Hidden,
660
883
  handleMouseWheel: true
661
884
  })));
662
885
  const scrollableDomNode = this._scrollableContainer.getDomNode();
663
886
  scrollableDomNode.tabIndex = 0;
664
887
  this.domNode.appendChild(scrollableDomNode);
665
888
  this.updateAriaLabel();
889
+ this._register(addDisposableListener(this.domNode, EventType.MOUSE_ENTER, () => {
890
+ this._scrollableContainer?.updateOptions({
891
+ horizontal: ScrollbarVisibility.Auto
892
+ });
893
+ }));
894
+ this._register(addDisposableListener(this.domNode, EventType.MOUSE_LEAVE, () => {
895
+ this._scrollableContainer?.updateOptions({
896
+ horizontal: ScrollbarVisibility.Hidden
897
+ });
898
+ }));
899
+ this._register(addDisposableListener(this.domNode, EventType.FOCUS_IN, () => {
900
+ this._scrollableContainer?.updateOptions({
901
+ horizontal: ScrollbarVisibility.Auto
902
+ });
903
+ }));
904
+ this._register(addDisposableListener(this.domNode, EventType.FOCUS_OUT, () => {
905
+ this._scrollableContainer?.updateOptions({
906
+ horizontal: ScrollbarVisibility.Hidden
907
+ });
908
+ }));
909
+ this._register(this._scrollableContainer.onScroll(() => {
910
+ if (this._isProgrammaticScroll) {
911
+ return;
912
+ }
913
+ this._isAtBottom = this._computeIsAtBottom();
914
+ }));
666
915
  }
667
916
  async _updateTerminalContent() {
668
917
  const liveTerminalInstance = await this._resolveLiveTerminal();
@@ -686,50 +935,88 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
686
935
  return true;
687
936
  }
688
937
  await liveTerminalInstance.xtermReadyPromise;
689
- if (liveTerminalInstance.isDisposed || !liveTerminalInstance.xterm) {
938
+ if (this._store.isDisposed || liveTerminalInstance.isDisposed || !liveTerminalInstance.xterm) {
690
939
  this._disposeLiveMirror();
691
940
  return false;
692
941
  }
693
- this._mirror = this._register(this._instantiationService.createInstance(DetachedTerminalCommandMirror, liveTerminalInstance.xterm, command));
694
- await this._mirror.attach(this._terminalContainer);
695
- const result = await this._mirror.renderCommand();
696
- if (!result || result.lineCount === 0) {
697
- this._showEmptyMessage(( localize(5736, 'No output was produced by the command.')));
942
+ const mirror = this._register(
943
+ this._instantiationService.createInstance(DetachedTerminalCommandMirror, liveTerminalInstance.xterm, command)
944
+ );
945
+ this._mirror = mirror;
946
+ this._register(mirror.onDidUpdate(result => {
947
+ if (result.lineCount && result.lineCount > 0) {
948
+ this._hideEmptyMessage();
949
+ }
950
+ this._layoutOutput(result.lineCount, result.maxColumnWidth);
951
+ if (this._isAtBottom) {
952
+ this._scrollOutputToBottom();
953
+ }
954
+ }));
955
+ this._register(mirror.onDidInput(data => {
956
+ if (!liveTerminalInstance.isDisposed) {
957
+ liveTerminalInstance.sendText(data, false);
958
+ }
959
+ }));
960
+ await mirror.attach(this._terminalContainer);
961
+ let result = await mirror.renderCommand();
962
+ let commandFinished = !!command.endMarker;
963
+ let hasOutput = result && result.lineCount && result.lineCount > 0;
964
+ if (!hasOutput) {
965
+ const maxRetries = 10;
966
+ for (let retry = 0; retry < maxRetries && !hasOutput; retry++) {
967
+ await timeout(100);
968
+ if (this._store.isDisposed) {
969
+ return true;
970
+ }
971
+ result = await mirror.renderCommand();
972
+ hasOutput = result && result.lineCount && result.lineCount > 0;
973
+ commandFinished = !!command.endMarker;
974
+ if (commandFinished) {
975
+ break;
976
+ }
977
+ }
698
978
  }
699
- else {
979
+ if (!hasOutput) {
980
+ if (commandFinished) {
981
+ this._showEmptyMessage(( localize(5989, "No output was produced by the command.")));
982
+ }
983
+ } else {
700
984
  this._hideEmptyMessage();
701
985
  }
702
- this._layoutOutput(result?.lineCount ?? 0);
986
+ this._layoutOutput(result?.lineCount ?? 0, result?.maxColumnWidth);
703
987
  return true;
704
988
  }
705
989
  async _renderSnapshotOutput(snapshot) {
706
990
  if (this._snapshotMirror) {
707
- this._layoutOutput(snapshot.lineCount ?? 0);
991
+ this._layoutOutput(snapshot.lineCount ?? 0, this._lastRenderedMaxColumnWidth);
992
+ return;
993
+ }
994
+ if (this._store.isDisposed) {
708
995
  return;
709
996
  }
710
997
  clearNode(this._terminalContainer);
711
- this._snapshotMirror = this._register(this._instantiationService.createInstance(DetachedTerminalSnapshotMirror, snapshot, this._getStoredTheme));
998
+ this._snapshotMirror = this._register(
999
+ this._instantiationService.createInstance(DetachedTerminalSnapshotMirror, snapshot, this._getStoredTheme)
1000
+ );
712
1001
  await this._snapshotMirror.attach(this._terminalContainer);
713
1002
  this._snapshotMirror.setOutput(snapshot);
714
1003
  const result = await this._snapshotMirror.render();
715
1004
  const hasText = !!snapshot.text && snapshot.text.length > 0;
716
1005
  if (hasText) {
717
1006
  this._hideEmptyMessage();
718
- }
719
- else {
720
- this._showEmptyMessage(( localize(5736, 'No output was produced by the command.')));
1007
+ } else {
1008
+ this._showEmptyMessage(( localize(5989, "No output was produced by the command.")));
721
1009
  }
722
1010
  const lineCount = result?.lineCount ?? snapshot.lineCount ?? 0;
723
- this._layoutOutput(lineCount);
1011
+ this._layoutOutput(lineCount, result?.maxColumnWidth);
724
1012
  }
725
1013
  _renderUnavailableMessage(liveTerminalInstance) {
726
1014
  clearNode(this._terminalContainer);
727
1015
  this._lastRenderedLineCount = undefined;
728
1016
  if (!liveTerminalInstance) {
729
- this._showEmptyMessage(( localize(5739, 'Terminal is no longer available.')));
730
- }
731
- else {
732
- this._showEmptyMessage(( localize(5740, 'Command information is not available.')));
1017
+ this._showEmptyMessage(( localize(5992, "Terminal is no longer available.")));
1018
+ } else {
1019
+ this._showEmptyMessage(( localize(5993, "Command information is not available.")));
733
1020
  }
734
1021
  }
735
1022
  async _resolveLiveTerminal() {
@@ -738,13 +1025,13 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
738
1025
  }
739
1026
  _showEmptyMessage(message) {
740
1027
  this._emptyElement.textContent = message;
741
- this._terminalContainer.classList.add('chat-terminal-output-terminal-no-output');
742
- this.domNode.classList.add('chat-terminal-output-container-no-output');
1028
+ this._terminalContainer.classList.add("chat-terminal-output-terminal-no-output");
1029
+ this.domNode.classList.add("chat-terminal-output-container-no-output");
743
1030
  }
744
1031
  _hideEmptyMessage() {
745
- this._emptyElement.textContent = '';
746
- this._terminalContainer.classList.remove('chat-terminal-output-terminal-no-output');
747
- this.domNode.classList.remove('chat-terminal-output-container-no-output');
1032
+ this._emptyElement.textContent = "";
1033
+ this._terminalContainer.classList.remove("chat-terminal-output-terminal-no-output");
1034
+ this.domNode.classList.remove("chat-terminal-output-container-no-output");
748
1035
  }
749
1036
  _disposeLiveMirror() {
750
1037
  if (this._mirror) {
@@ -765,26 +1052,30 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
765
1052
  if (this.isExpanded) {
766
1053
  this._layoutOutput();
767
1054
  this._scrollOutputToBottom();
768
- }
769
- else {
1055
+ } else {
770
1056
  this._scrollableContainer.scanDomNode();
771
1057
  }
772
1058
  }
773
- _layoutOutput(lineCount) {
1059
+ _layoutOutput(lineCount, maxColumnWidth) {
774
1060
  if (!this._scrollableContainer) {
775
1061
  return;
776
1062
  }
777
1063
  if (lineCount !== undefined) {
778
1064
  this._lastRenderedLineCount = lineCount;
779
- }
780
- else {
1065
+ } else {
781
1066
  lineCount = this._lastRenderedLineCount;
782
1067
  }
1068
+ if (maxColumnWidth !== undefined) {
1069
+ this._lastRenderedMaxColumnWidth = maxColumnWidth;
1070
+ } else {
1071
+ maxColumnWidth = this._lastRenderedMaxColumnWidth;
1072
+ }
783
1073
  this._scrollableContainer.scanDomNode();
784
1074
  if (!this.isExpanded || lineCount === undefined) {
785
1075
  return;
786
1076
  }
787
1077
  const scrollableDomNode = this._scrollableContainer.getDomNode();
1078
+ this._applyContentWidth(maxColumnWidth);
788
1079
  const rowHeight = this._computeRowHeightPx();
789
1080
  const padding = this._getOutputPadding();
790
1081
  const minHeight = rowHeight * MIN_OUTPUT_ROWS + padding;
@@ -793,31 +1084,68 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
793
1084
  const clampedHeight = Math.min(contentHeight, maxHeight);
794
1085
  const measuredBodyHeight = Math.max(this._outputBody.clientHeight, minHeight);
795
1086
  const appliedHeight = Math.min(clampedHeight, measuredBodyHeight);
796
- scrollableDomNode.style.height = appliedHeight < maxHeight ? `${appliedHeight}px` : '';
1087
+ scrollableDomNode.style.height = appliedHeight < maxHeight ? `${appliedHeight}px` : "";
797
1088
  this._scrollableContainer.scanDomNode();
798
- if (this._renderedOutputHeight !== appliedHeight) {
799
- this._renderedOutputHeight = appliedHeight;
800
- this._onDidChangeHeight();
1089
+ }
1090
+ _computeIsAtBottom() {
1091
+ if (!this._scrollableContainer) {
1092
+ return true;
801
1093
  }
1094
+ const dimensions = this._scrollableContainer.getScrollDimensions();
1095
+ const scrollPosition = this._scrollableContainer.getScrollPosition();
1096
+ const threshold = 5;
1097
+ return scrollPosition.scrollTop >= dimensions.scrollHeight - dimensions.height - threshold;
802
1098
  }
803
1099
  _scrollOutputToBottom() {
804
1100
  if (!this._scrollableContainer) {
805
1101
  return;
806
1102
  }
1103
+ this._isProgrammaticScroll = true;
807
1104
  const dimensions = this._scrollableContainer.getScrollDimensions();
808
- this._scrollableContainer.setScrollPosition({ scrollTop: dimensions.scrollHeight });
1105
+ this._scrollableContainer.setScrollPosition({
1106
+ scrollTop: dimensions.scrollHeight
1107
+ });
1108
+ this._isProgrammaticScroll = false;
809
1109
  }
810
1110
  _getOutputContentHeight(lineCount, rowHeight, padding) {
811
1111
  const contentRows = Math.max(lineCount, MIN_OUTPUT_ROWS);
812
- const adjustedRows = contentRows + (lineCount > MAX_OUTPUT_ROWS ? 1 : 0);
1112
+ const adjustedRows = contentRows + 1;
813
1113
  return (adjustedRows * rowHeight) + padding;
814
1114
  }
815
1115
  _getOutputPadding() {
816
1116
  const style = getComputedStyle(this._outputBody);
817
- const paddingTop = Number.parseFloat(style.paddingTop || '0');
818
- const paddingBottom = Number.parseFloat(style.paddingBottom || '0');
1117
+ const paddingTop = Number.parseFloat(style.paddingTop || "0");
1118
+ const paddingBottom = Number.parseFloat(style.paddingBottom || "0");
819
1119
  return paddingTop + paddingBottom;
820
1120
  }
1121
+ _applyContentWidth(maxColumnWidth) {
1122
+ if (!this._scrollableContainer) {
1123
+ return;
1124
+ }
1125
+ const window = getActiveWindow();
1126
+ const font = this._terminalConfigurationService.getFont(window);
1127
+ const charWidth = font.charWidth;
1128
+ if (!charWidth || !maxColumnWidth || maxColumnWidth <= 0) {
1129
+ return;
1130
+ }
1131
+ const horizontalPadding = 24;
1132
+ const cursorWidth = charWidth;
1133
+ const contentWidth = Math.ceil(maxColumnWidth * charWidth) + horizontalPadding + cursorWidth;
1134
+ const parentWidth = this.domNode.parentElement?.clientWidth ?? 0;
1135
+ const scrollableDomNode = this._scrollableContainer.getDomNode();
1136
+ if (parentWidth > 0 && contentWidth < parentWidth) {
1137
+ scrollableDomNode.style.width = `${contentWidth}px`;
1138
+ this._outputBody.style.width = `${contentWidth}px`;
1139
+ this._terminalContainer.style.width = `${contentWidth}px`;
1140
+ this._terminalContainer.classList.add("chat-terminal-output-terminal-clipped");
1141
+ } else {
1142
+ scrollableDomNode.style.width = "";
1143
+ this._outputBody.style.width = "";
1144
+ this._terminalContainer.style.width = "";
1145
+ this._terminalContainer.classList.remove("chat-terminal-output-terminal-clipped");
1146
+ }
1147
+ this._scrollableContainer.scanDomNode();
1148
+ }
821
1149
  _computeRowHeightPx() {
822
1150
  const window = getActiveWindow();
823
1151
  const font = this._terminalConfigurationService.getFont(window);
@@ -838,16 +1166,10 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
838
1166
  }
839
1167
  }
840
1168
  };
841
- ChatTerminalToolOutputSection = ( __decorate([
842
- ( __param(6, IAccessibleViewService)),
843
- ( __param(7, IInstantiationService)),
844
- ( __param(8, ITerminalConfigurationService)),
845
- ( __param(9, IThemeService)),
846
- ( __param(10, IContextKeyService))
847
- ], ChatTerminalToolOutputSection));
1169
+ ChatTerminalToolOutputSection = ( __decorate([( __param(5, IAccessibleViewService)), ( __param(6, IInstantiationService)), ( __param(7, ITerminalConfigurationService)), ( __param(8, IThemeService)), ( __param(9, IContextKeyService))], ChatTerminalToolOutputSection));
848
1170
  let ToggleChatTerminalOutputAction = class ToggleChatTerminalOutputAction extends Action {
849
1171
  constructor(_toggle, _keybindingService, _telemetryService) {
850
- super(TerminalContribCommandId.ToggleChatTerminalOutput, ( localize(5741, 'Show Output')), ThemeIcon.asClassName(Codicon.chevronRight), true);
1172
+ super(TerminalContribCommandId.ToggleChatTerminalOutput, ( localize(5994, "Show Output")), ThemeIcon.asClassName(Codicon.chevronRight), true);
851
1173
  this._toggle = _toggle;
852
1174
  this._keybindingService = _keybindingService;
853
1175
  this._telemetryService = _telemetryService;
@@ -855,7 +1177,7 @@ let ToggleChatTerminalOutputAction = class ToggleChatTerminalOutputAction extend
855
1177
  this._updateTooltip();
856
1178
  }
857
1179
  async run() {
858
- this._telemetryService.publicLog2('terminal/chatToggleOutput', {
1180
+ this._telemetryService.publicLog2("terminal/chatToggleOutput", {
859
1181
  previousExpanded: this._expanded
860
1182
  });
861
1183
  await this._toggle();
@@ -870,27 +1192,37 @@ let ToggleChatTerminalOutputAction = class ToggleChatTerminalOutputAction extend
870
1192
  }
871
1193
  _updatePresentation() {
872
1194
  if (this._expanded) {
873
- this.label = ( localize(5742, 'Hide Output'));
1195
+ this.label = ( localize(5995, "Hide Output"));
874
1196
  this.class = ThemeIcon.asClassName(Codicon.chevronDown);
875
- }
876
- else {
877
- this.label = ( localize(5741, 'Show Output'));
1197
+ } else {
1198
+ this.label = ( localize(5994, "Show Output"));
878
1199
  this.class = ThemeIcon.asClassName(Codicon.chevronRight);
879
1200
  }
880
1201
  }
881
1202
  _updateTooltip() {
882
- const keybinding = this._keybindingService.lookupKeybinding(TerminalContribCommandId.FocusMostRecentChatTerminalOutput);
883
- const label = keybinding?.getLabel();
884
- this.tooltip = label ? `${this.label} (${label})` : this.label;
1203
+ this.tooltip = this._keybindingService.appendKeybinding(this.label, TerminalContribCommandId.FocusMostRecentChatTerminalOutput);
885
1204
  }
886
1205
  };
887
- ToggleChatTerminalOutputAction = ( __decorate([
888
- ( __param(1, IKeybindingService)),
889
- ( __param(2, ITelemetryService))
890
- ], ToggleChatTerminalOutputAction));
1206
+ ToggleChatTerminalOutputAction = ( __decorate([( __param(1, IKeybindingService)), ( __param(2, ITelemetryService))], ToggleChatTerminalOutputAction));
891
1207
  let FocusChatInstanceAction = class FocusChatInstanceAction extends Action {
892
- constructor(_instance, _command, _commandUri, _commandId, isTerminalHidden, _terminalService, _terminalEditorService, _terminalGroupService, _keybindingService, _telemetryService) {
893
- super(TerminalContribCommandId.FocusChatInstanceAction, isTerminalHidden ? ( localize(5743, 'Show and Focus Terminal')) : ( localize(5744, 'Focus Terminal')), ThemeIcon.asClassName(Codicon.openInProduct), true);
1208
+ constructor(
1209
+ _instance,
1210
+ _command,
1211
+ _commandUri,
1212
+ _commandId,
1213
+ isTerminalHidden,
1214
+ _terminalService,
1215
+ _terminalEditorService,
1216
+ _terminalGroupService,
1217
+ _keybindingService,
1218
+ _telemetryService
1219
+ ) {
1220
+ super(
1221
+ TerminalContribCommandId.FocusChatInstanceAction,
1222
+ isTerminalHidden ? ( localize(5996, "Show and Focus Terminal")) : ( localize(5997, "Focus Terminal")),
1223
+ ThemeIcon.asClassName(Codicon.openInProduct),
1224
+ true
1225
+ );
894
1226
  this._instance = _instance;
895
1227
  this._command = _command;
896
1228
  this._commandUri = _commandUri;
@@ -903,18 +1235,17 @@ let FocusChatInstanceAction = class FocusChatInstanceAction extends Action {
903
1235
  this._updateTooltip();
904
1236
  }
905
1237
  async run() {
906
- this.label = this._instance?.shellLaunchConfig.hideFromUser ? ( localize(5745, 'Show and Focus Terminal')) : ( localize(5744, 'Focus Terminal'));
1238
+ this.label = this._instance?.shellLaunchConfig.hideFromUser ? ( localize(5998, "Show and Focus Terminal")) : ( localize(5997, "Focus Terminal"));
907
1239
  this._updateTooltip();
908
- let target = 'none';
909
- let location = 'panel';
1240
+ let target = "none";
1241
+ let location = "panel";
910
1242
  if (this._instance) {
911
- target = 'instance';
912
- location = this._instance.target === TerminalLocation.Editor ? 'editor' : 'panel';
1243
+ target = "instance";
1244
+ location = this._instance.target === TerminalLocation.Editor ? "editor" : "panel";
1245
+ } else if (this._commandUri) {
1246
+ target = "commandUri";
913
1247
  }
914
- else if (this._commandUri) {
915
- target = 'commandUri';
916
- }
917
- this._telemetryService.publicLog2('terminal/chatFocusInstance', {
1248
+ this._telemetryService.publicLog2("terminal/chatFocusInstance", {
918
1249
  target,
919
1250
  location
920
1251
  });
@@ -922,8 +1253,7 @@ let FocusChatInstanceAction = class FocusChatInstanceAction extends Action {
922
1253
  this._terminalService.setActiveInstance(this._instance);
923
1254
  if (this._instance.target === TerminalLocation.Editor) {
924
1255
  this._terminalEditorService.openEditor(this._instance);
925
- }
926
- else {
1256
+ } else {
927
1257
  await this._terminalGroupService.showPanel(true);
928
1258
  }
929
1259
  this._terminalService.setActiveInstance(this._instance);
@@ -956,17 +1286,71 @@ let FocusChatInstanceAction = class FocusChatInstanceAction extends Action {
956
1286
  return this._command;
957
1287
  }
958
1288
  _updateTooltip() {
959
- const keybinding = this._keybindingService.lookupKeybinding(TerminalContribCommandId.FocusMostRecentChatTerminal);
960
- const label = keybinding?.getLabel();
961
- this.tooltip = label ? `${this.label} (${label})` : this.label;
1289
+ this.tooltip = this._keybindingService.appendKeybinding(this.label, TerminalContribCommandId.FocusMostRecentChatTerminal);
1290
+ }
1291
+ };
1292
+ FocusChatInstanceAction = ( __decorate([( __param(5, ITerminalService)), ( __param(6, ITerminalEditorService)), ( __param(7, ITerminalGroupService)), ( __param(8, IKeybindingService)), ( __param(9, ITelemetryService))], FocusChatInstanceAction));
1293
+ let ContinueInBackgroundAction = class ContinueInBackgroundAction extends Action {
1294
+ constructor(_terminalToolSessionId, _terminalChatService) {
1295
+ super(TerminalContribCommandId.ContinueInBackground, ( localize(5999, "Continue in Background")), ThemeIcon.asClassName(Codicon.debugContinue), true);
1296
+ this._terminalToolSessionId = _terminalToolSessionId;
1297
+ this._terminalChatService = _terminalChatService;
1298
+ }
1299
+ async run() {
1300
+ this._terminalChatService.continueInBackground(this._terminalToolSessionId);
1301
+ }
1302
+ };
1303
+ ContinueInBackgroundAction = ( __decorate([( __param(1, ITerminalChatService))], ContinueInBackgroundAction));
1304
+ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsibleWrapper extends ChatCollapsibleContentPart {
1305
+ constructor(
1306
+ commandText,
1307
+ contentElement,
1308
+ context,
1309
+ initialExpanded,
1310
+ isComplete,
1311
+ hoverService
1312
+ ) {
1313
+ const title = isComplete ? `Ran \`${commandText}\`` : `Running \`${commandText}\``;
1314
+ super(title, context, undefined, hoverService);
1315
+ this._terminalContentElement = contentElement;
1316
+ this._commandText = commandText;
1317
+ this._isComplete = isComplete;
1318
+ this.domNode.classList.add("chat-terminal-thinking-collapsible");
1319
+ this._setCodeFormattedTitle();
1320
+ this.setExpanded(initialExpanded);
1321
+ }
1322
+ _setCodeFormattedTitle() {
1323
+ if (!this._collapseButton) {
1324
+ return;
1325
+ }
1326
+ const labelElement = this._collapseButton.labelElement;
1327
+ labelElement.textContent = "";
1328
+ const prefixText = this._isComplete ? ( localize(6000, "Ran ")) : ( localize(6001, "Running "));
1329
+ const ranText = createTextNode(prefixText);
1330
+ const codeElement = createElement("code");
1331
+ codeElement.textContent = this._commandText;
1332
+ labelElement.appendChild(ranText);
1333
+ labelElement.appendChild(codeElement);
1334
+ }
1335
+ markComplete() {
1336
+ if (this._isComplete) {
1337
+ return;
1338
+ }
1339
+ this._isComplete = true;
1340
+ this._setCodeFormattedTitle();
1341
+ }
1342
+ initContent() {
1343
+ const listWrapper = $(".chat-used-context-list.chat-terminal-thinking-content");
1344
+ listWrapper.appendChild(this._terminalContentElement);
1345
+ return listWrapper;
1346
+ }
1347
+ expand() {
1348
+ this.setExpanded(true);
1349
+ }
1350
+ hasSameContent(_other, _followingContent, _element) {
1351
+ return false;
962
1352
  }
963
1353
  };
964
- FocusChatInstanceAction = ( __decorate([
965
- ( __param(5, ITerminalService)),
966
- ( __param(6, ITerminalEditorService)),
967
- ( __param(7, ITerminalGroupService)),
968
- ( __param(8, IKeybindingService)),
969
- ( __param(9, ITelemetryService))
970
- ], FocusChatInstanceAction));
1354
+ ChatTerminalThinkingCollapsibleWrapper = ( __decorate([( __param(5, IHoverService))], ChatTerminalThinkingCollapsibleWrapper));
971
1355
 
972
- export { ChatTerminalToolProgressPart, FocusChatInstanceAction, ToggleChatTerminalOutputAction };
1356
+ export { ChatTerminalToolProgressPart, ContinueInBackgroundAction, FocusChatInstanceAction, ToggleChatTerminalOutputAction };