@codingame/monaco-vscode-katex-common 31.0.0 → 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
@@ -1,617 +0,0 @@
1
-
2
- import { registerCss } from '@codingame/monaco-vscode-api/css';
3
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
- import * as inlineChatOverlayWidget from './media/inlineChatOverlayWidget.css';
5
- import { $, append, setVisibility, DisposableResizeObserver, getTotalWidth, addDisposableListener, isAncestorOfActiveElement, trackFocus, createElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
- import { DEFAULT_FONT_FAMILY } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fonts';
7
- import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
8
- import { renderAsPlaintext, renderMarkdown } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
9
- import { ActionsOrientation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
10
- import { WorkbenchActionBar } from '../../../../platform/actions/browser/actionbar.js';
11
- import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
12
- import { ActionRunner } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
13
- import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
14
- import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
15
- import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
16
- import { Disposable, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
17
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
18
- import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
19
- import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
20
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
21
- import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
22
- import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
23
- import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
24
- import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
25
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
26
- import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
27
- import { getFlatActionBarActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
28
- import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
29
- import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
30
- import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
31
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
32
- import { ChatEditingAcceptRejectActionViewItem } from '../../chat/browser/chatEditing/chatEditingEditorOverlay.js';
33
- import { CTX_INLINE_CHAT_INPUT_HAS_TEXT, CTX_INLINE_CHAT_INPUT_WIDGET_FOCUSED } from '../common/inlineChat.js';
34
- import { StickyScrollController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/stickyScroll/browser/stickyScrollController';
35
- import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
36
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
37
- import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
38
- import { PlaceholderTextContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
39
- import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
40
- import { IInlineChatHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.service';
41
- import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
42
- import { observableFromEvent, observableFromEventOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
43
- import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
44
- import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
45
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
46
-
47
- registerCss(inlineChatOverlayWidget);
48
- let InlineChatInputWidget = class InlineChatInputWidget extends Disposable {
49
- #domNode;
50
- #container;
51
- #inputContainer;
52
- #toolbarContainer;
53
- #input;
54
- #position;
55
- #showStore;
56
- #stickyScrollHeight;
57
- #layoutData;
58
- #anchorLineNumber;
59
- #anchorLeft;
60
- #anchorAbove;
61
- #editorObs;
62
- #historyService;
63
- constructor(
64
- editorObs,
65
- contextKeyService,
66
- menuService,
67
- instantiationService,
68
- modelService,
69
- configurationService,
70
- historyService
71
- ) {
72
- super();
73
- this.#position = observableValue(this, null);
74
- this.position = this.#position;
75
- this.#showStore = this._store.add(( new DisposableStore()));
76
- this.#anchorLineNumber = 0;
77
- this.#anchorLeft = 0;
78
- this.#anchorAbove = false;
79
- this.#editorObs = editorObs;
80
- this.#historyService = historyService;
81
- this.#domNode = $(".inline-chat-gutter-menu");
82
- this.#container = append(this.#domNode, $(".inline-chat-gutter-container"));
83
- this.#inputContainer = append(this.#container, $(".input"));
84
- this.#toolbarContainer = append(this.#container, $(".toolbar"));
85
- const actionsContainer = append(this.#domNode, $(".inline-chat-gutter-actions"));
86
- const actionBar = this._store.add(
87
- instantiationService.createInstance(WorkbenchActionBar, actionsContainer, {
88
- orientation: ActionsOrientation.VERTICAL,
89
- preventLoopNavigation: true,
90
- telemetrySource: "inlineChatInput.actionBar"
91
- })
92
- );
93
- const actionsMenu = this._store.add(menuService.createMenu(MenuId.ChatEditorInlineMenu, contextKeyService));
94
- const updateActions = () => {
95
- const actions = getFlatActionBarActions(actionsMenu.getActions({
96
- shouldForwardArgs: true
97
- }));
98
- actionBar.clear();
99
- actionBar.push(actions);
100
- setVisibility(actions.length > 0, actionsContainer);
101
- };
102
- this._store.add(actionsMenu.onDidChange(updateActions));
103
- updateActions();
104
- const options = getSimpleEditorOptions(configurationService);
105
- options.wordWrap = "off";
106
- options.wrappingStrategy = "advanced";
107
- options.lineNumbers = "off";
108
- options.glyphMargin = false;
109
- options.lineDecorationsWidth = 0;
110
- options.lineNumbersMinChars = 0;
111
- options.folding = false;
112
- options.minimap = {
113
- enabled: false
114
- };
115
- options.scrollbar = {
116
- vertical: "hidden",
117
- horizontal: "hidden",
118
- alwaysConsumeMouseWheel: true
119
- };
120
- options.renderLineHighlight = "none";
121
- options.fontFamily = DEFAULT_FONT_FAMILY;
122
- options.fontSize = 13;
123
- options.lineHeight = 20;
124
- options.cursorWidth = 1;
125
- options.padding = {
126
- top: 2,
127
- bottom: 2
128
- };
129
- const codeEditorWidgetOptions = {
130
- isSimpleWidget: true,
131
- contributions: EditorExtensionsRegistry.getSomeEditorContributions([PlaceholderTextContribution.ID])
132
- };
133
- this.#input = this._store.add(
134
- instantiationService.createInstance(CodeEditorWidget, this.#inputContainer, options, codeEditorWidgetOptions)
135
- );
136
- const model = this._store.add(modelService.createModel("", null, ( URI.parse(`gutter-input:${Date.now()}`)), true));
137
- this.#input.setModel(model);
138
- const toolbar = this._store.add(
139
- instantiationService.createInstance(MenuWorkbenchToolBar, this.#toolbarContainer, MenuId.InlineChatInput, {
140
- telemetrySource: "inlineChatInput.toolbar",
141
- hiddenItemStrategy: HiddenItemStrategy.NoHide,
142
- toolbarOptions: {
143
- primaryGroup: () => true
144
- },
145
- menuOptions: {
146
- shouldForwardArgs: true
147
- }
148
- })
149
- );
150
- const stickyScrollController = StickyScrollController.get(this.#editorObs.editor);
151
- this.#stickyScrollHeight = stickyScrollController ? observableFromEvent(
152
- stickyScrollController.onDidChangeStickyScrollHeight,
153
- () => stickyScrollController.stickyScrollWidgetHeight
154
- ) : constObservable(0);
155
- const toolbarWidth = observableValue(this, 0);
156
- const resizeObserver = new DisposableResizeObserver(() => {
157
- toolbarWidth.set(getTotalWidth(toolbar.getElement()), undefined);
158
- });
159
- this._store.add(resizeObserver);
160
- this._store.add(resizeObserver.observe(toolbar.getElement()));
161
- const contentWidth = observableFromEvent(
162
- this,
163
- this.#input.onDidChangeModelContent,
164
- () => this.#input.getContentWidth()
165
- );
166
- const contentHeight = observableFromEvent(
167
- this,
168
- this.#input.onDidContentSizeChange,
169
- () => this.#input.getContentHeight()
170
- );
171
- this.#layoutData = derived(r => {
172
- const editorPad = 6;
173
- const totalWidth = contentWidth.read(r) + editorPad + toolbarWidth.read(r);
174
- const minWidth = 220;
175
- const maxWidth = 600;
176
- const midWidth = Math.round(maxWidth / 1.618);
177
- let clampedWidth;
178
- if (this.#input.getOption(EditorOption.wordWrap) === "on") {
179
- clampedWidth = maxWidth;
180
- } else if (totalWidth <= minWidth) {
181
- clampedWidth = minWidth;
182
- } else if (totalWidth <= midWidth) {
183
- clampedWidth = midWidth;
184
- } else {
185
- clampedWidth = maxWidth;
186
- }
187
- const lineHeight = this.#input.getOption(EditorOption.lineHeight);
188
- const clampedHeight = Math.min(contentHeight.read(r), (3 * lineHeight));
189
- if (totalWidth > clampedWidth) {
190
- this.#input.updateOptions({
191
- wordWrap: "on"
192
- });
193
- }
194
- return {
195
- editorPad,
196
- toolbarWidth: toolbarWidth.read(r),
197
- totalWidth: clampedWidth,
198
- height: clampedHeight
199
- };
200
- });
201
- this._store.add(autorun(r => {
202
- const {
203
- editorPad,
204
- toolbarWidth,
205
- totalWidth,
206
- height
207
- } = this.#layoutData.read(r);
208
- const inputWidth = totalWidth - toolbarWidth - editorPad;
209
- this.#container.style.width = `${totalWidth}px`;
210
- this.#inputContainer.style.width = `${inputWidth}px`;
211
- this.#input.layout({
212
- width: inputWidth,
213
- height
214
- });
215
- if (this.#position.read(undefined) !== null) {
216
- this.#updatePosition();
217
- }
218
- }));
219
- this._store.add(
220
- this.#input.onDidFocusEditorText(() => this.#container.classList.add("focused"))
221
- );
222
- this._store.add(
223
- this.#input.onDidBlurEditorText(() => this.#container.classList.remove("focused"))
224
- );
225
- this._store.add(this.#input.onDidScrollChange(e => {
226
- this.#toolbarContainer.classList.toggle("fake-scroll-decoration", e.scrollTop > 0);
227
- }));
228
- const inputHasText = CTX_INLINE_CHAT_INPUT_HAS_TEXT.bindTo(contextKeyService);
229
- this._store.add(this.#input.onDidChangeModelContent(() => {
230
- inputHasText.set(this.#input.getModel().getValue().trim().length > 0);
231
- }));
232
- this._store.add(toDisposable(() => inputHasText.reset()));
233
- const inputWidgetFocused = CTX_INLINE_CHAT_INPUT_WIDGET_FOCUSED.bindTo(contextKeyService);
234
- this._store.add(this.#input.onDidFocusEditorText(() => inputWidgetFocused.set(true)));
235
- this._store.add(this.#input.onDidBlurEditorText(() => inputWidgetFocused.set(false)));
236
- this._store.add(toDisposable(() => inputWidgetFocused.reset()));
237
- this._store.add(this.#input.onKeyDown(e => {
238
- if (e.keyCode === KeyCode.UpArrow) {
239
- const position = this.#input.getPosition();
240
- if (position && position.lineNumber === 1) {
241
- this.#showPreviousHistoryValue();
242
- e.preventDefault();
243
- e.stopPropagation();
244
- }
245
- } else if (e.keyCode === KeyCode.DownArrow) {
246
- const model = this.#input.getModel();
247
- const position = this.#input.getPosition();
248
- if (position && position.lineNumber === model.getLineCount()) {
249
- if (!this.#historyService.isAtEnd()) {
250
- this.#showNextHistoryValue();
251
- e.preventDefault();
252
- e.stopPropagation();
253
- } else if (!actionBar.isEmpty()) {
254
- e.preventDefault();
255
- e.stopPropagation();
256
- actionBar.focus(0);
257
- }
258
- }
259
- }
260
- }));
261
- this._store.add(addDisposableListener(actionBar.domNode, "keydown", e => {
262
- const event = ( new StandardKeyboardEvent(e));
263
- if (event.keyCode === KeyCode.Escape) {
264
- event.preventDefault();
265
- event.stopPropagation();
266
- this.hide();
267
- } else if (event.keyCode === KeyCode.UpArrow) {
268
- const firstItem = actionBar.viewItems[0];
269
- if (firstItem?.element && isAncestorOfActiveElement(firstItem.element)) {
270
- event.preventDefault();
271
- event.stopPropagation();
272
- this.#input.focus();
273
- }
274
- }
275
- }, true));
276
- const focusTracker = this._store.add(trackFocus(this.#domNode));
277
- this._store.add(focusTracker.onDidBlur(() => this.hide()));
278
- }
279
- get value() {
280
- return this.#input.getModel().getValue().trim();
281
- }
282
- addToHistory(value) {
283
- this.#historyService.addToHistory(value);
284
- }
285
- #showPreviousHistoryValue() {
286
- if (this.#historyService.isAtEnd()) {
287
- this.#historyService.replaceLast(this.#input.getModel().getValue());
288
- }
289
- const value = this.#historyService.previousValue();
290
- if (value !== undefined) {
291
- this.#input.getModel().setValue(value);
292
- }
293
- }
294
- #showNextHistoryValue() {
295
- if (this.#historyService.isAtEnd()) {
296
- return;
297
- }
298
- const value = this.#historyService.nextValue();
299
- if (value !== undefined) {
300
- this.#input.getModel().setValue(value);
301
- }
302
- }
303
- show(lineNumber, left, anchorAbove, placeholder, value) {
304
- this.#showStore.clear();
305
- this.#historyService.resetCursor();
306
- this.#input.updateOptions({
307
- wordWrap: "off",
308
- placeholder
309
- });
310
- this.#input.getModel().setValue(value ?? "");
311
- this.#anchorLineNumber = lineNumber;
312
- this.#anchorLeft = left;
313
- this.#anchorAbove = anchorAbove;
314
- this.#updatePosition();
315
- this.#showStore.add(this.#editorObs.createOverlayWidget({
316
- domNode: this.#domNode,
317
- position: this.#position,
318
- minContentWidthInPx: constObservable(0),
319
- allowEditorOverflow: true
320
- }));
321
- this.#updatePosition();
322
- this.#showStore.add(this.#editorObs.editor.onDidScrollChange(() => {
323
- const visibleRanges = this.#editorObs.editor.getVisibleRanges();
324
- const isLineVisible = ( visibleRanges.some(
325
- range => this.#anchorLineNumber >= range.startLineNumber && this.#anchorLineNumber <= range.endLineNumber
326
- ));
327
- const hasContent = !!this.#input.getModel().getValue();
328
- if (!isLineVisible && !hasContent) {
329
- this.hide();
330
- } else {
331
- this.#updatePosition();
332
- }
333
- }));
334
- this.#showStore.add(this.#editorObs.editor.onDidLayoutChange(() => {
335
- this.#updatePosition();
336
- }));
337
- setTimeout(() => {
338
- this.#input.focus();
339
- if (value) {
340
- this.#input.setSelection(this.#input.getModel().getFullModelRange());
341
- }
342
- }, 0);
343
- }
344
- #updatePosition() {
345
- const editor = this.#editorObs.editor;
346
- const lineHeight = editor.getOption(EditorOption.lineHeight);
347
- const top = editor.getTopForLineNumber(this.#anchorLineNumber) - editor.getScrollTop();
348
- let adjustedTop = top;
349
- if (this.#anchorAbove) {
350
- const widgetHeight = this.#domNode.offsetHeight;
351
- adjustedTop = top - widgetHeight;
352
- } else {
353
- adjustedTop = top + lineHeight;
354
- }
355
- const stickyScrollHeight = this.#stickyScrollHeight.get();
356
- const layoutInfo = editor.getLayoutInfo();
357
- const widgetHeight = this.#domNode.offsetHeight;
358
- const widgetWidth = this.#domNode.offsetWidth;
359
- const minTop = stickyScrollHeight;
360
- const maxTop = layoutInfo.height - widgetHeight;
361
- const padding = 8;
362
- const maxLeft = layoutInfo.width - layoutInfo.verticalScrollbarWidth - layoutInfo.minimap.minimapWidth - widgetWidth - padding;
363
- const clampedTop = Math.max(minTop, Math.min(adjustedTop, maxTop));
364
- const clampedLeft = Math.max(0, Math.min(this.#anchorLeft, maxLeft));
365
- const isClamped = clampedTop !== adjustedTop || clampedLeft !== this.#anchorLeft;
366
- this.#domNode.classList.toggle("clamped", isClamped);
367
- this.#position.set({
368
- preference: {
369
- top: clampedTop,
370
- left: clampedLeft
371
- },
372
- stackOrdinal: 10000
373
- }, undefined);
374
- }
375
- hide() {
376
- const editorDomNode = this.#editorObs.editor.getDomNode();
377
- if (editorDomNode && isAncestorOfActiveElement(editorDomNode)) {
378
- this.#editorObs.editor.focus();
379
- }
380
- this.#position.set(null, undefined);
381
- this.#input.getModel().setValue("");
382
- this.#showStore.clear();
383
- }
384
- };
385
- InlineChatInputWidget = ( __decorate([( __param(1, IContextKeyService)), ( __param(2, IMenuService)), ( __param(3, IInstantiationService)), ( __param(4, IModelService)), ( __param(5, IConfigurationService)), ( __param(6, IInlineChatHistoryService))], InlineChatInputWidget));
386
- let InlineChatSessionOverlayWidget = class InlineChatSessionOverlayWidget extends Disposable {
387
- #domNode = createElement("div");
388
- #container;
389
- #markdownContainer;
390
- #markdownMessage;
391
- #markdownScrollable;
392
- #contentRow;
393
- #statusNode;
394
- #icon;
395
- #message;
396
- #toolbarNode;
397
- #showStore = this._store.add(( new DisposableStore()));
398
- #position = observableValue(this, null);
399
- #minContentWidthInPx = constObservable(0);
400
- #stickyScrollHeight;
401
- #editorObs;
402
- #instaService;
403
- #keybindingService;
404
- constructor(editorObs, instaService, keybindingService) {
405
- super();
406
- this.#editorObs = editorObs;
407
- this.#instaService = instaService;
408
- this.#keybindingService = keybindingService;
409
- this.#domNode.classList.add("inline-chat-session-overlay-widget");
410
- this.#container = createElement("div");
411
- this.#domNode.appendChild(this.#container);
412
- this.#container.classList.add("inline-chat-session-overlay-container");
413
- this.#markdownContainer = createElement("div");
414
- this.#markdownContainer.classList.add("markdown-scroll-container");
415
- this.#markdownMessage = createElement("div");
416
- this.#markdownMessage.classList.add("markdown-message");
417
- this.#markdownContainer.appendChild(this.#markdownMessage);
418
- this.#markdownScrollable = this._store.add(( new DomScrollableElement(this.#markdownContainer, {
419
- consumeMouseWheelIfScrollbarIsNeeded: true,
420
- horizontal: ScrollbarVisibility.Hidden,
421
- vertical: ScrollbarVisibility.Auto
422
- })));
423
- this.#container.appendChild(this.#markdownScrollable.getDomNode());
424
- this.#contentRow = createElement("div");
425
- this.#contentRow.classList.add("content-row");
426
- this.#container.appendChild(this.#contentRow);
427
- this.#statusNode = createElement("div");
428
- this.#statusNode.classList.add("status");
429
- this.#icon = append(this.#statusNode, $("span"));
430
- this.#message = append(this.#statusNode, $("span.message"));
431
- this.#contentRow.appendChild(this.#statusNode);
432
- this.#toolbarNode = createElement("div");
433
- this.#toolbarNode.classList.add("toolbar");
434
- const stickyScrollController = StickyScrollController.get(this.#editorObs.editor);
435
- this.#stickyScrollHeight = stickyScrollController ? observableFromEvent(
436
- stickyScrollController.onDidChangeStickyScrollHeight,
437
- () => stickyScrollController.stickyScrollWidgetHeight
438
- ) : constObservable(0);
439
- }
440
- show(session) {
441
- assertType(this.#editorObs.editor.hasModel());
442
- this.#showStore.clear();
443
- const entry = derived(r => session.editingSession.readEntry(session.uri, r));
444
- const requestMessage = derived(r => {
445
- const chatModel = session?.chatModel;
446
- if (!session || !chatModel) {
447
- return undefined;
448
- }
449
- const terminationState = session.terminationState.read(r);
450
- if (terminationState) {
451
- return {
452
- markdown: terminationState,
453
- icon: Codicon.info
454
- };
455
- }
456
- const response = chatModel.lastRequestObs.read(r)?.response;
457
- if (!response) {
458
- return {
459
- message: ( localize(10098, "Working...")),
460
- icon: ThemeIcon.modify(Codicon.loading, "spin")
461
- };
462
- }
463
- if (response.isComplete) {
464
- const result = response.result;
465
- if (result?.errorDetails) {
466
- return {
467
- message: ( localize(10099, "Sorry, your request failed")),
468
- icon: Codicon.error
469
- };
470
- }
471
- const changes = entry.read(r)?.changesCount.read(r) ?? 0;
472
- return {
473
- message: changes === 0 ? ( localize(10100, "Done")) : changes === 1 ? ( localize(10101, "Done, 1 change")) : ( localize(10102, "Done, {0} changes", changes)),
474
- icon: Codicon.check
475
- };
476
- }
477
- const pendingConfirmation = response.isPendingConfirmation.read(r);
478
- if (pendingConfirmation) {
479
- return {
480
- message: ( localize(10103, "Sorry, but an unexpected error happened")),
481
- icon: Codicon.error
482
- };
483
- }
484
- const lastPart = observableFromEventOpts({
485
- equalsFn: () => false
486
- }, response.onDidChange, () => response.response.value).read(r).filter(part => part.kind === "progressMessage" || part.kind === "toolInvocation").at(-1);
487
- if (lastPart?.kind === "toolInvocation") {
488
- return {
489
- message: lastPart.invocationMessage,
490
- icon: ThemeIcon.modify(Codicon.loading, "spin")
491
- };
492
- } else if (lastPart?.kind === "progressMessage") {
493
- return {
494
- message: lastPart.content,
495
- icon: ThemeIcon.modify(Codicon.loading, "spin")
496
- };
497
- } else {
498
- return {
499
- message: ( localize(10098, "Working...")),
500
- icon: ThemeIcon.modify(Codicon.loading, "spin")
501
- };
502
- }
503
- });
504
- const markdownStore = this.#showStore.add(( new DisposableStore()));
505
- this.#showStore.add(autorun(r => {
506
- const value = requestMessage.read(r);
507
- if (value) {
508
- if (value.message && value.icon) {
509
- this.#message.innerText = renderAsPlaintext(value.message);
510
- this.#icon.className = "";
511
- this.#icon.classList.add(...ThemeIcon.asClassNameArray(value.icon));
512
- this.#statusNode.classList.remove("hidden");
513
- this.#contentRow.classList.remove("status-hidden");
514
- } else {
515
- this.#message.innerText = "";
516
- this.#icon.className = "";
517
- this.#statusNode.classList.add("hidden");
518
- this.#contentRow.classList.add("status-hidden");
519
- }
520
- markdownStore.clear();
521
- this.#markdownMessage.replaceChildren();
522
- if (value.markdown) {
523
- this.#markdownScrollable.getDomNode().classList.remove("hidden");
524
- const markdown = typeof value.markdown === "string" ? ( new MarkdownString(value.markdown)) : value.markdown;
525
- const rendered = markdownStore.add(renderMarkdown(markdown));
526
- this.#markdownMessage.appendChild(rendered.element);
527
- this.#markdownScrollable.scanDomNode();
528
- } else {
529
- this.#markdownScrollable.getDomNode().classList.add("hidden");
530
- }
531
- } else {
532
- this.#message.innerText = "";
533
- this.#icon.className = "";
534
- this.#statusNode.classList.add("hidden");
535
- this.#contentRow.classList.add("status-hidden");
536
- markdownStore.clear();
537
- this.#markdownMessage.replaceChildren();
538
- this.#markdownScrollable.getDomNode().classList.add("hidden");
539
- }
540
- }));
541
- this.#contentRow.appendChild(this.#toolbarNode);
542
- this.#showStore.add(toDisposable(() => this.#toolbarNode.remove()));
543
- const that = this;
544
- const actionRunner = this.#showStore.add(new (class extends ActionRunner {
545
- async runAction(action, context) {
546
- that.#editorObs.editor.focus();
547
- return super.runAction(action, context);
548
- }
549
- })());
550
- this.#showStore.add(
551
- this.#instaService.createInstance(MenuWorkbenchToolBar, this.#toolbarNode, MenuId.ChatEditorInlineExecute, {
552
- telemetrySource: "inlineChatProgress.overlayToolbar",
553
- hiddenItemStrategy: HiddenItemStrategy.Ignore,
554
- actionRunner,
555
- toolbarOptions: {
556
- primaryGroup: () => true,
557
- useSeparatorsInPrimaryActions: true
558
- },
559
- menuOptions: {
560
- renderShortTitle: true
561
- },
562
- actionViewItemProvider: (action, options) => {
563
- const primaryActions = ["inlineChat2.cancel", "inlineChat2.keep", "inlineChat2.rephrase"];
564
- const labeledActions = primaryActions.concat(["inlineChat2.undo"]);
565
- if (!labeledActions.includes(action.id)) {
566
- return undefined;
567
- }
568
- return ( new ChatEditingAcceptRejectActionViewItem(action, {
569
- ...options,
570
- keybinding: undefined
571
- }, entry, undefined, that.#keybindingService, primaryActions));
572
- }
573
- })
574
- );
575
- const lineHeight = this.#editorObs.getOption(EditorOption.lineHeight);
576
- const widgetWidth = observableValue(this, 0);
577
- const resizeObserver = new DisposableResizeObserver(() => {
578
- widgetWidth.set(this.#domNode.offsetWidth, undefined);
579
- });
580
- this.#showStore.add(resizeObserver);
581
- this.#showStore.add(resizeObserver.observe(this.#domNode));
582
- this.#showStore.add(autorun(r => {
583
- const layoutInfo = this.#editorObs.layoutInfo.read(r);
584
- const stickyScrollHeight = this.#stickyScrollHeight.read(r);
585
- const width = widgetWidth.read(r);
586
- const padding = Math.round(lineHeight.read(r) * 2 / 3);
587
- const maxWidth = Math.min(400, layoutInfo.contentWidth - 2 * padding);
588
- const maxHeight = Math.min(150, Math.floor(layoutInfo.height / 3));
589
- this.#domNode.style.maxWidth = `${maxWidth}px`;
590
- this.#markdownScrollable.getDomNode().style.maxHeight = `${maxHeight}px`;
591
- this.#markdownContainer.style.maxHeight = `${maxHeight}px`;
592
- this.#markdownScrollable.scanDomNode();
593
- const top = stickyScrollHeight + padding;
594
- const left = layoutInfo.width - width - layoutInfo.verticalScrollbarWidth - layoutInfo.minimap.minimapWidth - padding;
595
- this.#position.set({
596
- preference: {
597
- top,
598
- left
599
- },
600
- stackOrdinal: 10000
601
- }, undefined);
602
- }));
603
- this.#showStore.add(this.#editorObs.createOverlayWidget({
604
- domNode: this.#domNode,
605
- position: this.#position,
606
- minContentWidthInPx: this.#minContentWidthInPx,
607
- allowEditorOverflow: false
608
- }));
609
- }
610
- hide() {
611
- this.#position.set(null, undefined);
612
- this.#showStore.clear();
613
- }
614
- };
615
- InlineChatSessionOverlayWidget = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IKeybindingService))], InlineChatSessionOverlayWidget));
616
-
617
- export { InlineChatInputWidget, InlineChatSessionOverlayWidget };