@codingame/monaco-vscode-katex-common 31.0.0 → 32.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 +15 -3
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +6 -5
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +5 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +45 -14
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +51 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +45 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +46 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +155 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +37 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +14 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +51 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +56 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +68 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +653 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +28 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +91 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +53 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +42 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +93 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +169 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +60 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +13 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +125 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +29 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +119 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +132 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +156 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +133 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +53 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +288 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +23 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +699 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +12 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatPhoneInputPresenter.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +9 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +89 -108
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +521 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +19 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +44 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +3 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.d.ts → inlineChatAffordanceWidget.d.ts} +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.js → inlineChatAffordanceWidget.js} +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +19 -400
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +5 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +47 -133
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +103 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +3 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -92
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +99 -32
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +76 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +89 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +11 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +7 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +11 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +59 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +24 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +111 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +60 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +455 -171
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +49 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +302 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +34 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +233 -48
- package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +0 -16
- package/vscode/src/vs/platform/actions/browser/actionbar.js +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -539
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -386
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +0 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +0 -509
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +0 -276
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +0 -93
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +0 -617
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +0 -231
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { append, $, addDisposableListener, EventType,
|
|
3
|
+
import { append, $, addDisposableGenericMouseDownListener, EventHelper, addDisposableListener, EventType, getActiveElement, isHTMLElement, isHTMLInputElement, reset } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
5
|
-
import {
|
|
5
|
+
import { renderMarkdown } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
6
|
+
import { renderIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
7
|
+
import { getBaseLayerHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegate2';
|
|
8
|
+
import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
9
|
+
import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
6
10
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
7
11
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
12
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
9
13
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
10
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
14
|
+
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
15
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
12
16
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
13
17
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -44,20 +48,20 @@ function getUpdateHoverContent(updateState) {
|
|
|
44
48
|
switch (updateState) {
|
|
45
49
|
case StateType.AvailableForDownload:
|
|
46
50
|
hoverContent.appendMarkdown(( localize(
|
|
47
|
-
|
|
51
|
+
7457,
|
|
48
52
|
"This model requires a newer version of VS Code. [Download Update](command:update.downloadUpdate) to access it."
|
|
49
53
|
)));
|
|
50
54
|
break;
|
|
51
55
|
case StateType.Downloaded:
|
|
52
56
|
case StateType.Ready:
|
|
53
57
|
hoverContent.appendMarkdown(( localize(
|
|
54
|
-
|
|
58
|
+
7458,
|
|
55
59
|
"This model requires a newer version of VS Code. [Restart to Update](command:update.restartToUpdate) to access it."
|
|
56
60
|
)));
|
|
57
61
|
break;
|
|
58
62
|
default:
|
|
59
63
|
hoverContent.appendMarkdown(( localize(
|
|
60
|
-
|
|
64
|
+
7459,
|
|
61
65
|
"This model requires a newer version of VS Code. [Update VS Code](command:update.checkForUpdate) to access it."
|
|
62
66
|
)));
|
|
63
67
|
break;
|
|
@@ -67,24 +71,111 @@ function getUpdateHoverContent(updateState) {
|
|
|
67
71
|
const ModelPickerSection = {
|
|
68
72
|
Other: "other"
|
|
69
73
|
};
|
|
70
|
-
function
|
|
74
|
+
function getVendorDisplayName(languageModelsService, vendor) {
|
|
75
|
+
const descriptor = languageModelsService.getVendors().find(v => v.vendor === vendor);
|
|
76
|
+
if (descriptor?.displayName) {
|
|
77
|
+
return descriptor.displayName;
|
|
78
|
+
}
|
|
79
|
+
return vendor.charAt(0).toUpperCase() + vendor.slice(1);
|
|
80
|
+
}
|
|
81
|
+
function getProviderGroupKey(vendor, groupName) {
|
|
82
|
+
return `${vendor}\u0000${groupName}`;
|
|
83
|
+
}
|
|
84
|
+
function buildModelToProviderGroupMap(languageModelsService) {
|
|
85
|
+
const map = ( new Map());
|
|
86
|
+
for (const vendor of languageModelsService.getVendors()) {
|
|
87
|
+
const groups = languageModelsService.getLanguageModelGroups(vendor.vendor);
|
|
88
|
+
for (const group of groups) {
|
|
89
|
+
const groupName = group.group?.name ?? vendor.displayName;
|
|
90
|
+
for (const identifier of group.modelIdentifiers) {
|
|
91
|
+
map.set(identifier, {
|
|
92
|
+
vendor: vendor.vendor,
|
|
93
|
+
groupName
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return map;
|
|
99
|
+
}
|
|
100
|
+
function getProviderGroupForModel(model, modelToGroup, languageModelsService) {
|
|
101
|
+
const info = modelToGroup.get(model.identifier);
|
|
102
|
+
if (info) {
|
|
103
|
+
return info;
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
vendor: model.metadata.vendor,
|
|
107
|
+
groupName: getVendorDisplayName(languageModelsService, model.metadata.vendor)
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function isMultiplierPricing(model) {
|
|
111
|
+
return model.metadata.multiplierNumeric !== undefined;
|
|
112
|
+
}
|
|
113
|
+
function createModelItem(action, model, descriptionOverride, openerService, vendorLabel, isUBB) {
|
|
114
|
+
const hover = model && openerService ? getModelHoverContent(model, openerService, isUBB) : undefined;
|
|
71
115
|
return {
|
|
72
116
|
item: action,
|
|
73
117
|
kind: ActionListItemKind.Action,
|
|
74
118
|
label: action.label,
|
|
75
|
-
description: action.description,
|
|
119
|
+
description: descriptionOverride ?? action.description,
|
|
76
120
|
group: {
|
|
77
121
|
title: "",
|
|
78
122
|
icon: action.icon ?? ThemeIcon.fromId(action.checked ? Codicon.check.id : Codicon.blank.id)
|
|
79
123
|
},
|
|
80
124
|
hideIcon: false,
|
|
81
125
|
section: action.section,
|
|
82
|
-
|
|
83
|
-
|
|
126
|
+
className: vendorLabel ? "chat-model-picker-inline-source" : undefined,
|
|
127
|
+
badge: vendorLabel,
|
|
128
|
+
hover: hover ? {
|
|
129
|
+
content: hover.element,
|
|
130
|
+
disposable: hover.disposable
|
|
84
131
|
} : undefined,
|
|
85
|
-
|
|
132
|
+
tooltip: action.tooltip,
|
|
133
|
+
submenuActions: action.toolbarActions?.length ? action.toolbarActions : undefined
|
|
86
134
|
};
|
|
87
135
|
}
|
|
136
|
+
function resolveConfigProperty(model, group, languageModelsService) {
|
|
137
|
+
const schema = model.metadata.configurationSchema;
|
|
138
|
+
if (!schema?.properties) {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
const currentConfig = languageModelsService.getModelConfiguration(model.identifier) ?? {};
|
|
142
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
143
|
+
if (propSchema.group !== group) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (!propSchema.enum || propSchema.enum.length < 2) {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const value = currentConfig[key] ?? propSchema.default;
|
|
150
|
+
return {
|
|
151
|
+
key,
|
|
152
|
+
value,
|
|
153
|
+
schema: propSchema
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
function getPriceCategoryIndicator(priceCategory) {
|
|
159
|
+
let filled;
|
|
160
|
+
switch (priceCategory) {
|
|
161
|
+
case "low":
|
|
162
|
+
filled = 1;
|
|
163
|
+
break;
|
|
164
|
+
case "medium":
|
|
165
|
+
filled = 2;
|
|
166
|
+
break;
|
|
167
|
+
case "high":
|
|
168
|
+
filled = 3;
|
|
169
|
+
break;
|
|
170
|
+
case "very_high":
|
|
171
|
+
filled = 4;
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
const total = 4;
|
|
177
|
+
return "$(circle-filled)".repeat(filled) + "$(circle)".repeat(total - filled);
|
|
178
|
+
}
|
|
88
179
|
function getModelConfigurationDescription(model, languageModelsService) {
|
|
89
180
|
const schema = model.metadata.configurationSchema;
|
|
90
181
|
if (!schema?.properties) {
|
|
@@ -103,34 +194,60 @@ function getModelConfigurationDescription(model, languageModelsService) {
|
|
|
103
194
|
if (value === undefined) {
|
|
104
195
|
continue;
|
|
105
196
|
}
|
|
106
|
-
const enumItemLabels = propSchema.enumItemLabels;
|
|
107
197
|
const enumIndex = propSchema.enum?.indexOf(value) ?? -1;
|
|
108
|
-
const label = enumItemLabels?.[enumIndex] ?? String(value);
|
|
198
|
+
const label = propSchema.enumItemLabels?.[enumIndex] ?? String(value);
|
|
109
199
|
parts.push(label);
|
|
110
200
|
}
|
|
111
201
|
return parts.length > 0 ? parts.join(", ") : undefined;
|
|
112
202
|
}
|
|
113
|
-
function createModelAction(
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
203
|
+
function createModelAction(
|
|
204
|
+
model,
|
|
205
|
+
selectedModelId,
|
|
206
|
+
onSelect,
|
|
207
|
+
languageModelsService,
|
|
208
|
+
section,
|
|
209
|
+
suppressVendorInDetail,
|
|
210
|
+
isUBB
|
|
211
|
+
) {
|
|
212
|
+
const pricingForDescription = isMultiplierPricing(model) ? model.metadata.pricing : undefined;
|
|
213
|
+
const priceCategoryIndicator = isUBB ? getPriceCategoryIndicator(model.metadata.priceCategory) : undefined;
|
|
214
|
+
const configDescription = !isUBB ? getModelConfigurationDescription(model, languageModelsService) : undefined;
|
|
215
|
+
const detail = suppressVendorInDetail ? undefined : model.metadata.detail;
|
|
216
|
+
const textParts = [configDescription, detail, pricingForDescription].filter(Boolean);
|
|
217
|
+
const textDescription = textParts.length > 0 ? textParts.join(" · ") : undefined;
|
|
218
|
+
let descriptionOverride;
|
|
219
|
+
if (priceCategoryIndicator) {
|
|
220
|
+
const md = ( new MarkdownString("", {
|
|
221
|
+
isTrusted: false,
|
|
222
|
+
supportThemeIcons: true
|
|
223
|
+
}));
|
|
224
|
+
if (textDescription) {
|
|
225
|
+
md.appendText(textDescription + " · ");
|
|
226
|
+
}
|
|
227
|
+
md.appendMarkdown(priceCategoryIndicator);
|
|
228
|
+
descriptionOverride = md;
|
|
229
|
+
}
|
|
230
|
+
const toolbarActions = !isUBB ? languageModelsService.getModelConfigurationActions(model.identifier) : undefined;
|
|
231
|
+
const action = {
|
|
119
232
|
id: model.identifier,
|
|
120
233
|
enabled: true,
|
|
121
234
|
icon: model.metadata.statusIcon,
|
|
122
235
|
checked: model.identifier === selectedModelId,
|
|
123
236
|
class: undefined,
|
|
124
|
-
description,
|
|
237
|
+
description: priceCategoryIndicator ? undefined : textDescription,
|
|
125
238
|
tooltip: model.metadata.name,
|
|
126
239
|
label: model.metadata.name,
|
|
127
240
|
section,
|
|
128
241
|
toolbarActions: toolbarActions && toolbarActions.length > 0 ? toolbarActions : undefined,
|
|
129
242
|
run: () => onSelect(model)
|
|
130
243
|
};
|
|
244
|
+
return {
|
|
245
|
+
action,
|
|
246
|
+
descriptionOverride
|
|
247
|
+
};
|
|
131
248
|
}
|
|
132
249
|
function shouldShowManageModelsAction(chatEntitlementService) {
|
|
133
|
-
return chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.EDU || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal;
|
|
250
|
+
return chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.EDU || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Max || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal;
|
|
134
251
|
}
|
|
135
252
|
function createManageModelsAction(commandService) {
|
|
136
253
|
return {
|
|
@@ -138,8 +255,8 @@ function createManageModelsAction(commandService) {
|
|
|
138
255
|
enabled: true,
|
|
139
256
|
checked: false,
|
|
140
257
|
class: ThemeIcon.asClassName(Codicon.gear),
|
|
141
|
-
tooltip: ( localize(
|
|
142
|
-
label: ( localize(
|
|
258
|
+
tooltip: ( localize(7460, "Manage Language Models")),
|
|
259
|
+
label: ( localize(7461, "Manage Models...")),
|
|
143
260
|
run: () => {
|
|
144
261
|
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
145
262
|
}
|
|
@@ -159,7 +276,9 @@ function buildModelPickerItems(
|
|
|
159
276
|
chatEntitlementService,
|
|
160
277
|
showUnavailableFeatured,
|
|
161
278
|
showFeatured,
|
|
162
|
-
languageModelsService
|
|
279
|
+
languageModelsService,
|
|
280
|
+
openerService,
|
|
281
|
+
isUBB
|
|
163
282
|
) {
|
|
164
283
|
const items = [];
|
|
165
284
|
if (models.length === 0) {
|
|
@@ -168,13 +287,14 @@ function buildModelPickerItems(
|
|
|
168
287
|
enabled: true,
|
|
169
288
|
checked: true,
|
|
170
289
|
class: undefined,
|
|
171
|
-
tooltip: ( localize(
|
|
172
|
-
label: ( localize(
|
|
290
|
+
tooltip: ( localize(7462, "Auto")),
|
|
291
|
+
label: ( localize(7462, "Auto")),
|
|
173
292
|
run: () => {}
|
|
174
293
|
}));
|
|
175
294
|
}
|
|
176
295
|
if (useGroupedModelPicker) {
|
|
177
296
|
let otherModels = [];
|
|
297
|
+
const modelToGroup = languageModelsService ? buildModelToProviderGroupMap(languageModelsService) : ( new Map());
|
|
178
298
|
if (models.length) {
|
|
179
299
|
const allModelsMap = ( new Map());
|
|
180
300
|
const modelsByMetadataId = ( new Map());
|
|
@@ -200,13 +320,24 @@ function buildModelPickerItems(
|
|
|
200
320
|
}
|
|
201
321
|
return "admin";
|
|
202
322
|
};
|
|
203
|
-
const autoModel = models.find(m => m
|
|
323
|
+
const autoModel = models.find(m => isAutoModel(m));
|
|
204
324
|
if (autoModel) {
|
|
205
325
|
markPlaced(autoModel.identifier, autoModel.metadata.id);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
326
|
+
const {
|
|
327
|
+
action: autoAction,
|
|
328
|
+
descriptionOverride: autoDesc
|
|
329
|
+
} = createModelAction(
|
|
330
|
+
autoModel,
|
|
331
|
+
selectedModelId,
|
|
332
|
+
onSelect,
|
|
333
|
+
languageModelsService,
|
|
334
|
+
undefined,
|
|
335
|
+
undefined,
|
|
336
|
+
isUBB
|
|
337
|
+
);
|
|
338
|
+
items.push(
|
|
339
|
+
createModelItem(autoAction, autoModel, autoDesc, openerService, undefined, isUBB)
|
|
340
|
+
);
|
|
210
341
|
}
|
|
211
342
|
const promotedItems = [];
|
|
212
343
|
const tryPlaceModel = id => {
|
|
@@ -301,88 +432,155 @@ function buildModelPickerItems(
|
|
|
301
432
|
const bName = b.kind === "available" ? b.model.metadata.name : b.entry.label;
|
|
302
433
|
return aName.localeCompare(bName);
|
|
303
434
|
});
|
|
435
|
+
const allGroupKeys = ( new Set(( models.map(m => {
|
|
436
|
+
const info = getProviderGroupForModel(m, modelToGroup, languageModelsService);
|
|
437
|
+
return getProviderGroupKey(info.vendor, info.groupName);
|
|
438
|
+
}))));
|
|
439
|
+
const showPromotedGroupLabel = allGroupKeys.size > 1;
|
|
304
440
|
for (const item of promotedItems) {
|
|
305
441
|
if (item.kind === "available") {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
442
|
+
const groupLabel = showPromotedGroupLabel ? getProviderGroupForModel(item.model, modelToGroup, languageModelsService).groupName : undefined;
|
|
443
|
+
const {
|
|
444
|
+
action: promotedAction,
|
|
445
|
+
descriptionOverride: promotedDesc
|
|
446
|
+
} = createModelAction(
|
|
447
|
+
item.model,
|
|
448
|
+
selectedModelId,
|
|
449
|
+
onSelect,
|
|
450
|
+
languageModelsService,
|
|
451
|
+
undefined,
|
|
452
|
+
showPromotedGroupLabel,
|
|
453
|
+
isUBB
|
|
454
|
+
);
|
|
311
455
|
items.push(
|
|
312
|
-
|
|
456
|
+
createModelItem(promotedAction, item.model, promotedDesc, openerService, groupLabel, isUBB)
|
|
313
457
|
);
|
|
458
|
+
} else {
|
|
459
|
+
items.push(createUnavailableModelItem(
|
|
460
|
+
item.id,
|
|
461
|
+
item.entry,
|
|
462
|
+
item.reason,
|
|
463
|
+
manageSettingsUrl,
|
|
464
|
+
updateStateType,
|
|
465
|
+
chatEntitlementService
|
|
466
|
+
));
|
|
314
467
|
}
|
|
315
468
|
}
|
|
316
469
|
}
|
|
317
|
-
otherModels = models.filter(m => !( placed.has(m.identifier)) && !( placed.has(m.metadata.id)))
|
|
318
|
-
const aEntry = controlModels[a.metadata.id] ?? controlModels[a.identifier];
|
|
319
|
-
const bEntry = controlModels[b.metadata.id] ?? controlModels[b.identifier];
|
|
320
|
-
const aAvail = aEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, aEntry.minVSCodeVersion) ? 1 : 0;
|
|
321
|
-
const bAvail = bEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, bEntry.minVSCodeVersion) ? 1 : 0;
|
|
322
|
-
if (aAvail !== bAvail) {
|
|
323
|
-
return aAvail - bAvail;
|
|
324
|
-
}
|
|
325
|
-
const aCopilot = a.metadata.vendor === "copilot" ? 0 : 1;
|
|
326
|
-
const bCopilot = b.metadata.vendor === "copilot" ? 0 : 1;
|
|
327
|
-
if (aCopilot !== bCopilot) {
|
|
328
|
-
return aCopilot - bCopilot;
|
|
329
|
-
}
|
|
330
|
-
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
331
|
-
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
332
|
-
});
|
|
470
|
+
otherModels = models.filter(m => !( placed.has(m.identifier)) && !( placed.has(m.metadata.id)));
|
|
333
471
|
if (otherModels.length > 0) {
|
|
334
472
|
if (items.length > 0) {
|
|
335
473
|
items.push({
|
|
336
474
|
kind: ActionListItemKind.Separator
|
|
337
475
|
});
|
|
338
476
|
}
|
|
477
|
+
const otherModelsToolbar = manageModelsAction ? [toAction({
|
|
478
|
+
id: manageModelsAction.id,
|
|
479
|
+
label: manageModelsAction.tooltip ?? manageModelsAction.label,
|
|
480
|
+
class: ThemeIcon.asClassName(Codicon.gear),
|
|
481
|
+
run: () => manageModelsAction.run()
|
|
482
|
+
})] : undefined;
|
|
339
483
|
items.push({
|
|
340
484
|
item: {
|
|
341
485
|
id: "otherModels",
|
|
342
486
|
enabled: true,
|
|
343
487
|
checked: false,
|
|
344
488
|
class: undefined,
|
|
345
|
-
tooltip: ( localize(
|
|
346
|
-
label: ( localize(
|
|
489
|
+
tooltip: ( localize(7463, "Other Models")),
|
|
490
|
+
label: ( localize(7463, "Other Models")),
|
|
347
491
|
run: () => {}
|
|
348
492
|
},
|
|
349
493
|
kind: ActionListItemKind.Action,
|
|
350
|
-
label: ( localize(
|
|
494
|
+
label: ( localize(7463, "Other Models")),
|
|
351
495
|
group: {
|
|
352
496
|
title: "",
|
|
353
497
|
icon: Codicon.chevronDown
|
|
354
498
|
},
|
|
355
499
|
hideIcon: false,
|
|
356
500
|
section: ModelPickerSection.Other,
|
|
357
|
-
isSectionToggle: true
|
|
501
|
+
isSectionToggle: true,
|
|
502
|
+
toolbarActions: otherModelsToolbar,
|
|
503
|
+
className: "chat-model-picker-section-toggle"
|
|
358
504
|
});
|
|
505
|
+
const providerGroups = ( new Map());
|
|
359
506
|
for (const model of otherModels) {
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
)
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
507
|
+
const info = getProviderGroupForModel(model, modelToGroup, languageModelsService);
|
|
508
|
+
const key = getProviderGroupKey(info.vendor, info.groupName);
|
|
509
|
+
let bucket = providerGroups.get(key);
|
|
510
|
+
if (!bucket) {
|
|
511
|
+
bucket = {
|
|
512
|
+
vendor: info.vendor,
|
|
513
|
+
groupName: info.groupName,
|
|
514
|
+
models: []
|
|
515
|
+
};
|
|
516
|
+
providerGroups.set(key, bucket);
|
|
517
|
+
}
|
|
518
|
+
bucket.models.push(model);
|
|
519
|
+
}
|
|
520
|
+
const sortedBuckets = [...( providerGroups.values())].sort((a, b) => {
|
|
521
|
+
if (a.vendor === "copilot" && b.vendor !== "copilot") {
|
|
522
|
+
return -1;
|
|
523
|
+
}
|
|
524
|
+
if (b.vendor === "copilot" && a.vendor !== "copilot") {
|
|
525
|
+
return 1;
|
|
526
|
+
}
|
|
527
|
+
return a.groupName.localeCompare(b.groupName);
|
|
528
|
+
});
|
|
529
|
+
const showGroupHeaders = sortedBuckets.length > 1;
|
|
530
|
+
for (const bucket of sortedBuckets) {
|
|
531
|
+
if (showGroupHeaders) {
|
|
532
|
+
items.push({
|
|
533
|
+
kind: ActionListItemKind.Separator,
|
|
534
|
+
label: bucket.groupName,
|
|
535
|
+
section: ModelPickerSection.Other
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
const sortedBucketModels = [...bucket.models].sort((a, b) => {
|
|
539
|
+
const aEntry = controlModels[a.metadata.id] ?? controlModels[a.identifier];
|
|
540
|
+
const bEntry = controlModels[b.metadata.id] ?? controlModels[b.identifier];
|
|
541
|
+
const aAvail = aEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, aEntry.minVSCodeVersion) ? 1 : 0;
|
|
542
|
+
const bAvail = bEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, bEntry.minVSCodeVersion) ? 1 : 0;
|
|
543
|
+
if (aAvail !== bAvail) {
|
|
544
|
+
return aAvail - bAvail;
|
|
545
|
+
}
|
|
546
|
+
return a.metadata.name.localeCompare(b.metadata.name);
|
|
547
|
+
});
|
|
548
|
+
for (const model of sortedBucketModels) {
|
|
549
|
+
const entry = controlModels[model.metadata.id] ?? controlModels[model.identifier];
|
|
550
|
+
if (entry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
551
|
+
items.push(createUnavailableModelItem(
|
|
552
|
+
model.metadata.id,
|
|
553
|
+
entry,
|
|
554
|
+
"update",
|
|
555
|
+
manageSettingsUrl,
|
|
556
|
+
updateStateType,
|
|
557
|
+
chatEntitlementService,
|
|
558
|
+
ModelPickerSection.Other
|
|
559
|
+
));
|
|
560
|
+
} else {
|
|
561
|
+
const {
|
|
562
|
+
action: bucketAction,
|
|
563
|
+
descriptionOverride: bucketDesc
|
|
564
|
+
} = createModelAction(
|
|
565
|
+
model,
|
|
566
|
+
selectedModelId,
|
|
567
|
+
onSelect,
|
|
568
|
+
languageModelsService,
|
|
569
|
+
ModelPickerSection.Other,
|
|
570
|
+
showGroupHeaders,
|
|
571
|
+
isUBB
|
|
572
|
+
);
|
|
573
|
+
items.push(
|
|
574
|
+
createModelItem(bucketAction, model, bucketDesc, openerService, undefined, isUBB)
|
|
575
|
+
);
|
|
576
|
+
}
|
|
378
577
|
}
|
|
379
578
|
}
|
|
380
579
|
}
|
|
381
580
|
}
|
|
382
|
-
if (manageModelsAction) {
|
|
581
|
+
if (manageModelsAction && !otherModels.length) {
|
|
383
582
|
items.push({
|
|
384
|
-
kind: ActionListItemKind.Separator
|
|
385
|
-
section: otherModels.length ? ModelPickerSection.Other : undefined
|
|
583
|
+
kind: ActionListItemKind.Separator
|
|
386
584
|
});
|
|
387
585
|
items.push({
|
|
388
586
|
item: manageModelsAction,
|
|
@@ -393,33 +591,61 @@ function buildModelPickerItems(
|
|
|
393
591
|
icon: Codicon.blank
|
|
394
592
|
},
|
|
395
593
|
hideIcon: false,
|
|
396
|
-
section: otherModels.length ? ModelPickerSection.Other : undefined,
|
|
397
594
|
showAlways: true
|
|
398
595
|
});
|
|
399
596
|
}
|
|
400
597
|
} else {
|
|
401
|
-
const autoModel = models.find(m => m
|
|
598
|
+
const autoModel = models.find(m => isAutoModel(m));
|
|
402
599
|
if (autoModel) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
600
|
+
const {
|
|
601
|
+
action: flatAutoAction,
|
|
602
|
+
descriptionOverride: flatAutoDesc
|
|
603
|
+
} = createModelAction(
|
|
604
|
+
autoModel,
|
|
605
|
+
selectedModelId,
|
|
606
|
+
onSelect,
|
|
607
|
+
languageModelsService,
|
|
608
|
+
undefined,
|
|
609
|
+
undefined,
|
|
610
|
+
isUBB
|
|
611
|
+
);
|
|
612
|
+
items.push(
|
|
613
|
+
createModelItem(flatAutoAction, autoModel, flatAutoDesc, openerService, undefined, isUBB)
|
|
614
|
+
);
|
|
407
615
|
}
|
|
408
616
|
const sortedModels = models.filter(m => m !== autoModel).sort((a, b) => {
|
|
409
617
|
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
410
618
|
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
411
619
|
});
|
|
412
620
|
for (const model of sortedModels) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
621
|
+
const {
|
|
622
|
+
action: flatAction,
|
|
623
|
+
descriptionOverride: flatDesc
|
|
624
|
+
} = createModelAction(
|
|
625
|
+
model,
|
|
626
|
+
selectedModelId,
|
|
627
|
+
onSelect,
|
|
628
|
+
languageModelsService,
|
|
629
|
+
undefined,
|
|
630
|
+
undefined,
|
|
631
|
+
isUBB
|
|
632
|
+
);
|
|
633
|
+
items.push(
|
|
634
|
+
createModelItem(flatAction, model, flatDesc, openerService, undefined, isUBB)
|
|
635
|
+
);
|
|
417
636
|
}
|
|
418
637
|
}
|
|
419
638
|
return items;
|
|
420
639
|
}
|
|
421
640
|
function getModelPickerAccessibilityProvider() {
|
|
422
641
|
return {
|
|
642
|
+
getAriaLabel(element) {
|
|
643
|
+
if (element.kind !== ActionListItemKind.Action) {
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
const description = typeof element.description === "string" ? element.description : element.description?.value;
|
|
647
|
+
return [element.label, element.badge, description].filter(part => !!part).join(", ");
|
|
648
|
+
},
|
|
423
649
|
isChecked(element) {
|
|
424
650
|
if (element.isSectionToggle) {
|
|
425
651
|
return undefined;
|
|
@@ -442,18 +668,26 @@ function getModelPickerAccessibilityProvider() {
|
|
|
442
668
|
getWidgetRole: () => "menu"
|
|
443
669
|
};
|
|
444
670
|
}
|
|
445
|
-
function createUnavailableModelItem(
|
|
671
|
+
function createUnavailableModelItem(
|
|
672
|
+
id,
|
|
673
|
+
entry,
|
|
674
|
+
reason,
|
|
675
|
+
manageSettingsUrl,
|
|
676
|
+
updateStateType,
|
|
677
|
+
chatEntitlementService,
|
|
678
|
+
section
|
|
679
|
+
) {
|
|
446
680
|
let description;
|
|
447
681
|
if (reason === "upgrade") {
|
|
448
|
-
description = ( new MarkdownString(( localize(
|
|
682
|
+
description = ( new MarkdownString(( localize(7464, "[Upgrade](command:workbench.action.chat.upgradePlan \" \")")), {
|
|
449
683
|
isTrusted: true
|
|
450
684
|
}));
|
|
451
685
|
} else if (reason === "update") {
|
|
452
|
-
description = ( localize(
|
|
686
|
+
description = ( localize(7465, "Update VS Code"));
|
|
453
687
|
} else {
|
|
454
|
-
description = manageSettingsUrl ? ( new MarkdownString(( localize(
|
|
688
|
+
description = manageSettingsUrl ? ( new MarkdownString(( localize(7466, "[Contact your admin]({0})", manageSettingsUrl)), {
|
|
455
689
|
isTrusted: true
|
|
456
|
-
})) : ( localize(
|
|
690
|
+
})) : ( localize(7467, "Contact your admin"));
|
|
457
691
|
}
|
|
458
692
|
let hoverContent;
|
|
459
693
|
if (reason === "upgrade") {
|
|
@@ -461,10 +695,17 @@ function createUnavailableModelItem(id, entry, reason, manageSettingsUrl, update
|
|
|
461
695
|
isTrusted: true,
|
|
462
696
|
supportThemeIcons: true
|
|
463
697
|
}));
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
698
|
+
if (chatEntitlementService.entitlement === ChatEntitlement.Pro) {
|
|
699
|
+
hoverContent.appendMarkdown(( localize(
|
|
700
|
+
7468,
|
|
701
|
+
"[Upgrade to GitHub Copilot Pro+](command:workbench.action.chat.upgradePlan \" \") to use the best models."
|
|
702
|
+
)));
|
|
703
|
+
} else {
|
|
704
|
+
hoverContent.appendMarkdown(( localize(
|
|
705
|
+
7469,
|
|
706
|
+
"[Upgrade to GitHub Copilot Pro](command:workbench.action.chat.upgradePlan \" \") to use the best models."
|
|
707
|
+
)));
|
|
708
|
+
}
|
|
468
709
|
} else if (reason === "update") {
|
|
469
710
|
hoverContent = getUpdateHoverContent(updateStateType);
|
|
470
711
|
} else {
|
|
@@ -473,7 +714,7 @@ function createUnavailableModelItem(id, entry, reason, manageSettingsUrl, update
|
|
|
473
714
|
supportThemeIcons: true
|
|
474
715
|
}));
|
|
475
716
|
hoverContent.appendMarkdown(( localize(
|
|
476
|
-
|
|
717
|
+
7470,
|
|
477
718
|
"This model is not available. Contact your administrator to enable it."
|
|
478
719
|
)));
|
|
479
720
|
}
|
|
@@ -511,6 +752,9 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
511
752
|
get domNode() {
|
|
512
753
|
return this._domNode;
|
|
513
754
|
}
|
|
755
|
+
get nameButton() {
|
|
756
|
+
return this._nameButton;
|
|
757
|
+
}
|
|
514
758
|
constructor(
|
|
515
759
|
_delegate,
|
|
516
760
|
_actionWidgetService,
|
|
@@ -539,6 +783,14 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
539
783
|
this._register(this._languageModelsService.onDidChangeLanguageModels(() => {
|
|
540
784
|
this._renderLabel();
|
|
541
785
|
}));
|
|
786
|
+
let lastIsUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
787
|
+
this._register(this._entitlementService.onDidChangeQuotaRemaining(() => {
|
|
788
|
+
const currentIsUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
789
|
+
if (currentIsUBB !== lastIsUBB) {
|
|
790
|
+
lastIsUBB = currentIsUBB;
|
|
791
|
+
this._renderLabel();
|
|
792
|
+
}
|
|
793
|
+
}));
|
|
542
794
|
}
|
|
543
795
|
setHideChevrons(hideChevrons) {
|
|
544
796
|
this._hideChevrons = hideChevrons;
|
|
@@ -565,29 +817,54 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
565
817
|
this._updateBadge();
|
|
566
818
|
}
|
|
567
819
|
render(container) {
|
|
568
|
-
this._domNode = append(container, $("
|
|
569
|
-
this._domNode.
|
|
570
|
-
this._domNode.setAttribute("role", "button");
|
|
571
|
-
this._domNode.setAttribute("aria-haspopup", "true");
|
|
572
|
-
this._domNode.setAttribute("aria-expanded", "false");
|
|
820
|
+
this._domNode = append(container, $("div.action-label.model-picker-split"));
|
|
821
|
+
this._domNode.setAttribute("role", "group");
|
|
573
822
|
if (this._hideChevrons?.get()) {
|
|
574
823
|
this._domNode.classList.toggle("hide-chevrons", true);
|
|
575
824
|
}
|
|
576
|
-
this.
|
|
825
|
+
this._nameButton = append(this._domNode, $("a.model-picker-section.model-picker-name"));
|
|
826
|
+
this._nameButton.tabIndex = 0;
|
|
827
|
+
this._nameButton.setAttribute("role", "button");
|
|
828
|
+
this._nameButton.setAttribute("aria-haspopup", "true");
|
|
829
|
+
this._nameButton.setAttribute("aria-expanded", "false");
|
|
830
|
+
this._effortButton = append(this._domNode, $("a.model-picker-section.model-picker-effort"));
|
|
831
|
+
this._effortButton.tabIndex = 0;
|
|
832
|
+
this._effortButton.setAttribute("role", "button");
|
|
833
|
+
this._effortButton.setAttribute("aria-haspopup", "true");
|
|
834
|
+
this._effortButton.setAttribute("aria-expanded", "false");
|
|
835
|
+
this._effortButton.style.display = "none";
|
|
836
|
+
this._tokensButton = append(this._domNode, $("a.model-picker-section.model-picker-tokens"));
|
|
837
|
+
this._tokensButton.tabIndex = 0;
|
|
838
|
+
this._tokensButton.setAttribute("role", "button");
|
|
839
|
+
this._tokensButton.setAttribute("aria-haspopup", "true");
|
|
840
|
+
this._tokensButton.setAttribute("aria-expanded", "false");
|
|
841
|
+
this._tokensButton.style.display = "none";
|
|
842
|
+
this._badgeIcon = $("span.model-picker-badge");
|
|
577
843
|
this._updateBadge();
|
|
578
844
|
this._renderLabel();
|
|
579
|
-
this.
|
|
845
|
+
this._registerButtonAction(this._nameButton, () => this.show());
|
|
846
|
+
this._registerButtonAction(this._effortButton, () => this._showEffortPicker());
|
|
847
|
+
this._registerButtonAction(this._tokensButton, () => this._showTokensPicker());
|
|
848
|
+
this._register(
|
|
849
|
+
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._effortButton, ( localize(7471, "Set Thinking Effort")))
|
|
850
|
+
);
|
|
851
|
+
this._register(
|
|
852
|
+
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._tokensButton, ( localize(7472, "Set Context Size")))
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
_registerButtonAction(element, action) {
|
|
856
|
+
this._register(addDisposableGenericMouseDownListener(element, e => {
|
|
580
857
|
if (e.button !== 0) {
|
|
581
858
|
return;
|
|
582
859
|
}
|
|
583
860
|
EventHelper.stop(e, true);
|
|
584
|
-
|
|
861
|
+
action();
|
|
585
862
|
}));
|
|
586
|
-
this._register(addDisposableListener(
|
|
863
|
+
this._register(addDisposableListener(element, EventType.KEY_DOWN, e => {
|
|
587
864
|
const event = ( new StandardKeyboardEvent(e));
|
|
588
865
|
if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
|
|
589
866
|
EventHelper.stop(e, true);
|
|
590
|
-
|
|
867
|
+
action();
|
|
591
868
|
}
|
|
592
869
|
}));
|
|
593
870
|
}
|
|
@@ -607,8 +884,8 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
607
884
|
this._onDidChangeSelection.fire(model);
|
|
608
885
|
};
|
|
609
886
|
const models = this._delegate.getModels();
|
|
610
|
-
const showFilter = models.length >= 10;
|
|
611
887
|
const isPro = isProUser(this._entitlementService.entitlement);
|
|
888
|
+
const isUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
612
889
|
const manifest = this._languageModelsService.getModelsControlManifest();
|
|
613
890
|
const controlModelsForTier = isPro ? manifest.paid : manifest.free;
|
|
614
891
|
const canShowManageModelsAction = this._delegate.showManageModelsAction() && shouldShowManageModelsAction(this._entitlementService);
|
|
@@ -629,16 +906,20 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
629
906
|
onSelect,
|
|
630
907
|
manageSettingsUrl,
|
|
631
908
|
this._delegate.useGroupedModelPicker(),
|
|
632
|
-
|
|
909
|
+
isUBB ? manageModelsAction : undefined,
|
|
633
910
|
this._entitlementService,
|
|
634
911
|
this._delegate.showUnavailableFeatured(),
|
|
635
912
|
this._delegate.showFeatured(),
|
|
636
|
-
this._languageModelsService
|
|
913
|
+
this._languageModelsService,
|
|
914
|
+
this._openerService,
|
|
915
|
+
isUBB
|
|
637
916
|
);
|
|
917
|
+
const hasPriceCategories = ( models.some(m => !!m.metadata.priceCategory));
|
|
638
918
|
const listOptions = {
|
|
639
|
-
showFilter,
|
|
640
|
-
filterPlaceholder: ( localize(
|
|
641
|
-
filterActions:
|
|
919
|
+
showFilter: true,
|
|
920
|
+
filterPlaceholder: ( localize(7473, "Search models")),
|
|
921
|
+
filterActions: !isUBB && manageModelsAction ? [manageModelsAction] : undefined,
|
|
922
|
+
secondaryHeading: isUBB && hasPriceCategories ? ( localize(7474, "Cost")) : undefined,
|
|
642
923
|
focusFilterOnOpen: true,
|
|
643
924
|
collapsedByDefault: ( new Set([ModelPickerSection.Other])),
|
|
644
925
|
onDidToggleSection: (section, collapsed) => {
|
|
@@ -665,13 +946,13 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
665
946
|
action.run();
|
|
666
947
|
},
|
|
667
948
|
onHide: () => {
|
|
668
|
-
this.
|
|
949
|
+
this._nameButton?.setAttribute("aria-expanded", "false");
|
|
669
950
|
if (isHTMLElement(previouslyFocusedElement)) {
|
|
670
951
|
previouslyFocusedElement.focus();
|
|
671
952
|
}
|
|
672
953
|
}
|
|
673
954
|
};
|
|
674
|
-
this.
|
|
955
|
+
this._nameButton?.setAttribute("aria-expanded", "true");
|
|
675
956
|
this._actionWidgetService.show(
|
|
676
957
|
"ChatModelPicker",
|
|
677
958
|
false,
|
|
@@ -702,60 +983,333 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
702
983
|
}
|
|
703
984
|
}
|
|
704
985
|
_renderLabel() {
|
|
705
|
-
if (!this._domNode) {
|
|
986
|
+
if (!this._domNode || !this._nameButton) {
|
|
706
987
|
return;
|
|
707
988
|
}
|
|
708
989
|
const {
|
|
709
990
|
name,
|
|
710
991
|
statusIcon
|
|
711
992
|
} = this._selectedModel?.metadata || {};
|
|
712
|
-
const
|
|
993
|
+
const nameChildren = [];
|
|
713
994
|
if (statusIcon) {
|
|
714
|
-
|
|
715
|
-
domChildren.push(iconElement);
|
|
995
|
+
nameChildren.push(renderIcon(statusIcon));
|
|
716
996
|
}
|
|
717
|
-
const modelLabel = name ?? ( localize(
|
|
718
|
-
const
|
|
997
|
+
const modelLabel = name ?? ( localize(7462, "Auto"));
|
|
998
|
+
const isUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
999
|
+
const configDescription = !isUBB && this._selectedModel ? getModelConfigurationDescription(this._selectedModel, this._languageModelsService) : undefined;
|
|
719
1000
|
const fullLabel = configDescription ? `${modelLabel} · ${configDescription}` : modelLabel;
|
|
720
|
-
|
|
1001
|
+
nameChildren.push($("span.chat-input-picker-label", undefined, fullLabel));
|
|
721
1002
|
if (this._badgeIcon) {
|
|
722
|
-
|
|
1003
|
+
nameChildren.push(this._badgeIcon);
|
|
1004
|
+
}
|
|
1005
|
+
reset(this._nameButton, ...nameChildren);
|
|
1006
|
+
const effortConfig = isUBB ? this._getConfigProperty("navigation") : undefined;
|
|
1007
|
+
if (effortConfig && this._effortButton) {
|
|
1008
|
+
const enumIndex = effortConfig.schema.enum?.indexOf(effortConfig.value) ?? -1;
|
|
1009
|
+
const effortLabel = enumIndex >= 0 && effortConfig.schema.enumItemLabels?.[enumIndex] ? effortConfig.schema.enumItemLabels[enumIndex] : String(effortConfig.value);
|
|
1010
|
+
reset(
|
|
1011
|
+
this._effortButton,
|
|
1012
|
+
$("span.chat-input-picker-label", undefined, effortLabel)
|
|
1013
|
+
);
|
|
1014
|
+
this._effortButton.style.display = "";
|
|
1015
|
+
this._effortButton.ariaLabel = ( localize(7475, "Thinking Effort: {0}", effortLabel));
|
|
1016
|
+
} else if (this._effortButton) {
|
|
1017
|
+
this._effortButton.style.display = "none";
|
|
1018
|
+
}
|
|
1019
|
+
const tokensConfig = isUBB ? this._getConfigProperty("tokens") : undefined;
|
|
1020
|
+
if (tokensConfig && this._tokensButton) {
|
|
1021
|
+
const idx = tokensConfig.schema.enum?.indexOf(tokensConfig.value) ?? -1;
|
|
1022
|
+
const tokensLabel = idx >= 0 && tokensConfig.schema.enumItemLabels?.[idx] ? tokensConfig.schema.enumItemLabels[idx] : formatTokenCount(Number(tokensConfig.value));
|
|
1023
|
+
reset(
|
|
1024
|
+
this._tokensButton,
|
|
1025
|
+
$("span.chat-input-picker-label", undefined, tokensLabel)
|
|
1026
|
+
);
|
|
1027
|
+
this._tokensButton.style.display = "";
|
|
1028
|
+
this._tokensButton.ariaLabel = ( localize(7476, "Context Size: {0}", tokensLabel));
|
|
1029
|
+
} else if (this._tokensButton) {
|
|
1030
|
+
this._tokensButton.style.display = "none";
|
|
1031
|
+
}
|
|
1032
|
+
this._domNode.ariaLabel = ( localize(7477, "Pick Model, {0}", fullLabel));
|
|
1033
|
+
}
|
|
1034
|
+
_getConfigProperty(group) {
|
|
1035
|
+
if (!this._selectedModel) {
|
|
1036
|
+
return undefined;
|
|
723
1037
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
1038
|
+
return resolveConfigProperty(this._selectedModel, group, this._languageModelsService);
|
|
1039
|
+
}
|
|
1040
|
+
_showEffortPicker() {
|
|
1041
|
+
if (this._domNode?.classList.contains("disabled")) {
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
const config = this._getConfigProperty("navigation");
|
|
1045
|
+
if (!config || !this._effortButton || !this._selectedModel) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const modelIdentifier = this._selectedModel.identifier;
|
|
1049
|
+
const enumValues = config.schema.enum ?? [];
|
|
1050
|
+
const enumItemLabels = config.schema.enumItemLabels;
|
|
1051
|
+
const items = [{
|
|
1052
|
+
kind: ActionListItemKind.Header,
|
|
1053
|
+
label: ( localize(7478, "Thinking Effort"))
|
|
1054
|
+
}];
|
|
1055
|
+
for (let index = 0; index < enumValues.length; index++) {
|
|
1056
|
+
const value = enumValues[index];
|
|
1057
|
+
const label = enumItemLabels?.[index] ?? String(value);
|
|
1058
|
+
const isDefault = value === config.schema.default;
|
|
1059
|
+
const displayLabel = isDefault ? ( localize(7479, "{0} (default)", label)) : label;
|
|
1060
|
+
items.push({
|
|
1061
|
+
item: {
|
|
1062
|
+
id: `effort.${value}`,
|
|
1063
|
+
enabled: true,
|
|
1064
|
+
checked: config.value === value,
|
|
1065
|
+
class: undefined,
|
|
1066
|
+
tooltip: config.schema.enumDescriptions?.[index] ?? "",
|
|
1067
|
+
label: displayLabel,
|
|
1068
|
+
run: () => {
|
|
1069
|
+
this._languageModelsService.setModelConfiguration(modelIdentifier, {
|
|
1070
|
+
[config.key]: value
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
kind: ActionListItemKind.Action,
|
|
1075
|
+
label: displayLabel,
|
|
1076
|
+
description: config.schema.enumDescriptions?.[index],
|
|
1077
|
+
group: {
|
|
1078
|
+
title: "",
|
|
1079
|
+
icon: ThemeIcon.fromId(config.value === value ? Codicon.check.id : Codicon.blank.id)
|
|
1080
|
+
},
|
|
1081
|
+
hideIcon: false
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
const previouslyFocusedElement = getActiveElement();
|
|
1085
|
+
const delegate = {
|
|
1086
|
+
onSelect: action => {
|
|
1087
|
+
this._actionWidgetService.hide();
|
|
1088
|
+
action.run();
|
|
1089
|
+
},
|
|
1090
|
+
onHide: () => {
|
|
1091
|
+
this._effortButton?.setAttribute("aria-expanded", "false");
|
|
1092
|
+
if (isHTMLElement(previouslyFocusedElement)) {
|
|
1093
|
+
previouslyFocusedElement.focus();
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
this._effortButton.setAttribute("aria-expanded", "true");
|
|
1098
|
+
this._actionWidgetService.show(
|
|
1099
|
+
"ChatModelEffortPicker",
|
|
1100
|
+
false,
|
|
1101
|
+
items,
|
|
1102
|
+
delegate,
|
|
1103
|
+
this._effortButton,
|
|
1104
|
+
undefined,
|
|
1105
|
+
[],
|
|
1106
|
+
{
|
|
1107
|
+
isChecked(element) {
|
|
1108
|
+
return element.kind === ActionListItemKind.Action ? !!element?.item?.checked : undefined;
|
|
1109
|
+
},
|
|
1110
|
+
getRole: () => "menuitemradio",
|
|
1111
|
+
getWidgetRole: () => "menu"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
footerText: ( localize(7480, "Higher levels of thinking may increase costs"))
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
_showTokensPicker() {
|
|
1119
|
+
if (this._domNode?.classList.contains("disabled")) {
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const config = this._getConfigProperty("tokens");
|
|
1123
|
+
if (!config || !this._tokensButton || !this._selectedModel) {
|
|
1124
|
+
return;
|
|
1125
|
+
}
|
|
1126
|
+
const modelIdentifier = this._selectedModel.identifier;
|
|
1127
|
+
const enumValues = config.schema.enum ?? [];
|
|
1128
|
+
const enumItemLabels = config.schema.enumItemLabels;
|
|
1129
|
+
const items = [{
|
|
1130
|
+
kind: ActionListItemKind.Header,
|
|
1131
|
+
label: ( localize(7481, "Context Size"))
|
|
1132
|
+
}];
|
|
1133
|
+
for (let index = 0; index < enumValues.length; index++) {
|
|
1134
|
+
const value = enumValues[index];
|
|
1135
|
+
const label = enumItemLabels?.[index] ?? formatTokenCount(Number(value));
|
|
1136
|
+
const isDefault = value === config.schema.default;
|
|
1137
|
+
const displayLabel = isDefault ? ( localize(7482, "{0} (default)", label)) : label;
|
|
1138
|
+
const description = config.schema.enumDescriptions?.[index];
|
|
1139
|
+
items.push({
|
|
1140
|
+
item: {
|
|
1141
|
+
id: `tokens.${value}`,
|
|
1142
|
+
enabled: true,
|
|
1143
|
+
checked: config.value === value,
|
|
1144
|
+
class: undefined,
|
|
1145
|
+
tooltip: description ?? "",
|
|
1146
|
+
label: displayLabel,
|
|
1147
|
+
run: () => {
|
|
1148
|
+
this._languageModelsService.setModelConfiguration(modelIdentifier, {
|
|
1149
|
+
[config.key]: value
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
kind: ActionListItemKind.Action,
|
|
1154
|
+
label: displayLabel,
|
|
1155
|
+
description,
|
|
1156
|
+
group: {
|
|
1157
|
+
title: "",
|
|
1158
|
+
icon: ThemeIcon.fromId(config.value === value ? Codicon.check.id : Codicon.blank.id)
|
|
1159
|
+
},
|
|
1160
|
+
hideIcon: false
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
const previouslyFocusedElement = getActiveElement();
|
|
1164
|
+
const delegate = {
|
|
1165
|
+
onSelect: action => {
|
|
1166
|
+
this._actionWidgetService.hide();
|
|
1167
|
+
action.run();
|
|
1168
|
+
},
|
|
1169
|
+
onHide: () => {
|
|
1170
|
+
this._tokensButton?.setAttribute("aria-expanded", "false");
|
|
1171
|
+
if (isHTMLElement(previouslyFocusedElement)) {
|
|
1172
|
+
previouslyFocusedElement.focus();
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
this._tokensButton.setAttribute("aria-expanded", "true");
|
|
1177
|
+
this._actionWidgetService.show(
|
|
1178
|
+
"ChatModelTokensPicker",
|
|
1179
|
+
false,
|
|
1180
|
+
items,
|
|
1181
|
+
delegate,
|
|
1182
|
+
this._tokensButton,
|
|
1183
|
+
undefined,
|
|
1184
|
+
[],
|
|
1185
|
+
{
|
|
1186
|
+
isChecked(element) {
|
|
1187
|
+
return element.kind === ActionListItemKind.Action ? !!element?.item?.checked : undefined;
|
|
1188
|
+
},
|
|
1189
|
+
getRole: () => "menuitemradio",
|
|
1190
|
+
getWidgetRole: () => "menu"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
footerText: ( localize(7483, "Larger size may increase cost in longer sessions"))
|
|
1194
|
+
}
|
|
1195
|
+
);
|
|
727
1196
|
}
|
|
728
1197
|
};
|
|
729
1198
|
ModelPickerWidget = ( __decorate([( __param(1, IActionWidgetService)), ( __param(2, ICommandService)), ( __param(3, IOpenerService)), ( __param(4, ITelemetryService)), ( __param(5, ILanguageModelsService)), ( __param(6, IProductService)), ( __param(7, IChatEntitlementService)), ( __param(8, IUpdateService)), ( __param(9, IUriIdentityService))], ModelPickerWidget));
|
|
730
|
-
function getModelHoverContent(model) {
|
|
731
|
-
const isAuto = model
|
|
732
|
-
const
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}));
|
|
736
|
-
markdown.appendMarkdown(`**${model.metadata.name}**`);
|
|
1199
|
+
function getModelHoverContent(model, openerService, isUBB) {
|
|
1200
|
+
const isAuto = isAutoModel(model);
|
|
1201
|
+
const container = $(".chat-model-hover");
|
|
1202
|
+
const disposables = ( new DisposableStore());
|
|
1203
|
+
container.appendChild($(".chat-model-hover-name", undefined, model.metadata.name));
|
|
737
1204
|
if (model.metadata.tooltip) {
|
|
738
|
-
|
|
1205
|
+
container.appendChild($(".chat-model-hover-separator"));
|
|
1206
|
+
const descriptionContainer = $(".chat-model-hover-description");
|
|
1207
|
+
const md = ( new MarkdownString("", {
|
|
1208
|
+
isTrusted: true,
|
|
1209
|
+
supportThemeIcons: true
|
|
1210
|
+
}));
|
|
739
1211
|
if (model.metadata.statusIcon) {
|
|
740
|
-
|
|
1212
|
+
md.appendMarkdown(`$(${model.metadata.statusIcon.id}) `);
|
|
1213
|
+
}
|
|
1214
|
+
md.appendMarkdown(model.metadata.tooltip);
|
|
1215
|
+
const rendered = renderMarkdown(md, {
|
|
1216
|
+
actionHandler: url => {
|
|
1217
|
+
openerService.open(( URI.parse(url)), {
|
|
1218
|
+
allowCommands: true
|
|
1219
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
});
|
|
1222
|
+
disposables.add(rendered);
|
|
1223
|
+
descriptionContainer.appendChild(rendered.element);
|
|
1224
|
+
container.appendChild(descriptionContainer);
|
|
1225
|
+
}
|
|
1226
|
+
if (!isAuto && isUBB) {
|
|
1227
|
+
const costLines = [];
|
|
1228
|
+
if (model.metadata.inputCost !== undefined) {
|
|
1229
|
+
costLines.push({
|
|
1230
|
+
label: ( localize(7484, "Input")),
|
|
1231
|
+
value: model.metadata.inputCost === 1 ? ( localize(7485, "{0} credit", model.metadata.inputCost)) : ( localize(7486, "{0} credits", model.metadata.inputCost))
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
if (model.metadata.cacheCost !== undefined) {
|
|
1235
|
+
costLines.push({
|
|
1236
|
+
label: ( localize(7487, "Cached input")),
|
|
1237
|
+
value: model.metadata.cacheCost === 1 ? ( localize(7485, "{0} credit", model.metadata.cacheCost)) : ( localize(7486, "{0} credits", model.metadata.cacheCost))
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1240
|
+
if (model.metadata.outputCost !== undefined) {
|
|
1241
|
+
costLines.push({
|
|
1242
|
+
label: ( localize(7488, "Output")),
|
|
1243
|
+
value: model.metadata.outputCost === 1 ? ( localize(7485, "{0} credit", model.metadata.outputCost)) : ( localize(7486, "{0} credits", model.metadata.outputCost))
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
if (costLines.length > 0) {
|
|
1247
|
+
const costSection = $(".chat-model-hover-cost");
|
|
1248
|
+
costSection.appendChild($(".chat-model-hover-cost-title", undefined, ( localize(7489, "Cost (per 1M tokens)"))));
|
|
1249
|
+
for (const line of costLines) {
|
|
1250
|
+
costSection.appendChild($(
|
|
1251
|
+
".chat-model-hover-cost-line",
|
|
1252
|
+
undefined,
|
|
1253
|
+
$("span.chat-model-hover-cost-line-label", undefined, `${line.label}: `),
|
|
1254
|
+
$("span", undefined, line.value)
|
|
1255
|
+
));
|
|
1256
|
+
}
|
|
1257
|
+
container.appendChild(costSection);
|
|
1258
|
+
} else if (model.metadata.pricing && !isMultiplierPricing(model)) {
|
|
1259
|
+
const costSection = $(".chat-model-hover-cost");
|
|
1260
|
+
costSection.appendChild($("span", undefined, ( localize(7490, "Cost: {0}", model.metadata.pricing))));
|
|
1261
|
+
container.appendChild(costSection);
|
|
741
1262
|
}
|
|
742
|
-
markdown.appendMarkdown(`${model.metadata.tooltip}`);
|
|
743
1263
|
}
|
|
744
1264
|
if (!isAuto && (model.metadata.maxInputTokens || model.metadata.maxOutputTokens)) {
|
|
745
|
-
markdown.appendMarkdown(`\n\n`);
|
|
746
1265
|
const totalTokens = (model.metadata.maxInputTokens ?? 0) + (model.metadata.maxOutputTokens ?? 0);
|
|
747
|
-
|
|
748
|
-
|
|
1266
|
+
const contextSection = $(".chat-model-hover-context");
|
|
1267
|
+
contextSection.appendChild($(".chat-model-hover-context-label", undefined, ( localize(7491, "Max context"))));
|
|
1268
|
+
contextSection.appendChild($(
|
|
1269
|
+
".chat-model-hover-context-value",
|
|
1270
|
+
undefined,
|
|
1271
|
+
formatTokenCount(totalTokens)
|
|
1272
|
+
));
|
|
1273
|
+
container.appendChild(contextSection);
|
|
1274
|
+
}
|
|
1275
|
+
if (!isAuto && isUBB && model.metadata.configurationSchema?.properties) {
|
|
1276
|
+
const configurableLabels = [];
|
|
1277
|
+
for (const [, propSchema] of Object.entries(model.metadata.configurationSchema.properties)) {
|
|
1278
|
+
if (propSchema.enum && propSchema.enum.length >= 2) {
|
|
1279
|
+
const label = propSchema.title ?? propSchema.description;
|
|
1280
|
+
if (label) {
|
|
1281
|
+
configurableLabels.push(label);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
if (configurableLabels.length > 0) {
|
|
1286
|
+
container.appendChild($(".chat-model-hover-separator"));
|
|
1287
|
+
const configRow = $(".chat-model-hover-configurable");
|
|
1288
|
+
configRow.appendChild(
|
|
1289
|
+
$("span.chat-model-hover-configurable-label", undefined, ( localize(7492, "Configurable:")))
|
|
1290
|
+
);
|
|
1291
|
+
for (const label of configurableLabels) {
|
|
1292
|
+
configRow.appendChild($("span.chat-model-hover-configurable-tag", undefined, label));
|
|
1293
|
+
}
|
|
1294
|
+
container.appendChild(configRow);
|
|
1295
|
+
}
|
|
749
1296
|
}
|
|
750
|
-
return
|
|
1297
|
+
return container.children.length > 0 ? {
|
|
1298
|
+
element: container,
|
|
1299
|
+
disposable: disposables
|
|
1300
|
+
} : undefined;
|
|
751
1301
|
}
|
|
752
1302
|
function formatTokenCount(count) {
|
|
753
|
-
if (count
|
|
754
|
-
|
|
1303
|
+
if (count > 900_000) {
|
|
1304
|
+
const value = Math.ceil(count / 1_000_000);
|
|
1305
|
+
return `${value}M`;
|
|
755
1306
|
} else if (count >= 1000) {
|
|
756
|
-
return `${(count / 1000)
|
|
1307
|
+
return `${Math.round(count / 1000)}K`;
|
|
757
1308
|
}
|
|
758
1309
|
return ( count.toString());
|
|
759
1310
|
}
|
|
1311
|
+
function isAutoModel(model) {
|
|
1312
|
+
return model.metadata.id === "auto" && (model.metadata.vendor === "copilot" || model.metadata.vendor === "copilotcli");
|
|
1313
|
+
}
|
|
760
1314
|
|
|
761
|
-
export { ModelPickerWidget, buildModelPickerItems, getModelPickerAccessibilityProvider };
|
|
1315
|
+
export { ModelPickerWidget, buildModelPickerItems, formatTokenCount, getModelPickerAccessibilityProvider };
|