@codingame/monaco-vscode-katex-common 25.1.2 → 26.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 (317) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +23 -2
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
  4. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
  6. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
  8. package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
  9. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
  29. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
  30. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
  31. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
  32. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
  33. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
  34. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
  54. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
  113. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
  114. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
  117. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
  118. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
  119. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
  120. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
  121. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
  122. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
  123. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
  124. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
  128. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
  129. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
  131. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
  134. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
  135. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
  137. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
  138. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
  139. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
  140. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
  145. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
  146. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
  147. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
  148. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
  149. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
  150. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
  151. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
  152. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
  153. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
  155. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
  156. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
  157. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
  158. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
  159. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
  161. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
  172. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
  173. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
  174. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
  175. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
  176. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
  177. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
  179. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
  180. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
  181. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
  182. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
  183. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
  184. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
  185. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
  186. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
  187. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
  188. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
  191. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
  192. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
  198. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
  199. package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
  200. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
  201. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +80 -19
  202. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
  203. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
  204. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
  205. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
  206. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
  207. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
  208. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
  209. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
  210. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
  211. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
  212. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
  213. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
  214. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
  215. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
  216. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
  217. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
  218. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
  219. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
  220. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
  221. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
  222. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
  223. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
  224. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
  225. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
  226. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
  227. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
  228. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
  229. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
  230. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
  231. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
  232. package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
  239. package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
  240. package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
  241. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
  242. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
  243. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
  244. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
  245. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
  246. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
  247. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
  248. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
  249. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
  250. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
  251. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
  252. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
  253. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
  254. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
  255. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
  256. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
  257. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
  258. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
  259. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
  260. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
  261. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
  262. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
  304. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
  305. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
  306. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
  307. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
  308. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
  309. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
  310. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
  311. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
  312. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
  313. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
  314. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
  315. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
  316. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
  317. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
@@ -5,7 +5,6 @@ import * as chat from './media/chat.css';
5
5
  import * as chatAgentHover from './media/chatAgentHover.css';
6
6
  import * as chatViewWelcome from './media/chatViewWelcome.css';
