@codingame/monaco-vscode-katex-common 25.1.2 → 26.0.1
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 +23 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
- package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
- 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 +80 -19
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { IMarkdownRenderer } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer";
|
|
5
|
+
import { IChatRendererContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel";
|
|
6
|
+
import { ChatTreeItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
|
+
import { IChatContentPart, IChatContentPartRenderContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts";
|
|
8
|
+
import { ChatCollapsibleContentPart } from "./chatCollapsibleContentPart.js";
|
|
9
|
+
import { IChatMarkdownContent, IChatToolInvocation, IChatToolInvocationSerialized } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
10
|
+
import { CollapsibleListPool } from "./chatReferencesContentPart.js";
|
|
11
|
+
import { EditorPool } from "./chatContentCodePools.js";
|
|
12
|
+
import { CodeBlockModelCollection } from "../../../common/widget/codeBlockModelCollection.js";
|
|
13
|
+
import { IChatMarkdownAnchorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service";
|
|
14
|
+
/**
|
|
15
|
+
* This is generally copied from ChatThinkingContentPart. We are still experimenting with both UIs so I'm not
|
|
16
|
+
* trying to refactor to share code. Both could probably be simplified when stable.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ChatSubagentContentPart extends ChatCollapsibleContentPart implements IChatContentPart {
|
|
19
|
+
readonly subAgentInvocationId: string;
|
|
20
|
+
private readonly context;
|
|
21
|
+
private readonly chatContentMarkdownRenderer;
|
|
22
|
+
private readonly listPool;
|
|
23
|
+
private readonly editorPool;
|
|
24
|
+
private readonly currentWidthDelegate;
|
|
25
|
+
private readonly codeBlockModelCollection;
|
|
26
|
+
private readonly announcedToolProgressKeys;
|
|
27
|
+
private readonly instantiationService;
|
|
28
|
+
private readonly chatMarkdownAnchorService;
|
|
29
|
+
private wrapper;
|
|
30
|
+
private isActive;
|
|
31
|
+
private hasToolItems;
|
|
32
|
+
private readonly isInitiallyComplete;
|
|
33
|
+
private promptContainer;
|
|
34
|
+
private resultContainer;
|
|
35
|
+
private lastItemWrapper;
|
|
36
|
+
private readonly layoutScheduler;
|
|
37
|
+
private description;
|
|
38
|
+
private agentName;
|
|
39
|
+
private prompt;
|
|
40
|
+
private readonly lazyItems;
|
|
41
|
+
private hasExpandedOnce;
|
|
42
|
+
private pendingPromptRender;
|
|
43
|
+
private pendingResultText;
|
|
44
|
+
private currentRunningToolMessage;
|
|
45
|
+
private toolsWaitingForConfirmation;
|
|
46
|
+
private userManuallyExpanded;
|
|
47
|
+
private autoExpandedForConfirmation;
|
|
48
|
+
/**
|
|
49
|
+
* Extracts subagent info (description, agentName, prompt) from a tool invocation.
|
|
50
|
+
*/
|
|
51
|
+
private static extractSubagentInfo;
|
|
52
|
+
constructor(subAgentInvocationId: string, toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized, context: IChatContentPartRenderContext, chatContentMarkdownRenderer: IMarkdownRenderer, listPool: CollapsibleListPool, editorPool: EditorPool, currentWidthDelegate: () => number, codeBlockModelCollection: CodeBlockModelCollection, announcedToolProgressKeys: Set<string>, instantiationService: IInstantiationService, chatMarkdownAnchorService: IChatMarkdownAnchorService, hoverService: IHoverService);
|
|
53
|
+
protected initContent(): HTMLElement;
|
|
54
|
+
/**
|
|
55
|
+
* Renders the prompt as a collapsible section at the start of the content.
|
|
56
|
+
* If the wrapper doesn't exist yet (lazy init) or subagent is initially complete,
|
|
57
|
+
* this is deferred until expanded.
|
|
58
|
+
*/
|
|
59
|
+
private renderPromptSection;
|
|
60
|
+
private doRenderPromptSection;
|
|
61
|
+
getIsActive(): boolean;
|
|
62
|
+
markAsInactive(): void;
|
|
63
|
+
finalizeTitle(): void;
|
|
64
|
+
private updateTitle;
|
|
65
|
+
/**
|
|
66
|
+
* Tracks a tool invocation's state for:
|
|
67
|
+
* 1. Updating the title with the current tool message (persists even after completion)
|
|
68
|
+
* 2. Auto-expanding when a tool is waiting for confirmation
|
|
69
|
+
* 3. Auto-collapsing when the confirmation is addressed
|
|
70
|
+
* This method is public to support testing.
|
|
71
|
+
*/
|
|
72
|
+
trackToolState(toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized): void;
|
|
73
|
+
/**
|
|
74
|
+
* Watches the tool invocation for completion and renders the result.
|
|
75
|
+
* Handles both live and serialized invocations.
|
|
76
|
+
*/
|
|
77
|
+
private watchToolCompletion;
|
|
78
|
+
/**
|
|
79
|
+
* Renders the result text as a collapsible section.
|
|
80
|
+
* If the wrapper doesn't exist yet (lazy init) or subagent is initially complete,
|
|
81
|
+
* this is deferred until expanded.
|
|
82
|
+
*/
|
|
83
|
+
renderResultText(resultText: string): void;
|
|
84
|
+
private doRenderResultText;
|
|
85
|
+
/**
|
|
86
|
+
* Appends a tool invocation to the subagent group.
|
|
87
|
+
* The tool part is created lazily - only when the subagent section is expanded,
|
|
88
|
+
* unless it's actively streaming (not initially complete), in which case render immediately.
|
|
89
|
+
*/
|
|
90
|
+
appendToolInvocation(toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized, codeBlockStartIndex: number): void;
|
|
91
|
+
/**
|
|
92
|
+
* Appends a markdown item (e.g., an edit pill) to the subagent content part.
|
|
93
|
+
* This is used to route codeblockUri parts with subAgentInvocationId to this subagent's container.
|
|
94
|
+
*/
|
|
95
|
+
appendMarkdownItem(factory: () => {
|
|
96
|
+
domNode: HTMLElement;
|
|
97
|
+
disposable?: IDisposable;
|
|
98
|
+
}, _codeblocksPartId: string | undefined, _markdown: IChatMarkdownContent, _originalParent?: HTMLElement): void;
|
|
99
|
+
/**
|
|
100
|
+
* Appends a markdown item's DOM node to the wrapper.
|
|
101
|
+
*/
|
|
102
|
+
private appendMarkdownItemToDOM;
|
|
103
|
+
protected shouldInitEarly(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a ChatToolInvocationPart for the given tool invocation.
|
|
106
|
+
*/
|
|
107
|
+
private createToolPart;
|
|
108
|
+
/**
|
|
109
|
+
* Appends a tool part's DOM node to the wrapper with appropriate icon wrapper.
|
|
110
|
+
*/
|
|
111
|
+
private appendToolPartToDOM;
|
|
112
|
+
/**
|
|
113
|
+
* Materializes a lazy item by creating the content and adding it to the DOM.
|
|
114
|
+
*/
|
|
115
|
+
private materializeLazyItem;
|
|
116
|
+
/**
|
|
117
|
+
* Materializes all pending lazy content (prompt, tool items, result) when the section is expanded.
|
|
118
|
+
* This is called when first expanded, but the wrapper must exist (created by base class initContent).
|
|
119
|
+
*/
|
|
120
|
+
private materializePendingContent;
|
|
121
|
+
private performLayout;
|
|
122
|
+
hasSameContent(other: IChatRendererContent, _followingContent: IChatRendererContent[], _element: ChatTreeItem): boolean;
|
|
123
|
+
}
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import { AnimationFrameScheduler, $, DisposableResizeObserver, append } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
6
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
7
|
+
import { rcut } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
8
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
10
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { ChatCollapsibleContentPart } from './chatCollapsibleContentPart.js';
|
|
12
|
+
import { ChatCollapsibleMarkdownContentPart } from './chatCollapsibleMarkdownContentPart.js';
|
|
13
|
+
import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
14
|
+
import { RunSubagentTool } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool';
|
|
15
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
16
|
+
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
17
|
+
import { createThinkingIcon, getToolInvocationIcon } from './chatThinkingContentPart.js';
|
|
18
|
+
import { ChatToolInvocationPart } from './toolInvocationParts/chatToolInvocationPart.js';
|
|
19
|
+
import { IChatMarkdownAnchorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service';
|
|
20
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
21
|
+
import * as chatSubagentContent from './media/chatSubagentContent.css';
|
|
22
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
23
|
+
|
|
24
|
+
var ChatSubagentContentPart_1;
|
|
25
|
+
registerCss(chatSubagentContent);
|
|
26
|
+
const MAX_TITLE_LENGTH = 100;
|
|
27
|
+
let ChatSubagentContentPart = ChatSubagentContentPart_1 = class ChatSubagentContentPart extends ChatCollapsibleContentPart {
|
|
28
|
+
static extractSubagentInfo(toolInvocation) {
|
|
29
|
+
const defaultDescription = ( localize(5894, "Running subagent..."));
|
|
30
|
+
if (toolInvocation.toolId !== RunSubagentTool.Id) {
|
|
31
|
+
return {
|
|
32
|
+
description: defaultDescription,
|
|
33
|
+
agentName: undefined,
|
|
34
|
+
prompt: undefined
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (toolInvocation.toolSpecificData?.kind === "subagent") {
|
|
38
|
+
return {
|
|
39
|
+
description: toolInvocation.toolSpecificData.description ?? defaultDescription,
|
|
40
|
+
agentName: toolInvocation.toolSpecificData.agentName,
|
|
41
|
+
prompt: toolInvocation.toolSpecificData.prompt
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (toolInvocation.kind === "toolInvocation") {
|
|
45
|
+
const state = toolInvocation.state.get();
|
|
46
|
+
const params = state.type !== IChatToolInvocation.StateKind.Streaming ? state.parameters : undefined;
|
|
47
|
+
return {
|
|
48
|
+
description: params?.description ?? defaultDescription,
|
|
49
|
+
agentName: params?.agentName,
|
|
50
|
+
prompt: params?.prompt
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
description: defaultDescription,
|
|
55
|
+
agentName: undefined,
|
|
56
|
+
prompt: undefined
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
constructor(
|
|
60
|
+
subAgentInvocationId,
|
|
61
|
+
toolInvocation,
|
|
62
|
+
context,
|
|
63
|
+
chatContentMarkdownRenderer,
|
|
64
|
+
listPool,
|
|
65
|
+
editorPool,
|
|
66
|
+
currentWidthDelegate,
|
|
67
|
+
codeBlockModelCollection,
|
|
68
|
+
announcedToolProgressKeys,
|
|
69
|
+
instantiationService,
|
|
70
|
+
chatMarkdownAnchorService,
|
|
71
|
+
hoverService
|
|
72
|
+
) {
|
|
73
|
+
const {
|
|
74
|
+
description,
|
|
75
|
+
agentName,
|
|
76
|
+
prompt
|
|
77
|
+
} = ChatSubagentContentPart_1.extractSubagentInfo(toolInvocation);
|
|
78
|
+
const prefix = agentName || ( localize(5895, "Subagent"));
|
|
79
|
+
const initialTitle = `${prefix}: ${description}`;
|
|
80
|
+
super(initialTitle, context, undefined, hoverService);
|
|
81
|
+
this.subAgentInvocationId = subAgentInvocationId;
|
|
82
|
+
this.context = context;
|
|
83
|
+
this.chatContentMarkdownRenderer = chatContentMarkdownRenderer;
|
|
84
|
+
this.listPool = listPool;
|
|
85
|
+
this.editorPool = editorPool;
|
|
86
|
+
this.currentWidthDelegate = currentWidthDelegate;
|
|
87
|
+
this.codeBlockModelCollection = codeBlockModelCollection;
|
|
88
|
+
this.announcedToolProgressKeys = announcedToolProgressKeys;
|
|
89
|
+
this.instantiationService = instantiationService;
|
|
90
|
+
this.chatMarkdownAnchorService = chatMarkdownAnchorService;
|
|
91
|
+
this.isActive = true;
|
|
92
|
+
this.hasToolItems = false;
|
|
93
|
+
this.lazyItems = [];
|
|
94
|
+
this.hasExpandedOnce = false;
|
|
95
|
+
this.pendingPromptRender = false;
|
|
96
|
+
this.toolsWaitingForConfirmation = 0;
|
|
97
|
+
this.userManuallyExpanded = false;
|
|
98
|
+
this.autoExpandedForConfirmation = false;
|
|
99
|
+
this.description = description;
|
|
100
|
+
this.agentName = agentName;
|
|
101
|
+
this.prompt = prompt;
|
|
102
|
+
this.isInitiallyComplete = this.element.isComplete;
|
|
103
|
+
const node = this.domNode;
|
|
104
|
+
node.classList.add("chat-thinking-box", "chat-thinking-fixed-mode", "chat-subagent-part");
|
|
105
|
+
if (this._collapseButton && !this.element.isComplete) {
|
|
106
|
+
this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, "spin");
|
|
107
|
+
}
|
|
108
|
+
this._register(autorun(r => {
|
|
109
|
+
this.expanded.read(r);
|
|
110
|
+
if (this._collapseButton) {
|
|
111
|
+
if (!this.element.isComplete && this.isActive) {
|
|
112
|
+
this._collapseButton.icon = ThemeIcon.modify(Codicon.loading, "spin");
|
|
113
|
+
} else {
|
|
114
|
+
this._collapseButton.icon = Codicon.check;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
118
|
+
this._register(autorun(r => {
|
|
119
|
+
if (this._isExpanded.read(r) && !this.hasExpandedOnce) {
|
|
120
|
+
this.hasExpandedOnce = true;
|
|
121
|
+
this.materializePendingContent();
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
this.setExpanded(false);
|
|
125
|
+
this._register(autorun(r => {
|
|
126
|
+
const expanded = this._isExpanded.read(r);
|
|
127
|
+
if (expanded) {
|
|
128
|
+
if (!this.autoExpandedForConfirmation) {
|
|
129
|
+
this.userManuallyExpanded = true;
|
|
130
|
+
}
|
|
131
|
+
} else {
|
|
132
|
+
if (this.autoExpandedForConfirmation) {
|
|
133
|
+
this.autoExpandedForConfirmation = false;
|
|
134
|
+
}
|
|
135
|
+
if (this.userManuallyExpanded) {
|
|
136
|
+
this.userManuallyExpanded = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
this.layoutScheduler = this._register(( new AnimationFrameScheduler(this.domNode, () => this.performLayout())));
|
|
141
|
+
this.renderPromptSection();
|
|
142
|
+
this.watchToolCompletion(toolInvocation);
|
|
143
|
+
}
|
|
144
|
+
initContent() {
|
|
145
|
+
this.wrapper = $(".chat-used-context-list.chat-thinking-collapsible");
|
|
146
|
+
if (!this.hasToolItems) {
|
|
147
|
+
this.wrapper.style.display = "none";
|
|
148
|
+
}
|
|
149
|
+
this.materializePendingContent();
|
|
150
|
+
const resizeObserver = this._register(( new DisposableResizeObserver(() => this.layoutScheduler.schedule())));
|
|
151
|
+
this._register(resizeObserver.observe(this.wrapper));
|
|
152
|
+
return this.wrapper;
|
|
153
|
+
}
|
|
154
|
+
renderPromptSection() {
|
|
155
|
+
if (!this.prompt || this.promptContainer) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (!this.wrapper || (this.isInitiallyComplete && !this.isExpanded() && !this.hasExpandedOnce)) {
|
|
159
|
+
this.pendingPromptRender = true;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.pendingPromptRender = false;
|
|
163
|
+
this.doRenderPromptSection();
|
|
164
|
+
}
|
|
165
|
+
doRenderPromptSection() {
|
|
166
|
+
if (!this.prompt || this.promptContainer) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const lines = this.prompt.split("\n");
|
|
170
|
+
const rawFirstLine = lines[0] || ( localize(5896, "Prompt"));
|
|
171
|
+
const restOfLines = lines.slice(1).join("\n").trim();
|
|
172
|
+
const titleContent = rcut(rawFirstLine, MAX_TITLE_LENGTH);
|
|
173
|
+
const wasTruncated = rawFirstLine.length > MAX_TITLE_LENGTH;
|
|
174
|
+
const title = wasTruncated ? titleContent + "…" : titleContent;
|
|
175
|
+
const titleRemainder = rawFirstLine.length > titleContent.length ? rawFirstLine.slice(titleContent.length).trim() : "";
|
|
176
|
+
const content = titleRemainder ? (titleRemainder + (restOfLines ? "\n" + restOfLines : "")) : (restOfLines || this.prompt);
|
|
177
|
+
const collapsiblePart = this._register(this.instantiationService.createInstance(
|
|
178
|
+
ChatCollapsibleMarkdownContentPart,
|
|
179
|
+
title,
|
|
180
|
+
content,
|
|
181
|
+
this.context,
|
|
182
|
+
this.chatContentMarkdownRenderer
|
|
183
|
+
));
|
|
184
|
+
this.promptContainer = $(".chat-thinking-tool-wrapper.chat-subagent-section");
|
|
185
|
+
const promptIcon = createThinkingIcon(Codicon.comment);
|
|
186
|
+
this.promptContainer.appendChild(promptIcon);
|
|
187
|
+
this.promptContainer.appendChild(collapsiblePart.domNode);
|
|
188
|
+
if (this.wrapper) {
|
|
189
|
+
if (this.wrapper.firstChild) {
|
|
190
|
+
this.wrapper.insertBefore(this.promptContainer, this.wrapper.firstChild);
|
|
191
|
+
} else {
|
|
192
|
+
append(this.wrapper, this.promptContainer);
|
|
193
|
+
}
|
|
194
|
+
if (this.wrapper.style.display === "none") {
|
|
195
|
+
this.wrapper.style.display = "";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
getIsActive() {
|
|
200
|
+
return this.isActive;
|
|
201
|
+
}
|
|
202
|
+
markAsInactive() {
|
|
203
|
+
this.isActive = false;
|
|
204
|
+
if (this._collapseButton) {
|
|
205
|
+
this._collapseButton.icon = Codicon.check;
|
|
206
|
+
}
|
|
207
|
+
this.finalizeTitle();
|
|
208
|
+
this.setExpanded(false);
|
|
209
|
+
}
|
|
210
|
+
finalizeTitle() {
|
|
211
|
+
this.updateTitle();
|
|
212
|
+
if (this._collapseButton) {
|
|
213
|
+
this._collapseButton.icon = Codicon.check;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
updateTitle() {
|
|
217
|
+
const prefix = this.agentName || ( localize(5895, "Subagent"));
|
|
218
|
+
let finalLabel = `${prefix}: ${this.description}`;
|
|
219
|
+
if (this.currentRunningToolMessage && this.isActive) {
|
|
220
|
+
finalLabel += ` \u2014 ${this.currentRunningToolMessage}`;
|
|
221
|
+
}
|
|
222
|
+
this.setTitleWithWidgets(( new MarkdownString(finalLabel)), this.instantiationService, this.chatMarkdownAnchorService, this.chatContentMarkdownRenderer);
|
|
223
|
+
}
|
|
224
|
+
trackToolState(toolInvocation) {
|
|
225
|
+
if (toolInvocation.kind !== "toolInvocation") {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const message = toolInvocation.invocationMessage;
|
|
229
|
+
const messageText = typeof message === "string" ? message : message.value;
|
|
230
|
+
this.currentRunningToolMessage = messageText;
|
|
231
|
+
this.updateTitle();
|
|
232
|
+
let wasWaitingForConfirmation = false;
|
|
233
|
+
this._register(autorun(r => {
|
|
234
|
+
const state = toolInvocation.state.read(r);
|
|
235
|
+
const isWaitingForConfirmation = state.type === IChatToolInvocation.StateKind.WaitingForConfirmation || state.type === IChatToolInvocation.StateKind.WaitingForPostApproval;
|
|
236
|
+
if (isWaitingForConfirmation && !wasWaitingForConfirmation) {
|
|
237
|
+
this.toolsWaitingForConfirmation++;
|
|
238
|
+
if (!this.isExpanded()) {
|
|
239
|
+
this.autoExpandedForConfirmation = true;
|
|
240
|
+
this.setExpanded(true);
|
|
241
|
+
}
|
|
242
|
+
} else if (!isWaitingForConfirmation && wasWaitingForConfirmation) {
|
|
243
|
+
this.toolsWaitingForConfirmation--;
|
|
244
|
+
if (this.toolsWaitingForConfirmation === 0 && this.autoExpandedForConfirmation && !this.userManuallyExpanded) {
|
|
245
|
+
this.autoExpandedForConfirmation = false;
|
|
246
|
+
this.setExpanded(false);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
wasWaitingForConfirmation = isWaitingForConfirmation;
|
|
250
|
+
}));
|
|
251
|
+
}
|
|
252
|
+
watchToolCompletion(toolInvocation) {
|
|
253
|
+
if (toolInvocation.toolId !== RunSubagentTool.Id) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (toolInvocation.kind === "toolInvocation") {
|
|
257
|
+
let wasStreaming = toolInvocation.state.get().type === IChatToolInvocation.StateKind.Streaming;
|
|
258
|
+
this._register(autorun(r => {
|
|
259
|
+
const state = toolInvocation.state.read(r);
|
|
260
|
+
if (state.type === IChatToolInvocation.StateKind.Completed) {
|
|
261
|
+
wasStreaming = false;
|
|
262
|
+
const textParts = ( (state.contentForModel || []).filter(part => part.kind === "text").map(part => part.value));
|
|
263
|
+
if (textParts.length > 0) {
|
|
264
|
+
this.renderResultText(textParts.join("\n"));
|
|
265
|
+
}
|
|
266
|
+
this.markAsInactive();
|
|
267
|
+
} else if (wasStreaming && state.type !== IChatToolInvocation.StateKind.Streaming) {
|
|
268
|
+
wasStreaming = false;
|
|
269
|
+
const {
|
|
270
|
+
description,
|
|
271
|
+
agentName,
|
|
272
|
+
prompt
|
|
273
|
+
} = ChatSubagentContentPart_1.extractSubagentInfo(toolInvocation);
|
|
274
|
+
this.description = description;
|
|
275
|
+
this.agentName = agentName;
|
|
276
|
+
this.prompt = prompt;
|
|
277
|
+
this.renderPromptSection();
|
|
278
|
+
this.updateTitle();
|
|
279
|
+
}
|
|
280
|
+
}));
|
|
281
|
+
} else if (toolInvocation.toolSpecificData?.kind === "subagent" && toolInvocation.toolSpecificData.result) {
|
|
282
|
+
this.renderResultText(toolInvocation.toolSpecificData.result);
|
|
283
|
+
this.markAsInactive();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
renderResultText(resultText) {
|
|
287
|
+
if (this.resultContainer || !resultText) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (!this.wrapper || (this.isInitiallyComplete && !this.isExpanded() && !this.hasExpandedOnce)) {
|
|
291
|
+
this.pendingResultText = resultText;
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
this.pendingResultText = undefined;
|
|
295
|
+
this.doRenderResultText(resultText);
|
|
296
|
+
}
|
|
297
|
+
doRenderResultText(resultText) {
|
|
298
|
+
if (this.resultContainer || !resultText) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const lines = resultText.split("\n");
|
|
302
|
+
const rawFirstLine = lines[0] || "";
|
|
303
|
+
const restOfLines = lines.slice(1).join("\n").trim();
|
|
304
|
+
const titleContent = rcut(rawFirstLine, MAX_TITLE_LENGTH);
|
|
305
|
+
const wasTruncated = rawFirstLine.length > MAX_TITLE_LENGTH;
|
|
306
|
+
const title = wasTruncated ? titleContent + "…" : titleContent;
|
|
307
|
+
const titleRemainder = rawFirstLine.length > titleContent.length ? rawFirstLine.slice(titleContent.length).trim() : "";
|
|
308
|
+
const content = titleRemainder ? (titleRemainder + (restOfLines ? "\n" + restOfLines : "")) : restOfLines;
|
|
309
|
+
const collapsiblePart = this._register(this.instantiationService.createInstance(
|
|
310
|
+
ChatCollapsibleMarkdownContentPart,
|
|
311
|
+
title,
|
|
312
|
+
content,
|
|
313
|
+
this.context,
|
|
314
|
+
this.chatContentMarkdownRenderer
|
|
315
|
+
));
|
|
316
|
+
this.resultContainer = $(".chat-thinking-tool-wrapper.chat-subagent-section");
|
|
317
|
+
const resultIcon = createThinkingIcon(Codicon.check);
|
|
318
|
+
this.resultContainer.appendChild(resultIcon);
|
|
319
|
+
this.resultContainer.appendChild(collapsiblePart.domNode);
|
|
320
|
+
if (this.wrapper) {
|
|
321
|
+
append(this.wrapper, this.resultContainer);
|
|
322
|
+
if (this.wrapper.style.display === "none") {
|
|
323
|
+
this.wrapper.style.display = "";
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
appendToolInvocation(toolInvocation, codeBlockStartIndex) {
|
|
328
|
+
if (!this.hasToolItems) {
|
|
329
|
+
this.hasToolItems = true;
|
|
330
|
+
if (this.wrapper) {
|
|
331
|
+
this.wrapper.style.display = "";
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
this.trackToolState(toolInvocation);
|
|
335
|
+
if (this.isExpanded() || this.hasExpandedOnce) {
|
|
336
|
+
const part = this.createToolPart(toolInvocation, codeBlockStartIndex);
|
|
337
|
+
this.appendToolPartToDOM(part, toolInvocation);
|
|
338
|
+
} else {
|
|
339
|
+
const item = {
|
|
340
|
+
kind: "tool",
|
|
341
|
+
lazy: ( new Lazy(() => this.createToolPart(toolInvocation, codeBlockStartIndex))),
|
|
342
|
+
toolInvocation,
|
|
343
|
+
codeBlockStartIndex
|
|
344
|
+
};
|
|
345
|
+
this.lazyItems.push(item);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
appendMarkdownItem(factory, _codeblocksPartId, _markdown, _originalParent) {
|
|
349
|
+
if (this.isExpanded() || this.hasExpandedOnce) {
|
|
350
|
+
const result = factory();
|
|
351
|
+
this.appendMarkdownItemToDOM(result.domNode);
|
|
352
|
+
if (result.disposable) {
|
|
353
|
+
this._register(result.disposable);
|
|
354
|
+
}
|
|
355
|
+
} else {
|
|
356
|
+
const item = {
|
|
357
|
+
kind: "markdown",
|
|
358
|
+
lazy: ( new Lazy(factory))
|
|
359
|
+
};
|
|
360
|
+
this.lazyItems.push(item);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
appendMarkdownItemToDOM(domNode) {
|
|
364
|
+
if (!domNode.hasChildNodes() || domNode.textContent?.trim() === "") {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const itemWrapper = $(".chat-thinking-tool-wrapper");
|
|
368
|
+
const iconElement = createThinkingIcon(Codicon.edit);
|
|
369
|
+
itemWrapper.appendChild(domNode);
|
|
370
|
+
itemWrapper.insertBefore(iconElement, itemWrapper.firstChild);
|
|
371
|
+
if (this.wrapper) {
|
|
372
|
+
if (this.resultContainer) {
|
|
373
|
+
this.wrapper.insertBefore(itemWrapper, this.resultContainer);
|
|
374
|
+
} else {
|
|
375
|
+
this.wrapper.appendChild(itemWrapper);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
this.lastItemWrapper = itemWrapper;
|
|
379
|
+
this.layoutScheduler.schedule();
|
|
380
|
+
}
|
|
381
|
+
shouldInitEarly() {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
createToolPart(toolInvocation, codeBlockStartIndex) {
|
|
385
|
+
const part = this.instantiationService.createInstance(
|
|
386
|
+
ChatToolInvocationPart,
|
|
387
|
+
toolInvocation,
|
|
388
|
+
this.context,
|
|
389
|
+
this.chatContentMarkdownRenderer,
|
|
390
|
+
this.listPool,
|
|
391
|
+
this.editorPool,
|
|
392
|
+
this.currentWidthDelegate,
|
|
393
|
+
this.codeBlockModelCollection,
|
|
394
|
+
this.announcedToolProgressKeys,
|
|
395
|
+
codeBlockStartIndex
|
|
396
|
+
);
|
|
397
|
+
this._register(part);
|
|
398
|
+
return part;
|
|
399
|
+
}
|
|
400
|
+
appendToolPartToDOM(part, toolInvocation) {
|
|
401
|
+
const content = part.domNode;
|
|
402
|
+
if (!content.hasChildNodes() || content.textContent?.trim() === "") {
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
const itemWrapper = $(".chat-thinking-tool-wrapper");
|
|
406
|
+
const icon = getToolInvocationIcon(toolInvocation.toolId);
|
|
407
|
+
const iconElement = createThinkingIcon(icon);
|
|
408
|
+
itemWrapper.appendChild(content);
|
|
409
|
+
if (toolInvocation.kind === "toolInvocation") {
|
|
410
|
+
this._register(autorun(r => {
|
|
411
|
+
const state = toolInvocation.state.read(r);
|
|
412
|
+
const hasConfirmation = state.type === IChatToolInvocation.StateKind.WaitingForConfirmation || state.type === IChatToolInvocation.StateKind.WaitingForPostApproval;
|
|
413
|
+
if (hasConfirmation) {
|
|
414
|
+
iconElement.remove();
|
|
415
|
+
} else if (!iconElement.parentElement) {
|
|
416
|
+
itemWrapper.insertBefore(iconElement, itemWrapper.firstChild);
|
|
417
|
+
}
|
|
418
|
+
}));
|
|
419
|
+
} else {
|
|
420
|
+
itemWrapper.insertBefore(iconElement, itemWrapper.firstChild);
|
|
421
|
+
}
|
|
422
|
+
if (this.wrapper) {
|
|
423
|
+
if (this.resultContainer) {
|
|
424
|
+
this.wrapper.insertBefore(itemWrapper, this.resultContainer);
|
|
425
|
+
} else {
|
|
426
|
+
this.wrapper.appendChild(itemWrapper);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
this.lastItemWrapper = itemWrapper;
|
|
430
|
+
this.layoutScheduler.schedule();
|
|
431
|
+
}
|
|
432
|
+
materializeLazyItem(item) {
|
|
433
|
+
if (item.lazy.hasValue) {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (item.kind === "tool") {
|
|
437
|
+
const part = item.lazy.value;
|
|
438
|
+
this.appendToolPartToDOM(part, item.toolInvocation);
|
|
439
|
+
} else if (item.kind === "markdown") {
|
|
440
|
+
const result = item.lazy.value;
|
|
441
|
+
this.appendMarkdownItemToDOM(result.domNode);
|
|
442
|
+
if (result.disposable) {
|
|
443
|
+
this._register(result.disposable);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
materializePendingContent() {
|
|
448
|
+
if (!this.wrapper) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (this.pendingPromptRender) {
|
|
452
|
+
this.pendingPromptRender = false;
|
|
453
|
+
this.doRenderPromptSection();
|
|
454
|
+
}
|
|
455
|
+
for (const item of this.lazyItems) {
|
|
456
|
+
this.materializeLazyItem(item);
|
|
457
|
+
}
|
|
458
|
+
if (this.pendingResultText) {
|
|
459
|
+
const resultText = this.pendingResultText;
|
|
460
|
+
this.pendingResultText = undefined;
|
|
461
|
+
this.doRenderResultText(resultText);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
performLayout() {
|
|
465
|
+
if (this.lastItemWrapper && this.wrapper) {
|
|
466
|
+
const height = this.lastItemWrapper.offsetHeight;
|
|
467
|
+
if (height > 0) {
|
|
468
|
+
this.wrapper.style.setProperty("--chat-subagent-last-item-height", `${height}px`);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (this.isActive && !this.isInitiallyComplete && this.wrapper) {
|
|
472
|
+
const scrollHeight = this.wrapper.scrollHeight;
|
|
473
|
+
this.wrapper.scrollTop = scrollHeight;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
hasSameContent(other, _followingContent, _element) {
|
|
477
|
+
if (other.kind === "markdownContent") {
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
if ((other.kind === "toolInvocation" || other.kind === "toolInvocationSerialized") && (other.subAgentInvocationId || other.toolId === RunSubagentTool.Id)) {
|
|
481
|
+
const otherEffectiveId = other.toolId === RunSubagentTool.Id ? other.toolCallId : other.subAgentInvocationId;
|
|
482
|
+
if (this.subAgentInvocationId && otherEffectiveId) {
|
|
483
|
+
return this.subAgentInvocationId === otherEffectiveId;
|
|
484
|
+
}
|
|
485
|
+
return !this.subAgentInvocationId && !otherEffectiveId;
|
|
486
|
+
}
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
ChatSubagentContentPart = ChatSubagentContentPart_1 = ( __decorate([( __param(9, IInstantiationService)), ( __param(10, IChatMarkdownAnchorService)), ( __param(11, IHoverService))], ChatSubagentContentPart));
|
|
491
|
+
|
|
492
|
+
export { ChatSubagentContentPart };
|