@codingame/monaco-vscode-katex-common 33.0.7 → 34.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 (255) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.css +169 -0
  3. package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.d.ts +28 -0
  4. package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.js +61 -0
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +1 -1
  6. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +1 -1
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
  8. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +18 -17
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +40 -38
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +14 -14
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +1 -16
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +4 -48
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +16 -18
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +81 -69
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +1 -3
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +5 -22
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.d.ts +2 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.js +21 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +18 -28
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +2 -2
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +30 -30
  29. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +13 -2
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +177 -80
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +15 -15
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +7 -2
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +69 -5
  35. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +3 -3
  36. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
  37. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +25 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +2 -1
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +4 -2
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.d.ts +93 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.js +140 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.d.ts +46 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.js +134 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -15
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +49 -117
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +30 -30
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +47 -4
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +3 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +52 -51
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +18 -14
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +23 -13
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +13 -11
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +15 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +87 -11
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +21 -4
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +102 -35
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +22 -1
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +22 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +6 -2
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +1 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +21 -2
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +1 -1
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +35 -18
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +62 -35
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
  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/chatToolOutputPart.js +2 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.d.ts +2 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +15 -12
  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/chatToolProgressPart.d.ts +1 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +10 -3
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +2 -2
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +13 -15
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +4 -4
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +19 -1
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +154 -59
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +21 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.d.ts +4 -3
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +6 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +17 -2
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +113 -23
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.d.ts +21 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.js +64 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +10 -1
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +7 -1
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +11 -1
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +18 -7
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +26 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +361 -66
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +2 -2
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +4 -4
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.d.ts +30 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.js +147 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +11 -5
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +133 -87
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -4
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -2
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +13 -7
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatGoalBannerWidget.css +81 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +32 -18
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +2 -2
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -40
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +23 -2
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +66 -11
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -6
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +373 -32
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +5 -3
  144. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +18 -0
  145. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
  146. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +6 -6
  147. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
  148. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.d.ts +12 -2
  149. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +54 -11
  150. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
  151. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
  152. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  153. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
  154. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  164. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  165. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  166. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +0 -76
  167. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +0 -191
  168. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -50
  169. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -138
  170. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -12
  171. package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -14
  172. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
  173. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
  174. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +0 -87
  175. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +0 -10
  176. package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +0 -2
  177. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
  178. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
  179. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  180. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
  181. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
  182. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -52
  183. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -232
  184. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -65
  185. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -225
  186. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
  187. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -143
  188. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -37
  189. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -205
  190. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
  191. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
  192. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -7
  193. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -43
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -52
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -260
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -44
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -98
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -42
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -225
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -53
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
  206. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
  207. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
  208. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -27
  209. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -177
  210. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -11
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -33
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -22
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +0 -42
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +0 -102
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -24
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -15
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -53
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -177
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -512
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -42
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -258
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -2623
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -43
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +0 -22
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +0 -44
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -1
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -58
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -223
  248. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +0 -31
  249. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +0 -49
  250. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +0 -18
  251. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +0 -302
  252. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +0 -7
  253. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +0 -118
  254. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -114
  255. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -788