7
7
  import { $ as $$1, findParentWithClass, getTopLeftOffset, append, addStandardDisposableListener, EventType, setVisibility, clearNode, scheduleAtNextAnimationFrame, getWindow, createElement, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
8
- import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
9
8
  import { timeout, disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
10
9
  import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
11
10
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
@@ -29,25 +28,12 @@ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/
29
28
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
30
29
  import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
31
30
  import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
32
- import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
33
31
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
34
32
  import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
35
- import { WorkbenchObjectTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
36
33
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
37
34
  import { bindContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
38
35
  import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
39
36
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
40
- import { asCssVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
41
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
42
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
43
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
44
- import { buttonSecondaryHoverBackground, buttonSecondaryForeground, buttonSecondaryBackground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
45
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
46
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
47
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
48
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
49
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
50
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
51
37
  import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
52
38
  import { WorkbenchState } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
53
39
  import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
@@ -55,7 +41,6 @@ import { EditorResourceAccessor } from '@codingame/monaco-vscode-api/vscode/vs/w
55
41
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
56
42
  import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
57
43
  import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
58
- import { katexContainerClassName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/markdown/common/markedKatexExtension';
59
44
  import { checkModeOption } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
60
45
  import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
61
46
  import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
@@ -64,7 +49,7 @@ import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/work
64
49
  import { IChatLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatLayoutService.service';
65
50
  import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
66
51
  import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
67
- import { ChatRequestToolPart, ChatRequestToolSetPart, ChatRequestDynamicVariablePart, chatAgentLeader, chatSubcommandLeader, ChatRequestSlashPromptPart, formatChatQuestion, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
52
+ import { ChatRequestToolPart, ChatRequestToolSetPart, ChatRequestDynamicVariablePart, IParsedChatRequest, chatAgentLeader, chatSubcommandLeader, ChatRequestSlashPromptPart, formatChatQuestion, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
68
53
  import { ChatRequestParser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatRequestParser';
69
54
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
70
55
  import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
@@ -73,8 +58,8 @@ import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/wor
73
58
  import { isWorkspaceVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, toPromptFileVariableEntry, PromptFileVariableKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
74
59
  import { isResponseVM, isRequestVM, ChatViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
75
60
  import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
76
- import { ChatConfiguration, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
77
- import { ToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
61
+ import { ChatModeKind, ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
62
+ import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
78
63
  import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
79
64
  import { ComputeAutomaticInstructions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
80
65
  import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
@@ -83,10 +68,9 @@ import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
83
68
  import { handleModeSwitch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
84
69
  import { isIChatResourceViewContext, isIChatViewViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
85
70
  import { IChatWidgetService, IChatAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
86
- import { ChatAccessibilityProvider } from '../accessibility/chatAccessibilityProvider.js';
87
71
  import { ChatSuggestNextWidget } from './chatContentParts/chatSuggestNextWidget.js';
88
72
  import { ChatInputPart } from './input/chatInputPart.js';
89
- import { ChatListDelegate, ChatListItemRenderer } from './chatListRenderer.js';
73
+ import { ChatListWidget } from './chatListWidget.js';
90
74
  import { ChatEditorOptions } from './chatOptions.js';
91
75
  import { ChatViewWelcomePart } from '../viewsWelcome/chatViewWelcomeController.js';
92
76
  import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
@@ -115,14 +99,22 @@ const supportsAllAttachments = {
115
99
  supportsSourceControlAttachments: true,
116
100
  supportsProblemAttachments: true,
117
101
  supportsSymbolAttachments: true,
118
- supportsTerminalAttachments: true,
102
+ supportsTerminalAttachments: true
119
103
  };
120
- const DISCLAIMER = ( localize(5791, "AI responses may be inaccurate."));
104
+ const DISCLAIMER = ( localize(6047, "AI responses may be inaccurate."));
121
105
  let ChatWidget = class ChatWidget extends Disposable {
122
- static { ChatWidget_1 = this; }
123
- static { this.CONTRIBS = []; }
124
- get domNode() { return this.container; }
125
- get visible() { return this._visible; }
106
+ static {
107
+ ChatWidget_1 = this;
108
+ }
109
+ static {
110
+ this.CONTRIBS = [];
111
+ }
112
+ get domNode() {
113
+ return this.container;
114
+ }
115
+ get visible() {
116
+ return this._visible;
117
+ }
126
118
  set viewModel(viewModel) {
127
119
  if (this._viewModel === viewModel) {
128
120
  return;
@@ -132,13 +124,18 @@ let ChatWidget = class ChatWidget extends Disposable {
132
124
  this._viewModel = viewModel;
133
125
  if (viewModel) {
134
126
  this.viewModelDisposables.add(viewModel);
135
- this.logService.debug('ChatWidget#setViewModel: have viewModel');
136
- }
137
- else {
138
- this.logService.debug('ChatWidget#setViewModel: no viewModel');
127
+ this.logService.debug("ChatWidget#setViewModel: have viewModel");
128
+ if (viewModel.model.requestInProgress.get()) {
129
+ this.chatAccessibilityService.acceptRequest(viewModel.sessionResource, true);
130
+ }
131
+ } else {
132
+ this.logService.debug("ChatWidget#setViewModel: no viewModel");
139
133
  }
140
134
  this.currentRequest = undefined;
141
- this._onDidChangeViewModel.fire({ previousSessionResource, currentSessionResource: this._viewModel?.sessionResource });
135
+ this._onDidChangeViewModel.fire({
136
+ previousSessionResource,
137
+ currentSessionResource: this._viewModel?.sessionResource
138
+ });
142
139
  }
143
140
  get viewModel() {
144
141
  return this._viewModel;
@@ -146,10 +143,12 @@ let ChatWidget = class ChatWidget extends Disposable {
146
143
  get parsedInput() {
147
144
  if (this.parsedChatRequest === undefined) {
148
145
  if (!this.viewModel) {
149
- return { text: '', parts: [] };
146
+ return {
147
+ text: "",
148
+ parts: []
149
+ };
150
150
  }
151
- this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser)
152
- .parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, {
151
+ this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, {
153
152
  selectedAgent: this._lastSelectedAgent,
154
153
  mode: this.input.currentModeKind,
155
154
  forcedAgent: this._lockedAgent?.id ? this.chatAgentService.getAgent(this._lockedAgent.id) : undefined
@@ -170,7 +169,36 @@ let ChatWidget = class ChatWidget extends Disposable {
170
169
  get locationData() {
171
170
  return this._location.resolveData?.();
172
171
  }
173
- constructor(location, viewContext, viewOptions, styles, codeEditorService, editorService, configurationService, contextKeyService, instantiationService, chatService, chatAgentService, chatWidgetService, contextMenuService, chatAccessibilityService, logService, themeService, chatSlashCommandService, chatEditingService, telemetryService, promptsService, toolsService, chatModeService, chatLayoutService, chatEntitlementService, chatSessionsService, agentSessionsService, chatTodoListService, contextService, lifecycleService) {
172
+ constructor(
173
+ location,
174
+ viewContext,
175
+ viewOptions,
176
+ styles,
177
+ codeEditorService,
178
+ editorService,
179
+ configurationService,
180
+ contextKeyService,
181
+ instantiationService,
182
+ chatService,
183
+ chatAgentService,
184
+ chatWidgetService,
185
+ chatAccessibilityService,
186
+ logService,
187
+ themeService,
188
+ chatSlashCommandService,
189
+ chatEditingService,
190
+ telemetryService,
191
+ promptsService,
192
+ toolsService,
193
+ chatModeService,
194
+ chatLayoutService,
195
+ chatEntitlementService,
196
+ chatSessionsService,
197
+ agentSessionsService,
198
+ chatTodoListService,
199
+ contextService,
200
+ lifecycleService
201
+ ) {
174
202
  super();
175
203
  this.viewOptions = viewOptions;
176
204
  this.styles = styles;
@@ -182,7 +210,6 @@ let ChatWidget = class ChatWidget extends Disposable {
182
210
  this.chatService = chatService;
183
211
  this.chatAgentService = chatAgentService;
184
212
  this.chatWidgetService = chatWidgetService;
185
- this.contextMenuService = contextMenuService;
186
213
  this.chatAccessibilityService = chatAccessibilityService;
187
214
  this.logService = logService;
188
215
  this.themeService = themeService;
@@ -227,22 +254,17 @@ let ChatWidget = class ChatWidget extends Disposable {
227
254
  this.contribs = [];
228
255
  this.visibilityTimeoutDisposable = this._register(( new MutableDisposable()));
229
256
  this.visibilityAnimationFrameDisposable = this._register(( new MutableDisposable()));
230
- this.scrollAnimationFrameDisposable = this._register(( new MutableDisposable()));
231
257
  this.inputPartDisposable = this._register(( new MutableDisposable()));
232
258
  this.inlineInputPartDisposable = this._register(( new MutableDisposable()));
233
259
  this.recentlyRestoredCheckpoint = false;
234
- this.settingChangeCounter = 0;
235
260
  this.welcomePart = this._register(( new MutableDisposable()));
236
261
  this.visibleChangeCount = 0;
237
262
  this._visible = false;
238
- this.previousTreeScrollHeight = 0;
239
- this.scrollLock = true;
240
263
  this._isRenderingWelcome = false;
241
264
  this._attachmentCapabilities = supportsAllAttachments;
242
265
  this.promptDescriptionsCache = ( new Map());
243
266
  this.promptUriCache = ( new Map());
244
267
  this._isLoadingPromptDescriptions = false;
245
- this._mostRecentlyFocusedItemIndex = -1;
246
268
  this.viewModelDisposables = this._register(( new DisposableStore()));
247
269
  this._editingSession = observableValue(this, undefined);
248
270
  this._lockedToCodingAgentContextKey = ChatContextKeys.lockedToCodingAgent.bindTo(this.contextKeyService);
@@ -250,74 +272,88 @@ let ChatWidget = class ChatWidget extends Disposable {
250
272
  this._sessionIsEmptyContextKey = ChatContextKeys.chatSessionIsEmpty.bindTo(this.contextKeyService);
251
273
  this.viewContext = viewContext ?? {};
252
274
  const viewModelObs = observableFromEvent(this, this.onDidChangeViewModel, () => this.viewModel);
253
- if (typeof location === 'object') {
275
+ if (typeof location === "object") {
254
276
  this._location = location;
255
- }
256
- else {
257
- this._location = { location };
277
+ } else {
278
+ this._location = {
279
+ location
280
+ };
258
281
  }
259
282
  ChatContextKeys.inChatSession.bindTo(contextKeyService).set(true);
260
283
  ChatContextKeys.location.bindTo(contextKeyService).set(this._location.location);
261
284
  ChatContextKeys.inQuickChat.bindTo(contextKeyService).set(isQuickChat(this));
262
285
  this.agentInInput = ChatContextKeys.inputHasAgent.bindTo(contextKeyService);
263
286
  this.requestInProgress = ChatContextKeys.requestInProgress.bindTo(contextKeyService);
264
- this._register(this.chatEntitlementService.onDidChangeAnonymous(() => this.renderWelcomeViewContentIfNeeded()));
265
- this._register(bindContextKey(decidedChatEditingResourceContextKey, contextKeyService, (reader) => {
266
- const currentSession = this._editingSession.read(reader);
267
- if (!currentSession) {
268
- return;
269
- }
270
- const entries = currentSession.entries.read(reader);
271
- const decidedEntries = entries.filter(entry => entry.state.read(reader) !== ModifiedFileEntryState.Modified);
272
- return ( decidedEntries.map(entry => entry.entryId));
273
- }));
274
- this._register(bindContextKey(hasUndecidedChatEditingResourceContextKey, contextKeyService, (reader) => {
275
- const currentSession = this._editingSession.read(reader);
276
- const entries = currentSession?.entries.read(reader) ?? [];
277
- const decidedEntries = entries.filter(entry => entry.state.read(reader) === ModifiedFileEntryState.Modified);
278
- return decidedEntries.length > 0;
279
- }));
280
- this._register(bindContextKey(hasAppliedChatEditsContextKey, contextKeyService, (reader) => {
281
- const currentSession = this._editingSession.read(reader);
282
- if (!currentSession) {
283
- return false;
284
- }
285
- const entries = currentSession.entries.read(reader);
286
- return entries.length > 0;
287
- }));
288
- this._register(bindContextKey(inChatEditingSessionContextKey, contextKeyService, (reader) => {
289
- return this._editingSession.read(reader) !== null;
290
- }));
291
- this._register(bindContextKey(ChatContextKeys.chatEditingCanUndo, contextKeyService, (r) => {
292
- return this._editingSession.read(r)?.canUndo.read(r) || false;
293
- }));
294
- this._register(bindContextKey(ChatContextKeys.chatEditingCanRedo, contextKeyService, (r) => {
295
- return this._editingSession.read(r)?.canRedo.read(r) || false;
296
- }));
297
- this._register(bindContextKey(applyingChatEditsFailedContextKey, contextKeyService, (r) => {
298
- const chatModel = viewModelObs.read(r)?.model;
299
- const editingSession = this._editingSession.read(r);
300
- if (!editingSession || !chatModel) {
301
- return false;
302
- }
303
- const lastResponse = observableFromEvent(this, chatModel.onDidChange, () => chatModel.getRequests().at(-1)?.response).read(r);
304
- return lastResponse?.result?.errorDetails && !lastResponse?.result?.errorDetails.responseIsIncomplete;
305
- }));
287
+ this._register(
288
+ this.chatEntitlementService.onDidChangeAnonymous(() => this.renderWelcomeViewContentIfNeeded())
289
+ );
290
+ this._register(
291
+ bindContextKey(decidedChatEditingResourceContextKey, contextKeyService, reader => {
292
+ const currentSession = this._editingSession.read(reader);
293
+ if (!currentSession) {
294
+ return;
295
+ }
296
+ const entries = currentSession.entries.read(reader);
297
+ const decidedEntries = entries.filter(entry => entry.state.read(reader) !== ModifiedFileEntryState.Modified);
298
+ return ( decidedEntries.map(entry => entry.entryId));
299
+ })
300
+ );
301
+ this._register(
302
+ bindContextKey(hasUndecidedChatEditingResourceContextKey, contextKeyService, reader => {
303
+ const currentSession = this._editingSession.read(reader);
304
+ const entries = currentSession?.entries.read(reader) ?? [];
305
+ const decidedEntries = entries.filter(entry => entry.state.read(reader) === ModifiedFileEntryState.Modified);
306
+ return decidedEntries.length > 0;
307
+ })
308
+ );
309
+ this._register(
310
+ bindContextKey(hasAppliedChatEditsContextKey, contextKeyService, reader => {
311
+ const currentSession = this._editingSession.read(reader);
312
+ if (!currentSession) {
313
+ return false;
314
+ }
315
+ const entries = currentSession.entries.read(reader);
316
+ return entries.length > 0;
317
+ })
318
+ );
319
+ this._register(
320
+ bindContextKey(inChatEditingSessionContextKey, contextKeyService, reader => {
321
+ return this._editingSession.read(reader) !== null;
322
+ })
323
+ );
324
+ this._register(
325
+ bindContextKey(ChatContextKeys.chatEditingCanUndo, contextKeyService, r => {
326
+ return this._editingSession.read(r)?.canUndo.read(r) || false;
327
+ })
328
+ );
329
+ this._register(
330
+ bindContextKey(ChatContextKeys.chatEditingCanRedo, contextKeyService, r => {
331
+ return this._editingSession.read(r)?.canRedo.read(r) || false;
332
+ })
333
+ );
334
+ this._register(
335
+ bindContextKey(applyingChatEditsFailedContextKey, contextKeyService, r => {
336
+ const chatModel = viewModelObs.read(r)?.model;
337
+ const editingSession = this._editingSession.read(r);
338
+ if (!editingSession || !chatModel) {
339
+ return false;
340
+ }
341
+ const lastResponse = observableFromEvent(
342
+ this,
343
+ chatModel.onDidChange,
344
+ () => chatModel.getRequests().at(-1)?.response
345
+ ).read(r);
346
+ return lastResponse?.result?.errorDetails && !lastResponse?.result?.errorDetails.responseIsIncomplete;
347
+ })
348
+ );
306
349
  this._codeBlockModelCollection = this._register(instantiationService.createInstance(CodeBlockModelCollection, undefined));
307
350
  this.chatSuggestNextWidget = this._register(this.instantiationService.createInstance(ChatSuggestNextWidget));
308
- this._register(this.configurationService.onDidChangeConfiguration((e) => {
309
- if (e.affectsConfiguration('chat.renderRelatedFiles')) {
310
- this.input.renderChatRelatedFiles();
311
- }
312
- if (e.affectsConfiguration(ChatConfiguration.EditRequests) || e.affectsConfiguration(ChatConfiguration.CheckpointsEnabled)) {
313
- this.settingChangeCounter++;
314
- this.onDidChangeItems();
315
- }
316
- }));
317
351
  this._register(autorun(r => {
318
352
  const viewModel = viewModelObs.read(r);
319
353
  const sessions = chatEditingService.editingSessionsObs.read(r);
320
- const session = sessions.find(candidate => isEqual(candidate.chatSessionResource, viewModel?.sessionResource));
354
+ const session = sessions.find(
355
+ candidate => isEqual(candidate.chatSessionResource, viewModel?.sessionResource)
356
+ );
321
357
  this._editingSession.set(undefined, undefined);
322
358
  this.renderChatEditingSessionState();
323
359
  if (!session) {
@@ -332,62 +368,63 @@ let ChatWidget = class ChatWidget extends Disposable {
332
368
  this._editingSession.set(undefined, undefined);
333
369
  this.renderChatEditingSessionState();
334
370
  }));
335
- r.store.add(this.onDidChangeParsedInput(() => {
336
- this.renderChatEditingSessionState();
337
- }));
338
371
  r.store.add(this.inputEditor.onDidChangeModelContent(() => {
339
- if (this.getInput() === '') {
372
+ if (this.getInput() === "") {
340
373
  this.refreshParsedInput();
341
- this.renderChatEditingSessionState();
342
374
  }
343
375
  }));
344
376
  this.renderChatEditingSessionState();
345
377
  }));
346
- this._register(codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
347
- const resource = input.resource;
348
- if (resource.scheme !== Schemas.vscodeChatCodeBlock) {
349
- return null;
350
- }
351
- const responseId = resource.path.split('/').at(1);
352
- if (!responseId) {
353
- return null;
354
- }
355
- const item = this.viewModel?.getItems().find(item => item.id === responseId);
356
- if (!item) {
357
- return null;
358
- }
359
- this.reveal(item);
360
- await timeout(0);
361
- for (const codeBlockPart of this.renderer.editorsInUse()) {
362
- if (extUri.isEqual(codeBlockPart.uri, resource, true)) {
363
- const editor = codeBlockPart.editor;
364
- let relativeTop = 0;
365
- const editorDomNode = editor.getDomNode();
366
- if (editorDomNode) {
367
- const row = findParentWithClass(editorDomNode, 'monaco-list-row');
368
- if (row) {
369
- relativeTop = getTopLeftOffset(editorDomNode).top - getTopLeftOffset(row).top;
378
+ this._register(
379
+ codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
380
+ const resource = input.resource;
381
+ if (resource.scheme !== Schemas.vscodeChatCodeBlock) {
382
+ return null;
383
+ }
384
+ const responseId = resource.path.split("/").at(1);
385
+ if (!responseId) {
386
+ return null;
387
+ }
388
+ const item = this.viewModel?.getItems().find(item => item.id === responseId);
389
+ if (!item) {
390
+ return null;
391
+ }
392
+ this.reveal(item);
393
+ await timeout(0);
394
+ for (const codeBlockPart of this.listWidget.editorsInUse()) {
395
+ if (extUri.isEqual(codeBlockPart.uri, resource, true)) {
396
+ const editor = codeBlockPart.editor;
397
+ let relativeTop = 0;
398
+ const editorDomNode = editor.getDomNode();
399
+ if (editorDomNode) {
400
+ const row = findParentWithClass(editorDomNode, "monaco-list-row");
401
+ if (row) {
402
+ relativeTop = getTopLeftOffset(editorDomNode).top - getTopLeftOffset(row).top;
403
+ }
370
404
  }
405
+ if (input.options?.selection) {
406
+ const editorSelectionTopOffset = editor.getTopForPosition(
407
+ input.options.selection.startLineNumber,
408
+ input.options.selection.startColumn
409
+ );
410
+ relativeTop += editorSelectionTopOffset;
411
+ editor.focus();
412
+ editor.setSelection({
413
+ startLineNumber: input.options.selection.startLineNumber,
414
+ startColumn: input.options.selection.startColumn,
415
+ endLineNumber: input.options.selection.endLineNumber ?? input.options.selection.startLineNumber,
416
+ endColumn: input.options.selection.endColumn ?? input.options.selection.startColumn
417
+ });
418
+ }
419
+ this.reveal(item, relativeTop);
420
+ return editor;
371
421
  }
372
- if (input.options?.selection) {
373
- const editorSelectionTopOffset = editor.getTopForPosition(input.options.selection.startLineNumber, input.options.selection.startColumn);
374
- relativeTop += editorSelectionTopOffset;
375
- editor.focus();
376
- editor.setSelection({
377
- startLineNumber: input.options.selection.startLineNumber,
378
- startColumn: input.options.selection.startColumn,
379
- endLineNumber: input.options.selection.endLineNumber ?? input.options.selection.startLineNumber,
380
- endColumn: input.options.selection.endColumn ?? input.options.selection.startColumn
381
- });
382
- }
383
- this.reveal(item, relativeTop);
384
- return editor;
385
422
  }
386
- }
387
- return null;
388
- }));
423
+ return null;
424
+ })
425
+ );
389
426
  this._register(this.onDidChangeParsedInput(() => this.updateChatInputContext()));
390
- this._register(this.chatTodoListService.onDidUpdateTodos((sessionResource) => {
427
+ this._register(this.chatTodoListService.onDidUpdateTodos(sessionResource => {
391
428
  if (isEqual(this.viewModel?.sessionResource, sessionResource)) {
392
429
  this.inputPart.renderChatTodoListWidget(sessionResource);
393
430
  }
@@ -415,7 +452,7 @@ let ChatWidget = class ChatWidget extends Disposable {
415
452
  return this._attachmentCapabilities;
416
453
  }
417
454
  get input() {
418
- return this.viewModel?.editing && this.configurationService.getValue('chat.editRequests') !== 'input' ? this.inlineInputPart : this.inputPart;
455
+ return this.viewModel?.editing && this.configurationService.getValue("chat.editRequests") !== "input" ? this.inlineInputPart : this.inputPart;
419
456
  }
420
457
  get inputPart() {
421
458
  return this.inputPartDisposable.value;
@@ -427,73 +464,87 @@ let ChatWidget = class ChatWidget extends Disposable {
427
464
  return this.input.inputEditor;
428
465
  }
429
466
  get contentHeight() {
430
- return this.input.contentHeight + this.tree.contentHeight + this.chatSuggestNextWidget.height;
467
+ return this.input.height.get() + this.listWidget.contentHeight + this.chatSuggestNextWidget.height;
431
468
  }
432
469
  get attachmentModel() {
433
470
  return this.input.attachmentModel;
434
471
  }
435
472
  render(parent) {
436
473
  const viewId = isIChatViewViewContext(this.viewContext) ? this.viewContext.viewId : undefined;
437
- this.editorOptions = this._register(this.instantiationService.createInstance(ChatEditorOptions, viewId, this.styles.listForeground, this.styles.inputEditorBackground, this.styles.resultEditorBackground));
474
+ this.editorOptions = this._register(this.instantiationService.createInstance(
475
+ ChatEditorOptions,
476
+ viewId,
477
+ this.styles.listForeground,
478
+ this.styles.inputEditorBackground,
479
+ this.styles.resultEditorBackground
480
+ ));
438
481
  const renderInputOnTop = this.viewOptions.renderInputOnTop ?? false;
439
482
  const renderFollowups = this.viewOptions.renderFollowups ?? !renderInputOnTop;
440
483
  const renderStyle = this.viewOptions.renderStyle;
441
484
  const renderInputToolbarBelowInput = this.viewOptions.renderInputToolbarBelowInput ?? false;
442
- this.container = append(parent, $('.interactive-session'));
443
- this.welcomeMessageContainer = append(this.container, $('.chat-welcome-view-container', { style: 'display: none' }));
444
- this._register(addStandardDisposableListener(this.welcomeMessageContainer, EventType.CLICK, () => this.focusInput()));
485
+ this.container = append(parent, $(".interactive-session"));
486
+ this.welcomeMessageContainer = append(this.container, $(".chat-welcome-view-container", {
487
+ style: "display: none"
488
+ }));
489
+ this._register(
490
+ addStandardDisposableListener(this.welcomeMessageContainer, EventType.CLICK, () => this.focusInput())
491
+ );
445
492
  this._register(this.chatSuggestNextWidget.onDidChangeHeight(() => {
446
493
  if (this.bodyDimension) {
447
494
  this.layout(this.bodyDimension.height, this.bodyDimension.width);
448
495
  }
449
496
  }));
450
- this._register(this.chatSuggestNextWidget.onDidSelectPrompt(({ handoff, agentId }) => {
497
+ this._register(this.chatSuggestNextWidget.onDidSelectPrompt((
498
+ {
499
+ handoff,
500
+ agentId
501
+ }
502
+ ) => {
451
503
  this.handleNextPromptSelection(handoff, agentId);
452
504
  }));
453
505
  if (renderInputOnTop) {
454
- this.createInput(this.container, { renderFollowups, renderStyle, renderInputToolbarBelowInput });
506
+ this.createInput(this.container, {
507
+ renderFollowups,
508
+ renderStyle,
509
+ renderInputToolbarBelowInput
510
+ });
455
511
  this.listContainer = append(this.container, $(`.interactive-list`));
456
- }
457
- else {
512
+ } else {
458
513
  this.listContainer = append(this.container, $(`.interactive-list`));
459
514
  append(this.container, this.chatSuggestNextWidget.domNode);
460
- this.createInput(this.container, { renderFollowups, renderStyle, renderInputToolbarBelowInput });
515
+ this.createInput(this.container, {
516
+ renderFollowups,
517
+ renderStyle,
518
+ renderInputToolbarBelowInput
519
+ });
461
520
  }
462
521
  this.renderWelcomeViewContentIfNeeded();
463
- this.createList(this.listContainer, { editable: !isInlineChat(this) && !isQuickChat(this), ...this.viewOptions.rendererOptions, renderStyle });
464
- const scrollDownButton = this._register(( new Button(this.listContainer, {
465
- supportIcons: true,
466
- buttonBackground: asCssVariable(buttonSecondaryBackground),
467
- buttonForeground: asCssVariable(buttonSecondaryForeground),
468
- buttonHoverBackground: asCssVariable(buttonSecondaryHoverBackground),
469
- })));
470
- scrollDownButton.element.classList.add('chat-scroll-down');
471
- scrollDownButton.label = `$(${Codicon.chevronDown.id})`;
472
- scrollDownButton.setTitle(( localize(5792, "Scroll down")));
473
- this._register(scrollDownButton.onDidClick(() => {
474
- this.scrollLock = true;
475
- this.scrollToEnd();
476
- }));
522
+ this.createList(this.listContainer, {
523
+ editable: !isInlineChat(this) && !isQuickChat(this),
524
+ ...this.viewOptions.rendererOptions,
525
+ renderStyle
526
+ });
477
527
  this._register(autorun(reader => {
478
528
  const fontFamily = this.chatLayoutService.fontFamily.read(reader);
479
529
  const fontSize = this.chatLayoutService.fontSize.read(reader);
480
- this.container.style.setProperty('--vscode-chat-font-family', fontFamily);
530
+ this.container.style.setProperty("--vscode-chat-font-family", fontFamily);
481
531
  this.container.style.fontSize = `${fontSize}px`;
482
532
  if (this.visible) {
483
- this.tree.rerender();
533
+ this.listWidget.rerender();
484
534
  }
485
535
  }));
486
- this._register(Event.runAndSubscribe(this.editorOptions.onDidChange, () => this.onDidStyleChange()));
536
+ this._register(
537
+ Event.runAndSubscribe(this.editorOptions.onDidChange, () => this.onDidStyleChange())
538
+ );
487
539
  if (this.viewModel) {
488
540
  this.onDidChangeItems();
489
- this.scrollToEnd();
541
+ this.listWidget.scrollToEnd();
490
542
  }
491
543
  this.contribs = ( ChatWidget_1.CONTRIBS.map(contrib => {
492
544
  try {
493
545
  return this._register(this.instantiationService.createInstance(contrib, this));
494
- }
495
- catch (err) {
496
- this.logService.error('Failed to instantiate chat widget contrib', toErrorMessage(err));
546
+ } catch (err) {
547
+ this.logService.error("Failed to instantiate chat widget contrib", toErrorMessage(err));
497
548
  return undefined;
498
549
  }
499
550
  })).filter(isDefined);
@@ -518,15 +569,7 @@ let ChatWidget = class ChatWidget extends Disposable {
518
569
  this.attachmentModel.updateContext(oldPromptAttachments, ( newPromptAttachments.values()));
519
570
  }));
520
571
  if (!this.focusedInputDOM) {
521
- this.focusedInputDOM = this.container.appendChild($$1('.focused-input-dom'));
522
- }
523
- }
524
- scrollToEnd() {
525
- if (this.lastItem) {
526
- const offset = Math.max(this.lastItem.currentRenderedHeight ?? 0, 1e6);
527
- if (this.tree.hasElement(this.lastItem)) {
528
- this.tree.reveal(this.lastItem, offset);
529
- }
572
+ this.focusedInputDOM = this.container.appendChild($$1(".focused-input-dom"));
530
573
  }
531
574
  }
532
575
  focusInput() {
@@ -540,8 +583,14 @@ let ChatWidget = class ChatWidget extends Disposable {
540
583
  if (!this.viewModel) {
541
584
  return;
542
585
  }
543
- this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, { selectedAgent: this._lastSelectedAgent, mode: this.input.currentModeKind });
544
- this._onDidChangeParsedInput.fire();
586
+ const previous = this.parsedChatRequest;
587
+ this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, {
588
+ selectedAgent: this._lastSelectedAgent,
589
+ mode: this.input.currentModeKind
590
+ });
591
+ if (!previous || !IParsedChatRequest.equals(previous, this.parsedChatRequest)) {
592
+ this._onDidChangeParsedInput.fire();
593
+ }
545
594
  }
546
595
  getSibling(item, type) {
547
596
  if (!isResponseVM(item)) {
@@ -556,14 +605,14 @@ let ChatWidget = class ChatWidget extends Disposable {
556
605
  if (targetIndex === undefined) {
557
606
  return;
558
607
  }
559
- const indexToFocus = type === 'next' ? targetIndex + 1 : targetIndex - 1;
608
+ const indexToFocus = type === "next" ? targetIndex + 1 : targetIndex - 1;
560
609
  if (indexToFocus < 0 || indexToFocus > responseItems.length - 1) {
561
610
  return;
562
611
  }
563
612
  return responseItems[indexToFocus];
564
613
  }
565
614
  async clear() {
566
- this.logService.debug('ChatWidget#clear');
615
+ this.logService.debug("ChatWidget#clear");
567
616
  if (this._dynamicMessageLayoutData) {
568
617
  this._dynamicMessageLayoutData.enabled = true;
569
618
  }
@@ -574,9 +623,12 @@ let ChatWidget = class ChatWidget extends Disposable {
574
623
  this.viewModel.resetInputPlaceholder();
575
624
  }
576
625
  if (this._lockedAgent) {
577
- this.lockToCodingAgent(this._lockedAgent.name, this._lockedAgent.displayName, this._lockedAgent.id);
578
- }
579
- else {
626
+ this.lockToCodingAgent(
627
+ this._lockedAgent.name,
628
+ this._lockedAgent.displayName,
629
+ this._lockedAgent.id
630
+ );
631
+ } else {
580
632
  this.unlockFromCodingAgent();
581
633
  }
582
634
  this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, true);
@@ -585,39 +637,15 @@ let ChatWidget = class ChatWidget extends Disposable {
585
637
  }
586
638
  onDidChangeItems(skipDynamicLayout) {
587
639
  if (this._visible || !this.viewModel) {
588
- const treeItems = ( (this.viewModel?.getItems() ?? [])
589
- .map((item) => {
590
- return {
591
- element: item,
592
- collapsed: false,
593
- collapsible: false
594
- };
595
- }));
596
- if (treeItems.length > 0) {
640
+ const items = this.viewModel?.getItems() ?? [];
641
+ if (items.length > 0) {
597
642
  this.updateChatViewVisibility();
598
- }
599
- else {
643
+ } else {
600
644
  this.renderWelcomeViewContentIfNeeded();
601
645
  }
602
646
  this._onWillMaybeChangeHeight.fire();
603
- this.lastItem = treeItems.at(-1)?.element;
604
- ChatContextKeys.lastItemId.bindTo(this.contextKeyService).set(this.lastItem ? [this.lastItem.id] : []);
605
- this.tree.setChildren(null, treeItems, {
606
- diffIdentityProvider: {
607
- getId: (element) => {
608
- return element.dataId +
609
- `${(isRequestVM(element)) }` +
610
- `${isResponseVM(element) && element.renderData ? `_${this.visibleChangeCount}` : ''}` +
611
- (isResponseVM(element) ? `_${element.contentReferences.length}` : '') +
612
- `_${element.shouldBeRemovedOnSend ? `${element.shouldBeRemovedOnSend.afterUndoStop || '1'}` : '0'}` +
613
- `_${element.shouldBeBlocked ? '1' : '0'}` +
614
- `_${this.viewModel?.editing ? '1' : '0'}` +
615
- `_${this.viewModel?.model.checkpoint ? '1' : '0'}` +
616
- `_setting${this.settingChangeCounter || '0'}` +
617
- (isRequestVM(element) && element.contentReferences ? `_${element.contentReferences?.length}` : '');
618
- },
619
- }
620
- });
647
+ this.listWidget.setVisibleChangeCount(this.visibleChangeCount);
648
+ this.listWidget.refresh();
621
649
  if (!skipDynamicLayout && this._dynamicMessageLayoutData) {
622
650
  this.layoutDynamicChatTreeItemMode();
623
651
  }
@@ -625,12 +653,11 @@ let ChatWidget = class ChatWidget extends Disposable {
625
653
  }
626
654
  }
627
655
  updateChatViewVisibility() {
628
- if (!this.viewModel) {
629
- return;
656
+ if (this.viewModel) {
657
+ const numItems = this.viewModel.getItems().length;
658
+ setVisibility(numItems === 0, this.welcomeMessageContainer);
659
+ setVisibility(numItems !== 0, this.listContainer);
630
660
  }
631
- const numItems = this.viewModel.getItems().length;
632
- setVisibility(numItems === 0, this.welcomeMessageContainer);
633
- setVisibility(numItems !== 0, this.listContainer);
634
661
  this._onDidChangeEmptyState.fire();
635
662
  }
636
663
  isEmpty() {
@@ -642,7 +669,7 @@ let ChatWidget = class ChatWidget extends Disposable {
642
669
  }
643
670
  this._isRenderingWelcome = true;
644
671
  try {
645
- if (this.viewOptions.renderStyle === 'compact' || this.viewOptions.renderStyle === 'minimal' || this.lifecycleService.willShutdown) {
672
+ if (this.viewOptions.renderStyle === "compact" || this.viewOptions.renderStyle === "minimal" || this.lifecycleService.willShutdown) {
646
673
  return;
647
674
  }
648
675
  const numItems = this.viewModel?.getItems().length ?? 0;
@@ -652,15 +679,16 @@ let ChatWidget = class ChatWidget extends Disposable {
652
679
  if (this.chatEntitlementService.anonymous && !this.chatEntitlementService.sentiment.installed) {
653
680
  const providers = product.defaultChatAgent.provider;
654
681
  additionalMessage = ( new MarkdownString(( localize(
655
- 5793,
682
+ 6048,
656
683
  "By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3}).",
657
684
  providers.default.name,
658
685
  providers.default.name,
659
686
  product.defaultChatAgent.termsStatementUrl,
660
687
  product.defaultChatAgent.privacyStatementUrl
661
- )), { isTrusted: true }));
662
- }
663
- else {
688
+ )), {
689
+ isTrusted: true
690
+ }));
691
+ } else {
664
692
  additionalMessage = defaultAgent?.metadata.additionalWelcomeMessage;
665
693
  }
666
694
  if (!additionalMessage && !this._lockedAgent) {
@@ -677,8 +705,7 @@ let ChatWidget = class ChatWidget extends Disposable {
677
705
  }
678
706
  }
679
707
  this.updateChatViewVisibility();
680
- }
681
- finally {
708
+ } finally {
682
709
  this._isRenderingWelcome = false;
683
710
  }
684
711
  }
@@ -694,17 +721,20 @@ let ChatWidget = class ChatWidget extends Disposable {
694
721
  }));
695
722
  }
696
723
  if (this._instructionFilesExist === true) {
697
- return ( new MarkdownString(''));
698
- }
699
- else if (this._instructionFilesExist === false) {
700
- const generateInstructionsCommand = 'workbench.action.chat.generateInstructions';
724
+ return ( new MarkdownString(""));
725
+ } else if (this._instructionFilesExist === false) {
726
+ const generateInstructionsCommand = "workbench.action.chat.generateInstructions";
701
727
  return (new MarkdownString(localize(
702
- 5794,
728
+ 6049,
703
729
  "[Generate Agent Instructions]({0}) to onboard AI onto your codebase.",
704
730
  `command:${generateInstructionsCommand}`
705
- ), { isTrusted: { enabledCommands: [generateInstructionsCommand] } }));
731
+ ), {
732
+ isTrusted: {
733
+ enabledCommands: [generateInstructionsCommand]
734
+ }
735
+ }));
706
736
  }
707
- return ( new MarkdownString(''));
737
+ return ( new MarkdownString(""));
708
738
  }
709
739
  async _checkForAgentInstructionFiles() {
710
740
  try {
@@ -714,10 +744,9 @@ let ChatWidget = class ChatWidget extends Disposable {
714
744
  return true;
715
745
  }
716
746
  return ((await this.promptsService.listCopilotInstructionsMDs(CancellationToken.None)).length > 0 ||
717
- (await this.promptsService.listAgentMDs(CancellationToken.None, false)).length > 0);
718
- }
719
- catch (error) {
720
- this.logService.warn('[ChatWidget] Error checking for instruction files:', error);
747
+ (await this.promptsService.listAgentMDs(CancellationToken.None, false)).length > 0);
748
+ } catch (error) {
749
+ this.logService.warn("[ChatWidget] Error checking for instruction files:", error);
721
750
  return false;
722
751
  }
723
752
  }
@@ -726,37 +755,33 @@ let ChatWidget = class ChatWidget extends Disposable {
726
755
  const providerIcon = this._lockedAgent ? this.chatSessionsService.getIconForSessionType(this._lockedAgent.id) : undefined;
727
756
  const providerTitle = this._lockedAgent ? this.chatSessionsService.getWelcomeTitleForSessionType(this._lockedAgent.id) : undefined;
728
757
  const providerMessage = this._lockedAgent ? this.chatSessionsService.getWelcomeMessageForSessionType(this._lockedAgent.id) : undefined;
729
- const message = providerMessage
730
- ? ( new MarkdownString(providerMessage))
731
- : (this._lockedAgent?.prefix === '@copilot '
732
- ? ( new MarkdownString(( localize(
733
- 5795,
758
+ const message = providerMessage ? ( new MarkdownString(providerMessage)) : (this._lockedAgent?.prefix === "@copilot " ? ( new MarkdownString(( localize(
759
+ 6050,
734
760
  "This chat session will be forwarded to the {0} [coding agent]({1}) where work is completed in the background. ",
735
761
  this._lockedAgent.prefix,
736
- 'https://aka.ms/coding-agent-docs'
737
- )) + DISCLAIMER, { isTrusted: true }))
738
- : ( new MarkdownString(( localize(
739
- 5796,
762
+ "https://aka.ms/coding-agent-docs"
763
+ )) + DISCLAIMER, {
764
+ isTrusted: true
765
+ })) : ( new MarkdownString(( localize(
766
+ 6051,
740
767
  "This chat session will be forwarded to the {0} coding agent where work is completed in the background. ",
741
768
  this._lockedAgent?.prefix
742
769
  )) + DISCLAIMER)));
743
770
  return {
744
- title: providerTitle ?? ( localize(5797, "Delegate to {0}", this._lockedAgent?.prefix)),
771
+ title: providerTitle ?? ( localize(6052, "Delegate to {0}", this._lockedAgent?.prefix)),
745
772
  message,
746
773
  icon: providerIcon ?? Codicon.sendToRemoteAgent,
747
774
  additionalMessage,
748
- useLargeIcon: !!providerIcon,
775
+ useLargeIcon: !!providerIcon
749
776
  };
750
777
  }
751
778
  let title;
752
779
  if (this.input.currentModeKind === ChatModeKind.Ask) {
753
- title = ( localize(5798, "Ask about your code"));
754
- }
755
- else if (this.input.currentModeKind === ChatModeKind.Edit) {
756
- title = ( localize(5799, "Edit in context"));
757
- }
758
- else {
759
- title = ( localize(5800, "Build with Agent"));
780
+ title = ( localize(6053, "Ask about your code"));
781
+ } else if (this.input.currentModeKind === ChatModeKind.Edit) {
782
+ title = ( localize(6054, "Edit in context"));
783
+ } else {
784
+ title = ( localize(6055, "Build with Agent"));
760
785
  }
761
786
  return {
762
787
  title,
@@ -770,32 +795,25 @@ let ChatWidget = class ChatWidget extends Disposable {
770
795
  if (!this.chatEntitlementService.sentiment.installed) {
771
796
  const isEmpty = this.contextService.getWorkbenchState() === WorkbenchState.EMPTY;
772
797
  if (isEmpty) {
773
- return [
774
- {
775
- icon: Codicon.vscode,
776
- label: ( localize(5801, "Ask @vscode")),
777
- prompt: ( localize(5802, "@vscode How do I change the theme to light mode?")),
778
- },
779
- {
780
- icon: Codicon.newFolder,
781
- label: ( localize(5803, "Create Project")),
782
- prompt: ( localize(5804, "Create a #new Hello World project in TypeScript")),
783
- }
784
- ];
785
- }
786
- else {
787
- return [
788
- {
789
- icon: Codicon.debugAlt,
790
- label: ( localize(5805, "Build Workspace")),
791
- prompt: ( localize(5806, "How do I build this workspace?")),
792
- },
793
- {
794
- icon: Codicon.gear,
795
- label: ( localize(5807, "Show Config")),
796
- prompt: ( localize(5808, "Where is the configuration for this project defined?")),
797
- }
798
- ];
798
+ return [{
799
+ icon: Codicon.vscode,
800
+ label: ( localize(6056, "Ask @vscode")),
801
+ prompt: ( localize(6057, "@vscode How do I change the theme to light mode?"))
802
+ }, {
803
+ icon: Codicon.newFolder,
804
+ label: ( localize(6058, "Create Project")),
805
+ prompt: ( localize(6059, "Create a #new Hello World project in TypeScript"))
806
+ }];
807
+ } else {
808
+ return [{
809
+ icon: Codicon.debugAlt,
810
+ label: ( localize(6060, "Build Workspace")),
811
+ prompt: ( localize(6061, "How do I build this workspace?"))
812
+ }, {
813
+ icon: Codicon.gear,
814
+ label: ( localize(6062, "Show Config")),
815
+ prompt: ( localize(6063, "Where is the configuration for this project defined?"))
816
+ }];
799
817
  }
800
818
  }
801
819
  const activeEditor = this.editorService.activeEditor;
@@ -819,10 +837,10 @@ let ChatWidget = class ChatWidget extends Disposable {
819
837
  const promptsWithScores = [];
820
838
  for (const [promptName, condition] of Object.entries(suggestions)) {
821
839
  let score = 0;
822
- if (typeof condition === 'boolean') {
840
+ if (typeof condition === "boolean") {
823
841
  score = condition ? 1 : 0;
824
842
  }
825
- else if (typeof condition === 'string') {
843
+ else if (typeof condition === "string") {
826
844
  try {
827
845
  const whenClause = ContextKeyExpr.deserialize(condition);
828
846
  if (whenClause) {
@@ -832,35 +850,41 @@ let ChatWidget = class ChatWidget extends Disposable {
832
850
  try {
833
851
  const editorContext = this.contextKeyService.getContext(editor.getDomNode());
834
852
  return count + (whenClause.evaluate(editorContext) ? 1 : 0);
835
- }
836
- catch (error) {
837
- this.logService.warn('Failed to evaluate when clause for editor:', error);
853
+ } catch (error) {
854
+ this.logService.warn("Failed to evaluate when clause for editor:", error);
838
855
  return count;
839
856
  }
840
857
  }, 0);
841
- }
842
- else {
858
+ } else {
843
859
  score = this.contextKeyService.contextMatchesRules(whenClause) ? 1 : 0;
844
860
  }
845
- }
846
- else {
861
+ } else {
847
862
  score = 0;
848
863
  }
849
- }
850
- catch (error) {
851
- this.logService.warn('Failed to parse when clause for prompt file suggestion:', condition, error);
864
+ } catch (error) {
865
+ this.logService.warn(
866
+ "Failed to parse when clause for prompt file suggestion:",
867
+ condition,
868
+ error
869
+ );
852
870
  score = 0;
853
871
  }
854
872
  }
855
873
  if (score > 0) {
856
- promptsWithScores.push({ promptName, condition, score });
874
+ promptsWithScores.push({
875
+ promptName,
876
+ condition,
877
+ score
878
+ });
857
879
  }
858
880
  }
859
881
  promptsWithScores.sort((a, b) => b.score - a.score);
860
882
  const topPrompts = promptsWithScores.slice(0, 5);
861
- for (const { promptName } of topPrompts) {
883
+ for (const {
884
+ promptName
885
+ } of topPrompts) {
862
886
  const description = this.promptDescriptionsCache.get(promptName);
863
- const commandLabel = ( localize(5809, "{0}", promptName));
887
+ const commandLabel = ( localize(6064, "{0}", promptName));
864
888
  const uri = this.promptUriCache.get(promptName);
865
889
  const descriptionText = description?.trim() ? description : undefined;
866
890
  result.push({
@@ -887,9 +911,8 @@ let ChatWidget = class ChatWidget extends Disposable {
887
911
  if (description) {
888
912
  this.promptDescriptionsCache.set(promptCommand.name, description);
889
913
  cacheUpdated = true;
890
- }
891
- else {
892
- this.promptDescriptionsCache.set(promptCommand.name, '');
914
+ } else {
915
+ this.promptDescriptionsCache.set(promptCommand.name, "");
893
916
  cacheUpdated = true;
894
917
  }
895
918
  }
@@ -897,11 +920,9 @@ let ChatWidget = class ChatWidget extends Disposable {
897
920
  if (cacheUpdated) {
898
921
  this.renderWelcomeViewContentIfNeeded();
899
922
  }
900
- }
901
- catch (error) {
902
- this.logService.warn('Failed to load specific prompt descriptions:', error);
903
- }
904
- finally {
923
+ } catch (error) {
924
+ this.logService.warn("Failed to load specific prompt descriptions:", error);
925
+ } finally {
905
926
  this._isLoadingPromptDescriptions = false;
906
927
  }
907
928
  }
@@ -910,20 +931,14 @@ let ChatWidget = class ChatWidget extends Disposable {
910
931
  return;
911
932
  }
912
933
  this.input.renderChatEditingSessionState(this._editingSession.get() ?? null);
913
- if (this.bodyDimension) {
914
- this.layout(this.bodyDimension.height, this.bodyDimension.width);
915
- }
916
934
  }
917
935
  async renderFollowups() {
918
- if (this.lastItem && isResponseVM(this.lastItem) && this.lastItem.isComplete) {
919
- this.input.renderFollowups(this.lastItem.replyFollowups, this.lastItem);
920
- }
921
- else {
936
+ const lastItem = this.listWidget.lastItem;
937
+ if (lastItem && isResponseVM(lastItem) && lastItem.isComplete) {
938
+ this.input.renderFollowups(lastItem.replyFollowups, lastItem);
939
+ } else {
922
940
  this.input.renderFollowups(undefined, undefined);
923
941
  }
924
- if (this.bodyDimension) {
925
- this.layout(this.bodyDimension.height, this.bodyDimension.width);
926
- }
927
942
  }
928
943
  renderChatSuggestNextWidget() {
929
944
  if (this.lifecycleService.willShutdown) {
@@ -946,16 +961,15 @@ let ChatWidget = class ChatWidget extends Disposable {
946
961
  const handoffs = currentMode?.handOffs?.get();
947
962
  const shouldShow = currentMode && handoffs && handoffs.length > 0;
948
963
  if (shouldShow) {
949
- const wasHidden = this.chatSuggestNextWidget.domNode.style.display === 'none';
964
+ const wasHidden = this.chatSuggestNextWidget.domNode.style.display === "none";
950
965
  this.chatSuggestNextWidget.render(currentMode);
951
966
  if (wasHidden) {
952
- this.telemetryService.publicLog2('chat.handoffWidgetShown', {
967
+ this.telemetryService.publicLog2("chat.handoffWidgetShown", {
953
968
  agent: currentMode.id,
954
969
  handoffCount: handoffs.length
955
970
  });
956
971
  }
957
- }
958
- else {
972
+ } else {
959
973
  this.chatSuggestNextWidget.hide();
960
974
  }
961
975
  if (this.bodyDimension) {
@@ -966,20 +980,22 @@ let ChatWidget = class ChatWidget extends Disposable {
966
980
  this.chatSuggestNextWidget.hide();
967
981
  const promptToUse = handoff.prompt;
968
982
  const currentMode = this.input.currentModeObs.get();
969
- const fromAgent = currentMode?.id ?? '';
970
- this.telemetryService.publicLog2('chat.handoffClicked', {
983
+ const fromAgent = currentMode?.id ?? "";
984
+ this.telemetryService.publicLog2("chat.handoffClicked", {
971
985
  fromAgent: fromAgent,
972
- toAgent: agentId || handoff.agent || '',
986
+ toAgent: agentId || handoff.agent || "",
973
987
  hasPrompt: Boolean(promptToUse),
974
988
  autoSend: Boolean(handoff.send)
975
989
  });
976
990
  if (agentId) {
977
991
  this.input.setValue(`@${agentId} ${promptToUse}`, false);
978
992
  this.input.focus();
979
- this.acceptInput().catch(e => this.logService.error('Failed to handle handoff continueOn', e));
980
- }
981
- else if (handoff.agent) {
993
+ this.acceptInput().catch(e => this.logService.error("Failed to handle handoff continueOn", e));
994
+ } else if (handoff.agent) {
982
995
  this._switchToAgentByName(handoff.agent);
996
+ if (handoff.model) {
997
+ this.input.switchModelByQualifiedName([handoff.model]);
998
+ }
983
999
  this.input.setValue(promptToUse, false);
984
1000
  this.input.focus();
985
1001
  if (handoff.send) {
@@ -993,9 +1009,8 @@ let ChatWidget = class ChatWidget extends Disposable {
993
1009
  }
994
1010
  try {
995
1011
  await this._handleDelegationExit();
996
- }
997
- catch (e) {
998
- this.logService.error('Failed to handle delegation exit', e);
1012
+ } catch (e) {
1013
+ this.logService.error("Failed to handle delegation exit", e);
999
1014
  }
1000
1015
  }
1001
1016
  _shouldExitAfterDelegation(sourceAgent, targetAgent) {
@@ -1074,7 +1089,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1074
1089
  const wasVisible = this._visible;
1075
1090
  this._visible = visible;
1076
1091
  this.visibleChangeCount++;
1077
- this.renderer.setVisible(visible);
1092
+ this.listWidget.setVisible(visible);
1078
1093
  this.input.setVisible(visible);
1079
1094
  if (visible) {
1080
1095
  if (!wasVisible) {
@@ -1087,118 +1102,67 @@ let ChatWidget = class ChatWidget extends Disposable {
1087
1102
  this._onDidShow.fire();
1088
1103
  });
1089
1104
  }
1090
- }
1091
- else if (wasVisible) {
1105
+ } else if (wasVisible) {
1092
1106
  this._onDidHide.fire();
1093
1107
  }
1094
1108
  }
1095
1109
  createList(listContainer, options) {
1096
- const scopedInstantiationService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.contextKeyService]))));
1097
- const delegate = scopedInstantiationService.createInstance(ChatListDelegate, this.viewOptions.defaultElementHeight ?? 200);
1098
- const rendererDelegate = {
1099
- getListLength: () => this.tree.getNode(null).visibleChildrenCount,
1100
- onDidScroll: this.onDidScroll,
1101
- container: listContainer,
1102
- currentChatMode: () => this.input.currentModeKind,
1103
- };
1104
- const overflowWidgetsContainer = createElement('div');
1105
- overflowWidgetsContainer.classList.add('chat-overflow-widget-container', 'monaco-editor');
1110
+ const overflowWidgetsContainer = createElement("div");
1111
+ overflowWidgetsContainer.classList.add("chat-overflow-widget-container", "monaco-editor");
1106
1112
  listContainer.append(overflowWidgetsContainer);
1107
- this.renderer = this._register(scopedInstantiationService.createInstance(ChatListItemRenderer, this.editorOptions, options, rendererDelegate, this._codeBlockModelCollection, overflowWidgetsContainer, this.viewModel));
1108
- this._register(this.renderer.onDidClickRequest(async (item) => {
1113
+ this.listWidget = this._register(this.instantiationService.createInstance(ChatListWidget, listContainer, {
1114
+ rendererOptions: options,
1115
+ renderStyle: this.viewOptions.renderStyle,
1116
+ defaultElementHeight: this.viewOptions.defaultElementHeight ?? 200,
1117
+ overflowWidgetsDomNode: overflowWidgetsContainer,
1118
+ styles: {
1119
+ listForeground: this.styles.listForeground,
1120
+ listBackground: this.styles.listBackground
1121
+ },
1122
+ currentChatMode: () => this.input.currentModeKind,
1123
+ filter: this.viewOptions.filter ? {
1124
+ filter: this.viewOptions.filter.bind(this.viewOptions)
1125
+ } : undefined,
1126
+ codeBlockModelCollection: this._codeBlockModelCollection,
1127
+ viewModel: this.viewModel,
1128
+ editorOptions: this.editorOptions,
1129
+ location: this.location,
1130
+ getCurrentLanguageModelId: () => this.input.currentLanguageModel,
1131
+ getCurrentModeInfo: () => this.input.currentModeInfo
1132
+ }));
1133
+ this._register(this.listWidget.onDidClickRequest(async item => {
1109
1134
  this.clickedRequest(item);
1110
1135
  }));
1111
- this._register(this.renderer.onDidRerender(item => {
1112
- if (isRequestVM(item.currentElement) && this.configurationService.getValue('chat.editRequests') !== 'input') {
1136
+ this._register(this.listWidget.onDidRerender(item => {
1137
+ if (isRequestVM(item.currentElement) && this.configurationService.getValue("chat.editRequests") !== "input") {
1113
1138
  if (!item.rowContainer.contains(this.inputContainer)) {
1114
1139
  item.rowContainer.appendChild(this.inputContainer);
1115
1140
  }
1116
1141
  this.input.focus();
1117
1142
  }
1118
1143
  }));
1119
- this._register(this.renderer.onDidDispose((item) => {
1144
+ this._register(this.listWidget.onDidDispose(() => {
1120
1145
  this.focusedInputDOM.appendChild(this.inputContainer);
1121
1146
  this.input.focus();
1122
1147
  }));
1123
- this._register(this.renderer.onDidFocusOutside(() => {
1148
+ this._register(this.listWidget.onDidFocusOutside(() => {
1124
1149
  this.finishedEditing();
1125
1150
  }));
1126
- this._register(this.renderer.onDidClickFollowup(item => {
1151
+ this._register(this.listWidget.onDidClickFollowup(item => {
1127
1152
  this.acceptInput(item.message);
1128
1153
  }));
1129
- this._register(this.renderer.onDidClickRerunWithAgentOrCommandDetection(e => {
1130
- const request = this.chatService.getSession(e.sessionResource)?.getRequests().find(candidate => candidate.id === e.requestId);
1131
- if (request) {
1132
- const options = {
1133
- noCommandDetection: true,
1134
- attempt: request.attempt + 1,
1135
- location: this.location,
1136
- userSelectedModelId: this.input.currentLanguageModel,
1137
- modeInfo: this.input.currentModeInfo,
1138
- };
1139
- this.chatService.resendRequest(request, options).catch(e => this.logService.error('FAILED to rerun request', e));
1140
- }
1141
- }));
1142
- this.tree = this._register(scopedInstantiationService.createInstance((WorkbenchObjectTree), 'Chat', listContainer, delegate, [this.renderer], {
1143
- identityProvider: { getId: (e) => e.id },
1144
- horizontalScrolling: false,
1145
- alwaysConsumeMouseWheel: false,
1146
- supportDynamicHeights: true,
1147
- hideTwistiesOfChildlessElements: true,
1148
- accessibilityProvider: this.instantiationService.createInstance(ChatAccessibilityProvider),
1149
- keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e) => isRequestVM(e) ? e.message : isResponseVM(e) ? e.response.value : '' },
1150
- setRowLineHeight: false,
1151
- filter: this.viewOptions.filter ? { filter: this.viewOptions.filter.bind(this.viewOptions), } : undefined,
1152
- scrollToActiveElement: true,
1153
- overrideStyles: {
1154
- listFocusBackground: this.styles.listBackground,
1155
- listInactiveFocusBackground: this.styles.listBackground,
1156
- listActiveSelectionBackground: this.styles.listBackground,
1157
- listFocusAndSelectionBackground: this.styles.listBackground,
1158
- listInactiveSelectionBackground: this.styles.listBackground,
1159
- listHoverBackground: this.styles.listBackground,
1160
- listBackground: this.styles.listBackground,
1161
- listFocusForeground: this.styles.listForeground,
1162
- listHoverForeground: this.styles.listForeground,
1163
- listInactiveFocusForeground: this.styles.listForeground,
1164
- listInactiveSelectionForeground: this.styles.listForeground,
1165
- listActiveSelectionForeground: this.styles.listForeground,
1166
- listFocusAndSelectionForeground: this.styles.listForeground,
1167
- listActiveSelectionIconForeground: undefined,
1168
- listInactiveSelectionIconForeground: undefined,
1169
- }
1170
- }));
1171
- this._register(this.tree.onDidChangeFocus(() => {
1172
- const focused = this.tree.getFocus();
1173
- if (focused && focused.length > 0) {
1174
- const focusedItem = focused[0];
1175
- const items = this.tree.getNode(null).children;
1176
- const idx = items.findIndex(i => i.element === focusedItem);
1177
- if (idx !== -1) {
1178
- this._mostRecentlyFocusedItemIndex = idx;
1179
- }
1180
- }
1181
- }));
1182
- this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
1183
- this._register(this.tree.onDidChangeContentHeight(() => {
1184
- this.onDidChangeTreeContentHeight();
1185
- }));
1186
- this._register(this.renderer.onDidChangeItemHeight(e => {
1187
- if (this.tree.hasElement(e.element) && this.visible) {
1188
- this.tree.updateElementHeight(e.element, e.height);
1189
- }
1154
+ this._register(this.listWidget.onDidChangeContentHeight(() => {
1155
+ this._onDidChangeContentHeight.fire();
1190
1156
  }));
1191
- this._register(this.tree.onDidFocus(() => {
1157
+ this._register(this.listWidget.onDidFocus(() => {
1192
1158
  this._onDidFocus.fire();
1193
1159
  }));
1194
- this._register(this.tree.onDidScroll(() => {
1160
+ this._register(this.listWidget.onDidScroll(() => {
1195
1161
  this._onDidScroll.fire();
1196
- const isScrolledDown = this.tree.scrollTop >= this.tree.scrollHeight - this.tree.renderHeight - 2;
1197
- this.container.classList.toggle('show-scroll-down', !isScrolledDown && !this.scrollLock);
1198
1162
  }));
1199
1163
  }
1200
1164
  startEditing(requestId) {
1201
- const editedRequest = this.renderer.getTemplateDataForRequestId(requestId);
1165
+ const editedRequest = this.listWidget.getTemplateDataForRequestId(requestId);
1202
1166
  if (editedRequest) {
1203
1167
  this.clickedRequest(editedRequest);
1204
1168
  }
@@ -1216,7 +1180,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1216
1180
  this.viewModel?.model.setCheckpoint(currentElement.id);
1217
1181
  const currentContext = [];
1218
1182
  const addedContextIds = ( new Set());
1219
- const addToContext = (entry) => {
1183
+ const addToContext = entry => {
1220
1184
  if (( addedContextIds.has(entry.id)) || isWorkspaceVariableEntry(entry)) {
1221
1185
  return;
1222
1186
  }
@@ -1229,7 +1193,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1229
1193
  for (let i = requests.length - 1; i >= 0; i -= 1) {
1230
1194
  const request = requests[i];
1231
1195
  if (request.id === currentElement.id) {
1232
- request.shouldBeBlocked = false;
1196
+ request.setShouldBeBlocked(false);
1233
1197
  request.attachedContext?.forEach(addToContext);
1234
1198
  currentElement.variables.forEach(addToContext);
1235
1199
  }
@@ -1238,17 +1202,16 @@ let ChatWidget = class ChatWidget extends Disposable {
1238
1202
  if (item?.contextKeyService) {
1239
1203
  ChatContextKeys.currentlyEditing.bindTo(item.contextKeyService).set(true);
1240
1204
  }
1241
- const isInput = this.configurationService.getValue('chat.editRequests') === 'input';
1205
+ const isInput = this.configurationService.getValue("chat.editRequests") === "input";
1242
1206
  this.inputPart?.setEditing(!!this.viewModel?.editing && isInput);
1243
1207
  if (!isInput) {
1244
1208
  const rowContainer = item.rowContainer;
1245
- this.inputContainer = $$1('.chat-edit-input-container');
1209
+ this.inputContainer = $$1(".chat-edit-input-container");
1246
1210
  rowContainer.appendChild(this.inputContainer);
1247
1211
  this.createInput(this.inputContainer);
1248
1212
  this.input.setChatMode(this.inputPart.currentModeObs.get().id);
1249
- }
1250
- else {
1251
- this.inputPart.element.classList.add('editing');
1213
+ } else {
1214
+ this.inputPart.element.classList.add("editing");
1252
1215
  }
1253
1216
  this.inputPart.toggleChatInputOverlay(!isInput);
1254
1217
  if (currentContext.length > 0) {
@@ -1257,43 +1220,41 @@ let ChatWidget = class ChatWidget extends Disposable {
1257
1220
  this.inputPart.dnd.setDisabledOverlay(!isInput);
1258
1221
  this.input.renderAttachedContext();
1259
1222
  this.input.setValue(currentElement.messageText, false);
1260
- this.renderer.updateItemHeightOnRender(currentElement, item);
1261
1223
  this.onDidChangeItems();
1262
1224
  this.input.inputEditor.focus();
1263
1225
  this._register(this.inputPart.onDidClickOverlay(() => {
1264
- if (this.viewModel?.editing && this.configurationService.getValue('chat.editRequests') !== 'input') {
1226
+ if (this.viewModel?.editing && this.configurationService.getValue("chat.editRequests") !== "input") {
1265
1227
  this.finishedEditing();
1266
1228
  }
1267
1229
  }));
1268
1230
  if (!isInput) {
1269
1231
  this._register(this.inlineInputPart.inputEditor.onDidChangeModelContent(() => {
1270
- this.scrollToCurrentItem(currentElement);
1232
+ this.listWidget.scrollToCurrentItem(currentElement);
1271
1233
  }));
1272
- this._register(this.inlineInputPart.inputEditor.onDidChangeCursorSelection((e) => {
1273
- this.scrollToCurrentItem(currentElement);
1234
+ this._register(this.inlineInputPart.inputEditor.onDidChangeCursorSelection(e => {
1235
+ this.listWidget.scrollToCurrentItem(currentElement);
1274
1236
  }));
1275
1237
  }
1276
1238
  }
1277
- this.telemetryService.publicLog2('chat.startEditingRequests', {
1278
- editRequestType: this.configurationService.getValue('chat.editRequests'),
1239
+ this.telemetryService.publicLog2("chat.startEditingRequests", {
1240
+ editRequestType: this.configurationService.getValue("chat.editRequests")
1279
1241
  });
1280
1242
  }
1281
1243
  finishedEditing(completedEdit) {
1282
- const editedRequest = this.renderer.getTemplateDataForRequestId(this.viewModel?.editing?.id);
1244
+ const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
1283
1245
  if (this.recentlyRestoredCheckpoint) {
1284
1246
  this.recentlyRestoredCheckpoint = false;
1285
- }
1286
- else {
1247
+ } else {
1287
1248
  this.viewModel?.model.setCheckpoint(undefined);
1288
1249
  }
1289
1250
  this.inputPart.dnd.setDisabledOverlay(false);
1290
1251
  if (editedRequest?.contextKeyService) {
1291
1252
  ChatContextKeys.currentlyEditing.bindTo(editedRequest.contextKeyService).set(false);
1292
1253
  }
1293
- const isInput = this.configurationService.getValue('chat.editRequests') === 'input';
1254
+ const isInput = this.configurationService.getValue("chat.editRequests") === "input";
1294
1255
  if (!isInput) {
1295
1256
  this.inputPart.setChatMode(this.input.currentModeObs.get().id);
1296
- const currentModel = this.input.selectedLanguageModel;
1257
+ const currentModel = this.input.selectedLanguageModel.get();
1297
1258
  if (currentModel) {
1298
1259
  this.inputPart.switchModel(currentModel.metadata);
1299
1260
  }
@@ -1301,116 +1262,78 @@ let ChatWidget = class ChatWidget extends Disposable {
1301
1262
  try {
1302
1263
  if (editedRequest?.rowContainer?.contains(this.inputContainer)) {
1303
1264
  editedRequest.rowContainer.removeChild(this.inputContainer);
1304
- }
1305
- else if (this.inputContainer.parentElement) {
1265
+ } else if (this.inputContainer.parentElement) {
1306
1266
  this.inputContainer.parentElement.removeChild(this.inputContainer);
1307
1267
  }
1268
+ } catch (e) {
1269
+ this.logService.error("Error occurred while finishing editing:", e);
1308
1270
  }
1309
- catch (e) {
1310
- this.logService.error('Error occurred while finishing editing:', e);
1311
- }
1312
- this.inputContainer = $$1('.empty-chat-state');
1271
+ this.inputContainer = $$1(".empty-chat-state");
1313
1272
  this.input.dispose();
1314
1273
  }
1315
1274
  if (isInput) {
1316
- this.inputPart.element.classList.remove('editing');
1275
+ this.inputPart.element.classList.remove("editing");
1317
1276
  }
1318
1277
  this.viewModel?.setEditing(undefined);
1319
1278
  this.inputPart?.setEditing(!!this.viewModel?.editing && isInput);
1320
1279
  this.onDidChangeItems();
1321
- if (editedRequest?.currentElement) {
1322
- this.renderer.updateItemHeightOnRender(editedRequest.currentElement, editedRequest);
1323
- }
1324
- this.telemetryService.publicLog2('chat.editRequestsFinished', {
1325
- editRequestType: this.configurationService.getValue('chat.editRequests'),
1280
+ this.telemetryService.publicLog2("chat.editRequestsFinished", {
1281
+ editRequestType: this.configurationService.getValue("chat.editRequests"),
1326
1282
  editCanceled: !completedEdit
1327
1283
  });
1328
1284
  this.inputPart.focus();
1329
1285
  }
1330
- scrollToCurrentItem(currentElement) {
1331
- if (this.viewModel?.editing && currentElement) {
1332
- const element = currentElement;
1333
- if (!this.tree.hasElement(element)) {
1334
- return;
1335
- }
1336
- const relativeTop = this.tree.getRelativeTop(element);
1337
- if (relativeTop === null || relativeTop < 0 || relativeTop > 1) {
1338
- this.tree.reveal(element, 0);
1339
- }
1340
- }
1341
- }
1342
- onContextMenu(e) {
1343
- e.browserEvent.preventDefault();
1344
- e.browserEvent.stopPropagation();
1345
- const selected = e.element;
1346
- const target = e.browserEvent.target;
1347
- const isKatexElement = target.closest(`.${katexContainerClassName}`) !== null;
1348
- const scopedContextKeyService = this.contextKeyService.createOverlay([
1349
- [ChatContextKeys.responseIsFiltered.key, isResponseVM(selected) && !!selected.errorDetails?.responseIsFiltered],
1350
- [ChatContextKeys.isKatexMathElement.key, isKatexElement]
1351
- ]);
1352
- this.contextMenuService.showContextMenu({
1353
- menuId: MenuId.ChatContext,
1354
- menuActionOptions: { shouldForwardArgs: true },
1355
- contextKeyService: scopedContextKeyService,
1356
- getAnchor: () => e.anchor,
1357
- getActionsContext: () => selected,
1358
- });
1359
- }
1360
- onDidChangeTreeContentHeight() {
1361
- if (this.tree.scrollHeight !== this.previousTreeScrollHeight) {
1362
- const lastItem = this.viewModel?.getItems().at(-1);
1363
- const lastResponseIsRendering = isResponseVM(lastItem) && lastItem.renderData;
1364
- if (!lastResponseIsRendering || this.scrollLock) {
1365
- const lastElementWasVisible = this.tree.scrollTop + this.tree.renderHeight >= this.previousTreeScrollHeight - 2;
1366
- if (lastElementWasVisible) {
1367
- this.scrollAnimationFrameDisposable.value = scheduleAtNextAnimationFrame(getWindow(this.listContainer), () => {
1368
- this.scrollToEnd();
1369
- }, 0);
1370
- }
1371
- }
1372
- }
1373
- this.previousTreeScrollHeight = this.tree.scrollHeight;
1374
- this._onDidChangeContentHeight.fire();
1375
- }
1376
1286
  getWidgetViewKindTag() {
1377
1287
  if (!this.viewContext) {
1378
- return 'editor';
1379
- }
1380
- else if (isIChatViewViewContext(this.viewContext)) {
1381
- return 'view';
1382
- }
1383
- else {
1384
- return 'quick';
1288
+ return "editor";
1289
+ } else if (isIChatViewViewContext(this.viewContext)) {
1290
+ return "view";
1291
+ } else {
1292
+ return "quick";
1385
1293
  }
1386
1294
  }
1387
1295
  createInput(container, options) {
1388
1296
  const commonConfig = {
1389
1297
  renderFollowups: options?.renderFollowups ?? true,
1390
- renderStyle: options?.renderStyle === 'minimal' ? 'compact' : options?.renderStyle,
1298
+ renderStyle: options?.renderStyle === "minimal" ? "compact" : options?.renderStyle,
1391
1299
  renderInputToolbarBelowInput: options?.renderInputToolbarBelowInput ?? false,
1392
1300
  menus: {
1393
1301
  executeToolbar: MenuId.ChatExecute,
1394
- telemetrySource: 'chatWidget',
1302
+ telemetrySource: "chatWidget",
1395
1303
  ...this.viewOptions.menus
1396
1304
  },
1397
1305
  editorOverflowWidgetsDomNode: this.viewOptions.editorOverflowWidgetsDomNode,
1398
1306
  enableImplicitContext: this.viewOptions.enableImplicitContext,
1399
- renderWorkingSet: this.viewOptions.enableWorkingSet === 'explicit',
1307
+ renderWorkingSet: this.viewOptions.enableWorkingSet === "explicit",
1400
1308
  supportsChangingModes: this.viewOptions.supportsChangingModes,
1401
1309
  dndContainer: this.viewOptions.dndContainer,
1402
1310
  widgetViewKindTag: this.getWidgetViewKindTag(),
1403
- defaultMode: this.viewOptions.defaultMode
1311
+ defaultMode: this.viewOptions.defaultMode,
1312
+ sessionTypePickerDelegate: this.viewOptions.sessionTypePickerDelegate,
1313
+ workspacePickerDelegate: this.viewOptions.workspacePickerDelegate,
1314
+ isQuickChat: isQuickChat(this)
1404
1315
  };
1405
1316
  if (this.viewModel?.editing) {
1406
- const editedRequest = this.renderer.getTemplateDataForRequestId(this.viewModel?.editing?.id);
1317
+ const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
1407
1318
  const scopedInstantiationService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, editedRequest?.contextKeyService]))));
1408
1319
  this.inlineInputPartDisposable.value = scopedInstantiationService.createInstance(ChatInputPart, this.location, commonConfig, this.styles, true);
1409
- }
1410
- else {
1320
+ } else {
1411
1321
  this.inputPartDisposable.value = this.instantiationService.createInstance(ChatInputPart, this.location, commonConfig, this.styles, false);
1322
+ this._register(autorun(reader => {
1323
+ this.inputPart.height.read(reader);
1324
+ if (!this.listWidget) {
1325
+ return;
1326
+ }
1327
+ if (this.bodyDimension) {
1328
+ this.layout(this.bodyDimension.height, this.bodyDimension.width);
1329
+ }
1330
+ this._onDidChangeContentHeight.fire();
1331
+ }));
1332
+ }
1333
+ this.input.render(container, "", this);
1334
+ if (this.bodyDimension?.width) {
1335
+ this.input.layout(this.bodyDimension.width);
1412
1336
  }
1413
- this.input.render(container, '', this);
1414
1337
  this._register(this.input.onDidLoadInputState(() => {
1415
1338
  this.refreshParsedInput();
1416
1339
  }));
@@ -1419,7 +1342,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1419
1342
  if (!this.viewModel) {
1420
1343
  return;
1421
1344
  }
1422
- let msg = '';
1345
+ let msg = "";
1423
1346
  if (e.followup.agentId && e.followup.agentId !== this.chatAgentService.getDefaultAgent(this.location, this.input.currentModeKind)?.id) {
1424
1347
  const agent = this.chatAgentService.getAgent(e.followup.agentId);
1425
1348
  if (!agent) {
@@ -1430,8 +1353,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1430
1353
  if (e.followup.subCommand) {
1431
1354
  msg += `${chatSubcommandLeader}${e.followup.subCommand} `;
1432
1355
  }
1433
- }
1434
- else if (!e.followup.agentId && e.followup.subCommand && this.chatSlashCommandService.hasCommand(e.followup.subCommand)) {
1356
+ } else if (!e.followup.agentId && e.followup.subCommand && this.chatSlashCommandService.hasCommand(e.followup.subCommand)) {
1435
1357
  msg = `${chatSubcommandLeader}${e.followup.subCommand} `;
1436
1358
  }
1437
1359
  msg += e.followup.message;
@@ -1446,21 +1368,11 @@ let ChatWidget = class ChatWidget extends Disposable {
1446
1368
  command: e.response.slashCommand?.name,
1447
1369
  result: e.response.result,
1448
1370
  action: {
1449
- kind: 'followUp',
1371
+ kind: "followUp",
1450
1372
  followup: e.followup
1451
- },
1373
+ }
1452
1374
  });
1453
1375
  }));
1454
- this._register(this.input.onDidChangeHeight(() => {
1455
- const editedRequest = this.renderer.getTemplateDataForRequestId(this.viewModel?.editing?.id);
1456
- if (isRequestVM(editedRequest?.currentElement) && this.viewModel?.editing) {
1457
- this.renderer.updateItemHeightOnRender(editedRequest?.currentElement, editedRequest);
1458
- }
1459
- if (this.bodyDimension) {
1460
- this.layout(this.bodyDimension.height, this.bodyDimension.width);
1461
- }
1462
- this._onDidChangeContentHeight.fire();
1463
- }));
1464
1376
  this._register(this.inputEditor.onDidChangeModelContent(() => {
1465
1377
  this.parsedChatRequest = undefined;
1466
1378
  this.updateChatInputContext();
@@ -1480,29 +1392,35 @@ let ChatWidget = class ChatWidget extends Disposable {
1480
1392
  const toolIds = ( new Set());
1481
1393
  for (const [entry, enabled] of this.input.selectedToolsModel.entriesMap.read(r)) {
1482
1394
  if (enabled) {
1483
- if (entry instanceof ToolSet) {
1395
+ if (isToolSet(entry)) {
1484
1396
  toolSetIds.add(entry.id);
1485
- }
1486
- else {
1397
+ } else {
1487
1398
  toolIds.add(entry.id);
1488
1399
  }
1489
1400
  }
1490
1401
  }
1491
- const disabledTools = ( this.input.attachmentModel.attachments
1492
- .filter(a => a.kind === 'tool' && !( toolIds.has(a.id)) || a.kind === 'toolset' && !( toolSetIds.has(a.id)))
1493
- .map(a => a.id));
1402
+ const disabledTools = ( this.input.attachmentModel.attachments.filter(a => a.kind === "tool" && !( toolIds.has(a.id)) || a.kind === "toolset" && !( toolSetIds.has(a.id))).map(a => a.id));
1494
1403
  this.input.attachmentModel.updateContext(disabledTools, Iterable.empty());
1495
1404
  this.refreshParsedInput();
1496
1405
  }));
1497
1406
  }
1498
1407
  onDidStyleChange() {
1499
- this.container.style.setProperty('--vscode-interactive-result-editor-background-color', this.editorOptions.configuration.resultEditor.backgroundColor?.toString() ?? '');
1500
- this.container.style.setProperty('--vscode-interactive-session-foreground', this.editorOptions.configuration.foreground?.toString() ?? '');
1501
- this.container.style.setProperty('--vscode-chat-list-background', this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString() ?? '');
1408
+ this.container.style.setProperty(
1409
+ "--vscode-interactive-result-editor-background-color",
1410
+ this.editorOptions.configuration.resultEditor.backgroundColor?.toString() ?? ""
1411
+ );
1412
+ this.container.style.setProperty(
1413
+ "--vscode-interactive-session-foreground",
1414
+ this.editorOptions.configuration.foreground?.toString() ?? ""
1415
+ );
1416
+ this.container.style.setProperty(
1417
+ "--vscode-chat-list-background",
1418
+ this.themeService.getColorTheme().getColor(this.styles.listBackground)?.toString() ?? ""
1419
+ );
1502
1420
  }
1503
1421
  setModel(model) {
1504
1422
  if (!this.container) {
1505
- throw ( new Error('Call render() before setModel()'));
1423
+ throw ( new Error("Call render() before setModel()"));
1506
1424
  }
1507
1425
  if (!model) {
1508
1426
  if (this.viewModel?.editing) {
@@ -1521,39 +1439,43 @@ let ChatWidget = class ChatWidget extends Disposable {
1521
1439
  this.inputPart.clearTodoListWidget(model.sessionResource, false);
1522
1440
  this.chatSuggestNextWidget.hide();
1523
1441
  this._codeBlockModelCollection.clear();
1524
- this.container.setAttribute('data-session-id', model.sessionId);
1525
- this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection);
1442
+ this.container.setAttribute("data-session-id", model.sessionId);
1443
+ this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
1526
1444
  this.inputPart.setInputModel(model.inputModel, model.getRequests().length === 0);
1445
+ this.listWidget.setViewModel(this.viewModel);
1527
1446
  if (this._lockedAgent) {
1528
1447
  let placeholder = this.chatSessionsService.getInputPlaceholderForSessionType(this._lockedAgent.id);
1529
1448
  if (!placeholder) {
1530
- placeholder = ( localize(5810, "Chat with {0}", this._lockedAgent.id));
1449
+ placeholder = ( localize(6065, "Chat with {0}", this._lockedAgent.id));
1531
1450
  }
1532
1451
  this.viewModel.setInputPlaceholder(placeholder);
1533
- this.inputEditor.updateOptions({ placeholder });
1534
- }
1535
- else if (this.viewModel.inputPlaceholder) {
1536
- this.inputEditor.updateOptions({ placeholder: this.viewModel.inputPlaceholder });
1452
+ this.inputEditor.updateOptions({
1453
+ placeholder
1454
+ });
1455
+ } else if (this.viewModel.inputPlaceholder) {
1456
+ this.inputEditor.updateOptions({
1457
+ placeholder: this.viewModel.inputPlaceholder
1458
+ });
1537
1459
  }
1538
- const renderImmediately = this.configurationService.getValue('chat.experimental.renderMarkdownImmediately');
1460
+ const renderImmediately = this.configurationService.getValue("chat.experimental.renderMarkdownImmediately");
1539
1461
  const delay = renderImmediately ? MicrotaskDelay : 0;
1540
- this.viewModelDisposables.add(Event.runAndSubscribe(Event.accumulate(this.viewModel.onDidChange, delay), (events => {
1541
- if (!this.viewModel || this._store.isDisposed) {
1542
- return;
1543
- }
1544
- this.requestInProgress.set(this.viewModel.model.requestInProgress.get());
1545
- if (events?.some(e => e?.kind === 'changePlaceholder')) {
1546
- this.inputEditor.updateOptions({ placeholder: this.viewModel.inputPlaceholder });
1547
- }
1548
- this.onDidChangeItems();
1549
- if (events?.some(e => e?.kind === 'addRequest') && this.visible) {
1550
- this.scrollToEnd();
1551
- }
1552
- })));
1553
- this.viewModelDisposables.add(autorun(reader => {
1554
- this._editingSession.read(reader);
1555
- this.renderChatEditingSessionState();
1556
- }));
1462
+ this.viewModelDisposables.add(
1463
+ Event.runAndSubscribe(Event.accumulate(this.viewModel.onDidChange, delay), (events => {
1464
+ if (!this.viewModel || this._store.isDisposed) {
1465
+ return;
1466
+ }
1467
+ this.requestInProgress.set(this.viewModel.model.requestInProgress.get());
1468
+ if (events?.some(e => e?.kind === "changePlaceholder")) {
1469
+ this.inputEditor.updateOptions({
1470
+ placeholder: this.viewModel.inputPlaceholder
1471
+ });
1472
+ }
1473
+ this.onDidChangeItems();
1474
+ if (events?.some(e => e?.kind === "addRequest") && this.visible) {
1475
+ this.listWidget.scrollToEnd();
1476
+ }
1477
+ }))
1478
+ );
1557
1479
  this.viewModelDisposables.add(this.viewModel.onDidDisposeModel(() => {
1558
1480
  if (this.viewModel?.editing) {
1559
1481
  this.finishedEditing();
@@ -1563,52 +1485,53 @@ let ChatWidget = class ChatWidget extends Disposable {
1563
1485
  }));
1564
1486
  this._sessionIsEmptyContextKey.set(model.getRequests().length === 0);
1565
1487
  this.refreshParsedInput();
1566
- this.viewModelDisposables.add(model.onDidChange((e) => {
1567
- if (e.kind === 'setAgent') {
1568
- this._onDidChangeAgent.fire({ agent: e.agent, slashCommand: e.command });
1488
+ this.viewModelDisposables.add(model.onDidChange(e => {
1489
+ if (e.kind === "setAgent") {
1490
+ this._onDidChangeAgent.fire({
1491
+ agent: e.agent,
1492
+ slashCommand: e.command
1493
+ });
1569
1494
  this._updateAgentCapabilitiesContextKeys(e.agent);
1570
1495
  }
1571
- if (e.kind === 'addRequest') {
1496
+ if (e.kind === "addRequest") {
1572
1497
  this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, false);
1573
1498
  this._sessionIsEmptyContextKey.set(false);
1574
1499
  }
1575
- if (e.kind === 'removeRequest') {
1500
+ if (e.kind === "removeRequest") {
1576
1501
  this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, true);
1577
1502
  this.chatSuggestNextWidget.hide();
1578
1503
  this._sessionIsEmptyContextKey.set((this.viewModel?.model.getRequests().length ?? 0) === 0);
1579
1504
  }
1580
- if (e.kind === 'completedRequest') {
1505
+ if (e.kind === "completedRequest") {
1581
1506
  const lastRequest = this.viewModel?.model.getRequests().at(-1);
1582
1507
  const wasCancelled = lastRequest?.response?.isCanceled ?? false;
1583
1508
  if (wasCancelled) {
1584
1509
  this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, true);
1585
1510
  }
1586
1511
  this.renderChatSuggestNextWidget();
1512
+ if (this.visible && this.viewModel?.sessionResource) {
1513
+ this.agentSessionsService.getSession(this.viewModel.sessionResource)?.setRead(true);
1514
+ }
1587
1515
  }
1588
1516
  }));
1589
- if (this.tree && this.visible) {
1517
+ if (this.listWidget && this.visible) {
1590
1518
  this.onDidChangeItems();
1591
- this.scrollToEnd();
1519
+ this.listWidget.scrollToEnd();
1592
1520
  }
1593
- this.renderer.updateViewModel(this.viewModel);
1594
1521
  this.updateChatInputContext();
1595
1522
  this.input.renderChatTodoListWidget(this.viewModel.sessionResource);
1596
1523
  }
1597
1524
  getFocus() {
1598
- return this.tree.getFocus()[0] ?? undefined;
1525
+ return this.listWidget.getFocus()[0] ?? undefined;
1599
1526
  }
1600
1527
  reveal(item, relativeTop) {
1601
- this.tree.reveal(item, relativeTop);
1528
+ this.listWidget.reveal(item, relativeTop);
1602
1529
  }
1603
1530
  focus(item) {
1604
- const items = this.tree.getNode(null).children;
1605
- const node = items.find(i => i.element?.id === item.id);
1606
- if (!node) {
1531
+ if (!this.listWidget.hasElement(item)) {
1607
1532
  return;
1608
1533
  }
1609
- this._mostRecentlyFocusedItemIndex = items.indexOf(node);
1610
- this.tree.setFocus([node.element]);
1611
- this.tree.domFocus();
1534
+ this.listWidget.focusItem(item);
1612
1535
  }
1613
1536
  setInputPlaceholder(placeholder) {
1614
1537
  this.viewModel?.setInputPlaceholder(placeholder);
@@ -1616,7 +1539,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1616
1539
  resetInputPlaceholder() {
1617
1540
  this.viewModel?.resetInputPlaceholder();
1618
1541
  }
1619
- setInput(value = '') {
1542
+ setInput(value = "") {
1620
1543
  this.input.setValue(value, false);
1621
1544
  this.refreshParsedInput();
1622
1545
  }
@@ -1637,9 +1560,14 @@ let ChatWidget = class ChatWidget extends Disposable {
1637
1560
  this.renderWelcomeViewContentIfNeeded();
1638
1561
  const agent = this.chatAgentService.getAgent(agentId);
1639
1562
  this._updateAgentCapabilitiesContextKeys(agent);
1640
- this.renderer.updateOptions({ restorable: false, editable: false, noFooter: true, progressMessageAtBottomOfResponse: true });
1563
+ this.listWidget?.updateRendererOptions({
1564
+ restorable: false,
1565
+ editable: false,
1566
+ noFooter: true,
1567
+ progressMessageAtBottomOfResponse: true
1568
+ });
1641
1569
  if (this.visible) {
1642
- this.tree.rerender();
1570
+ this.listWidget?.rerender();
1643
1571
  }
1644
1572
  }
1645
1573
  unlockFromCodingAgent() {
@@ -1650,10 +1578,17 @@ let ChatWidget = class ChatWidget extends Disposable {
1650
1578
  if (this.viewModel) {
1651
1579
  this.viewModel.resetInputPlaceholder();
1652
1580
  }
1653
- this.inputEditor.updateOptions({ placeholder: undefined });
1654
- this.renderer.updateOptions({ restorable: true, editable: true, noFooter: false, progressMessageAtBottomOfResponse: mode => mode !== ChatModeKind.Ask });
1581
+ this.inputEditor?.updateOptions({
1582
+ placeholder: undefined
1583
+ });
1584
+ this.listWidget?.updateRendererOptions({
1585
+ restorable: true,
1586
+ editable: true,
1587
+ noFooter: false,
1588
+ progressMessageAtBottomOfResponse: mode => mode !== ChatModeKind.Ask
1589
+ });
1655
1590
  if (this.visible) {
1656
- this.tree.rerender();
1591
+ this.listWidget?.rerender();
1657
1592
  }
1658
1593
  }
1659
1594
  get isLockedToCodingAgent() {
@@ -1666,7 +1601,9 @@ let ChatWidget = class ChatWidget extends Disposable {
1666
1601
  this.input.logInputHistory();
1667
1602
  }
1668
1603
  async acceptInput(query, options) {
1669
- return this._acceptInput(query ? { query } : undefined, options);
1604
+ return this._acceptInput(query ? {
1605
+ query
1606
+ } : undefined, options);
1670
1607
  }
1671
1608
  async rerunLastRequest() {
1672
1609
  if (!this.viewModel) {
@@ -1685,7 +1622,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1685
1622
  return await this.chatService.resendRequest(lastRequest, options);
1686
1623
  }
1687
1624
  async _applyPromptFileIfSet(requestInput) {
1688
- const agentSlashPromptPart = this.parsedInput.parts.find((r) => r instanceof ChatRequestSlashPromptPart);
1625
+ const agentSlashPromptPart = this.parsedInput.parts.find(r => r instanceof ChatRequestSlashPromptPart);
1689
1626
  if (!agentSlashPromptPart) {
1690
1627
  return;
1691
1628
  }
@@ -1694,10 +1631,24 @@ let ChatWidget = class ChatWidget extends Disposable {
1694
1631
  return;
1695
1632
  }
1696
1633
  const parseResult = slashCommand.parsedPromptFile;
1697
- const refs = parseResult.body?.variableReferences.map(({ name, offset }) => ({ name, range: ( new OffsetRange(offset, offset + name.length + 1)) })) ?? [];
1634
+ const refs = parseResult.body?.variableReferences.map((
1635
+ {
1636
+ name,
1637
+ offset
1638
+ }
1639
+ ) => ({
1640
+ name,
1641
+ range: ( new OffsetRange(offset, offset + name.length + 1))
1642
+ })) ?? [];
1698
1643
  const toolReferences = this.toolsService.toToolReferences(refs);
1699
- requestInput.attachedContext.insertFirst(toPromptFileVariableEntry(parseResult.uri, PromptFileVariableKind.PromptFile, undefined, true, toolReferences));
1700
- requestInput.input = ( this.parsedInput.parts.filter(part => !(part instanceof ChatRequestSlashPromptPart)).map(part => part.text)).join('').trim();
1644
+ requestInput.attachedContext.insertFirst(toPromptFileVariableEntry(
1645
+ parseResult.uri,
1646
+ PromptFileVariableKind.PromptFile,
1647
+ undefined,
1648
+ true,
1649
+ toolReferences
1650
+ ));
1651
+ requestInput.input = ( this.parsedInput.parts.filter(part => !(part instanceof ChatRequestSlashPromptPart)).map(part => part.text)).join("").trim();
1701
1652
  const input = requestInput.input.trim();
1702
1653
  requestInput.input = `Follow instructions in [${basename(parseResult.uri)}](${( parseResult.uri.toString())}).`;
1703
1654
  if (input) {
@@ -1725,12 +1676,21 @@ let ChatWidget = class ChatWidget extends Disposable {
1725
1676
  if (!this.viewModel) {
1726
1677
  return;
1727
1678
  }
1679
+ if (this.viewOptions.submitHandler) {
1680
+ const inputValue = !query ? this.getInput() : query.query;
1681
+ const handled = await this.viewOptions.submitHandler(inputValue, this.input.currentModeKind);
1682
+ if (handled) {
1683
+ return;
1684
+ }
1685
+ }
1728
1686
  this._onDidAcceptInput.fire();
1729
- this.scrollLock = this.isLockedToCodingAgent || !!checkModeOption(this.input.currentModeKind, this.viewOptions.autoScroll);
1687
+ this.listWidget.setScrollLock(
1688
+ this.isLockedToCodingAgent || !!checkModeOption(this.input.currentModeKind, this.viewOptions.autoScroll)
1689
+ );
1730
1690
  const editorValue = this.getInput();
1731
1691
  const requestInputs = {
1732
1692
  input: !query ? editorValue : query.query,
1733
- attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext(this.viewModel.sessionResource) : this.input.getAttachedAndImplicitContext(this.viewModel.sessionResource),
1693
+ attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext(this.viewModel.sessionResource) : this.input.getAttachedAndImplicitContext(this.viewModel.sessionResource)
1734
1694
  };
1735
1695
  const isUserQuery = !query;
1736
1696
  if (this.viewModel?.editing) {
@@ -1745,7 +1705,7 @@ let ChatWidget = class ChatWidget extends Disposable {
1745
1705
  const previousRequests = this.viewModel.model.getRequests();
1746
1706
  for (const request of previousRequests) {
1747
1707
  for (const variable of request.variableData.variables) {
1748
- if (URI.isUri(variable.value) && variable.kind === 'file') {
1708
+ if (URI.isUri(variable.value) && variable.kind === "file") {
1749
1709
  const uri = variable.value;
1750
1710
  if (!( uniqueWorkingSetEntries.has(uri))) {
1751
1711
  editingSessionAttachedContext.add(variable);
@@ -1755,7 +1715,10 @@ let ChatWidget = class ChatWidget extends Disposable {
1755
1715
  }
1756
1716
  }
1757
1717
  requestInputs.attachedContext = editingSessionAttachedContext;
1758
- this.telemetryService.publicLog2('chatEditing/workingSetSize', { originalSize: uniqueWorkingSetEntries.size, actualSize: uniqueWorkingSetEntries.size });
1718
+ this.telemetryService.publicLog2("chatEditing/workingSetSize", {
1719
+ originalSize: uniqueWorkingSetEntries.size,
1720
+ actualSize: uniqueWorkingSetEntries.size
1721
+ });
1759
1722
  }
1760
1723
  this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource);
1761
1724
  if (this.currentRequest) {
@@ -1778,12 +1741,15 @@ let ChatWidget = class ChatWidget extends Disposable {
1778
1741
  userSelectedModelId: this.input.currentLanguageModel,
1779
1742
  location: this.location,
1780
1743
  locationData: this._location.resolveData?.(),
1781
- parserContext: { selectedAgent: this._lastSelectedAgent, mode: this.input.currentModeKind },
1744
+ parserContext: {
1745
+ selectedAgent: this._lastSelectedAgent,
1746
+ mode: this.input.currentModeKind
1747
+ },
1782
1748
  attachedContext: requestInputs.attachedContext.asArray(),
1783
1749
  noCommandDetection: options?.noCommandDetection,
1784
1750
  ...this.getModeRequestOptions(),
1785
1751
  modeInfo: this.input.currentModeInfo,
1786
- agentIdSilent: this._lockedAgent?.id,
1752
+ agentIdSilent: this._lockedAgent?.id
1787
1753
  });
1788
1754
  if (!result) {
1789
1755
  this.chatAccessibilityService.disposeRequest(this.viewModel.sessionResource);
@@ -1791,14 +1757,27 @@ let ChatWidget = class ChatWidget extends Disposable {
1791
1757
  }
1792
1758
  this.updateChatViewVisibility();
1793
1759
  this.input.acceptInput(options?.storeToHistory ?? isUserQuery);
1794
- this._onDidSubmitAgent.fire({ agent: result.agent, slashCommand: result.slashCommand });
1760
+ this._onDidSubmitAgent.fire({
1761
+ agent: result.agent,
1762
+ slashCommand: result.slashCommand
1763
+ });
1795
1764
  this.handleDelegationExitIfNeeded(this._lockedAgent, result.agent);
1796
1765
  this.currentRequest = result.responseCompletePromise.then(() => {
1797
1766
  const responses = this.viewModel?.getItems().filter(isResponseVM);
1798
1767
  const lastResponse = responses?.[responses.length - 1];
1799
- this.chatAccessibilityService.acceptResponse(this, this.container, lastResponse, this.viewModel?.sessionResource, options?.isVoiceInput);
1768
+ this.chatAccessibilityService.acceptResponse(
1769
+ this,
1770
+ this.container,
1771
+ lastResponse,
1772
+ this.viewModel?.sessionResource,
1773
+ options?.isVoiceInput
1774
+ );
1800
1775
  if (lastResponse?.result?.nextQuestion) {
1801
- const { prompt, participant, command } = lastResponse.result.nextQuestion;
1776
+ const {
1777
+ prompt,
1778
+ participant,
1779
+ command
1780
+ } = lastResponse.result.nextQuestion;
1802
1781
  const question = formatChatQuestion(this.chatAgentService, this.location, prompt, participant, command);
1803
1782
  if (question) {
1804
1783
  this.input.setValue(question, false);
@@ -1811,77 +1790,56 @@ let ChatWidget = class ChatWidget extends Disposable {
1811
1790
  getModeRequestOptions() {
1812
1791
  return {
1813
1792
  modeInfo: this.input.currentModeInfo,
1814
- userSelectedTools: this.input.selectedToolsModel.userSelectedTools,
1793
+ userSelectedTools: this.input.selectedToolsModel.userSelectedTools
1815
1794
  };
1816
1795
  }
1817
1796
  getCodeBlockInfosForResponse(response) {
1818
- return this.renderer.getCodeBlockInfosForResponse(response);
1797
+ return this.listWidget.getCodeBlockInfosForResponse(response);
1819
1798
  }
1820
1799
  getCodeBlockInfoForEditor(uri) {
1821
- return this.renderer.getCodeBlockInfoForEditor(uri);
1800
+ return this.listWidget.getCodeBlockInfoForEditor(uri);
1822
1801
  }
1823
1802
  getFileTreeInfosForResponse(response) {
1824
- return this.renderer.getFileTreeInfosForResponse(response);
1803
+ return this.listWidget.getFileTreeInfosForResponse(response);
1825
1804
  }
1826
1805
  getLastFocusedFileTreeForResponse(response) {
1827
- return this.renderer.getLastFocusedFileTreeForResponse(response);
1806
+ return this.listWidget.getLastFocusedFileTreeForResponse(response);
1828
1807
  }
1829
1808
  focusResponseItem(lastFocused) {
1830
- if (!this.viewModel) {
1831
- return;
1832
- }
1833
- const items = this.tree.getNode(null).children;
1834
- let item;
1835
- if (lastFocused) {
1836
- item = items[this._mostRecentlyFocusedItemIndex] ?? items[items.length - 1];
1837
- }
1838
- else {
1839
- item = items[items.length - 1];
1840
- }
1841
- if (!item) {
1842
- return;
1843
- }
1844
- this.tree.setFocus([item.element]);
1845
- this.tree.domFocus();
1809
+ this.listWidget.focusLastItem(lastFocused);
1846
1810
  }
1847
1811
  layout(height, width) {
1848
- width = Math.min(width, this.viewOptions.renderStyle === 'minimal' ? width : 950);
1849
- const heightUpdated = this.bodyDimension && this.bodyDimension.height !== height;
1812
+ width = Math.min(width, this.viewOptions.renderStyle === "minimal" ? width : 950);
1850
1813
  this.bodyDimension = new Dimension(width, height);
1851
- const layoutHeight = this._dynamicMessageLayoutData?.enabled ? this._dynamicMessageLayoutData.maxHeight : height;
1852
1814
  if (this.viewModel?.editing) {
1853
- this.inlineInputPart?.layout(layoutHeight, width);
1815
+ this.inlineInputPart?.layout(width);
1854
1816
  }
1855
- this.inputPart.layout(layoutHeight, width);
1856
- const inputHeight = this.inputPart.inputPartHeight;
1817
+ this.inputPart.layout(width);
1818
+ const inputHeight = this.inputPart.height.get();
1857
1819
  const chatSuggestNextWidgetHeight = this.chatSuggestNextWidget.height;
1858
- const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight - 2;
1859
- const lastItem = this.viewModel?.getItems().at(-1);
1820
+ const lastElementVisible = this.listWidget.isScrolledToBottom;
1821
+ const lastItem = this.listWidget.lastItem;
1860
1822
  const contentHeight = Math.max(0, height - inputHeight - chatSuggestNextWidgetHeight);
1861
- if (this.viewOptions.renderStyle === 'compact' || this.viewOptions.renderStyle === 'minimal') {
1862
- this.listContainer.style.removeProperty('--chat-current-response-min-height');
1863
- }
1864
- else {
1865
- this.listContainer.style.setProperty('--chat-current-response-min-height', contentHeight * .75 + 'px');
1866
- if (heightUpdated && lastItem && this.visible && this.tree.hasElement(lastItem)) {
1867
- this.tree.updateElementHeight(lastItem, undefined);
1868
- }
1869
- }
1870
- this.tree.layout(contentHeight, width);
1823
+ this.listWidget.layout(contentHeight, width);
1871
1824
  this.welcomeMessageContainer.style.height = `${contentHeight}px`;
1872
- this.renderer.layout(width);
1873
1825
  const lastResponseIsRendering = isResponseVM(lastItem) && lastItem.renderData;
1874
1826
  if (lastElementVisible && (!lastResponseIsRendering || checkModeOption(this.input.currentModeKind, this.viewOptions.autoScroll))) {
1875
- this.scrollToEnd();
1827
+ this.listWidget.scrollToEnd();
1876
1828
  }
1877
1829
  this.listContainer.style.height = `${contentHeight}px`;
1878
1830
  this._onDidChangeHeight.fire(height);
1879
1831
  }
1880
1832
  setDynamicChatTreeItemLayout(numOfChatTreeItems, maxHeight) {
1881
- this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
1882
- this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode()));
1833
+ this._dynamicMessageLayoutData = {
1834
+ numOfMessages: numOfChatTreeItems,
1835
+ maxHeight,
1836
+ enabled: true
1837
+ };
1838
+ this._register(
1839
+ this.listWidget.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode())
1840
+ );
1883
1841
  const mutableDisposable = this._register(( new MutableDisposable()));
1884
- this._register(this.tree.onDidScroll((e) => {
1842
+ this._register(this.listWidget.onDidScroll(e => {
1885
1843
  if (!this._dynamicMessageLayoutData?.enabled) {
1886
1844
  return;
1887
1845
  }
@@ -1896,16 +1854,23 @@ let ChatWidget = class ChatWidget extends Disposable {
1896
1854
  }
1897
1855
  const possibleMaxHeight = (this._dynamicMessageLayoutData?.maxHeight ?? maxHeight);
1898
1856
  const width = this.bodyDimension?.width ?? this.container.offsetWidth;
1899
- this.input.layout(possibleMaxHeight, width);
1900
- const inputPartHeight = this.input.inputPartHeight;
1857
+ this.input.layout(width);
1858
+ const inputPartHeight = this.input.height.get();
1901
1859
  const chatSuggestNextWidgetHeight = this.chatSuggestNextWidget.height;
1902
- const newHeight = Math.min(renderHeight + diff, possibleMaxHeight - inputPartHeight - chatSuggestNextWidgetHeight);
1860
+ const newHeight = Math.min(
1861
+ renderHeight + diff,
1862
+ possibleMaxHeight - inputPartHeight - chatSuggestNextWidgetHeight
1863
+ );
1903
1864
  this.layout(newHeight + inputPartHeight + chatSuggestNextWidgetHeight, width);
1904
1865
  });
1905
1866
  }));
1906
1867
  }
1907
1868
  updateDynamicChatTreeItemLayout(numOfChatTreeItems, maxHeight) {
1908
- this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true };
1869
+ this._dynamicMessageLayoutData = {
1870
+ numOfMessages: numOfChatTreeItems,
1871
+ maxHeight,
1872
+ enabled: true
1873
+ };
1909
1874
  let hasChanged = false;
1910
1875
  let height = this.bodyDimension.height;
1911
1876
  let width = this.bodyDimension.width;
@@ -1936,23 +1901,22 @@ let ChatWidget = class ChatWidget extends Disposable {
1936
1901
  return;
1937
1902
  }
1938
1903
  const width = this.bodyDimension?.width ?? this.container.offsetWidth;
1939
- this.input.layout(this._dynamicMessageLayoutData.maxHeight, width);
1940
- const inputHeight = this.input.inputPartHeight;
1904
+ this.input.layout(width);
1905
+ const inputHeight = this.input.height.get();
1941
1906
  const chatSuggestNextWidgetHeight = this.chatSuggestNextWidget.height;
1942
1907
  const totalMessages = this.viewModel.getItems();
1943
1908
  const messages = totalMessages.slice(-this._dynamicMessageLayoutData.numOfMessages);
1944
1909
  const needsRerender = ( messages.some(m => m.currentRenderedHeight === undefined));
1945
- const listHeight = needsRerender
1946
- ? this._dynamicMessageLayoutData.maxHeight
1947
- : messages.reduce((acc, message) => acc + message.currentRenderedHeight, 0);
1910
+ const listHeight = needsRerender ? this._dynamicMessageLayoutData.maxHeight : messages.reduce((acc, message) => acc + message.currentRenderedHeight, 0);
1948
1911
  this.layout(Math.min(
1949
- inputHeight + chatSuggestNextWidgetHeight + listHeight + (totalMessages.length > 2 ? 18 : 0), this._dynamicMessageLayoutData.maxHeight), width);
1912
+ inputHeight + chatSuggestNextWidgetHeight + listHeight + (totalMessages.length > 2 ? 18 : 0),
1913
+ this._dynamicMessageLayoutData.maxHeight
1914
+ ), width);
1950
1915
  if (needsRerender || !listHeight) {
1951
- this.scrollToEnd();
1916
+ this.listWidget.scrollToEnd();
1952
1917
  }
1953
1918
  }
1954
- saveState() {
1955
- }
1919
+ saveState() {}
1956
1920
  getViewState() {
1957
1921
  return this.input.getCurrentInputState();
1958
1922
  }
@@ -1966,7 +1930,13 @@ let ChatWidget = class ChatWidget extends Disposable {
1966
1930
  const agent = this.chatModeService.findModeByName(agentName);
1967
1931
  if (agent) {
1968
1932
  if (currentAgent.kind !== agent.kind) {
1969
- const chatModeCheck = await this.instantiationService.invokeFunction(handleModeSwitch, currentAgent.kind, agent.kind, this.viewModel?.model.getRequests().length ?? 0, this.viewModel?.model);
1933
+ const chatModeCheck = await this.instantiationService.invokeFunction(
1934
+ handleModeSwitch,
1935
+ currentAgent.kind,
1936
+ agent.kind,
1937
+ this.viewModel?.model.getRequests().length ?? 0,
1938
+ this.viewModel?.model
1939
+ );
1970
1940
  if (!chatModeCheck) {
1971
1941
  return;
1972
1942
  }
@@ -1978,7 +1948,14 @@ let ChatWidget = class ChatWidget extends Disposable {
1978
1948
  }
1979
1949
  }
1980
1950
  }
1981
- async _applyPromptMetadata({ agent, tools, model }, requestInput) {
1951
+ async _applyPromptMetadata(
1952
+ {
1953
+ agent,
1954
+ tools,
1955
+ model
1956
+ },
1957
+ requestInput
1958
+ ) {
1982
1959
  if (tools !== undefined && !agent && this.input.currentModeKind !== ChatModeKind.Agent) {
1983
1960
  agent = ChatMode.Agent.name.get();
1984
1961
  }
@@ -1986,49 +1963,33 @@ let ChatWidget = class ChatWidget extends Disposable {
1986
1963
  this._switchToAgentByName(agent);
1987
1964
  }
1988
1965
  if (tools !== undefined && this.input.currentModeKind === ChatModeKind.Agent) {
1989
- const enablementMap = this.toolsService.toToolAndToolSetEnablementMap(tools, Target.VSCode);
1966
+ const enablementMap = this.toolsService.toToolAndToolSetEnablementMap(tools, Target.VSCode, this.input.selectedLanguageModel.get()?.metadata);
1990
1967
  this.input.selectedToolsModel.set(enablementMap, true);
1991
1968
  }
1992
1969
  if (model !== undefined) {
1993
1970
  this.input.switchModelByQualifiedName(model);
1994
1971
  }
1995
1972
  }
1996
- async _autoAttachInstructions({ attachedContext }) {
1973
+ async _autoAttachInstructions(
1974
+ {
1975
+ attachedContext
1976
+ }
1977
+ ) {
1997
1978
  this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are always enabled`);
1998
- const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.entriesMap.get() : undefined;
1999
- const computer = this.instantiationService.createInstance(ComputeAutomaticInstructions, enabledTools);
1979
+ const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
1980
+ const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
1981
+ const computer = this.instantiationService.createInstance(
1982
+ ComputeAutomaticInstructions,
1983
+ this.input.currentModeKind,
1984
+ enabledTools,
1985
+ enabledSubAgents
1986
+ );
2000
1987
  await computer.collect(attachedContext, CancellationToken.None);
2001
1988
  }
2002
1989
  delegateScrollFromMouseWheelEvent(browserEvent) {
2003
- this.tree.delegateScrollFromMouseWheelEvent(browserEvent);
1990
+ this.listWidget.delegateScrollFromMouseWheelEvent(browserEvent);
2004
1991
  }
2005
1992
  };
2006
- ChatWidget = ChatWidget_1 = ( __decorate([
2007
- ( __param(4, ICodeEditorService)),
2008
- ( __param(5, IEditorService)),
2009
- ( __param(6, IConfigurationService)),
2010
- ( __param(7, IContextKeyService)),
2011
- ( __param(8, IInstantiationService)),
2012
- ( __param(9, IChatService)),
2013
- ( __param(10, IChatAgentService)),
2014
- ( __param(11, IChatWidgetService)),
2015
- ( __param(12, IContextMenuService)),
2016
- ( __param(13, IChatAccessibilityService)),
2017
- ( __param(14, ILogService)),
2018
- ( __param(15, IThemeService)),
2019
- ( __param(16, IChatSlashCommandService)),
2020
- ( __param(17, IChatEditingService)),
2021
- ( __param(18, ITelemetryService)),
2022
- ( __param(19, IPromptsService)),
2023
- ( __param(20, ILanguageModelToolsService)),
2024
- ( __param(21, IChatModeService)),
2025
- ( __param(22, IChatLayoutService)),
2026
- ( __param(23, IChatEntitlementService)),
2027
- ( __param(24, IChatSessionsService)),
2028
- ( __param(25, IAgentSessionsService)),
2029
- ( __param(26, IChatTodoListService)),
2030
- ( __param(27, IWorkspaceContextService)),
2031
- ( __param(28, ILifecycleService))
2032
- ], ChatWidget));
1993
+ ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IEditorService)), ( __param(6, IConfigurationService)), ( __param(7, IContextKeyService)), ( __param(8, IInstantiationService)), ( __param(9, IChatService)), ( __param(10, IChatAgentService)), ( __param(11, IChatWidgetService)), ( __param(12, IChatAccessibilityService)), ( __param(13, ILogService)), ( __param(14, IThemeService)), ( __param(15, IChatSlashCommandService)), ( __param(16, IChatEditingService)), ( __param(17, ITelemetryService)), ( __param(18, IPromptsService)), ( __param(19, ILanguageModelToolsService)), ( __param(20, IChatModeService)), ( __param(21, IChatLayoutService)), ( __param(22, IChatEntitlementService)), ( __param(23, IChatSessionsService)), ( __param(24, IAgentSessionsService)), ( __param(25, IChatTodoListService)), ( __param(26, IWorkspaceContextService)), ( __param(27, ILifecycleService))], ChatWidget));
2033
1994
 
2034
1995
  export { ChatWidget, isQuickChat };