@codingame/monaco-vscode-katex-common 28.4.0 → 29.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/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +2 -2
- 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.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +158 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +22 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +121 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +29 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +349 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +104 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +21 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +29 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +261 -282
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +184 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +4 -2
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +4 -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.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +42 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +14 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +11 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +25 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +332 -114
- 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.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +10 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +66 -7
- 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 +28 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +272 -107
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.js +70 -0
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +6 -3
- 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/chatConfirmationWidget.css +151 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +96 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +86 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +5 -2
- 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/chatInputOutputMarkdownProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +8 -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/chatModifiedFilesConfirmationSubPart.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +273 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +28 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +81 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +20 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +11 -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.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +21 -7
- 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 +2 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +112 -163
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +137 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +108 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +385 -247
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +23 -23
- 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 +124 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +84 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +4 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +38 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +31 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +12 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +130 -23
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +41 -0
- 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/inlineChatOverlayWidget.css +55 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +50 -39
- 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/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +0 -440
|
@@ -10,18 +10,21 @@ import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyC
|
|
|
10
10
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
11
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
12
12
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
13
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
13
14
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
15
|
import { ActionListItemKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionList';
|
|
15
16
|
import { IActionWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service';
|
|
16
17
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
18
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
17
19
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
18
20
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
19
21
|
import { TelemetryTrustedValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
20
22
|
import { MANAGE_CHAT_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
21
23
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
22
|
-
import {
|
|
24
|
+
import { ChatEntitlement, isProUser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService';
|
|
23
25
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
24
26
|
import { semverExports } from '@codingame/monaco-vscode-api/_virtual/semver';
|
|
27
|
+
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
25
28
|
import { StateType } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update';
|
|
26
29
|
import { IUpdateService } from '@codingame/monaco-vscode-api/vscode/vs/platform/update/common/update.service';
|
|
27
30
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
@@ -41,20 +44,20 @@ function getUpdateHoverContent(updateState) {
|
|
|
41
44
|
switch (updateState) {
|
|
42
45
|
case StateType.AvailableForDownload:
|
|
43
46
|
hoverContent.appendMarkdown(( localize(
|
|
44
|
-
|
|
47
|
+
6990,
|
|
45
48
|
"This model requires a newer version of VS Code. [Download Update](command:update.downloadUpdate) to access it."
|
|
46
49
|
)));
|
|
47
50
|
break;
|
|
48
51
|
case StateType.Downloaded:
|
|
49
52
|
case StateType.Ready:
|
|
50
53
|
hoverContent.appendMarkdown(( localize(
|
|
51
|
-
|
|
54
|
+
6991,
|
|
52
55
|
"This model requires a newer version of VS Code. [Restart to Update](command:update.restartToUpdate) to access it."
|
|
53
56
|
)));
|
|
54
57
|
break;
|
|
55
58
|
default:
|
|
56
59
|
hoverContent.appendMarkdown(( localize(
|
|
57
|
-
|
|
60
|
+
6992,
|
|
58
61
|
"This model requires a newer version of VS Code. [Update VS Code](command:update.checkForUpdate) to access it."
|
|
59
62
|
)));
|
|
60
63
|
break;
|
|
@@ -64,7 +67,7 @@ function getUpdateHoverContent(updateState) {
|
|
|
64
67
|
const ModelPickerSection = {
|
|
65
68
|
Other: "other"
|
|
66
69
|
};
|
|
67
|
-
function createModelItem(action, model) {
|
|
70
|
+
function createModelItem(action, model, hoverPosition, languageModelsService) {
|
|
68
71
|
return {
|
|
69
72
|
item: action,
|
|
70
73
|
kind: ActionListItemKind.Action,
|
|
@@ -77,24 +80,69 @@ function createModelItem(action, model) {
|
|
|
77
80
|
hideIcon: false,
|
|
78
81
|
section: action.section,
|
|
79
82
|
hover: model ? {
|
|
80
|
-
content: getModelHoverContent(model)
|
|
81
|
-
|
|
83
|
+
content: getModelHoverContent(model, languageModelsService),
|
|
84
|
+
position: hoverPosition
|
|
85
|
+
} : undefined,
|
|
86
|
+
submenuActions: action.toolbarActions
|
|
82
87
|
};
|
|
83
88
|
}
|
|
84
|
-
function
|
|
89
|
+
function getModelConfigurationDescription(model, languageModelsService) {
|
|
90
|
+
const schema = model.metadata.configurationSchema;
|
|
91
|
+
if (!schema?.properties) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
const currentConfig = languageModelsService.getModelConfiguration(model.identifier) ?? {};
|
|
95
|
+
const parts = [];
|
|
96
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
97
|
+
if (propSchema.group !== "navigation") {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const value = currentConfig[key] ?? propSchema.default;
|
|
101
|
+
if (value === undefined) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
const enumItemLabels = propSchema.enumItemLabels;
|
|
105
|
+
const enumIndex = propSchema.enum?.indexOf(value) ?? -1;
|
|
106
|
+
const label = enumItemLabels?.[enumIndex] ?? String(value);
|
|
107
|
+
parts.push(label);
|
|
108
|
+
}
|
|
109
|
+
return parts.length > 0 ? parts.join(", ") : undefined;
|
|
110
|
+
}
|
|
111
|
+
function createModelAction(model, selectedModelId, onSelect, languageModelsService, section) {
|
|
112
|
+
const toolbarActions = languageModelsService.getModelConfigurationActions(model.identifier);
|
|
113
|
+
const configDescription = getModelConfigurationDescription(model, languageModelsService);
|
|
114
|
+
const baseDescription = model.metadata.multiplier ?? model.metadata.detail;
|
|
115
|
+
const description = configDescription && baseDescription ? `${configDescription} · ${baseDescription}` : configDescription ?? baseDescription;
|
|
85
116
|
return {
|
|
86
117
|
id: model.identifier,
|
|
87
118
|
enabled: true,
|
|
88
119
|
icon: model.metadata.statusIcon,
|
|
89
120
|
checked: model.identifier === selectedModelId,
|
|
90
121
|
class: undefined,
|
|
91
|
-
description
|
|
122
|
+
description,
|
|
92
123
|
tooltip: model.metadata.name,
|
|
93
124
|
label: model.metadata.name,
|
|
94
125
|
section,
|
|
126
|
+
toolbarActions: toolbarActions && toolbarActions.length > 0 ? toolbarActions : undefined,
|
|
95
127
|
run: () => onSelect(model)
|
|
96
128
|
};
|
|
97
129
|
}
|
|
130
|
+
function shouldShowManageModelsAction(chatEntitlementService) {
|
|
131
|
+
return chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal;
|
|
132
|
+
}
|
|
133
|
+
function createManageModelsAction(commandService) {
|
|
134
|
+
return {
|
|
135
|
+
id: "manageModels",
|
|
136
|
+
enabled: true,
|
|
137
|
+
checked: false,
|
|
138
|
+
class: ThemeIcon.asClassName(Codicon.gear),
|
|
139
|
+
tooltip: ( localize(6993, "Manage Language Models")),
|
|
140
|
+
label: ( localize(6994, "Manage Models...")),
|
|
141
|
+
run: () => {
|
|
142
|
+
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
98
146
|
function buildModelPickerItems(
|
|
99
147
|
models,
|
|
100
148
|
selectedModelId,
|
|
@@ -104,9 +152,13 @@ function buildModelPickerItems(
|
|
|
104
152
|
updateStateType,
|
|
105
153
|
onSelect,
|
|
106
154
|
manageSettingsUrl,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
chatEntitlementService
|
|
155
|
+
useGroupedModelPicker,
|
|
156
|
+
manageModelsAction,
|
|
157
|
+
chatEntitlementService,
|
|
158
|
+
showUnavailableFeatured,
|
|
159
|
+
showFeatured,
|
|
160
|
+
hoverPosition,
|
|
161
|
+
languageModelsService
|
|
110
162
|
) {
|
|
111
163
|
const items = [];
|
|
112
164
|
if (models.length === 0) {
|
|
@@ -115,249 +167,268 @@ function buildModelPickerItems(
|
|
|
115
167
|
enabled: true,
|
|
116
168
|
checked: true,
|
|
117
169
|
class: undefined,
|
|
118
|
-
tooltip: ( localize(
|
|
119
|
-
label: ( localize(
|
|
170
|
+
tooltip: ( localize(6995, "Auto")),
|
|
171
|
+
label: ( localize(6995, "Auto")),
|
|
120
172
|
run: () => {}
|
|
121
173
|
}));
|
|
122
174
|
}
|
|
123
|
-
if (
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
132
|
-
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
133
|
-
});
|
|
134
|
-
for (const model of sortedModels) {
|
|
135
|
-
items.push(
|
|
136
|
-
createModelItem(createModelAction(model, selectedModelId, onSelect), model)
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
return items;
|
|
140
|
-
}
|
|
141
|
-
const isPro = isProUser(chatEntitlementService.entitlement);
|
|
142
|
-
let otherModels = [];
|
|
143
|
-
if (models.length) {
|
|
144
|
-
const allModelsMap = ( new Map());
|
|
145
|
-
const modelsByMetadataId = ( new Map());
|
|
146
|
-
for (const model of models) {
|
|
147
|
-
allModelsMap.set(model.identifier, model);
|
|
148
|
-
modelsByMetadataId.set(model.metadata.id, model);
|
|
149
|
-
}
|
|
150
|
-
const placed = ( new Set());
|
|
151
|
-
const markPlaced = (identifierOrId, metadataId) => {
|
|
152
|
-
placed.add(identifierOrId);
|
|
153
|
-
if (metadataId) {
|
|
154
|
-
placed.add(metadataId);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
const resolveModel = id => allModelsMap.get(id) ?? modelsByMetadataId.get(id);
|
|
158
|
-
const getUnavailableReason = entry => {
|
|
159
|
-
if (!isPro) {
|
|
160
|
-
return "upgrade";
|
|
161
|
-
}
|
|
162
|
-
if (entry.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
163
|
-
return "update";
|
|
164
|
-
}
|
|
165
|
-
return "admin";
|
|
166
|
-
};
|
|
167
|
-
const autoModel = models.find(m => m.metadata.id === "auto" && m.metadata.vendor === "copilot");
|
|
168
|
-
if (autoModel) {
|
|
169
|
-
markPlaced(autoModel.identifier, autoModel.metadata.id);
|
|
170
|
-
items.push(
|
|
171
|
-
createModelItem(createModelAction(autoModel, selectedModelId, onSelect), autoModel)
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
const promotedItems = [];
|
|
175
|
-
const tryPlaceModel = id => {
|
|
176
|
-
if (( placed.has(id))) {
|
|
177
|
-
return false;
|
|
175
|
+
if (useGroupedModelPicker) {
|
|
176
|
+
let otherModels = [];
|
|
177
|
+
if (models.length) {
|
|
178
|
+
const allModelsMap = ( new Map());
|
|
179
|
+
const modelsByMetadataId = ( new Map());
|
|
180
|
+
for (const model of models) {
|
|
181
|
+
allModelsMap.set(model.identifier, model);
|
|
182
|
+
modelsByMetadataId.set(model.metadata.id, model);
|
|
178
183
|
}
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
});
|
|
184
|
+
const placed = ( new Set());
|
|
185
|
+
const markPlaced = (identifierOrId, metadataId) => {
|
|
186
|
+
placed.add(identifierOrId);
|
|
187
|
+
if (metadataId) {
|
|
188
|
+
placed.add(metadataId);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const resolveModel = id => allModelsMap.get(id) ?? modelsByMetadataId.get(id);
|
|
192
|
+
const getUnavailableReason = entry => {
|
|
193
|
+
const isBusinessOrEnterpriseUser = chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise;
|
|
194
|
+
if (!isBusinessOrEnterpriseUser) {
|
|
195
|
+
return "upgrade";
|
|
196
|
+
}
|
|
197
|
+
if (entry.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
198
|
+
return "update";
|
|
195
199
|
}
|
|
196
|
-
return
|
|
200
|
+
return "admin";
|
|
201
|
+
};
|
|
202
|
+
const autoModel = models.find(m => m.metadata.id === "auto" && m.metadata.vendor === "copilot");
|
|
203
|
+
if (autoModel) {
|
|
204
|
+
markPlaced(autoModel.identifier, autoModel.metadata.id);
|
|
205
|
+
items.push(createModelItem(
|
|
206
|
+
createModelAction(autoModel, selectedModelId, onSelect, languageModelsService),
|
|
207
|
+
autoModel,
|
|
208
|
+
hoverPosition,
|
|
209
|
+
languageModelsService
|
|
210
|
+
));
|
|
197
211
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
212
|
+
const promotedItems = [];
|
|
213
|
+
const tryPlaceModel = id => {
|
|
214
|
+
if (( placed.has(id))) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
const model = resolveModel(id);
|
|
218
|
+
if (model && !( placed.has(model.identifier))) {
|
|
219
|
+
markPlaced(model.identifier, model.metadata.id);
|
|
220
|
+
const entry = controlModels[model.metadata.id];
|
|
221
|
+
if (entry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
222
|
+
promotedItems.push({
|
|
223
|
+
kind: "unavailable",
|
|
224
|
+
id: model.metadata.id,
|
|
225
|
+
entry,
|
|
226
|
+
reason: "update"
|
|
227
|
+
});
|
|
228
|
+
} else {
|
|
229
|
+
promotedItems.push({
|
|
230
|
+
kind: "available",
|
|
231
|
+
model
|
|
232
|
+
});
|
|
233
|
+
}
|
|
208
234
|
return true;
|
|
209
235
|
}
|
|
236
|
+
if (!model) {
|
|
237
|
+
const entry = controlModels[id];
|
|
238
|
+
if (entry && !entry.exists) {
|
|
239
|
+
markPlaced(id);
|
|
240
|
+
promotedItems.push({
|
|
241
|
+
kind: "unavailable",
|
|
242
|
+
id,
|
|
243
|
+
entry,
|
|
244
|
+
reason: getUnavailableReason(entry)
|
|
245
|
+
});
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return false;
|
|
250
|
+
};
|
|
251
|
+
if (selectedModelId && selectedModelId !== autoModel?.identifier) {
|
|
252
|
+
tryPlaceModel(selectedModelId);
|
|
210
253
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (selectedModelId && selectedModelId !== autoModel?.identifier) {
|
|
214
|
-
tryPlaceModel(selectedModelId);
|
|
215
|
-
}
|
|
216
|
-
for (const id of recentModelIds) {
|
|
217
|
-
tryPlaceModel(id);
|
|
218
|
-
}
|
|
219
|
-
for (const [entryId, entry] of Object.entries(controlModels)) {
|
|
220
|
-
if (!entry.featured || ( placed.has(entryId))) {
|
|
221
|
-
continue;
|
|
254
|
+
for (const id of recentModelIds) {
|
|
255
|
+
tryPlaceModel(id);
|
|
222
256
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
entry,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
257
|
+
if (showFeatured) {
|
|
258
|
+
for (const [entryId, entry] of Object.entries(controlModels)) {
|
|
259
|
+
if (!entry.featured || ( placed.has(entryId))) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
const model = resolveModel(entryId);
|
|
263
|
+
if (model && !( placed.has(model.identifier))) {
|
|
264
|
+
if (entry.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
265
|
+
if (showUnavailableFeatured) {
|
|
266
|
+
markPlaced(model.identifier, model.metadata.id);
|
|
267
|
+
promotedItems.push({
|
|
268
|
+
kind: "unavailable",
|
|
269
|
+
id: entryId,
|
|
270
|
+
entry,
|
|
271
|
+
reason: "update"
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
markPlaced(model.identifier, model.metadata.id);
|
|
276
|
+
promotedItems.push({
|
|
277
|
+
kind: "available",
|
|
278
|
+
model
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
} else if (!model && !entry.exists) {
|
|
282
|
+
if (showUnavailableFeatured) {
|
|
283
|
+
markPlaced(entryId);
|
|
284
|
+
promotedItems.push({
|
|
285
|
+
kind: "unavailable",
|
|
286
|
+
id: entryId,
|
|
287
|
+
entry,
|
|
288
|
+
reason: getUnavailableReason(entry)
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
238
292
|
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
promotedItems.
|
|
242
|
-
kind
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
293
|
+
}
|
|
294
|
+
if (promotedItems.length > 0) {
|
|
295
|
+
promotedItems.sort((a, b) => {
|
|
296
|
+
const aAvail = a.kind === "available" ? 0 : 1;
|
|
297
|
+
const bAvail = b.kind === "available" ? 0 : 1;
|
|
298
|
+
if (aAvail !== bAvail) {
|
|
299
|
+
return aAvail - bAvail;
|
|
300
|
+
}
|
|
301
|
+
const aName = a.kind === "available" ? a.model.metadata.name : a.entry.label;
|
|
302
|
+
const bName = b.kind === "available" ? b.model.metadata.name : b.entry.label;
|
|
303
|
+
return aName.localeCompare(bName);
|
|
246
304
|
});
|
|
305
|
+
for (const item of promotedItems) {
|
|
306
|
+
if (item.kind === "available") {
|
|
307
|
+
items.push(createModelItem(
|
|
308
|
+
createModelAction(item.model, selectedModelId, onSelect, languageModelsService),
|
|
309
|
+
item.model,
|
|
310
|
+
hoverPosition,
|
|
311
|
+
languageModelsService
|
|
312
|
+
));
|
|
313
|
+
} else {
|
|
314
|
+
items.push(createUnavailableModelItem(
|
|
315
|
+
item.id,
|
|
316
|
+
item.entry,
|
|
317
|
+
item.reason,
|
|
318
|
+
manageSettingsUrl,
|
|
319
|
+
updateStateType,
|
|
320
|
+
undefined,
|
|
321
|
+
hoverPosition
|
|
322
|
+
));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
247
325
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
const aAvail =
|
|
252
|
-
const bAvail =
|
|
326
|
+
otherModels = models.filter(m => !( placed.has(m.identifier)) && !( placed.has(m.metadata.id))).sort((a, b) => {
|
|
327
|
+
const aEntry = controlModels[a.metadata.id] ?? controlModels[a.identifier];
|
|
328
|
+
const bEntry = controlModels[b.metadata.id] ?? controlModels[b.identifier];
|
|
329
|
+
const aAvail = aEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, aEntry.minVSCodeVersion) ? 1 : 0;
|
|
330
|
+
const bAvail = bEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, bEntry.minVSCodeVersion) ? 1 : 0;
|
|
253
331
|
if (aAvail !== bAvail) {
|
|
254
332
|
return aAvail - bAvail;
|
|
255
333
|
}
|
|
256
|
-
const
|
|
257
|
-
const
|
|
258
|
-
|
|
334
|
+
const aCopilot = a.metadata.vendor === "copilot" ? 0 : 1;
|
|
335
|
+
const bCopilot = b.metadata.vendor === "copilot" ? 0 : 1;
|
|
336
|
+
if (aCopilot !== bCopilot) {
|
|
337
|
+
return aCopilot - bCopilot;
|
|
338
|
+
}
|
|
339
|
+
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
340
|
+
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
259
341
|
});
|
|
260
|
-
|
|
261
|
-
if (
|
|
262
|
-
items.push(
|
|
263
|
-
|
|
264
|
-
);
|
|
265
|
-
} else {
|
|
266
|
-
items.push(
|
|
267
|
-
createUnavailableModelItem(item.id, item.entry, item.reason, manageSettingsUrl, updateStateType)
|
|
268
|
-
);
|
|
342
|
+
if (otherModels.length > 0) {
|
|
343
|
+
if (items.length > 0) {
|
|
344
|
+
items.push({
|
|
345
|
+
kind: ActionListItemKind.Separator
|
|
346
|
+
});
|
|
269
347
|
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
otherModels = models.filter(m => !( placed.has(m.identifier)) && !( placed.has(m.metadata.id))).sort((a, b) => {
|
|
273
|
-
const aEntry = controlModels[a.metadata.id] ?? controlModels[a.identifier];
|
|
274
|
-
const bEntry = controlModels[b.metadata.id] ?? controlModels[b.identifier];
|
|
275
|
-
const aAvail = aEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, aEntry.minVSCodeVersion) ? 1 : 0;
|
|
276
|
-
const bAvail = bEntry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, bEntry.minVSCodeVersion) ? 1 : 0;
|
|
277
|
-
if (aAvail !== bAvail) {
|
|
278
|
-
return aAvail - bAvail;
|
|
279
|
-
}
|
|
280
|
-
const aCopilot = a.metadata.vendor === "copilot" ? 0 : 1;
|
|
281
|
-
const bCopilot = b.metadata.vendor === "copilot" ? 0 : 1;
|
|
282
|
-
if (aCopilot !== bCopilot) {
|
|
283
|
-
return aCopilot - bCopilot;
|
|
284
|
-
}
|
|
285
|
-
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
286
|
-
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
287
|
-
});
|
|
288
|
-
if (otherModels.length > 0) {
|
|
289
|
-
if (items.length > 0) {
|
|
290
348
|
items.push({
|
|
291
|
-
|
|
349
|
+
item: {
|
|
350
|
+
id: "otherModels",
|
|
351
|
+
enabled: true,
|
|
352
|
+
checked: false,
|
|
353
|
+
class: undefined,
|
|
354
|
+
tooltip: ( localize(6996, "Other Models")),
|
|
355
|
+
label: ( localize(6996, "Other Models")),
|
|
356
|
+
run: () => {}
|
|
357
|
+
},
|
|
358
|
+
kind: ActionListItemKind.Action,
|
|
359
|
+
label: ( localize(6996, "Other Models")),
|
|
360
|
+
group: {
|
|
361
|
+
title: "",
|
|
362
|
+
icon: Codicon.chevronDown
|
|
363
|
+
},
|
|
364
|
+
hideIcon: false,
|
|
365
|
+
section: ModelPickerSection.Other,
|
|
366
|
+
isSectionToggle: true
|
|
292
367
|
});
|
|
368
|
+
for (const model of otherModels) {
|
|
369
|
+
const entry = controlModels[model.metadata.id] ?? controlModels[model.identifier];
|
|
370
|
+
if (entry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
371
|
+
items.push(createUnavailableModelItem(
|
|
372
|
+
model.metadata.id,
|
|
373
|
+
entry,
|
|
374
|
+
"update",
|
|
375
|
+
manageSettingsUrl,
|
|
376
|
+
updateStateType,
|
|
377
|
+
ModelPickerSection.Other,
|
|
378
|
+
hoverPosition
|
|
379
|
+
));
|
|
380
|
+
} else {
|
|
381
|
+
items.push(createModelItem(createModelAction(
|
|
382
|
+
model,
|
|
383
|
+
selectedModelId,
|
|
384
|
+
onSelect,
|
|
385
|
+
languageModelsService,
|
|
386
|
+
ModelPickerSection.Other
|
|
387
|
+
), model, hoverPosition, languageModelsService));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
293
390
|
}
|
|
391
|
+
}
|
|
392
|
+
if (manageModelsAction) {
|
|
294
393
|
items.push({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
tooltip: ( localize(6792, "Other Models")),
|
|
301
|
-
label: ( localize(6792, "Other Models")),
|
|
302
|
-
run: () => {}
|
|
303
|
-
},
|
|
394
|
+
kind: ActionListItemKind.Separator,
|
|
395
|
+
section: otherModels.length ? ModelPickerSection.Other : undefined
|
|
396
|
+
});
|
|
397
|
+
items.push({
|
|
398
|
+
item: manageModelsAction,
|
|
304
399
|
kind: ActionListItemKind.Action,
|
|
305
|
-
label:
|
|
400
|
+
label: manageModelsAction.label,
|
|
306
401
|
group: {
|
|
307
402
|
title: "",
|
|
308
|
-
icon: Codicon.
|
|
403
|
+
icon: Codicon.blank
|
|
309
404
|
},
|
|
310
405
|
hideIcon: false,
|
|
311
|
-
section: ModelPickerSection.Other,
|
|
312
|
-
|
|
406
|
+
section: otherModels.length ? ModelPickerSection.Other : undefined,
|
|
407
|
+
showAlways: true
|
|
313
408
|
});
|
|
314
|
-
for (const model of otherModels) {
|
|
315
|
-
const entry = controlModels[model.metadata.id] ?? controlModels[model.identifier];
|
|
316
|
-
if (entry?.minVSCodeVersion && !isVersionAtLeast(currentVSCodeVersion, entry.minVSCodeVersion)) {
|
|
317
|
-
items.push(createUnavailableModelItem(
|
|
318
|
-
model.metadata.id,
|
|
319
|
-
entry,
|
|
320
|
-
"update",
|
|
321
|
-
manageSettingsUrl,
|
|
322
|
-
updateStateType,
|
|
323
|
-
ModelPickerSection.Other
|
|
324
|
-
));
|
|
325
|
-
} else {
|
|
326
|
-
items.push(createModelItem(
|
|
327
|
-
createModelAction(model, selectedModelId, onSelect, ModelPickerSection.Other),
|
|
328
|
-
model
|
|
329
|
-
));
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
409
|
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
label: ( localize(6794, "Manage Models...")),
|
|
347
|
-
run: () => {
|
|
348
|
-
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
kind: ActionListItemKind.Action,
|
|
352
|
-
label: ( localize(6794, "Manage Models...")),
|
|
353
|
-
group: {
|
|
354
|
-
title: "",
|
|
355
|
-
icon: Codicon.blank
|
|
356
|
-
},
|
|
357
|
-
hideIcon: false,
|
|
358
|
-
section: otherModels.length ? ModelPickerSection.Other : undefined,
|
|
359
|
-
showAlways: true
|
|
410
|
+
} else {
|
|
411
|
+
const autoModel = models.find(m => m.metadata.id === "auto" && m.metadata.vendor === "copilot");
|
|
412
|
+
if (autoModel) {
|
|
413
|
+
items.push(createModelItem(
|
|
414
|
+
createModelAction(autoModel, selectedModelId, onSelect, languageModelsService),
|
|
415
|
+
autoModel,
|
|
416
|
+
hoverPosition,
|
|
417
|
+
languageModelsService
|
|
418
|
+
));
|
|
419
|
+
}
|
|
420
|
+
const sortedModels = models.filter(m => m !== autoModel).sort((a, b) => {
|
|
421
|
+
const vendorCmp = a.metadata.vendor.localeCompare(b.metadata.vendor);
|
|
422
|
+
return vendorCmp !== 0 ? vendorCmp : a.metadata.name.localeCompare(b.metadata.name);
|
|
360
423
|
});
|
|
424
|
+
for (const model of sortedModels) {
|
|
425
|
+
items.push(createModelItem(
|
|
426
|
+
createModelAction(model, selectedModelId, onSelect, languageModelsService),
|
|
427
|
+
model,
|
|
428
|
+
hoverPosition,
|
|
429
|
+
languageModelsService
|
|
430
|
+
));
|
|
431
|
+
}
|
|
361
432
|
}
|
|
362
433
|
return items;
|
|
363
434
|
}
|
|
@@ -379,18 +450,26 @@ function getModelPickerAccessibilityProvider() {
|
|
|
379
450
|
getWidgetRole: () => "menu"
|
|
380
451
|
};
|
|
381
452
|
}
|
|
382
|
-
function createUnavailableModelItem(
|
|
453
|
+
function createUnavailableModelItem(
|
|
454
|
+
id,
|
|
455
|
+
entry,
|
|
456
|
+
reason,
|
|
457
|
+
manageSettingsUrl,
|
|
458
|
+
updateStateType,
|
|
459
|
+
section,
|
|
460
|
+
hoverPosition
|
|
461
|
+
) {
|
|
383
462
|
let description;
|
|
384
463
|
if (reason === "upgrade") {
|
|
385
|
-
description = ( new MarkdownString(( localize(
|
|
464
|
+
description = ( new MarkdownString(( localize(6997, "[Upgrade](command:workbench.action.chat.upgradePlan \" \")")), {
|
|
386
465
|
isTrusted: true
|
|
387
466
|
}));
|
|
388
467
|
} else if (reason === "update") {
|
|
389
|
-
description = ( localize(
|
|
468
|
+
description = ( localize(6998, "Update VS Code"));
|
|
390
469
|
} else {
|
|
391
|
-
description = manageSettingsUrl ? ( new MarkdownString(( localize(
|
|
470
|
+
description = manageSettingsUrl ? ( new MarkdownString(( localize(6999, "[Contact your admin]({0})", manageSettingsUrl)), {
|
|
392
471
|
isTrusted: true
|
|
393
|
-
})) : ( localize(
|
|
472
|
+
})) : ( localize(7000, "Contact your admin"));
|
|
394
473
|
}
|
|
395
474
|
let hoverContent;
|
|
396
475
|
if (reason === "upgrade") {
|
|
@@ -399,7 +478,7 @@ function createUnavailableModelItem(id, entry, reason, manageSettingsUrl, update
|
|
|
399
478
|
supportThemeIcons: true
|
|
400
479
|
}));
|
|
401
480
|
hoverContent.appendMarkdown(( localize(
|
|
402
|
-
|
|
481
|
+
7001,
|
|
403
482
|
"[Upgrade to GitHub Copilot Pro](command:workbench.action.chat.upgradePlan \" \") with a free 30-day trial to use the best models."
|
|
404
483
|
)));
|
|
405
484
|
} else if (reason === "update") {
|
|
@@ -410,7 +489,7 @@ function createUnavailableModelItem(id, entry, reason, manageSettingsUrl, update
|
|
|
410
489
|
supportThemeIcons: true
|
|
411
490
|
}));
|
|
412
491
|
hoverContent.appendMarkdown(( localize(
|
|
413
|
-
|
|
492
|
+
7002,
|
|
414
493
|
"This model is not available. Contact your administrator to enable it."
|
|
415
494
|
)));
|
|
416
495
|
}
|
|
@@ -437,7 +516,8 @@ function createUnavailableModelItem(id, entry, reason, manageSettingsUrl, update
|
|
|
437
516
|
className: "chat-model-picker-unavailable",
|
|
438
517
|
section,
|
|
439
518
|
hover: {
|
|
440
|
-
content: hoverContent
|
|
519
|
+
content: hoverContent,
|
|
520
|
+
position: hoverPosition
|
|
441
521
|
}
|
|
442
522
|
};
|
|
443
523
|
}
|
|
@@ -450,25 +530,34 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
450
530
|
}
|
|
451
531
|
constructor(
|
|
452
532
|
_delegate,
|
|
533
|
+
_hoverPosition,
|
|
453
534
|
_actionWidgetService,
|
|
454
535
|
_commandService,
|
|
536
|
+
_openerService,
|
|
455
537
|
_telemetryService,
|
|
456
538
|
_languageModelsService,
|
|
457
539
|
_productService,
|
|
458
540
|
_entitlementService,
|
|
459
|
-
_updateService
|
|
541
|
+
_updateService,
|
|
542
|
+
_uriIdentityService
|
|
460
543
|
) {
|
|
461
544
|
super();
|
|
462
545
|
this._delegate = _delegate;
|
|
546
|
+
this._hoverPosition = _hoverPosition;
|
|
463
547
|
this._actionWidgetService = _actionWidgetService;
|
|
464
548
|
this._commandService = _commandService;
|
|
549
|
+
this._openerService = _openerService;
|
|
465
550
|
this._telemetryService = _telemetryService;
|
|
466
551
|
this._languageModelsService = _languageModelsService;
|
|
467
552
|
this._productService = _productService;
|
|
468
553
|
this._entitlementService = _entitlementService;
|
|
469
554
|
this._updateService = _updateService;
|
|
555
|
+
this._uriIdentityService = _uriIdentityService;
|
|
470
556
|
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
471
557
|
this.onDidChangeSelection = this._onDidChangeSelection.event;
|
|
558
|
+
this._register(this._languageModelsService.onDidChangeLanguageModels(() => {
|
|
559
|
+
this._renderLabel();
|
|
560
|
+
}));
|
|
472
561
|
}
|
|
473
562
|
setHideChevrons(hideChevrons) {
|
|
474
563
|
this._hideChevrons = hideChevrons;
|
|
@@ -531,9 +620,18 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
531
620
|
this._onDidChangeSelection.fire(model);
|
|
532
621
|
};
|
|
533
622
|
const models = this._delegate.getModels();
|
|
623
|
+
const showFilter = models.length >= 10;
|
|
534
624
|
const isPro = isProUser(this._entitlementService.entitlement);
|
|
535
625
|
const manifest = this._languageModelsService.getModelsControlManifest();
|
|
536
626
|
const controlModelsForTier = isPro ? manifest.paid : manifest.free;
|
|
627
|
+
const canShowManageModelsAction = this._delegate.showManageModelsAction() && shouldShowManageModelsAction(this._entitlementService);
|
|
628
|
+
const manageModelsAction = canShowManageModelsAction ? createManageModelsAction(this._commandService) : undefined;
|
|
629
|
+
const logModelPickerInteraction = interaction => {
|
|
630
|
+
this._telemetryService.publicLog2("chat.modelPickerInteraction", {
|
|
631
|
+
interaction
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
const manageSettingsUrl = this._productService.defaultChatAgent?.manageSettingsUrl;
|
|
537
635
|
const items = buildModelPickerItems(
|
|
538
636
|
models,
|
|
539
637
|
this._selectedModel?.identifier,
|
|
@@ -542,16 +640,36 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
542
640
|
this._productService.version,
|
|
543
641
|
this._updateService.state.type,
|
|
544
642
|
onSelect,
|
|
545
|
-
|
|
546
|
-
this._delegate.
|
|
547
|
-
|
|
548
|
-
this._entitlementService
|
|
643
|
+
manageSettingsUrl,
|
|
644
|
+
this._delegate.useGroupedModelPicker(),
|
|
645
|
+
!showFilter ? manageModelsAction : undefined,
|
|
646
|
+
this._entitlementService,
|
|
647
|
+
this._delegate.showUnavailableFeatured(),
|
|
648
|
+
this._delegate.showFeatured(),
|
|
649
|
+
this._hoverPosition,
|
|
650
|
+
this._languageModelsService
|
|
549
651
|
);
|
|
550
652
|
const listOptions = {
|
|
551
|
-
showFilter
|
|
552
|
-
filterPlaceholder: ( localize(
|
|
653
|
+
showFilter,
|
|
654
|
+
filterPlaceholder: ( localize(7003, "Search models")),
|
|
655
|
+
filterActions: showFilter && manageModelsAction ? [manageModelsAction] : undefined,
|
|
553
656
|
focusFilterOnOpen: true,
|
|
554
657
|
collapsedByDefault: ( new Set([ModelPickerSection.Other])),
|
|
658
|
+
onDidToggleSection: (section, collapsed) => {
|
|
659
|
+
if (section === ModelPickerSection.Other) {
|
|
660
|
+
logModelPickerInteraction(collapsed ? "otherModelsCollapsed" : "otherModelsExpanded");
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
linkHandler: uri => {
|
|
664
|
+
if (uri.scheme === "command" && uri.path === "workbench.action.chat.upgradePlan") {
|
|
665
|
+
logModelPickerInteraction("premiumModelUpgradePlanClicked");
|
|
666
|
+
} else if (manageSettingsUrl && this._uriIdentityService.extUri.isEqual(uri, ( URI.parse(manageSettingsUrl)))) {
|
|
667
|
+
logModelPickerInteraction("disabledModelContactAdminClicked");
|
|
668
|
+
}
|
|
669
|
+
void this._openerService.open(uri, {
|
|
670
|
+
allowCommands: true
|
|
671
|
+
});
|
|
672
|
+
},
|
|
555
673
|
minWidth: 200
|
|
556
674
|
};
|
|
557
675
|
const previouslyFocusedElement = getActiveElement();
|
|
@@ -610,18 +728,20 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
610
728
|
const iconElement = renderIcon(statusIcon);
|
|
611
729
|
domChildren.push(iconElement);
|
|
612
730
|
}
|
|
613
|
-
|
|
731
|
+
const modelLabel = name ?? ( localize(6995, "Auto"));
|
|
732
|
+
const configDescription = this._selectedModel ? getModelConfigurationDescription(this._selectedModel, this._languageModelsService) : undefined;
|
|
733
|
+
const fullLabel = configDescription ? `${modelLabel} · ${configDescription}` : modelLabel;
|
|
734
|
+
domChildren.push($("span.chat-input-picker-label", undefined, fullLabel));
|
|
614
735
|
if (this._badgeIcon) {
|
|
615
736
|
domChildren.push(this._badgeIcon);
|
|
616
737
|
}
|
|
617
738
|
domChildren.push(...renderLabelWithIcons(`$(chevron-down)`));
|
|
618
739
|
reset(this._domNode, ...domChildren);
|
|
619
|
-
|
|
620
|
-
this._domNode.ariaLabel = ( localize(6802, "Pick Model, {0}", modelName));
|
|
740
|
+
this._domNode.ariaLabel = ( localize(7004, "Pick Model, {0}", fullLabel));
|
|
621
741
|
}
|
|
622
742
|
};
|
|
623
|
-
ModelPickerWidget = ( __decorate([( __param(
|
|
624
|
-
function getModelHoverContent(model) {
|
|
743
|
+
ModelPickerWidget = ( __decorate([( __param(2, IActionWidgetService)), ( __param(3, ICommandService)), ( __param(4, IOpenerService)), ( __param(5, ITelemetryService)), ( __param(6, ILanguageModelsService)), ( __param(7, IProductService)), ( __param(8, IChatEntitlementService)), ( __param(9, IUpdateService)), ( __param(10, IUriIdentityService))], ModelPickerWidget));
|
|
744
|
+
function getModelHoverContent(model, languageModelsService) {
|
|
625
745
|
const isAuto = model.metadata.id === "auto" && model.metadata.vendor === "copilot";
|
|
626
746
|
const markdown = ( new MarkdownString("", {
|
|
627
747
|
isTrusted: true,
|
|
@@ -638,7 +758,7 @@ function getModelHoverContent(model) {
|
|
|
638
758
|
}
|
|
639
759
|
if (model.metadata.multiplier) {
|
|
640
760
|
markdown.appendMarkdown(`${( localize(
|
|
641
|
-
|
|
761
|
+
7005,
|
|
642
762
|
"Each chat message counts {0} toward your premium request quota",
|
|
643
763
|
model.metadata.multiplier
|
|
644
764
|
))}`);
|
|
@@ -646,10 +766,28 @@ function getModelHoverContent(model) {
|
|
|
646
766
|
}
|
|
647
767
|
if (!isAuto && (model.metadata.maxInputTokens || model.metadata.maxOutputTokens)) {
|
|
648
768
|
const totalTokens = (model.metadata.maxInputTokens ?? 0) + (model.metadata.maxOutputTokens ?? 0);
|
|
649
|
-
markdown.appendMarkdown(`${( localize(
|
|
769
|
+
markdown.appendMarkdown(`${( localize(7006, "Context Size"))}: `);
|
|
650
770
|
markdown.appendMarkdown(`${formatTokenCount(totalTokens)}`);
|
|
651
771
|
markdown.appendText(`\n`);
|
|
652
772
|
}
|
|
773
|
+
if (languageModelsService) {
|
|
774
|
+
const schema = model.metadata.configurationSchema;
|
|
775
|
+
if (schema?.properties) {
|
|
776
|
+
const currentConfig = languageModelsService.getModelConfiguration(model.identifier) ?? {};
|
|
777
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
778
|
+
const value = currentConfig[key] ?? propSchema.default;
|
|
779
|
+
if (value === undefined) {
|
|
780
|
+
continue;
|
|
781
|
+
}
|
|
782
|
+
const enumItemLabels = propSchema.enumItemLabels;
|
|
783
|
+
const enumIndex = propSchema.enum?.indexOf(value) ?? -1;
|
|
784
|
+
const displayValue = enumItemLabels?.[enumIndex] ?? String(value);
|
|
785
|
+
const label = propSchema.title ?? key;
|
|
786
|
+
markdown.appendText(`${label}: ${displayValue}`);
|
|
787
|
+
markdown.appendText(`\n`);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
}
|
|
653
791
|
return markdown;
|
|
654
792
|
}
|
|
655
793
|
function formatTokenCount(count) {
|