@codingame/monaco-vscode-katex-common 25.1.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,634 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { softAssertNever } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
5
|
+
import { disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
6
|
+
import { decodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
7
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
8
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
+
import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
10
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
11
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
13
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
14
|
+
import { isFalsyOrWhitespace } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
15
|
+
import { hasKey, isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
16
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
17
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
18
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
19
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
20
|
+
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
21
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
22
|
+
import { McpToolCallUI } from '../../../../../mcp/browser/mcpToolCallUI.js';
|
|
23
|
+
import { McpResourceURI } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
24
|
+
import { McpApps } from '../../../../../mcp/common/modelContextProtocolApps.js';
|
|
25
|
+
import { WebviewOriginStore, WebviewContentPurpose } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview';
|
|
26
|
+
import { IWebviewService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/webview/browser/webview.service';
|
|
27
|
+
import { IChatToolInvocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
28
|
+
import { isToolResultInputOutputDetails } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
29
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
30
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
31
|
+
import { autorun, autorunSelfDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
32
|
+
|
|
33
|
+
var ChatMcpAppModel_1;
|
|
34
|
+
const ORIGIN_STORE_KEY = "chatMcpApp.origins";
|
|
35
|
+
let ChatMcpAppModel = class ChatMcpAppModel extends Disposable {
|
|
36
|
+
static {
|
|
37
|
+
ChatMcpAppModel_1 = this;
|
|
38
|
+
}
|
|
39
|
+
static {
|
|
40
|
+
this.heightCache = ( new WeakMap());
|
|
41
|
+
}
|
|
42
|
+
constructor(
|
|
43
|
+
toolInvocation,
|
|
44
|
+
renderData,
|
|
45
|
+
_container,
|
|
46
|
+
maxHeight,
|
|
47
|
+
currentWidth,
|
|
48
|
+
_instantiationService,
|
|
49
|
+
_chatWidgetService,
|
|
50
|
+
_webviewService,
|
|
51
|
+
storageService,
|
|
52
|
+
_logService,
|
|
53
|
+
_productService,
|
|
54
|
+
_openerService
|
|
55
|
+
) {
|
|
56
|
+
super();
|
|
57
|
+
this.toolInvocation = toolInvocation;
|
|
58
|
+
this.renderData = renderData;
|
|
59
|
+
this._container = _container;
|
|
60
|
+
this._instantiationService = _instantiationService;
|
|
61
|
+
this._chatWidgetService = _chatWidgetService;
|
|
62
|
+
this._webviewService = _webviewService;
|
|
63
|
+
this._logService = _logService;
|
|
64
|
+
this._productService = _productService;
|
|
65
|
+
this._openerService = _openerService;
|
|
66
|
+
this._disposeCts = this._register(( new CancellationTokenSource()));
|
|
67
|
+
this._announcedCapabilities = false;
|
|
68
|
+
this._latestCsp = undefined;
|
|
69
|
+
this._loadState = observableValue(this, {
|
|
70
|
+
status: "loading"
|
|
71
|
+
});
|
|
72
|
+
this.loadState = this._loadState;
|
|
73
|
+
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
74
|
+
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
75
|
+
this._originStore = ( new WebviewOriginStore(ORIGIN_STORE_KEY, storageService));
|
|
76
|
+
this._webviewOrigin = this._originStore.getOrigin("mcpApp", renderData.serverDefinitionId);
|
|
77
|
+
this._mcpToolCallUI = this._register(this._instantiationService.createInstance(McpToolCallUI, renderData));
|
|
78
|
+
this._height = ChatMcpAppModel_1.heightCache.get(this.toolInvocation) ?? 300;
|
|
79
|
+
this._webview = this._register(this._webviewService.createWebviewElement({
|
|
80
|
+
origin: this._webviewOrigin,
|
|
81
|
+
title: ( localize(5965, "MCP App")),
|
|
82
|
+
options: {
|
|
83
|
+
purpose: WebviewContentPurpose.ChatOutputItem,
|
|
84
|
+
enableFindWidget: false,
|
|
85
|
+
disableServiceWorker: true,
|
|
86
|
+
retainContextWhenHidden: true
|
|
87
|
+
},
|
|
88
|
+
contentOptions: {
|
|
89
|
+
allowMultipleAPIAcquire: true,
|
|
90
|
+
allowScripts: true,
|
|
91
|
+
allowForms: true
|
|
92
|
+
},
|
|
93
|
+
extension: undefined
|
|
94
|
+
}));
|
|
95
|
+
const targetWindow = getWindow(this._container);
|
|
96
|
+
this._webview.mountTo(this._container, targetWindow);
|
|
97
|
+
this.hostContext = ( this._mcpToolCallUI.hostContext.map((context, reader) => ({
|
|
98
|
+
...context,
|
|
99
|
+
containerDimensions: {
|
|
100
|
+
width: currentWidth.read(reader),
|
|
101
|
+
maxHeight: maxHeight.read(reader)
|
|
102
|
+
},
|
|
103
|
+
toolCall: {
|
|
104
|
+
toolCallId: this.toolInvocation.toolCallId,
|
|
105
|
+
toolName: this.toolInvocation.toolId
|
|
106
|
+
}
|
|
107
|
+
})));
|
|
108
|
+
this._register(autorun(reader => {
|
|
109
|
+
const context = this.hostContext.read(reader);
|
|
110
|
+
if (this._announcedCapabilities) {
|
|
111
|
+
this._sendNotification({
|
|
112
|
+
method: "ui/notifications/host-context-changed",
|
|
113
|
+
params: context
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
this._register(this._webview.onMessage(async (
|
|
118
|
+
{
|
|
119
|
+
message
|
|
120
|
+
}
|
|
121
|
+
) => {
|
|
122
|
+
await this._handleWebviewMessage(message);
|
|
123
|
+
}));
|
|
124
|
+
this._loadContent();
|
|
125
|
+
}
|
|
126
|
+
get height() {
|
|
127
|
+
return this._height;
|
|
128
|
+
}
|
|
129
|
+
remount() {
|
|
130
|
+
this._webview.reinitializeAfterDismount();
|
|
131
|
+
this._announcedCapabilities = false;
|
|
132
|
+
}
|
|
133
|
+
retry() {
|
|
134
|
+
this._loadState.set({
|
|
135
|
+
status: "loading"
|
|
136
|
+
}, undefined);
|
|
137
|
+
this._loadContent();
|
|
138
|
+
}
|
|
139
|
+
async _loadContent() {
|
|
140
|
+
const token = this._disposeCts.token;
|
|
141
|
+
try {
|
|
142
|
+
const resourceContent = await this._mcpToolCallUI.loadResource(token);
|
|
143
|
+
if (token.isCancellationRequested) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const htmlWithCsp = this._injectPreamble(resourceContent);
|
|
147
|
+
this._announcedCapabilities = false;
|
|
148
|
+
this._latestCsp = resourceContent.csp;
|
|
149
|
+
this._webview.setHtml(htmlWithCsp);
|
|
150
|
+
this._loadState.set({
|
|
151
|
+
status: "loaded"
|
|
152
|
+
}, undefined);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
this._logService.error("[MCP App] Error loading app:", error);
|
|
155
|
+
this._loadState.set({
|
|
156
|
+
status: "error",
|
|
157
|
+
error: error
|
|
158
|
+
}, undefined);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_injectPreamble(
|
|
162
|
+
{
|
|
163
|
+
html,
|
|
164
|
+
csp
|
|
165
|
+
}
|
|
166
|
+
) {
|
|
167
|
+
const cleanDomains = s => (s?.join(" ") || "").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """);
|
|
168
|
+
const cspContent = `
|
|
169
|
+
default-src 'none';
|
|
170
|
+
script-src 'self' 'unsafe-inline' ${cleanDomains(csp?.resourceDomains)};
|
|
171
|
+
style-src 'self' 'unsafe-inline' ${cleanDomains(csp?.resourceDomains)};
|
|
172
|
+
connect-src 'self' ${cleanDomains(csp?.connectDomains)};
|
|
173
|
+
img-src 'self' data: ${cleanDomains(csp?.resourceDomains)};
|
|
174
|
+
font-src 'self' ${cleanDomains(csp?.resourceDomains)};
|
|
175
|
+
media-src 'self' data: ${cleanDomains(csp?.resourceDomains)};
|
|
176
|
+
frame-src ${cleanDomains(csp?.frameDomains) || `'none'`};
|
|
177
|
+
object-src 'none';
|
|
178
|
+
base-uri ${cleanDomains(csp?.baseUriDomains) || `'self'`};
|
|
179
|
+
`;
|
|
180
|
+
const cspTag = `<meta http-equiv="Content-Security-Policy" content="${cspContent}">`;
|
|
181
|
+
const postMessageRehoist = `
|
|
182
|
+
<script>(() => {
|
|
183
|
+
const api = acquireVsCodeApi();
|
|
184
|
+
const setMessageSource = (obj, src) => new Proxy(obj, {
|
|
185
|
+
get: (target, prop) => {
|
|
186
|
+
if (prop === 'source') {
|
|
187
|
+
return src;
|
|
188
|
+
}
|
|
189
|
+
return target[prop];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const wrappedFns = new WeakMap();
|
|
194
|
+
|
|
195
|
+
let patchedPostMessage = (message, transfer) => api.postMessage(message, transfer);
|
|
196
|
+
const wrap = target => new Proxy(target, {
|
|
197
|
+
set: (obj, prop, value) => {
|
|
198
|
+
if (prop === 'postMessage') {
|
|
199
|
+
patchedPostMessage = (message, transfer) => value.call(target, message, transfer);
|
|
200
|
+
} else {
|
|
201
|
+
obj[prop] = value;
|
|
202
|
+
}
|
|
203
|
+
return true;
|
|
204
|
+
},
|
|
205
|
+
get: (obj, prop) => {
|
|
206
|
+
if (prop === 'postMessage') {
|
|
207
|
+
return patchedPostMessage;
|
|
208
|
+
}
|
|
209
|
+
return obj[prop];
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const originalAddEventListener = window.addEventListener.bind(window);
|
|
214
|
+
window.addEventListener = (type, listener, options) => {
|
|
215
|
+
if (type === 'message') {
|
|
216
|
+
const originalListener = listener;
|
|
217
|
+
const wrappedListener = (event) => {
|
|
218
|
+
if (event.origin === document.location.origin && event.source !== window) { event = setMessageSource(event, window.parent); }
|
|
219
|
+
originalListener(event);
|
|
220
|
+
};
|
|
221
|
+
wrappedFns.set(originalListener, wrappedListener);
|
|
222
|
+
listener = wrappedListener;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return originalAddEventListener(type, listener, options);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const originalRemoveEventListener = window.removeEventListener.bind(window);
|
|
229
|
+
window.removeEventListener = (type, listener, options) => {
|
|
230
|
+
const wrappedListener = wrappedFns.get(listener) || listener;
|
|
231
|
+
return originalRemoveEventListener(type, wrappedListener, options);
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
window.parent = wrap(window.parent);
|
|
235
|
+
|
|
236
|
+
// Scroll boundary detection: bubble wheel events to parent when at scroll boundaries
|
|
237
|
+
const shouldBubbleScroll = (event) => {
|
|
238
|
+
// First check element-level scrolling (for elements with overflow: auto/scroll)
|
|
239
|
+
for (let node = event.target; node; node = node.parentNode) {
|
|
240
|
+
if (!(node instanceof Element)) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Skip HTML and BODY - we check document-level scroll separately
|
|
245
|
+
if (node === document.documentElement || node === document.body) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Check if the element can actually scroll
|
|
250
|
+
const overflow = window.getComputedStyle(node).overflowY;
|
|
251
|
+
if (overflow === 'hidden' || overflow === 'visible') {
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Scroll up: if there's content above (scrollTop > 0), don't bubble
|
|
256
|
+
if (event.deltaY < 0 && node.scrollTop > 0) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Scroll down: if there's content below, don't bubble
|
|
261
|
+
if (event.deltaY > 0 && node.scrollTop + node.clientHeight < node.scrollHeight) {
|
|
262
|
+
// Account for rounding: scrollTop isn't rounded but scrollHeight/clientHeight are
|
|
263
|
+
if (node.scrollHeight - node.scrollTop - node.clientHeight < 2) {
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Check document-level scrolling (works even with overflow: visible on html/body)
|
|
271
|
+
const docEl = document.documentElement;
|
|
272
|
+
const scrollTop = window.scrollY || docEl.scrollTop || document.body.scrollTop || 0;
|
|
273
|
+
const scrollHeight = Math.max(docEl.scrollHeight, document.body.scrollHeight);
|
|
274
|
+
const clientHeight = docEl.clientHeight;
|
|
275
|
+
const scrollableDistance = scrollHeight - clientHeight;
|
|
276
|
+
|
|
277
|
+
if (scrollableDistance > 2) {
|
|
278
|
+
// Document is scrollable
|
|
279
|
+
if (event.deltaY < 0 && scrollTop > 0) {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
if (event.deltaY > 0 && scrollTop < scrollableDistance - 2) {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return true;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
window.addEventListener('wheel', (event) => {
|
|
291
|
+
if (event.defaultPrevented || !shouldBubbleScroll(event)) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
api.postMessage({
|
|
295
|
+
method: 'ui/notifications/sandbox-wheel',
|
|
296
|
+
params: {
|
|
297
|
+
deltaMode: event.deltaMode,
|
|
298
|
+
deltaX: event.deltaX,
|
|
299
|
+
deltaY: event.deltaY,
|
|
300
|
+
deltaZ: event.deltaZ,
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}, { passive: true });
|
|
304
|
+
})();</script>
|
|
305
|
+
`;
|
|
306
|
+
return this._prependToHead(html, cspTag + postMessageRehoist);
|
|
307
|
+
}
|
|
308
|
+
_prependToHead(html, content) {
|
|
309
|
+
const headMatch = html.match(/<head[^>]*>/i);
|
|
310
|
+
if (headMatch) {
|
|
311
|
+
const insertIndex = headMatch.index + headMatch[0].length;
|
|
312
|
+
return html.slice(0, insertIndex) + "\n" + content + html.slice(insertIndex);
|
|
313
|
+
}
|
|
314
|
+
const htmlMatch = html.match(/<html[^>]*>/i);
|
|
315
|
+
if (htmlMatch) {
|
|
316
|
+
const insertIndex = htmlMatch.index + htmlMatch[0].length;
|
|
317
|
+
return html.slice(0, insertIndex) + "\n<head>" + content + "</head>" + html.slice(insertIndex);
|
|
318
|
+
}
|
|
319
|
+
return `<!DOCTYPE html><html><head>${content}</head><body>${html}</body></html>`;
|
|
320
|
+
}
|
|
321
|
+
async _handleWebviewMessage(message) {
|
|
322
|
+
const request = message;
|
|
323
|
+
const token = this._disposeCts.token;
|
|
324
|
+
try {
|
|
325
|
+
let result = {};
|
|
326
|
+
switch (request.method) {
|
|
327
|
+
case "ui/initialize":
|
|
328
|
+
result = await this._handleInitialize(request.params);
|
|
329
|
+
break;
|
|
330
|
+
case "tools/call":
|
|
331
|
+
result = await this._handleToolsCall(request.params, token);
|
|
332
|
+
break;
|
|
333
|
+
case "resources/read":
|
|
334
|
+
result = await this._handleResourcesRead(request.params, token);
|
|
335
|
+
break;
|
|
336
|
+
case "ping":
|
|
337
|
+
break;
|
|
338
|
+
case "ui/notifications/size-changed":
|
|
339
|
+
this._handleSizeChanged(request.params);
|
|
340
|
+
break;
|
|
341
|
+
case "ui/open-link":
|
|
342
|
+
result = await this._handleOpenLink(request.params);
|
|
343
|
+
break;
|
|
344
|
+
case "ui/request-display-mode":
|
|
345
|
+
result = {
|
|
346
|
+
mode: "inline"
|
|
347
|
+
};
|
|
348
|
+
break;
|
|
349
|
+
case "ui/notifications/initialized":
|
|
350
|
+
break;
|
|
351
|
+
case "ui/message":
|
|
352
|
+
result = await this._handleUiMessage(request.params);
|
|
353
|
+
break;
|
|
354
|
+
case "ui/update-model-context":
|
|
355
|
+
result = await this._handleUpdateModelContext(request.params);
|
|
356
|
+
break;
|
|
357
|
+
case "notifications/message":
|
|
358
|
+
await this._mcpToolCallUI.log(request.params);
|
|
359
|
+
break;
|
|
360
|
+
case "ui/notifications/sandbox-wheel":
|
|
361
|
+
this._handleSandboxWheel(request.params);
|
|
362
|
+
break;
|
|
363
|
+
default:
|
|
364
|
+
{
|
|
365
|
+
softAssertNever(request);
|
|
366
|
+
const cast = request;
|
|
367
|
+
if (cast.id !== undefined) {
|
|
368
|
+
await this._sendError(cast.id, -32601, `Method not found: ${cast.method}`);
|
|
369
|
+
}
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (hasKey(request, {
|
|
374
|
+
id: true
|
|
375
|
+
})) {
|
|
376
|
+
await this._sendResponse(request.id, result);
|
|
377
|
+
}
|
|
378
|
+
} catch (error) {
|
|
379
|
+
this._logService.error(`[MCP App] Error handling ${request.method}:`, error);
|
|
380
|
+
if (hasKey(request, {
|
|
381
|
+
id: true
|
|
382
|
+
})) {
|
|
383
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
384
|
+
await this._sendError(request.id, -32e3, message);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
async _handleInitialize(_params) {
|
|
389
|
+
this._announcedCapabilities = true;
|
|
390
|
+
let args;
|
|
391
|
+
try {
|
|
392
|
+
args = JSON.parse(this.renderData.input);
|
|
393
|
+
} catch {
|
|
394
|
+
args = this.renderData.input;
|
|
395
|
+
}
|
|
396
|
+
const timeout = this._register(disposableTimeout(async () => {
|
|
397
|
+
this._store.delete(timeout);
|
|
398
|
+
await this._sendNotification({
|
|
399
|
+
method: "ui/notifications/tool-input",
|
|
400
|
+
params: {
|
|
401
|
+
arguments: args
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
if (this.toolInvocation.kind === "toolInvocationSerialized") {
|
|
405
|
+
this._sendToolResult(this.toolInvocation.resultDetails);
|
|
406
|
+
} else if (this.toolInvocation.kind === "toolInvocation") {
|
|
407
|
+
const invocation = this.toolInvocation;
|
|
408
|
+
this._register(autorunSelfDisposable(reader => {
|
|
409
|
+
const state = invocation.state.read(reader);
|
|
410
|
+
if (state.type === IChatToolInvocation.StateKind.Completed) {
|
|
411
|
+
this._sendToolResult(state.resultDetails);
|
|
412
|
+
reader.dispose();
|
|
413
|
+
}
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
}));
|
|
417
|
+
return {
|
|
418
|
+
protocolVersion: McpApps.LATEST_PROTOCOL_VERSION,
|
|
419
|
+
hostInfo: {
|
|
420
|
+
name: this._productService.nameLong,
|
|
421
|
+
version: this._productService.version
|
|
422
|
+
},
|
|
423
|
+
hostCapabilities: {
|
|
424
|
+
openLinks: {},
|
|
425
|
+
serverTools: {
|
|
426
|
+
listChanged: true
|
|
427
|
+
},
|
|
428
|
+
serverResources: {
|
|
429
|
+
listChanged: true
|
|
430
|
+
},
|
|
431
|
+
logging: {},
|
|
432
|
+
sandbox: {
|
|
433
|
+
csp: this._latestCsp,
|
|
434
|
+
permissions: {
|
|
435
|
+
clipboardWrite: {}
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
updateModelContext: {
|
|
439
|
+
audio: {},
|
|
440
|
+
image: {},
|
|
441
|
+
resourceLink: {},
|
|
442
|
+
resource: {},
|
|
443
|
+
structuredContent: {}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
hostContext: this.hostContext.get()
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
_sendToolResult(resultDetails) {
|
|
450
|
+
if (isToolResultInputOutputDetails(resultDetails) && resultDetails.mcpOutput) {
|
|
451
|
+
this._sendNotification({
|
|
452
|
+
method: "ui/notifications/tool-result",
|
|
453
|
+
params: resultDetails.mcpOutput
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
async _handleUiMessage(params) {
|
|
458
|
+
const widget = this._chatWidgetService.getWidgetBySessionResource(this.renderData.sessionResource);
|
|
459
|
+
if (!widget) {
|
|
460
|
+
return {
|
|
461
|
+
isError: true
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
if (!isFalsyOrWhitespace(widget.getInput())) {
|
|
465
|
+
return {
|
|
466
|
+
isError: true
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
widget.setInput(( params.content.filter(c => c.type === "text").map(c => c.text)).join("\n\n"));
|
|
470
|
+
widget.attachmentModel.clearAndSetContext(...( params.content.map((c, i) => {
|
|
471
|
+
const id = `mcpui-${i}-${Date.now()}`;
|
|
472
|
+
if (c.type === "image") {
|
|
473
|
+
return {
|
|
474
|
+
kind: "image",
|
|
475
|
+
value: decodeBase64(c.data).buffer,
|
|
476
|
+
id,
|
|
477
|
+
name: "Image"
|
|
478
|
+
};
|
|
479
|
+
} else if (c.type === "resource_link") {
|
|
480
|
+
const uri = McpResourceURI.fromServer({
|
|
481
|
+
id: this.renderData.serverDefinitionId,
|
|
482
|
+
label: ""
|
|
483
|
+
}, c.uri);
|
|
484
|
+
return {
|
|
485
|
+
kind: "file",
|
|
486
|
+
value: uri,
|
|
487
|
+
id,
|
|
488
|
+
name: basename(uri)
|
|
489
|
+
};
|
|
490
|
+
} else {
|
|
491
|
+
return undefined;
|
|
492
|
+
}
|
|
493
|
+
})).filter(isDefined));
|
|
494
|
+
widget.focusInput();
|
|
495
|
+
return {
|
|
496
|
+
isError: false
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
async _handleUpdateModelContext(params) {
|
|
500
|
+
const widget = this._chatWidgetService.getWidgetBySessionResource(this.renderData.sessionResource);
|
|
501
|
+
if (!widget) {
|
|
502
|
+
return {};
|
|
503
|
+
}
|
|
504
|
+
const idPrefix = `mcpui-context-${hash(this.renderData.serverDefinitionId)}-`;
|
|
505
|
+
const toDelete = widget.attachmentModel.getAttachmentIDs();
|
|
506
|
+
const idsToDelete = Array.from(toDelete).filter(id => id.startsWith(idPrefix));
|
|
507
|
+
const entries = [];
|
|
508
|
+
let entryIndex = 0;
|
|
509
|
+
if (params.content) {
|
|
510
|
+
for (const block of params.content) {
|
|
511
|
+
const id = `${idPrefix}${entryIndex++}`;
|
|
512
|
+
if (block.type === "image") {
|
|
513
|
+
entries.push({
|
|
514
|
+
kind: "image",
|
|
515
|
+
value: decodeBase64(block.data).buffer,
|
|
516
|
+
id,
|
|
517
|
+
name: "Image",
|
|
518
|
+
mimeType: block.mimeType
|
|
519
|
+
});
|
|
520
|
+
} else if (block.type === "resource_link") {
|
|
521
|
+
const uri = McpResourceURI.fromServer({
|
|
522
|
+
id: this.renderData.serverDefinitionId,
|
|
523
|
+
label: ""
|
|
524
|
+
}, block.uri);
|
|
525
|
+
entries.push({
|
|
526
|
+
kind: "file",
|
|
527
|
+
value: uri,
|
|
528
|
+
id,
|
|
529
|
+
name: basename(uri)
|
|
530
|
+
});
|
|
531
|
+
} else if (block.type === "text") {
|
|
532
|
+
const preview = block.text.replaceAll(/\s+/g, " ").trim();
|
|
533
|
+
const truncateTo = 20;
|
|
534
|
+
entries.push({
|
|
535
|
+
kind: "generic",
|
|
536
|
+
value: block.text,
|
|
537
|
+
id,
|
|
538
|
+
tooltip: ( new MarkdownString()).appendCodeblock("plaintext", block.text),
|
|
539
|
+
name: preview.length > truncateTo ? preview.slice(0, truncateTo) + "…" : preview
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
if (params.structuredContent && ( Object.keys(params.structuredContent)).length > 0) {
|
|
545
|
+
const id = `${idPrefix}structured`;
|
|
546
|
+
const value = JSON.stringify(params.structuredContent, null, 2);
|
|
547
|
+
entries.push({
|
|
548
|
+
kind: "generic",
|
|
549
|
+
value,
|
|
550
|
+
tooltip: ( new MarkdownString()).appendCodeblock("json", value),
|
|
551
|
+
id,
|
|
552
|
+
name: "UI Data"
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
widget.attachmentModel.updateContext(idsToDelete, entries);
|
|
556
|
+
return {};
|
|
557
|
+
}
|
|
558
|
+
_handleSizeChanged(params) {
|
|
559
|
+
if (params.height !== undefined && params.height !== this._height) {
|
|
560
|
+
this._height = params.height;
|
|
561
|
+
ChatMcpAppModel_1.heightCache.set(this.toolInvocation, params.height);
|
|
562
|
+
this._onDidChangeHeight.fire();
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
_handleSandboxWheel(params) {
|
|
566
|
+
let defaultPrevented = false;
|
|
567
|
+
const evt = {
|
|
568
|
+
wheelDeltaX: params.deltaX,
|
|
569
|
+
wheelDeltaY: -params.deltaY,
|
|
570
|
+
wheelDelta: Math.abs(params.deltaY),
|
|
571
|
+
deltaX: params.deltaX,
|
|
572
|
+
deltaY: -params.deltaY,
|
|
573
|
+
deltaZ: params.deltaZ,
|
|
574
|
+
deltaMode: params.deltaMode,
|
|
575
|
+
preventDefault: () => {
|
|
576
|
+
defaultPrevented = true;
|
|
577
|
+
},
|
|
578
|
+
stopPropagation: () => {},
|
|
579
|
+
get defaultPrevented() {
|
|
580
|
+
return defaultPrevented;
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
const widget = this._chatWidgetService.getWidgetBySessionResource(this.renderData.sessionResource);
|
|
584
|
+
widget?.delegateScrollFromMouseWheelEvent(evt);
|
|
585
|
+
}
|
|
586
|
+
async _handleOpenLink(params) {
|
|
587
|
+
const ok = await this._openerService.open(params.url);
|
|
588
|
+
return {
|
|
589
|
+
isError: !ok
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
async _handleToolsCall(params, token) {
|
|
593
|
+
if (!params?.name) {
|
|
594
|
+
throw ( new Error("Missing tool name in tools/call request"));
|
|
595
|
+
}
|
|
596
|
+
return this._mcpToolCallUI.callTool(params.name, params.arguments || {}, token);
|
|
597
|
+
}
|
|
598
|
+
async _handleResourcesRead(params, token) {
|
|
599
|
+
if (!params?.uri) {
|
|
600
|
+
throw ( new Error("Missing uri in resources/read request"));
|
|
601
|
+
}
|
|
602
|
+
return this._mcpToolCallUI.readResource(params.uri, token);
|
|
603
|
+
}
|
|
604
|
+
async _sendResponse(id, result) {
|
|
605
|
+
await this._webview.postMessage({
|
|
606
|
+
jsonrpc: "2.0",
|
|
607
|
+
id,
|
|
608
|
+
result
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
async _sendError(id, code, message) {
|
|
612
|
+
await this._webview.postMessage({
|
|
613
|
+
jsonrpc: "2.0",
|
|
614
|
+
id,
|
|
615
|
+
error: {
|
|
616
|
+
code,
|
|
617
|
+
message
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
async _sendNotification(message) {
|
|
622
|
+
await this._webview.postMessage({
|
|
623
|
+
jsonrpc: "2.0",
|
|
624
|
+
...message
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
dispose() {
|
|
628
|
+
this._disposeCts.dispose(true);
|
|
629
|
+
super.dispose();
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
ChatMcpAppModel = ChatMcpAppModel_1 = ( __decorate([( __param(5, IInstantiationService)), ( __param(6, IChatWidgetService)), ( __param(7, IWebviewService)), ( __param(8, IStorageService)), ( __param(9, ILogService)), ( __param(10, IProductService)), ( __param(11, IOpenerService))], ChatMcpAppModel));
|
|
633
|
+
|
|
634
|
+
export { ChatMcpAppModel };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { IMarkdownRendererService } from "@codingame/monaco-vscode-api/vscode/vs/platform/markdown/browser/markdownRenderer.service";
|
|
5
|
+
import { IChatToolInvocation, IChatToolInvocationSerialized } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
6
|
+
import { IChatCodeBlockInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
|
+
import { IChatContentPartRenderContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts";
|
|
8
|
+
import { BaseChatToolInvocationSubPart } from "./chatToolInvocationSubPart.js";
|
|
9
|
+
/**
|
|
10
|
+
* Data needed to render an MCP App, available before tool completion.
|
|
11
|
+
*/
|
|
12
|
+
export interface IMcpAppRenderData {
|
|
13
|
+
/** URI of the UI resource for rendering (e.g., "ui://weather-server/dashboard") */
|
|
14
|
+
readonly resourceUri: string;
|
|
15
|
+
/** Reference to the server definition for reconnection */
|
|
16
|
+
readonly serverDefinitionId: string;
|
|
17
|
+
/** Reference to the collection containing the server */
|
|
18
|
+
readonly collectionId: string;
|
|
19
|
+
/** The tool input arguments as a JSON string */
|
|
20
|
+
readonly input: string;
|
|
21
|
+
/** The session resource URI for the chat session */
|
|
22
|
+
readonly sessionResource: URI;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Sub-part for rendering MCP App webviews in chat tool output.
|
|
26
|
+
* This is a thin view layer that delegates to ChatMcpAppModel.
|
|
27
|
+
*/
|
|
28
|
+
export declare class ChatMcpAppSubPart extends BaseChatToolInvocationSubPart {
|
|
29
|
+
private readonly _renderData;
|
|
30
|
+
private readonly _instantiationService;
|
|
31
|
+
private readonly _markdownRendererService;
|
|
32
|
+
readonly domNode: HTMLElement;
|
|
33
|
+
readonly codeblocks: IChatCodeBlockInfo[];
|
|
34
|
+
/** The model that owns the webview */
|
|
35
|
+
private readonly _model;
|
|
36
|
+
/** The webview container */
|
|
37
|
+
private readonly _webviewContainer;
|
|
38
|
+
/** Current progress part for loading state */
|
|
39
|
+
private readonly _progressPart;
|
|
40
|
+
/** Current error node */
|
|
41
|
+
private _errorNode;
|
|
42
|
+
constructor(toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized, onDidRemount: Event<void>, context: IChatContentPartRenderContext, _renderData: IMcpAppRenderData, _instantiationService: IInstantiationService, _markdownRendererService: IMarkdownRendererService);
|
|
43
|
+
private _handleLoadStateChange;
|
|
44
|
+
private _updateContainerHeight;
|
|
45
|
+
/**
|
|
46
|
+
* Shows an error message in the container.
|
|
47
|
+
*/
|
|
48
|
+
private _showError;
|
|
49
|
+
}
|