@codingame/monaco-vscode-katex-common 32.0.2 → 33.0.7
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/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/platform/agentHost/common/claudeSessionConfigKeys.d.ts +30 -0
- package/vscode/src/vs/platform/agentHost/common/claudeSessionConfigKeys.js +8 -0
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.d.ts +32 -0
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +56 -36
- 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/agentHost/agentHostChatInputPicker.contribution.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +502 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +153 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +52 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -13
- 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/tools/chatToolRiskAssessmentService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +23 -20
- 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/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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +40 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -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/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +217 -13
- 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.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +44 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- 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 +10 -10
- 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 +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +12 -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.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +8 -13
- 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.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- 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 +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +24 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +72 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
- 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/chatToolOutputPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +7 -22
- 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/chatToolProgressPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +25 -5
- 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 +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +41 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +31 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +89 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +203 -107
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +18 -18
- 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 +32 -81
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
- 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/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +4 -0
- 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/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +29 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +27 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +17 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +150 -69
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +9 -14
|
@@ -29,6 +29,8 @@ import { ChatEntitlement, isProUser } from '@codingame/monaco-vscode-api/vscode/
|
|
|
29
29
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
30
30
|
import { semverExports } from '@codingame/monaco-vscode-api/_virtual/semver';
|
|
31
31
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
32
|
+
import { GitHubPaths } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount';
|
|
33
|
+
import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
|
|
32
34
|
import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
|
|
33
35
|
import { IUpdateService } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service';
|
|
34
36
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
@@ -48,20 +50,20 @@ function getUpdateHoverContent(updateState) {
|
|
|
48
50
|
switch (updateState) {
|
|
49
51
|
case StateType.AvailableForDownload:
|
|
50
52
|
hoverContent.appendMarkdown(( localize(
|
|
51
|
-
|
|
53
|
+
7547,
|
|
52
54
|
"This model requires a newer version of VS Code. [Download Update](command:update.downloadUpdate) to access it."
|
|
53
55
|
)));
|
|
54
56
|
break;
|
|
55
57
|
case StateType.Downloaded:
|
|
56
58
|
case StateType.Ready:
|
|
57
59
|
hoverContent.appendMarkdown(( localize(
|
|
58
|
-
|
|
60
|
+
7548,
|
|
59
61
|
"This model requires a newer version of VS Code. [Restart to Update](command:update.restartToUpdate) to access it."
|
|
60
62
|
)));
|
|
61
63
|
break;
|
|
62
64
|
default:
|
|
63
65
|
hoverContent.appendMarkdown(( localize(
|
|
64
|
-
|
|
66
|
+
7549,
|
|
65
67
|
"This model requires a newer version of VS Code. [Update VS Code](command:update.checkForUpdate) to access it."
|
|
66
68
|
)));
|
|
67
69
|
break;
|
|
@@ -110,13 +112,22 @@ function getProviderGroupForModel(model, modelToGroup, languageModelsService) {
|
|
|
110
112
|
function isMultiplierPricing(model) {
|
|
111
113
|
return model.metadata.multiplierNumeric !== undefined;
|
|
112
114
|
}
|
|
113
|
-
function createModelItem(
|
|
115
|
+
function createModelItem(
|
|
116
|
+
action,
|
|
117
|
+
model,
|
|
118
|
+
openerService,
|
|
119
|
+
vendorLabel,
|
|
120
|
+
isUBB,
|
|
121
|
+
ariaDescription,
|
|
122
|
+
pinAction
|
|
123
|
+
) {
|
|
114
124
|
const hover = model && openerService ? getModelHoverContent(model, openerService, isUBB) : undefined;
|
|
115
125
|
return {
|
|
116
126
|
item: action,
|
|
117
127
|
kind: ActionListItemKind.Action,
|
|
118
128
|
label: action.label,
|
|
119
|
-
description:
|
|
129
|
+
description: action.description,
|
|
130
|
+
ariaDescription,
|
|
120
131
|
group: {
|
|
121
132
|
title: "",
|
|
122
133
|
icon: action.icon ?? ThemeIcon.fromId(action.checked ? Codicon.check.id : Codicon.blank.id)
|
|
@@ -130,9 +141,18 @@ function createModelItem(action, model, descriptionOverride, openerService, vend
|
|
|
130
141
|
disposable: hover.disposable
|
|
131
142
|
} : undefined,
|
|
132
143
|
tooltip: action.tooltip,
|
|
144
|
+
toolbarActions: pinAction ? [pinAction] : undefined,
|
|
133
145
|
submenuActions: action.toolbarActions?.length ? action.toolbarActions : undefined
|
|
134
146
|
};
|
|
135
147
|
}
|
|
148
|
+
function createPinAction(modelIdentifier, isPinned, onTogglePin) {
|
|
149
|
+
return toAction({
|
|
150
|
+
id: `pin.${modelIdentifier}`,
|
|
151
|
+
label: isPinned ? ( localize(7550, "Unpin Model")) : ( localize(7551, "Pin Model")),
|
|
152
|
+
class: ThemeIcon.asClassName(isPinned ? Codicon.pinned : Codicon.pin),
|
|
153
|
+
run: () => onTogglePin(modelIdentifier, !isPinned)
|
|
154
|
+
});
|
|
155
|
+
}
|
|
136
156
|
function resolveConfigProperty(model, group, languageModelsService) {
|
|
137
157
|
const schema = model.metadata.configurationSchema;
|
|
138
158
|
if (!schema?.properties) {
|
|
@@ -155,26 +175,19 @@ function resolveConfigProperty(model, group, languageModelsService) {
|
|
|
155
175
|
}
|
|
156
176
|
return undefined;
|
|
157
177
|
}
|
|
158
|
-
function
|
|
159
|
-
let filled;
|
|
178
|
+
function getPriceCategoryLabel(priceCategory) {
|
|
160
179
|
switch (priceCategory) {
|
|
161
180
|
case "low":
|
|
162
|
-
|
|
163
|
-
break;
|
|
181
|
+
return localize(7552, "Low cost");
|
|
164
182
|
case "medium":
|
|
165
|
-
|
|
166
|
-
break;
|
|
183
|
+
return localize(7553, "Medium cost");
|
|
167
184
|
case "high":
|
|
168
|
-
|
|
169
|
-
break;
|
|
185
|
+
return localize(7554, "High cost");
|
|
170
186
|
case "very_high":
|
|
171
|
-
|
|
172
|
-
break;
|
|
187
|
+
return localize(7555, "Very high cost");
|
|
173
188
|
default:
|
|
174
189
|
return undefined;
|
|
175
190
|
}
|
|
176
|
-
const total = 4;
|
|
177
|
-
return "$(circle-filled)".repeat(filled) + "$(circle)".repeat(total - filled);
|
|
178
191
|
}
|
|
179
192
|
function getModelConfigurationDescription(model, languageModelsService) {
|
|
180
193
|
const schema = model.metadata.configurationSchema;
|
|
@@ -210,23 +223,11 @@ function createModelAction(
|
|
|
210
223
|
isUBB
|
|
211
224
|
) {
|
|
212
225
|
const pricingForDescription = isMultiplierPricing(model) ? model.metadata.pricing : undefined;
|
|
213
|
-
const
|
|
226
|
+
const priceCategoryLabel = isUBB ? getPriceCategoryLabel(model.metadata.priceCategory) : undefined;
|
|
214
227
|
const configDescription = !isUBB ? getModelConfigurationDescription(model, languageModelsService) : undefined;
|
|
215
228
|
const detail = suppressVendorInDetail ? undefined : model.metadata.detail;
|
|
216
229
|
const textParts = [configDescription, detail, pricingForDescription].filter(Boolean);
|
|
217
230
|
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
231
|
const toolbarActions = !isUBB ? languageModelsService.getModelConfigurationActions(model.identifier) : undefined;
|
|
231
232
|
const action = {
|
|
232
233
|
id: model.identifier,
|
|
@@ -234,20 +235,21 @@ function createModelAction(
|
|
|
234
235
|
icon: model.metadata.statusIcon,
|
|
235
236
|
checked: model.identifier === selectedModelId,
|
|
236
237
|
class: undefined,
|
|
237
|
-
description:
|
|
238
|
+
description: textDescription,
|
|
238
239
|
tooltip: model.metadata.name,
|
|
239
240
|
label: model.metadata.name,
|
|
240
241
|
section,
|
|
241
242
|
toolbarActions: toolbarActions && toolbarActions.length > 0 ? toolbarActions : undefined,
|
|
242
243
|
run: () => onSelect(model)
|
|
243
244
|
};
|
|
245
|
+
const ariaDescription = priceCategoryLabel ? (textDescription ? textDescription + " · " + priceCategoryLabel : priceCategoryLabel) : undefined;
|
|
244
246
|
return {
|
|
245
247
|
action,
|
|
246
|
-
|
|
248
|
+
ariaDescription
|
|
247
249
|
};
|
|
248
250
|
}
|
|
249
251
|
function shouldShowManageModelsAction(chatEntitlementService) {
|
|
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;
|
|
252
|
+
return chatEntitlementService.hasByokModels || 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;
|
|
251
253
|
}
|
|
252
254
|
function createManageModelsAction(commandService) {
|
|
253
255
|
return {
|
|
@@ -255,8 +257,8 @@ function createManageModelsAction(commandService) {
|
|
|
255
257
|
enabled: true,
|
|
256
258
|
checked: false,
|
|
257
259
|
class: ThemeIcon.asClassName(Codicon.gear),
|
|
258
|
-
tooltip: ( localize(
|
|
259
|
-
label: ( localize(
|
|
260
|
+
tooltip: ( localize(7556, "Manage Language Models")),
|
|
261
|
+
label: ( localize(7557, "Manage Models...")),
|
|
260
262
|
run: () => {
|
|
261
263
|
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
262
264
|
}
|
|
@@ -266,10 +268,12 @@ function buildModelPickerItems(
|
|
|
266
268
|
models,
|
|
267
269
|
selectedModelId,
|
|
268
270
|
recentModelIds,
|
|
271
|
+
pinnedModelIds,
|
|
269
272
|
controlModels,
|
|
270
273
|
currentVSCodeVersion,
|
|
271
274
|
updateStateType,
|
|
272
275
|
onSelect,
|
|
276
|
+
onTogglePin,
|
|
273
277
|
manageSettingsUrl,
|
|
274
278
|
useGroupedModelPicker,
|
|
275
279
|
manageModelsAction,
|
|
@@ -287,8 +291,8 @@ function buildModelPickerItems(
|
|
|
287
291
|
enabled: true,
|
|
288
292
|
checked: true,
|
|
289
293
|
class: undefined,
|
|
290
|
-
tooltip: ( localize(
|
|
291
|
-
label: ( localize(
|
|
294
|
+
tooltip: ( localize(7558, "Auto")),
|
|
295
|
+
label: ( localize(7558, "Auto")),
|
|
292
296
|
run: () => {}
|
|
293
297
|
}));
|
|
294
298
|
}
|
|
@@ -325,7 +329,7 @@ function buildModelPickerItems(
|
|
|
325
329
|
markPlaced(autoModel.identifier, autoModel.metadata.id);
|
|
326
330
|
const {
|
|
327
331
|
action: autoAction,
|
|
328
|
-
|
|
332
|
+
ariaDescription: autoAriaDesc
|
|
329
333
|
} = createModelAction(
|
|
330
334
|
autoModel,
|
|
331
335
|
selectedModelId,
|
|
@@ -336,9 +340,58 @@ function buildModelPickerItems(
|
|
|
336
340
|
isUBB
|
|
337
341
|
);
|
|
338
342
|
items.push(
|
|
339
|
-
createModelItem(autoAction, autoModel,
|
|
343
|
+
createModelItem(autoAction, autoModel, openerService, undefined, isUBB, autoAriaDesc)
|
|
340
344
|
);
|
|
341
345
|
}
|
|
346
|
+
const allGroupKeys = ( new Set(( models.map(m => {
|
|
347
|
+
const info = getProviderGroupForModel(m, modelToGroup, languageModelsService);
|
|
348
|
+
return getProviderGroupKey(info.vendor, info.groupName);
|
|
349
|
+
}))));
|
|
350
|
+
const showGroupLabel = allGroupKeys.size > 1;
|
|
351
|
+
const makePinAction = model => onTogglePin ? createPinAction(model.identifier, pinnedModelIds.includes(model.identifier), onTogglePin) : undefined;
|
|
352
|
+
const pinnedSet = ( new Set(pinnedModelIds));
|
|
353
|
+
const pinnedModels = [];
|
|
354
|
+
for (const id of pinnedModelIds) {
|
|
355
|
+
if (( placed.has(id))) {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const model = resolveModel(id);
|
|
359
|
+
if (model && !( placed.has(model.identifier))) {
|
|
360
|
+
markPlaced(model.identifier, model.metadata.id);
|
|
361
|
+
pinnedModels.push(model);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (pinnedModels.length > 0) {
|
|
365
|
+
items.push({
|
|
366
|
+
kind: ActionListItemKind.Separator,
|
|
367
|
+
label: ( localize(7559, "Pinned"))
|
|
368
|
+
});
|
|
369
|
+
for (const model of pinnedModels) {
|
|
370
|
+
const groupLabel = showGroupLabel ? getProviderGroupForModel(model, modelToGroup, languageModelsService).groupName : undefined;
|
|
371
|
+
const {
|
|
372
|
+
action: pinnedAction,
|
|
373
|
+
ariaDescription: pinnedAriaDesc
|
|
374
|
+
} = createModelAction(
|
|
375
|
+
model,
|
|
376
|
+
selectedModelId,
|
|
377
|
+
onSelect,
|
|
378
|
+
languageModelsService,
|
|
379
|
+
undefined,
|
|
380
|
+
showGroupLabel,
|
|
381
|
+
isUBB
|
|
382
|
+
);
|
|
383
|
+
items.push(createModelItem(
|
|
384
|
+
pinnedAction,
|
|
385
|
+
model,
|
|
386
|
+
openerService,
|
|
387
|
+
groupLabel,
|
|
388
|
+
isUBB,
|
|
389
|
+
pinnedAriaDesc,
|
|
390
|
+
makePinAction(model)
|
|
391
|
+
));
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const filteredRecentIds = recentModelIds.filter(id => !( pinnedSet.has(id))).slice(0, 3);
|
|
342
395
|
const promotedItems = [];
|
|
343
396
|
const tryPlaceModel = id => {
|
|
344
397
|
if (( placed.has(id))) {
|
|
@@ -381,7 +434,7 @@ function buildModelPickerItems(
|
|
|
381
434
|
if (selectedModelId && selectedModelId !== autoModel?.identifier) {
|
|
382
435
|
tryPlaceModel(selectedModelId);
|
|
383
436
|
}
|
|
384
|
-
for (const id of
|
|
437
|
+
for (const id of filteredRecentIds) {
|
|
385
438
|
tryPlaceModel(id);
|
|
386
439
|
}
|
|
387
440
|
if (showFeatured) {
|
|
@@ -422,6 +475,11 @@ function buildModelPickerItems(
|
|
|
422
475
|
}
|
|
423
476
|
}
|
|
424
477
|
if (promotedItems.length > 0) {
|
|
478
|
+
if (items.length > 0) {
|
|
479
|
+
items.push({
|
|
480
|
+
kind: ActionListItemKind.Separator
|
|
481
|
+
});
|
|
482
|
+
}
|
|
425
483
|
promotedItems.sort((a, b) => {
|
|
426
484
|
const aAvail = a.kind === "available" ? 0 : 1;
|
|
427
485
|
const bAvail = b.kind === "available" ? 0 : 1;
|
|
@@ -432,29 +490,30 @@ function buildModelPickerItems(
|
|
|
432
490
|
const bName = b.kind === "available" ? b.model.metadata.name : b.entry.label;
|
|
433
491
|
return aName.localeCompare(bName);
|
|
434
492
|
});
|
|
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;
|
|
440
493
|
for (const item of promotedItems) {
|
|
441
494
|
if (item.kind === "available") {
|
|
442
|
-
const groupLabel =
|
|
495
|
+
const groupLabel = showGroupLabel ? getProviderGroupForModel(item.model, modelToGroup, languageModelsService).groupName : undefined;
|
|
443
496
|
const {
|
|
444
497
|
action: promotedAction,
|
|
445
|
-
|
|
498
|
+
ariaDescription: promotedAriaDesc
|
|
446
499
|
} = createModelAction(
|
|
447
500
|
item.model,
|
|
448
501
|
selectedModelId,
|
|
449
502
|
onSelect,
|
|
450
503
|
languageModelsService,
|
|
451
504
|
undefined,
|
|
452
|
-
|
|
505
|
+
showGroupLabel,
|
|
453
506
|
isUBB
|
|
454
507
|
);
|
|
455
|
-
items.push(
|
|
456
|
-
|
|
457
|
-
|
|
508
|
+
items.push(createModelItem(
|
|
509
|
+
promotedAction,
|
|
510
|
+
item.model,
|
|
511
|
+
openerService,
|
|
512
|
+
groupLabel,
|
|
513
|
+
isUBB,
|
|
514
|
+
promotedAriaDesc,
|
|
515
|
+
makePinAction(item.model)
|
|
516
|
+
));
|
|
458
517
|
} else {
|
|
459
518
|
items.push(createUnavailableModelItem(
|
|
460
519
|
item.id,
|
|
@@ -486,12 +545,12 @@ function buildModelPickerItems(
|
|
|
486
545
|
enabled: true,
|
|
487
546
|
checked: false,
|
|
488
547
|
class: undefined,
|
|
489
|
-
tooltip: ( localize(
|
|
490
|
-
label: ( localize(
|
|
548
|
+
tooltip: ( localize(7560, "Other Models")),
|
|
549
|
+
label: ( localize(7560, "Other Models")),
|
|
491
550
|
run: () => {}
|
|
492
551
|
},
|
|
493
552
|
kind: ActionListItemKind.Action,
|
|
494
|
-
label: ( localize(
|
|
553
|
+
label: ( localize(7560, "Other Models")),
|
|
495
554
|
group: {
|
|
496
555
|
title: "",
|
|
497
556
|
icon: Codicon.chevronDown
|
|
@@ -560,7 +619,7 @@ function buildModelPickerItems(
|
|
|
560
619
|
} else {
|
|
561
620
|
const {
|
|
562
621
|
action: bucketAction,
|
|
563
|
-
|
|
622
|
+
ariaDescription: bucketAriaDesc
|
|
564
623
|
} = createModelAction(
|
|
565
624
|
model,
|
|
566
625
|
selectedModelId,
|
|
@@ -570,9 +629,15 @@ function buildModelPickerItems(
|
|
|
570
629
|
showGroupHeaders,
|
|
571
630
|
isUBB
|
|
572
631
|
);
|
|
573
|
-
items.push(
|
|
574
|
-
|
|
575
|
-
|
|
632
|
+
items.push(createModelItem(
|
|
633
|
+
bucketAction,
|
|
634
|
+
model,
|
|
635
|
+
openerService,
|
|
636
|
+
undefined,
|
|
637
|
+
isUBB,
|
|
638
|
+
bucketAriaDesc,
|
|
639
|
+
makePinAction(model)
|
|
640
|
+
));
|
|
576
641
|
}
|
|
577
642
|
}
|
|
578
643
|
}
|
|
@@ -599,7 +664,7 @@ function buildModelPickerItems(
|
|
|
599
664
|
if (autoModel) {
|
|
600
665
|
const {
|
|
601
666
|
action: flatAutoAction,
|
|
602
|
-
|
|
667
|
+
ariaDescription: flatAutoAriaDesc
|
|
603
668
|
} = createModelAction(
|
|
604
669
|
autoModel,
|
|
605
670
|
selectedModelId,
|
|
@@ -609,9 +674,14 @@ function buildModelPickerItems(
|
|
|
609
674
|
undefined,
|
|
610
675
|
isUBB
|
|
611
676
|
);
|
|
612
|
-
items.push(
|
|
613
|
-
|
|
614
|
-
|
|
677
|
+
items.push(createModelItem(
|
|
678
|
+
flatAutoAction,
|
|
679
|
+
autoModel,
|
|
680
|
+
openerService,
|
|
681
|
+
undefined,
|
|
682
|
+
isUBB,
|
|
683
|
+
flatAutoAriaDesc
|
|
684
|
+
));
|
|
615
685
|
}
|
|
616
686
|
const sortedModels = models.filter(m => m !== autoModel).sort((a, b) => {
|
|
617
687
|
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
@@ -620,7 +690,7 @@ function buildModelPickerItems(
|
|
|
620
690
|
for (const model of sortedModels) {
|
|
621
691
|
const {
|
|
622
692
|
action: flatAction,
|
|
623
|
-
|
|
693
|
+
ariaDescription: flatAriaDesc
|
|
624
694
|
} = createModelAction(
|
|
625
695
|
model,
|
|
626
696
|
selectedModelId,
|
|
@@ -631,7 +701,7 @@ function buildModelPickerItems(
|
|
|
631
701
|
isUBB
|
|
632
702
|
);
|
|
633
703
|
items.push(
|
|
634
|
-
createModelItem(flatAction, model,
|
|
704
|
+
createModelItem(flatAction, model, openerService, undefined, isUBB, flatAriaDesc)
|
|
635
705
|
);
|
|
636
706
|
}
|
|
637
707
|
}
|
|
@@ -643,7 +713,7 @@ function getModelPickerAccessibilityProvider() {
|
|
|
643
713
|
if (element.kind !== ActionListItemKind.Action) {
|
|
644
714
|
return null;
|
|
645
715
|
}
|
|
646
|
-
const description = typeof element.description === "string" ? element.description : element.description?.value;
|
|
716
|
+
const description = element.ariaDescription ?? (typeof element.description === "string" ? element.description : element.description?.value);
|
|
647
717
|
return [element.label, element.badge, description].filter(part => !!part).join(", ");
|
|
648
718
|
},
|
|
649
719
|
isChecked(element) {
|
|
@@ -679,15 +749,15 @@ function createUnavailableModelItem(
|
|
|
679
749
|
) {
|
|
680
750
|
let description;
|
|
681
751
|
if (reason === "upgrade") {
|
|
682
|
-
description = ( new MarkdownString(( localize(
|
|
752
|
+
description = ( new MarkdownString(( localize(7561, "[Upgrade](command:workbench.action.chat.upgradePlan \" \")")), {
|
|
683
753
|
isTrusted: true
|
|
684
754
|
}));
|
|
685
755
|
} else if (reason === "update") {
|
|
686
|
-
description = ( localize(
|
|
756
|
+
description = ( localize(7562, "Update VS Code"));
|
|
687
757
|
} else {
|
|
688
|
-
description = manageSettingsUrl ? ( new MarkdownString(( localize(
|
|
758
|
+
description = manageSettingsUrl ? ( new MarkdownString(( localize(7563, "[Contact your admin]({0})", manageSettingsUrl)), {
|
|
689
759
|
isTrusted: true
|
|
690
|
-
})) : ( localize(
|
|
760
|
+
})) : ( localize(7564, "Contact your admin"));
|
|
691
761
|
}
|
|
692
762
|
let hoverContent;
|
|
693
763
|
if (reason === "upgrade") {
|
|
@@ -697,12 +767,12 @@ function createUnavailableModelItem(
|
|
|
697
767
|
}));
|
|
698
768
|
if (chatEntitlementService.entitlement === ChatEntitlement.Pro) {
|
|
699
769
|
hoverContent.appendMarkdown(( localize(
|
|
700
|
-
|
|
770
|
+
7565,
|
|
701
771
|
"[Upgrade to GitHub Copilot Pro+](command:workbench.action.chat.upgradePlan \" \") to use the best models."
|
|
702
772
|
)));
|
|
703
773
|
} else {
|
|
704
774
|
hoverContent.appendMarkdown(( localize(
|
|
705
|
-
|
|
775
|
+
7566,
|
|
706
776
|
"[Upgrade to GitHub Copilot Pro](command:workbench.action.chat.upgradePlan \" \") to use the best models."
|
|
707
777
|
)));
|
|
708
778
|
}
|
|
@@ -714,7 +784,7 @@ function createUnavailableModelItem(
|
|
|
714
784
|
supportThemeIcons: true
|
|
715
785
|
}));
|
|
716
786
|
hoverContent.appendMarkdown(( localize(
|
|
717
|
-
|
|
787
|
+
7567,
|
|
718
788
|
"This model is not available. Contact your administrator to enable it."
|
|
719
789
|
)));
|
|
720
790
|
}
|
|
@@ -765,7 +835,8 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
765
835
|
_productService,
|
|
766
836
|
_entitlementService,
|
|
767
837
|
_updateService,
|
|
768
|
-
_uriIdentityService
|
|
838
|
+
_uriIdentityService,
|
|
839
|
+
_defaultAccountService
|
|
769
840
|
) {
|
|
770
841
|
super();
|
|
771
842
|
this._delegate = _delegate;
|
|
@@ -778,18 +849,14 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
778
849
|
this._entitlementService = _entitlementService;
|
|
779
850
|
this._updateService = _updateService;
|
|
780
851
|
this._uriIdentityService = _uriIdentityService;
|
|
852
|
+
this._defaultAccountService = _defaultAccountService;
|
|
781
853
|
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
782
854
|
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
783
855
|
this._register(this._languageModelsService.onDidChangeLanguageModels(() => {
|
|
784
856
|
this._renderLabel();
|
|
785
857
|
}));
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
const currentIsUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
789
|
-
if (currentIsUBB !== lastIsUBB) {
|
|
790
|
-
lastIsUBB = currentIsUBB;
|
|
791
|
-
this._renderLabel();
|
|
792
|
-
}
|
|
858
|
+
this._register(this._entitlementService.onDidChangeUsageBasedBilling(() => {
|
|
859
|
+
this._renderLabel();
|
|
793
860
|
}));
|
|
794
861
|
}
|
|
795
862
|
setHideChevrons(hideChevrons) {
|
|
@@ -846,10 +913,10 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
846
913
|
this._registerButtonAction(this._effortButton, () => this._showEffortPicker());
|
|
847
914
|
this._registerButtonAction(this._tokensButton, () => this._showTokensPicker());
|
|
848
915
|
this._register(
|
|
849
|
-
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._effortButton, ( localize(
|
|
916
|
+
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._effortButton, ( localize(7568, "Set Thinking Effort")))
|
|
850
917
|
);
|
|
851
918
|
this._register(
|
|
852
|
-
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._tokensButton, ( localize(
|
|
919
|
+
getBaseLayerHoverDelegate().setupManagedHover(getDefaultHoverDelegate("mouse"), this._tokensButton, ( localize(7569, "Set Context Size")))
|
|
853
920
|
);
|
|
854
921
|
}
|
|
855
922
|
_registerButtonAction(element, action) {
|
|
@@ -895,15 +962,26 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
895
962
|
interaction
|
|
896
963
|
});
|
|
897
964
|
};
|
|
898
|
-
const manageSettingsUrl = this.
|
|
965
|
+
const manageSettingsUrl = this._defaultAccountService.resolveGitHubUrl(GitHubPaths.copilotSettings);
|
|
966
|
+
const onTogglePin = (modelIdentifier, pinned) => {
|
|
967
|
+
if (pinned) {
|
|
968
|
+
this._languageModelsService.pinModel(modelIdentifier);
|
|
969
|
+
} else {
|
|
970
|
+
this._languageModelsService.unpinModel(modelIdentifier);
|
|
971
|
+
}
|
|
972
|
+
this._actionWidgetService.hide();
|
|
973
|
+
this.show(anchorElement);
|
|
974
|
+
};
|
|
899
975
|
const items = buildModelPickerItems(
|
|
900
976
|
models,
|
|
901
977
|
this._selectedModel?.identifier,
|
|
902
978
|
this._languageModelsService.getRecentlyUsedModelIds(),
|
|
979
|
+
this._languageModelsService.getPinnedModelIds(),
|
|
903
980
|
controlModelsForTier,
|
|
904
981
|
this._productService.version,
|
|
905
982
|
this._updateService.state.type,
|
|
906
983
|
onSelect,
|
|
984
|
+
onTogglePin,
|
|
907
985
|
manageSettingsUrl,
|
|
908
986
|
this._delegate.useGroupedModelPicker(),
|
|
909
987
|
isUBB ? manageModelsAction : undefined,
|
|
@@ -914,12 +992,16 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
914
992
|
this._openerService,
|
|
915
993
|
isUBB
|
|
916
994
|
);
|
|
917
|
-
const
|
|
995
|
+
const hoverDisposables = ( new DisposableStore());
|
|
996
|
+
for (const item of items) {
|
|
997
|
+
if (item.hover?.disposable) {
|
|
998
|
+
hoverDisposables.add(item.hover.disposable);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
918
1001
|
const listOptions = {
|
|
919
1002
|
showFilter: true,
|
|
920
|
-
filterPlaceholder: ( localize(
|
|
1003
|
+
filterPlaceholder: ( localize(7570, "Search models")),
|
|
921
1004
|
filterActions: !isUBB && manageModelsAction ? [manageModelsAction] : undefined,
|
|
922
|
-
secondaryHeading: isUBB && hasPriceCategories ? ( localize(7485, "Cost")) : undefined,
|
|
923
1005
|
focusFilterOnOpen: true,
|
|
924
1006
|
collapsedByDefault: ( new Set([ModelPickerSection.Other])),
|
|
925
1007
|
onDidToggleSection: (section, collapsed) => {
|
|
@@ -946,6 +1028,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
946
1028
|
action.run();
|
|
947
1029
|
},
|
|
948
1030
|
onHide: () => {
|
|
1031
|
+
hoverDisposables.dispose();
|
|
949
1032
|
this._nameButton?.setAttribute("aria-expanded", "false");
|
|
950
1033
|
if (isHTMLElement(previouslyFocusedElement)) {
|
|
951
1034
|
previouslyFocusedElement.focus();
|
|
@@ -994,7 +1077,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
994
1077
|
if (statusIcon) {
|
|
995
1078
|
nameChildren.push(renderIcon(statusIcon));
|
|
996
1079
|
}
|
|
997
|
-
const modelLabel = name ?? ( localize(
|
|
1080
|
+
const modelLabel = name ?? ( localize(7558, "Auto"));
|
|
998
1081
|
const isUBB = !!this._entitlementService.quotas.usageBasedBilling;
|
|
999
1082
|
const configDescription = !isUBB && this._selectedModel ? getModelConfigurationDescription(this._selectedModel, this._languageModelsService) : undefined;
|
|
1000
1083
|
const fullLabel = configDescription ? `${modelLabel} · ${configDescription}` : modelLabel;
|
|
@@ -1012,7 +1095,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1012
1095
|
$("span.chat-input-picker-label", undefined, effortLabel)
|
|
1013
1096
|
);
|
|
1014
1097
|
this._effortButton.style.display = "";
|
|
1015
|
-
this._effortButton.ariaLabel = ( localize(
|
|
1098
|
+
this._effortButton.ariaLabel = ( localize(7571, "Thinking Effort: {0}", effortLabel));
|
|
1016
1099
|
} else if (this._effortButton) {
|
|
1017
1100
|
this._effortButton.style.display = "none";
|
|
1018
1101
|
}
|
|
@@ -1025,11 +1108,11 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1025
1108
|
$("span.chat-input-picker-label", undefined, tokensLabel)
|
|
1026
1109
|
);
|
|
1027
1110
|
this._tokensButton.style.display = "";
|
|
1028
|
-
this._tokensButton.ariaLabel = ( localize(
|
|
1111
|
+
this._tokensButton.ariaLabel = ( localize(7572, "Context Size: {0}", tokensLabel));
|
|
1029
1112
|
} else if (this._tokensButton) {
|
|
1030
1113
|
this._tokensButton.style.display = "none";
|
|
1031
1114
|
}
|
|
1032
|
-
this._domNode.ariaLabel = ( localize(
|
|
1115
|
+
this._domNode.ariaLabel = ( localize(7573, "Pick Model, {0}", fullLabel));
|
|
1033
1116
|
}
|
|
1034
1117
|
_getConfigProperty(group) {
|
|
1035
1118
|
if (!this._selectedModel) {
|
|
@@ -1050,13 +1133,13 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1050
1133
|
const enumItemLabels = config.schema.enumItemLabels;
|
|
1051
1134
|
const items = [{
|
|
1052
1135
|
kind: ActionListItemKind.Header,
|
|
1053
|
-
label: ( localize(
|
|
1136
|
+
label: ( localize(7574, "Thinking Effort"))
|
|
1054
1137
|
}];
|
|
1055
1138
|
for (let index = 0; index < enumValues.length; index++) {
|
|
1056
1139
|
const value = enumValues[index];
|
|
1057
1140
|
const label = enumItemLabels?.[index] ?? String(value);
|
|
1058
1141
|
const isDefault = value === config.schema.default;
|
|
1059
|
-
const displayLabel = isDefault ? ( localize(
|
|
1142
|
+
const displayLabel = isDefault ? ( localize(7575, "{0} (default)", label)) : label;
|
|
1060
1143
|
items.push({
|
|
1061
1144
|
item: {
|
|
1062
1145
|
id: `effort.${value}`,
|
|
@@ -1111,7 +1194,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1111
1194
|
getWidgetRole: () => "menu"
|
|
1112
1195
|
},
|
|
1113
1196
|
{
|
|
1114
|
-
footerText: ( localize(
|
|
1197
|
+
footerText: ( localize(7576, "Higher levels of thinking may increase costs"))
|
|
1115
1198
|
}
|
|
1116
1199
|
);
|
|
1117
1200
|
}
|
|
@@ -1128,13 +1211,13 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1128
1211
|
const enumItemLabels = config.schema.enumItemLabels;
|
|
1129
1212
|
const items = [{
|
|
1130
1213
|
kind: ActionListItemKind.Header,
|
|
1131
|
-
label: ( localize(
|
|
1214
|
+
label: ( localize(7577, "Context Size"))
|
|
1132
1215
|
}];
|
|
1133
1216
|
for (let index = 0; index < enumValues.length; index++) {
|
|
1134
1217
|
const value = enumValues[index];
|
|
1135
1218
|
const label = enumItemLabels?.[index] ?? formatTokenCount(Number(value));
|
|
1136
1219
|
const isDefault = value === config.schema.default;
|
|
1137
|
-
const displayLabel = isDefault ? ( localize(
|
|
1220
|
+
const displayLabel = isDefault ? ( localize(7578, "{0} (default)", label)) : label;
|
|
1138
1221
|
const description = config.schema.enumDescriptions?.[index];
|
|
1139
1222
|
items.push({
|
|
1140
1223
|
item: {
|
|
@@ -1190,12 +1273,12 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
1190
1273
|
getWidgetRole: () => "menu"
|
|
1191
1274
|
},
|
|
1192
1275
|
{
|
|
1193
|
-
footerText: ( localize(
|
|
1276
|
+
footerText: ( localize(7579, "Larger size may increase cost in longer sessions"))
|
|
1194
1277
|
}
|
|
1195
1278
|
);
|
|
1196
1279
|
}
|
|
1197
1280
|
};
|
|
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));
|
|
1281
|
+
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)), ( __param(10, IDefaultAccountService))], ModelPickerWidget));
|
|
1199
1282
|
function getModelHoverContent(model, openerService, isUBB) {
|
|
1200
1283
|
const isAuto = isAutoModel(model);
|
|
1201
1284
|
const container = $(".chat-model-hover");
|
|
@@ -1227,25 +1310,31 @@ function getModelHoverContent(model, openerService, isUBB) {
|
|
|
1227
1310
|
const costLines = [];
|
|
1228
1311
|
if (model.metadata.inputCost !== undefined) {
|
|
1229
1312
|
costLines.push({
|
|
1230
|
-
label: ( localize(
|
|
1231
|
-
value: model.metadata.inputCost === 1 ? ( localize(
|
|
1313
|
+
label: ( localize(7580, "Input")),
|
|
1314
|
+
value: model.metadata.inputCost === 1 ? ( localize(7581, "{0} credit", model.metadata.inputCost)) : ( localize(7582, "{0} credits", model.metadata.inputCost))
|
|
1232
1315
|
});
|
|
1233
1316
|
}
|
|
1234
1317
|
if (model.metadata.cacheCost !== undefined) {
|
|
1235
1318
|
costLines.push({
|
|
1236
|
-
label: ( localize(
|
|
1237
|
-
value: model.metadata.cacheCost === 1 ? ( localize(
|
|
1319
|
+
label: ( localize(7583, "Cached input")),
|
|
1320
|
+
value: model.metadata.cacheCost === 1 ? ( localize(7581, "{0} credit", model.metadata.cacheCost)) : ( localize(7582, "{0} credits", model.metadata.cacheCost))
|
|
1238
1321
|
});
|
|
1239
1322
|
}
|
|
1240
1323
|
if (model.metadata.outputCost !== undefined) {
|
|
1241
1324
|
costLines.push({
|
|
1242
|
-
label: ( localize(
|
|
1243
|
-
value: model.metadata.outputCost === 1 ? ( localize(
|
|
1325
|
+
label: ( localize(7584, "Output")),
|
|
1326
|
+
value: model.metadata.outputCost === 1 ? ( localize(7581, "{0} credit", model.metadata.outputCost)) : ( localize(7582, "{0} credits", model.metadata.outputCost))
|
|
1244
1327
|
});
|
|
1245
1328
|
}
|
|
1329
|
+
const priceCategoryLabel = getPriceCategoryLabel(model.metadata.priceCategory);
|
|
1246
1330
|
if (costLines.length > 0) {
|
|
1247
1331
|
const costSection = $(".chat-model-hover-cost");
|
|
1248
|
-
|
|
1332
|
+
const titleRow = $(".chat-model-hover-cost-title-row");
|
|
1333
|
+
titleRow.appendChild($(".chat-model-hover-cost-title", undefined, ( localize(7585, "Cost (per 1M tokens)"))));
|
|
1334
|
+
if (priceCategoryLabel) {
|
|
1335
|
+
titleRow.appendChild($("span.chat-model-hover-cost-tag", undefined, priceCategoryLabel));
|
|
1336
|
+
}
|
|
1337
|
+
costSection.appendChild(titleRow);
|
|
1249
1338
|
for (const line of costLines) {
|
|
1250
1339
|
costSection.appendChild($(
|
|
1251
1340
|
".chat-model-hover-cost-line",
|
|
@@ -1255,16 +1344,23 @@ function getModelHoverContent(model, openerService, isUBB) {
|
|
|
1255
1344
|
));
|
|
1256
1345
|
}
|
|
1257
1346
|
container.appendChild(costSection);
|
|
1347
|
+
} else if (priceCategoryLabel) {
|
|
1348
|
+
const costSection = $(".chat-model-hover-cost");
|
|
1349
|
+
const titleRow = $(".chat-model-hover-cost-title-row");
|
|
1350
|
+
titleRow.appendChild($(".chat-model-hover-cost-title", undefined, ( localize(7586, "Cost"))));
|
|
1351
|
+
titleRow.appendChild($("span.chat-model-hover-cost-tag", undefined, priceCategoryLabel));
|
|
1352
|
+
costSection.appendChild(titleRow);
|
|
1353
|
+
container.appendChild(costSection);
|
|
1258
1354
|
} else if (model.metadata.pricing && !isMultiplierPricing(model)) {
|
|
1259
1355
|
const costSection = $(".chat-model-hover-cost");
|
|
1260
|
-
costSection.appendChild($("span", undefined, ( localize(
|
|
1356
|
+
costSection.appendChild($("span", undefined, ( localize(7587, "Cost: {0}", model.metadata.pricing))));
|
|
1261
1357
|
container.appendChild(costSection);
|
|
1262
1358
|
}
|
|
1263
1359
|
}
|
|
1264
1360
|
if (!isAuto && (model.metadata.maxInputTokens || model.metadata.maxOutputTokens)) {
|
|
1265
1361
|
const totalTokens = (model.metadata.maxInputTokens ?? 0) + (model.metadata.maxOutputTokens ?? 0);
|
|
1266
1362
|
const contextSection = $(".chat-model-hover-context");
|
|
1267
|
-
contextSection.appendChild($(".chat-model-hover-context-label", undefined, ( localize(
|
|
1363
|
+
contextSection.appendChild($(".chat-model-hover-context-label", undefined, ( localize(7588, "Max context"))));
|
|
1268
1364
|
contextSection.appendChild($(
|
|
1269
1365
|
".chat-model-hover-context-value",
|
|
1270
1366
|
undefined,
|
|
@@ -1286,7 +1382,7 @@ function getModelHoverContent(model, openerService, isUBB) {
|
|
|
1286
1382
|
container.appendChild($(".chat-model-hover-separator"));
|
|
1287
1383
|
const configRow = $(".chat-model-hover-configurable");
|
|
1288
1384
|
configRow.appendChild(
|
|
1289
|
-
$("span.chat-model-hover-configurable-label", undefined, ( localize(
|
|
1385
|
+
$("span.chat-model-hover-configurable-label", undefined, ( localize(7589, "Configurable:")))
|
|
1290
1386
|
);
|
|
1291
1387
|
for (const label of configurableLabels) {
|
|
1292
1388
|
configRow.appendChild($("span.chat-model-hover-configurable-tag", undefined, label));
|