@codingame/monaco-vscode-katex-common 25.1.1 → 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
@@ -1,17 +1,26 @@
1
1
 
2
2
  import { registerCss } from '@codingame/monaco-vscode-api/css';
3
3
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
- import { $, clearNode, hide } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { $, scheduleAtNextAnimationFrame, getWindow, clearNode, hide } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
5
+ import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
6
+ import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
7
+ import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
8
+ import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
5
9
  import { ThinkingDisplayMode, ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
6
10
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
7
11
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
8
12
  import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
13
+ import { extractCodeblockUrisFromText } from '../../../common/widget/annotations.js';
14
+ import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
9
15
  import { ChatCollapsibleContentPart } from './chatCollapsibleContentPart.js';
10
16
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
11
17
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
12
18
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
19
+ import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
20
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
21
+ import { DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
13
22
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
14
- import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
23
+ import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
15
24
  import { IChatMarkdownAnchorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service';
16
25
  import { ChatMessageRole } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
17
26
  import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
@@ -22,33 +31,27 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
22
31
 
23
32
  registerCss(chatThinkingContent);
24
33
  function extractTextFromPart(content) {
25
- const raw = Array.isArray(content.value) ? content.value.join('') : (content.value || '');
34
+ const raw = Array.isArray(content.value) ? content.value.join("") : (content.value || "");
26
35
  return raw.trim();
27
36
  }
28
37
  function getToolInvocationIcon(toolId) {
29
38
  const lowerToolId = toolId.toLowerCase();
30
- if (lowerToolId.includes('search') ||
31
- lowerToolId.includes('grep') ||
32
- lowerToolId.includes('find') ||
33
- lowerToolId.includes('list') ||
34
- lowerToolId.includes('semantic') ||
35
- lowerToolId.includes('changes') ||
36
- lowerToolId.includes('codebase')) {
39
+ if (lowerToolId.includes("search") || lowerToolId.includes("grep") || lowerToolId.includes("find") || lowerToolId.includes("list") || lowerToolId.includes("semantic") || lowerToolId.includes("changes") || lowerToolId.includes("codebase")) {
37
40
  return Codicon.search;
38
41
  }
39
- if (lowerToolId.includes('read') ||
40
- lowerToolId.includes('get_file') ||
41
- lowerToolId.includes('problems')) {
42
- return Codicon.eye;
42
+ if (lowerToolId.includes("read") || lowerToolId.includes("get_file") || lowerToolId.includes("problems")) {
43
+ return Codicon.book;
43
44
  }
44
- if (lowerToolId.includes('edit') ||
45
- lowerToolId.includes('create')) {
45
+ if (lowerToolId.includes("edit") || lowerToolId.includes("create")) {
46
46
  return Codicon.pencil;
47
47
  }
48
+ if (lowerToolId.includes("terminal")) {
49
+ return Codicon.terminal;
50
+ }
48
51
  return Codicon.tools;
49
52
  }
50
53
  function createThinkingIcon(icon) {
51
- const iconElement = $('span.chat-thinking-icon');
54
+ const iconElement = $("span.chat-thinking-icon");
52
55
  iconElement.classList.add(...ThemeIcon.asClassNameArray(icon));
53
56
  return iconElement;
54
57
  }
@@ -56,67 +59,123 @@ function extractTitleFromThinkingContent(content) {
56
59
  const headerMatch = content.match(/^\*\*([^*]+)\*\*/);
57
60
  return headerMatch ? headerMatch[1] : undefined;
58
61
  }
62
+ const THINKING_SCROLL_MAX_HEIGHT = 200;
63
+ var WorkingMessageCategory;
64
+ (function(WorkingMessageCategory) {
65
+ WorkingMessageCategory["Thinking"] = "thinking";
66
+ WorkingMessageCategory["Terminal"] = "terminal";
67
+ WorkingMessageCategory["Tool"] = "tool";
68
+ })(WorkingMessageCategory || (WorkingMessageCategory = {}));
69
+ const thinkingMessages = [( localize(5904, "Thinking...")), ( localize(5905, "Reasoning...")), ( localize(5906, "Considering...")), ( localize(5907, "Analyzing...")), ( localize(5908, "Evaluating..."))];
70
+ const terminalMessages = [( localize(5909, "Executing...")), ( localize(5910, "Running...")), ( localize(5911, "Processing..."))];
71
+ const toolMessages = [( localize(5912, "Processing...")), ( localize(5913, "Preparing...")), ( localize(5914, "Loading...")), ( localize(5915, "Analyzing...")), ( localize(5916, "Evaluating..."))];
59
72
  let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsibleContentPart {
60
- constructor(content, context, chatContentMarkdownRenderer, instantiationService, configurationService, chatMarkdownAnchorService, languageModelsService, hoverService) {
73
+ getRandomWorkingMessage(category = WorkingMessageCategory.Tool) {
74
+ let pool = this.availableMessagesByCategory.get(category);
75
+ if (!pool || pool.length === 0) {
76
+ switch (category) {
77
+ case WorkingMessageCategory.Thinking:
78
+ pool = [...thinkingMessages];
79
+ break;
80
+ case WorkingMessageCategory.Terminal:
81
+ pool = [...terminalMessages];
82
+ break;
83
+ case WorkingMessageCategory.Tool:
84
+ default:
85
+ pool = [...toolMessages];
86
+ break;
87
+ }
88
+ this.availableMessagesByCategory.set(category, pool);
89
+ }
90
+ const index = Math.floor(Math.random() * pool.length);
91
+ return pool.splice(index, 1)[0];
92
+ }
93
+ constructor(
94
+ content,
95
+ context,
96
+ chatContentMarkdownRenderer,
97
+ streamingCompleted,
98
+ instantiationService,
99
+ configurationService,
100
+ chatMarkdownAnchorService,
101
+ languageModelsService,
102
+ hoverService
103
+ ) {
61
104
  const initialText = extractTextFromPart(content);
62
- const extractedTitle = extractTitleFromThinkingContent(initialText)
63
- ?? 'Thinking...';
105
+ const extractedTitle = extractTitleFromThinkingContent(initialText) ?? "Working...";
64
106
  super(extractedTitle, context, undefined, hoverService);
65
107
  this.chatContentMarkdownRenderer = chatContentMarkdownRenderer;
108
+ this.streamingCompleted = streamingCompleted;
66
109
  this.instantiationService = instantiationService;
67
110
  this.configurationService = configurationService;
68
111
  this.chatMarkdownAnchorService = chatMarkdownAnchorService;
69
112
  this.languageModelsService = languageModelsService;
70
- this.defaultTitle = ( localize(5673, 'Thinking...'));
113
+ this._onDidChangeHeight = this._register(( new Emitter()));
114
+ this.defaultTitle = ( localize(5917, "Working..."));
71
115
  this.fixedScrollingMode = false;
116
+ this.autoScrollEnabled = true;
72
117
  this.extractedTitles = [];
73
118
  this.toolInvocationCount = 0;
74
- this.streamingCompleted = false;
119
+ this.appendedItemCount = 0;
75
120
  this.isActive = true;
76
121
  this.toolInvocations = [];
122
+ this.lazyItems = [];
123
+ this.hasExpandedOnce = false;
124
+ this.availableMessagesByCategory = ( new Map());
125
+ this.toolWrappersByCallId = ( new Map());
126
+ this.toolDisposables = this._register(( new DisposableMap()));
127
+ this.pendingRemovals = [];
128
+ this.isUpdatingDimensions = false;
77
129
  this.id = content.id;
78
130
  this.content = content;
79
- const configuredMode = this.configurationService.getValue('chat.agent.thinkingStyle') ?? ThinkingDisplayMode.Collapsed;
131
+ const configuredMode = this.configurationService.getValue("chat.agent.thinkingStyle") ?? ThinkingDisplayMode.Collapsed;
80
132
  this.fixedScrollingMode = configuredMode === ThinkingDisplayMode.FixedScrolling;
81
133
  this.currentTitle = extractedTitle;
82
134
  if (extractedTitle !== this.defaultTitle) {
83
135
  this.lastExtractedTitle = extractedTitle;
84
136
  }
85
137
  this.currentThinkingValue = initialText;
138
+ if (initialText.trim()) {
139
+ this.appendedItemCount++;
140
+ }
141
+ alert(( localize(5918, "Thinking")));
86
142
  if (configuredMode === ThinkingDisplayMode.Collapsed) {
87
143
  this.setExpanded(false);
88
- }
89
- else {
90
- this.setExpanded(true);
91
- }
92
- if (this.fixedScrollingMode) {
144
+ } else if (configuredMode === ThinkingDisplayMode.CollapsedPreview) {
145
+ this.setExpanded(!this.streamingCompleted && !this.element.isComplete);
146
+ } else {
93
147
  this.setExpanded(false);
94
148
  }
95
149
  const node = this.domNode;
96
- node.classList.add('chat-thinking-box');
97
- node.tabIndex = 0;
150
+ node.classList.add("chat-thinking-box");
98
151
  if (this.fixedScrollingMode) {
99
- node.classList.add('chat-thinking-fixed-mode');
152
+ node.classList.add("chat-thinking-fixed-mode");
100
153
  this.currentTitle = this.defaultTitle;
101
- if (this._collapseButton && !this.context.element.isComplete) {
102
- this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, 'spin');
103
- }
104
154
  }
105
155
  this._register(autorun(r => {
106
- this.expanded.read(r);
107
- if (this._collapseButton && this.wrapper) {
108
- if (this.wrapper.classList.contains('chat-thinking-streaming') && !this.context.element.isComplete) {
109
- this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, 'spin');
110
- }
111
- else {
156
+ const isExpanded = this.expanded.read(r);
157
+ if (this._collapseButton) {
158
+ if (this.streamingCompleted || this.element.isComplete) {
112
159
  this._collapseButton.icon = Codicon.check;
160
+ } else if (!this.fixedScrollingMode) {
161
+ if (isExpanded) {
162
+ this._collapseButton.icon = Codicon.chevronDown;
163
+ } else {
164
+ this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, "spin");
165
+ }
113
166
  }
114
167
  }
115
168
  }));
116
- if (this._collapseButton && !this.streamingCompleted && !this.context.element.isComplete) {
117
- this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, 'spin');
118
- }
119
- const label = this.lastExtractedTitle ?? '';
169
+ this._register(autorun(r => {
170
+ if (this._isExpanded.read(r) && !this.hasExpandedOnce && this.lazyItems.length > 0) {
171
+ this.hasExpandedOnce = true;
172
+ for (const item of this.lazyItems) {
173
+ this.materializeLazyItem(item);
174
+ }
175
+ }
176
+ this._onDidChangeHeight.fire();
177
+ }));
178
+ const label = this.lastExtractedTitle ?? "";
120
179
  if (!this.fixedScrollingMode && !this._isExpanded.get()) {
121
180
  this.setTitle(label);
122
181
  }
@@ -129,26 +188,156 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
129
188
  if (expanded) {
130
189
  this.setTitle(this.defaultTitle, true);
131
190
  this.currentTitle = this.defaultTitle;
132
- }
133
- else if (this.lastExtractedTitle) {
134
- const collapsedLabel = this.lastExtractedTitle ?? '';
191
+ } else if (this.lastExtractedTitle) {
192
+ const collapsedLabel = this.lastExtractedTitle ?? "";
135
193
  this.setTitle(collapsedLabel);
136
194
  this.currentTitle = collapsedLabel;
137
195
  }
138
196
  }));
139
197
  }
140
198
  }
199
+ shouldInitEarly() {
200
+ return this.fixedScrollingMode && !this.streamingCompleted;
201
+ }
141
202
  initContent() {
142
- this.wrapper = $('.chat-used-context-list.chat-thinking-collapsible');
143
- this.wrapper.classList.add('chat-thinking-streaming');
144
- if (this.currentThinkingValue) {
145
- this.textContainer = $('.chat-thinking-item.markdown-content');
203
+ this.wrapper = $(".chat-used-context-list.chat-thinking-collapsible");
204
+ if (!this.streamingCompleted) {
205
+ this.wrapper.classList.add("chat-thinking-streaming");
206
+ }
207
+ const hasLazyThinkingItems = ( this.lazyItems.some(item => item.kind === "thinking"));
208
+ if (this.currentThinkingValue && !hasLazyThinkingItems) {
209
+ this.textContainer = $(".chat-thinking-item.markdown-content");
146
210
  this.wrapper.appendChild(this.textContainer);
147
211
  this.renderMarkdown(this.currentThinkingValue);
148
212
  }
213
+ if (!this.streamingCompleted && !this.element.isComplete) {
214
+ this.workingSpinnerElement = $(".chat-thinking-item.chat-thinking-spinner-item");
215
+ const spinnerIcon = createThinkingIcon(ThemeIcon.modify(Codicon.loading, "spin"));
216
+ this.workingSpinnerElement.appendChild(spinnerIcon);
217
+ this.workingSpinnerLabel = $("span.chat-thinking-spinner-label");
218
+ this.workingSpinnerLabel.textContent = this.getRandomWorkingMessage(WorkingMessageCategory.Thinking);
219
+ this.workingSpinnerElement.appendChild(this.workingSpinnerLabel);
220
+ this.wrapper.appendChild(this.workingSpinnerElement);
221
+ }
222
+ if (this.fixedScrollingMode) {
223
+ this.scrollableElement = this._register(( new DomScrollableElement(this.wrapper, {
224
+ vertical: ScrollbarVisibility.Auto,
225
+ horizontal: ScrollbarVisibility.Hidden,
226
+ handleMouseWheel: true,
227
+ alwaysConsumeMouseWheel: false
228
+ })));
229
+ this._register(this.scrollableElement.onScroll(e => this.handleScroll(e.scrollTop)));
230
+ const mutationObserver = ( new MutationObserver(() => {
231
+ if (!this.streamingCompleted) {
232
+ this.syncDimensionsAndScheduleScroll();
233
+ }
234
+ }));
235
+ mutationObserver.observe(this.wrapper, {
236
+ childList: true,
237
+ subtree: true,
238
+ characterData: true
239
+ });
240
+ this.mutationObserverDisposable = {
241
+ dispose: () => mutationObserver.disconnect()
242
+ };
243
+ this._register(this.mutationObserverDisposable);
244
+ this._register(this._onDidChangeHeight.event(() => {
245
+ this.syncDimensionsAndScheduleScroll();
246
+ }));
247
+ this.syncDimensionsAndScheduleScroll();
248
+ this.updateDropdownClickability();
249
+ return this.scrollableElement.getDomNode();
250
+ }
149
251
  this.updateDropdownClickability();
150
252
  return this.wrapper;
151
253
  }
254
+ handleScroll(scrollTop) {
255
+ if (!this.scrollableElement || this.isUpdatingDimensions) {
256
+ return;
257
+ }
258
+ const scrollDimensions = this.scrollableElement.getScrollDimensions();
259
+ const maxScrollTop = scrollDimensions.scrollHeight - scrollDimensions.height;
260
+ const isAtBottom = maxScrollTop <= 0 || scrollTop >= maxScrollTop - 10;
261
+ if (isAtBottom) {
262
+ this.autoScrollEnabled = true;
263
+ } else {
264
+ this.autoScrollEnabled = false;
265
+ }
266
+ }
267
+ syncDimensionsAndScheduleScroll() {
268
+ if (this.autoScrollEnabled && this.scrollableElement) {
269
+ this.isUpdatingDimensions = true;
270
+ try {
271
+ this.updateScrollDimensions();
272
+ this.scrollToBottom();
273
+ } finally {
274
+ this.isUpdatingDimensions = false;
275
+ }
276
+ return;
277
+ }
278
+ if (this.pendingScrollDisposable) {
279
+ return;
280
+ }
281
+ this.pendingScrollDisposable = scheduleAtNextAnimationFrame(getWindow(this.domNode), () => {
282
+ this.pendingScrollDisposable = undefined;
283
+ if (this._store.isDisposed) {
284
+ return;
285
+ }
286
+ this.isUpdatingDimensions = true;
287
+ try {
288
+ this.updateScrollDimensions();
289
+ } finally {
290
+ this.isUpdatingDimensions = false;
291
+ }
292
+ });
293
+ }
294
+ updateScrollDimensions() {
295
+ if (!this.scrollableElement) {
296
+ return;
297
+ }
298
+ const isCollapsed = this.domNode.classList.contains("chat-used-context-collapsed");
299
+ if (!isCollapsed) {
300
+ return;
301
+ }
302
+ const contentHeight = this.wrapper.scrollHeight;
303
+ const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
304
+ this.scrollableElement.setScrollDimensions({
305
+ width: this.scrollableElement.getDomNode().clientWidth,
306
+ scrollWidth: this.wrapper.scrollWidth,
307
+ height: viewportHeight,
308
+ scrollHeight: contentHeight
309
+ });
310
+ }
311
+ scrollToBottom() {
312
+ if (!this.scrollableElement) {
313
+ return;
314
+ }
315
+ const contentHeight = this.wrapper.scrollHeight;
316
+ const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
317
+ if (contentHeight > viewportHeight) {
318
+ this.scrollableElement.setScrollPosition({
319
+ scrollTop: contentHeight - viewportHeight
320
+ });
321
+ }
322
+ }
323
+ updateScrollDimensionsForCompletion() {
324
+ if (!this.scrollableElement || !this.fixedScrollingMode) {
325
+ return;
326
+ }
327
+ const contentHeight = this.wrapper.scrollHeight;
328
+ const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
329
+ this.scrollableElement.setScrollDimensions({
330
+ width: this.scrollableElement.getDomNode().clientWidth,
331
+ scrollWidth: this.wrapper.scrollWidth,
332
+ height: viewportHeight,
333
+ scrollHeight: contentHeight
334
+ });
335
+ if (contentHeight <= THINKING_SCROLL_MAX_HEIGHT) {
336
+ this.scrollableElement.setScrollPosition({
337
+ scrollTop: 0
338
+ });
339
+ }
340
+ }
152
341
  renderMarkdown(content, reuseExisting) {
153
342
  if (this._store.isDisposed) {
154
343
  return;
@@ -159,11 +348,13 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
159
348
  this.markdownResult.dispose();
160
349
  this.markdownResult = undefined;
161
350
  }
162
- clearNode(this.textContainer);
351
+ if (this.textContainer) {
352
+ clearNode(this.textContainer);
353
+ }
163
354
  return;
164
355
  }
165
356
  let contentToRender = cleanedContent;
166
- if (cleanedContent.startsWith('**') && cleanedContent.endsWith('**')) {
357
+ if (cleanedContent.startsWith("**") && cleanedContent.endsWith("**")) {
167
358
  contentToRender = cleanedContent.slice(2, -2);
168
359
  }
169
360
  const target = reuseExisting ? this.markdownResult?.element : undefined;
@@ -175,21 +366,23 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
175
366
  fillInIncompleteTokens: true,
176
367
  asyncRenderCallback: () => this._onDidChangeHeight.fire(),
177
368
  codeBlockRendererSync: (_languageId, text, raw) => {
178
- const codeElement = $('code');
369
+ const codeElement = $("code");
179
370
  codeElement.textContent = text;
180
371
  return codeElement;
181
372
  }
182
373
  }, target));
183
374
  this.markdownResult = rendered;
184
375
  if (!target) {
185
- clearNode(this.textContainer);
186
- this.textContainer.appendChild(createThinkingIcon(Codicon.comment));
187
- this.textContainer.appendChild(rendered.element);
376
+ if (this.textContainer) {
377
+ clearNode(this.textContainer);
378
+ this.textContainer.appendChild(createThinkingIcon(Codicon.circleFilled));
379
+ this.textContainer.appendChild(rendered.element);
380
+ }
188
381
  }
189
382
  }
