@codingame/monaco-vscode-katex-common 31.0.1 → 32.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +15 -3
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +6 -5
  4. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +5 -1
  5. package/vscode/src/vs/platform/actions/browser/buttonbar.js +45 -14
  6. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +15 -1
  7. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +15 -10
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +51 -54
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
  14. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +3 -1
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +45 -23
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +13 -7
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +5 -3
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +4 -1
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +46 -32
  21. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +8 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +155 -46
  24. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +20 -1
  26. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +4 -1
  27. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +37 -14
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +1 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +28 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +250 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
  34. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +14 -11
  35. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
  36. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +7 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +7 -3
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +12 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +51 -20
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +6 -1
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +56 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +2 -2
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +3 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +4 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +68 -10
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -2
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +653 -75
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +28 -10
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +91 -54
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +7 -5
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +53 -51
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -11
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +4 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +42 -22
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +6 -2
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +93 -35
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +5 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +169 -27
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +13 -4
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +29 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +60 -15
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +13 -6
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -8
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +6 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +125 -26
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +29 -23
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +14 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +119 -10
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +1 -1
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +77 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +38 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +125 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +1 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +132 -59
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +16 -3
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +156 -67
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +55 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +93 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +21 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +133 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +53 -8
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +288 -125
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +23 -2
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +699 -145
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +12 -8
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +12 -11
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.d.ts +62 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +120 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +191 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatPhoneInputPresenter.css +22 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -3
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +9 -25
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +4 -3
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +20 -1
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +89 -108
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +521 -9
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +19 -19
  136. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
  137. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.d.ts +2 -0
  138. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.js +6 -0
  139. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +27 -0
  140. package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +82 -0
  141. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +3 -0
  142. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +44 -17
  143. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -3
  144. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +3 -46
  145. package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.d.ts → inlineChatAffordanceWidget.d.ts} +1 -1
  146. package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.js → inlineChatAffordanceWidget.js} +6 -6
  147. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -18
  148. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +19 -400
  149. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -9
  150. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +1 -1
  151. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +5 -19
  152. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +47 -133
  153. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +3 -1
  154. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +103 -25
  155. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +29 -0
  156. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +3 -32
  157. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -92
  158. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
  168. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  169. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  170. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +7 -0
  171. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +99 -32
  172. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +13 -1
  173. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +76 -14
  174. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -3
  175. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +9 -1
  176. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +89 -28
  177. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +1 -1
  178. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -1
  179. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +11 -7
  180. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +3 -1
  181. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +7 -3
  182. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +1 -1
  183. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  184. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
  185. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  186. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +8 -0
  187. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +11 -2
  188. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +20 -0
  189. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +59 -4
  190. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -1
  191. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +24 -3
  192. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +47 -0
  193. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +111 -30
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +60 -3
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +455 -171
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +33 -0
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -0
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +31 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +49 -0
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +18 -0
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +302 -0
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +118 -0
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +34 -4
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +233 -48
  206. package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +0 -16
  207. package/vscode/src/vs/platform/actions/browser/actionbar.js +0 -22
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -539
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -29
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -386
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +0 -101
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +0 -509
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -130
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +0 -276
  216. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -45
  217. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +0 -93
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +0 -39
  219. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +0 -617
  220. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +0 -231
@@ -10,24 +10,37 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
10
10
  import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
11
11
  import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
12
12
  import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
13
- import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
13
+ import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
14
14
  import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
15
15
  import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
16
16
  import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
17
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
18
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
17
19
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
18
20
  import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
21
+ import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
22
+ import { ShowLightbulbIconMode } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
23
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
24
+ import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
25
+ import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
19
26
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
20
27
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
21
28
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
22
29
  import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
30
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
31
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
23
32
  import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service';
