@codingame/monaco-vscode-katex-common 25.1.2 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,247 @@
|
|
|
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 { $, append } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
+
import { renderIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
7
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
8
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
9
|
+
import { fromNow, getDurationString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
|
|
10
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
11
|
+
import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
13
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
16
|
+
import { ChatAgentLocation, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
17
|
+
import { ChatViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
18
|
+
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
19
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
20
|
+
import { ChatListWidget } from '../widget/chatListWidget.js';
|
|
21
|
+
import { getAgentSessionProvider, AgentSessionProviders, getAgentSessionProviderIcon, getAgentSessionProviderName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
22
|
+
import { getAgentChangesSummary, hasValidDiff } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
|
|
23
|
+
import * as agentSessionHoverWidget from './media/agentSessionHoverWidget.css';
|
|
24
|
+
import { ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
25
|
+
|
|
26
|
+
registerCss(agentSessionHoverWidget);
|
|
27
|
+
const HEADER_HEIGHT = 60;
|
|
28
|
+
const CHAT_LIST_HEIGHT = 240;
|
|
29
|
+
const CHAT_HOVER_WIDTH = 500;
|
|
30
|
+
let AgentSessionHoverWidget = class AgentSessionHoverWidget extends Disposable {
|
|
31
|
+
constructor(session, chatService, instantiationService, chatWidgetService) {
|
|
32
|
+
super();
|
|
33
|
+
this.session = session;
|
|
34
|
+
this.chatService = chatService;
|
|
35
|
+
this.instantiationService = instantiationService;
|
|
36
|
+
this.chatWidgetService = chatWidgetService;
|
|
37
|
+
this.hasRendered = false;
|
|
38
|
+
this.domNode = $(".agent-session-hover.interactive-session");
|
|
39
|
+
this.domNode.style.width = `${CHAT_HOVER_WIDTH}px`;
|
|
40
|
+
this.domNode.style.height = `${HEADER_HEIGHT + CHAT_LIST_HEIGHT}px`;
|
|
41
|
+
this.domNode.style.overflow = "hidden";
|
|
42
|
+
this.cts = ( new CancellationTokenSource());
|
|
43
|
+
this._register(toDisposable(() => this.cts.cancel()));
|
|
44
|
+
this.buildHeader();
|
|
45
|
+
this.contentElement = append(this.domNode, $(".agent-session-hover-content"));
|
|
46
|
+
this.loadingElement = append(this.contentElement, $(".agent-session-hover-loading"));
|
|
47
|
+
append(this.loadingElement, renderIcon(ThemeIcon.modify(Codicon.loading, "spin")));
|
|
48
|
+
this.renderScheduler = this._register(( new RunOnceScheduler(() => this.render(), 200)));
|
|
49
|
+
}
|
|
50
|
+
onRendered() {
|
|
51
|
+
this.modelRef ??= this.loadModel();
|
|
52
|
+
if (!this.hasRendered) {
|
|
53
|
+
this.hasRendered = true;
|
|
54
|
+
this.renderScheduler.schedule();
|
|
55
|
+
} else {
|
|
56
|
+
this.listWidget?.layout(CHAT_LIST_HEIGHT, CHAT_HOVER_WIDTH);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async loadModel() {
|
|
60
|
+
const modelRef = await this.chatService.loadSessionForResource(this.session.resource, ChatAgentLocation.Chat, this.cts.token);
|
|
61
|
+
if (this._store.isDisposed) {
|
|
62
|
+
modelRef?.dispose();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!modelRef) {
|
|
66
|
+
this.loadingElement.remove();
|
|
67
|
+
const tooltip = this.buildFallbackTooltip(this.session);
|
|
68
|
+
this.domNode.textContent = typeof tooltip === "string" ? tooltip : tooltip.value;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this._register(modelRef);
|
|
72
|
+
return modelRef.object;
|
|
73
|
+
}
|
|
74
|
+
async render() {
|
|
75
|
+
this.modelRef ??= this.loadModel();
|
|
76
|
+
const model = await this.modelRef;
|
|
77
|
+
if (!model || this._store.isDisposed) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.loadingElement.remove();
|
|
81
|
+
const codeBlockCollection = this._register(
|
|
82
|
+
this.instantiationService.createInstance(CodeBlockModelCollection, "agentSessionHover")
|
|
83
|
+
);
|
|
84
|
+
const viewModel = this._register(
|
|
85
|
+
this.instantiationService.createInstance(ChatViewModel, model, codeBlockCollection, {
|
|
86
|
+
maxVisibleItems: 2
|
|
87
|
+
})
|
|
88
|
+
);
|
|
89
|
+
const container = append(this.contentElement, $(".interactive-list"));
|
|
90
|
+
const listWidget = this._register(this.instantiationService.createInstance(ChatListWidget, container, {
|
|
91
|
+
rendererOptions: {
|
|
92
|
+
renderStyle: "compact",
|
|
93
|
+
noHeader: true,
|
|
94
|
+
editable: false
|
|
95
|
+
},
|
|
96
|
+
currentChatMode: () => ChatModeKind.Ask
|
|
97
|
+
}));
|
|
98
|
+
listWidget.layout(CHAT_LIST_HEIGHT, CHAT_HOVER_WIDTH);
|
|
99
|
+
listWidget.setScrollLock(true);
|
|
100
|
+
listWidget.setViewModel(viewModel);
|
|
101
|
+
listWidget.refresh();
|
|
102
|
+
const viewModelScheudler = this._register(( new RunOnceScheduler(() => listWidget.refresh(), 500)));
|
|
103
|
+
this._register(viewModel.onDidChange(() => {
|
|
104
|
+
if (!viewModelScheudler.isScheduled()) {
|
|
105
|
+
viewModelScheudler.schedule();
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
this._register(listWidget.onDidClickFollowup(async followup => {
|
|
109
|
+
const widget = await this.chatWidgetService.openSession(model.sessionResource);
|
|
110
|
+
if (widget) {
|
|
111
|
+
widget.acceptInput(followup.message);
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
buildHeader() {
|
|
116
|
+
const session = this.session;
|
|
117
|
+
const header = append(this.domNode, $(".agent-session-hover-header"));
|
|
118
|
+
const titleRow = append(header, $(".agent-session-hover-title"));
|
|
119
|
+
append(titleRow, $("span", undefined, session.label));
|
|
120
|
+
const detailsRow = append(header, $(".agent-session-hover-details"));
|
|
121
|
+
const providerType = getAgentSessionProvider(session.providerType);
|
|
122
|
+
const provider = providerType ?? AgentSessionProviders.Local;
|
|
123
|
+
const providerIcon = getAgentSessionProviderIcon(provider);
|
|
124
|
+
append(detailsRow, renderIcon(providerIcon));
|
|
125
|
+
append(
|
|
126
|
+
detailsRow,
|
|
127
|
+
$("span", undefined, getAgentSessionProviderName(provider))
|
|
128
|
+
);
|
|
129
|
+
append(detailsRow, $("span.separator", undefined, "•"));
|
|
130
|
+
if (session.timing.lastRequestEnded && session.timing.lastRequestStarted) {
|
|
131
|
+
const duration = this.toDuration(session.timing.lastRequestStarted, session.timing.lastRequestEnded, true);
|
|
132
|
+
if (duration) {
|
|
133
|
+
append(detailsRow, $("span", undefined, duration));
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
const startTime = session.timing.lastRequestStarted ?? session.timing.created;
|
|
137
|
+
append(detailsRow, $("span", undefined, fromNow(startTime, true, true)));
|
|
138
|
+
}
|
|
139
|
+
const diff = getAgentChangesSummary(session.changes);
|
|
140
|
+
if (diff && hasValidDiff(session.changes)) {
|
|
141
|
+
append(detailsRow, $("span.separator", undefined, "•"));
|
|
142
|
+
const diffContainer = append(detailsRow, $(".agent-session-hover-diff"));
|
|
143
|
+
if (diff.files > 0) {
|
|
144
|
+
append(diffContainer, $("span", undefined, diff.files === 1 ? ( localize(4888, "1 file")) : ( localize(4889, "{0} files", diff.files))));
|
|
145
|
+
}
|
|
146
|
+
if (diff.insertions > 0) {
|
|
147
|
+
append(diffContainer, $("span.insertions", undefined, `+${diff.insertions}`));
|
|
148
|
+
}
|
|
149
|
+
if (diff.deletions > 0) {
|
|
150
|
+
append(diffContainer, $("span.deletions", undefined, `-${diff.deletions}`));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (session.status !== ChatSessionStatus.Completed) {
|
|
154
|
+
append(detailsRow, $("span.separator", undefined, "•"));
|
|
155
|
+
append(detailsRow, $("span", undefined, this.toStatusLabel(session.status)));
|
|
156
|
+
}
|
|
157
|
+
if (session.isArchived()) {
|
|
158
|
+
append(detailsRow, $("span.separator", undefined, "•"));
|
|
159
|
+
append(detailsRow, renderIcon(Codicon.archive));
|
|
160
|
+
append(detailsRow, $("span", undefined, ( localize(4890, "Archived"))));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
buildFallbackTooltip(session) {
|
|
164
|
+
const lines = [];
|
|
165
|
+
lines.push(`**${session.label}**`);
|
|
166
|
+
if (session.tooltip) {
|
|
167
|
+
const tooltip = typeof session.tooltip === "string" ? session.tooltip : session.tooltip.value;
|
|
168
|
+
lines.push(tooltip);
|
|
169
|
+
} else {
|
|
170
|
+
if (session.description) {
|
|
171
|
+
const description = typeof session.description === "string" ? session.description : session.description.value;
|
|
172
|
+
lines.push(description);
|
|
173
|
+
}
|
|
174
|
+
if (session.badge) {
|
|
175
|
+
const badge = typeof session.badge === "string" ? session.badge : session.badge.value;
|
|
176
|
+
lines.push(badge);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const details = [];
|
|
180
|
+
const providerType = getAgentSessionProvider(session.providerType);
|
|
181
|
+
const provider = providerType ?? AgentSessionProviders.Local;
|
|
182
|
+
const providerIcon = getAgentSessionProviderIcon(provider);
|
|
183
|
+
const providerName = getAgentSessionProviderName(provider);
|
|
184
|
+
let timeLabel;
|
|
185
|
+
if (session.timing.lastRequestEnded && session.timing.lastRequestStarted) {
|
|
186
|
+
const duration = this.toDuration(session.timing.lastRequestStarted, session.timing.lastRequestEnded, true);
|
|
187
|
+
timeLabel = duration ?? fromNow(session.timing.lastRequestStarted, true, true);
|
|
188
|
+
} else {
|
|
189
|
+
const startTime = session.timing.lastRequestStarted ?? session.timing.created;
|
|
190
|
+
timeLabel = fromNow(startTime, true, true);
|
|
191
|
+
}
|
|
192
|
+
details.push(`$(${providerIcon.id}) ${providerName} • ${timeLabel}`);
|
|
193
|
+
const diff = getAgentChangesSummary(session.changes);
|
|
194
|
+
if (diff && hasValidDiff(session.changes)) {
|
|
195
|
+
const diffParts = [];
|
|
196
|
+
if (diff.files > 0) {
|
|
197
|
+
diffParts.push(diff.files === 1 ? ( localize(4888, "1 file")) : ( localize(4889, "{0} files", diff.files)));
|
|
198
|
+
}
|
|
199
|
+
if (diff.insertions > 0) {
|
|
200
|
+
diffParts.push(`+${diff.insertions}`);
|
|
201
|
+
}
|
|
202
|
+
if (diff.deletions > 0) {
|
|
203
|
+
diffParts.push(`-${diff.deletions}`);
|
|
204
|
+
}
|
|
205
|
+
if (diffParts.length > 0) {
|
|
206
|
+
details.push(diffParts.join(" "));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (session.status !== ChatSessionStatus.Completed) {
|
|
210
|
+
details.push(this.toStatusLabel(session.status));
|
|
211
|
+
}
|
|
212
|
+
lines.push(details.join(" • "));
|
|
213
|
+
if (session.isArchived()) {
|
|
214
|
+
lines.push(`$(archive) ${( localize(4890, "Archived"))}`);
|
|
215
|
+
}
|
|
216
|
+
return ( new MarkdownString(lines.join("\n\n"), {
|
|
217
|
+
supportThemeIcons: true
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
toDuration(startTime, endTime, useFullTimeWords) {
|
|
221
|
+
const elapsed = Math.round((endTime - startTime) / 1000) * 1000;
|
|
222
|
+
if (elapsed < 1000) {
|
|
223
|
+
return undefined;
|
|
224
|
+
}
|
|
225
|
+
return getDurationString(elapsed, useFullTimeWords);
|
|
226
|
+
}
|
|
227
|
+
toStatusLabel(status) {
|
|
228
|
+
let statusLabel;
|
|
229
|
+
switch (status) {
|
|
230
|
+
case ChatSessionStatus.NeedsInput:
|
|
231
|
+
statusLabel = ( localize(4891, "Needs Input"));
|
|
232
|
+
break;
|
|
233
|
+
case ChatSessionStatus.InProgress:
|
|
234
|
+
statusLabel = ( localize(4892, "In Progress"));
|
|
235
|
+
break;
|
|
236
|
+
case ChatSessionStatus.Failed:
|
|
237
|
+
statusLabel = ( localize(4893, "Failed"));
|
|
238
|
+
break;
|
|
239
|
+
default:
|
|
240
|
+
statusLabel = ( localize(4894, "Completed"));
|
|
241
|
+
}
|
|
242
|
+
return statusLabel;
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
AgentSessionHoverWidget = ( __decorate([( __param(1, IChatService)), ( __param(2, IInstantiationService)), ( __param(3, IChatWidgetService))], AgentSessionHoverWidget));
|
|
246
|
+
|
|
247
|
+
export { AgentSessionHoverWidget };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
2
|
+
import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { IOpenEvent } from "@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService";
|
|
5
|
+
import { IAgentSession } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel";
|
|
6
|
+
import { AgentSessionListItem, IAgentSessionsFilter, IAgentSessionsSorterOptions } from "./agentSessionsViewer.js";
|
|
7
|
+
import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
|
|
8
|
+
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
9
|
+
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
10
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
11
|
+
import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service";
|
|
12
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
13
|
+
import { IListStyles } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/list/listWidget";
|
|
14
|
+
import { IStyleOverride } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles";
|
|
15
|
+
import { IAgentSessionsControl } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions";
|
|
16
|
+
import { HoverPosition } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget";
|
|
17
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
18
|
+
import { ISessionOpenOptions } from "./agentSessionsOpener.js";
|
|
19
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
20
|
+
import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
21
|
+
export interface IAgentSessionsControlOptions extends IAgentSessionsSorterOptions {
|
|
22
|
+
readonly overrideStyles: IStyleOverride<IListStyles>;
|
|
23
|
+
readonly filter: IAgentSessionsFilter;
|
|
24
|
+
readonly source: string;
|
|
25
|
+
getHoverPosition(): HoverPosition;
|
|
26
|
+
trackActiveEditorSession(): boolean;
|
|
27
|
+
overrideSessionOpenOptions?(openEvent: IOpenEvent<AgentSessionListItem | undefined>): ISessionOpenOptions;
|
|
28
|
+
notifySessionOpened?(resource: URI, widget: IChatWidget): void;
|
|
29
|
+
}
|
|
30
|
+
export declare class AgentSessionsControl extends Disposable implements IAgentSessionsControl {
|
|
31
|
+
private readonly container;
|
|
32
|
+
private readonly options;
|
|
33
|
+
private readonly contextMenuService;
|
|
34
|
+
private readonly contextKeyService;
|
|
35
|
+
private readonly instantiationService;
|
|
36
|
+
private readonly chatSessionsService;
|
|
37
|
+
private readonly commandService;
|
|
38
|
+
private readonly menuService;
|
|
39
|
+
private readonly agentSessionsService;
|
|
40
|
+
private readonly telemetryService;
|
|
41
|
+
private readonly editorService;
|
|
42
|
+
private sessionsContainer;
|
|
43
|
+
get element(): HTMLElement | undefined;
|
|
44
|
+
private sessionsList;
|
|
45
|
+
private sessionsListFindIsOpen;
|
|
46
|
+
private visible;
|
|
47
|
+
private focusedAgentSessionArchivedContextKey;
|
|
48
|
+
private focusedAgentSessionReadContextKey;
|
|
49
|
+
private focusedAgentSessionTypeContextKey;
|
|
50
|
+
private hasMultipleAgentSessionsSelectedContextKey;
|
|
51
|
+
constructor(container: HTMLElement, options: IAgentSessionsControlOptions, contextMenuService: IContextMenuService, contextKeyService: IContextKeyService, instantiationService: IInstantiationService, chatSessionsService: IChatSessionsService, commandService: ICommandService, menuService: IMenuService, agentSessionsService: IAgentSessionsService, telemetryService: ITelemetryService, editorService: IEditorService);
|
|
52
|
+
private registerListeners;
|
|
53
|
+
private revealAndFocusActiveEditorSession;
|
|
54
|
+
private createList;
|
|
55
|
+
private openAgentSession;
|
|
56
|
+
private showContextMenu;
|
|
57
|
+
private showAgentSessionSectionContextMenu;
|
|
58
|
+
private showAgentSessionContextMenu;
|
|
59
|
+
openFind(): void;
|
|
60
|
+
private updateSectionCollapseStates;
|
|
61
|
+
refresh(): Promise<void>;
|
|
62
|
+
update(): Promise<void>;
|
|
63
|
+
setVisible(visible: boolean): void;
|
|
64
|
+
layout(height: number, width: number): void;
|
|
65
|
+
focus(): void;
|
|
66
|
+
clearFocus(): void;
|
|
67
|
+
hasFocusOrSelection(): boolean;
|
|
68
|
+
scrollToTop(): void;
|
|
69
|
+
getFocus(): IAgentSession[];
|
|
70
|
+
reveal(sessionResource: URI): boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
4
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
5
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
6
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
+
import { WorkbenchCompressibleAsyncDataTree } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
8
|
+
import { append, $, EventHelper } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
9
|
+
import { isAgentSessionSection, AgentSessionSection, isAgentSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
|
|
10
|
+
import { AgentSessionsSorter, AgentSessionsListDelegate, AgentSessionsCompressionDelegate, AgentSessionRenderer, AgentSessionSectionRenderer, AgentSessionsDataSource, AgentSessionsKeyboardNavigationLabelProvider, AgentSessionsIdentityProvider, AgentSessionsDragAndDrop, AgentSessionsAccessibilityProvider } from './agentSessionsViewer.js';
|
|
11
|
+
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
12
|
+
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
13
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
14
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
15
|
+
import { ACTION_ID_NEW_CHAT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
16
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
17
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
18
|
+
import { MarshalledId } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshallingIds';
|
|
19
|
+
import { Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
20
|
+
import { RenderIndentGuides, TreeFindMode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/tree/abstractTree';
|
|
21
|
+
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
22
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
23
|
+
import { openSession } from './agentSessionsOpener.js';
|
|
24
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
25
|
+
import { ChatEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput';
|
|
26
|
+
|
|
27
|
+
let AgentSessionsControl = class AgentSessionsControl extends Disposable {
|
|
28
|
+
get element() {
|
|
29
|
+
return this.sessionsContainer;
|
|
30
|
+
}
|
|
31
|
+
constructor(
|
|
32
|
+
container,
|
|
33
|
+
options,
|
|
34
|
+
contextMenuService,
|
|
35
|
+
contextKeyService,
|
|
36
|
+
instantiationService,
|
|
37
|
+
chatSessionsService,
|
|
38
|
+
commandService,
|
|
39
|
+
menuService,
|
|
40
|
+
agentSessionsService,
|
|
41
|
+
telemetryService,
|
|
42
|
+
editorService
|
|
43
|
+
) {
|
|
44
|
+
super();
|
|
45
|
+
this.container = container;
|
|
46
|
+
this.options = options;
|
|
47
|
+
this.contextMenuService = contextMenuService;
|
|
48
|
+
this.contextKeyService = contextKeyService;
|
|
49
|
+
this.instantiationService = instantiationService;
|
|
50
|
+
this.chatSessionsService = chatSessionsService;
|
|
51
|
+
this.commandService = commandService;
|
|
52
|
+
this.menuService = menuService;
|
|
53
|
+
this.agentSessionsService = agentSessionsService;
|
|
54
|
+
this.telemetryService = telemetryService;
|
|
55
|
+
this.editorService = editorService;
|
|
56
|
+
this.sessionsListFindIsOpen = false;
|
|
57
|
+
this.visible = true;
|
|
58
|
+
this.focusedAgentSessionArchivedContextKey = ChatContextKeys.isArchivedAgentSession.bindTo(this.contextKeyService);
|
|
59
|
+
this.focusedAgentSessionReadContextKey = ChatContextKeys.isReadAgentSession.bindTo(this.contextKeyService);
|
|
60
|
+
this.focusedAgentSessionTypeContextKey = ChatContextKeys.agentSessionType.bindTo(this.contextKeyService);
|
|
61
|
+
this.hasMultipleAgentSessionsSelectedContextKey = ChatContextKeys.hasMultipleAgentSessionsSelected.bindTo(this.contextKeyService);
|
|
62
|
+
this.createList(this.container);
|
|
63
|
+
this.registerListeners();
|
|
64
|
+
}
|
|
65
|
+
registerListeners() {
|
|
66
|
+
this._register(
|
|
67
|
+
this.editorService.onDidActiveEditorChange(() => this.revealAndFocusActiveEditorSession())
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
revealAndFocusActiveEditorSession() {
|
|
71
|
+
if (!this.options.trackActiveEditorSession() || !this.visible) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const input = this.editorService.activeEditor;
|
|
75
|
+
const resource = (input instanceof ChatEditorInput) ? input.sessionResource : input?.resource;
|
|
76
|
+
if (!resource) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const matchingSession = this.agentSessionsService.model.getSession(resource);
|
|
80
|
+
if (matchingSession && this.sessionsList?.hasNode(matchingSession)) {
|
|
81
|
+
if (this.sessionsList.getRelativeTop(matchingSession) === null) {
|
|
82
|
+
this.sessionsList.reveal(matchingSession, 0.5);
|
|
83
|
+
}
|
|
84
|
+
this.sessionsList.setFocus([matchingSession]);
|
|
85
|
+
this.sessionsList.setSelection([matchingSession]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
createList(container) {
|
|
89
|
+
this.sessionsContainer = append(container, $(".agent-sessions-viewer"));
|
|
90
|
+
const collapseByDefault = element => {
|
|
91
|
+
if (isAgentSessionSection(element)) {
|
|
92
|
+
if (element.section === AgentSessionSection.More && !this.options.filter.getExcludes().read) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
if (element.section === AgentSessionSection.Archived && this.options.filter.getExcludes().archived) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return false;
|
|
100
|
+
};
|
|
101
|
+
const sorter = ( new AgentSessionsSorter(this.options));
|
|
102
|
+
const list = this.sessionsList = this._register(this.instantiationService.createInstance(
|
|
103
|
+
WorkbenchCompressibleAsyncDataTree,
|
|
104
|
+
"AgentSessionsView",
|
|
105
|
+
this.sessionsContainer,
|
|
106
|
+
( new AgentSessionsListDelegate()),
|
|
107
|
+
( new AgentSessionsCompressionDelegate()),
|
|
108
|
+
[this._register(
|
|
109
|
+
this.instantiationService.createInstance(AgentSessionRenderer, this.options)
|
|
110
|
+
), this.instantiationService.createInstance(AgentSessionSectionRenderer)],
|
|
111
|
+
( new AgentSessionsDataSource(this.options.filter, sorter)),
|
|
112
|
+
{
|
|
113
|
+
accessibilityProvider: ( new AgentSessionsAccessibilityProvider()),
|
|
114
|
+
dnd: this.instantiationService.createInstance(AgentSessionsDragAndDrop),
|
|
115
|
+
identityProvider: ( new AgentSessionsIdentityProvider()),
|
|
116
|
+
horizontalScrolling: false,
|
|
117
|
+
multipleSelectionSupport: true,
|
|
118
|
+
findWidgetEnabled: true,
|
|
119
|
+
defaultFindMode: TreeFindMode.Filter,
|
|
120
|
+
keyboardNavigationLabelProvider: ( new AgentSessionsKeyboardNavigationLabelProvider()),
|
|
121
|
+
overrideStyles: this.options.overrideStyles,
|
|
122
|
+
twistieAdditionalCssClass: () => "force-no-twistie",
|
|
123
|
+
collapseByDefault: element => collapseByDefault(element),
|
|
124
|
+
renderIndentGuides: RenderIndentGuides.None
|
|
125
|
+
}
|
|
126
|
+
));
|
|
127
|
+
ChatContextKeys.agentSessionsViewerFocused.bindTo(list.contextKeyService);
|
|
128
|
+
const model = this.agentSessionsService.model;
|
|
129
|
+
this._register(this.options.filter.onDidChange(async () => {
|
|
130
|
+
if (this.visible) {
|
|
131
|
+
this.updateSectionCollapseStates();
|
|
132
|
+
list.updateChildren();
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
this._register(model.onDidChangeSessions(() => {
|
|
136
|
+
if (this.visible) {
|
|
137
|
+
list.updateChildren();
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
list.setInput(model);
|
|
141
|
+
this._register(list.onDidOpen(e => this.openAgentSession(e)));
|
|
142
|
+
this._register(list.onContextMenu(e => this.showContextMenu(e)));
|
|
143
|
+
this._register(list.onMouseDblClick((
|
|
144
|
+
{
|
|
145
|
+
element
|
|
146
|
+
}
|
|
147
|
+
) => {
|
|
148
|
+
if (element === null) {
|
|
149
|
+
this.commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
150
|
+
}
|
|
151
|
+
}));
|
|
152
|
+
this._register(Event.any(
|
|
153
|
+
list.onDidChangeFocus,
|
|
154
|
+
list.onDidChangeSelection,
|
|
155
|
+
model.onDidChangeSessions
|
|
156
|
+
)(() => {
|
|
157
|
+
const focused = list.getFocus().at(0);
|
|
158
|
+
if (focused && isAgentSession(focused)) {
|
|
159
|
+
this.focusedAgentSessionArchivedContextKey.set(focused.isArchived());
|
|
160
|
+
this.focusedAgentSessionReadContextKey.set(focused.isRead());
|
|
161
|
+
this.focusedAgentSessionTypeContextKey.set(focused.providerType);
|
|
162
|
+
} else {
|
|
163
|
+
this.focusedAgentSessionArchivedContextKey.reset();
|
|
164
|
+
this.focusedAgentSessionReadContextKey.reset();
|
|
165
|
+
this.focusedAgentSessionTypeContextKey.reset();
|
|
166
|
+
}
|
|
167
|
+
const selection = list.getSelection().filter(isAgentSession);
|
|
168
|
+
this.hasMultipleAgentSessionsSelectedContextKey.set(selection.length > 1);
|
|
169
|
+
}));
|
|
170
|
+
this._register(list.onDidChangeFindOpenState(open => {
|
|
171
|
+
this.sessionsListFindIsOpen = open;
|
|
172
|
+
this.updateSectionCollapseStates();
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
async openAgentSession(e) {
|
|
176
|
+
const element = e.element;
|
|
177
|
+
if (!element || isAgentSessionSection(element)) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
this.telemetryService.publicLog2("agentSessionOpened", {
|
|
181
|
+
providerType: element.providerType,
|
|
182
|
+
source: this.options.source
|
|
183
|
+
});
|
|
184
|
+
const options = this.options.overrideSessionOpenOptions?.(e) ?? e;
|
|
185
|
+
const widget = await this.instantiationService.invokeFunction(openSession, element, options);
|
|
186
|
+
if (widget) {
|
|
187
|
+
this.options.notifySessionOpened?.(element.resource, widget);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async showContextMenu(
|
|
191
|
+
{
|
|
192
|
+
element,
|
|
193
|
+
anchor,
|
|
194
|
+
browserEvent
|
|
195
|
+
}
|
|
196
|
+
) {
|
|
197
|
+
if (!element) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
EventHelper.stop(browserEvent, true);
|
|
201
|
+
if (isAgentSessionSection(element)) {
|
|
202
|
+
this.showAgentSessionSectionContextMenu(element, anchor);
|
|
203
|
+
} else {
|
|
204
|
+
this.showAgentSessionContextMenu(element, anchor);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async showAgentSessionSectionContextMenu(section, anchor) {
|
|
208
|
+
const contextOverlay = [];
|
|
209
|
+
contextOverlay.push([ChatContextKeys.agentSessionSection.key, section.section]);
|
|
210
|
+
const menu = this.menuService.createMenu(
|
|
211
|
+
MenuId.AgentSessionSectionContext,
|
|
212
|
+
this.contextKeyService.createOverlay(contextOverlay)
|
|
213
|
+
);
|
|
214
|
+
this.contextMenuService.showContextMenu({
|
|
215
|
+
getActions: () => Separator.join(...( menu.getActions({
|
|
216
|
+
arg: section,
|
|
217
|
+
shouldForwardArgs: true
|
|
218
|
+
}).map(([, actions]) => actions))),
|
|
219
|
+
getAnchor: () => anchor,
|
|
220
|
+
getActionsContext: () => section
|
|
221
|
+
});
|
|
222
|
+
menu.dispose();
|
|
223
|
+
}
|
|
224
|
+
async showAgentSessionContextMenu(session, anchor) {
|
|
225
|
+
await this.chatSessionsService.activateChatSessionItemProvider(session.providerType);
|
|
226
|
+
const contextOverlay = [];
|
|
227
|
+
contextOverlay.push([ChatContextKeys.isArchivedAgentSession.key, session.isArchived()]);
|
|
228
|
+
contextOverlay.push([ChatContextKeys.isReadAgentSession.key, session.isRead()]);
|
|
229
|
+
contextOverlay.push([ChatContextKeys.agentSessionType.key, session.providerType]);
|
|
230
|
+
const menu = this.menuService.createMenu(
|
|
231
|
+
MenuId.AgentSessionsContext,
|
|
232
|
+
this.contextKeyService.createOverlay(contextOverlay)
|
|
233
|
+
);
|
|
234
|
+
const selection = this.sessionsList?.getSelection().filter(isAgentSession) ?? [];
|
|
235
|
+
const marshalledContext = {
|
|
236
|
+
session,
|
|
237
|
+
sessions: selection.length > 1 && selection.includes(session) ? selection : [session],
|
|
238
|
+
$mid: MarshalledId.AgentSessionContext
|
|
239
|
+
};
|
|
240
|
+
this.contextMenuService.showContextMenu({
|
|
241
|
+
getActions: () => Separator.join(...( menu.getActions({
|
|
242
|
+
arg: marshalledContext,
|
|
243
|
+
shouldForwardArgs: true
|
|
244
|
+
}).map(([, actions]) => actions))),
|
|
245
|
+
getAnchor: () => anchor,
|
|
246
|
+
getActionsContext: () => marshalledContext
|
|
247
|
+
});
|
|
248
|
+
menu.dispose();
|
|
249
|
+
}
|
|
250
|
+
openFind() {
|
|
251
|
+
this.sessionsList?.openFind();
|
|
252
|
+
}
|
|
253
|
+
updateSectionCollapseStates() {
|
|
254
|
+
if (!this.sessionsList) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const model = this.agentSessionsService.model;
|
|
258
|
+
for (const child of this.sessionsList.getNode(model).children) {
|
|
259
|
+
if (!isAgentSessionSection(child.element)) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
switch (child.element.section) {
|
|
263
|
+
case AgentSessionSection.Archived:
|
|
264
|
+
{
|
|
265
|
+
const shouldCollapseArchived =
|
|
266
|
+
!this.sessionsListFindIsOpen && this.options.filter.getExcludes().archived;
|
|
267
|
+
if (shouldCollapseArchived && !child.collapsed) {
|
|
268
|
+
this.sessionsList.collapse(child.element);
|
|
269
|
+
} else if (!shouldCollapseArchived && child.collapsed) {
|
|
270
|
+
this.sessionsList.expand(child.element);
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case AgentSessionSection.More:
|
|
275
|
+
{
|
|
276
|
+
if (child.collapsed) {
|
|
277
|
+
let autoExpandMore = false;
|
|
278
|
+
if (this.sessionsListFindIsOpen) {
|
|
279
|
+
autoExpandMore = true;
|
|
280
|
+
} else if (this.options.filter.getExcludes().read && ( child.element.sessions.some(session => !session.isRead()))) {
|
|
281
|
+
autoExpandMore = true;
|
|
282
|
+
}
|
|
283
|
+
if (autoExpandMore) {
|
|
284
|
+
this.sessionsList.expand(child.element);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
refresh() {
|
|
293
|
+
return this.agentSessionsService.model.resolve(undefined);
|
|
294
|
+
}
|
|
295
|
+
async update() {
|
|
296
|
+
await this.sessionsList?.updateChildren();
|
|
297
|
+
}
|
|
298
|
+
setVisible(visible) {
|
|
299
|
+
if (this.visible === visible) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
this.visible = visible;
|
|
303
|
+
if (this.visible) {
|
|
304
|
+
this.sessionsList?.updateChildren();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
layout(height, width) {
|
|
308
|
+
this.sessionsList?.layout(height, width);
|
|
309
|
+
}
|
|
310
|
+
focus() {
|
|
311
|
+
this.sessionsList?.domFocus();
|
|
312
|
+
}
|
|
313
|
+
clearFocus() {
|
|
314
|
+
this.sessionsList?.setFocus([]);
|
|
315
|
+
this.sessionsList?.setSelection([]);
|
|
316
|
+
}
|
|
317
|
+
hasFocusOrSelection() {
|
|
318
|
+
return (this.sessionsList?.getFocus().length ?? 0) > 0 || (this.sessionsList?.getSelection().length ?? 0) > 0;
|
|
319
|
+
}
|
|
320
|
+
scrollToTop() {
|
|
321
|
+
if (this.sessionsList) {
|
|
322
|
+
this.sessionsList.scrollTop = 0;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
getFocus() {
|
|
326
|
+
const focused = this.sessionsList?.getFocus() ?? [];
|
|
327
|
+
return focused.filter(e => isAgentSession(e));
|
|
328
|
+
}
|
|
329
|
+
reveal(sessionResource) {
|
|
330
|
+
if (!this.sessionsList) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
const session = this.agentSessionsService.model.getSession(sessionResource);
|
|
334
|
+
if (!session || !this.sessionsList.hasNode(session)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
if (this.sessionsList.getRelativeTop(session) === null) {
|
|
338
|
+
this.sessionsList.reveal(session, 0.5);
|
|
339
|
+
}
|
|
340
|
+
this.sessionsList.setFocus([session]);
|
|
341
|
+
this.sessionsList.setSelection([session]);
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
AgentSessionsControl = ( __decorate([( __param(2, IContextMenuService)), ( __param(3, IContextKeyService)), ( __param(4, IInstantiationService)), ( __param(5, IChatSessionsService)), ( __param(6, ICommandService)), ( __param(7, IMenuService)), ( __param(8, IAgentSessionsService)), ( __param(9, ITelemetryService)), ( __param(10, IEditorService))], AgentSessionsControl));
|
|
346
|
+
|
|
347
|
+
export { AgentSessionsControl };
|