190
383
  setDropdownClickable(clickable) {
191
384
  if (this._collapseButton) {
192
- this._collapseButton.element.style.pointerEvents = clickable ? 'auto' : 'none';
385
+ this._collapseButton.element.style.pointerEvents = clickable ? "auto" : "none";
193
386
  }
194
387
  if (!clickable && this.streamingCompleted) {
195
388
  super.setTitle(this.lastExtractedTitle ?? this.currentTitle);
@@ -199,20 +392,29 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
199
392
  if (!this.wrapper) {
200
393
  return;
201
394
  }
202
- if (this.wrapper.children.length > 1 || this.toolInvocationCount > 0) {
395
+ if (this.wrapper.children.length > 1 || this.toolInvocationCount > 0 || this.lazyItems.length > 0) {
203
396
  this.setDropdownClickable(true);
204
397
  return;
205
398
  }
206
399
  const contentWithoutTitle = this.currentThinkingValue.trim();
207
400
  const titleToCompare = this.lastExtractedTitle ?? this.currentTitle;
208
- const stripMarkdown = (text) => {
209
- return text
210
- .replace(/\*\*(.+?)\*\*/g, '$1').replace(/\*(.+?)\*/g, '$1').replace(/`(.+?)`/g, '$1').trim();
401
+ const stripMarkdown = text => {
402
+ return text.replace(/\*\*(.+?)\*\*/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/`(.+?)`/g, "$1").trim();
211
403
  };
212
404
  const strippedContent = stripMarkdown(contentWithoutTitle);
213
405
  const shouldDisable = !strippedContent || strippedContent === titleToCompare;
214
406
  this.setDropdownClickable(!shouldDisable);
215
407
  }
408
+ appendToWrapper(element) {
409
+ if (!this.wrapper) {
410
+ return;
411
+ }
412
+ if (this.workingSpinnerElement && this.workingSpinnerElement.parentNode === this.wrapper) {
413
+ this.wrapper.insertBefore(element, this.workingSpinnerElement);
414
+ } else {
415
+ this.wrapper.appendChild(element);
416
+ }
417
+ }
216
418
  resetId() {
217
419
  this.id = undefined;
218
420
  }
@@ -224,6 +426,12 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
224
426
  return;
225
427
  }
226
428
  this.content = content;
429
+ for (const lazyItem of this.lazyItems) {
430
+ if (lazyItem.kind === "thinking" && lazyItem.content.id === content.id) {
431
+ lazyItem.content = content;
432
+ break;
433
+ }
434
+ }
227
435
  const raw = extractTextFromPart(content);
228
436
  const next = raw;
229
437
  if (next === this.currentThinkingValue) {
@@ -233,8 +441,8 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
233
441
  const reuseExisting = !!(this.markdownResult && next.startsWith(previousValue) && next.length > previousValue.length);
234
442
  this.currentThinkingValue = next;
235
443
  this.renderMarkdown(next, reuseExisting);
236
- if (this.fixedScrollingMode && this.wrapper) {
237
- this.wrapper.scrollTop = this.wrapper.scrollHeight;
444
+ if (this.fixedScrollingMode && this.scrollableElement) {
445
+ this.syncDimensionsAndScheduleScroll();
238
446
  }
239
447
  const extractedTitle = extractTitleFromThinkingContent(raw);
240
448
  if (extractedTitle && extractedTitle !== this.currentTitle) {
@@ -246,7 +454,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
246
454
  if (!extractedTitle || extractedTitle === this.currentTitle) {
247
455
  return;
248
456
  }
249
- const label = this.lastExtractedTitle ?? '';
457
+ const label = this.lastExtractedTitle ?? "";
250
458
  if (!this.fixedScrollingMode && !this._isExpanded.get()) {
251
459
  this.setTitle(label);
252
460
  }
@@ -257,13 +465,32 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
257
465
  }
258
466
  markAsInactive() {
259
467
  this.isActive = false;
468
+ this.processPendingRemovals();
469
+ if (this.workingSpinnerElement) {
470
+ this.workingSpinnerElement.remove();
471
+ this.workingSpinnerElement = undefined;
472
+ this.workingSpinnerLabel = undefined;
473
+ }
260
474
  }
261
475
  finalizeTitleIfDefault() {
262
- this.wrapper.classList.remove('chat-thinking-streaming');
476
+ this.processPendingRemovals();
477
+ if (this.wrapper) {
478
+ this.wrapper.classList.remove("chat-thinking-streaming");
479
+ }
263
480
  this.streamingCompleted = true;
481
+ if (this.mutationObserverDisposable) {
482
+ this.mutationObserverDisposable.dispose();
483
+ this.mutationObserverDisposable = undefined;
484
+ }
485
+ if (this.workingSpinnerElement) {
486
+ this.workingSpinnerElement.remove();
487
+ this.workingSpinnerElement = undefined;
488
+ this.workingSpinnerLabel = undefined;
489
+ }
264
490
  if (this._collapseButton) {
265
491
  this._collapseButton.icon = Codicon.check;
266
492
  }
493
+ this.updateScrollDimensionsForCompletion();
267
494
  this.updateDropdownClickability();
268
495
  if (this.content.generatedTitle) {
269
496
  this.currentTitle = this.content.generatedTitle;
@@ -277,8 +504,8 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
277
504
  super.setTitle(existingToolTitle);
278
505
  return;
279
506
  }
280
- if (this.toolInvocationCount === 1 && this.currentThinkingValue.trim() === '' && this.singleToolItemInfo) {
281
- this.restoreSingleToolToOriginalPosition();
507
+ if (this.appendedItemCount === 1 && this.currentThinkingValue.trim() === "" && this.singleItemInfo) {
508
+ this.restoreSingleItemToOriginalPosition();
282
509
  return;
283
510
  }
284
511
  if (this.extractedTitles.length === 1 && this.toolInvocationCount === 0) {
@@ -301,46 +528,144 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
301
528
  }
302
529
  }
303
530
  async generateTitleViaLLM() {
531
+ const cts = ( new CancellationTokenSource());
532
+ const timeout = setTimeout(() => cts.cancel(), 5000);
304
533
  try {
305
- let models = await this.languageModelsService.selectLanguageModels({ vendor: 'copilot', id: 'copilot-fast' });
534
+ let models = await this.languageModelsService.selectLanguageModels({
535
+ vendor: "copilot",
536
+ id: "copilot-fast"
537
+ });
306
538
  if (!models.length) {
307
- models = await this.languageModelsService.selectLanguageModels({ vendor: 'copilot', family: 'gpt-4o-mini' });
539
+ models = await this.languageModelsService.selectLanguageModels({
540
+ vendor: "copilot",
541
+ family: "gpt-4o-mini"
542
+ });
308
543
  }
309
544
  if (!models.length) {
310
545
  this.setFallbackTitle();
311
546
  return;
312
547
  }
548
+ if (cts.token.isCancellationRequested) {
549
+ this.setFallbackTitle();
550
+ return;
551
+ }
313
552
  let context;
314
553
  if (this.extractedTitles.length > 0) {
315
- context = this.extractedTitles.join(', ');
316
- }
317
- else {
554
+ context = this.extractedTitles.join(", ");
555
+ } else {
318
556
  context = this.currentThinkingValue.substring(0, 1000);
319
557
  }
320
- const prompt = `Summarize the following actions in 6-7 words using past tense. Be very concise - focus on the main action only. No subjects, quotes, or punctuation.
558
+ const prompt = `Summarize the following content in a SINGLE sentence (under 10 words) using past tense. Follow these rules strictly:
559
+
560
+ OUTPUT FORMAT:
561
+ - MUST be a single sentence
562
+ - MUST be under 10 words
563
+ - No quotes, no trailing punctuation
564
+
565
+ GENERAL:
566
+ - The content may include tool invocations (file edits, reads, searches, terminal commands), reasoning headers, or raw thinking text
567
+ - For reasoning headers or thinking text (no tool calls), summarize WHAT was considered/analyzed, NOT that thinking occurred
568
+ - For thinking-only summaries, use phrases like: "Considered...", "Planned...", "Analyzed...", "Reviewed..."
569
+
570
+ TOOL NAME FILTERING:
571
+ - NEVER include tool names like "Replace String in File", "Multi Replace String in File", "Create File", "Read File", etc. in the output
572
+ - If an action says "Edited X and used Replace String in File", output ONLY the action on X
573
+ - Tool names describe HOW something was done, not WHAT was done - always omit them
574
+
575
+ VOCABULARY - Use varied synonyms for natural-sounding summaries:
576
+ - For edits: "Updated", "Modified", "Changed", "Refactored", "Fixed", "Adjusted"
577
+ - For reads: "Reviewed", "Examined", "Checked", "Inspected", "Analyzed", "Explored"
578
+ - For creates: "Created", "Added", "Generated"
579
+ - For searches: "Searched for", "Looked up", "Investigated"
580
+ - For terminal: "Ran command", "Executed"
581
+ - For reasoning/thinking: "Considered", "Planned", "Analyzed", "Reviewed", "Evaluated"
582
+ - Choose the synonym that best fits the context
583
+
584
+ RULES FOR TOOL CALLS:
585
+ 1. If the SAME file was both edited AND read: Use a combined phrase like "Reviewed and updated <filename>"
586
+ 2. If exactly ONE file was edited: Start with an edit synonym + "<filename>" (include actual filename)
587
+ 3. If exactly ONE file was read: Start with a read synonym + "<filename>" (include actual filename)
588
+ 4. If MULTIPLE files were edited: Start with an edit synonym + "X files"
589
+ 5. If MULTIPLE files were read: Start with a read synonym + "X files"
590
+ 6. If BOTH edits AND reads occurred on DIFFERENT files: Combine them naturally
591
+ 7. For searches: Say "searched for <term>" or "looked up <term>" with the actual search term, NOT "searched for files"
592
+ 8. After the file info, you may add a brief summary of other actions if space permits
593
+ 9. NEVER say "1 file" - always use the actual filename when there's only one file
594
+
595
+ RULES FOR REASONING HEADERS (no tool calls):
596
+ 1. If the input contains reasoning/analysis headers without actual tool invocations, summarize the main topic and what was considered
597
+ 2. Use past tense verbs that indicate thinking, not doing: "Considered", "Planned", "Analyzed", "Evaluated"
598
+ 3. Focus on WHAT was being thought about, not that thinking occurred
599
+
600
+ RULES FOR RAW THINKING TEXT:
601
+ 1. Extract the main topic or question being considered from the text
602
+ 2. Identify any specific files, functions, or concepts mentioned
603
+ 3. Summarize as "Analyzed <topic>" or "Considered <specific thing>"
604
+ 4. If discussing code structure: "Reviewed <component/architecture>"
605
+ 5. If discussing a problem: "Analyzed <problem description>"
606
+ 6. If discussing implementation: "Planned <feature/change>"
321
607
 
322
- Examples:
323
- - "Preparing to create new page file, Read HomePage.tsx, Creating new TypeScript file" → "Created new page file"
324
- - "Searching for files, Reading configuration, Analyzing dependencies" → "Analyzed project structure"
325
- - "Invoked terminal command, Checked build output, Fixed errors" → "Ran build and fixed errors"
608
+ EXAMPLES WITH TOOLS:
609
+ - "Read HomePage.tsx, Edited HomePage.tsx" → "Reviewed and updated HomePage.tsx"
610
+ - "Edited HomePage.tsx" → "Updated HomePage.tsx"
611
+ - "Edited config.css and used Replace String in File" → "Modified config.css"
612
+ - "Edited App.tsx, used Multi Replace String in File" → "Refactored App.tsx"
613
+ - "Read config.json, Read package.json" → "Reviewed 2 files"
614
+ - "Edited App.tsx, Read utils.ts" → "Updated App.tsx and checked utils.ts"
615
+ - "Edited App.tsx, Read utils.ts, Read types.ts" → "Updated App.tsx and reviewed 2 files"
616
+ - "Edited index.ts, Edited styles.css, Ran terminal command" → "Modified 2 files and ran command"
617
+ - "Read README.md, Searched for AuthService" → "Checked README.md and searched for AuthService"
618
+ - "Searched for login, Searched for authentication" → "Searched for login and authentication"
619
+ - "Edited api.ts, Edited models.ts, Read schema.json" → "Updated 2 files and reviewed schema.json"
620
+ - "Edited Button.tsx, Edited Button.css, Edited index.ts" → "Modified 3 files"
621
+ - "Searched codebase for error handling" → "Looked up error handling"
326
622
 
327
- Actions: ${context}`;
328
- const response = await this.languageModelsService.sendChatRequest(models[0], ( new ExtensionIdentifier('core')), [{ role: ChatMessageRole.User, content: [{ type: 'text', value: prompt }] }], {}, CancellationToken.None);
329
- let generatedTitle = '';
623
+ EXAMPLES WITH REASONING HEADERS (no tools):
624
+ - "Analyzing component architecture" "Considered component architecture"
625
+ - "Planning refactor strategy" → "Planned refactor strategy"
626
+ - "Reviewing error handling approach, Considering edge cases" → "Analyzed error handling approach"
627
+ - "Understanding the codebase structure" → "Reviewed codebase structure"
628
+ - "Thinking about implementation options" → "Considered implementation options"
629
+
630
+ EXAMPLES WITH RAW THINKING TEXT:
631
+ - "I need to understand how the authentication flow works in this app..." → "Analyzed authentication flow"
632
+ - "Let me think about how to refactor this component to be more maintainable..." → "Planned component refactoring"
633
+ - "The error seems to be coming from the database connection..." → "Investigated database connection issue"
634
+ - "Looking at the UserService class, I see it handles..." → "Reviewed UserService implementation"
635
+
636
+ Content: ${context}`;
637
+ const response = await this.languageModelsService.sendChatRequest(models[0], ( new ExtensionIdentifier("core")), [{
638
+ role: ChatMessageRole.User,
639
+ content: [{
640
+ type: "text",
641
+ value: prompt
642
+ }]
643
+ }], {}, cts.token);
644
+ let generatedTitle = "";
330
645
  for await (const part of response.stream) {
646
+ if (cts.token.isCancellationRequested) {
647
+ break;
648
+ }
331
649
  if (Array.isArray(part)) {
332
650
  for (const p of part) {
333
- if (p.type === 'text') {
651
+ if (p.type === "text") {
334
652
  generatedTitle += p.value;
335
653
  }
336
654
  }
337
- }
338
- else if (part.type === 'text') {
655
+ } else if (part.type === "text") {
339
656
  generatedTitle += part.value;
340
657
  }
341
658
  }
659
+ if (cts.token.isCancellationRequested) {
660
+ this.setFallbackTitle();
661
+ return;
662
+ }
342
663
  await response.result;
343
664
  generatedTitle = generatedTitle.trim();
665
+ if (generatedTitle.includes("can't assist with that")) {
666
+ this.setFallbackTitle();
667
+ return;
668
+ }
344
669
  if (generatedTitle && !this._store.isDisposed) {
345
670
  this.currentTitle = generatedTitle;
346
671
  if (this._collapseButton) {
@@ -350,36 +675,44 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
350
675
  this.setGeneratedTitleOnToolInvocations(generatedTitle);
351
676
  return;
352
677
  }
353
- }
354
- catch (error) {
678
+ } catch (error) {} finally {
679
+ clearTimeout(timeout);
680
+ cts.dispose();
355
681
  }
356
682
  this.setFallbackTitle();
357
683
  }
358
- restoreSingleToolToOriginalPosition() {
359
- if (!this.singleToolItemInfo) {
684
+ restoreSingleItemToOriginalPosition() {
685
+ if (!this.singleItemInfo) {
686
+ return;
687
+ }
688
+ const {
689
+ element,
690
+ originalParent,
691
+ originalNextSibling
692
+ } = this.singleItemInfo;
693
+ if (element.childElementCount > 1) {
694
+ this.singleItemInfo = undefined;
360
695
  return;
361
696
  }
362
- const { element, originalParent, originalNextSibling } = this.singleToolItemInfo;
363
697
  if (originalNextSibling && originalNextSibling.parentNode === originalParent) {
364
698
  originalParent.insertBefore(element, originalNextSibling);
365
- }
366
- else {
699
+ } else {
367
700
  originalParent.appendChild(element);
368
701
  }
369
702
  hide(this.domNode);
370
- this.singleToolItemInfo = undefined;
703
+ this.singleItemInfo = undefined;
371
704
  }
372
705
  setFallbackTitle() {
373
- const finalLabel = this.toolInvocationCount > 0
374
- ? ( localize(
375
- 5674,
376
- 'Finished thinking and invoked {0} tool{1}',
377
- this.toolInvocationCount,
378
- this.toolInvocationCount === 1 ? '' : 's'
379
- ))
380
- : ( localize(5675, 'Finished Thinking'));
706
+ const finalLabel = this.appendedItemCount > 0 ? ( localize(
707
+ 5919,
708
+ "Finished with {0} step{1}",
709
+ this.appendedItemCount,
710
+ this.appendedItemCount === 1 ? "" : "s"
711
+ )) : ( localize(5920, "Finished Working"));
381
712
  this.currentTitle = finalLabel;
382
- this.wrapper.classList.remove('chat-thinking-streaming');
713
+ if (this.wrapper) {
714
+ this.wrapper.classList.remove("chat-thinking-streaming");
715
+ }
383
716
  this.streamingCompleted = true;
384
717
  if (this._collapseButton) {
385
718
  this._collapseButton.icon = Codicon.check;
@@ -387,62 +720,295 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
387
720
  }
388
721
  this.updateDropdownClickability();
389
722
  }
390
- appendItem(content, toolInvocationId, toolInvocation, originalParent) {
391
- if (this.toolInvocationCount === 0 && originalParent) {
392
- this.singleToolItemInfo = {
723
+ appendItem(factory, toolInvocationId, toolInvocationOrMarkdown, originalParent) {
724
+ this.processPendingRemovals();
725
+ this.trackToolMetadata(toolInvocationId, toolInvocationOrMarkdown);
726
+ this.appendedItemCount++;
727
+ if (this.workingSpinnerLabel) {
728
+ const isTerminalTool = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && toolInvocationOrMarkdown.toolSpecificData?.kind === "terminal";
729
+ const category = isTerminalTool ? WorkingMessageCategory.Terminal : WorkingMessageCategory.Tool;
730
+ this.workingSpinnerLabel.textContent = this.getRandomWorkingMessage(category);
731
+ }
732
+ if (this.isExpanded() || this.hasExpandedOnce || (this.fixedScrollingMode && !this.streamingCompleted)) {
733
+ const result = factory();
734
+ this.appendItemToDOM(result.domNode, toolInvocationId, toolInvocationOrMarkdown, originalParent);
735
+ if (result.disposable) {
736
+ const toolCallId = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? toolInvocationOrMarkdown.toolCallId : undefined;
737
+ if (toolCallId) {
738
+ this.toolDisposables.get(toolCallId)?.add(result.disposable);
739
+ } else {
740
+ this._register(result.disposable);
741
+ }
742
+ }
743
+ } else {
744
+ const item = {
745
+ kind: "tool",
746
+ lazy: ( new Lazy(factory)),
747
+ toolInvocationId,
748
+ toolInvocationOrMarkdown,
749
+ originalParent
750
+ };
751
+ this.lazyItems.push(item);
752
+ }
753
+ this.updateDropdownClickability();
754
+ }
755
+ removeLazyItem(toolInvocationId) {
756
+ const index = this.lazyItems.findIndex(item => item.kind === "tool" && item.toolInvocationId === toolInvocationId);
757
+ if (index === -1) {
758
+ return false;
759
+ }
760
+ this.lazyItems.splice(index, 1);
761
+ this.appendedItemCount--;
762
+ this.toolInvocationCount--;
763
+ const toolInvocationsIndex = this.toolInvocations.findIndex(
764
+ t => (t.kind === "toolInvocation" || t.kind === "toolInvocationSerialized") && t.toolId === toolInvocationId
765
+ );
766
+ if (toolInvocationsIndex !== -1) {
767
+ this.toolInvocations.splice(toolInvocationsIndex, 1);
768
+ }
769
+ this.updateDropdownClickability();
770
+ return true;
771
+ }
772
+ processPendingRemovals() {
773
+ for (const pending of this.pendingRemovals) {
774
+ this.removeStreamingToolEntry(pending.toolCallId, pending.toolLabel);
775
+ }
776
+ this.pendingRemovals = [];
777
+ }
778
+ removeStreamingToolEntry(toolCallId, toolLabel) {
779
+ this.toolDisposables.deleteAndDispose(toolCallId);
780
+ const wrapper = this.toolWrappersByCallId.get(toolCallId);
781
+ if (wrapper) {
782
+ wrapper.remove();
783
+ this.toolWrappersByCallId.delete(toolCallId);
784
+ }
785
+ const lazyIndex = this.lazyItems.findIndex(
786
+ item => item.kind === "tool" && item.toolInvocationOrMarkdown && (item.toolInvocationOrMarkdown.kind === "toolInvocation" || item.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && item.toolInvocationOrMarkdown.toolCallId === toolCallId
787
+ );
788
+ if (lazyIndex !== -1) {
789
+ this.lazyItems.splice(lazyIndex, 1);
790
+ }
791
+ this.appendedItemCount = Math.max(0, this.appendedItemCount - 1);
792
+ this.toolInvocationCount = Math.max(0, this.toolInvocationCount - 1);
793
+ const toolInvocationsIndex = this.toolInvocations.findIndex(
794
+ t => (t.kind === "toolInvocation" || t.kind === "toolInvocationSerialized") && t.toolCallId === toolCallId
795
+ );
796
+ if (toolInvocationsIndex !== -1) {
797
+ this.toolInvocations.splice(toolInvocationsIndex, 1);
798
+ }
799
+ const titleIndex = this.extractedTitles.indexOf(toolLabel);
800
+ if (titleIndex !== -1) {
801
+ this.extractedTitles.splice(titleIndex, 1);
802
+ }
803
+ this.updateDropdownClickability();
804
+ this._onDidChangeHeight.fire();
805
+ }
806
+ trackToolMetadata(toolInvocationId, toolInvocationOrMarkdown) {
807
+ if (!toolInvocationId) {
808
+ return;
809
+ }
810
+ this.toolInvocationCount++;
811
+ let toolCallLabel;
812
+ const isToolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized");
813
+ if (isToolInvocation && toolInvocationOrMarkdown.invocationMessage) {
814
+ const message = typeof toolInvocationOrMarkdown.invocationMessage === "string" ? toolInvocationOrMarkdown.invocationMessage : toolInvocationOrMarkdown.invocationMessage.value;
815
+ toolCallLabel = message;
816
+ this.toolInvocations.push(toolInvocationOrMarkdown);
817
+ if (toolInvocationOrMarkdown.kind === "toolInvocation") {
818
+ let currentToolLabel = toolCallLabel;
819
+ let isComplete = false;
820
+ let isStreaming = IChatToolInvocation.isStreaming(toolInvocationOrMarkdown);
821
+ const toolStore = ( new DisposableStore());
822
+ this.toolDisposables.set(toolInvocationOrMarkdown.toolCallId, toolStore);
823
+ const updateTitle = updatedMessage => {
824
+ if (updatedMessage && updatedMessage !== currentToolLabel) {
825
+ const oldIndex = this.extractedTitles.indexOf(currentToolLabel);
826
+ const updatedIndex = this.extractedTitles.indexOf(updatedMessage);
827
+ if (oldIndex !== -1) {
828
+ if (updatedIndex !== -1 && updatedIndex !== oldIndex) {
829
+ this.extractedTitles.splice(oldIndex, 1);
830
+ } else {
831
+ this.extractedTitles[oldIndex] = updatedMessage;
832
+ }
833
+ } else if (updatedIndex === -1) {
834
+ this.extractedTitles.push(updatedMessage);
835
+ }
836
+ currentToolLabel = updatedMessage;
837
+ this.lastExtractedTitle = updatedMessage;
838
+ if (!this.fixedScrollingMode && !this._isExpanded.read(undefined)) {
839
+ this.setTitle(updatedMessage);
840
+ }
841
+ }
842
+ };
843
+ const autorunDisposable = autorun(reader => {
844
+ if (isComplete) {
845
+ return;
846
+ }
847
+ const currentState = toolInvocationOrMarkdown.state.read(reader);
848
+ if (isStreaming && currentState.type !== IChatToolInvocation.StateKind.Streaming) {
849
+ isStreaming = false;
850
+ if (toolInvocationOrMarkdown.presentation === "hidden") {
851
+ this.pendingRemovals.push({
852
+ toolCallId: toolInvocationOrMarkdown.toolCallId,
853
+ toolLabel: currentToolLabel
854
+ });
855
+ isComplete = true;
856
+ return;
857
+ }
858
+ }
859
+ if (currentState.type === IChatToolInvocation.StateKind.Completed || currentState.type === IChatToolInvocation.StateKind.Cancelled) {
860
+ isComplete = true;
861
+ return;
862
+ }
863
+ if (currentState.type === IChatToolInvocation.StateKind.Streaming) {
864
+ isStreaming = true;
865
+ const streamingMessage = currentState.streamingMessage.read(reader);
866
+ if (streamingMessage) {
867
+ const updatedMessage = typeof streamingMessage === "string" ? streamingMessage : streamingMessage.value;
868
+ updateTitle(updatedMessage);
869
+ }
870
+ return;
871
+ }
872
+ if (currentState.type === IChatToolInvocation.StateKind.Executing) {
873
+ const progressData = currentState.progress.read(reader);
874
+ if (progressData.message) {
875
+ const updatedMessage = typeof progressData.message === "string" ? progressData.message : progressData.message.value;
876
+ updateTitle(updatedMessage);
877
+ } else {
878
+ const invocationMsg = toolInvocationOrMarkdown.invocationMessage;
879
+ if (invocationMsg) {
880
+ const updatedMessage = typeof invocationMsg === "string" ? invocationMsg : invocationMsg.value;
881
+ updateTitle(updatedMessage);
882
+ }
883
+ }
884
+ return;
885
+ }
886
+ const invocationMsg = toolInvocationOrMarkdown.invocationMessage;
887
+ if (invocationMsg) {
888
+ const updatedMessage = typeof invocationMsg === "string" ? invocationMsg : invocationMsg.value;
889
+ updateTitle(updatedMessage);
890
+ }
891
+ });
892
+ toolStore.add(autorunDisposable);
893
+ }
894
+ } else if (toolInvocationOrMarkdown?.kind === "markdownContent") {
895
+ const codeblockInfo = extractCodeblockUrisFromText(toolInvocationOrMarkdown.content.value);
896
+ if (codeblockInfo?.uri) {
897
+ const filename = basename(codeblockInfo.uri);
898
+ toolCallLabel = ( localize(5921, "Edited {0}", filename));
899
+ } else {
900
+ toolCallLabel = ( localize(5922, "Edited file"));
901
+ }
902
+ } else {
903
+ toolCallLabel = `Invoked \`${toolInvocationId}\``;
904
+ }
905
+ if (!this.extractedTitles.includes(toolCallLabel)) {
906
+ this.extractedTitles.push(toolCallLabel);
907
+ }
908
+ this.lastExtractedTitle = toolCallLabel;
909
+ if (!this.fixedScrollingMode && !this._isExpanded.get()) {
910
+ this.setTitle(toolCallLabel);
911
+ }
912
+ }
913
+ appendItemToDOM(content, toolInvocationId, toolInvocationOrMarkdown, originalParent) {
914
+ if (!content.hasChildNodes() || content.textContent?.trim() === "") {
915
+ return;
916
+ }
917
+ if (this.appendedItemCount === 1 && originalParent) {
918
+ this.singleItemInfo = {
393
919
  element: content,
394
920
  originalParent,
395
921
  originalNextSibling: this.domNode
396
922
  };
923
+ } else {
924
+ this.singleItemInfo = undefined;
397
925
  }
398
- else {
399
- this.singleToolItemInfo = undefined;
926
+ const itemWrapper = $(".chat-thinking-tool-wrapper");
927
+ const isMarkdownEdit = toolInvocationOrMarkdown?.kind === "markdownContent";
928
+ const isTerminalTool = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && toolInvocationOrMarkdown.toolSpecificData?.kind === "terminal";
929
+ let icon;
930
+ if (isMarkdownEdit) {
931
+ icon = Codicon.pencil;
932
+ } else if (isTerminalTool) {
933
+ const terminalData = toolInvocationOrMarkdown.toolSpecificData;
934
+ const exitCode = terminalData?.terminalCommandState?.exitCode;
935
+ icon = exitCode !== undefined && exitCode !== 0 ? Codicon.error : Codicon.terminal;
936
+ } else {
937
+ icon = toolInvocationId ? getToolInvocationIcon(toolInvocationId) : Codicon.tools;
400
938
  }
401
- const itemWrapper = $('.chat-thinking-tool-wrapper');
402
- const icon = toolInvocationId ? getToolInvocationIcon(toolInvocationId) : Codicon.tools;
403
939
  const iconElement = createThinkingIcon(icon);
404
940
  itemWrapper.appendChild(iconElement);
405
941
  itemWrapper.appendChild(content);
406
- this.wrapper.appendChild(itemWrapper);
407
- if (toolInvocationId) {
408
- this.toolInvocationCount++;
409
- let toolCallLabel;
410
- if (toolInvocation?.invocationMessage) {
411
- const message = typeof toolInvocation.invocationMessage === 'string' ? toolInvocation.invocationMessage : toolInvocation.invocationMessage.value;
412
- toolCallLabel = message;
413
- }
414
- else {
415
- toolCallLabel = `Invoked \`${toolInvocationId}\``;
416
- }
417
- if (toolInvocation) {
418
- this.toolInvocations.push(toolInvocation);
419
- }
420
- if (!this.extractedTitles.includes(toolCallLabel)) {
421
- this.extractedTitles.push(toolCallLabel);
422
- }
423
- if (!this.fixedScrollingMode && !this._isExpanded.get()) {
424
- this.setTitle(toolCallLabel);
425
- }
942
+ const isToolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized");
943
+ if (isToolInvocation && toolInvocationOrMarkdown.toolCallId) {
944
+ this.toolWrappersByCallId.set(toolInvocationOrMarkdown.toolCallId, itemWrapper);
426
945
  }
427
- if (this.fixedScrollingMode && this.wrapper) {
428
- this.wrapper.scrollTop = this.wrapper.scrollHeight;
946
+ this.appendToWrapper(itemWrapper);
947
+ if (this.fixedScrollingMode && this.scrollableElement) {
948
+ this.syncDimensionsAndScheduleScroll();
429
949
  }
430
- this.updateDropdownClickability();
431
950
  }
432
- setupThinkingContainer(content, context) {
951
+ materializeLazyItem(item) {
952
+ if (item.kind === "thinking") {
953
+ this.appendToWrapper(item.textContainer);
954
+ this.textContainer = item.textContainer;
955
+ this.id = item.content.id;
956
+ this.updateThinking(item.content);
957
+ return;
958
+ }
959
+ if (this.workingSpinnerLabel) {
960
+ const isTerminalTool = item.toolInvocationOrMarkdown && (item.toolInvocationOrMarkdown.kind === "toolInvocation" || item.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && item.toolInvocationOrMarkdown.toolSpecificData?.kind === "terminal";
961
+ const category = isTerminalTool ? WorkingMessageCategory.Terminal : WorkingMessageCategory.Tool;
962
+ this.workingSpinnerLabel.textContent = this.getRandomWorkingMessage(category);
963
+ }
964
+ if (item.lazy.hasValue) {
965
+ return;
966
+ }
967
+ const result = item.lazy.value;
968
+ this.appendItemToDOM(
969
+ result.domNode,
970
+ item.toolInvocationId,
971
+ item.toolInvocationOrMarkdown,
972
+ item.originalParent
973
+ );
974
+ if (result.disposable) {
975
+ const toolCallId = item.toolInvocationOrMarkdown && (item.toolInvocationOrMarkdown.kind === "toolInvocation" || item.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? item.toolInvocationOrMarkdown.toolCallId : undefined;
976
+ if (toolCallId) {
977
+ this.toolDisposables.get(toolCallId)?.add(result.disposable);
978
+ } else {
979
+ this._register(result.disposable);
980
+ }
981
+ }
982
+ }
983
+ setupThinkingContainer(content) {
433
984
  if (this._store.isDisposed) {
434
985
  return;
435
986
  }
436
- this.textContainer = $('.chat-thinking-item.markdown-content');
987
+ this.appendedItemCount++;
988
+ this.textContainer = $(".chat-thinking-item.markdown-content");
437
989
  if (content.value) {
438
- this.wrapper.appendChild(this.textContainer);
439
- this.id = content.id;
440
- this.updateThinking(content);
990
+ if (this.isExpanded() || this.hasExpandedOnce || (this.fixedScrollingMode && !this.streamingCompleted)) {
991
+ this.appendToWrapper(this.textContainer);
992
+ this.id = content.id;
993
+ this.updateThinking(content);
994
+ } else {
995
+ this.content = content;
996
+ this.id = content.id;
997
+ const lazyThinking = {
998
+ kind: "thinking",
999
+ textContainer: this.textContainer,
1000
+ content
1001
+ };
1002
+ this.lazyItems.push(lazyThinking);
1003
+ }
1004
+ if (this.workingSpinnerLabel) {
1005
+ this.workingSpinnerLabel.textContent = this.getRandomWorkingMessage(WorkingMessageCategory.Thinking);
1006
+ }
441
1007
  }
442
1008
  this.updateDropdownClickability();
443
1009
  }
444
1010
  setTitle(title, omitPrefix) {
445
- if (!title || this.context.element.isComplete) {
1011
+ if (!title || this.element.isComplete) {
446
1012
  return;
447
1013
  }
448
1014
  if (omitPrefix) {
@@ -450,16 +1016,16 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
450
1016
  this.currentTitle = title;
451
1017
  return;
452
1018
  }
453
- const thinkingLabel = `Thinking: ${title}`;
1019
+ const thinkingLabel = `Working: ${title}`;
454
1020
  this.lastExtractedTitle = title;
455
1021
  this.currentTitle = thinkingLabel;
456
1022
  this.setTitleWithWidgets(( new MarkdownString(thinkingLabel)), this.instantiationService, this.chatMarkdownAnchorService, this.chatContentMarkdownRenderer);
457
1023
  }
458
1024
  hasSameContent(other, _followingContent, _element) {
459
- if (other.kind === 'toolInvocation' || other.kind === 'toolInvocationSerialized') {
1025
+ if (other.kind === "toolInvocation" || other.kind === "toolInvocationSerialized" || other.kind === "markdownContent") {
460
1026
  return true;
461
1027
  }
462
- if (other.kind !== 'thinking') {
1028
+ if (other.kind !== "thinking") {
463
1029
  return false;
464
1030
  }
465
1031
  return other?.id !== this.id;
@@ -469,15 +1035,15 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
469
1035
  this.markdownResult.dispose();
470
1036
  this.markdownResult = undefined;
471
1037
  }
1038
+ if (this.workingSpinnerElement) {
1039
+ this.workingSpinnerElement.remove();
1040
+ this.workingSpinnerElement = undefined;
1041
+ this.workingSpinnerLabel = undefined;
1042
+ }
1043
+ this.pendingScrollDisposable?.dispose();
472
1044
  super.dispose();
473
1045
  }
474
1046
  };
475
- ChatThinkingContentPart = ( __decorate([
476
- ( __param(3, IInstantiationService)),
477
- ( __param(4, IConfigurationService)),
478
- ( __param(5, IChatMarkdownAnchorService)),
479
- ( __param(6, ILanguageModelsService)),
480
- ( __param(7, IHoverService))
481
- ], ChatThinkingContentPart));
1047
+ ChatThinkingContentPart = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, IConfigurationService)), ( __param(6, IChatMarkdownAnchorService)), ( __param(7, ILanguageModelsService)), ( __param(8, IHoverService))], ChatThinkingContentPart));
482
1048
 
483
- export { ChatThinkingContentPart };
1049
+ export { ChatThinkingContentPart, createThinkingIcon, getToolInvocationIcon };