@codingame/monaco-vscode-katex-common 26.2.2 → 27.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.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +35 -11
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +168 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +381 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +109 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +51 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +36 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +241 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +252 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +48 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +351 -422
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +69 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +61 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +441 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +52 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +86 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +20 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +108 -27
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +0 -42
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
- /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
|
@@ -16,6 +16,7 @@ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/even
|
|
|
16
16
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
17
17
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
18
18
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
19
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
19
20
|
import { Disposable, DisposableStore, dispose, toDisposable, thenIfNotDisposed } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
20
21
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
21
22
|
import { FileAccess, Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
@@ -23,7 +24,7 @@ import { clamp } from '@codingame/monaco-vscode-api/vscode/vs/base/common/number
|
|
|
23
24
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
24
25
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
25
26
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
26
|
-
import { createActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
27
|
+
import { MenuEntryActionViewItem, createActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
27
28
|
import { MenuWorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
28
29
|
import { MenuId, MenuItemAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
29
30
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
@@ -36,22 +37,26 @@ import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platfo
|
|
|
36
37
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
37
38
|
import { isDark } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
38
39
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
40
|
+
import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
41
|
+
import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
39
42
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
40
43
|
import { IWorkbenchIssueService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/issue/common/issue.service';
|
|
41
44
|
import { CodiconActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
|
|
42
|
-
import { annotateSpecialMarkdownContent,
|
|
45
|
+
import { annotateSpecialMarkdownContent, hasEditCodeblockUriTag, extractSubAgentInvocationIdFromText } from '../../common/widget/annotations.js';
|
|
43
46
|
import { checkModeOption } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
44
47
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
45
48
|
import { chatSubcommandLeader } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
46
49
|
import { ChatAgentVoteDirection, ChatRequestQueueKind, IChatToolInvocation, isChatFollowup, ChatErrorLevel, ChatAgentVoteDownReason } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
47
50
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
51
|
+
import { ChatQuestionCarouselData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatQuestionCarouselData';
|
|
48
52
|
import { localChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
49
53
|
import { getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
50
54
|
import { isResponseVM, isPendingDividerVM, isRequestVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
51
55
|
import { getNWords } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatWordCounter';
|
|
52
56
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
53
|
-
import { ChatAgentLocation, ChatConfiguration, CollapsedToolsDisplayMode, ThinkingDisplayMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
54
|
-
import {
|
|
57
|
+
import { ChatAgentLocation, ChatConfiguration, CollapsedToolsDisplayMode, ThinkingDisplayMode, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
58
|
+
import { ClickAnimation } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/animations/animations';
|
|
59
|
+
import { MarkUnhelpfulActionId, MarkHelpfulActionId } from '../actions/chatTitleActions.js';
|
|
55
60
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
56
61
|
import { ChatAgentHover, getChatAgentHoverOptions } from './chatAgentHover.js';
|
|
57
62
|
import { ChatContentMarkdownRenderer } from './chatContentMarkdownRenderer.js';
|
|
@@ -80,18 +85,19 @@ import { ChatTaskContentPart } from './chatContentParts/chatTaskContentPart.js';
|
|
|
80
85
|
import { ChatTextEditContentPart } from './chatContentParts/chatTextEditContentPart.js';
|
|
81
86
|
import { ChatThinkingContentPart } from './chatContentParts/chatThinkingContentPart.js';
|
|
82
87
|
import { ChatSubagentContentPart } from './chatContentParts/chatSubagentContentPart.js';
|
|
83
|
-
import { ChatTipContentPart } from './chatContentParts/chatTipContentPart.js';
|
|
84
88
|
import { TreePool, ChatTreeContentPart } from './chatContentParts/chatTreeContentPart.js';
|
|
85
89
|
import { ChatWorkspaceEditContentPart } from './chatContentParts/chatWorkspaceEditContentPart.js';
|
|
86
90
|
import { ChatToolInvocationPart } from './chatContentParts/toolInvocationParts/chatToolInvocationPart.js';
|
|
87
91
|
import { ChatMarkdownDecorationsRenderer } from './chatContentParts/chatMarkdownDecorationsRenderer.js';
|
|
88
92
|
import { ChatCodeBlockContentProvider } from './chatContentParts/codeBlockPart.js';
|
|
89
93
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
90
|
-
import { RunSubagentTool } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool';
|
|
91
94
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
92
|
-
import {
|
|
95
|
+
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
93
96
|
import { ChatHookContentPart } from './chatContentParts/chatHookContentPart.js';
|
|
94
97
|
import { HookType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookSchema';
|
|
98
|
+
import { ChatQuestionCarouselAutoReply } from './chatQuestionCarouselAutoReply.js';
|
|
99
|
+
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
100
|
+
import { AccessibilityWorkbenchSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
95
101
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
96
102
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
97
103
|
|
|
@@ -99,6 +105,20 @@ var ChatListItemRenderer_1;
|
|
|
99
105
|
const $ = $$1;
|
|
100
106
|
const COPILOT_USERNAME = "GitHub Copilot";
|
|
101
107
|
const mostRecentResponseClassName = "chat-most-recent-response";
|
|
108
|
+
function upvoteAnimationSettingToEnum(value) {
|
|
109
|
+
switch (value) {
|
|
110
|
+
case "confetti":
|
|
111
|
+
return ClickAnimation.Confetti;
|
|
112
|
+
case "floatingThumbs":
|
|
113
|
+
return ClickAnimation.FloatingIcons;
|
|
114
|
+
case "pulseWave":
|
|
115
|
+
return ClickAnimation.PulseWave;
|
|
116
|
+
case "radiantLines":
|
|
117
|
+
return ClickAnimation.RadiantLines;
|
|
118
|
+
default:
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
102
122
|
let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
103
123
|
static {
|
|
104
124
|
ChatListItemRenderer_1 = this;
|
|
@@ -123,7 +143,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
123
143
|
chatWidgetService,
|
|
124
144
|
chatEntitlementService,
|
|
125
145
|
chatService,
|
|
126
|
-
|
|
146
|
+
accessibilitySignalService,
|
|
147
|
+
accessibilityService,
|
|
148
|
+
environmentService
|
|
127
149
|
) {
|
|
128
150
|
super();
|
|
129
151
|
this.rendererOptions = rendererOptions;
|
|
@@ -140,16 +162,21 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
140
162
|
this.chatWidgetService = chatWidgetService;
|
|
141
163
|
this.chatEntitlementService = chatEntitlementService;
|
|
142
164
|
this.chatService = chatService;
|
|
143
|
-
this.
|
|
165
|
+
this.accessibilitySignalService = accessibilitySignalService;
|
|
166
|
+
this.accessibilityService = accessibilityService;
|
|
167
|
+
this.environmentService = environmentService;
|
|
144
168
|
this.codeBlocksByResponseId = ( new Map());
|
|
145
169
|
this.codeBlocksByEditorUri = ( new ResourceMap());
|
|
146
170
|
this.fileTreesByResponseId = ( new Map());
|
|
147
171
|
this.focusedFileTreesByResponseId = ( new Map());
|
|
148
172
|
this.templateDataByRequestId = ( new Map());
|
|
173
|
+
this.responseTemplateDataByRequestId = ( new Map());
|
|
149
174
|
this.pendingQuestionCarousels = ( new ResourceMap());
|
|
175
|
+
this._autoRepliedQuestionCarousels = ( new Set());
|
|
176
|
+
this._notifiedQuestionCarousels = ( new Set());
|
|
150
177
|
this._onDidClickFollowup = this._register(( new Emitter()));
|
|
151
178
|
this.onDidClickFollowup = this._onDidClickFollowup.event;
|
|
152
|
-
this._onDidClickRerunWithAgentOrCommandDetection = ( new Emitter());
|
|
179
|
+
this._onDidClickRerunWithAgentOrCommandDetection = this._register(( new Emitter()));
|
|
153
180
|
this.onDidClickRerunWithAgentOrCommandDetection = this._onDidClickRerunWithAgentOrCommandDetection.event;
|
|
154
181
|
this._onDidClickRequest = this._register(( new Emitter()));
|
|
155
182
|
this.onDidClickRequest = this._onDidClickRequest.event;
|
|
@@ -190,6 +217,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
190
217
|
this._toolInvocationCodeBlockCollection = this._register(
|
|
191
218
|
this.instantiationService.createInstance(CodeBlockModelCollection, "tools")
|
|
192
219
|
);
|
|
220
|
+
this._autoReply = this._register(this.instantiationService.createInstance(ChatQuestionCarouselAutoReply));
|
|
193
221
|
this._register(this.chatService.onDidSubmitRequest(e => {
|
|
194
222
|
const carousels = this.pendingQuestionCarousels.get(e.chatSessionResource);
|
|
195
223
|
if (carousels) {
|
|
@@ -220,10 +248,27 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
220
248
|
this.logService.trace(`ChatListItemRenderer#${method}: ${message}`);
|
|
221
249
|
}
|
|
222
250
|
}
|
|
251
|
+
fireItemHeightChange(template, measuredHeight) {
|
|
252
|
+
if (!template.currentElement || !template.rowContainer.isConnected) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const height = measuredHeight ?? template.rowContainer.getBoundingClientRect().height;
|
|
256
|
+
if (height === 0 || !height) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const normalizedHeight = Math.ceil(height);
|
|
260
|
+
template.currentElement.currentRenderedHeight = normalizedHeight;
|
|
261
|
+
if (template.currentElement !== this._elementBeingRendered) {
|
|
262
|
+
this._onDidChangeItemHeight.fire({
|
|
263
|
+
element: template.currentElement,
|
|
264
|
+
height: normalizedHeight
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
223
268
|
getProgressiveRenderRate(element) {
|
|
224
269
|
let Rate;
|
|
225
270
|
(function(Rate) {
|
|
226
|
-
Rate[Rate["Min"] =
|
|
271
|
+
Rate[Rate["Min"] = 40] = "Min";
|
|
227
272
|
Rate[Rate["Max"] = 2000] = "Max";
|
|
228
273
|
})(Rate || (Rate = {}));
|
|
229
274
|
const minAfterComplete = 80;
|
|
@@ -247,10 +292,13 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
247
292
|
updateViewModel(viewModel) {
|
|
248
293
|
this.viewModel = viewModel;
|
|
249
294
|
this._announcedToolProgressKeys.clear();
|
|
295
|
+
this._autoRepliedQuestionCarousels.clear();
|
|
296
|
+
this._notifiedQuestionCarousels.clear();
|
|
250
297
|
this.codeBlocksByEditorUri.clear();
|
|
251
298
|
this.codeBlocksByResponseId.clear();
|
|
252
299
|
this.fileTreesByResponseId.clear();
|
|
253
300
|
this.focusedFileTreesByResponseId.clear();
|
|
301
|
+
this.responseTemplateDataByRequestId.clear();
|
|
254
302
|
this._editorPool.clear();
|
|
255
303
|
this._toolEditorPool.clear();
|
|
256
304
|
this._diffEditorPool.clear();
|
|
@@ -345,8 +393,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
345
393
|
}
|
|
346
394
|
this.hoverHidden(requestHover);
|
|
347
395
|
const checkpointContainer = append(rowContainer, $(".checkpoint-container"));
|
|
348
|
-
|
|
349
|
-
append(codiconContainer, $("span.codicon.codicon-bookmark"));
|
|
396
|
+
append(checkpointContainer, $(".checkpoint-line-left"));
|
|
350
397
|
const checkpointToolbar = templateDisposables.add(
|
|
351
398
|
scopedInstantiationService.createInstance(MenuWorkbenchToolBar, checkpointContainer, MenuId.ChatMessageCheckpoint, {
|
|
352
399
|
actionViewItemProvider: (action, options) => {
|
|
@@ -366,7 +413,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
366
413
|
}
|
|
367
414
|
})
|
|
368
415
|
);
|
|
369
|
-
append(checkpointContainer, $(".checkpoint-
|
|
416
|
+
append(checkpointContainer, $(".checkpoint-line-right"));
|
|
370
417
|
const user = append(header, $(".user"));
|
|
371
418
|
const avatarContainer = append(user, $(".avatar-container"));
|
|
372
419
|
const username = append(user, $("h3.username"));
|
|
@@ -394,6 +441,13 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
394
441
|
if (action instanceof MenuItemAction && action.item.id === MarkUnhelpfulActionId) {
|
|
395
442
|
return scopedInstantiationService.createInstance(ChatVoteDownButton, action, options);
|
|
396
443
|
}
|
|
444
|
+
if (action instanceof MenuItemAction && action.item.id === MarkHelpfulActionId) {
|
|
445
|
+
const animation = upvoteAnimationSettingToEnum(this.configService.getValue("chat.upvoteAnimation"));
|
|
446
|
+
return scopedInstantiationService.createInstance(MenuEntryActionViewItem, action, {
|
|
447
|
+
...options,
|
|
448
|
+
onClickAnimation: animation
|
|
449
|
+
});
|
|
450
|
+
}
|
|
397
451
|
return createActionViewItem(scopedInstantiationService, action, options);
|
|
398
452
|
}
|
|
399
453
|
})
|
|
@@ -401,10 +455,12 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
401
455
|
const footerDetailsContainer = append(footerToolbar.getElement(), $(".chat-footer-details"));
|
|
402
456
|
footerDetailsContainer.tabIndex = 0;
|
|
403
457
|
const checkpointRestoreContainer = append(rowContainer, $(".checkpoint-restore-container"));
|
|
404
|
-
|
|
405
|
-
append(codiconRestoreContainer, $("span.codicon.codicon-bookmark"));
|
|
458
|
+
append(checkpointRestoreContainer, $(".checkpoint-line-left"));
|
|
406
459
|
const label = append(checkpointRestoreContainer, $("span.checkpoint-label-text"));
|
|
407
|
-
label.textContent = ( localize(
|
|
460
|
+
label.textContent = ( localize(6630, "Checkpoint Restored"));
|
|
461
|
+
const dot = append(checkpointRestoreContainer, $("span.checkpoint-dot-separator"));
|
|
462
|
+
dot.textContent = "·";
|
|
463
|
+
dot.setAttribute("aria-hidden", "true");
|
|
408
464
|
const checkpointRestoreToolbar = templateDisposables.add(scopedInstantiationService.createInstance(
|
|
409
465
|
MenuWorkbenchToolBar,
|
|
410
466
|
checkpointRestoreContainer,
|
|
@@ -427,7 +483,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
427
483
|
}
|
|
428
484
|
}
|
|
429
485
|
));
|
|
430
|
-
append(checkpointRestoreContainer, $(".checkpoint-
|
|
486
|
+
append(checkpointRestoreContainer, $(".checkpoint-line-right"));
|
|
431
487
|
const agentHover = templateDisposables.add(this.instantiationService.createInstance(ChatAgentHover));
|
|
432
488
|
const hoverContent = () => {
|
|
433
489
|
if (isResponseVM(template.currentElement) && template.currentElement.agent && !template.currentElement.agent.isDefault) {
|
|
@@ -506,23 +562,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
506
562
|
}
|
|
507
563
|
}));
|
|
508
564
|
const resizeObserver = templateDisposables.add(new DisposableResizeObserver(entries => {
|
|
509
|
-
if (!template.currentElement) {
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
565
|
const entry = entries[0];
|
|
513
566
|
if (entry) {
|
|
514
|
-
|
|
515
|
-
if (height === 0 || !height || !template.rowContainer.isConnected) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
const normalizedHeight = Math.ceil(height);
|
|
519
|
-
template.currentElement.currentRenderedHeight = normalizedHeight;
|
|
520
|
-
if (template.currentElement !== this._elementBeingRendered) {
|
|
521
|
-
this._onDidChangeItemHeight.fire({
|
|
522
|
-
element: template.currentElement,
|
|
523
|
-
height: normalizedHeight
|
|
524
|
-
});
|
|
525
|
-
}
|
|
567
|
+
this.fireItemHeightChange(template, entry.borderBoxSize.at(0)?.blockSize);
|
|
526
568
|
}
|
|
527
569
|
}));
|
|
528
570
|
templateDisposables.add(resizeObserver.observe(rowContainer));
|
|
@@ -616,8 +658,14 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
616
658
|
this.renderAvatar(element, templateData);
|
|
617
659
|
}
|
|
618
660
|
templateData.username.textContent = element.username;
|
|
619
|
-
templateData.username.classList.toggle(
|
|
620
|
-
|
|
661
|
+
templateData.username.classList.toggle(
|
|
662
|
+
"hidden",
|
|
663
|
+
element.username === COPILOT_USERNAME || this.environmentService.isSessionsWindow
|
|
664
|
+
);
|
|
665
|
+
templateData.avatarContainer.classList.toggle(
|
|
666
|
+
"hidden",
|
|
667
|
+
element.username === COPILOT_USERNAME || this.environmentService.isSessionsWindow
|
|
668
|
+
);
|
|
621
669
|
this.hoverHidden(templateData.requestHover);
|
|
622
670
|
clearNode(templateData.detail);
|
|
623
671
|
if (isResponseVM(element)) {
|
|
@@ -627,6 +675,35 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
627
675
|
const checkpointEnabled = this.configService.getValue(ChatConfiguration.CheckpointsEnabled) && (this.rendererOptions.restorable ?? true);
|
|
628
676
|
const isPendingRequest = isRequestVM(element) && !!element.pendingKind;
|
|
629
677
|
templateData.checkpointContainer.classList.toggle("hidden", isResponseVM(element) || isPendingRequest || !checkpointEnabled);
|
|
678
|
+
if (isResponseVM(element)) {
|
|
679
|
+
this.responseTemplateDataByRequestId.set(element.requestId, templateData);
|
|
680
|
+
templateData.elementDisposables.add(
|
|
681
|
+
toDisposable(() => this.responseTemplateDataByRequestId.delete(element.requestId))
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
if (!isPendingRequest) {
|
|
685
|
+
const setGroupHover = hovered => {
|
|
686
|
+
const requestId = isRequestVM(element) ? element.id : isResponseVM(element) ? element.requestId : undefined;
|
|
687
|
+
if (!requestId) {
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
const reqData = this.templateDataByRequestId.get(requestId);
|
|
691
|
+
const resData = this.responseTemplateDataByRequestId.get(requestId);
|
|
692
|
+
reqData?.checkpointContainer.classList.toggle("group-hovered", hovered);
|
|
693
|
+
resData?.rowContainer.classList.toggle("group-hovered", hovered);
|
|
694
|
+
};
|
|
695
|
+
templateData.elementDisposables.add(addDisposableListener(
|
|
696
|
+
templateData.rowContainer,
|
|
697
|
+
EventType.MOUSE_ENTER,
|
|
698
|
+
() => setGroupHover(true)
|
|
699
|
+
));
|
|
700
|
+
templateData.elementDisposables.add(addDisposableListener(
|
|
701
|
+
templateData.rowContainer,
|
|
702
|
+
EventType.MOUSE_LEAVE,
|
|
703
|
+
() => setGroupHover(false)
|
|
704
|
+
));
|
|
705
|
+
templateData.elementDisposables.add(toDisposable(() => setGroupHover(false)));
|
|
706
|
+
}
|
|
630
707
|
const shouldShowRestore = this.viewModel?.model.checkpoint && !this.viewModel?.editing && (index === this.delegate.getListLength() - 1) && !isPendingRequest;
|
|
631
708
|
templateData.checkpointRestoreContainer.classList.toggle("hidden", !(shouldShowRestore && checkpointEnabled));
|
|
632
709
|
const editing = element.id === this.viewModel?.editing?.id;
|
|
@@ -657,7 +734,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
657
734
|
}
|
|
658
735
|
})
|
|
659
736
|
);
|
|
660
|
-
templateData.rowContainer.parentElement?.parentElement?.parentElement
|
|
737
|
+
const rowRoot = templateData.rowContainer.parentElement?.parentElement?.parentElement;
|
|
738
|
+
rowRoot?.classList.toggle("request", isRequestVM(element));
|
|
739
|
+
rowRoot?.classList.toggle("response", isResponseVM(element));
|
|
661
740
|
templateData.rowContainer.classList.toggle(mostRecentResponseClassName, index === this.delegate.getListLength() - 1);
|
|
662
741
|
templateData.rowContainer.classList.toggle("confirmation-message", isRequestVM(element) && !!element.confirmation);
|
|
663
742
|
const shouldShowHeader = isResponseVM(element) && !this.rendererOptions.noHeader;
|
|
@@ -707,11 +786,11 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
707
786
|
const dividerContent = $$1(".pending-divider-content");
|
|
708
787
|
const label = append(dividerContent, $$1("span.pending-divider-label"));
|
|
709
788
|
if (element.dividerKind === ChatRequestQueueKind.Steering) {
|
|
710
|
-
label.textContent = ( localize(
|
|
711
|
-
label.title = ( localize(
|
|
789
|
+
label.textContent = ( localize(6631, "Steering"));
|
|
790
|
+
label.title = ( localize(6632, "Steering message will be sent after the next tool call happens"));
|
|
712
791
|
} else {
|
|
713
|
-
label.textContent = ( localize(
|
|
714
|
-
label.title = ( localize(
|
|
792
|
+
label.textContent = ( localize(6633, "Queued"));
|
|
793
|
+
label.title = ( localize(6634, "Queued messages will be sent after the current request completes"));
|
|
715
794
|
}
|
|
716
795
|
templateData.value.appendChild(dividerContent);
|
|
717
796
|
}
|
|
@@ -719,10 +798,10 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
719
798
|
clearNode(templateData.detail);
|
|
720
799
|
if (element.agentOrSlashCommandDetected) {
|
|
721
800
|
const msg = element.slashCommand ? ( localize(
|
|
722
|
-
|
|
801
|
+
6635,
|
|
723
802
|
"used {0} [[(rerun without)]]",
|
|
724
803
|
`${chatSubcommandLeader}${element.slashCommand.name}`
|
|
725
|
-
)) : ( localize(
|
|
804
|
+
)) : ( localize(6636, "[[(rerun without)]]"));
|
|
726
805
|
reset(templateData.detail, renderFormattedText(msg, {
|
|
727
806
|
actionHandler: {
|
|
728
807
|
disposables: templateData.elementDisposables,
|
|
@@ -735,7 +814,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
735
814
|
this.delegate.currentChatMode(),
|
|
736
815
|
this.rendererOptions.progressMessageAtBottomOfResponse
|
|
737
816
|
)) {
|
|
738
|
-
templateData.detail.textContent = ( localize(
|
|
817
|
+
templateData.detail.textContent = ( localize(6637, "Working"));
|
|
739
818
|
}
|
|
740
819
|
}
|
|
741
820
|
renderConfirmationAction(element, templateData) {
|
|
@@ -744,9 +823,19 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
744
823
|
append(templateData.detail, $("span.codicon.codicon-check", {
|
|
745
824
|
"aria-hidden": "true"
|
|
746
825
|
}));
|
|
747
|
-
append(templateData.detail, $("span.confirmation-text", undefined, ( localize(
|
|
826
|
+
append(templateData.detail, $("span.confirmation-text", undefined, ( localize(6638, "Selected \"{0}\"", element.confirmation))));
|
|
748
827
|
templateData.header?.classList.remove("header-disabled");
|
|
749
828
|
templateData.header?.classList.add("partially-disabled");
|
|
829
|
+
const updateCheckmarks = () => templateData.detail.classList.toggle(
|
|
830
|
+
"show-checkmarks",
|
|
831
|
+
!!this.configService.getValue(AccessibilityWorkbenchSettingId.ShowChatCheckmarks)
|
|
832
|
+
);
|
|
833
|
+
updateCheckmarks();
|
|
834
|
+
templateData.elementDisposables.add(this.configService.onDidChangeConfiguration(e => {
|
|
835
|
+
if (e.affectsConfiguration(AccessibilityWorkbenchSettingId.ShowChatCheckmarks)) {
|
|
836
|
+
updateCheckmarks();
|
|
837
|
+
}
|
|
838
|
+
}));
|
|
750
839
|
}
|
|
751
840
|
}
|
|
752
841
|
renderAvatar(element, templateData) {
|
|
@@ -845,10 +934,15 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
845
934
|
}
|
|
846
935
|
const collapsedToolsMode = this.configService.getValue("chat.agent.thinking.collapsedTools");
|
|
847
936
|
if (collapsedToolsMode !== CollapsedToolsDisplayMode.Off && ( partsToRender.some(
|
|
848
|
-
part => (part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") &&
|
|
937
|
+
part => (part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") && this.shouldPinPart(part, element)
|
|
849
938
|
))) {
|
|
850
939
|
return false;
|
|
851
940
|
}
|
|
941
|
+
const hasRenderedThinkingPart = ( (templateData.renderedParts ?? []).some(part => part instanceof ChatThinkingContentPart));
|
|
942
|
+
const hasEditPillMarkdown = ( partsToRender.some(part => part.kind === "markdownContent" && this.hasCodeblockUri(part)));
|
|
943
|
+
if (hasRenderedThinkingPart && hasEditPillMarkdown) {
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
852
946
|
if (this.getSubagentPart(templateData.renderedParts)) {
|
|
853
947
|
return false;
|
|
854
948
|
}
|
|
@@ -930,12 +1024,6 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
930
1024
|
}
|
|
931
1025
|
clearNode(templateData.value);
|
|
932
1026
|
const parts = [];
|
|
933
|
-
const tip = this.chatTipService.getNextTip(element.id, element.timestamp, this.contextKeyService);
|
|
934
|
-
if (tip) {
|
|
935
|
-
const tipPart = ( new ChatTipContentPart(tip, this.chatContentMarkdownRenderer));
|
|
936
|
-
templateData.value.appendChild(tipPart.domNode);
|
|
937
|
-
templateData.elementDisposables.add(tipPart);
|
|
938
|
-
}
|
|
939
1027
|
let inlineSlashCommandRendered = false;
|
|
940
1028
|
content.forEach((data, contentIndex) => {
|
|
941
1029
|
const context = {
|
|
@@ -1041,8 +1129,10 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1041
1129
|
renderChatContentDiff(partsToRender, contentForThisTurn, element, elementIndex, templateData) {
|
|
1042
1130
|
const renderedParts = templateData.renderedParts ?? [];
|
|
1043
1131
|
templateData.renderedParts = renderedParts;
|
|
1132
|
+
const lastMarkdownIndex = partsToRender.findLastIndex(part => part?.kind === "markdownContent");
|
|
1044
1133
|
partsToRender.forEach((partToRender, contentIndex) => {
|
|
1045
1134
|
const alreadyRenderedPart = templateData.renderedParts?.[contentIndex];
|
|
1135
|
+
const isFinalAnswerPart = partToRender?.kind === "markdownContent" && contentIndex === lastMarkdownIndex && element.isComplete;
|
|
1046
1136
|
if (!partToRender) {
|
|
1047
1137
|
if (!templateData.renderedPartsMounted) {
|
|
1048
1138
|
alreadyRenderedPart?.onDidRemount?.();
|
|
@@ -1056,11 +1146,17 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1056
1146
|
}
|
|
1057
1147
|
renderedParts[contentIndex] = alreadyRenderedPart;
|
|
1058
1148
|
return;
|
|
1059
|
-
} else if (alreadyRenderedPart instanceof ChatThinkingContentPart && this.shouldPinPart(partToRender, element)) {
|
|
1149
|
+
} else if (alreadyRenderedPart instanceof ChatThinkingContentPart && this.shouldPinPart(partToRender, element) && !isFinalAnswerPart) {
|
|
1060
1150
|
renderedParts[contentIndex] = alreadyRenderedPart;
|
|
1061
1151
|
return;
|
|
1062
1152
|
}
|
|
1063
1153
|
alreadyRenderedPart.dispose();
|
|
1154
|
+
if (alreadyRenderedPart.domNode) {
|
|
1155
|
+
const thinkingToolWrapper = findParentWithClass(alreadyRenderedPart.domNode, "chat-thinking-tool-wrapper");
|
|
1156
|
+
if (thinkingToolWrapper) {
|
|
1157
|
+
thinkingToolWrapper.replaceWith(alreadyRenderedPart.domNode);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1064
1160
|
}
|
|
1065
1161
|
const preceedingContentParts = renderedParts.slice(0, contentIndex);
|
|
1066
1162
|
const context = {
|
|
@@ -1082,7 +1178,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1082
1178
|
}
|
|
1083
1179
|
};
|
|
1084
1180
|
const lastThinking = this.getLastThinkingPart(renderedParts);
|
|
1085
|
-
if (lastThinking && (partToRender.kind === "toolInvocation" || partToRender.kind === "toolInvocationSerialized" || partToRender.kind === "markdownContent" || partToRender.kind === "textEditGroup" || partToRender.kind === "hook") && this.shouldPinPart(partToRender, element)) {
|
|
1181
|
+
if (lastThinking && (partToRender.kind === "toolInvocation" || partToRender.kind === "toolInvocationSerialized" || partToRender.kind === "markdownContent" || partToRender.kind === "textEditGroup" || partToRender.kind === "hook") && this.shouldPinPart(partToRender, element) && !isFinalAnswerPart) {
|
|
1086
1182
|
const newPart = this.renderChatContentPart(partToRender, templateData, context);
|
|
1087
1183
|
if (newPart) {
|
|
1088
1184
|
renderedParts[contentIndex] = newPart;
|
|
@@ -1228,9 +1324,16 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1228
1324
|
}
|
|
1229
1325
|
diff(renderedParts, contentToRender, element) {
|
|
1230
1326
|
const diff = [];
|
|
1327
|
+
const elementIsComplete = isResponseVM(element) && element.isComplete;
|
|
1328
|
+
const lastMarkdownContentIndex = contentToRender.findLastIndex(part => part.kind === "markdownContent");
|
|
1231
1329
|
for (let i = 0; i < contentToRender.length; i++) {
|
|
1232
1330
|
const content = contentToRender[i];
|
|
1233
1331
|
const renderedPart = renderedParts[i];
|
|
1332
|
+
const isFinalAnswerPart = content.kind === "markdownContent" && i === lastMarkdownContentIndex && elementIsComplete;
|
|
1333
|
+
if (isFinalAnswerPart && this.isRenderedPartInsideThinking(renderedPart)) {
|
|
1334
|
+
diff.push(content);
|
|
1335
|
+
continue;
|
|
1336
|
+
}
|
|
1234
1337
|
if (!renderedPart || !renderedPart.hasSameContent(content, contentToRender.slice(i + 1), element)) {
|
|
1235
1338
|
diff.push(content);
|
|
1236
1339
|
} else {
|
|
@@ -1239,11 +1342,17 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1239
1342
|
}
|
|
1240
1343
|
return diff;
|
|
1241
1344
|
}
|
|
1345
|
+
isRenderedPartInsideThinking(renderedPart) {
|
|
1346
|
+
if (!renderedPart?.domNode) {
|
|
1347
|
+
return false;
|
|
1348
|
+
}
|
|
1349
|
+
return !!findParentWithClass(renderedPart.domNode, "chat-thinking-box");
|
|
1350
|
+
}
|
|
1242
1351
|
hasCodeblockUri(part) {
|
|
1243
1352
|
if (part.kind !== "markdownContent") {
|
|
1244
1353
|
return false;
|
|
1245
1354
|
}
|
|
1246
|
-
return
|
|
1355
|
+
return hasEditCodeblockUriTag(part.content.value);
|
|
1247
1356
|
}
|
|
1248
1357
|
isCodeblockComplete(part, element) {
|
|
1249
1358
|
if (part.kind !== "markdownContent") {
|
|
@@ -1279,12 +1388,11 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1279
1388
|
if (isMermaidTool) {
|
|
1280
1389
|
return false;
|
|
1281
1390
|
}
|
|
1282
|
-
const isAskQuestionsTool = (part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") && part.toolId === "copilot_askQuestions";
|
|
1391
|
+
const isAskQuestionsTool = (part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") && (part.toolId === "copilot_askQuestions" || part.toolId === "vscode_askQuestions");
|
|
1283
1392
|
if (isAskQuestionsTool) {
|
|
1284
1393
|
return false;
|
|
1285
1394
|
}
|
|
1286
|
-
|
|
1287
|
-
if (isSubagentTool) {
|
|
1395
|
+
if ((part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") && isSubagentToolInvocation(part)) {
|
|
1288
1396
|
return false;
|
|
1289
1397
|
}
|
|
1290
1398
|
const isTerminalTool = (part.kind === "toolInvocation" || part.kind === "toolInvocationSerialized") && part.toolSpecificData?.kind === "terminal";
|
|
@@ -1367,7 +1475,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1367
1475
|
this.finalizeCurrentThinkingPart(context, templateData);
|
|
1368
1476
|
const lastSubagent = this.getSubagentPart(templateData.renderedParts, subagentId);
|
|
1369
1477
|
if (lastSubagent) {
|
|
1370
|
-
if (toolInvocation
|
|
1478
|
+
if (!isParentSubagentTool(toolInvocation)) {
|
|
1371
1479
|
lastSubagent.appendToolInvocation(toolInvocation, codeBlockStartIndex);
|
|
1372
1480
|
}
|
|
1373
1481
|
return lastSubagent;
|
|
@@ -1384,7 +1492,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1384
1492
|
this._toolInvocationCodeBlockCollection,
|
|
1385
1493
|
this._announcedToolProgressKeys
|
|
1386
1494
|
);
|
|
1387
|
-
if (toolInvocation
|
|
1495
|
+
if (!isParentSubagentTool(toolInvocation)) {
|
|
1388
1496
|
subagentPart.appendToolInvocation(toolInvocation, codeBlockStartIndex);
|
|
1389
1497
|
}
|
|
1390
1498
|
return subagentPart;
|
|
@@ -1421,7 +1529,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1421
1529
|
}
|
|
1422
1530
|
}
|
|
1423
1531
|
}
|
|
1424
|
-
const isSubagentContent = (content.kind === "toolInvocation" || content.kind === "toolInvocationSerialized") && (content
|
|
1532
|
+
const isSubagentContent = (content.kind === "toolInvocation" || content.kind === "toolInvocationSerialized") && isSubagentToolInvocation(content);
|
|
1425
1533
|
if (context.element.isComplete && !isSubagentContent) {
|
|
1426
1534
|
for (const templateData of ( this.templateDataByRequestId.values())) {
|
|
1427
1535
|
this.finalizeAllSubagentParts(templateData);
|
|
@@ -1440,7 +1548,8 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1440
1548
|
undefined,
|
|
1441
1549
|
undefined,
|
|
1442
1550
|
undefined,
|
|
1443
|
-
undefined
|
|
1551
|
+
undefined,
|
|
1552
|
+
content.shimmer
|
|
1444
1553
|
);
|
|
1445
1554
|
} else if (content.kind === "working") {
|
|
1446
1555
|
return this.instantiationService.createInstance(
|
|
@@ -1470,6 +1579,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1470
1579
|
} else if (content.kind === "markdownContent") {
|
|
1471
1580
|
return this.renderMarkdown(content, templateData, context);
|
|
1472
1581
|
} else if (content.kind === "references") {
|
|
1582
|
+
if (isResponseVM(context.element) && context.element.model.request?.modeInfo?.modeId === ChatModeKind.Agent) {
|
|
1583
|
+
return this.renderNoContent(other => other.kind === content.kind);
|
|
1584
|
+
}
|
|
1473
1585
|
return this.renderContentReferencesListData(content, undefined, context, templateData);
|
|
1474
1586
|
} else if (content.kind === "codeCitations") {
|
|
1475
1587
|
return this.renderCodeCitations(content, context, templateData);
|
|
@@ -1510,7 +1622,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1510
1622
|
"ChatListItemRenderer#renderChatContentPart: error rendering content",
|
|
1511
1623
|
toErrorMessage(err, true)
|
|
1512
1624
|
);
|
|
1513
|
-
const errorPart = this.instantiationService.createInstance(ChatErrorContentPart, ChatErrorLevel.Error, ( new MarkdownString(( localize(
|
|
1625
|
+
const errorPart = this.instantiationService.createInstance(ChatErrorContentPart, ChatErrorLevel.Error, ( new MarkdownString(( localize(6639, "Failed to render content")) + `: ${toErrorMessage(err, false)}`)), content, this.chatContentMarkdownRenderer);
|
|
1514
1626
|
return {
|
|
1515
1627
|
dispose: () => errorPart.dispose(),
|
|
1516
1628
|
domNode: errorPart.domNode,
|
|
@@ -1701,7 +1813,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1701
1813
|
this.finalizeCurrentThinkingPart(context, templateData);
|
|
1702
1814
|
}
|
|
1703
1815
|
}
|
|
1704
|
-
const subagentId = toolInvocation
|
|
1816
|
+
const subagentId = getSubagentId(toolInvocation);
|
|
1705
1817
|
if (subagentId && isResponseVM(context.element) && toolInvocation.presentation !== "hidden") {
|
|
1706
1818
|
return this.handleSubagentToolGrouping(toolInvocation, subagentId, context, templateData, codeBlockStartIndex);
|
|
1707
1819
|
}
|
|
@@ -1786,7 +1898,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1786
1898
|
}
|
|
1787
1899
|
const shouldPinToThinking = hookPart.hookType === HookType.PreToolUse || hookPart.hookType === HookType.PostToolUse;
|
|
1788
1900
|
if (shouldPinToThinking) {
|
|
1789
|
-
const hookTitle = hookPart.stopReason ? (hookPart.toolDisplayName ? ( localize(
|
|
1901
|
+
const hookTitle = hookPart.stopReason ? (hookPart.toolDisplayName ? ( localize(6640, "Blocked {0}", hookPart.toolDisplayName)) : ( localize(6641, "Blocked by hook"))) : (hookPart.toolDisplayName ? ( localize(6642, "Used {0}, but received a warning", hookPart.toolDisplayName)) : ( localize(6643, "Tool call received a warning")));
|
|
1790
1902
|
let thinkingPart = this.getLastThinkingPart(templateData.renderedParts);
|
|
1791
1903
|
if (!thinkingPart) {
|
|
1792
1904
|
const newThinking = this.renderThinkingPart({
|
|
@@ -1841,15 +1953,23 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1841
1953
|
}
|
|
1842
1954
|
renderQuestionCarousel(context, carousel, templateData) {
|
|
1843
1955
|
this.finalizeCurrentThinkingPart(context, templateData);
|
|
1956
|
+
this._notifyOnQuestionCarousel(context, carousel);
|
|
1844
1957
|
const widget = isResponseVM(context.element) ? this.chatWidgetService.getWidgetBySessionResource(context.element.sessionResource) : undefined;
|
|
1845
1958
|
const shouldAutoFocus = widget ? widget.getInput() === "" : true;
|
|
1959
|
+
const modelName = widget?.input.currentLanguageModel;
|
|
1846
1960
|
const responseId = isResponseVM(context.element) ? context.element.requestId : undefined;
|
|
1961
|
+
const requestMessageText = isResponseVM(context.element) ? this.getRequestMessageText(context.element) : undefined;
|
|
1847
1962
|
const handleSubmit = async (answers, part) => {
|
|
1848
1963
|
const answersRecord = answers ? Object.fromEntries(answers) : undefined;
|
|
1849
1964
|
if (answersRecord) {
|
|
1850
1965
|
carousel.data = answersRecord;
|
|
1851
1966
|
}
|
|
1852
1967
|
carousel.isUsed = true;
|
|
1968
|
+
if (carousel instanceof ChatQuestionCarouselData) {
|
|
1969
|
+
carousel.completion.complete({
|
|
1970
|
+
answers: answersRecord
|
|
1971
|
+
});
|
|
1972
|
+
}
|
|
1853
1973
|
if (isResponseVM(context.element) && carousel.resolveId) {
|
|
1854
1974
|
this.chatService.notifyQuestionCarouselAnswer(context.element.requestId, carousel.resolveId, answersRecord);
|
|
1855
1975
|
}
|
|
@@ -1859,6 +1979,17 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1859
1979
|
const responseIsComplete = isResponseVM(context.element) && context.element.isComplete;
|
|
1860
1980
|
const inputPartHasCarousel = widget?.input.questionCarousel !== undefined;
|
|
1861
1981
|
if (carousel.isUsed || responseIsComplete) {
|
|
1982
|
+
if (responseIsComplete && !carousel.isUsed && isResponseVM(context.element) && carousel.resolveId && carousel.data === undefined) {
|
|
1983
|
+
carousel.data = {};
|
|
1984
|
+
carousel.isUsed = true;
|
|
1985
|
+
if (carousel instanceof ChatQuestionCarouselData) {
|
|
1986
|
+
carousel.completion.complete({
|
|
1987
|
+
answers: undefined
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
this.chatService.notifyQuestionCarouselAnswer(context.element.requestId, carousel.resolveId, undefined);
|
|
1991
|
+
this.pendingQuestionCarousels.get(context.element.sessionResource)?.clear();
|
|
1992
|
+
}
|
|
1862
1993
|
if (responseIsComplete && inputPartHasCarousel && responseId) {
|
|
1863
1994
|
widget?.input.clearQuestionCarousel(responseId);
|
|
1864
1995
|
}
|
|
@@ -1878,11 +2009,24 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1878
2009
|
shouldAutoFocus,
|
|
1879
2010
|
onSubmit: async answers => handleSubmit(answers, fallbackPart)
|
|
1880
2011
|
});
|
|
2012
|
+
this.maybeAutoReplyToQuestionCarousel(
|
|
2013
|
+
context,
|
|
2014
|
+
carousel,
|
|
2015
|
+
fallbackPart,
|
|
2016
|
+
answers => handleSubmit(answers, fallbackPart),
|
|
2017
|
+
modelName,
|
|
2018
|
+
requestMessageText
|
|
2019
|
+
);
|
|
1881
2020
|
return fallbackPart;
|
|
1882
2021
|
}
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
2022
|
+
this.maybeAutoReplyToQuestionCarousel(
|
|
2023
|
+
context,
|
|
2024
|
+
carousel,
|
|
2025
|
+
part,
|
|
2026
|
+
answers => handleSubmit(answers, part),
|
|
2027
|
+
modelName,
|
|
2028
|
+
requestMessageText
|
|
2029
|
+
);
|
|
1886
2030
|
if (isResponseVM(context.element) && carousel.allowSkip && !carousel.isUsed) {
|
|
1887
2031
|
let carousels = this.pendingQuestionCarousels.get(context.element.sessionResource);
|
|
1888
2032
|
if (!carousels) {
|
|
@@ -1910,6 +2054,74 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1910
2054
|
return false;
|
|
1911
2055
|
});
|
|
1912
2056
|
}
|
|
2057
|
+
_getCarouselStableKey(context, carousel) {
|
|
2058
|
+
const requestId = isResponseVM(context.element) ? context.element.requestId : undefined;
|
|
2059
|
+
if (!requestId || !carousel.resolveId) {
|
|
2060
|
+
return undefined;
|
|
2061
|
+
}
|
|
2062
|
+
return `${requestId}::${carousel.resolveId}`;
|
|
2063
|
+
}
|
|
2064
|
+
_notifyOnQuestionCarousel(context, carousel) {
|
|
2065
|
+
if (carousel.isUsed) {
|
|
2066
|
+
return;
|
|
2067
|
+
}
|
|
2068
|
+
const stableKey = this._getCarouselStableKey(context, carousel);
|
|
2069
|
+
if (stableKey ? ( this._notifiedQuestionCarousels.has(stableKey)) : false) {
|
|
2070
|
+
return;
|
|
2071
|
+
}
|
|
2072
|
+
const questionCount = carousel.questions.length;
|
|
2073
|
+
const question = carousel.questions.length > 0 && carousel.questions[0].message ? carousel.questions[0].message : ( localize(6644, "Chat input required."));
|
|
2074
|
+
const stringQuestion = typeof question === "string" ? question : question.value;
|
|
2075
|
+
const alertMessage = questionCount === 1 ? ( localize(6645, "Chat input required (1 question): {0}", stringQuestion)) : ( localize(
|
|
2076
|
+
6646,
|
|
2077
|
+
"Chat input required ({0} questions): {1}",
|
|
2078
|
+
questionCount,
|
|
2079
|
+
stringQuestion
|
|
2080
|
+
));
|
|
2081
|
+
this.accessibilityService.alert(alertMessage);
|
|
2082
|
+
if (stableKey) {
|
|
2083
|
+
this._notifiedQuestionCarousels.add(stableKey);
|
|
2084
|
+
}
|
|
2085
|
+
const signalMessage = questionCount === 1 ? ( localize(6647, "Chat needs your input (1 question).")) : ( localize(6648, "Chat needs your input ({0} questions).", questionCount));
|
|
2086
|
+
this.accessibilitySignalService.playSignal(AccessibilitySignal.chatUserActionRequired, {
|
|
2087
|
+
allowManyInParallel: true,
|
|
2088
|
+
customAlertMessage: signalMessage
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
maybeAutoReplyToQuestionCarousel(context, carousel, part, submit, modelName, requestMessageText) {
|
|
2092
|
+
if (carousel.isUsed) {
|
|
2093
|
+
return;
|
|
2094
|
+
}
|
|
2095
|
+
const stableKey = this._getCarouselStableKey(context, carousel);
|
|
2096
|
+
if (stableKey) {
|
|
2097
|
+
if (( this._autoRepliedQuestionCarousels.has(stableKey))) {
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2100
|
+
this._autoRepliedQuestionCarousels.add(stableKey);
|
|
2101
|
+
}
|
|
2102
|
+
void this._autoReply.shouldAutoReply().then(shouldAutoReply => {
|
|
2103
|
+
if (!shouldAutoReply) {
|
|
2104
|
+
if (stableKey) {
|
|
2105
|
+
this._autoRepliedQuestionCarousels.delete(stableKey);
|
|
2106
|
+
}
|
|
2107
|
+
return;
|
|
2108
|
+
}
|
|
2109
|
+
const cts = ( new CancellationTokenSource());
|
|
2110
|
+
part.addDisposable(toDisposable(() => {
|
|
2111
|
+
cts.cancel();
|
|
2112
|
+
cts.dispose();
|
|
2113
|
+
}));
|
|
2114
|
+
this._autoReply.autoReply(carousel, submit, modelName, requestMessageText, cts.token).catch(err => {
|
|
2115
|
+
this.logService.debug("#ChatQuestionCarousel: Auto reply failed", toErrorMessage(err));
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
getRequestMessageText(response) {
|
|
2120
|
+
const requestId = response.requestId;
|
|
2121
|
+
const items = response.session.getItems();
|
|
2122
|
+
const request = items.find(item => isRequestVM(item) && item.id === requestId);
|
|
2123
|
+
return request?.messageText;
|
|
2124
|
+
}
|
|
1913
2125
|
removeCarouselFromTracking(context, part) {
|
|
1914
2126
|
if (isResponseVM(context.element)) {
|
|
1915
2127
|
const carousels = this.pendingQuestionCarousels.get(context.element.sessionResource);
|
|
@@ -1942,7 +2154,11 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1942
2154
|
}
|
|
1943
2155
|
renderMarkdown(markdown, templateData, context) {
|
|
1944
2156
|
const element = context.element;
|
|
1945
|
-
const
|
|
2157
|
+
const isFinalRenderPass = isResponseVM(element) && element.isComplete && !element.renderData;
|
|
2158
|
+
const lastPinnedPartIndex = isFinalRenderPass ? context.content.findLastIndex(
|
|
2159
|
+
c => c.kind === "thinking" || c.kind === "toolInvocation" || c.kind === "toolInvocationSerialized"
|
|
2160
|
+
) : -1;
|
|
2161
|
+
const isFinalAnswerPart = isFinalRenderPass && context.contentIndex > lastPinnedPartIndex;
|
|
1946
2162
|
if (!this.hasCodeblockUri(markdown) || isFinalAnswerPart) {
|
|
1947
2163
|
this.finalizeCurrentThinkingPart(context, templateData);
|
|
1948
2164
|
}
|
|
@@ -1961,6 +2177,9 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1961
2177
|
this.codeBlockModelCollection,
|
|
1962
2178
|
{}
|
|
1963
2179
|
);
|
|
2180
|
+
markdownPart.addDisposable(
|
|
2181
|
+
markdownPart.onDidChangeHeight(() => this.fireItemHeightChange(templateData))
|
|
2182
|
+
);
|
|
1964
2183
|
if (isRequestVM(element)) {
|
|
1965
2184
|
markdownPart.domNode.tabIndex = 0;
|
|
1966
2185
|
if (this.configService.getValue("chat.editRequests") === "inline" && this.rendererOptions.editable) {
|
|
@@ -1991,7 +2210,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
1991
2210
|
})
|
|
1992
2211
|
);
|
|
1993
2212
|
markdownPart.addDisposable(
|
|
1994
|
-
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), markdownPart.domNode, ( localize(
|
|
2213
|
+
this.hoverService.setupManagedHover(getDefaultHoverDelegate("element"), markdownPart.domNode, ( localize(6649, "Click to Edit")), {
|
|
1995
2214
|
trapFocus: true
|
|
1996
2215
|
})
|
|
1997
2216
|
);
|
|
@@ -2136,7 +2355,7 @@ let ChatListItemRenderer = class ChatListItemRenderer extends Disposable {
|
|
|
2136
2355
|
requestHover.style.opacity = "0";
|
|
2137
2356
|
}
|
|
2138
2357
|
};
|
|
2139
|
-
ChatListItemRenderer = ChatListItemRenderer_1 = ( __decorate([( __param(6, IInstantiationService)), ( __param(7, IConfigurationService)), ( __param(8, ILogService)), ( __param(9, IContextKeyService)), ( __param(10, IThemeService)), ( __param(11, ICommandService)), ( __param(12, IHoverService)), ( __param(13, IChatWidgetService)), ( __param(14, IChatEntitlementService)), ( __param(15, IChatService)), ( __param(16,
|
|
2358
|
+
ChatListItemRenderer = ChatListItemRenderer_1 = ( __decorate([( __param(6, IInstantiationService)), ( __param(7, IConfigurationService)), ( __param(8, ILogService)), ( __param(9, IContextKeyService)), ( __param(10, IThemeService)), ( __param(11, ICommandService)), ( __param(12, IHoverService)), ( __param(13, IChatWidgetService)), ( __param(14, IChatEntitlementService)), ( __param(15, IChatService)), ( __param(16, IAccessibilitySignalService)), ( __param(17, IAccessibilityService)), ( __param(18, IWorkbenchEnvironmentService))], ChatListItemRenderer));
|
|
2140
2359
|
class ChatListDelegate extends CachedListVirtualDelegate {
|
|
2141
2360
|
constructor(defaultElementHeight) {
|
|
2142
2361
|
super();
|
|
@@ -2153,15 +2372,15 @@ class ChatListDelegate extends CachedListVirtualDelegate {
|
|
|
2153
2372
|
}
|
|
2154
2373
|
}
|
|
2155
2374
|
const voteDownDetailLabels = {
|
|
2156
|
-
[ChatAgentVoteDownReason.IncorrectCode]: ( localize(
|
|
2157
|
-
[ChatAgentVoteDownReason.DidNotFollowInstructions]: ( localize(
|
|
2158
|
-
[ChatAgentVoteDownReason.MissingContext]: ( localize(
|
|
2159
|
-
[ChatAgentVoteDownReason.OffensiveOrUnsafe]: ( localize(
|
|
2160
|
-
[ChatAgentVoteDownReason.PoorlyWrittenOrFormatted]: ( localize(
|
|
2161
|
-
[ChatAgentVoteDownReason.RefusedAValidRequest]: ( localize(
|
|
2162
|
-
[ChatAgentVoteDownReason.IncompleteCode]: ( localize(
|
|
2163
|
-
[ChatAgentVoteDownReason.WillReportIssue]: ( localize(
|
|
2164
|
-
[ChatAgentVoteDownReason.Other]: ( localize(
|
|
2375
|
+
[ChatAgentVoteDownReason.IncorrectCode]: ( localize(6650, "Suggested incorrect code")),
|
|
2376
|
+
[ChatAgentVoteDownReason.DidNotFollowInstructions]: ( localize(6651, "Didn't follow instructions")),
|
|
2377
|
+
[ChatAgentVoteDownReason.MissingContext]: ( localize(6652, "Missing context")),
|
|
2378
|
+
[ChatAgentVoteDownReason.OffensiveOrUnsafe]: ( localize(6653, "Offensive or unsafe")),
|
|
2379
|
+
[ChatAgentVoteDownReason.PoorlyWrittenOrFormatted]: ( localize(6654, "Poorly written or formatted")),
|
|
2380
|
+
[ChatAgentVoteDownReason.RefusedAValidRequest]: ( localize(6655, "Refused a valid request")),
|
|
2381
|
+
[ChatAgentVoteDownReason.IncompleteCode]: ( localize(6656, "Incomplete code")),
|
|
2382
|
+
[ChatAgentVoteDownReason.WillReportIssue]: ( localize(6657, "Report an issue")),
|
|
2383
|
+
[ChatAgentVoteDownReason.Other]: ( localize(6658, "Other"))
|
|
2165
2384
|
};
|
|
2166
2385
|
let ChatVoteDownButton = class ChatVoteDownButton extends DropdownMenuActionViewItem {
|
|
2167
2386
|
constructor(
|
|
@@ -2235,5 +2454,17 @@ let ChatVoteDownButton = class ChatVoteDownButton extends DropdownMenuActionView
|
|
|
2235
2454
|
}
|
|
2236
2455
|
};
|
|
2237
2456
|
ChatVoteDownButton = ( __decorate([( __param(2, ICommandService)), ( __param(3, IWorkbenchIssueService)), ( __param(4, ILogService)), ( __param(5, IContextMenuService))], ChatVoteDownButton));
|
|
2457
|
+
function isParentSubagentTool(invocation) {
|
|
2458
|
+
return invocation.toolSpecificData?.kind === "subagent" && !invocation.subAgentInvocationId;
|
|
2459
|
+
}
|
|
2460
|
+
function getSubagentId(invocation) {
|
|
2461
|
+
if (isParentSubagentTool(invocation)) {
|
|
2462
|
+
return invocation.toolCallId;
|
|
2463
|
+
}
|
|
2464
|
+
return invocation.subAgentInvocationId;
|
|
2465
|
+
}
|
|
2466
|
+
function isSubagentToolInvocation(invocation) {
|
|
2467
|
+
return !!getSubagentId(invocation);
|
|
2468
|
+
}
|
|
2238
2469
|
|
|
2239
2470
|
export { ChatListDelegate, ChatListItemRenderer, ChatVoteDownButton };
|