@@ -1,53 +0,0 @@
1
- import type { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
2
- import type { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
- import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
4
- import type { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
5
- import type { ConfigurationTarget } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration";
6
- import type { ToolConfirmationAction } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
7
- import type { INpmScriptAutoApproveResult } from "./autoApprove/npmScriptAutoApprover.js";
8
- import type { TreeSitterCommandParserLanguage } from "../../treeSitterCommandParser.js";
9
- export interface IAutoApproveRule {
10
- regex: RegExp;
11
- regexCaseInsensitive: RegExp;
12
- sourceText: string;
13
- sourceTarget: ConfigurationTarget | "session";
14
- isDefaultRule: boolean;
15
- }
16
- export interface INpmScriptAutoApproveRule {
17
- type: "npmScript";
18
- npmScriptResult: INpmScriptAutoApproveResult;
19
- }
20
- export declare function isAutoApproveRule(rule: IAutoApproveRule | INpmScriptAutoApproveRule | undefined): rule is IAutoApproveRule;
21
- export declare function isNpmScriptAutoApproveRule(rule: IAutoApproveRule | INpmScriptAutoApproveRule | undefined): rule is INpmScriptAutoApproveRule;
22
- export interface ICommandLineAnalyzer extends IDisposable {
23
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
24
- }
25
- export interface ICommandLineAnalyzerOptions {
26
- commandLine: string;
27
- cwd: URI | undefined;
28
- shell: string;
29
- os: OperatingSystem;
30
- treeSitterLanguage: TreeSitterCommandParserLanguage;
31
- terminalToolSessionId: string;
32
- chatSessionResource: URI | undefined;
33
- requiresUnsandboxConfirmation?: boolean;
34
- hasSessionAutoApproval?: boolean;
35
- }
36
- export interface ICommandLineAnalyzerResult {
37
- /**
38
- * Whether auto approval is allowed based on the analysis, when false this
39
- * will block auto approval.
40
- */
41
- readonly isAutoApproveAllowed: boolean;
42
- /**
43
- * Whether the command line was explicitly auto approved by this analyzer.
44
- * - `true`: This analyzer explicitly approves auto-execution
45
- * - `false`: This analyzer explicitly denies auto-execution
46
- * - `undefined`: This analyzer does not make an approval/denial decision
47
- */
48
- readonly isAutoApproved?: boolean;
49
- readonly disclaimers?: readonly (string | IMarkdownString)[];
50
- readonly autoApproveInfo?: IMarkdownString;
51
- readonly customActions?: ToolConfirmationAction[];
52
- readonly forceAutoApproval?: boolean;
53
- }
@@ -1,10 +0,0 @@
1
-
2
-
3
- function isAutoApproveRule(rule) {
4
- return !!rule && 'sourceText' in rule;
5
- }
6
- function isNpmScriptAutoApproveRule(rule) {
7
- return !!rule && 'type' in rule && rule.type === 'npmScript';
8
- }
9
-
10
- export { isAutoApproveRule, isNpmScriptAutoApproveRule };
@@ -1,20 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
- import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
5
- import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
6
- import type { RunInTerminalToolTelemetry } from "../../runInTerminalToolTelemetry.js";
7
- import { type TreeSitterCommandParser } from "../../treeSitterCommandParser.js";
8
- import { type ICommandLineAnalyzer, type ICommandLineAnalyzerOptions, type ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
9
- export declare class CommandLineAutoApproveAnalyzer extends Disposable implements ICommandLineAnalyzer {
10
- private readonly _treeSitterCommandParser;
11
- private readonly _telemetry;
12
- private readonly _log;
13
- private readonly _configurationService;
14
- private readonly _storageService;
15
- private readonly _terminalChatService;
16
- private readonly _commandLineAutoApprover;
17
- constructor(_treeSitterCommandParser: TreeSitterCommandParser, _telemetry: RunInTerminalToolTelemetry, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, instantiationService: IInstantiationService, _storageService: IStorageService, _terminalChatService: ITerminalChatService);
18
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
19
- private _createAutoApproveInfo;
20
- }
@@ -1,310 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { asArray } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
4
- import { createCommandUri, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
5
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
- import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
8
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
9
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
- import { ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
11
- import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
12
- import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
13
- import { TerminalToolConfirmationStorageKeys } from '../../../../../chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js';
14
- import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
15
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
16
- import { isPowerShell, generateAutoApproveActions, dedupeRules } from '../../runInTerminalHelpers.js';
17
- import { isAutoApproveRule, isNpmScriptAutoApproveRule } from './commandLineAnalyzer.js';
18
- import { TerminalChatCommandId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
19
- import { CommandLineAutoApprover } from './autoApprove/commandLineAutoApprover.js';
20
-
21
- const promptInjectionWarningCommandsLower = ["curl", "wget"];
22
- const promptInjectionWarningCommandsLowerPwshOnly = ["invoke-restmethod", "invoke-webrequest", "irm", "iwr"];
23
- let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extends Disposable {
24
- constructor(
25
- _treeSitterCommandParser,
26
- _telemetry,
27
- _log,
28
- _configurationService,
29
- instantiationService,
30
- _storageService,
31
- _terminalChatService
32
- ) {
33
- super();
34
- this._treeSitterCommandParser = _treeSitterCommandParser;
35
- this._telemetry = _telemetry;
36
- this._log = _log;
37
- this._configurationService = _configurationService;
38
- this._storageService = _storageService;
39
- this._terminalChatService = _terminalChatService;
40
- this._commandLineAutoApprover = this._register(instantiationService.createInstance(CommandLineAutoApprover));
41
- }
42
- async analyze(options) {
43
- const isAutoApproveEnabledInSettings = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
44
- if (isAutoApproveEnabledInSettings && options.chatSessionResource && this._terminalChatService.hasChatSessionAutoApproval(options.chatSessionResource)) {
45
- this._log("Session has auto approval enabled, auto approving command");
46
- const disableUri = createCommandUri(
47
- TerminalChatCommandId.DisableSessionAutoApproval,
48
- options.chatSessionResource
49
- );
50
- const mdTrustSettings = {
51
- isTrusted: {
52
- enabledCommands: [TerminalChatCommandId.DisableSessionAutoApproval]
53
- }
54
- };
55
- return {
56
- isAutoApproved: true,
57
- isAutoApproveAllowed: true,
58
- disclaimers: [],
59
- autoApproveInfo: ( new MarkdownString(`${( localize(14450, "Auto approved for this session"))} ([${( localize(14451, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings))
60
- };
61
- }
62
- const trimmedCommandLine = options.commandLine.trimStart();
63
- let subCommands;
64
- try {
65
- subCommands = await this._treeSitterCommandParser.extractSubCommands(options.treeSitterLanguage, trimmedCommandLine);
66
- this._log(
67
- `Parsed sub-commands via ${options.treeSitterLanguage} grammar`,
68
- subCommands
69
- );
70
- } catch (e) {
71
- console.error(e);
72
- this._log(`Failed to parse sub-commands via ${options.treeSitterLanguage} grammar`);
73
- }
74
- let isAutoApproved = false;
75
- let autoApproveInfo;
76
- let customActions;
77
- if (!subCommands?.length) {
78
- if (trimmedCommandLine.length === 0) {
79
- this._log("Command line is empty, auto approving");
80
- return {
81
- isAutoApproved: true,
82
- isAutoApproveAllowed: true,
83
- disclaimers: []
84
- };
85
- }
86
- this._log("No sub-commands were parsed, auto approval is not allowed");
87
- return {
88
- isAutoApproveAllowed: false,
89
- disclaimers: []
90
- };
91
- }
92
- const subCommandResults = await Promise.all(( subCommands.map(
93
- e => this._commandLineAutoApprover.isCommandAutoApproved(e, options.shell, options.os, options.cwd, options.chatSessionResource)
94
- )));
95
- const commandLineResult = this._commandLineAutoApprover.isCommandLineAutoApproved(trimmedCommandLine, options.chatSessionResource);
96
- const autoApproveReasons = [...( subCommandResults.map(e => e.reason)), commandLineResult.reason];
97
- let isDenied = false;
98
- let autoApproveReason;
99
- let autoApproveDefault;
100
- const deniedSubCommandResult = subCommandResults.find(e => e.result === "denied");
101
- if (deniedSubCommandResult) {
102
- this._log("Sub-command DENIED auto approval");
103
- isDenied = true;
104
- autoApproveDefault = isAutoApproveRule(deniedSubCommandResult.rule) ? deniedSubCommandResult.rule.isDefaultRule : undefined;
105
- autoApproveReason = "subCommand";
106
- } else if (commandLineResult.result === "denied") {
107
- this._log("Command line DENIED auto approval");
108
- isDenied = true;
109
- autoApproveDefault = isAutoApproveRule(commandLineResult.rule) ? commandLineResult.rule.isDefaultRule : undefined;
110
- autoApproveReason = "commandLine";
111
- } else {
112
- if (subCommandResults.every(e => e.result === "approved")) {
113
- this._log("All sub-commands auto-approved");
114
- isAutoApproved = true;
115
- autoApproveReason = "subCommand";
116
- autoApproveDefault = subCommandResults.every(e => isAutoApproveRule(e.rule) && e.rule.isDefaultRule);
117
- } else {
118
- this._log("All sub-commands NOT auto-approved");
119
- if (commandLineResult.result === "approved") {
120
- this._log("Command line auto-approved");
121
- autoApproveReason = "commandLine";
122
- isAutoApproved = true;
123
- autoApproveDefault = isAutoApproveRule(commandLineResult.rule) ? commandLineResult.rule.isDefaultRule : undefined;
124
- } else {
125
- this._log("Command line NOT auto-approved");
126
- }
127
- }
128
- }
129
- for (const reason of autoApproveReasons) {
130
- this._log(`- ${reason}`);
131
- }
132
- const isAutoApproveEnabled = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
133
- const isAutoApproveWarningAccepted = this._storageService.getBoolean(
134
- TerminalToolConfirmationStorageKeys.TerminalAutoApproveWarningAccepted,
135
- StorageScope.APPLICATION,
136
- false
137
- );
138
- if (isAutoApproveEnabled && isAutoApproved) {
139
- autoApproveInfo = this._createAutoApproveInfo(
140
- isAutoApproved,
141
- isDenied,
142
- autoApproveReason,
143
- subCommandResults,
144
- commandLineResult
145
- );
146
- } else {
147
- isAutoApproved = false;
148
- }
149
- this._telemetry.logPrepare({
150
- terminalToolSessionId: options.terminalToolSessionId,
151
- subCommands,
152
- autoApproveAllowed: !isAutoApproveEnabled ? "off" : isAutoApproveWarningAccepted ? "allowed" : "needsOptIn",
153
- autoApproveResult: isAutoApproved ? "approved" : isDenied ? "denied" : "manual",
154
- autoApproveReason,
155
- autoApproveDefault
156
- });
157
- const disclaimers = [];
158
- const subCommandsLowerFirstWordOnly = ( subCommands.map(command => command.split(" ")[0].toLowerCase()));
159
- if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) || (isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
160
- disclaimers.push(( localize(
161
- 14452,
162
- "Web content may contain malicious code or attempt prompt injection attacks."
163
- )));
164
- }
165
- if (isAutoApproveEnabled && isDenied) {
166
- const denialInfo = this._createAutoApproveInfo(
167
- isAutoApproved,
168
- isDenied,
169
- autoApproveReason,
170
- subCommandResults,
171
- commandLineResult
172
- );
173
- if (denialInfo) {
174
- disclaimers.push(denialInfo);
175
- }
176
- }
177
- if (!isAutoApproved && isAutoApproveEnabled) {
178
- customActions = generateAutoApproveActions(trimmedCommandLine, subCommands, {
179
- subCommandResults,
180
- commandLineResult
181
- });
182
- }
183
- return {
184
- isAutoApproved,
185
- isAutoApproveAllowed: true,
186
- disclaimers,
187
- autoApproveInfo,
188
- customActions
189
- };
190
- }
191
- _createAutoApproveInfo(
192
- isAutoApproved,
193
- isDenied,
194
- autoApproveReason,
195
- subCommandResults,
196
- commandLineResult
197
- ) {
198
- const formatRuleLinks = result => {
199
- return ( asArray(result).filter(e => isAutoApproveRule(e.rule)).map(e => {
200
- const escapedSourceText = e.rule.sourceText.replaceAll("$", "\\$");
201
- if (e.rule.sourceTarget === "session") {
202
- return localize(14453, "{0} (session)", `\`${escapedSourceText}\``);
203
- }
204
- const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
205
- const tooltip = ( localize(14454, "View rule in settings"));
206
- let label = escapedSourceText;
207
- switch (e.rule?.sourceTarget) {
208
- case ConfigurationTarget.DEFAULT:
209
- label = `${label} (default)`;
210
- break;
211
- case ConfigurationTarget.USER:
212
- case ConfigurationTarget.USER_LOCAL:
213
- label = `${label} (user)`;
214
- break;
215
- case ConfigurationTarget.USER_REMOTE:
216
- label = `${label} (remote)`;
217
- break;
218
- case ConfigurationTarget.WORKSPACE:
219
- case ConfigurationTarget.WORKSPACE_FOLDER:
220
- label = `${label} (workspace)`;
221
- break;
222
- }
223
- return `[\`${label}\`](${( settingsUri.toString())} "${tooltip}")`;
224
- })).join(", ");
225
- };
226
- const mdTrustSettings = {
227
- isTrusted: {
228
- enabledCommands: [TerminalChatCommandId.OpenTerminalSettingsLink]
229
- }
230
- };
231
- const config = this._configurationService.inspect(ChatConfiguration.GlobalAutoApprove);
232
- const isGlobalAutoApproved = config?.value ?? config.defaultValue;
233
- if (isGlobalAutoApproved) {
234
- const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, "global");
235
- return (new MarkdownString(`${( localize(
236
- 14455,
237
- "Auto approved by setting {0}",
238
- `[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(14456, "View settings"))}")`
239
- ))}`, mdTrustSettings));
240
- }
241
- if (isAutoApproved) {
242
- switch (autoApproveReason) {
243
- case "commandLine":
244
- {
245
- if (isAutoApproveRule(commandLineResult.rule)) {
246
- return (new MarkdownString(
247
- localize(14457, "Auto approved by rule {0}", formatRuleLinks(commandLineResult)),
248
- mdTrustSettings
249
- ));
250
- }
251
- break;
252
- }
253
- case "subCommand":
254
- {
255
- const npmScriptApproval = subCommandResults.find(e => isNpmScriptAutoApproveRule(e.rule));
256
- if (npmScriptApproval && isNpmScriptAutoApproveRule(npmScriptApproval.rule) && npmScriptApproval.rule.npmScriptResult.autoApproveInfo) {
257
- return npmScriptApproval.rule.npmScriptResult.autoApproveInfo;
258
- }
259
- const uniqueRules = dedupeRules(subCommandResults);
260
- if (uniqueRules.length === 1) {
261
- return (new MarkdownString(
262
- localize(14457, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
263
- mdTrustSettings
264
- ));
265
- } else if (uniqueRules.length > 1) {
266
- return (new MarkdownString(
267
- localize(14458, "Auto approved by rules {0}", formatRuleLinks(uniqueRules)),
268
- mdTrustSettings
269
- ));
270
- }
271
- break;
272
- }
273
- }
274
- } else if (isDenied) {
275
- switch (autoApproveReason) {
276
- case "commandLine":
277
- {
278
- if (commandLineResult.rule) {
279
- return (new MarkdownString(localize(
280
- 14459,
281
- "Auto approval denied by rule {0}",
282
- formatRuleLinks(commandLineResult)
283
- ), mdTrustSettings));
284
- }
285
- break;
286
- }
287
- case "subCommand":
288
- {
289
- const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === "denied"));
290
- if (uniqueRules.length === 1) {
291
- return (new MarkdownString(
292
- localize(14459, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
293
- mdTrustSettings
294
- ));
295
- } else if (uniqueRules.length > 1) {
296
- return (new MarkdownString(
297
- localize(14460, "Auto approval denied by rules {0}", formatRuleLinks(uniqueRules)),
298
- mdTrustSettings
299
- ));
300
- }
301
- break;
302
- }
303
- }
304
- }
305
- return undefined;
306
- }
307
- };
308
- CommandLineAutoApproveAnalyzer = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, IInstantiationService)), ( __param(5, IStorageService)), ( __param(6, ITerminalChatService))], CommandLineAutoApproveAnalyzer));
309
-
310
- export { CommandLineAutoApproveAnalyzer };
@@ -1,27 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
4
- import { type TreeSitterCommandParser } from "../../treeSitterCommandParser.js";
5
- import type { ICommandLineAnalyzer, ICommandLineAnalyzerOptions, ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
6
- import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
7
- export declare class CommandLineFileWriteAnalyzer extends Disposable implements ICommandLineAnalyzer {
8
- private readonly _treeSitterCommandParser;
9
- private readonly _log;
10
- private readonly _configurationService;
11
- private readonly _labelService;
12
- private readonly _workspaceContextService;
13
- constructor(_treeSitterCommandParser: TreeSitterCommandParser, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, _labelService: ILabelService, _workspaceContextService: IWorkspaceContextService);
14
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
15
- private _getFileWrites;
16
- private _stripSurroundingQuotes;
17
- private _mapNullDevice;
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;
27
- }
@@ -1,177 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
5
- import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
6
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
8
- import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
9
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
10
- import { TreeSitterCommandParserLanguage } from '../../treeSitterCommandParser.js';
11
- import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
12
- import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
13
- import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
14
-
15
- const nullDevice = Symbol("null device");
16
- let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Disposable {
17
- constructor(
18
- _treeSitterCommandParser,
19
- _log,
20
- _configurationService,
21
- _labelService,
22
- _workspaceContextService
23
- ) {
24
- super();
25
- this._treeSitterCommandParser = _treeSitterCommandParser;
26
- this._log = _log;
27
- this._configurationService = _configurationService;
28
- this._labelService = _labelService;
29
- this._workspaceContextService = _workspaceContextService;
30
- }
31
- async analyze(options) {
32
- let fileWrites;
33
- try {
34
- fileWrites = await this._getFileWrites(options);
35
- } catch (e) {
36
- console.error(e);
37
- this._log("Failed to get file writes via grammar", options.treeSitterLanguage);
38
- return {
39
- isAutoApproveAllowed: false
40
- };
41
- }
42
- return this._getResult(options, fileWrites);
43
- }
44
- async _getFileWrites(options) {
45
- let fileWrites = [];
46
- const capturedFileWrites = ( (await this._treeSitterCommandParser.getFileWrites(options.treeSitterLanguage, options.commandLine)).map(this._mapNullDevice.bind(this, options)));
47
- const commandFileWrites = ( (await this._treeSitterCommandParser.getCommandFileWrites(options.treeSitterLanguage, options.commandLine)).map(this._mapNullDevice.bind(this, options)));
48
- const allCapturedFileWrites = [...capturedFileWrites, ...commandFileWrites];
49
- if (allCapturedFileWrites.length) {
50
- const cwd = options.cwd;
51
- if (cwd) {
52
- this._log("Detected cwd", ( cwd.toString()));
53
- fileWrites = ( allCapturedFileWrites.map(e => {
54
- if (e === nullDevice) {
55
- return e;
56
- }
57
- if (/^['"].*['"]$/.test(e)) {
58
- e = this._stripSurroundingQuotes(e);
59
- }
60
- const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(e) : posix.isAbsolute(e);
61
- if (isAbsolute) {
62
- return cwd.with({
63
- path: e
64
- });
65
- }
66
- return URI.joinPath(cwd, e);
67
- }));
68
- } else {
69
- this._log("Cwd could not be detected");
70
- fileWrites = allCapturedFileWrites;
71
- }
72
- }
73
- this._log("File writes detected", ( fileWrites.map(e => ( e.toString()))));
74
- return fileWrites;
75
- }
76
- _stripSurroundingQuotes(text) {
77
- if ((text.startsWith("\"") && text.endsWith("\"")) || (text.startsWith("'") && text.endsWith("'"))) {
78
- return text.slice(1, -1);
79
- }
80
- return text;
81
- }
82
- _mapNullDevice(options, rawFileWrite) {
83
- if (options.treeSitterLanguage === TreeSitterCommandParserLanguage.PowerShell) {
84
- return rawFileWrite === "$null" ? nullDevice : rawFileWrite;
85
- }
86
- return rawFileWrite === "/dev/null" ? nullDevice : rawFileWrite;
87
- }
88
- _getResult(options, fileWrites) {
89
- let isAutoApproveAllowed = true;
90
- if (fileWrites.length > 0) {
91
- const blockDetectedFileWrites = this._configurationService.getValue(TerminalChatAgentToolsSettingId.BlockDetectedFileWrites);
92
- switch (blockDetectedFileWrites) {
93
- case "all":
94
- {
95
- isAutoApproveAllowed = false;
96
- this._log("File writes blocked due to \"all\" setting");
97
- break;
98
- }
99
- case "outsideWorkspace":
100
- {
101
- const workspaceFolders = this._workspaceContextService.getWorkspace().folders;
102
- if (workspaceFolders.length > 0) {
103
- for (const fileWrite of fileWrites) {
104
- if (fileWrite === nullDevice) {
105
- this._log("File write to null device allowed", URI.isUri(fileWrite) ? ( fileWrite.toString()) : fileWrite);
106
- continue;
107
- }
108
- if (isString(fileWrite)) {
109
- const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(fileWrite) : posix.isAbsolute(fileWrite);
110
- if (!isAbsolute) {
111
- isAutoApproveAllowed = false;
112
- this._log("File write blocked due to unknown terminal cwd", fileWrite);
113
- break;
114
- }
115
- }
116
- const fileUri = URI.isUri(fileWrite) ? fileWrite : URI.file(fileWrite);
117
- if (fileUri.fsPath.match(/[$\(\){}`~]/)) {
118
- isAutoApproveAllowed = false;
119
- this._log(
120
- "File write blocked due to likely containing a variable, sub-command, or tilde expansion",
121
- ( fileUri.toString())
122
- );
123
- break;
124
- }
125
- const isInsideWorkspace = ( workspaceFolders.some(
126
- folder => folder.uri.scheme === fileUri.scheme && (fileUri.path.startsWith(folder.uri.path + "/") || fileUri.path === folder.uri.path)
127
- ));
128
- if (!isInsideWorkspace) {
129
- if (options.hasSessionAutoApproval && this._isInTempDirectory(fileUri.path, options.os)) {
130
- continue;
131
- }
132
- isAutoApproveAllowed = false;
133
- this._log("File write blocked outside workspace", ( fileUri.toString()));
134
- break;
135
- }
136
- }
137
- } else {
138
- const hasOnlyNullDevices = fileWrites.every(fw => fw === nullDevice);
139
- if (!hasOnlyNullDevices) {
140
- isAutoApproveAllowed = false;
141
- this._log("File writes blocked - no workspace folders");
142
- }
143
- }
144
- break;
145
- }
146
- }
147
- }
148
- const disclaimers = [];
149
- if (fileWrites.length > 0) {
150
- const fileWritesList = ( fileWrites.map(
151
- fw => `\`${URI.isUri(fw) ? this._labelService.getUriLabel(fw) : fw === nullDevice ? "/dev/null" : ( fw.toString())}\``
152
- )).join(", ");
153
- if (!isAutoApproveAllowed) {
154
- disclaimers.push(( localize(
155
- 14461,
156
- "File write operations detected that cannot be auto approved: {0}",
157
- fileWritesList
158
- )));
159
- } else {
160
- disclaimers.push(( localize(14462, "File write operations detected: {0}", fileWritesList)));
161
- }
162
- }
163
- return {
164
- isAutoApproveAllowed,
165
- disclaimers
166
- };
167
- }
168
- _isInTempDirectory(uriPath, os) {
169
- if (os === OperatingSystem.Windows) {
170
- return /[\\/]te?mp[\\/].+/i.test(uriPath);
171
- }
172
- return uriPath.startsWith("/tmp/");
173
- }
174
- };
175
- CommandLineFileWriteAnalyzer = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ILabelService)), ( __param(4, IWorkspaceContextService))], CommandLineFileWriteAnalyzer));
176
-
177
- export { CommandLineFileWriteAnalyzer };
@@ -1,11 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { ITerminalSandboxService } from "../../../common/terminalSandboxService.js";
4
- import type { ICommandLineAnalyzer, ICommandLineAnalyzerOptions, ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
5
- export declare class CommandLineSandboxAnalyzer extends Disposable implements ICommandLineAnalyzer {
6
- private readonly _sandboxService;
7
- private readonly _configurationService;
8
- constructor(_sandboxService: ITerminalSandboxService, _configurationService: IConfigurationService);
9
- private _isAutoApproveEnabled;
10
- analyze(_options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
11
- }
@@ -1,33 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
5
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
6
- import '../../../common/terminalSandboxService.js';
7
- import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
8
-
9
- let CommandLineSandboxAnalyzer = class CommandLineSandboxAnalyzer extends Disposable {
10
- constructor(_sandboxService, _configurationService) {
11
- super();
12
- this._sandboxService = _sandboxService;
13
- this._configurationService = _configurationService;
14
- }
15
- _isAutoApproveEnabled() {
16
- return this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) !== false;
17
- }
18
- async analyze(_options) {
19
- const isAutoApproveEnabled = this._isAutoApproveEnabled();
20
- if (!(await this._sandboxService.isEnabled())) {
21
- return {
22
- isAutoApproveAllowed: isAutoApproveEnabled
23
- };
24
- }
25
- return {
26
- isAutoApproveAllowed: isAutoApproveEnabled,
27
- forceAutoApproval: !_options.requiresUnsandboxConfirmation && isAutoApproveEnabled
28
- };
29
- }
30
- };
31
- CommandLineSandboxAnalyzer = ( __decorate([( __param(0, ITerminalSandboxService)), ( __param(1, IConfigurationService))], CommandLineSandboxAnalyzer));
32
-
33
- export { CommandLineSandboxAnalyzer };