@codingame/monaco-vscode-katex-common 31.0.1 → 32.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 (220) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +15 -3
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +6 -5
  4. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +5 -1
  5. package/vscode/src/vs/platform/actions/browser/buttonbar.js +45 -14
  6. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +15 -1
  7. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +15 -10
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +51 -54
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
  14. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +3 -1
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +45 -23
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +13 -7
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +5 -3
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +4 -1
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +46 -32
  21. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +8 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +155 -46
  24. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +20 -1
  26. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +4 -1
  27. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +37 -14
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +1 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +28 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +250 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
  34. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +14 -11
  35. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
  36. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +7 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +7 -3
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +12 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +51 -20
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +6 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +56 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +2 -2
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +3 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +4 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +68 -10
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -2
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +653 -75
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +28 -10
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +91 -54
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +7 -5
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +53 -51
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -11
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +4 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +42 -22
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +6 -2
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +93 -35
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +5 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +169 -27
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +13 -4
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +29 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +60 -15
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +13 -6
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -8
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +6 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +125 -26
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +29 -23
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +14 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +119 -10
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +1 -1
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +77 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +38 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +125 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +1 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +132 -59
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +16 -3
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +156 -67
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +55 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +93 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +21 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +133 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +53 -8
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +288 -125
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +23 -2
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +699 -145
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +12 -8
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +12 -11
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.d.ts +62 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +120 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +191 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatPhoneInputPresenter.css +22 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -3
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +9 -25
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +4 -3
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +20 -1
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +89 -108
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +521 -9
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +19 -19
  136. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
  137. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.d.ts +2 -0
  138. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.js +6 -0
  139. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +27 -0
  140. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +82 -0
  141. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +3 -0
  142. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +44 -17
  143. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -3
  144. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +3 -46
  145. package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.d.ts → inlineChatAffordanceWidget.d.ts} +1 -1
  146. package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.js → inlineChatAffordanceWidget.js} +6 -6
  147. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -18
  148. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +19 -400
  149. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -9
  150. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +1 -1
  151. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +5 -19
  152. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +47 -133
  153. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +3 -1
  154. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +103 -25
  155. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +29 -0
  156. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +3 -32
  157. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -92
  158. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  168. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  169. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  170. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +7 -0
  171. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +99 -32
  172. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +13 -1
  173. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +76 -14
  174. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -3
  175. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +9 -1
  176. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +89 -28
  177. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +1 -1
  178. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -1
  179. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +11 -7
  180. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +3 -1
  181. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +7 -3
  182. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +1 -1
  183. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  184. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
  185. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  186. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +8 -0
  187. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +11 -2
  188. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +20 -0
  189. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +59 -4
  190. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -1
  191. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +24 -3
  192. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +47 -0
  193. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +111 -30
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +60 -3
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +455 -171
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +33 -0
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -0
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +31 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +49 -0
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +18 -0
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +302 -0
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +118 -0
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +34 -4
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +233 -48
  206. package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +0 -16
  207. package/vscode/src/vs/platform/actions/browser/actionbar.js +0 -22
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -539
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -29
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -386
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +0 -101
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +0 -509
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -130
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +0 -276
  216. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -45
  217. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +0 -93
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +0 -39
  219. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +0 -617
  220. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +0 -231
@@ -110,50 +110,112 @@ async function waitForIdleWithPromptHeuristics(onData, instance, idlePollInterva
110
110
  };
111
111
  }
112
112
  }
