@codingame/monaco-vscode-katex-common 30.0.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +16 -0
  3. package/vscode/src/vs/platform/actions/browser/actionbar.js +22 -0
  4. package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
  5. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
  6. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
  7. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
  8. package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
  9. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
  10. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
  11. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +73 -0
  12. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +3 -1
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +51 -24
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +2 -1
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +64 -72
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +2 -1
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -14
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +17 -18
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +5 -2
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +5 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +73 -9
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  29. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +32 -32
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.d.ts +1 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +20 -2
  32. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +1 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +73 -49
  34. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +0 -6
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +41 -99
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +13 -9
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +14 -15
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +11 -12
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +339 -161
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +9 -2
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +9 -4
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +33 -5
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +43 -1
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +147 -2
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +4 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +55 -6
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +1 -1
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +7 -5
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +1 -3
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +42 -10
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animation.d.ts +18 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.d.ts +15 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/animationRegistry.js +16 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.d.ts +13 -0
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/animations/blockAnimations.js +33 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/buffer.d.ts +46 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.d.ts +11 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/bufferRegistry.js +12 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.d.ts +9 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/offBuffer.js +12 -0
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +23 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +37 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.d.ts +34 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/wordBuffer.js +68 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +77 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +170 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/media/chatIncrementalRendering.css +112 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +3 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -16
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +24 -6
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +111 -145
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +425 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +16 -7
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +68 -25
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +101 -45
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +36 -4
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +217 -25
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +23 -3
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +168 -60
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +10 -10
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +18 -17
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -5
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +7 -18
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +1 -5
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +7 -19
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +24 -19
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +104 -78
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +11 -2
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +257 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +19 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +30 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +1 -1
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +12 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +286 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -11
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -7
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +25 -47
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +29 -53
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +258 -321
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +53 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +392 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -3
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +24 -30
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +2 -3
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +9 -8
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +6 -3
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +2 -3
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +38 -11
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +577 -113
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +0 -7
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +4 -7
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -8
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +58 -75
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +44 -12
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +362 -188
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +0 -2
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -5
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +42 -95
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +2 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +9 -10
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +57 -38
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +21 -15
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/{modelPickerActionItem2.js → modelPickerActionItem.js} +5 -7
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +38 -31
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +4 -5
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +94 -40
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  166. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +16 -0
  167. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +218 -0
  168. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
  169. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +6 -1
  170. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
  171. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +12 -21
  172. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -32
  173. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +355 -156
  174. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +2 -13
  175. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +72 -65
  176. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +4 -43
  177. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +238 -204
  178. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +4 -19
  179. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +128 -115
  180. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +6 -9
  181. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +152 -49
  182. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +64 -0
  183. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +40 -40
  184. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  194. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  196. package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +2 -0
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +45 -0
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +165 -0
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +53 -0
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +163 -0
  206. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
  207. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +142 -0
  208. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +29 -0
  209. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +144 -0
  210. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +42 -0
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +256 -0
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +42 -0
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +94 -0
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +221 -0
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +52 -0
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +19 -0
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +168 -0
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +22 -0
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +47 -0
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
  248. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
  249. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +24 -0
  250. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
  251. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +32 -0
  252. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +108 -0
  253. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +412 -0
  254. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
  255. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
  256. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
  257. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +192 -0
  258. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2258 -0
  259. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +22 -0
  260. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +43 -0
  261. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
  262. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
  263. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
  264. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
  265. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +1 -0
  266. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +25 -0
  267. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +141 -0
  268. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +85 -0
  269. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +608 -0
  270. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +0 -40
  271. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +0 -196
  272. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +0 -29
  273. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +0 -46
  274. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +0 -215
  275. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +0 -18
  276. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +0 -107