24
33
  import { defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
25
34
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
35
+ import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
36
+ import { IPlanReviewFeedbackService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.service';
26
37
  import { ChatPlanReviewData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatPlanReviewData';
27
38
  import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
39
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
28
40
  import * as chatPlanReview from './media/chatPlanReview.css';
29
41
 
30
42
  registerCss(chatPlanReview);
43
+ const PLAN_REVIEW_EDITING_PATH_PREFIX = "/chat-plan-review";
31
44
  let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
32
45
  constructor(
33
46
  review,
@@ -37,7 +50,14 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
37
50
  _contextMenuService,
38
51
  _dialogService,
39
52
  _editorService,
40
- _hoverService
53
+ _hoverService,
54
+ _planReviewFeedbackService,
55
+ _instantiationService,
56
+ _textFileService,
57
+ _modelService,
58
+ _textModelService,
59
+ _languageService,
60
+ _configurationService
41
61
  ) {
42
62
  super();
43
63
  this.review = review;
@@ -47,20 +67,53 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
47
67
  this._dialogService = _dialogService;
48
68
  this._editorService = _editorService;
49
69
  this._hoverService = _hoverService;
70
+ this._planReviewFeedbackService = _planReviewFeedbackService;
71
+ this._instantiationService = _instantiationService;
72
+ this._textFileService = _textFileService;
73
+ this._modelService = _modelService;
74
+ this._textModelService = _textModelService;
75
+ this._languageService = _languageService;
76
+ this._configurationService = _configurationService;
50
77
  this._onDidChangeHeight = this._register(( new Emitter()));
51
78
  this.onDidChangeHeight = this._onDidChangeHeight.event;
52
79
  this._buttonStore = this._register(( new DisposableStore()));
80
+ this._renderedSubmitInlineCount = -1;
53
81
  this._messageContentDisposables = this._register(( new MutableDisposable()));
54
82
  this._isCollapsed = false;
55
83
  this._isExpanded = false;
56
84
  this._isSubmitted = false;
57
85
  this._isFeedbackMode = false;
86
+ this._planReviewRegistration = this._register(( new MutableDisposable()));
87
+ this._commentRowDisposables = this._register(( new DisposableStore()));
88
+ this._inlineEditorMountId = 0;
89
+ this._suppressFeedbackModeAutoOpen = false;
90
+ this._messageEditorDisposables = this._register(( new DisposableStore()));
58
91
  this._selectedAction = review.actions.find(a => a.default) ?? review.actions[0];
59
92
  if (review instanceof ChatPlanReviewData && typeof review.draftCollapsed === "boolean") {
60
93
  this._isCollapsed = review.draftCollapsed;
61
94
  }
62
95
  const isResponseComplete = isResponseVM(context.element) && context.element.isComplete;
63
96
  this._isSubmitted = !!review.isUsed || isResponseComplete;
97
+ if (review.planUri && review.canProvideFeedback && !this._isSubmitted) {
98
+ const planUri = URI.revive(review.planUri);
99
+ const planUriString = ( planUri.toString());
100
+ const registrationStore = ( new DisposableStore());
101
+ registrationStore.add(this._planReviewFeedbackService.registerPlanReview(planUri, result => {
102
+ if (this._isSubmitted) {
103
+ return;
104
+ }
105
+ this._isSubmitted = true;
106
+ this._options.onSubmit(result);
107
+ void this.markUsed();
108
+ }));
109
+ registrationStore.add(this._planReviewFeedbackService.onDidChangeFeedback(uri => {
110
+ const uriString = ( uri.toString());
111
+ if (uriString === planUriString || uriString === this._editingUri?.toString()) {
112
+ this.onInlineFeedbackChanged();
113
+ }
114
+ }));
115
+ this._planReviewRegistration.value = registrationStore;
116
+ }
64
117
  const elements = h(
65
118
  ".chat-confirmation-widget-container.chat-plan-review-container@container",
66
119
  [h(
@@ -78,7 +131,7 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
78
131
  this.domNode = elements.container;
79
132
  this.domNode.id = generateUuid();
80
133
  this.domNode.setAttribute("role", "region");
81
- this.domNode.setAttribute("aria-label", ( localize(6855, "Plan review: {0}", review.title)));
134
+ this.domNode.setAttribute("aria-label", ( localize(7102, "Plan review: {0}", review.title)));
82
135
  this._titleActionsEl = elements.titleActions;
83
136
  this._inlineActionsEl = elements.inlineActions;
84
137
  this._footerButtonsEl = elements.footerButtons;
@@ -89,15 +142,23 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
89
142
  }));
90
143
  if (review.planUri) {
91
144
  const fileName = basename(URI.revive(review.planUri));
92
- const editButton = this._register(( new Button(this._titleActionsEl, {
145
+ const reviewButtonTooltip = review.canProvideFeedback ? ( localize(7103, "Review {0}", fileName)) : ( localize(7104, "Open {0}", fileName));
146
+ const reviewButton = this._register(( new Button(this._titleActionsEl, {
93
147
  ...defaultButtonStyles,
94
148
  secondary: true,
95
149
  supportIcons: true,
96
- title: ( localize(6856, "Edit {0}", fileName))
150
+ title: reviewButtonTooltip,
151
+ ariaLabel: reviewButtonTooltip
97
152
  })));
98
- editButton.element.classList.add("chat-plan-review-title-button", "chat-plan-review-edit");
99
- editButton.label = `$(${Codicon.edit.id}) ${( localize(6857, "Edit {0}", fileName))}`;
100
- this._register(editButton.onDidClick(() => this.openPlanFile()));
153
+ reviewButton.element.classList.add("chat-plan-review-title-button", "chat-plan-review-review-button");
154
+ this._reviewButton = reviewButton;
155
+ this._register(reviewButton.onDidClick(() => {
156
+ if (this._isFeedbackMode) {
157
+ void this.exitFeedbackMode();
158
+ } else {
159
+ void this.enterReviewMode();
160
+ }
161
+ }));
101
162
  }
102
163
  this._restoreButton = this._register(( new Button(this._titleActionsEl, {
103
164
  ...defaultButtonStyles,
@@ -125,16 +186,20 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
125
186
  "chat-plan-review-body-scrollable"
126
187
  );
127
188
  messageParent.insertBefore(this._messageScrollable.getDomNode(), messageNextSibling);
128
- const resizeObserver = this._register(
129
- new DisposableResizeObserver(() => this._messageScrollable.scanDomNode())
130
- );
131
- this._register(resizeObserver.observe(this._messageEl));
189
+ const resizeObserver = this._register(new DisposableResizeObserver(
190
+ "ChatPlanReviewPart.messageScrollable",
191
+ () => this._messageScrollable.scanDomNode()
192
+ ));
132
193
  this._register(resizeObserver.observe(this._messageScrollable.getDomNode()));
133
194
  this.renderMarkdown();
134
195
  if (review.canProvideFeedback) {
135
196
  this.renderFeedback(elements.feedback);
136
197
  this._feedbackSection = elements.feedback;
137
- hide(elements.feedback);
198
+ if (review.planUri) {
199
+ hide(elements.feedback);
200
+ } else {
201
+ this.domNode.classList.add("chat-plan-review-textarea-mode");
202
+ }
138
203
  } else {
139
204
  hide(elements.feedback);
140
205
  }
@@ -148,6 +213,13 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
148
213
  }
149
214
  if (this._feedbackTextarea && review instanceof ChatPlanReviewData && review.draftFeedback) {
150
215
  this._feedbackTextarea.value = review.draftFeedback;
216
+ this._feedbackTextarea.style.height = "auto";
217
+ this._feedbackTextarea.style.height = `${this._feedbackTextarea.scrollHeight}px`;
218
+ }
219
+ if (!this._isSubmitted && this.getInlineFeedbackItems().length > 0) {
220
+ void this.enterFeedbackMode({
221
+ focus: false
222
+ });
151
223
  }
152
224
  }
153
225
  hasSameContent(other, _followingContent, _element) {
@@ -165,6 +237,7 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
165
237
  renderMarkdown() {
166
238
  clearNode(this._messageEl);
167
239
  const store = ( new DisposableStore());
240
+ this._messageContentDisposables.value = store;
168
241
  const rendered = store.add(this._markdownRendererService.render(( new MarkdownString(this.review.content, {
169
242
  supportThemeIcons: true,
170
243
  isTrusted: false
@@ -172,16 +245,58 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
172
245
  asyncRenderCallback: () => this._messageScrollable.scanDomNode()
173
246
  }));
174
247
  this._messageEl.append(rendered.element);
175
- this._messageContentDisposables.value = store;
176
248
  this._messageScrollable.scanDomNode();
177
249
  }
178
250
  renderFeedback(section) {
179
251
  clearNode(section);
180
- const label = append(section, $(".chat-plan-review-feedback-label"));
181
- label.textContent = ( localize(6858, "Additional feedback"));
252
+ const header = append(section, $(".chat-plan-review-feedback-header"));
253
+ const label = append(header, $(".chat-plan-review-feedback-label"));
254
+ label.textContent = ( localize(7105, "Feedback"));
255
+ const headerActions = append(header, $(".chat-plan-review-feedback-header-actions"));
256
+ if (this.review.planUri) {
257
+ const clearAllLabel = ( localize(7106, "Clear All"));
258
+ const clearAllButton = this._register(( new Button(headerActions, {
259
+ ...defaultButtonStyles,
260
+ secondary: true,
261
+ supportIcons: true,
262
+ title: clearAllLabel,
263
+ ariaLabel: clearAllLabel
264
+ })));
265
+ clearAllButton.element.classList.add("chat-plan-review-title-button", "chat-plan-review-feedback-clear-all");
266
+ clearAllButton.label = clearAllLabel;
267
+ this._register(clearAllButton.onDidClick(() => this.clearAllInlineFeedback()));
268
+ this._clearAllButtonEl = clearAllButton.element;
269
+ }
270
+ if (this.review.planUri) {
271
+ const closeButtonLabel = ( localize(7107, "Close"));
272
+ const closeButton = this._register(( new Button(headerActions, {
273
+ ...defaultButtonStyles,
274
+ secondary: true,
275
+ supportIcons: true,
276
+ title: closeButtonLabel,
277
+ ariaLabel: closeButtonLabel
278
+ })));
279
+ closeButton.element.classList.add(
280
+ "chat-plan-review-title-button",
281
+ "chat-plan-review-title-icon-button",
282
+ "chat-plan-review-feedback-close"
283
+ );
284
+ closeButton.label = `$(${Codicon.close.id})`;
285
+ this._register(closeButton.onDidClick(() => this.exitFeedbackMode()));
286
+ }
287
+ this._commentsListEl = $(".chat-plan-review-comments-list");
288
+ this._commentsListScrollable = this._register(( new DomScrollableElement(this._commentsListEl, {
289
+ vertical: ScrollbarVisibility.Auto,
290
+ horizontal: ScrollbarVisibility.Hidden,
291
+ consumeMouseWheelIfScrollbarIsNeeded: true
292
+ })));
293
+ this._commentsListScrollable.getDomNode().classList.add("chat-plan-review-comments-list-scrollable");
294
+ append(section, this._commentsListScrollable.getDomNode());
295
+ hide(this._commentsListScrollable.getDomNode());
296
+ this.renderCommentsList();
182
297
  const textarea = append(section, $("textarea.chat-plan-review-feedback-textarea"));
183
298
  textarea.rows = 1;
184
- textarea.placeholder = ( localize(6859, "Suggest changes or add instructions..."));
299
+ textarea.placeholder = ( localize(7108, "Add an overall comment for the agent..."));
185
300
  this._feedbackTextarea = textarea;
186
301
  const autoResize = () => {
187
302
  textarea.style.height = "auto";
@@ -190,37 +305,209 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
190
305
  };
191
306
  this._register(addDisposableListener(textarea, EventType.INPUT, () => {
192
307
  autoResize();
308
+ this._messageScrollable.scanDomNode();
193
309
  if (this.review instanceof ChatPlanReviewData) {
194
310
  this.review.draftFeedback = textarea.value;
195
311
  }
312
+ this.updateSubmitButtonState();
196
313
  }));
197
- this._register(addDisposableListener(textarea, EventType.KEY_DOWN, e => {
198
- const ev = ( new StandardKeyboardEvent(e));
199
- if (ev.keyCode === KeyCode.Enter && !ev.shiftKey) {
200
- e.preventDefault();
201
- e.stopPropagation();
202
- this.submitFeedback();
314
+ if (this.review.planUri) {
315
+ this._register(addDisposableListener(textarea, EventType.KEY_DOWN, e => {
316
+ const ev = ( new StandardKeyboardEvent(e));
317
+ if (ev.keyCode === KeyCode.Enter && !ev.shiftKey) {
318
+ e.preventDefault();
319
+ e.stopPropagation();
320
+ void this.submitFeedback();
321
+ }
322
+ }));
323
+ }
324
+ }
325
+ renderCommentsList() {
326
+ if (!this._commentsListEl) {
327
+ return;
328
+ }
329
+ this._commentRowDisposables.clear();
330
+ clearNode(this._commentsListEl);
331
+ const items = this.getInlineFeedbackItems();
332
+ if (this._clearAllButtonEl) {
333
+ if (items.length > 0) {
334
+ show(this._clearAllButtonEl);
335
+ } else {
336
+ hide(this._clearAllButtonEl);
203
337
  }
204
- }));
338
+ }
339
+ const scrollableNode = this._commentsListScrollable?.getDomNode();
340
+ if (items.length === 0) {
341
+ if (scrollableNode) {
342
+ hide(scrollableNode);
343
+ }
344
+ this._commentsListScrollable?.scanDomNode();
345
+ return;
346
+ }
347
+ if (scrollableNode) {
348
+ show(scrollableNode);
349
+ }
350
+ for (const item of items) {
351
+ const row = append(this._commentsListEl, $(".chat-plan-review-comment-row"));
352
+ const rowLabel = ( localize(7109, "Line {0}: {1}", item.line, item.text));
353
+ const revealButton = append(row, $("button.chat-plan-review-comment-reveal"));
354
+ revealButton.type = "button";
355
+ revealButton.setAttribute("aria-label", rowLabel);
356
+ const lineEl = append(revealButton, $("span.chat-plan-review-comment-line"));
357
+ lineEl.textContent = ( localize(7110, "Line {0}", item.line));
358
+ const textEl = append(revealButton, $("span.chat-plan-review-comment-text"));
359
+ textEl.textContent = item.text;
360
+ this._commentRowDisposables.add(addDisposableListener(revealButton, EventType.CLICK, () => {
361
+ this.revealInlineComment(item.id, item.line, item.column);
362
+ }));
363
+ const removeLabel = ( localize(7111, "Remove comment on line {0}", item.line));
364
+ const removeButton = append(row, $("button.chat-plan-review-comment-remove"));
365
+ removeButton.type = "button";
366
+ removeButton.setAttribute("aria-label", removeLabel);
367
+ removeButton.title = removeLabel;
368
+ removeButton.classList.add(...ThemeIcon.asClassNameArray(Codicon.close));
369
+ this._commentRowDisposables.add(addDisposableListener(removeButton, EventType.CLICK, e => {
370
+ e.stopPropagation();
371
+ this.removeInlineComment(item.id);
372
+ }));
373
+ }
374
+ this._commentsListScrollable?.scanDomNode();
375
+ }
376
+ getCommentUri() {
377
+ if (this._editingUri) {
378
+ return this._editingUri;
379
+ }
380
+ return this.review.planUri ? URI.revive(this.review.planUri) : undefined;
381
+ }
382
+ getInlineFeedbackItems() {
383
+ const editingItems = this._editingUri ? this._planReviewFeedbackService.getFeedback(this._editingUri) : [];
384
+ const planItems = this.review.planUri ? this._planReviewFeedbackService.getFeedback(URI.revive(this.review.planUri)) : [];
385
+ return [...editingItems, ...planItems].sort(
386
+ (first, second) => first.line - second.line || first.column - second.column
387
+ );
388
+ }
389
+ async revealInlineComment(itemId, line, column) {
390
+ const uri = this.getCommentUri();
391
+ if (!uri) {
392
+ return;
393
+ }
394
+ this._planReviewFeedbackService.setNavigationAnchor(uri, itemId);
395
+ if (this._messageEditor) {
396
+ this._messageEditor.revealLineInCenterIfOutsideViewport(line);
397
+ this._messageEditor.setPosition({
398
+ lineNumber: line,
399
+ column
400
+ });
401
+ this._messageEditor.focus();
402
+ return;
403
+ }
404
+ if (this.review.planUri) {
405
+ await this._editorService.openEditor({
406
+ resource: URI.revive(this.review.planUri),
407
+ options: {
408
+ selection: {
409
+ startLineNumber: line,
410
+ startColumn: column
411
+ }
412
+ }
413
+ });
414
+ }
415
+ }
416
+ removeInlineComment(itemId) {
417
+ if (this._isSubmitted) {
418
+ return;
419
+ }
420
+ for (const uri of this.getFeedbackUris()) {
421
+ this._planReviewFeedbackService.removeFeedback(uri, itemId);
422
+ }
423
+ }
424
+ async clearAllInlineFeedback() {
425
+ if (this._isSubmitted) {
426
+ return;
427
+ }
428
+ const items = this.getInlineFeedbackItems();
429
+ if (items.length === 0) {
430
+ return;
431
+ }
432
+ const result = await this._dialogService.confirm({
433
+ type: Severity.Warning,
434
+ message: ( localize(7112, "Clear {0} inline comment(s)?", items.length)),
435
+ detail: ( localize(
436
+ 7113,
437
+ "These comments will be removed from the plan file and not sent to the agent."
438
+ )),
439
+ primaryButton: ( localize(7114, "Clear All"))
440
+ });
441
+ if (!result.confirmed) {
442
+ return;
443
+ }
444
+ for (const uri of this.getFeedbackUris()) {
445
+ this._planReviewFeedbackService.clearFeedback(uri);
446
+ }
447
+ }
448
+ getFeedbackUris() {
449
+ const uris = [];
450
+ if (this._editingUri) {
451
+ uris.push(this._editingUri);
452
+ }
453
+ if (this.review.planUri) {
454
+ uris.push(URI.revive(this.review.planUri));
455
+ }
456
+ return uris;
457
+ }
458
+ onInlineFeedbackChanged() {
459
+ if (this._isSubmitted) {
460
+ return;
461
+ }
462
+ const items = this.getInlineFeedbackItems();
463
+ if (items.length > 0 && !this._suppressFeedbackModeAutoOpen && !this._isFeedbackMode && !this._isCollapsed) {
464
+ void this.enterFeedbackMode({
465
+ focus: false
466
+ });
467
+ return;
468
+ }
469
+ this.renderCommentsList();
470
+ if (this._isFeedbackMode) {
471
+ this.updateSubmitButtonState();
472
+ }
473
+ this._messageScrollable.scanDomNode();
474
+ this._onDidChangeHeight.fire();
475
+ }
476
+ renderCurrentActionButtons() {
477
+ if (this._isSubmitted) {
478
+ return;
479
+ }
480
+ const target = this._isCollapsed ? this._inlineActionsEl : this._footerButtonsEl;
481
+ const other = this._isCollapsed ? this._footerButtonsEl : this._inlineActionsEl;
482
+ clearNode(other);
483
+ this.renderActionButtons(target, {
484
+ includeReject: !this._isCollapsed
485
+ });
205
486
  }
206
487
  renderActionButtons(container, options) {
207
488
  const includeReject = options?.includeReject ?? true;
208
489
  this._buttonStore.clear();
490
+ this._submitButton = undefined;
491
+ this._renderedSubmitInlineCount = -1;
209
492
  clearNode(container);
210
493
  if (this._isFeedbackMode) {
494
+ const inlineCount = this.getInlineFeedbackItems().length;
211
495
  const submitButton = ( new Button(container, {
212
496
  ...defaultButtonStyles,
213
497
  supportIcons: true
214
498
  }));
215
- submitButton.label = ( localize(6860, "Submit"));
499
+ submitButton.label = this.computeSubmitLabel(inlineCount);
500
+ submitButton.enabled = this.canSubmitFeedback();
501
+ this._submitButton = submitButton;
502
+ this._renderedSubmitInlineCount = inlineCount;
216
503
  this._buttonStore.add(submitButton);
217
- this._buttonStore.add(submitButton.onDidClick(() => this.submitFeedback()));
504
+ this._buttonStore.add(submitButton.onDidClick(() => void this.submitFeedback()));
218
505
  if (includeReject) {
219
506
  const rejectButton = ( new Button(container, {
220
507
  ...defaultButtonStyles,
221
508
  secondary: true
222
509
  }));
223
- rejectButton.label = ( localize(6861, "Reject"));
510
+ rejectButton.label = ( localize(7115, "Reject"));
224
511
  this._buttonStore.add(rejectButton);
225
512
  this._buttonStore.add(rejectButton.onDidClick(() => this.submitRejection()));
226
513
  }
@@ -256,25 +543,37 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
256
543
  approveButton.element.title = primary.description;
257
544
  }
258
545
  this._buttonStore.add(approveButton.onDidClick(() => this.submitApproval(primary)));
259
- if (this.review.canProvideFeedback && includeReject) {
260
- const feedbackButton = ( new Button(container, {
261
- ...defaultButtonStyles,
262
- secondary: true
263
- }));
264
- feedbackButton.label = ( localize(6862, "Provide Feedback"));
265
- this._buttonStore.add(feedbackButton);
266
- this._buttonStore.add(feedbackButton.onDidClick(() => this.enterFeedbackMode()));
267
- }
268
546
  if (includeReject) {
269
547
  const rejectButton = ( new Button(container, {
270
548
  ...defaultButtonStyles,
271
549
  secondary: true
272
550
  }));
273
- rejectButton.label = ( localize(6861, "Reject"));
551
+ rejectButton.label = ( localize(7115, "Reject"));
274
552
  this._buttonStore.add(rejectButton);
275
553
  this._buttonStore.add(rejectButton.onDidClick(() => this.submitRejection()));
276
554
  }
277
555
  }
556
+ canSubmitFeedback() {
557
+ const textareaText = this._feedbackTextarea?.value.trim() ?? "";
558
+ if (textareaText) {
559
+ return true;
560
+ }
561
+ return this.getInlineFeedbackItems().length > 0;
562
+ }
563
+ computeSubmitLabel(inlineCount) {
564
+ return inlineCount > 0 ? ( localize(7116, "Submit Feedback ({0})", inlineCount)) : ( localize(7117, "Submit Feedback"));
565
+ }
566
+ updateSubmitButtonState() {
567
+ if (!this._submitButton || !this._isFeedbackMode) {
568
+ return;
569
+ }
570
+ this._submitButton.enabled = this.canSubmitFeedback();
571
+ const inlineCount = this.getInlineFeedbackItems().length;
572
+ if (inlineCount !== this._renderedSubmitInlineCount) {
573
+ this._submitButton.label = this.computeSubmitLabel(inlineCount);
574
+ this._renderedSubmitInlineCount = inlineCount;
575
+ }
576
+ }
278
577
  toggleCollapsed() {
279
578
  this._isCollapsed = !this._isCollapsed;
280
579
  if (this._isCollapsed) {
@@ -299,41 +598,67 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
299
598
  updateCollapsedPresentation() {
300
599
  this.domNode.classList.toggle("chat-plan-review-collapsed", this._isCollapsed);
301
600
  this._restoreButton.element.classList.toggle("chat-plan-review-hidden", this._isCollapsed);
302
- this._collapseButton.label = this._isCollapsed ? `$(${Codicon.chevronDown.id})` : `$(${Codicon.chevronUp.id})`;
303
- const collapseTooltip = this._isCollapsed ? ( localize(6863, "Expand")) : ( localize(6864, "Collapse"));
601
+ this._collapseButton.label = this._isCollapsed ? `$(${Codicon.chevronUp.id})` : `$(${Codicon.chevronDown.id})`;
602
+ const collapseTooltip = this._isCollapsed ? ( localize(7118, "Expand")) : ( localize(7119, "Collapse"));
304
603
  this._collapseButton.element.setAttribute("aria-label", collapseTooltip);
305
604
  this._collapseButton.element.setAttribute("aria-expanded", String(!this._isCollapsed));
306
605
  this._collapseButton.setTitle(collapseTooltip);
307
- if (!this._isSubmitted) {
308
- if (this._isCollapsed && this._isFeedbackMode) {
309
- this._isFeedbackMode = false;
310
- if (this._feedbackSection) {
311
- hide(this._feedbackSection);
606
+ if (this._reviewButton) {
607
+ const isIconOnly = this._isCollapsed;
608
+ this._reviewButton.element.classList.toggle("chat-plan-review-title-icon-button", isIconOnly);
609
+ let label;
610
+ let tooltip;
611
+ if (isIconOnly) {
612
+ label = `$(${Codicon.edit.id})`;
613
+ const fileName = this.review.planUri ? basename(URI.revive(this.review.planUri)) : "";
614
+ tooltip = this.review.canProvideFeedback ? ( localize(7103, "Review {0}", fileName)) : ( localize(7104, "Open {0}", fileName));
615
+ } else if (this._isFeedbackMode) {
616
+ label = ( localize(7120, "Cancel"));
617
+ tooltip = ( localize(7121, "Exit feedback mode"));
618
+ } else {
619
+ const fileName = this.review.planUri ? basename(URI.revive(this.review.planUri)) : "";
620
+ if (this.review.canProvideFeedback) {
621
+ label = ( localize(7122, "Edit or Provide Feedback"));
622
+ tooltip = ( localize(7103, "Review {0}", fileName));
623
+ } else {
624
+ label = ( localize(7123, "Open Plan"));
625
+ tooltip = ( localize(7104, "Open {0}", fileName));
312
626
  }
313
627
  }
314
- const target = this._isCollapsed ? this._inlineActionsEl : this._footerButtonsEl;
315
- const other = this._isCollapsed ? this._footerButtonsEl : this._inlineActionsEl;
316
- clearNode(other);
317
- this.renderActionButtons(target, {
318
- includeReject: !this._isCollapsed
319
- });
628
+ this._reviewButton.label = label;
629
+ this._reviewButton.element.setAttribute("aria-label", tooltip);
630
+ this._reviewButton.setTitle(tooltip);
320
631
  }
632
+ this.renderCurrentActionButtons();
321
633
  }
322
634
  updateExpandedPresentation() {
323
635
  this.domNode.classList.toggle("chat-plan-review-expanded", this._isExpanded && !this._isCollapsed);
324
636
  this._restoreButton.label = this._isExpanded ? `$(${Codicon.screenNormal.id})` : `$(${Codicon.screenFull.id})`;
325
- const tooltip = this._isExpanded ? ( localize(6865, "Restore Size")) : ( localize(6866, "Expand"));
637
+ const tooltip = this._isExpanded ? ( localize(7124, "Restore Size")) : ( localize(7125, "Expand"));
326
638
  this._restoreButton.element.setAttribute("aria-label", tooltip);
327
639
  this._restoreButton.setTitle(tooltip);
328
640
  this._messageScrollable.scanDomNode();
641
+ this._onDidChangeHeight.fire();
329
642
  }
330
- async openPlanFile() {
331
- if (!this.review.planUri) {
643
+ async enterReviewMode() {
644
+ if (!this.review.canProvideFeedback || this._isSubmitted) {
645
+ if (this.review.planUri) {
646
+ await this._editorService.openEditor({
647
+ resource: URI.revive(this.review.planUri)
648
+ });
649
+ }
332
650
  return;
333
651
  }
334
- const uri = URI.revive(this.review.planUri);
335
- await this._editorService.openEditor({
336
- resource: uri
652
+ if (this._isCollapsed) {
653
+ this._isCollapsed = false;
654
+ if (this.review instanceof ChatPlanReviewData) {
655
+ this.review.draftCollapsed = false;
656
+ }
657
+ this.updateCollapsedPresentation();
658
+ this.updateExpandedPresentation();
659
+ }
660
+ await this.enterFeedbackMode({
661
+ focus: true
337
662
  });
338
663
  }
339
664
  async submitApproval(action) {
@@ -347,64 +672,308 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
347
672
  }
348
673
  }
349
674
  this._isSubmitted = true;
675
+ const ridesAlong = !this.review.planUri;
676
+ const textareaFeedback = ridesAlong ? this._feedbackTextarea?.value.trim() : undefined;
350
677
  this._options.onSubmit({
351
678
  action: action.label,
352
- rejected: false
679
+ ...(action.id ? {
680
+ actionId: action.id
681
+ } : {}),
682
+ rejected: false,
683
+ ...(textareaFeedback ? {
684
+ feedback: textareaFeedback,
685
+ feedbackOverall: textareaFeedback
686
+ } : {})
353
687
  });
354
- this.markUsed();
688
+ void this.markUsed();
355
689
  }
356
690
  submitRejection() {
357
691
  if (this._isSubmitted) {
358
692
  return;
359
693
  }
360
694
  this._isSubmitted = true;
695
+ const ridesAlong = !this.review.planUri;
696
+ const textareaFeedback = ridesAlong ? this._feedbackTextarea?.value.trim() : undefined;
361
697
  this._options.onSubmit({
362
- rejected: true
698
+ rejected: true,
699
+ ...(textareaFeedback ? {
700
+ feedback: textareaFeedback,
701
+ feedbackOverall: textareaFeedback
702
+ } : {})
363
703
  });
364
- this.markUsed();
704
+ void this.markUsed();
365
705
  }
366
- enterFeedbackMode() {
706
+ async enterFeedbackMode(options) {
707
+ if (this._isFeedbackMode) {
708
+ if (options?.focus) {
709
+ this.focusFeedbackInput();
710
+ }
711
+ return;
712
+ }
367
713
  this._isFeedbackMode = true;
368
714
  if (this._feedbackSection) {
369
715
  show(this._feedbackSection);
370
716
  }
371
- this.renderActionButtons(this._footerButtonsEl, {
372
- includeReject: true
717
+ this.domNode.classList.add("chat-plan-review-feedback-mode");
718
+ this.renderCommentsList();
719
+ this.updateCollapsedPresentation();
720
+ const mountId = ++this._inlineEditorMountId;
721
+ if (this.isInlineEditorEnabled()) {
722
+ await this.mountInlineEditor(mountId);
723
+ } else if (this.review.planUri) {
724
+ await this._editorService.openEditor({
725
+ resource: URI.revive(this.review.planUri)
726
+ });
727
+ }
728
+ if (options?.focus !== false) {
729
+ this.focusFeedbackInput();
730
+ }
731
+ this._messageScrollable.scanDomNode();
732
+ this._onDidChangeHeight.fire();
733
+ }
734
+ async exitFeedbackMode() {
735
+ if (!this._isFeedbackMode) {
736
+ return;
737
+ }
738
+ this._isFeedbackMode = false;
739
+ if (this._feedbackSection) {
740
+ hide(this._feedbackSection);
741
+ }
742
+ this.domNode.classList.remove("chat-plan-review-feedback-mode");
743
+ await this.unmountInlineEditor();
744
+ this.renderMarkdown();
745
+ this.updateCollapsedPresentation();
746
+ this._messageScrollable.scanDomNode();
747
+ this._onDidChangeHeight.fire();
748
+ }
749
+ focusFeedbackInput() {
750
+ if (this._messageEditor) {
751
+ this._messageEditor.focus();
752
+ } else {
753
+ this._feedbackTextarea?.focus();
754
+ }
755
+ }
756
+ async mountInlineEditor(mountId) {
757
+ if (!this.canContinueInlineEditorMount(mountId) || !this.review.planUri) {
758
+ return;
759
+ }
760
+ const planUri = URI.revive(this.review.planUri);
761
+ let initialContent;
762
+ try {
763
+ const stat = await this._textFileService.read(planUri);
764
+ initialContent = stat.value;
765
+ } catch {
766
+ return;
767
+ }
768
+ if (!this.canContinueInlineEditorMount(mountId)) {
769
+ return;
770
+ }
771
+ const editingUri = ( URI.from({
772
+ scheme: Schemas.inMemory,
773
+ path: `${PLAN_REVIEW_EDITING_PATH_PREFIX}/${generateUuid()}/${basename(planUri)}`
774
+ }));
775
+ const language = this._languageService.createByFilepathOrFirstLine(planUri);
776
+ const model = this._modelService.createModel(initialContent, language, editingUri);
777
+ let pinnedRef;
778
+ try {
779
+ pinnedRef = await this._textModelService.createModelReference(editingUri);
780
+ } catch {}
781
+ if (!this.canContinueInlineEditorMount(mountId)) {
782
+ pinnedRef?.dispose();
783
+ model.dispose();
784
+ return;
785
+ }
786
+ this._messageEditorDisposables.clear();
787
+ this._messageContentDisposables.clear();
788
+ clearNode(this._messageEl);
789
+ this._messageEl.classList.add("chat-plan-review-body-editor");
790
+ const editorOptions = {
791
+ wordWrap: "on",
792
+ lineNumbers: "on",
793
+ lineNumbersMinChars: 2,
794
+ glyphMargin: true,
795
+ folding: false,
796
+ minimap: {
797
+ enabled: false
798
+ },
799
+ scrollBeyondLastLine: false,
800
+ overviewRulerLanes: 0,
801
+ overviewRulerBorder: false,
802
+ hideCursorInOverviewRuler: true,
803
+ lineDecorationsWidth: 6,
804
+ renderLineHighlight: "none",
805
+ lightbulb: {
806
+ enabled: ShowLightbulbIconMode.Off
807
+ },
808
+ padding: {
809
+ top: 0,
810
+ bottom: 0
811
+ },
812
+ automaticLayout: true,
813
+ scrollbar: {
814
+ vertical: "auto",
815
+ horizontal: "auto",
816
+ alwaysConsumeMouseWheel: false
817
+ }
818
+ };
819
+ let editor;
820
+ try {
821
+ editor = this._instantiationService.createInstance(CodeEditorWidget, this._messageEl, editorOptions, {
822
+ isSimpleWidget: false
823
+ });
824
+ } catch {
825
+ pinnedRef?.dispose();
826
+ model.dispose();
827
+ this._messageEl.classList.remove("chat-plan-review-body-editor");
828
+ clearNode(this._messageEl);
829
+ this.renderMarkdown();
830
+ return;
831
+ }
832
+ this._messageEditorDisposables.add(toDisposable(() => editor.setModel(null)));
833
+ this._messageEditorDisposables.add(editor);
834
+ this._messageEditorDisposables.add(model);
835
+ if (pinnedRef) {
836
+ this._messageEditorDisposables.add(pinnedRef);
837
+ }
838
+ this._editingUri = editingUri;
839
+ this._initialEditorContent = initialContent;
840
+ const editingRegistration = this._planReviewFeedbackService.registerPlanReview(editingUri, () => {
841
+ void this.submitFeedback();
373
842
  });
374
- this._feedbackTextarea?.focus();
843
+ this._messageEditorDisposables.add(editingRegistration);
844
+ this._messageEditorDisposables.add(toDisposable(() => {
845
+ this._editingUri = undefined;
846
+ }));
847
+ try {
848
+ editor.setModel(model);
849
+ } catch {
850
+ this._messageEditorDisposables.clear();
851
+ this._messageEl.classList.remove("chat-plan-review-body-editor");
852
+ clearNode(this._messageEl);
853
+ this.renderMarkdown();
854
+ return;
855
+ }
856
+ this._messageEditor = editor;
857
+ const preExistingComments = this._planReviewFeedbackService.getFeedback(planUri);
858
+ if (preExistingComments.length > 0) {
859
+ for (const item of preExistingComments) {
860
+ this._planReviewFeedbackService.addFeedback(editingUri, item.line, item.column, item.text);
861
+ }
862
+ this._planReviewFeedbackService.clearFeedback(planUri);
863
+ }
864
+ this._messageScrollable.scanDomNode();
375
865
  this._onDidChangeHeight.fire();
866
+ editor.focus();
376
867
  }
377
- submitFeedback() {
868
+ canContinueInlineEditorMount(mountId) {
869
+ return this._inlineEditorMountId === mountId && !this._messageEditor && this._isFeedbackMode && !this._isSubmitted && !this._messageEditorDisposables.isDisposed;
870
+ }
871
+ isInlineEditorEnabled() {
872
+ return this._configurationService.getValue(ChatConfiguration.PlanReviewInlineEditorEnabled) !== false;
873
+ }
874
+ migrateInlineFeedbackToPlan(editingUri, planUri) {
875
+ const items = [...this._planReviewFeedbackService.getFeedback(editingUri)];
876
+ if (items.length === 0) {
877
+ return;
878
+ }
879
+ this._suppressFeedbackModeAutoOpen = true;
880
+ try {
881
+ for (const item of items) {
882
+ this._planReviewFeedbackService.addFeedback(planUri, item.line, item.column, item.text);
883
+ }
884
+ this._planReviewFeedbackService.clearFeedback(editingUri);
885
+ } finally {
886
+ this._suppressFeedbackModeAutoOpen = false;
887
+ }
888
+ }
889
+ async unmountInlineEditor(options) {
890
+ this._inlineEditorMountId++;
891
+ if (!this._messageEditor) {
892
+ return;
893
+ }
894
+ const editor = this._messageEditor;
895
+ const editingUri = this._editingUri;
896
+ const model = editingUri ? this._modelService.getModel(editingUri) : undefined;
897
+ const planUri = this.review.planUri ? URI.revive(this.review.planUri) : undefined;
898
+ const initialContent = this._initialEditorContent;
899
+ const text = model && !model.isDisposed() ? model.getValue() : undefined;
900
+ if (editingUri && planUri) {
901
+ this.migrateInlineFeedbackToPlan(editingUri, planUri);
902
+ }
903
+ this._messageEditor = undefined;
904
+ this._initialEditorContent = undefined;
905
+ try {
906
+ editor.setModel(null);
907
+ } finally {
908
+ this._messageEditorDisposables.clear();
909
+ this._messageEl.classList.remove("chat-plan-review-body-editor");
910
+ clearNode(this._messageEl);
911
+ }
912
+ if (options?.writeBack && text !== undefined && planUri && text !== initialContent) {
913
+ if (this.review instanceof ChatPlanReviewData) {
914
+ this.review.content = text;
915
+ }
916
+ try {
917
+ await this._textFileService.write(planUri, text);
918
+ } catch {}
919
+ }
920
+ }
921
+ async submitFeedback() {
378
922
  if (this._isSubmitted) {
379
923
  return;
380
924
  }
381
- const feedback = this._feedbackTextarea?.value.trim();
382
- if (!feedback) {
925
+ const textareaFeedback = this._feedbackTextarea?.value.trim();
926
+ const editorFeedbackItems = [...this.getInlineFeedbackItems()];
927
+ if (!textareaFeedback && editorFeedbackItems.length === 0) {
383
928
  return;
384
929
  }
385
930
  this._isSubmitted = true;
931
+ await this.unmountInlineEditor({
932
+ writeBack: true
933
+ });
934
+ let feedbackInlineMarkdown;
935
+ if (editorFeedbackItems.length > 0) {
936
+ const planUri = this.review.planUri ? URI.revive(this.review.planUri) : undefined;
937
+ const fileName = planUri ? basename(planUri) : "";
938
+ const heading = fileName ? ( localize(7126, "Inline comments on `{0}`:", fileName)) : ( localize(7127, "Inline comments:"));
939
+ const bullets = ( editorFeedbackItems.map(item => {
940
+ const location = item.column > 1 ? ( localize(7128, "Line {0}, Column {1}", item.line, item.column)) : ( localize(7129, "Line {0}", item.line));
941
+ return `- **${location}:** ${item.text}`;
942
+ }));
943
+ feedbackInlineMarkdown = [heading, ...bullets].join("\n");
944
+ }
945
+ const sections = [];
946
+ if (textareaFeedback) {
947
+ sections.push(textareaFeedback);
948
+ }
949
+ if (feedbackInlineMarkdown) {
950
+ sections.push(feedbackInlineMarkdown);
951
+ }
952
+ const feedback = sections.join("\n\n");
386
953
  this._options.onSubmit({
387
954
  rejected: false,
388
- feedback
955
+ feedback,
956
+ feedbackOverall: textareaFeedback || undefined,
957
+ feedbackInlineMarkdown
389
958
  });
390
- this.markUsed();
959
+ await this.markUsed();
391
960
  }
392
961
  async confirmAutopilot() {
393
962
  const result = await this._dialogService.prompt({
394
963
  type: Severity.Warning,
395
- message: ( localize(6867, "Enable Autopilot?")),
964
+ message: ( localize(7130, "Enable Autopilot?")),
396
965
  buttons: [{
397
- label: ( localize(6868, "Enable")),
966
+ label: ( localize(7131, "Enable")),
398
967
  run: () => true
399
968
  }, {
400
- label: ( localize(6869, "Cancel")),
969
+ label: ( localize(7132, "Cancel")),
401
970
  run: () => false
402
971
  }],
403
972
  custom: {
404
973
  icon: Codicon.rocket,
405
974
  markdownDetails: [{
406
975
  markdown: ( new MarkdownString(( localize(
407
- 6870,
976
+ 7133,
408
977
  "Autopilot will auto-approve all tool calls and continue working autonomously until the task is complete. This includes terminal commands, file edits, and external tool calls. The agent will make decisions on your behalf without asking for confirmation.\n\nYou can stop the agent at any time by clicking the stop button. This applies to the current session only."
409
978
  ))))
410
979
  }]
@@ -412,14 +981,23 @@ let ChatPlanReviewPart = class ChatPlanReviewPart extends Disposable {
412
981
  });
413
982
  return result.result === true;
414
983
  }
415
- markUsed() {
984
+ async markUsed() {
416
985
  this.domNode.classList.add("chat-plan-review-used");
417
986
  this._buttonStore.clear();
987
+ this._submitButton = undefined;
988
+ this._renderedSubmitInlineCount = -1;
989
+ this._planReviewRegistration.clear();
990
+ if (this._messageEditor) {
991
+ await this.unmountInlineEditor({
992
+ writeBack: false
993
+ });
994
+ this.renderMarkdown();
995
+ }
418
996
  if (this._feedbackTextarea) {
419
997
  this._feedbackTextarea.disabled = true;
420
998
  }
421
999
  }
422
1000
  };
423
- ChatPlanReviewPart = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IContextMenuService)), ( __param(5, IDialogService)), ( __param(6, IEditorService)), ( __param(7, IHoverService))], ChatPlanReviewPart));
1001
+ ChatPlanReviewPart = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IContextMenuService)), ( __param(5, IDialogService)), ( __param(6, IEditorService)), ( __param(7, IHoverService)), ( __param(8, IPlanReviewFeedbackService)), ( __param(9, IInstantiationService)), ( __param(10, ITextFileService)), ( __param(11, IModelService)), ( __param(12, ITextModelService)), ( __param(13, ILanguageService)), ( __param(14, IConfigurationService))], ChatPlanReviewPart));
424
1002
 
425
1003
  export { ChatPlanReviewPart };