113
- async function trackIdleOnPrompt(instance, idleDurationMs, store, promptFallbackMs) {
113
+ async function trackIdleOnPrompt(instance, idleDurationMs, store, promptFallbackMs, logService, options) {
114
114
  const idleOnPrompt = ( new DeferredPromise());
115
115
  const onData = instance.onData;
116
+ const log = logService ? msg => logService.info(`trackIdleOnPrompt: ${msg}`) : undefined;
117
+ let TerminalState;
118
+ (function(TerminalState) {
119
+ TerminalState[TerminalState["Initial"] = 0] = "Initial";
120
+ TerminalState[TerminalState["Prompt"] = 1] = "Prompt";
121
+ TerminalState[TerminalState["Executing"] = 2] = "Executing";
122
+ TerminalState[TerminalState["PromptAfterExecuting"] = 3] = "PromptAfterExecuting";
123
+ })(TerminalState || (TerminalState = {}));
124
+ const stateNames = {
125
+ [0 ]: "Initial",
126
+ [1 ]: "Prompt",
127
+ [2 ]: "Executing",
128
+ [3 ]: "PromptAfterExecuting"
129
+ };
130
+ let state = 0 ;
131
+ let dataEventCount = 0;
132
+ function setState(newState, reason) {
133
+ if (state !== newState) {
134
+ log?.(`State ${stateNames[state]} → ${stateNames[newState]} (${reason})`);
135
+ state = newState;
136
+ }
137
+ }
116
138
  const scheduler = store.add(( new RunOnceScheduler(() => {
139
+ log?.(`Idle scheduler fired, completing (dataEvents=${dataEventCount})`);
117
140
  idleOnPrompt.complete();
118
141
  }, idleDurationMs)));
119
- let state = 0 ;
120
142
  const promptFallbackScheduler = store.add(( new RunOnceScheduler(() => {
121
143
  if (state === 2 || state === 3 ) {
122
144
  promptFallbackScheduler.cancel();
123
145
  return;
124
146
  }
125
- state = 3 ;
147
+ log?.(`Prompt fallback fired (dataEvents=${dataEventCount})`);
148
+ setState(3, "promptFallback");
126
149
  scheduler.schedule();
127
150
  }, promptFallbackMs ?? 1000)));
128
- let TerminalState;
129
- (function(TerminalState) {
130
- TerminalState[TerminalState["Initial"] = 0] = "Initial";
131
- TerminalState[TerminalState["Prompt"] = 1] = "Prompt";
132
- TerminalState[TerminalState["Executing"] = 2] = "Executing";
133
- TerminalState[TerminalState["PromptAfterExecuting"] = 3] = "PromptAfterExecuting";
134
- })(TerminalState || (TerminalState = {}));
151
+ const disableFallbacks = options?.disableFallbacks ?? false;
152
+ const initialFallbackScheduler = store.add(( new RunOnceScheduler(() => {
153
+ if (state === 2 || state === 3 ) {
154
+ log?.(`Initial fallback fired but state is ${stateNames[state]}, skipping`);
155
+ return;
156
+ }
157
+ log?.(`Initial fallback fired, no data events received`);
158
+ setState(3, "initialFallback");
159
+ scheduler.schedule();
160
+ }, 10_000)));
161
+ if (!disableFallbacks) {
162
+ initialFallbackScheduler.schedule();
163
+ }
164
+ const executingFallbackScheduler = store.add(( new RunOnceScheduler(() => {
165
+ if (state === 2 ) {
166
+ log?.(
167
+ `Executing fallback fired after 30s data-idle (dataEvents=${dataEventCount})`
168
+ );
169
+ setState(3, "executingFallback");
170
+ scheduler.schedule();
171
+ }
172
+ }, 30_000)));
173
+ const hardCapScheduler = store.add(( new RunOnceScheduler(() => {
174
+ if (state === 0 || state === 1 ) {
175
+ log?.(
176
+ `Hard cap fired after 5min in state ${stateNames[state]} (dataEvents=${dataEventCount})`
177
+ );
178
+ setState(3, "hardCap");
179
+ scheduler.schedule();
180
+ }
181
+ }, 60_000)));
182
+ if (!disableFallbacks) {
183
+ hardCapScheduler.schedule();
184
+ }
135
185
  store.add(onData(e => {
186
+ dataEventCount++;
187
+ initialFallbackScheduler.cancel();
136
188
  const matches = e.matchAll(/(?:\x1b\]|\x9d)[16]33;(?<type>[ACD])(?:;.*)?(?:\x1b\\|\x07|\x9c)/g);
137
189
  for (const match of matches) {
138
190
  if (match.groups?.type === "A") {
139
191
  if (state === 0 ) {
140
- state = 1 ;
192
+ setState(1, "sequence A");
141
193
  } else if (state === 2 ) {
142
- state = 3 ;
194
+ setState(3, "sequence A after executing");
195
+ executingFallbackScheduler.cancel();
143
196
  }
144
197
  } else if (match.groups?.type === "C" || match.groups?.type === "D") {
145
- state = 2 ;
198
+ setState(2, `sequence ${match.groups?.type}`);
199
+ if (!disableFallbacks) {
200
+ executingFallbackScheduler.schedule();
201
+ }
146
202
  }
147
203
  }
148
204
  if (state === 3 ) {
149
205
  promptFallbackScheduler.cancel();
206
+ executingFallbackScheduler.cancel();
150
207
  scheduler.schedule();
151
208
  } else {
152
209
  scheduler.cancel();
153
210
  if (state === 0 || state === 1 ) {
154
- promptFallbackScheduler.schedule();
211
+ if (!disableFallbacks) {
212
+ promptFallbackScheduler.schedule();
213
+ }
155
214
  } else {
156
215
  promptFallbackScheduler.cancel();
216
+ if (!disableFallbacks) {
217
+ executingFallbackScheduler.schedule();
218
+ }
157
219
  }
158
220
  }
159
221
  }));
@@ -9,6 +9,7 @@ import { waitForIdle, waitForIdleWithPromptHeuristics } from './executeStrategy.
9
9
  import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
10
10
  import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
11
11
  import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
12
+ import { isMultilineCommand } from '../runInTerminalHelpers.js';
12
13
 
13
14
  let NoneExecuteStrategy = class NoneExecuteStrategy extends Disposable {
14
15
  constructor(_instance, _hasReceivedUserInput, _configurationService, _logService) {
@@ -48,14 +49,14 @@ let NoneExecuteStrategy = class NoneExecuteStrategy extends Disposable {
48
49
  this._log.bind(this)
49
50
  );
50
51
  if (this._hasReceivedUserInput()) {
51
- this._log("Command timed out, sending SIGINT and retrying");
52
- await this._instance.sendText("\u0003", false);
52
+ this._log("Sending Ctrl+U to clear any pending input before sending command");
53
+ await this._instance.sendText("\u0015", false);
53
54
  await waitForIdle(this._instance.onData, 100);
54
55
  }
55
56
  this._log(`Executing command line \`${commandLine}\``);
56
57
  markerRecreation.dispose();
57
58
  const startLine = this._startMarker.value?.line;
58
- const forceBracketedPasteMode = isMacintosh;
59
+ const forceBracketedPasteMode = isMacintosh || isMultilineCommand(commandLine);
59
60
  this._instance.sendText(commandLine, true, forceBracketedPasteMode);
60
61
  if (startLine !== undefined) {
61
62
  this._log("Waiting for cursor to move past start line");
@@ -17,13 +17,21 @@ import type { IMarker as IXtermMarker } from "@xterm/xterm";
17
17
  export declare class RichExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
18
18
  private readonly _instance;
19
19
  private readonly _commandDetection;
20
+ private readonly _isSyncMode;
20
21
  private readonly _configurationService;
21
22
  private readonly _logService;
22
23
  readonly type = "rich";
23
24
  private readonly _startMarker;
24
25
  private readonly _onDidCreateStartMarker;
25
26
  onDidCreateStartMarker: Event<IXtermMarker | undefined>;
26
- constructor(_instance: ITerminalInstance, _commandDetection: ICommandDetectionCapability, _configurationService: IConfigurationService, _logService: ITerminalLogService);
27
+ /**
28
+ * Tracks per-execute() DisposableStores so they can be cleaned up if the
29
+ * strategy is disposed mid-flight, AND removed from this collection on
30
+ * successful completion to avoid accumulating stale references when
31
+ * execute() is invoked many times on the same strategy instance.
32
+ */
33
+ private readonly _executionStores;
34
+ constructor(_instance: ITerminalInstance, _commandDetection: ICommandDetectionCapability, _isSyncMode: boolean, _configurationService: IConfigurationService, _logService: ITerminalLogService);
27
35
  execute(commandLine: string, token: CancellationToken, commandId?: string, commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
28
36
  private _log;
29
37
  }
@@ -10,51 +10,109 @@ import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/plat
10
10
  import { trackIdleOnPrompt } from './executeStrategy.js';
11
11
  import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
12
12
  import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
13
+ import { isMultilineCommand } from '../runInTerminalHelpers.js';
13
14
 
15
+ function isTerminalLaunchError(value) {
16
+ return typeof value === "object" && value !== null && "message" in value;
17
+ }
18
+ function formatExitCodeOrError(exitCodeOrError) {
19
+ if (isTerminalLaunchError(exitCodeOrError)) {
20
+ return `launch error: ${exitCodeOrError.message}${exitCodeOrError.code !== undefined ? `, code=${exitCodeOrError.code}` : ""}`;
21
+ }
22
+ return `code=${exitCodeOrError}`;
23
+ }
24
+ function extractExitCode(exitCodeOrError) {
25
+ if (isNumber(exitCodeOrError)) {
26
+ return exitCodeOrError;
27
+ }
28
+ if (isTerminalLaunchError(exitCodeOrError)) {
29
+ return exitCodeOrError.code;
30
+ }
31
+ return undefined;
32
+ }
14
33
  let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
15
- constructor(_instance, _commandDetection, _configurationService, _logService) {
34
+ constructor(
35
+ _instance,
36
+ _commandDetection,
37
+ _isSyncMode,
38
+ _configurationService,
39
+ _logService
40
+ ) {
16
41
  super();
17
42
  this._instance = _instance;
18
43
  this._commandDetection = _commandDetection;
44
+ this._isSyncMode = _isSyncMode;
19
45
  this._configurationService = _configurationService;
20
46
  this._logService = _logService;
21
47
  this.type = "rich";
22
48
  this._startMarker = this._register(( new MutableDisposable()));
23
49
  this._onDidCreateStartMarker = this._register(( new Emitter()));
24
50
  this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
51
+ this._executionStores = this._register(( new DisposableStore()));
25
52
  }
26
53
  async execute(commandLine, token, commandId, commandLineForMetadata) {
27
54
  const store = ( new DisposableStore());
28
- this._register(store);
55
+ this._executionStores.add(store);
29
56
  try {
57
+ if (this._instance.isDisposed) {
58
+ this._log("Terminal already disposed at strategy entry");
59
+ throw ( new Error("The terminal was closed"));
60
+ }
61
+ if (this._instance.exitCode !== undefined) {
62
+ this._log(
63
+ `Terminal pty already exited at strategy entry (code=${this._instance.exitCode})`
64
+ );
65
+ return {
66
+ output: undefined,
67
+ exitCode: this._instance.exitCode,
68
+ additionalInformation: `Command exited with code ${this._instance.exitCode}`
69
+ };
70
+ }
71
+ const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
72
+ const staleMarker = this._commandDetection.executingCommandObject?.marker;
73
+ const onCommandFinishedFiltered = staleMarker ? Event.filter(
74
+ this._commandDetection.onCommandFinished,
75
+ e => e.marker !== staleMarker,
76
+ store
77
+ ) : this._commandDetection.onCommandFinished;
78
+ const onDone = Promise.race([Event.toPromise(onCommandFinishedFiltered, store).then(e => {
79
+ this._log("onDone via end event");
80
+ return {
81
+ "type": "success",
82
+ command: e
83
+ };
84
+ }), Event.toPromise(token.onCancellationRequested, store).then(() => {
85
+ this._log("onDone via cancellation");
86
+ }), Event.toPromise(this._instance.onDisposed, store).then(() => {
87
+ this._log("onDone via terminal disposal");
88
+ return {
89
+ type: "disposal"
90
+ };
91
+ }), Event.toPromise(this._instance.onExit, store).then(exitCodeOrError => {
92
+ this._log(`onDone via process exit (${formatExitCodeOrError(exitCodeOrError)})`);
93
+ return {
94
+ type: "processExit",
95
+ exitCodeOrError
96
+ };
97
+ }),
98
+ ...(this._isSyncMode ? [trackIdleOnPrompt(
99
+ this._instance,
100
+ idlePollInterval,
101
+ store,
102
+ idlePollInterval,
103
+ this._logService,
104
+ {
105
+ disableFallbacks: true
106
+ }
107
+ ).then(() => {
108
+ this._log("onDone via idle prompt");
109
+ })] : [])]);
30
110
  this._log("Waiting for xterm");
31
111
  const xterm = await this._instance.xtermReadyPromise;
32
112
  if (!xterm) {
33
113
  throw ( new Error("Xterm is not available"));
34
114
  }
35
115
  const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
36
- const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
37
- const onDone = Promise.race([
38
- Event.toPromise(this._commandDetection.onCommandFinished, store).then(e => {
39
- this._log("onDone via end event");
40
- return {
41
- "type": "success",
42
- command: e
43
- };
44
- }),
45
- Event.toPromise(token.onCancellationRequested, store).then(() => {
46
- this._log("onDone via cancellation");
47
- }),
48
- Event.toPromise(this._instance.onDisposed, store).then(() => {
49
- this._log("onDone via terminal disposal");
50
- return {
51
- type: "disposal"
52
- };
53
- }),
54
- trackIdleOnPrompt(this._instance, idlePollInterval, store, idlePollInterval).then(() => {
55
- this._log("onDone via idle prompt");
56
- })
57
- ]);
58
116
  const markerRecreation = setupRecreatingStartMarker(
59
117
  xterm,
60
118
  this._startMarker,
@@ -64,7 +122,7 @@ let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
64
122
  );
65
123
  this._log(`Executing command line \`${commandLine}\``);
66
124
  markerRecreation.dispose();
67
- const forceBracketedPasteMode = isMacintosh;
125
+ const forceBracketedPasteMode = isMacintosh || isMultilineCommand(commandLine);
68
126
  this._instance.runCommand(
69
127
  commandLine,
70
128
  true,
@@ -117,7 +175,10 @@ let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
117
175
  if (output !== undefined && output.trim().length === 0) {
118
176
  additionalInformationLines.push("Command produced no output");
119
177
  }
120
- const exitCode = finishedCommand?.exitCode;
178
+ let exitCode = finishedCommand?.exitCode;
179
+ if (exitCode === undefined && onDoneResult && onDoneResult.type === "processExit") {
180
+ exitCode = extractExitCode(onDoneResult.exitCodeOrError);
181
+ }
121
182
  if (isNumber(exitCode) && exitCode > 0) {
122
183
  additionalInformationLines.push(`Command exited with code ${exitCode}`);
123
184
  }
@@ -127,7 +188,7 @@ let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
127
188
  exitCode
128
189
  };
129
190
  } finally {
130
- store.dispose();
191
+ this._executionStores.delete(store);
131
192
  }
132
193
  }
133
194
  _log(message) {
@@ -139,6 +200,6 @@ let RichExecuteStrategy = class RichExecuteStrategy extends Disposable {
139
200
  }
140
201
  }
141
202
  };
142
- RichExecuteStrategy = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ITerminalLogService))], RichExecuteStrategy));
203
+ RichExecuteStrategy = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, ITerminalLogService))], RichExecuteStrategy));
143
204
 
