@codingame/monaco-vscode-katex-common 25.1.2 → 26.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +23 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
- package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +80 -19
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { reset
|
|
3
|
+
import { $, reset } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { renderLabelWithIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
5
5
|
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
6
6
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
@@ -8,7 +8,6 @@ import { groupBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/coll
|
|
|
8
8
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
9
9
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
10
10
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
11
|
-
import { ActionWidgetDropdownActionViewItem } from '../../../../../../platform/actions/browser/actionWidgetDropdownActionViewItem.js';
|
|
12
11
|
import { getFlatActionBarActions } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
13
12
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
14
13
|
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
@@ -18,39 +17,124 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
18
17
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
19
18
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
20
19
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
20
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
21
21
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
22
22
|
import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
23
23
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
24
|
+
import { isOrganizationPromptFile } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/utils/promptsServiceUtils';
|
|
24
25
|
import { ChatConfiguration, ChatModeKind, ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
25
|
-
import { PromptsStorage
|
|
26
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
26
27
|
import { getOpenChatActionIdForMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
27
28
|
import { ToggleAgentModeActionId } from '../../actions/chatExecuteActions.js';
|
|
29
|
+
import { ChatInputPickerActionViewItem } from './chatInputPickerActionItem.js';
|
|
30
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
28
31
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const builtinDefaultIcon = Codicon.tasklist;
|
|
34
|
+
let ModePickerActionItem = class ModePickerActionItem extends ChatInputPickerActionViewItem {
|
|
35
|
+
constructor(
|
|
36
|
+
action,
|
|
37
|
+
delegate,
|
|
38
|
+
pickerOptions,
|
|
39
|
+
actionWidgetService,
|
|
40
|
+
chatAgentService,
|
|
41
|
+
keybindingService,
|
|
42
|
+
configurationService,
|
|
43
|
+
contextKeyService,
|
|
44
|
+
chatModeService,
|
|
45
|
+
menuService,
|
|
46
|
+
commandService,
|
|
47
|
+
_productService,
|
|
48
|
+
telemetryService,
|
|
49
|
+
openerService
|
|
50
|
+
) {
|
|
51
|
+
const customAgentTarget = delegate.customAgentTarget?.();
|
|
52
|
+
const builtInCategory = {
|
|
53
|
+
label: ( localize(6106, "Built-In")),
|
|
54
|
+
order: 0
|
|
55
|
+
};
|
|
56
|
+
const customCategory = {
|
|
57
|
+
label: ( localize(6107, "Custom")),
|
|
58
|
+
order: 1
|
|
59
|
+
};
|
|
60
|
+
const policyDisabledCategory = {
|
|
61
|
+
label: ( localize(6108, "Managed by your organization")),
|
|
62
|
+
order: 999,
|
|
63
|
+
showHeader: true
|
|
64
|
+
};
|
|
35
65
|
const agentModeDisabledViaPolicy = configurationService.inspect(ChatConfiguration.AgentEnabled).policyValue === false;
|
|
36
66
|
const makeAction = (mode, currentMode) => {
|
|
37
|
-
const isDisabledViaPolicy = mode.kind === ChatModeKind.Agent &&
|
|
38
|
-
agentModeDisabledViaPolicy;
|
|
67
|
+
const isDisabledViaPolicy = mode.kind === ChatModeKind.Agent && agentModeDisabledViaPolicy;
|
|
39
68
|
const tooltip = chatAgentService.getDefaultAgent(ChatAgentLocation.Chat, mode.kind)?.description ?? action.tooltip;
|
|
69
|
+
const toolbarActions = [];
|
|
70
|
+
if (mode.kind === ChatModeKind.Agent && !isDisabledViaPolicy) {
|
|
71
|
+
if (mode.uri) {
|
|
72
|
+
let label, icon, id;
|
|
73
|
+
if (mode.source?.storage === PromptsStorage.extension) {
|
|
74
|
+
icon = Codicon.eye;
|
|
75
|
+
id = `viewAgent:${mode.id}`;
|
|
76
|
+
label = ( localize(6109, "View {0} agent", mode.label.get()));
|
|
77
|
+
} else {
|
|
78
|
+
icon = Codicon.edit;
|
|
79
|
+
id = `editAgent:${mode.id}`;
|
|
80
|
+
label = ( localize(6110, "Edit {0} agent", mode.label.get()));
|
|
81
|
+
}
|
|
82
|
+
const modeResource = mode.uri;
|
|
83
|
+
toolbarActions.push({
|
|
84
|
+
id,
|
|
85
|
+
label,
|
|
86
|
+
tooltip: label,
|
|
87
|
+
class: ThemeIcon.asClassName(icon),
|
|
88
|
+
enabled: true,
|
|
89
|
+
run: async () => {
|
|
90
|
+
openerService.open(modeResource.get());
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
} else if (!customAgentTarget) {
|
|
94
|
+
const label = ( localize(6111, "Configure tools for {0} agent", mode.label.get()));
|
|
95
|
+
toolbarActions.push({
|
|
96
|
+
id: `configureTools:${mode.id}`,
|
|
97
|
+
label,
|
|
98
|
+
tooltip: label,
|
|
99
|
+
class: ThemeIcon.asClassName(Codicon.tools),
|
|
100
|
+
enabled: true,
|
|
101
|
+
run: async () => {
|
|
102
|
+
actionWidgetService.hide();
|
|
103
|
+
if (currentMode.id !== mode.id) {
|
|
104
|
+
await commandService.executeCommand(ToggleAgentModeActionId, {
|
|
105
|
+
modeId: mode.id,
|
|
106
|
+
sessionResource: this.delegate.sessionResource()
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
await commandService.executeCommand("workbench.action.chat.configureTools", pickerOptions.actionContext, {
|
|
110
|
+
source: "modePicker"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
40
116
|
return {
|
|
41
117
|
...action,
|
|
42
118
|
id: getOpenChatActionIdForMode(mode),
|
|
43
119
|
label: mode.label.get(),
|
|
44
|
-
icon: isDisabledViaPolicy ? ThemeIcon.fromId(Codicon.lock.id) :
|
|
45
|
-
class: isDisabledViaPolicy ?
|
|
120
|
+
icon: isDisabledViaPolicy ? ThemeIcon.fromId(Codicon.lock.id) : mode.icon.get(),
|
|
121
|
+
class: isDisabledViaPolicy ? "disabled-by-policy" : undefined,
|
|
46
122
|
enabled: !isDisabledViaPolicy,
|
|
47
123
|
checked: !isDisabledViaPolicy && currentMode.id === mode.id,
|
|
48
|
-
tooltip,
|
|
124
|
+
tooltip: "",
|
|
125
|
+
hover: {
|
|
126
|
+
content: tooltip,
|
|
127
|
+
position: this.pickerOptions.hoverPosition
|
|
128
|
+
},
|
|
129
|
+
toolbarActions,
|
|
49
130
|
run: async () => {
|
|
50
131
|
if (isDisabledViaPolicy) {
|
|
51
132
|
return;
|
|
52
133
|
}
|
|
53
|
-
const result = await commandService.executeCommand(ToggleAgentModeActionId, {
|
|
134
|
+
const result = await commandService.executeCommand(ToggleAgentModeActionId, {
|
|
135
|
+
modeId: mode.id,
|
|
136
|
+
sessionResource: this.delegate.sessionResource()
|
|
137
|
+
});
|
|
54
138
|
if (this.element) {
|
|
55
139
|
this.renderLabel(this.element);
|
|
56
140
|
}
|
|
@@ -62,42 +146,87 @@ let ModePickerActionItem = class ModePickerActionItem extends ActionWidgetDropdo
|
|
|
62
146
|
const makeActionFromCustomMode = (mode, currentMode) => {
|
|
63
147
|
return {
|
|
64
148
|
...makeAction(mode, currentMode),
|
|
65
|
-
tooltip:
|
|
149
|
+
tooltip: "",
|
|
150
|
+
hover: {
|
|
151
|
+
content: mode.description.get() ?? chatAgentService.getDefaultAgent(ChatAgentLocation.Chat, mode.kind)?.description ?? action.tooltip,
|
|
152
|
+
position: this.pickerOptions.hoverPosition
|
|
153
|
+
},
|
|
154
|
+
icon: mode.icon.get() ?? (isModeConsideredBuiltIn(mode, this._productService) ? builtinDefaultIcon : undefined),
|
|
66
155
|
category: agentModeDisabledViaPolicy ? policyDisabledCategory : customCategory
|
|
67
156
|
};
|
|
68
157
|
};
|
|
158
|
+
const isUserDefinedCustomAgent = mode => {
|
|
159
|
+
if (mode.isBuiltin || !mode.source) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return mode.source.storage === PromptsStorage.local || mode.source.storage === PromptsStorage.user;
|
|
163
|
+
};
|
|
164
|
+
const actionProviderWithCustomAgentTarget = {
|
|
165
|
+
getActions: () => {
|
|
166
|
+
const modes = chatModeService.getModes();
|
|
167
|
+
const currentMode = delegate.currentMode.get();
|
|
168
|
+
const filteredCustomModes = modes.custom.filter(mode => {
|
|
169
|
+
const target = mode.target?.get();
|
|
170
|
+
return isUserDefinedCustomAgent(mode) && (!target || target === customAgentTarget);
|
|
171
|
+
});
|
|
172
|
+
const checked = currentMode.id === ChatMode.Agent.id;
|
|
173
|
+
const defaultAction = {
|
|
174
|
+
...makeAction(ChatMode.Agent, ChatMode.Agent),
|
|
175
|
+
checked
|
|
176
|
+
};
|
|
177
|
+
const customActions = ( filteredCustomModes.map(mode => makeActionFromCustomMode(mode, currentMode)));
|
|
178
|
+
return [defaultAction, ...customActions];
|
|
179
|
+
}
|
|
180
|
+
};
|
|
69
181
|
const actionProvider = {
|
|
70
182
|
getActions: () => {
|
|
71
183
|
const modes = chatModeService.getModes();
|
|
72
184
|
const currentMode = delegate.currentMode.get();
|
|
73
185
|
const agentMode = modes.builtin.find(mode => mode.id === ChatMode.Agent.id);
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
186
|
+
const shouldHideEditMode = configurationService.getValue(ChatConfiguration.EditModeHidden) && chatAgentService.hasToolsAgent && currentMode.id !== ChatMode.Edit.id;
|
|
187
|
+
const otherBuiltinModes = modes.builtin.filter(
|
|
188
|
+
mode => mode.id !== ChatMode.Agent.id && !(shouldHideEditMode && mode.id === ChatMode.Edit.id)
|
|
189
|
+
);
|
|
190
|
+
const customModes = groupBy(
|
|
191
|
+
modes.custom,
|
|
192
|
+
mode => isModeConsideredBuiltIn(mode, this._productService) ? "builtin" : "custom"
|
|
193
|
+
);
|
|
77
194
|
const customBuiltinModeActions = customModes.builtin?.map(mode => {
|
|
78
195
|
const action = makeActionFromCustomMode(mode, currentMode);
|
|
79
196
|
action.category = agentModeDisabledViaPolicy ? policyDisabledCategory : builtInCategory;
|
|
80
197
|
return action;
|
|
81
198
|
}) ?? [];
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
]);
|
|
199
|
+
customBuiltinModeActions.sort((a, b) => a.label.localeCompare(b.label));
|
|
200
|
+
const customModeActions = customModes.custom?.map(mode => makeActionFromCustomMode(mode, currentMode)) ?? [];
|
|
201
|
+
customModeActions.sort((a, b) => a.label.localeCompare(b.label));
|
|
202
|
+
const orderedModes = coalesce([agentMode && makeAction(agentMode, currentMode), ...( otherBuiltinModes.map(mode => mode && makeAction(mode, currentMode))), ...customBuiltinModeActions, ...customModeActions]);
|
|
87
203
|
return orderedModes;
|
|
88
204
|
}
|
|
89
205
|
};
|
|
90
206
|
const modePickerActionWidgetOptions = {
|
|
91
|
-
actionProvider,
|
|
207
|
+
actionProvider: customAgentTarget ? actionProviderWithCustomAgentTarget : actionProvider,
|
|
92
208
|
actionBarActionProvider: {
|
|
93
209
|
getActions: () => this.getModePickerActionBarActions()
|
|
94
210
|
},
|
|
95
|
-
showItemKeybindings: true
|
|
211
|
+
showItemKeybindings: true,
|
|
212
|
+
reporter: {
|
|
213
|
+
name: "ChatModePicker",
|
|
214
|
+
includeOptions: true
|
|
215
|
+
}
|
|
96
216
|
};
|
|
97
|
-
super(
|
|
217
|
+
super(
|
|
218
|
+
action,
|
|
219
|
+
modePickerActionWidgetOptions,
|
|
220
|
+
pickerOptions,
|
|
221
|
+
actionWidgetService,
|
|
222
|
+
keybindingService,
|
|
223
|
+
contextKeyService,
|
|
224
|
+
telemetryService
|
|
225
|
+
);
|
|
98
226
|
this.delegate = delegate;
|
|
99
227
|
this.contextKeyService = contextKeyService;
|
|
100
228
|
this.menuService = menuService;
|
|
229
|
+
this._productService = _productService;
|
|
101
230
|
this._register(autorun(reader => {
|
|
102
231
|
this.delegate.currentMode.read(reader).label.read(reader);
|
|
103
232
|
if (this.element) {
|
|
@@ -107,31 +236,50 @@ let ModePickerActionItem = class ModePickerActionItem extends ActionWidgetDropdo
|
|
|
107
236
|
}
|
|
108
237
|
getModePickerActionBarActions() {
|
|
109
238
|
const menuActions = this.menuService.createMenu(MenuId.ChatModePicker, this.contextKeyService);
|
|
110
|
-
const menuContributions = getFlatActionBarActions(menuActions.getActions({
|
|
239
|
+
const menuContributions = getFlatActionBarActions(menuActions.getActions({
|
|
240
|
+
renderShortTitle: true
|
|
241
|
+
}));
|
|
111
242
|
menuActions.dispose();
|
|
112
243
|
return menuContributions;
|
|
113
244
|
}
|
|
114
245
|
renderLabel(element) {
|
|
115
246
|
this.setAriaLabelAttributes(element);
|
|
116
|
-
const
|
|
117
|
-
|
|
247
|
+
const currentMode = this.delegate.currentMode.get();
|
|
248
|
+
const isDefault = currentMode.id === ChatMode.Agent.id;
|
|
249
|
+
const state = currentMode.label.get();
|
|
250
|
+
let icon = currentMode.icon.get();
|
|
251
|
+
if (!icon && isModeConsideredBuiltIn(currentMode, this._productService)) {
|
|
252
|
+
icon = builtinDefaultIcon;
|
|
253
|
+
}
|
|
254
|
+
const labelElements = [];
|
|
255
|
+
if (icon) {
|
|
256
|
+
labelElements.push(...renderLabelWithIcons(`$(${icon.id})`));
|
|
257
|
+
}
|
|
258
|
+
if (!isDefault || !icon || !this.pickerOptions.onlyShowIconsForDefaultActions.get()) {
|
|
259
|
+
labelElements.push($("span.chat-input-picker-label", undefined, state));
|
|
260
|
+
}
|
|
261
|
+
labelElements.push(...renderLabelWithIcons(`$(chevron-down)`));
|
|
262
|
+
reset(element, ...labelElements);
|
|
118
263
|
return null;
|
|
119
264
|
}
|
|
120
|
-
render(container) {
|
|
121
|
-
super.render(container);
|
|
122
|
-
container.classList.add('chat-modelPicker-item');
|
|
123
|
-
}
|
|
124
265
|
};
|
|
125
|
-
ModePickerActionItem = ( __decorate([
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
266
|
+
ModePickerActionItem = ( __decorate([( __param(3, IActionWidgetService)), ( __param(4, IChatAgentService)), ( __param(5, IKeybindingService)), ( __param(6, IConfigurationService)), ( __param(7, IContextKeyService)), ( __param(8, IChatModeService)), ( __param(9, IMenuService)), ( __param(10, ICommandService)), ( __param(11, IProductService)), ( __param(12, ITelemetryService)), ( __param(13, IOpenerService))], ModePickerActionItem));
|
|
267
|
+
function isModeConsideredBuiltIn(mode, productService) {
|
|
268
|
+
if (mode.isBuiltin) {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
if (mode.source?.storage !== PromptsStorage.extension) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
const chatExtensionId = productService.defaultChatAgent?.chatExtensionId;
|
|
275
|
+
if (!chatExtensionId || mode.source.extensionId.value !== chatExtensionId) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
const modeUri = mode.uri?.get();
|
|
279
|
+
if (!modeUri) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
return !isOrganizationPromptFile(modeUri, mode.source.extensionId, productService);
|
|
283
|
+
}
|
|
136
284
|
|
|
137
285
|
export { ModePickerActionItem };
|
package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
+
import { IManagedHoverContent } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hover";
|
|
1
2
|
import { IAction } from "@codingame/monaco-vscode-api/vscode/vs/base/common/actions";
|
|
2
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
-
import { ILanguageModelChatMetadataAndIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels";
|
|
4
3
|
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
5
|
-
import {
|
|
4
|
+
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
6
5
|
import { IActionWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service";
|
|
7
6
|
import { IActionWidgetDropdownOptions } from "../../../../../../platform/actionWidget/browser/actionWidgetDropdown.js";
|
|
8
|
-
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
9
7
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
10
|
-
import {
|
|
8
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
11
9
|
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
12
|
-
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
13
10
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
14
|
-
import {
|
|
11
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
12
|
+
import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
|
|
13
|
+
import { ILanguageModelChatMetadataAndIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels";
|
|
14
|
+
import { ChatInputPickerActionViewItem, IChatInputPickerOptions } from "./chatInputPickerActionItem.js";
|
|
15
15
|
export interface IModelPickerDelegate {
|
|
16
|
-
readonly
|
|
17
|
-
getCurrentModel(): ILanguageModelChatMetadataAndIdentifier | undefined;
|
|
16
|
+
readonly currentModel: IObservable<ILanguageModelChatMetadataAndIdentifier | undefined>;
|
|
18
17
|
setModel(model: ILanguageModelChatMetadataAndIdentifier): void;
|
|
19
18
|
getModels(): ILanguageModelChatMetadataAndIdentifier[];
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* Action view item for selecting a language model in the chat interface.
|
|
23
22
|
*/
|
|
24
|
-
export declare class ModelPickerActionItem extends
|
|
23
|
+
export declare class ModelPickerActionItem extends ChatInputPickerActionViewItem {
|
|
25
24
|
protected currentModel: ILanguageModelChatMetadataAndIdentifier | undefined;
|
|
26
|
-
constructor(action: IAction,
|
|
25
|
+
constructor(action: IAction, widgetOptions: Omit<IActionWidgetDropdownOptions, "label" | "labelRenderer"> | undefined, delegate: IModelPickerDelegate, pickerOptions: IChatInputPickerOptions, actionWidgetService: IActionWidgetService, contextKeyService: IContextKeyService, commandService: ICommandService, chatEntitlementService: IChatEntitlementService, keybindingService: IKeybindingService, telemetryService: ITelemetryService, productService: IProductService);
|
|
27
26
|
protected getHoverContents(): IManagedHoverContent | undefined;
|
|
27
|
+
protected setAriaLabelAttributes(element: HTMLElement): void;
|
|
28
28
|
protected renderLabel(element: HTMLElement): IDisposable | null;
|
|
29
|
-
render(container: HTMLElement): void;
|
|
30
29
|
}
|
|
@@ -1,53 +1,68 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
3
|
import { $, reset } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
4
|
import { renderIcon, renderLabelWithIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
|
-
import
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
6
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
7
|
import { IActionWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service';
|
|
8
|
-
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
9
8
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
10
|
-
import {
|
|
11
|
-
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
9
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
12
10
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
13
|
-
import { DEFAULT_MODEL_PICKER_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget';
|
|
14
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
15
11
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
16
|
-
import {
|
|
12
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
13
|
import { TelemetryTrustedValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
14
|
+
import { ChatEntitlement } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService';
|
|
15
|
+
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
16
|
+
import { MANAGE_CHAT_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
17
|
+
import { DEFAULT_MODEL_PICKER_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget';
|
|
18
|
+
import { ChatInputPickerActionViewItem } from './chatInputPickerActionItem.js';
|
|
19
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
18
20
|
|
|
19
|
-
function modelDelegateToWidgetActionsProvider(delegate, telemetryService) {
|
|
21
|
+
function modelDelegateToWidgetActionsProvider(delegate, telemetryService, pickerOptions) {
|
|
20
22
|
return {
|
|
21
23
|
getActions: () => {
|
|
22
24
|
const models = delegate.getModels();
|
|
23
25
|
if (models.length === 0) {
|
|
24
26
|
return [{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
id: "auto",
|
|
28
|
+
enabled: true,
|
|
29
|
+
checked: true,
|
|
30
|
+
category: DEFAULT_MODEL_PICKER_CATEGORY,
|
|
31
|
+
class: undefined,
|
|
32
|
+
description: ( localize(6112, "Best for your request based on capacity and performance.")),
|
|
33
|
+
tooltip: ( localize(6113, "Auto")),
|
|
34
|
+
label: ( localize(6113, "Auto")),
|
|
35
|
+
hover: {
|
|
36
|
+
content: ( localize(
|
|
37
|
+
6114,
|
|
38
|
+
"Automatically selects the best model for your task based on context and complexity."
|
|
39
|
+
)),
|
|
40
|
+
position: pickerOptions.hoverPosition
|
|
41
|
+
},
|
|
42
|
+
run: () => {}
|
|
43
|
+
}];
|
|
34
44
|
}
|
|
35
45
|
return ( models.map(model => {
|
|
46
|
+
const hoverContent = model.metadata.tooltip;
|
|
36
47
|
return {
|
|
37
48
|
id: model.metadata.id,
|
|
38
49
|
enabled: true,
|
|
39
50
|
icon: model.metadata.statusIcon,
|
|
40
|
-
checked: model.identifier === delegate.
|
|
51
|
+
checked: model.identifier === delegate.currentModel.get()?.identifier,
|
|
41
52
|
category: model.metadata.modelPickerCategory || DEFAULT_MODEL_PICKER_CATEGORY,
|
|
42
53
|
class: undefined,
|
|
43
|
-
description: model.metadata.detail,
|
|
44
|
-
tooltip:
|
|
54
|
+
description: model.metadata.multiplier ?? model.metadata.detail,
|
|
55
|
+
tooltip: hoverContent ? "" : model.metadata.name,
|
|
56
|
+
hover: hoverContent ? {
|
|
57
|
+
content: hoverContent,
|
|
58
|
+
position: pickerOptions.hoverPosition
|
|
59
|
+
} : undefined,
|
|
45
60
|
label: model.metadata.name,
|
|
46
61
|
run: () => {
|
|
47
|
-
const previousModel = delegate.
|
|
48
|
-
telemetryService.publicLog2(
|
|
49
|
-
fromModel: previousModel?.metadata.vendor ===
|
|
50
|
-
toModel: model.metadata.vendor ===
|
|
62
|
+
const previousModel = delegate.currentModel.get();
|
|
63
|
+
telemetryService.publicLog2("chat.modelChange", {
|
|
64
|
+
fromModel: previousModel?.metadata.vendor === "copilot" ? ( new TelemetryTrustedValue(previousModel.identifier)) : "unknown",
|
|
65
|
+
toModel: model.metadata.vendor === "copilot" ? ( new TelemetryTrustedValue(model.identifier)) : "unknown"
|
|
51
66
|
});
|
|
52
67
|
delegate.setModel(model);
|
|
53
68
|
}
|
|
@@ -60,34 +75,28 @@ function getModelPickerActionBarActionProvider(commandService, chatEntitlementSe
|
|
|
60
75
|
const actionProvider = {
|
|
61
76
|
getActions: () => {
|
|
62
77
|
const additionalActions = [];
|
|
63
|
-
if (chatEntitlementService.entitlement === ChatEntitlement.Free ||
|
|
64
|
-
chatEntitlementService.entitlement === ChatEntitlement.Pro ||
|
|
65
|
-
chatEntitlementService.entitlement === ChatEntitlement.ProPlus ||
|
|
66
|
-
chatEntitlementService.isInternal) {
|
|
78
|
+
if (chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal) {
|
|
67
79
|
additionalActions.push({
|
|
68
|
-
id:
|
|
69
|
-
label: ( localize(
|
|
80
|
+
id: "manageModels",
|
|
81
|
+
label: ( localize(6115, "Manage Models...")),
|
|
70
82
|
enabled: true,
|
|
71
|
-
tooltip: ( localize(
|
|
83
|
+
tooltip: ( localize(6116, "Manage Language Models")),
|
|
72
84
|
class: undefined,
|
|
73
85
|
run: () => {
|
|
74
86
|
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
75
87
|
}
|
|
76
88
|
});
|
|
77
89
|
}
|
|
78
|
-
const isNewOrAnonymousUser = !chatEntitlementService.sentiment.installed ||
|
|
79
|
-
chatEntitlementService.entitlement === ChatEntitlement.Available ||
|
|
80
|
-
chatEntitlementService.anonymous ||
|
|
81
|
-
chatEntitlementService.entitlement === ChatEntitlement.Unknown;
|
|
90
|
+
const isNewOrAnonymousUser = !chatEntitlementService.sentiment.installed || chatEntitlementService.entitlement === ChatEntitlement.Available || chatEntitlementService.anonymous || chatEntitlementService.entitlement === ChatEntitlement.Unknown;
|
|
82
91
|
if (isNewOrAnonymousUser || chatEntitlementService.entitlement === ChatEntitlement.Free) {
|
|
83
92
|
additionalActions.push({
|
|
84
|
-
id:
|
|
85
|
-
label: isNewOrAnonymousUser ? ( localize(
|
|
93
|
+
id: "moreModels",
|
|
94
|
+
label: isNewOrAnonymousUser ? ( localize(6117, "Add Language Models")) : ( localize(6118, "Add Premium Models")),
|
|
86
95
|
enabled: true,
|
|
87
|
-
tooltip: isNewOrAnonymousUser ? ( localize(
|
|
96
|
+
tooltip: isNewOrAnonymousUser ? ( localize(6119, "Add Language Models")) : ( localize(6120, "Add Premium Models")),
|
|
88
97
|
class: undefined,
|
|
89
98
|
run: () => {
|
|
90
|
-
const commandId = isNewOrAnonymousUser ?
|
|
99
|
+
const commandId = isNewOrAnonymousUser ? "workbench.action.chat.triggerSetup" : "workbench.action.chat.upgradePlan";
|
|
91
100
|
commandService.executeCommand(commandId);
|
|
92
101
|
}
|
|
93
102
|
});
|
|
@@ -97,20 +106,45 @@ function getModelPickerActionBarActionProvider(commandService, chatEntitlementSe
|
|
|
97
106
|
};
|
|
98
107
|
return actionProvider;
|
|
99
108
|
}
|
|
100
|
-
let ModelPickerActionItem = class ModelPickerActionItem extends
|
|
101
|
-
constructor(
|
|
109
|
+
let ModelPickerActionItem = class ModelPickerActionItem extends ChatInputPickerActionViewItem {
|
|
110
|
+
constructor(
|
|
111
|
+
action,
|
|
112
|
+
widgetOptions,
|
|
113
|
+
delegate,
|
|
114
|
+
pickerOptions,
|
|
115
|
+
actionWidgetService,
|
|
116
|
+
contextKeyService,
|
|
117
|
+
commandService,
|
|
118
|
+
chatEntitlementService,
|
|
119
|
+
keybindingService,
|
|
120
|
+
telemetryService,
|
|
121
|
+
productService
|
|
122
|
+
) {
|
|
102
123
|
const actionWithLabel = {
|
|
103
124
|
...action,
|
|
104
|
-
label: currentModel?.metadata.name ?? ( localize(
|
|
105
|
-
run: () => {
|
|
125
|
+
label: delegate.currentModel.get()?.metadata.name ?? ( localize(6113, "Auto")),
|
|
126
|
+
run: () => {}
|
|
106
127
|
};
|
|
107
128
|
const modelPickerActionWidgetOptions = {
|
|
108
|
-
actionProvider: modelDelegateToWidgetActionsProvider(delegate, telemetryService),
|
|
109
|
-
actionBarActionProvider: getModelPickerActionBarActionProvider(commandService, chatEntitlementService)
|
|
129
|
+
actionProvider: modelDelegateToWidgetActionsProvider(delegate, telemetryService, pickerOptions),
|
|
130
|
+
actionBarActionProvider: getModelPickerActionBarActionProvider(commandService, chatEntitlementService),
|
|
131
|
+
reporter: {
|
|
132
|
+
name: "ChatModelPicker",
|
|
133
|
+
includeOptions: true
|
|
134
|
+
}
|
|
110
135
|
};
|
|
111
|
-
super(
|
|
112
|
-
|
|
113
|
-
|
|
136
|
+
super(
|
|
137
|
+
actionWithLabel,
|
|
138
|
+
widgetOptions ?? modelPickerActionWidgetOptions,
|
|
139
|
+
pickerOptions,
|
|
140
|
+
actionWidgetService,
|
|
141
|
+
keybindingService,
|
|
142
|
+
contextKeyService,
|
|
143
|
+
telemetryService
|
|
144
|
+
);
|
|
145
|
+
this.currentModel = delegate.currentModel.get();
|
|
146
|
+
this._register(autorun(t => {
|
|
147
|
+
const model = delegate.currentModel.read(t);
|
|
114
148
|
this.currentModel = model;
|
|
115
149
|
this.updateTooltip();
|
|
116
150
|
if (this.element) {
|
|
@@ -119,36 +153,35 @@ let ModelPickerActionItem = class ModelPickerActionItem extends ActionWidgetDrop
|
|
|
119
153
|
}));
|
|
120
154
|
}
|
|
121
155
|
getHoverContents() {
|
|
122
|
-
const label = `${( localize(
|
|
123
|
-
const {
|
|
156
|
+
const label = `${( localize(6121, "Pick Model"))}${super.getHoverContents()}`;
|
|
157
|
+
const {
|
|
158
|
+
statusIcon,
|
|
159
|
+
tooltip
|
|
160
|
+
} = this.currentModel?.metadata || {};
|
|
124
161
|
return statusIcon && tooltip ? `${label} • ${tooltip}` : label;
|
|
125
162
|
}
|
|
163
|
+
setAriaLabelAttributes(element) {
|
|
164
|
+
super.setAriaLabelAttributes(element);
|
|
165
|
+
const modelName = this.currentModel?.metadata.name ?? ( localize(6113, "Auto"));
|
|
166
|
+
element.ariaLabel = ( localize(6122, "Pick Model, {0}", modelName));
|
|
167
|
+
}
|
|
126
168
|
renderLabel(element) {
|
|
127
|
-
const {
|
|
169
|
+
const {
|
|
170
|
+
name,
|
|
171
|
+
statusIcon
|
|
172
|
+
} = this.currentModel?.metadata || {};
|
|
128
173
|
const domChildren = [];
|
|
129
174
|
if (statusIcon) {
|
|
130
175
|
const iconElement = renderIcon(statusIcon);
|
|
131
176
|
domChildren.push(iconElement);
|
|
132
177
|
}
|
|
133
|
-
domChildren.push($(
|
|
178
|
+
domChildren.push($("span.chat-input-picker-label", undefined, name ?? ( localize(6113, "Auto"))));
|
|
134
179
|
domChildren.push(...renderLabelWithIcons(`$(chevron-down)`));
|
|
135
180
|
reset(element, ...domChildren);
|
|
136
181
|
this.setAriaLabelAttributes(element);
|
|
137
182
|
return null;
|
|
138
183
|
}
|
|
139
|
-
render(container) {
|
|
140
|
-
super.render(container);
|
|
141
|
-
container.classList.add('chat-modelPicker-item');
|
|
142
|
-
}
|
|
143
184
|
};
|
|
144
|
-
ModelPickerActionItem = ( __decorate([
|
|
145
|
-
( __param(4, IActionWidgetService)),
|
|
146
|
-
( __param(5, IContextKeyService)),
|
|
147
|
-
( __param(6, ICommandService)),
|
|
148
|
-
( __param(7, IChatEntitlementService)),
|
|
149
|
-
( __param(8, IKeybindingService)),
|
|
150
|
-
( __param(9, ITelemetryService)),
|
|
151
|
-
( __param(10, IProductService))
|
|
152
|
-
], ModelPickerActionItem));
|
|
185
|
+
ModelPickerActionItem = ( __decorate([( __param(4, IActionWidgetService)), ( __param(5, IContextKeyService)), ( __param(6, ICommandService)), ( __param(7, IChatEntitlementService)), ( __param(8, IKeybindingService)), ( __param(9, ITelemetryService)), ( __param(10, IProductService))], ModelPickerActionItem));
|
|
153
186
|
|
|
154
187
|
export { ModelPickerActionItem };
|