@@ -2,7 +2,6 @@
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
4
  import { h, addDisposableListener, EventType, DisposableResizeObserver, clearNode, getActiveWindow, getComputedStyle, createTextNode, createElement, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
- import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
6
5
  import { MarkdownString, isMarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
7
6
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
8
7
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
@@ -20,10 +19,11 @@ import { TerminalToolAutoExpand } from './terminalToolAutoExpand.js';
20
19
  import { ChatCollapsibleContentPart } from '../chatCollapsibleContentPart.js';
21
20
  import * as chatTerminalToolProgressPart from '../media/chatTerminalToolProgressPart.css';
22
21
  import { Action } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
22
+ import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
23
23
  import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
24
- import { ITerminalChatService, ITerminalService, ITerminalConfigurationService, ITerminalEditorService, ITerminalGroupService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
25
- import { Disposable, MutableDisposable, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
26
- import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
24
+ import { ITerminalChatService, ITerminalService, ITerminalEditorService, ITerminalGroupService, ITerminalConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
25
+ import { Disposable, DisposableStore, toDisposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
26
+ import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
27
27
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
28
28
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
29
29
  import { getTerminalCommandDecorationTooltip, getTerminalCommandDecorationState, DecorationSelector } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/xterm/decorationStyles';
@@ -38,7 +38,6 @@ import { IAccessibleViewService } from '@codingame/monaco-vscode-api/vscode/vs/p
38
38
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
39
39
  import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
40
40
  import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
41
- import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
42
41
  import { DetachedTerminalCommandMirror, DetachedTerminalSnapshotMirror } from '../../../../../terminal/browser/chatTerminalCommandMirror.js';
43
42
  import { TerminalLocation } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
44
43
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
@@ -59,6 +58,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/misc
59
58
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
60
59
  import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
61
60
  import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
61
+ import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
62
62
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
63
63
 
64
64
  registerCss(chatTerminalToolProgressPart);
@@ -69,6 +69,24 @@ const MAX_OUTPUT_POLL_RETRIES = 10;
69
69
  const OUTPUT_POLL_DELAY_MS = 100;
70
70
  const MIN_DATA_EVENTS_FOR_REAL_OUTPUT = 2;
71
71
  const expandedStateByInvocation = ( new WeakMap());
72
+ CommandsRegistry.registerCommand(
73
+ TerminalContribCommandId.FocusChatInstanceAction,
74
+ async (_accessor, progressPart) => {
75
+ await progressPart?.focusTerminal();
76
+ }
77
+ );
78
+ CommandsRegistry.registerCommand(
79
+ TerminalContribCommandId.ContinueInBackground,
80
+ async (_accessor, progressPart) => {
81
+ progressPart?.continueInBackground();
82
+ }
83
+ );
84
+ CommandsRegistry.registerCommand(
85
+ TerminalContribCommandId.ToggleChatTerminalOutput,
86
+ async (_accessor, progressPart) => {
87
+ await progressPart?.toggleOutputFromAction();
88
+ }
89
+ );
72
90
  let TerminalCommandDecoration = class TerminalCommandDecoration extends Disposable {
73
91
  constructor(_options, _hoverService) {
74
92
  super();
@@ -179,14 +197,15 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
179
197
  editorPool,
180
198
  currentWidthDelegate,
181
199
  codeBlockStartIndex,
182
- codeBlockModelCollection,
183
200
  _instantiationService,
184
201
  _terminalChatService,
185
202
  _terminalService,
186
203
  _contextKeyService,
187
204
  _chatWidgetService,
188
- _keybindingService,
189
- _configurationService
205
+ _configurationService,
206
+ _terminalEditorService,
207
+ _terminalGroupService,
208
+ _telemetryService
190
209
  ) {
191
210
  super(toolInvocation);
192
211
  this._instantiationService = _instantiationService;
@@ -194,12 +213,16 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
194
213
  this._terminalService = _terminalService;
195
214
  this._contextKeyService = _contextKeyService;
196
215
  this._chatWidgetService = _chatWidgetService;
197
- this._keybindingService = _keybindingService;
198
216
  this._configurationService = _configurationService;
199
- this._showOutputAction = this._register(( new MutableDisposable()));
200
- this._showOutputActionAdded = false;
201
- this._focusAction = this._register(( new MutableDisposable()));
202
- this._continueInBackgroundAction = this._register(( new MutableDisposable()));
217
+ this._terminalEditorService = _terminalEditorService;
218
+ this._terminalGroupService = _terminalGroupService;
219
+ this._telemetryService = _telemetryService;
220
+ this._toolbarHasInstance = false;
221
+ this._toolbarCanContinueInBackground = false;
222
+ this._toolbarHasOutput = false;
223
+ this._toolbarIsHiddenTerminal = false;
224
+ this._toolbarOutputExpanded = false;
225
+ this._actionBarActions = ( new DisposableStore());
203
226
  this._userToggledOutput = false;
204
227
  this._isInThinkingContainer = false;
205
228
  this._usesCollapsibleWrapper = false;
@@ -209,7 +232,6 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
209
232
  terminalData = migrateLegacyTerminalToolSpecificData(terminalData);
210
233
  this._terminalData = terminalData;
211
234
  this._terminalCommandUri = terminalData.terminalCommandUri ? URI.revive(terminalData.terminalCommandUri) : undefined;
212
- this._storedCommandId = this._terminalCommandUri ? ( new URLSearchParams(this._terminalCommandUri.query ?? "")).get("command") ?? undefined : undefined;
213
235
  this._isSerializedInvocation = (toolInvocation.kind === "toolInvocationSerialized");
214
236
  const elements = h(".chat-terminal-content-part@container", [h(
215
237
  ".chat-terminal-content-title@title",
@@ -254,15 +276,32 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
254
276
  this._register(this._outputView.onDidFocus(() => this._handleOutputFocus()));
255
277
  this._register(this._outputView.onDidBlur(e => this._handleOutputBlur(e)));
256
278
  this._register(toDisposable(() => this._handleDispose()));
257
- this._register(this._keybindingService.onDidUpdateKeybindings(() => {
258
- this._focusAction.value?.refreshKeybindingTooltip();
259
- this._showOutputAction.value?.refreshKeybindingTooltip();
260
- }));
261
279
  const actionBarEl = h(".chat-terminal-action-bar@actionBar");
262
280
  elements.title.append(actionBarEl.root);
263
- this._actionBar = this._register(( new ActionBar(actionBarEl.actionBar, {})));
264
- this._initializeTerminalActions();
265
- this._terminalService.whenConnected.then(() => this._initializeTerminalActions());
281
+ this._actionBar = this._register(( new ActionBar(actionBarEl.actionBar)));
282
+ this._register(this._actionBarActions);
283
+ let didInitializeTerminalActions = false;
284
+ const initializeTerminalActionsOnce = () => {
285
+ if (didInitializeTerminalActions || this._store.isDisposed) {
286
+ return;
287
+ }
288
+ didInitializeTerminalActions = true;
289
+ this._initializeTerminalActions();
290
+ };
291
+ initializeTerminalActionsOnce();
292
+ this._terminalService.whenConnected.then(() => {
293
+ initializeTerminalActionsOnce();
294
+ });
295
+ const terminalToolSessionId = this._terminalData.terminalToolSessionId;
296
+ if (terminalToolSessionId) {
297
+ this._register(this._terminalChatService.onDidContinueInBackground(sessionId => {
298
+ if (sessionId === terminalToolSessionId) {
299
+ this._terminalData.didContinueInBackground = true;
300
+ this._toolbarCanContinueInBackground = false;
301
+ this._updateToolbarActions();
302
+ }
303
+ }));
304
+ }
266
305
  let pastTenseMessage;
267
306
  if (toolInvocation.pastTenseMessage) {
268
307
  pastTenseMessage = `${typeof toolInvocation.pastTenseMessage === "string" ? toolInvocation.pastTenseMessage : toolInvocation.pastTenseMessage.value}`;
@@ -286,7 +325,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
286
325
  const markdownOptions = {
287
326
  codeBlockRenderOptions,
288
327
  accessibilityOptions: pastTenseMessage ? {
289
- statusMessage: ( localize(6944, "{0}", stripIcons(pastTenseMessage)))
328
+ statusMessage: ( localize(7057, "{0}", stripIcons(pastTenseMessage)))
290
329
  } : undefined
291
330
  };
292
331
  this.markdownPart = this._register(_instantiationService.createInstance(
@@ -299,7 +338,6 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
299
338
  renderer,
300
339
  {},
301
340
  currentWidthDelegate(),
302
- codeBlockModelCollection,
303
341
  markdownOptions
304
342
  ));
305
343
  elements.message.append(this.markdownPart.domNode);
@@ -409,7 +447,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
409
447
  }
410
448
  const terminalToolSessionId = this._terminalData.terminalToolSessionId;
411
449
  if (!terminalToolSessionId) {
412
- this._addActions();
450
+ this._updateToolbarContextKeys();
413
451
  return;
414
452
  }
415
453
  const attachInstance = async instance => {
@@ -420,7 +458,7 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
420
458
  if (this._isSerializedInvocation) {
421
459
  this._clearCommandAssociation();
422
460
  }
423
- this._addActions(undefined, terminalToolSessionId);
461
+ this._updateToolbarContextKeys(undefined, terminalToolSessionId);
424
462
  return;
425
463
  }
426
464
  const isNewInstance = this._terminalInstance !== instance;
@@ -428,12 +466,12 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
428
466
  this._terminalInstance = instance;
429
467
  this._registerInstanceListener(instance);
430
468
  }
431
- this._addActions(instance, terminalToolSessionId);
469
+ this._updateToolbarContextKeys(instance, terminalToolSessionId);
432
470
  };
433
471
  const initialInstance = await this._terminalChatService.getTerminalInstanceByToolSessionId(terminalToolSessionId);
434
472
  await attachInstance(initialInstance);
435
473
  if (!initialInstance) {
436
- this._addActions(undefined, terminalToolSessionId);
474
+ this._updateToolbarContextKeys(undefined, terminalToolSessionId);
437
475
  }
438
476
  if (this._store.isDisposed) {
439
477
  return;
@@ -450,53 +488,81 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
450
488
  });
451
489
  this._terminalSessionRegistration = this._store.add(listener);
452
490
  }
453
- this._store.add(this._terminalChatService.onDidContinueInBackground(sessionId => {
454
- if (sessionId === terminalToolSessionId) {
455
- this._terminalData.didContinueInBackground = true;
456
- this._removeContinueInBackgroundAction();
457
- }
458
- }));
459
491
  }
460
- _addActions(terminalInstance, terminalToolSessionId) {
492
+ _updateToolbarContextKeys(terminalInstance, terminalToolSessionId) {
461
493
  if (this._store.isDisposed) {
462
494
  return;
463
495
  }
464
- const actionBar = this._actionBar;
465
- this._removeFocusAction();
466
496
  const resolvedCommand = this._getResolvedCommand(terminalInstance);
467
- this._removeContinueInBackgroundAction();
468
- if (terminalInstance) {
469
- const isTerminalHidden = terminalInstance && terminalToolSessionId ? this._terminalChatService.isBackgroundTerminal(terminalToolSessionId) : false;
470
- const focusAction = this._instantiationService.createInstance(
471
- FocusChatInstanceAction,
472
- terminalInstance,
473
- resolvedCommand,
474
- this._terminalCommandUri,
475
- this._storedCommandId,
476
- isTerminalHidden
477
- );
478
- this._focusAction.value = focusAction;
479
- actionBar.push(focusAction, {
480
- icon: true,
481
- label: false,
482
- index: 0
483
- });
484
- if (terminalToolSessionId && !this._terminalData.isBackground && !this._terminalData.didContinueInBackground) {
485
- const isStillRunning = resolvedCommand?.exitCode === undefined && this._terminalData.terminalCommandState?.exitCode === undefined;
486
- if (isStillRunning) {
487
- const continueAction = this._instantiationService.createInstance(ContinueInBackgroundAction, terminalToolSessionId);
488
- this._continueInBackgroundAction.value = continueAction;
489
- actionBar.push(continueAction, {
490
- icon: true,
491
- label: false,
492
- index: 0
493
- });
497
+ this._toolbarHasInstance = !!terminalInstance;
498
+ if (terminalInstance && terminalToolSessionId) {
499
+ this._toolbarIsHiddenTerminal = this._terminalChatService.isBackgroundTerminal(terminalToolSessionId);
500
+ } else {
501
+ this._toolbarIsHiddenTerminal = false;
502
+ }
503
+ if (terminalInstance && terminalToolSessionId && !this._terminalData.isBackground && !this._terminalData.didContinueInBackground) {
504
+ const isStillRunning = resolvedCommand?.exitCode === undefined && this._terminalData.terminalCommandState?.exitCode === undefined;
505
+ this._toolbarCanContinueInBackground = isStillRunning;
506
+ } else {
507
+ this._toolbarCanContinueInBackground = false;
508
+ }
509
+ if (!this._usesCollapsibleWrapper) {
510
+ const hasSnapshot = !!this._terminalData.terminalCommandOutput;
511
+ const hasOutput = !!resolvedCommand || hasSnapshot;
512
+ this._toolbarHasOutput = hasOutput;
513
+ if (hasOutput && !this._outputView.isExpanded) {
514
+ const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
515
+ const exitCode = resolvedCommand?.exitCode ?? this._terminalData.terminalCommandState?.exitCode;
516
+ if (exitCode !== undefined && exitCode !== 0 && autoExpandFailures) {
517
+ this._toggleOutput(true);
494
518
  }
495
519
  }
496
520
  }
497
- this._ensureShowOutputAction(resolvedCommand);
521
+ this._updateToolbarActions();
498
522
  this._decoration.update(resolvedCommand);
499
523
  }
524
+ _updateToolbarActions() {
525
+ if (!this._actionBar || this._store.isDisposed) {
526
+ return;
527
+ }
528
+ this._actionBar.clear();
529
+ this._actionBarActions.clear();
530
+ const actions = [];
531
+ if (this._toolbarCanContinueInBackground) {
532
+ const action = ( new Action(TerminalContribCommandId.ContinueInBackground, ( localize(7058, "Continue in Background")), ThemeIcon.asClassName(Codicon.debugContinue), true, () => this.continueInBackground()));
533
+ this._actionBarActions.add(action);
534
+ actions.push(action);
535
+ }
536
+ if (this._toolbarHasInstance) {
537
+ const focusLabel = this._toolbarIsHiddenTerminal ? ( localize(7059, "Show and Focus Terminal")) : ( localize(7060, "Focus Terminal"));
538
+ const action = ( new Action(
539
+ TerminalContribCommandId.FocusChatInstanceAction,
540
+ focusLabel,
541
+ ThemeIcon.asClassName(Codicon.openInProduct),
542
+ true,
543
+ () => this.focusTerminal()
544
+ ));
545
+ this._actionBarActions.add(action);
546
+ actions.push(action);
547
+ }
548
+ if (this._toolbarHasOutput && !this._usesCollapsibleWrapper) {
549
+ const toggleIcon = this._toolbarOutputExpanded ? Codicon.chevronDown : Codicon.chevronRight;
550
+ const toggleLabel = this._toolbarOutputExpanded ? ( localize(7061, "Hide Output")) : ( localize(7062, "Show Output"));
551
+ const action = ( new Action(
552
+ TerminalContribCommandId.ToggleChatTerminalOutput,
553
+ toggleLabel,
554
+ ThemeIcon.asClassName(toggleIcon),
555
+ true,
556
+ () => this.toggleOutputFromAction()
557
+ ));
558
+ this._actionBarActions.add(action);
559
+ actions.push(action);
560
+ }
561
+ this._actionBar.push(actions, {
562
+ icon: true,
563
+ label: false
564
+ });
565
+ }
500
566
  _getResolvedCommand(instance) {
501
567
  const target = instance ?? this._terminalInstance;
502
568
  if (!target) {
@@ -504,51 +570,8 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
504
570
  }
505
571
  return this._resolveCommand(target);
506
572
  }
507
- _ensureShowOutputAction(command) {
508
- if (this._store.isDisposed) {
509
- return;
510
- }
511
- if (this._usesCollapsibleWrapper) {
512
- return;
513
- }
514
- const resolvedCommand = command ?? this._getResolvedCommand();
515
- const hasSnapshot = !!this._terminalData.terminalCommandOutput;
516
- if (!resolvedCommand && !hasSnapshot) {
517
- return;
518
- }
519
- let showOutputAction = this._showOutputAction.value;
520
- if (!showOutputAction) {
521
- showOutputAction = this._instantiationService.createInstance(ToggleChatTerminalOutputAction, () => this._toggleOutputFromAction());
522
- this._showOutputAction.value = showOutputAction;
523
- const autoExpandFailures = this._configurationService.getValue(ChatConfiguration.AutoExpandToolFailures);
524
- const exitCode = resolvedCommand?.exitCode ?? this._terminalData.terminalCommandState?.exitCode;
525
- if (exitCode !== undefined && exitCode !== 0 && autoExpandFailures) {
526
- this._toggleOutput(true);
527
- }
528
- }
529
- showOutputAction.syncPresentation(this._outputView.isExpanded);
530
- const actionBar = this._actionBar;
531
- if (this._showOutputActionAdded) {
532
- const existingIndex = actionBar.viewItems.findIndex(item => item.action === showOutputAction);
533
- if (existingIndex >= 0 && existingIndex !== actionBar.length() - 1) {
534
- actionBar.pull(existingIndex);
535
- this._showOutputActionAdded = false;
536
- } else if (existingIndex >= 0) {
537
- return;
538
- }
539
- }
540
- if (this._showOutputActionAdded) {
541
- return;
542
- }
543
- actionBar.push([showOutputAction], {
544
- icon: true,
545
- label: false
546
- });
547
- this._showOutputActionAdded = true;
548
- }
549
573
  _clearCommandAssociation(options) {
550
574
  this._terminalCommandUri = undefined;
551
- this._storedCommandId = undefined;
552
575
  if (options?.clearPersistentData) {
553
576
  if (this._terminalData.terminalCommandUri) {
554
577
  delete this._terminalData.terminalCommandUri;
@@ -566,12 +589,16 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
566
589
  const commandDetectionListener = this._register(( new MutableDisposable()));
567
590
  const tryResolveCommand = async () => {
568
591
  const resolvedCommand = this._resolveCommand(terminalInstance);
569
- this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
592
+ this._updateToolbarContextKeys(terminalInstance, this._terminalData.terminalToolSessionId);
570
593
  return resolvedCommand;
571
594
  };
572
595
  const attachCommandDetection = async commandDetection => {
573
596
  commandDetectionListener.clear();
574
597
  if (!commandDetection) {
598
+ const ahpSource = this._terminalData.terminalToolSessionId ? this._terminalChatService.getAhpCommandSource(this._terminalData.terminalToolSessionId) : undefined;
599
+ if (ahpSource) {
600
+ this._attachAhpCommandSource(terminalInstance, ahpSource, commandDetectionListener);
601
+ }
575
602
  await tryResolveCommand();
576
603
  return;
577
604
  }
@@ -596,7 +623,8 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
596
623
  return receivedDataCount > MIN_DATA_EVENTS_FOR_REAL_OUTPUT;
597
624
  };
598
625
  const autoExpand = store.add(( new TerminalToolAutoExpand({
599
- commandDetection,
626
+ onCommandExecuted: ( Event.map(commandDetection.onCommandExecuted, () => undefined)),
627
+ onCommandFinished: ( Event.map(commandDetection.onCommandFinished, () => undefined)),
600
628
  onWillData: terminalInstance.onWillData,
601
629
  shouldAutoExpand: () => this._shouldAutoExpand(),
602
630
  hasRealOutput
@@ -611,10 +639,10 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
611
639
  receivedDataCount++;
612
640
  }));
613
641
  store.add(commandDetection.onCommandExecuted(() => {
614
- this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
642
+ this._updateToolbarContextKeys(terminalInstance, this._terminalData.terminalToolSessionId);
615
643
  }));
616
644
  store.add(commandDetection.onCommandFinished(() => {
617
- this._addActions(terminalInstance, this._terminalData.terminalToolSessionId);
645
+ this._updateToolbarContextKeys(terminalInstance, this._terminalData.terminalToolSessionId);
618
646
  const resolvedCommand = this._getResolvedCommand(terminalInstance);
619
647
  this._handleCommandCompletion(resolvedCommand);
620
648
  if (resolvedCommand?.endMarker) {
@@ -641,43 +669,50 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
641
669
  clearPersistentData: true
642
670
  });
643
671
  commandDetectionListener.clear();
644
- if (!this._store.isDisposed) {
645
- this._actionBar.clear();
646
- }
647
- this._removeFocusAction();
648
- this._showOutputActionAdded = false;
649
- this._showOutputAction.clear();
650
- this._addActions(undefined, this._terminalData.terminalToolSessionId);
672
+ this._updateToolbarContextKeys(undefined, this._terminalData.terminalToolSessionId);
651
673
  instanceListener.dispose();
652
674
  }));
653
675
  }
654
- _removeFocusAction() {
655
- if (this._store.isDisposed) {
656
- return;
657
- }
658
- const actionBar = this._actionBar;
659
- const focusAction = this._focusAction.value;
660
- if (actionBar && focusAction) {
661
- const existingIndex = actionBar.viewItems.findIndex(item => item.action === focusAction);
662
- if (existingIndex >= 0) {
663
- actionBar.pull(existingIndex);
676
+ _attachAhpCommandSource(terminalInstance, ahpSource, commandDetectionListener) {
677
+ const store = ( new DisposableStore());
678
+ const hasRealOutput = () => {
679
+ const command = this._getResolvedCommand(terminalInstance);
680
+ if (command?.hasOutput()) {
681
+ return true;
664
682
  }
665
- }
666
- this._focusAction.clear();
667
- }
668
- _removeContinueInBackgroundAction() {
669
- if (this._store.isDisposed) {
670
- return;
671
- }
672
- const actionBar = this._actionBar;
673
- const continueAction = this._continueInBackgroundAction.value;
674
- if (actionBar && continueAction) {
675
- const existingIndex = actionBar.viewItems.findIndex(item => item.action === continueAction);
676
- if (existingIndex >= 0) {
677
- actionBar.pull(existingIndex);
683
+ return !!this._terminalData.terminalCommandOutput?.text?.trim();
684
+ };
685
+ const autoExpand = store.add(( new TerminalToolAutoExpand({
686
+ onCommandExecuted: ( Event.map(ahpSource.onCommandExecuted, () => undefined)),
687
+ onCommandFinished: ( Event.map(ahpSource.onCommandFinished, () => undefined)),
688
+ onWillData: terminalInstance.onWillData,
689
+ shouldAutoExpand: () => this._shouldAutoExpand(),
690
+ hasRealOutput
691
+ })));
692
+ store.add(autoExpand.onDidRequestExpand(() => {
693
+ if (this._usesCollapsibleWrapper) {
694
+ this.expandCollapsibleWrapper();
695
+ }
696
+ this._toggleOutput(true);
697
+ }));
698
+ store.add(ahpSource.onCommandExecuted(cmd => {
699
+ if (!this._terminalData.terminalCommandId && cmd.id) {
700
+ this._terminalData.terminalCommandId = cmd.id;
701
+ this._updateToolbarContextKeys(terminalInstance, this._terminalData.terminalToolSessionId);
702
+ }
703
+ }));
704
+ store.add(ahpSource.onCommandFinished(cmd => {
705
+ if (this._terminalData.terminalCommandId === cmd.id) {
706
+ this._updateToolbarContextKeys(terminalInstance, this._terminalData.terminalToolSessionId);
707
+ const resolvedCommand = this._getResolvedCommand(terminalInstance);
708
+ this._handleCommandCompletion(resolvedCommand);
678
709
  }
710
+ }));
711
+ commandDetectionListener.value = store;
712
+ const resolvedCommand = this._resolveCommand(terminalInstance);
713
+ if (resolvedCommand?.endMarker) {
714
+ this._handleCommandCompletion(resolvedCommand);
679
715
  }
680
- this._continueInBackgroundAction.clear();
681
716
  }
682
717
  _handleCommandCompletion(resolvedCommand) {
683
718
  this.markCollapsibleWrapperComplete();
@@ -693,7 +728,8 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
693
728
  const didChange = await this._outputView.toggle(expanded);
694
729
  const isExpanded = this._outputView.isExpanded;
695
730
  this._titleElement.classList.toggle("chat-terminal-content-title-no-bottom-radius", isExpanded);
696
- this._showOutputAction.value?.syncPresentation(isExpanded);
731
+ this._toolbarOutputExpanded = isExpanded;
732
+ this._updateToolbarActions();
697
733
  if (didChange) {
698
734
  expandedStateByInvocation.set(this.toolInvocation, isExpanded);
699
735
  }
@@ -739,30 +775,63 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
739
775
  widget?.focusInput();
740
776
  }
741
777
  async focusTerminal() {
742
- if (this._focusAction.value) {
743
- await this._focusAction.value.run();
778
+ const instance = this._terminalInstance;
779
+ let target = "none";
780
+ let location = "panel";
781
+ if (instance) {
782
+ target = "instance";
783
+ location = instance.target === TerminalLocation.Editor ? "editor" : "panel";
784
+ } else if (this._terminalCommandUri) {
785
+ target = "commandUri";
786
+ }
787
+ this._telemetryService.publicLog2("terminal/chatFocusInstance", {
788
+ target,
789
+ location
790
+ });
791
+ if (instance) {
792
+ this._terminalService.setActiveInstance(instance);
793
+ if (instance.target === TerminalLocation.Editor) {
794
+ this._terminalEditorService.openEditor(instance);
795
+ } else {
796
+ await this._terminalGroupService.showPanel(true);
797
+ }
798
+ this._terminalService.setActiveInstance(instance);
799
+ await instance.focusWhenReady(true);
800
+ const command = this._getResolvedCommand(instance);
801
+ if (command) {
802
+ instance.xterm?.markTracker.revealCommand(command);
803
+ }
744
804
  return;
745
805
  }
746
806
  if (this._terminalCommandUri) {
747
807
  this._terminalService.openResource(this._terminalCommandUri);
748
808
  }
749
809
  }
750
- async toggleOutputFromKeyboard() {
810
+ continueInBackground() {
811
+ const sessionId = this._terminalData.terminalToolSessionId;
812
+ if (sessionId) {
813
+ this._terminalChatService.continueInBackground(sessionId);
814
+ }
815
+ }
816
+ async toggleOutputFromAction() {
751
817
  this._userToggledOutput = true;
818
+ this._telemetryService.publicLog2("terminal/chatToggleOutput", {
819
+ previousExpanded: this._outputView.isExpanded
820
+ });
752
821
  if (!this._outputView.isExpanded) {
753
822
  await this._toggleOutput(true);
754
- this.focusOutput();
755
823
  return;
756
824
  }
757
- await this._collapseOutputAndFocusInput();
825
+ await this._toggleOutput(false);
758
826
  }
759
- async _toggleOutputFromAction() {
827
+ async toggleOutputFromKeyboard() {
760
828
  this._userToggledOutput = true;
761
829
  if (!this._outputView.isExpanded) {
762
830
  await this._toggleOutput(true);
831
+ this.focusOutput();
763
832
  return;
764
833
  }
765
- await this._toggleOutput(false);
834
+ await this._collapseOutputAndFocusInput();
766
835
  }
767
836
  async _collapseOutputAndFocusInput() {
768
837
  if (this._outputView.isExpanded) {
@@ -774,29 +843,35 @@ let ChatTerminalToolProgressPart = class ChatTerminalToolProgressPart extends Ba
774
843
  if (instance.isDisposed) {
775
844
  return undefined;
776
845
  }
777
- const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
778
- if (!commandDetection) {
779
- return undefined;
780
- }
781
846
  const targetId = this._terminalData.terminalCommandId;
782
- if (!targetId) {
783
- return undefined;
784
- }
785
- const commands = commandDetection.commands;
786
- if (commands && commands.length > 0) {
787
- const fromHistory = commands.find(c => c.id === targetId);
788
- if (fromHistory) {
789
- return fromHistory;
847
+ const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
848
+ if (commandDetection && targetId) {
849
+ const commands = commandDetection.commands;
850
+ if (commands && commands.length > 0) {
851
+ const fromHistory = commands.find(c => c.id === targetId);
852
+ if (fromHistory) {
853
+ return fromHistory;
854
+ }
855
+ }
856
+ const executing = commandDetection.executingCommandObject;
857
+ if (executing && executing.id === targetId) {
858
+ return executing;
790
859
  }
791
860
  }
792
- const executing = commandDetection.executingCommandObject;
793
- if (executing && executing.id === targetId) {
794
- return executing;
861
+ const sessionId = this._terminalData.terminalToolSessionId;
862
+ if (sessionId) {
863
+ const ahpSource = this._terminalChatService.getAhpCommandSource(sessionId);
864
+ if (ahpSource) {
865
+ if (targetId) {
866
+ return ahpSource.getCommandById(targetId);
867
+ }
868
+ return ahpSource.executingCommandObject ?? ahpSource.commands[ahpSource.commands.length - 1];
869
+ }
795
870
  }
796
871
  return undefined;
797
872
  }
798
873
  };
799
- ChatTerminalToolProgressPart = ( __decorate([( __param(8, IInstantiationService)), ( __param(9, ITerminalChatService)), ( __param(10, ITerminalService)), ( __param(11, IContextKeyService)), ( __param(12, IChatWidgetService)), ( __param(13, IKeybindingService)), ( __param(14, IConfigurationService))], ChatTerminalToolProgressPart));
874
+ ChatTerminalToolProgressPart = ( __decorate([( __param(7, IInstantiationService)), ( __param(8, ITerminalChatService)), ( __param(9, ITerminalService)), ( __param(10, IContextKeyService)), ( __param(11, IChatWidgetService)), ( __param(12, IConfigurationService)), ( __param(13, ITerminalEditorService)), ( __param(14, ITerminalGroupService)), ( __param(15, ITelemetryService))], ChatTerminalToolProgressPart));
800
875
  let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends Disposable {
801
876
  get isExpanded() {
802
877
  return this.domNode.classList.contains("expanded");
@@ -903,7 +978,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
903
978
  if (!commandText) {
904
979
  return;
905
980
  }
906
- const ariaLabel = ( localize(6945, "Terminal output for {0}", commandText));
981
+ const ariaLabel = ( localize(7063, "Terminal output for {0}", commandText));
907
982
  const scrollableDomNode = this._scrollableContainer.getDomNode();
908
983
  scrollableDomNode.setAttribute("role", "region");
909
984
  const accessibleViewHint = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.TerminalChatOutput);
@@ -916,26 +991,26 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
916
991
  if (!commandText) {
917
992
  return undefined;
918
993
  }
919
- const commandHeader = ( localize(6946, "Command: {0}", commandText));
994
+ const commandHeader = ( localize(7064, "Command: {0}", commandText));
920
995
  if (command) {
921
996
  const rawOutput = command.getOutput();
922
997
  if (!rawOutput || rawOutput.trim().length === 0) {
923
- return `${commandHeader}\n${( localize(6947, "No output was produced by the command."))}`;
998
+ return `${commandHeader}\n${( localize(7065, "No output was produced by the command."))}`;
924
999
  }
925
1000
  const lines = rawOutput.split("\n");
926
1001
  return `${commandHeader}\n${lines.join("\n").trimEnd()}`;
927
1002
  }
928
1003
  const snapshot = this._getTerminalCommandOutput();
929
1004
  if (!snapshot) {
930
- return `${commandHeader}\n${( localize(6948, "Command output is no longer available."))}`;
1005
+ return `${commandHeader}\n${( localize(7066, "Command output is no longer available."))}`;
931
1006
  }
932
1007
  const plain = removeAnsiEscapeCodes((snapshot.text ?? ""));
933
1008
  if (!plain.trim().length) {
934
- return `${commandHeader}\n${( localize(6947, "No output was produced by the command."))}`;
1009
+ return `${commandHeader}\n${( localize(7065, "No output was produced by the command."))}`;
935
1010
  }
936
1011
  let outputText = plain.trimEnd();
937
1012
  if (snapshot.truncated) {
938
- outputText += `\n${( localize(6949, "Output truncated."))}`;
1013
+ outputText += `\n${( localize(7067, "Output truncated."))}`;
939
1014
  }
940
1015
  return `${commandHeader}\n${outputText}`;
941
1016
  }
@@ -1047,7 +1122,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1047
1122
  }
1048
1123
  if (!hasOutput) {
1049
1124
  if (commandFinished) {
1050
- this._showEmptyMessage(( localize(6947, "No output was produced by the command.")));
1125
+ this._showEmptyMessage(( localize(7065, "No output was produced by the command.")));
1051
1126
  }
1052
1127
  } else {
1053
1128
  this._hideEmptyMessage();
@@ -1074,7 +1149,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1074
1149
  if (hasText) {
1075
1150
  this._hideEmptyMessage();
1076
1151
  } else {
1077
- this._showEmptyMessage(( localize(6947, "No output was produced by the command.")));
1152
+ this._showEmptyMessage(( localize(7065, "No output was produced by the command.")));
1078
1153
  }
1079
1154
  const lineCount = result?.lineCount ?? snapshot.lineCount ?? 0;
1080
1155
  this._layoutOutput(lineCount);
@@ -1083,9 +1158,9 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1083
1158
  clearNode(this._terminalContainer);
1084
1159
  this._lastRenderedLineCount = undefined;
1085
1160
  if (!liveTerminalInstance) {
1086
- this._showEmptyMessage(( localize(6950, "Terminal is no longer available.")));
1161
+ this._showEmptyMessage(( localize(7068, "Terminal is no longer available.")));
1087
1162
  } else {
1088
- this._showEmptyMessage(( localize(6951, "Command information is not available.")));
1163
+ this._showEmptyMessage(( localize(7069, "Command information is not available.")));
1089
1164
  }
1090
1165
  }
1091
1166
  async _resolveLiveTerminal() {
@@ -1141,13 +1216,10 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1141
1216
  const scrollableDomNode = this._scrollableContainer.getDomNode();
1142
1217
  const rowHeight = this._computeRowHeightPx();
1143
1218
  const padding = this._getOutputPadding();
1144
- const minHeight = rowHeight * MIN_OUTPUT_ROWS + padding;
1145
1219
  const maxHeight = rowHeight * MAX_OUTPUT_ROWS + padding;
1146
1220
  const contentHeight = this._getOutputContentHeight(lineCount, rowHeight, padding);
1147
1221
  const clampedHeight = Math.min(contentHeight, maxHeight);
1148
- const measuredBodyHeight = Math.max(this._outputBody.clientHeight, minHeight);
1149
- const appliedHeight = Math.min(clampedHeight, measuredBodyHeight);
1150
- scrollableDomNode.style.height = appliedHeight < maxHeight ? `${appliedHeight}px` : "";
1222
+ scrollableDomNode.style.height = clampedHeight < maxHeight ? `${clampedHeight}px` : "";
1151
1223
  this._scrollableContainer.scanDomNode();
1152
1224
  }
1153
1225
  _computeIsAtBottom() {
@@ -1172,8 +1244,7 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1172
1244
  }
1173
1245
  _getOutputContentHeight(lineCount, rowHeight, padding) {
1174
1246
  const contentRows = Math.max(lineCount, MIN_OUTPUT_ROWS);
1175
- const adjustedRows = contentRows + 1;
1176
- return (adjustedRows * rowHeight) + padding;
1247
+ return (contentRows * rowHeight) + padding;
1177
1248
  }
1178
1249
  _getOutputPadding() {
1179
1250
  const style = getComputedStyle(this._outputBody);
@@ -1202,140 +1273,6 @@ let ChatTerminalToolOutputSection = class ChatTerminalToolOutputSection extends
1202
1273
  }
1203
1274
  };
1204
1275
  ChatTerminalToolOutputSection = ( __decorate([( __param(6, IAccessibleViewService)), ( __param(7, IInstantiationService)), ( __param(8, ITerminalConfigurationService)), ( __param(9, IThemeService)), ( __param(10, IContextKeyService))], ChatTerminalToolOutputSection));
1205
- let ToggleChatTerminalOutputAction = class ToggleChatTerminalOutputAction extends Action {
1206
- constructor(_toggle, _keybindingService, _telemetryService) {
1207
- super(TerminalContribCommandId.ToggleChatTerminalOutput, ( localize(6952, "Show Output")), ThemeIcon.asClassName(Codicon.chevronRight), true);
1208
- this._toggle = _toggle;
1209
- this._keybindingService = _keybindingService;
1210
- this._telemetryService = _telemetryService;
1211
- this._expanded = false;
1212
- this._updateTooltip();
1213
- }
1214
- async run() {
1215
- this._telemetryService.publicLog2("terminal/chatToggleOutput", {
1216
- previousExpanded: this._expanded
1217
- });
1218
- await this._toggle();
1219
- }
1220
- syncPresentation(expanded) {
1221
- this._expanded = expanded;
1222
- this._updatePresentation();
1223
- this._updateTooltip();
1224
- }
1225
- refreshKeybindingTooltip() {
1226
- this._updateTooltip();
1227
- }
1228
- _updatePresentation() {
1229
- if (this._expanded) {
1230
- this.label = ( localize(6953, "Hide Output"));
1231
- this.class = ThemeIcon.asClassName(Codicon.chevronDown);
1232
- } else {
1233
- this.label = ( localize(6952, "Show Output"));
1234
- this.class = ThemeIcon.asClassName(Codicon.chevronRight);
1235
- }
1236
- }
1237
- _updateTooltip() {
1238
- this.tooltip = this._keybindingService.appendKeybinding(this.label, TerminalContribCommandId.FocusMostRecentChatTerminalOutput);
1239
- }
1240
- };
1241
- ToggleChatTerminalOutputAction = ( __decorate([( __param(1, IKeybindingService)), ( __param(2, ITelemetryService))], ToggleChatTerminalOutputAction));
1242
- let FocusChatInstanceAction = class FocusChatInstanceAction extends Action {
1243
- constructor(
1244
- _instance,
1245
- _command,
1246
- _commandUri,
1247
- _commandId,
1248
- isTerminalHidden,
1249
- _terminalService,
1250
- _terminalEditorService,
1251
- _terminalGroupService,
1252
- _keybindingService,
1253
- _telemetryService
1254
- ) {
1255
- super(
1256
- TerminalContribCommandId.FocusChatInstanceAction,
1257
- isTerminalHidden ? ( localize(6954, "Show and Focus Terminal")) : ( localize(6955, "Focus Terminal")),
1258
- ThemeIcon.asClassName(Codicon.openInProduct),
1259
- true
1260
- );
1261
- this._instance = _instance;
1262
- this._command = _command;
1263
- this._commandUri = _commandUri;
1264
- this._commandId = _commandId;
1265
- this._terminalService = _terminalService;
1266
- this._terminalEditorService = _terminalEditorService;
1267
- this._terminalGroupService = _terminalGroupService;
1268
- this._keybindingService = _keybindingService;
1269
- this._telemetryService = _telemetryService;
1270
- this._updateTooltip();
1271
- }
1272
- async run() {
1273
- this.label = this._instance?.shellLaunchConfig.hideFromUser ? ( localize(6956, "Show and Focus Terminal")) : ( localize(6955, "Focus Terminal"));
1274
- this._updateTooltip();
1275
- let target = "none";
1276
- let location = "panel";
1277
- if (this._instance) {
1278
- target = "instance";
1279
- location = this._instance.target === TerminalLocation.Editor ? "editor" : "panel";
1280
- } else if (this._commandUri) {
1281
- target = "commandUri";
1282
- }
1283
- this._telemetryService.publicLog2("terminal/chatFocusInstance", {
1284
- target,
1285
- location
1286
- });
1287
- if (this._instance) {
1288
- this._terminalService.setActiveInstance(this._instance);
1289
- if (this._instance.target === TerminalLocation.Editor) {
1290
- this._terminalEditorService.openEditor(this._instance);
1291
- } else {
1292
- await this._terminalGroupService.showPanel(true);
1293
- }
1294
- this._terminalService.setActiveInstance(this._instance);
1295
- await this._instance.focusWhenReady(true);
1296
- const command = this._resolveCommand();
1297
- if (command) {
1298
- this._instance.xterm?.markTracker.revealCommand(command);
1299
- }
1300
- return;
1301
- }
1302
- if (this._commandUri) {
1303
- this._terminalService.openResource(this._commandUri);
1304
- }
1305
- }
1306
- refreshKeybindingTooltip() {
1307
- this._updateTooltip();
1308
- }
1309
- _resolveCommand() {
1310
- if (this._command && !this._command.endMarker?.isDisposed) {
1311
- return this._command;
1312
- }
1313
- if (!this._instance || !this._commandId) {
1314
- return this._command;
1315
- }
1316
- const commandDetection = this._instance.capabilities.get(TerminalCapability.CommandDetection);
1317
- const resolved = commandDetection?.commands.find(c => c.id === this._commandId);
1318
- if (resolved) {
1319
- this._command = resolved;
1320
- }
1321
- return this._command;
1322
- }
1323
- _updateTooltip() {
1324
- this.tooltip = this._keybindingService.appendKeybinding(this.label, TerminalContribCommandId.FocusMostRecentChatTerminal);
1325
- }
1326
- };
1327
- FocusChatInstanceAction = ( __decorate([( __param(5, ITerminalService)), ( __param(6, ITerminalEditorService)), ( __param(7, ITerminalGroupService)), ( __param(8, IKeybindingService)), ( __param(9, ITelemetryService))], FocusChatInstanceAction));
1328
- let ContinueInBackgroundAction = class ContinueInBackgroundAction extends Action {
1329
- constructor(_terminalToolSessionId, _terminalChatService) {
1330
- super(TerminalContribCommandId.ContinueInBackground, ( localize(6957, "Continue in Background")), ThemeIcon.asClassName(Codicon.debugContinue), true);
1331
- this._terminalToolSessionId = _terminalToolSessionId;
1332
- this._terminalChatService = _terminalChatService;
1333
- }
1334
- async run() {
1335
- this._terminalChatService.continueInBackground(this._terminalToolSessionId);
1336
- }
1337
- };
1338
- ContinueInBackgroundAction = ( __decorate([( __param(1, ITerminalChatService))], ContinueInBackgroundAction));
1339
1276
  let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsibleWrapper extends ChatCollapsibleContentPart {
1340
1277
  constructor(
1341
1278
  commandText,
@@ -1347,7 +1284,7 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
1347
1284
  hoverService,
1348
1285
  configurationService
1349
1286
  ) {
1350
- const title = isComplete ? ( localize(6958, "Ran {0}", commandText)) : ( localize(6959, "Running {0}", commandText));
1287
+ const title = isComplete ? ( localize(7070, "Ran {0}", commandText)) : ( localize(7071, "Running {0}", commandText));
1351
1288
  super(title, context, undefined, hoverService, configurationService);
1352
1289
  this._terminalContentElement = contentElement;
1353
1290
  this._commandText = commandText;
@@ -1367,8 +1304,8 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
1367
1304
  const labelElement = this._collapseButton.labelElement;
1368
1305
  labelElement.textContent = "";
1369
1306
  if (this._isSandboxWrapped) {
1370
- const prefixText = this._isComplete ? ( localize(6960, "Ran ")) : ( localize(6961, "Running "));
1371
- const suffixText = ( localize(6962, " in sandbox"));
1307
+ const prefixText = this._isComplete ? ( localize(7072, "Ran ")) : ( localize(7073, "Running "));
1308
+ const suffixText = ( localize(7074, " in sandbox"));
1372
1309
  labelElement.appendChild(createTextNode(prefixText));
1373
1310
  const codeElement = createElement("code");
1374
1311
  codeElement.textContent = this._commandText;
@@ -1376,7 +1313,7 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
1376
1313
  labelElement.appendChild(createTextNode(suffixText));
1377
1314
  return;
1378
1315
  }
1379
- const prefixText = this._isComplete ? ( localize(6963, "Ran ")) : ( localize(6964, "Running "));
1316
+ const prefixText = this._isComplete ? ( localize(7075, "Ran ")) : ( localize(7076, "Running "));
1380
1317
  const ranText = createTextNode(prefixText);
1381
1318
  const codeElement = createElement("code");
1382
1319
  codeElement.textContent = this._commandText;
@@ -1405,4 +1342,4 @@ let ChatTerminalThinkingCollapsibleWrapper = class ChatTerminalThinkingCollapsib
1405
1342
  };
1406
1343
  ChatTerminalThinkingCollapsibleWrapper = ( __decorate([( __param(6, IHoverService)), ( __param(7, IConfigurationService))], ChatTerminalThinkingCollapsibleWrapper));
1407
1344
 
1408
- export { ChatTerminalThinkingCollapsibleWrapper, ChatTerminalToolProgressPart, ContinueInBackgroundAction, FocusChatInstanceAction, ToggleChatTerminalOutputAction };
1345
+ export { ChatTerminalThinkingCollapsibleWrapper, ChatTerminalToolProgressPart };