144
205
  export { RichExecuteStrategy };
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { truncateOutputKeepingTail } from './runInTerminalHelpers.js';
3
3
 
4
- const MAX_OUTPUT_LENGTH = 16000;
4
+ const MAX_OUTPUT_LENGTH = 60000;
5
5
  function getOutput(instance, startMarker, options) {
6
6
  if (!instance.xterm || !instance.xterm.raw) {
7
7
  return '';
@@ -8,7 +8,6 @@ export declare function isBash(envShell: string, os: OperatingSystem): boolean;
8
8
  export declare function isFish(envShell: string, os: OperatingSystem): boolean;
9
9
  export declare const TRUNCATION_MESSAGE = "\n\n[... PREVIOUS OUTPUT TRUNCATED ...]\n\n";
10
10
  export declare function truncateOutputKeepingTail(output: string, maxLength: number): string;
11
- export declare function sanitizeTerminalOutput(output: string): string;
12
11
  /**
13
12
  * Normalizes command text for UI display by removing unnecessary quote and forward slash
14
13
  * escaping artifacts (for example: \" \' \/) commonly produced in streamed tool-call JSON.
@@ -24,6 +23,17 @@ export declare function buildCommandDisplayText(command: string): string;
24
23
  * This prevents multi-line input from being sent as multiple commands via sendText.
25
24
  */
26
25
  export declare function normalizeCommandForExecution(command: string): string;
26
+ /**
27
+ * Whether a command spans multiple lines (heredoc, multi-statement block, etc.).
28
+ * Multi-line commands must be sent verbatim through bracketed paste mode so the
29
+ * shell treats them as a single paste instead of executing each line as it
30
+ * arrives.
31
+ *
32
+ * Bare line continuations (`\` immediately before a newline) are **not**
33
+ * considered multi-line because the shell joins them into a single logical
34
+ * line. Only newlines that are *not* preceded by a backslash count.
35
+ */
36
+ export declare function isMultilineCommand(command: string): boolean;
27
37
  export declare function generateAutoApproveActions(commandLine: string, subCommands: string[], autoApproveResult: {
28
38
  subCommandResults: ICommandApprovalResultWithReason[];
29
39
  commandLineResult: ICommandApprovalResultWithReason;
@@ -57,6 +57,10 @@ function buildCommandDisplayText(command) {
57
57
  function normalizeCommandForExecution(command) {
58
58
  return command.replace(/\r\n|\r|\n/g, " ").trim();
59
59
  }
60
+ function isMultilineCommand(command) {
61
+ const normalized = command.replace(/\r\n|\r/g, "\n");
62
+ return /(?<!\\)\n/.test(normalized);
63
+ }
60
64
  function generateAutoApproveActions(commandLine, subCommands, autoApproveResult) {
61
65
  const actions = [];
62
66
  const canCreateAutoApproval = (autoApproveResult.subCommandResults.every(e => e.result !== "denied") && autoApproveResult.commandLineResult.result !== "denied");
@@ -162,7 +166,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
162
166
  const firstSubcommandFirstWord = unapprovedSubCommands.length > 0 ? unapprovedSubCommands[0].split(" ")[0] : "";
163
167
  if (firstSubcommandFirstWord !== commandLine && !( commandsWithSubcommands.has(commandLine)) && !( commandsWithSubSubCommands.has(commandLine))) {
164
168
  actions.push({
165
- label: ( localize(13997, "Allow Exact Command Line in this Session")),
169
+ label: ( localize(14286, "Allow Exact Command Line in this Session")),
166
170
  data: {
167
171
  type: "newRule",
168
172
  rule: {
@@ -176,7 +180,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
176
180
  }
177
181
  });
178
182
  actions.push({
179
- label: ( localize(13998, "Allow Exact Command Line in this Workspace")),
183
+ label: ( localize(14287, "Allow Exact Command Line in this Workspace")),
180
184
  data: {
181
185
  type: "newRule",
182
186
  rule: {
@@ -190,7 +194,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
190
194
  }
191
195
  });
192
196
  actions.push({
193
- label: ( localize(13999, "Always Allow Exact Command Line")),
197
+ label: ( localize(14288, "Always Allow Exact Command Line")),
194
198
  data: {
195
199
  type: "newRule",
196
200
  rule: {
@@ -209,15 +213,15 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
209
213
  actions.push(( new Separator()));
210
214
  }
211
215
  actions.push({
212
- label: ( localize(14000, "Allow All Commands in this Session")),
213
- tooltip: ( localize(14001, "Allow this tool to run in this session without confirmation.")),
216
+ label: ( localize(14289, "Allow All Commands in this Session")),
217
+ tooltip: ( localize(14290, "Allow this tool to run in this session without confirmation.")),
214
218
  data: {
215
219
  type: "sessionApproval"
216
220
  }
217
221
  });
218
222
  actions.push(( new Separator()));
219
223
  actions.push({
220
- label: ( localize(14002, "Configure Auto Approve...")),
224
+ label: ( localize(14291, "Configure Auto Approve...")),
221
225
  data: {
222
226
  type: "configure"
223
227
  }
@@ -253,4 +257,4 @@ function extractCdPrefix(commandLine, shell, os) {
253
257
  return undefined;
254
258
  }
255
259
 
256
- export { TRUNCATION_MESSAGE, buildCommandDisplayText, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isPowerShell, isWindowsPowerShell, isZsh, normalizeCommandForExecution, normalizeTerminalCommandForDisplay, truncateOutputKeepingTail };
260
+ export { TRUNCATION_MESSAGE, buildCommandDisplayText, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isMultilineCommand, isPowerShell, isWindowsPowerShell, isZsh, normalizeCommandForExecution, normalizeTerminalCommandForDisplay, truncateOutputKeepingTail };
@@ -1,9 +1,11 @@
1
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
1
2
  import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
2
3
  import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
3
4
  import { ShellIntegrationQuality } from "./toolTerminalCreator.js";
4
5
  export declare class RunInTerminalToolTelemetry {
5
6
  private readonly _telemetryService;
6
- constructor(_telemetryService: ITelemetryService);
7
+ private readonly _configurationService;
8
+ constructor(_telemetryService: ITelemetryService, _configurationService: IConfigurationService);
7
9
  logPrepare(state: {
8
10
  terminalToolSessionId: string | undefined;
9
11
  subCommands: string[];
@@ -1,12 +1,15 @@
1
1
 
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
3
4
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
4
5
  import { TelemetryTrustedValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
6
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
5
7
  import { ShellIntegrationQuality } from './toolTerminalCreator.js';
6
8
 
7
9
  let RunInTerminalToolTelemetry = class RunInTerminalToolTelemetry {
8
- constructor(_telemetryService) {
10
+ constructor(_telemetryService, _configurationService) {
9
11
  this._telemetryService = _telemetryService;
12
+ this._configurationService = _configurationService;
10
13
  }
11
14
  logPrepare(state) {
12
15
  const subCommandsSanitized = ( state.subCommands.map(e => {
@@ -76,11 +79,12 @@ let RunInTerminalToolTelemetry = class RunInTerminalToolTelemetry {
76
79
  inputToolManualChars: state.inputToolManualChars ?? 0,
77
80
  inputToolManualShownCount: state.inputToolManualShownCount ?? 0,
78
81
  inputToolFreeFormInputShownCount: state.inputToolFreeFormInputShownCount ?? 0,
79
- inputToolFreeFormInputCount: state.inputToolFreeFormInputCount ?? 0
82
+ inputToolFreeFormInputCount: state.inputToolFreeFormInputCount ?? 0,
83
+ compressOutputEnabled: this._configurationService.getValue(ChatConfiguration.CompressOutputEnabled) === true
80
84
  });
81
85
  }
82
86
  };
83
- RunInTerminalToolTelemetry = ( __decorate([( __param(0, ITelemetryService))], RunInTerminalToolTelemetry));
87
+ RunInTerminalToolTelemetry = ( __decorate([( __param(0, ITelemetryService)), ( __param(1, IConfigurationService))], RunInTerminalToolTelemetry));
84
88
  const commandAllowList = ( new Set([
85
89
  "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "~", "{", "}", "<", ">",
86
90
  ".", "7z", "alias", "assoc", "attrib", "awk", "basename", "bg", "blkid", "bunzip2", "bzip2", "cat", "cd", "certutil", "chkdsk", "chmod", "chown", "cipher", "clear", "cls", "cmp", "column", "comm", "compact", "compress", "copy", "cp", "curl", "cut", "date", "dd", "del", "df", "diff", "dig", "dir", "dirname", "diskpart", "dism", "disown", "du", "echo", "env", "erase", "eval", "expand", "export", "fc", "fdisk", "fg", "file", "find", "findstr", "fmt", "fold", "forfiles", "format", "free", "fsck", "git", "gpupdate", "grep", "groupadd", "groups", "gunzip", "gzip", "hash", "head", "hexdump", "history", "host", "htop", "icacls", "id", "ifconfig", "iostat", "ip", "ipconfig", "iptables", "jobs", "jq", "kill", "killall", "less", "ln", "locate", "ls", "lsblk", "lscpu", "lsof", "man", "mkdir", "mklink", "more", "mount", "move", "mv", "nbtstat", "nc/netcat", "net", "netstat", "nice", "nl", "nohup", "nslookup", "nslookup", "od", "passwd", "paste", "pathping", "pause", "pgrep", "ping", "pkill", "powercfg", "pr", "printenv", "ps", "pwd", "query", "rar", "readlink", "realpath", "reg", "rem", "ren", "rename", "renice", "rev", "rm", "rmdir", "robocopy", "route", "rsync", "sc", "schtasks", "scp", "sed", "seq", "set", "setx", "sfc", "shred", "shuf", "shutdown", "sleep", "sort", "source", "split", "ss", "ssh", "stat", "strings", "su", "subst", "sudo", "systeminfo", "tac", "tail", "tar", "tee", "telnet", "test", "time", "top", "touch", "tr", "traceroute", "tracert", "tree", "true", "truncate", "type", "type", "umask", "umount", "unalias", "uname", "uncompress", "unexpand", "uniq", "unlink", "unrar", "unzip", "uptime", "useradd", "usermod", "vmstat", "vol", "watch", "wc", "wget", "where", "whereis", "which", "who", "whoami", "wmic", "xargs", "xcopy", "xxd", "xz", "yes", "zcat", "zip", "zless", "zmore",
@@ -257,7 +257,7 @@ let CommandLineAutoApprover = class CommandLineAutoApprover extends Disposable {
257
257
  function checkTarget(inspectValue) {
258
258
  return (isObject(inspectValue) && Object.prototype.hasOwnProperty.call(inspectValue, key) && structuralEquals(inspectValue[key], value));
259
259
  }
260
- const sourceTarget = (checkTarget(configInspectValue.workspaceFolder) ? ConfigurationTarget.WORKSPACE_FOLDER : checkTarget(configInspectValue.workspaceValue) ? ConfigurationTarget.WORKSPACE : checkTarget(configInspectValue.userRemoteValue) ? ConfigurationTarget.USER_REMOTE : checkTarget(configInspectValue.userLocalValue) ? ConfigurationTarget.USER_LOCAL : checkTarget(configInspectValue.userValue) ? ConfigurationTarget.USER : checkTarget(configInspectValue.applicationValue) ? ConfigurationTarget.APPLICATION : ConfigurationTarget.DEFAULT);
260
+ const sourceTarget = (checkTarget(configInspectValue.workspaceFolderValue) ? ConfigurationTarget.WORKSPACE_FOLDER : checkTarget(configInspectValue.workspaceValue) ? ConfigurationTarget.WORKSPACE : checkTarget(configInspectValue.userRemoteValue) ? ConfigurationTarget.USER_REMOTE : checkTarget(configInspectValue.userLocalValue) ? ConfigurationTarget.USER_LOCAL : checkTarget(configInspectValue.userValue) ? ConfigurationTarget.USER : checkTarget(configInspectValue.applicationValue) ? ConfigurationTarget.APPLICATION : ConfigurationTarget.DEFAULT);
261
261
  if (ignoreDefaults && isDefaultRule && sourceTarget === ConfigurationTarget.DEFAULT) {
262
262
  continue;
263
263
  }
@@ -154,7 +154,7 @@ let NpmScriptAutoApprover = class NpmScriptAutoApprover extends Disposable {
154
154
  isAutoApproved: true,
155
155
  scriptName,
156
156
  autoApproveInfo: ( new MarkdownString(( localize(
157
- 14005,
157
+ 14294,
158
158
  "Auto approved as {0} is defined in package.json",
159
159
  `\`${scriptName}\``
160
160
  ))))
@@ -31,6 +31,7 @@ export interface ICommandLineAnalyzerOptions {
31
31
  terminalToolSessionId: string;
32
32
  chatSessionResource: URI | undefined;
33
33
  requiresUnsandboxConfirmation?: boolean;
34
+ hasSessionAutoApproval?: boolean;
34
35
  }
35
36
  export interface ICommandLineAnalyzerResult {
36
37
  /**
@@ -56,7 +56,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
56
56
  isAutoApproved: true,
57
57
  isAutoApproveAllowed: true,
58
58
  disclaimers: [],
59
- autoApproveInfo: ( new MarkdownString(`${( localize(14006, "Auto approved for this session"))} ([${( localize(14007, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings))
59
+ autoApproveInfo: ( new MarkdownString(`${( localize(14295, "Auto approved for this session"))} ([${( localize(14296, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings))
60
60
  };
61
61
  }
62
62
  const trimmedCommandLine = options.commandLine.trimStart();
@@ -158,7 +158,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
158
158
  const subCommandsLowerFirstWordOnly = ( subCommands.map(command => command.split(" ")[0].toLowerCase()));
159
159
  if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) || (isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
160
160
  disclaimers.push(( localize(
161
- 14008,
161
+ 14297,
162
162
  "Web content may contain malicious code or attempt prompt injection attacks."
163
163
  )));
164
164
  }
@@ -199,10 +199,10 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
199
199
  return ( asArray(result).filter(e => isAutoApproveRule(e.rule)).map(e => {
200
200
  const escapedSourceText = e.rule.sourceText.replaceAll("$", "\\$");
201
201
  if (e.rule.sourceTarget === "session") {
202
- return localize(14009, "{0} (session)", `\`${escapedSourceText}\``);
202
+ return localize(14298, "{0} (session)", `\`${escapedSourceText}\``);
203
203
  }
204
204
  const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
205
- const tooltip = ( localize(14010, "View rule in settings"));
205
+ const tooltip = ( localize(14299, "View rule in settings"));
206
206
  let label = escapedSourceText;
207
207
  switch (e.rule?.sourceTarget) {
208
208
  case ConfigurationTarget.DEFAULT:
@@ -233,9 +233,9 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
233
233
  if (isGlobalAutoApproved) {
234
234
  const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, "global");
235
235
  return (new MarkdownString(`${( localize(
236
- 14011,
236
+ 14300,
237
237
  "Auto approved by setting {0}",
238
- `[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(14012, "View settings"))}")`
238
+ `[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(14301, "View settings"))}")`
239
239
  ))}`, mdTrustSettings));
240
240
  }
241
241
  if (isAutoApproved) {
@@ -244,7 +244,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
244
244
  {
245
245
  if (isAutoApproveRule(commandLineResult.rule)) {
246
246
  return (new MarkdownString(
247
- localize(14013, "Auto approved by rule {0}", formatRuleLinks(commandLineResult)),
247
+ localize(14302, "Auto approved by rule {0}", formatRuleLinks(commandLineResult)),
248
248
  mdTrustSettings
249
249
  ));
250
250
  }
@@ -259,12 +259,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
259
259
  const uniqueRules = dedupeRules(subCommandResults);
260
260
  if (uniqueRules.length === 1) {
261
261
  return (new MarkdownString(
262
- localize(14013, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
262
+ localize(14302, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
263
263
  mdTrustSettings
264
264
  ));
265
265
  } else if (uniqueRules.length > 1) {
266
266
  return (new MarkdownString(
267
- localize(14014, "Auto approved by rules {0}", formatRuleLinks(uniqueRules)),
267
+ localize(14303, "Auto approved by rules {0}", formatRuleLinks(uniqueRules)),
268
268
  mdTrustSettings
269
269
  ));
270
270
  }
@@ -277,7 +277,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
277
277
  {
278
278
  if (commandLineResult.rule) {
279
279
  return (new MarkdownString(localize(
280
- 14015,
280
+ 14304,
281
281
  "Auto approval denied by rule {0}",
282
282
  formatRuleLinks(commandLineResult)
283
283
  ), mdTrustSettings));
@@ -289,12 +289,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
289
289
  const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === "denied"));
290
290
  if (uniqueRules.length === 1) {
291
291
  return (new MarkdownString(
292
- localize(14015, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
292
+ localize(14304, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
293
293
  mdTrustSettings
294
294
  ));
295
295
  } else if (uniqueRules.length > 1) {
296
296
  return (new MarkdownString(
297
- localize(14016, "Auto approval denied by rules {0}", formatRuleLinks(uniqueRules)),
297
+ localize(14305, "Auto approval denied by rules {0}", formatRuleLinks(uniqueRules)),
298
298
  mdTrustSettings
299
299
  ));
300
300
  }
@@ -16,4 +16,12 @@ export declare class CommandLineFileWriteAnalyzer extends Disposable implements
16
16
  private _stripSurroundingQuotes;
17
17
  private _mapNullDevice;
18
18
  private _getResult;
19
+ /**
20
+ * Returns true if the given URI path points inside an OS temporary directory.
21
+ * On posix systems this matches `/tmp/`. On Windows this matches any `temp`
22
+ * or `tmp` directory segment (case-insensitive), which covers the canonical
23
+ * user temp (`...\AppData\Local\Temp\`), system temp (`C:\Windows\Temp\`),
24
+ * and common dev conventions like `C:\Temp\` and `C:\tmp\`.
25
+ */
26
+ private _isInTempDirectory;
19
27
  }