@codingame/monaco-vscode-chat-service-override 38.0.7 → 38.1.2
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/common.js +0 -53
- package/index.js +0 -3
- package/package.json +5 -5
- package/session.js +0 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +1 -1
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.d.ts +0 -135
- package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.js +0 -510
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +0 -22
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +0 -21
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.d.ts +0 -273
- package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.js +0 -61
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.d.ts +0 -7
- package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.js +0 -17
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.d.ts +0 -12
- package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.js +0 -48
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.d.ts +0 -8
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js +0 -11
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.d.ts +0 -114
- package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.js +0 -141
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.d.ts +0 -48
- package/vscode/src/vs/platform/agentHost/common/taskEventReplay.js +0 -238
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.js +0 -260
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.d.ts +0 -102
- package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.js +0 -115
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.d.ts +0 -46
- package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.js +0 -92
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -9
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +0 -14
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +0 -385
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +0 -67
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +0 -695
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +0 -4
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +0 -39
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +0 -59
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +0 -83
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +0 -87
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +0 -176
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +0 -422
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +0 -2444
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +0 -91
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +0 -620
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +0 -1
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +0 -5
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +0 -46
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +0 -321
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +0 -104
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +0 -345
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +0 -611
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +0 -85
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +0 -200
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +0 -981
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +0 -206
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +0 -368
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +0 -57
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +0 -98
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +0 -186
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +0 -116
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +0 -226
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +0 -138
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +0 -32
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +0 -29
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +0 -108
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +0 -63
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +0 -252
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +0 -178
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +0 -322
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +0 -146
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +0 -890
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +0 -132
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +0 -237
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +0 -120
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +0 -234
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +0 -164
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.js +0 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.js +0 -561
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.d.ts +0 -133
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.js +0 -1176
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.d.ts +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.js +0 -220
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.js +0 -184
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.js +0 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.d.ts +0 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.js +0 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.js +0 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.d.ts +0 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.js +0 -838
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.js +0 -604
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.d.ts +0 -289
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.js +0 -497
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.js +0 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.js +0 -398
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.js +0 -296
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +0 -361
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +0 -198
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +0 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +0 -871
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +0 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +0 -297
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +0 -118
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { readAgentModelNoticesMeta } from '../../../../../../platform/agentHost/common/agentModelNotices.js';
|
|
7
|
-
import { isCopilotHydraFusionModelId } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/copilotCliConfig';
|
|
8
|
-
import { COPILOT_CLI_AGENT_PROVIDER_ID } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agent';
|
|
9
|
-
import { readAgentModelPricingMeta } from '../../../../../../platform/agentHost/common/meta/agentModelMeta.js';
|
|
10
|
-
import { readAgentModelByokIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentModelByokMeta';
|
|
11
|
-
import { readAgentModelGroupId, readAgentModelSourceId } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentModelSource';
|
|
12
|
-
import { getReasoningEffortDescription, getReasoningEffortLabel } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/reasoningEffort';
|
|
13
|
-
import { nullExtensionDescription } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
14
|
-
import { COPILOT_VENDOR_ID, AUTO_RAW_MODEL_ID, ILanguageModelChatMetadata } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
15
|
-
import { readAgentModelEnsembleMeta } from '../../../../../../platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js';
|
|
16
|
-
|
|
17
|
-
function agentHostProviderSupportsAutoModel(provider) {
|
|
18
|
-
return provider === "copilotcli";
|
|
19
|
-
}
|
|
20
|
-
class AgentHostLanguageModelProvider extends Disposable {
|
|
21
|
-
constructor(_sessionType, _vendor, _catalogue) {
|
|
22
|
-
super();
|
|
23
|
-
this._sessionType = _sessionType;
|
|
24
|
-
this._vendor = _vendor;
|
|
25
|
-
this._catalogue = _catalogue;
|
|
26
|
-
this._onDidChange = this._register(( new Emitter()));
|
|
27
|
-
this.onDidChange = this._onDidChange.event;
|
|
28
|
-
this._models = [];
|
|
29
|
-
this._additionalModels = [];
|
|
30
|
-
if (this._catalogue) {
|
|
31
|
-
this._register(this._catalogue.onDidChangeLanguageModels(vendor => {
|
|
32
|
-
if (vendor === COPILOT_VENDOR_ID) {
|
|
33
|
-
this._onDidChange.fire();
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
updateModels(models) {
|
|
39
|
-
this._models = models;
|
|
40
|
-
this._onDidChange.fire();
|
|
41
|
-
}
|
|
42
|
-
updateAdditionalModels(models) {
|
|
43
|
-
this._additionalModels = models;
|
|
44
|
-
this._onDidChange.fire();
|
|
45
|
-
}
|
|
46
|
-
async provideLanguageModelChatInfo(_options, _token) {
|
|
47
|
-
const hostModelIds = ( new Set(this._models.map(model => model.id)));
|
|
48
|
-
return [...this._models, ...this._additionalModels.filter(model => !( hostModelIds.has(model.id)))].filter(m => m.policyState !== "disabled").map(m => {
|
|
49
|
-
const pricing = readAgentModelPricingMeta(m);
|
|
50
|
-
const multiplierNumeric = pricing.multiplierNumeric;
|
|
51
|
-
const isAuto = m.id === AUTO_RAW_MODEL_ID;
|
|
52
|
-
const ensemble = isAuto ? readAgentModelEnsembleMeta(m) : undefined;
|
|
53
|
-
const notices = isAuto ? undefined : readAgentModelNoticesMeta(m);
|
|
54
|
-
const discountPercent = pricing.discountPercent;
|
|
55
|
-
const hasDiscount = typeof discountPercent === "number" && discountPercent > 0 && discountPercent <= 100;
|
|
56
|
-
const {
|
|
57
|
-
detail,
|
|
58
|
-
description
|
|
59
|
-
} = this._routingPresentationFor(m, hasDiscount ? discountPercent : undefined);
|
|
60
|
-
const tooltip = notices?.rowWarning ?? description;
|
|
61
|
-
const modelGroup = this._modelGroupFor(m);
|
|
62
|
-
const byokModelIdentifier = readAgentModelByokIdentifier(m);
|
|
63
|
-
const known = this._catalogueEntryFor(m, modelGroup);
|
|
64
|
-
const maxOutputTokens = m.maxOutputTokens ?? known?.maxOutputTokens ?? 0;
|
|
65
|
-
const maxInputTokens = m.maxPromptTokens ?? (m.maxContextWindow !== undefined ? Math.max(0, m.maxContextWindow - maxOutputTokens) : undefined) ?? known?.maxInputTokens ?? 0;
|
|
66
|
-
return {
|
|
67
|
-
identifier: `${this._vendor}:${m.id}`,
|
|
68
|
-
metadata: {
|
|
69
|
-
extension: nullExtensionDescription.identifier,
|
|
70
|
-
name: m.name,
|
|
71
|
-
id: m.id,
|
|
72
|
-
vendor: this._vendor,
|
|
73
|
-
version: "1.0",
|
|
74
|
-
family: m.id,
|
|
75
|
-
...(tooltip !== undefined && {
|
|
76
|
-
tooltip
|
|
77
|
-
}),
|
|
78
|
-
...(detail !== undefined && {
|
|
79
|
-
detail
|
|
80
|
-
}),
|
|
81
|
-
...(isAuto && hasDiscount && {
|
|
82
|
-
autoModelDiscountPercent: discountPercent
|
|
83
|
-
}),
|
|
84
|
-
...(ensemble && {
|
|
85
|
-
autoModelEnsemble: ensemble
|
|
86
|
-
}),
|
|
87
|
-
maxInputTokens,
|
|
88
|
-
maxOutputTokens,
|
|
89
|
-
maxContextWindowTokens: m.maxContextWindow ?? known?.maxContextWindowTokens,
|
|
90
|
-
isDefaultForLocation: {},
|
|
91
|
-
isUserSelectable: true,
|
|
92
|
-
statusIcon: notices?.rowWarning ? Codicon.warning : undefined,
|
|
93
|
-
warningText: notices?.warningText,
|
|
94
|
-
infoText: notices?.infoText,
|
|
95
|
-
pricing: multiplierNumeric !== undefined ? `${multiplierNumeric}x` : known?.pricing,
|
|
96
|
-
multiplierNumeric: multiplierNumeric ?? known?.multiplierNumeric,
|
|
97
|
-
inputCost: pricing.inputCost ?? known?.inputCost,
|
|
98
|
-
cacheCost: pricing.cacheCost ?? known?.cacheCost,
|
|
99
|
-
cacheWriteCost: pricing.cacheWriteCost ?? known?.cacheWriteCost,
|
|
100
|
-
outputCost: pricing.outputCost ?? known?.outputCost,
|
|
101
|
-
longContextInputCost: pricing.longContextInputCost ?? known?.longContextInputCost,
|
|
102
|
-
longContextCacheCost: pricing.longContextCacheCost ?? known?.longContextCacheCost,
|
|
103
|
-
longContextCacheWriteCost: pricing.longContextCacheWriteCost ?? known?.longContextCacheWriteCost,
|
|
104
|
-
longContextOutputCost: pricing.longContextOutputCost ?? known?.longContextOutputCost,
|
|
105
|
-
priceCategory: pricing.priceCategory ?? known?.priceCategory,
|
|
106
|
-
category: pricing.category ?? known?.category,
|
|
107
|
-
promo: pricing.promo ?? known?.promo,
|
|
108
|
-
targetChatSessionType: this._sessionType,
|
|
109
|
-
...(modelGroup ? {
|
|
110
|
-
modelGroup
|
|
111
|
-
} : {}),
|
|
112
|
-
...(byokModelIdentifier !== undefined && {
|
|
113
|
-
byokModelIdentifier
|
|
114
|
-
}),
|
|
115
|
-
capabilities: {
|
|
116
|
-
vision: m.supportsVision ?? known?.capabilities?.vision ?? false,
|
|
117
|
-
toolCalling: true,
|
|
118
|
-
agentMode: true
|
|
119
|
-
},
|
|
120
|
-
configurationSchema: this._toLanguageModelConfigurationSchema(m.configSchema)
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
_routingPresentationFor(model, discountPercent) {
|
|
126
|
-
if (model.id === AUTO_RAW_MODEL_ID) {
|
|
127
|
-
return {
|
|
128
|
-
detail: discountPercent !== undefined ? ( localize(9689, "{0}% discount", discountPercent)) : undefined,
|
|
129
|
-
description: ILanguageModelChatMetadata.getAutoModelDescription(!!readAgentModelEnsembleMeta(model))
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (model.provider === COPILOT_CLI_AGENT_PROVIDER_ID && isCopilotHydraFusionModelId(model.id)) {
|
|
133
|
-
return {
|
|
134
|
-
detail: ( localize(9690, "Research preview")),
|
|
135
|
-
description: ( localize(
|
|
136
|
-
9691,
|
|
137
|
-
"{0} routes the first eligible turn and may use multiple models.",
|
|
138
|
-
model.name
|
|
139
|
-
))
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
return {};
|
|
143
|
-
}
|
|
144
|
-
_catalogueEntryFor(model, group) {
|
|
145
|
-
if (!this._catalogue || group?.id !== COPILOT_VENDOR_ID) {
|
|
146
|
-
return undefined;
|
|
147
|
-
}
|
|
148
|
-
for (const identifier of this._catalogue.getLanguageModelIds()) {
|
|
149
|
-
const metadata = this._catalogue.lookupLanguageModel(identifier);
|
|
150
|
-
if (metadata?.vendor === COPILOT_VENDOR_ID && metadata.id === model.id) {
|
|
151
|
-
return metadata;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
_toLanguageModelConfigurationSchema(schema) {
|
|
157
|
-
if (!schema) {
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
const properties = {};
|
|
161
|
-
for (const [key, property] of Object.entries(schema.properties)) {
|
|
162
|
-
const effortDisplay = property.enumLabels === undefined && property.enumDescriptions === undefined ? AgentHostLanguageModelProvider._reasoningEffortDisplay(key, property.enum) : undefined;
|
|
163
|
-
properties[key] = {
|
|
164
|
-
type: property.type,
|
|
165
|
-
title: property.title,
|
|
166
|
-
description: property.description,
|
|
167
|
-
default: property.default,
|
|
168
|
-
enum: property.enum,
|
|
169
|
-
enumItemLabels: property.enumLabels ?? effortDisplay?.labels,
|
|
170
|
-
enumDescriptions: property.enumDescriptions ?? effortDisplay?.descriptions,
|
|
171
|
-
readOnly: property.readOnly,
|
|
172
|
-
group: AgentHostLanguageModelProvider._groupForConfigKey(key)
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
type: schema.type,
|
|
177
|
-
required: schema.required,
|
|
178
|
-
properties
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
static {
|
|
182
|
-
this._reasoningEffortKeys = ( new Set(["reasoningEffort", "thinkingLevel"]));
|
|
183
|
-
}
|
|
184
|
-
static _reasoningEffortDisplay(key, values) {
|
|
185
|
-
if (!( AgentHostLanguageModelProvider._reasoningEffortKeys.has(key)) || !values?.length) {
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
const levels = values.filter(value => typeof value === "string");
|
|
189
|
-
if (levels.length !== values.length) {
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
return {
|
|
193
|
-
labels: levels.map(getReasoningEffortLabel),
|
|
194
|
-
descriptions: levels.map(level => getReasoningEffortDescription(level) ?? "")
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
static _groupForConfigKey(key) {
|
|
198
|
-
switch (key) {
|
|
199
|
-
case "tier":
|
|
200
|
-
case "autoTier":
|
|
201
|
-
case "thinkingLevel":
|
|
202
|
-
case "reasoningEffort":
|
|
203
|
-
return "navigation";
|
|
204
|
-
case "contextSize":
|
|
205
|
-
case "contextTier":
|
|
206
|
-
return "tokens";
|
|
207
|
-
default:
|
|
208
|
-
return undefined;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
_modelGroupFor(model) {
|
|
212
|
-
const explicitGroupId = readAgentModelGroupId(model);
|
|
213
|
-
const slash = ( model.id.indexOf("/"));
|
|
214
|
-
const groupVendorId = explicitGroupId ?? (slash > 0 ? model.id.slice(0, slash) : model.provider);
|
|
215
|
-
if (!groupVendorId) {
|
|
216
|
-
return undefined;
|
|
217
|
-
}
|
|
218
|
-
const sourceId = readAgentModelSourceId(model);
|
|
219
|
-
return {
|
|
220
|
-
id: groupVendorId,
|
|
221
|
-
...(sourceId !== undefined && {
|
|
222
|
-
sourceId
|
|
223
|
-
})
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
async sendChatRequest() {
|
|
227
|
-
throw ( new Error("Agent-host models do not support direct chat requests"));
|
|
228
|
-
}
|
|
229
|
-
async provideTokenCount() {
|
|
230
|
-
return 0;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export { AgentHostLanguageModelProvider, agentHostProviderSupportsAutoModel };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
2
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
-
import { IQuickInputButton } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
5
|
-
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
6
|
-
import { ISessionOpenOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener";
|
|
7
|
-
import { IAgentSession } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel";
|
|
8
|
-
import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service";
|
|
9
|
-
import { type IAgentSessionsFilter } from "@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer";
|
|
10
|
-
export interface IAgentSessionArchiveButtons {
|
|
11
|
-
readonly archive: IQuickInputButton;
|
|
12
|
-
readonly unarchive: IQuickInputButton;
|
|
13
|
-
}
|
|
14
|
-
export declare function createAgentSessionArchiveButtons(configurationService: IConfigurationService): IAgentSessionArchiveButtons;
|
|
15
|
-
export declare const renameButton: IQuickInputButton;
|
|
16
|
-
export declare const deleteButton: IQuickInputButton;
|
|
17
|
-
export declare function getSessionDescription(session: IAgentSession): string;
|
|
18
|
-
export declare function getSessionButtons(session: IAgentSession, archiveButtons: IAgentSessionArchiveButtons): IQuickInputButton[];
|
|
19
|
-
export declare function shouldShowSessionInPicker(session: IAgentSession, filter: IAgentSessionsFilter): boolean;
|
|
20
|
-
export interface IAgentSessionsPickerOptions {
|
|
21
|
-
overrideSessionOpen?(session: IAgentSession, openOptions?: ISessionOpenOptions): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export declare class AgentSessionsPicker {
|
|
24
|
-
private readonly anchor;
|
|
25
|
-
private readonly options;
|
|
26
|
-
private readonly agentSessionsService;
|
|
27
|
-
private readonly quickInputService;
|
|
28
|
-
private readonly instantiationService;
|
|
29
|
-
private readonly commandService;
|
|
30
|
-
private readonly configurationService;
|
|
31
|
-
private readonly sorter;
|
|
32
|
-
constructor(anchor: HTMLElement | undefined, options: IAgentSessionsPickerOptions | undefined, agentSessionsService: IAgentSessionsService, quickInputService: IQuickInputService, instantiationService: IInstantiationService, commandService: ICommandService, configurationService: IConfigurationService);
|
|
33
|
-
pickAgentSession(): Promise<void>;
|
|
34
|
-
private createPickerItems;
|
|
35
|
-
private toPickItem;
|
|
36
|
-
}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
4
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
-
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
7
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
-
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
9
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
-
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
12
|
-
import { getChatSessionArchiveActionPresentation, getChatSessionArchiveActionWording } from '@codingame/monaco-vscode-api/vscode/vs/platform/chat/common/sessionArchiveActions';
|
|
13
|
-
import { openSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener';
|
|
14
|
-
import { isLocalAgentSessionItem, isAgentHostAgentSessionItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
|
|
15
|
-
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
16
|
-
import { sessionDateFromNow, AgentSessionsSorter, groupAgentSessionsByDate } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer';
|
|
17
|
-
import { AGENT_SESSION_RENAME_ACTION_ID, AGENT_SESSION_DELETE_ACTION_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
18
|
-
import { AgentSessionsFilter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter';
|
|
19
|
-
|
|
20
|
-
function createAgentSessionArchiveButtons(configurationService) {
|
|
21
|
-
const presentation = getChatSessionArchiveActionPresentation(getChatSessionArchiveActionWording(configurationService));
|
|
22
|
-
return {
|
|
23
|
-
archive: {
|
|
24
|
-
iconClass: ThemeIcon.asClassName(presentation.archive.icon),
|
|
25
|
-
tooltip: presentation.archive.title.value
|
|
26
|
-
},
|
|
27
|
-
unarchive: {
|
|
28
|
-
iconClass: ThemeIcon.asClassName(presentation.unarchive.icon),
|
|
29
|
-
tooltip: presentation.unarchive.title.value
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const renameButton = {
|
|
34
|
-
iconClass: ThemeIcon.asClassName(Codicon.edit),
|
|
35
|
-
tooltip: ( localize(9975, "Rename"))
|
|
36
|
-
};
|
|
37
|
-
const deleteButton = {
|
|
38
|
-
iconClass: ThemeIcon.asClassName(Codicon.trash),
|
|
39
|
-
tooltip: ( localize(9976, "Delete"))
|
|
40
|
-
};
|
|
41
|
-
function getSessionDescription(session) {
|
|
42
|
-
const descriptionText = typeof session.description === "string" ? session.description : session.description ? renderAsPlaintext(session.description) : undefined;
|
|
43
|
-
const timeAgo = sessionDateFromNow(session.timing.created);
|
|
44
|
-
const descriptionParts = [descriptionText, session.providerLabel, timeAgo].filter(part => !!part);
|
|
45
|
-
return descriptionParts.join(" • ");
|
|
46
|
-
}
|
|
47
|
-
function getSessionButtons(session, archiveButtons) {
|
|
48
|
-
const buttons = [];
|
|
49
|
-
if (isLocalAgentSessionItem(session)) {
|
|
50
|
-
buttons.push(renameButton);
|
|
51
|
-
buttons.push(deleteButton);
|
|
52
|
-
} else if (isAgentHostAgentSessionItem(session)) {
|
|
53
|
-
buttons.push(renameButton);
|
|
54
|
-
}
|
|
55
|
-
buttons.push(session.isArchived() ? archiveButtons.unarchive : archiveButtons.archive);
|
|
56
|
-
return buttons;
|
|
57
|
-
}
|
|
58
|
-
function shouldShowSessionInPicker(session, filter) {
|
|
59
|
-
return !session.isArchived() && !filter.exclude(session);
|
|
60
|
-
}
|
|
61
|
-
let AgentSessionsPicker = class AgentSessionsPicker {
|
|
62
|
-
constructor(
|
|
63
|
-
anchor,
|
|
64
|
-
options,
|
|
65
|
-
agentSessionsService,
|
|
66
|
-
quickInputService,
|
|
67
|
-
instantiationService,
|
|
68
|
-
commandService,
|
|
69
|
-
configurationService
|
|
70
|
-
) {
|
|
71
|
-
this.anchor = anchor;
|
|
72
|
-
this.options = options;
|
|
73
|
-
this.agentSessionsService = agentSessionsService;
|
|
74
|
-
this.quickInputService = quickInputService;
|
|
75
|
-
this.instantiationService = instantiationService;
|
|
76
|
-
this.commandService = commandService;
|
|
77
|
-
this.configurationService = configurationService;
|
|
78
|
-
this.sorter = ( new AgentSessionsSorter());
|
|
79
|
-
}
|
|
80
|
-
async pickAgentSession() {
|
|
81
|
-
const disposables = ( new DisposableStore());
|
|
82
|
-
const picker = disposables.add(this.quickInputService.createQuickPick({
|
|
83
|
-
useSeparators: true
|
|
84
|
-
}));
|
|
85
|
-
const filter = disposables.add(this.instantiationService.createInstance(AgentSessionsFilter, {}));
|
|
86
|
-
picker.anchor = this.anchor;
|
|
87
|
-
picker.items = this.createPickerItems(filter);
|
|
88
|
-
picker.canAcceptInBackground = true;
|
|
89
|
-
picker.placeholder = ( localize(9977, "Search agent sessions by name"));
|
|
90
|
-
disposables.add(picker.onDidAccept(e => {
|
|
91
|
-
const pick = picker.selectedItems[0];
|
|
92
|
-
if (pick) {
|
|
93
|
-
const openOptions = {
|
|
94
|
-
sideBySide: e.inBackground,
|
|
95
|
-
editorOptions: {
|
|
96
|
-
preserveFocus: e.inBackground,
|
|
97
|
-
pinned: e.inBackground
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
if (this.options?.overrideSessionOpen) {
|
|
101
|
-
this.options.overrideSessionOpen(pick.session, openOptions);
|
|
102
|
-
} else {
|
|
103
|
-
this.instantiationService.invokeFunction(openSession, pick.session, openOptions);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (!e.inBackground) {
|
|
107
|
-
picker.hide();
|
|
108
|
-
}
|
|
109
|
-
}));
|
|
110
|
-
disposables.add(picker.onDidTriggerItemButton(async e => {
|
|
111
|
-
const session = e.item.session;
|
|
112
|
-
let reopenResolved = false;
|
|
113
|
-
if (e.button === renameButton) {
|
|
114
|
-
reopenResolved = true;
|
|
115
|
-
await this.commandService.executeCommand(AGENT_SESSION_RENAME_ACTION_ID, session);
|
|
116
|
-
} else if (e.button === deleteButton) {
|
|
117
|
-
reopenResolved = true;
|
|
118
|
-
await this.commandService.executeCommand(AGENT_SESSION_DELETE_ACTION_ID, session);
|
|
119
|
-
} else {
|
|
120
|
-
const newArchivedState = !session.isArchived();
|
|
121
|
-
session.setArchived(newArchivedState);
|
|
122
|
-
}
|
|
123
|
-
if (reopenResolved) {
|
|
124
|
-
await this.agentSessionsService.model.resolve(session.providerType);
|
|
125
|
-
this.pickAgentSession();
|
|
126
|
-
} else {
|
|
127
|
-
picker.items = this.createPickerItems(filter);
|
|
128
|
-
}
|
|
129
|
-
}));
|
|
130
|
-
disposables.add(picker.onDidHide(() => disposables.dispose()));
|
|
131
|
-
picker.show();
|
|
132
|
-
}
|
|
133
|
-
createPickerItems(filter) {
|
|
134
|
-
const sessions = this.agentSessionsService.model.sessions.filter(session => shouldShowSessionInPicker(session, filter)).sort(this.sorter.compare.bind(this.sorter));
|
|
135
|
-
const items = [];
|
|
136
|
-
const groupedSessions = groupAgentSessionsByDate(sessions);
|
|
137
|
-
for (const group of ( groupedSessions.values())) {
|
|
138
|
-
if (group.sessions.length > 0) {
|
|
139
|
-
items.push({
|
|
140
|
-
type: "separator",
|
|
141
|
-
label: group.label
|
|
142
|
-
});
|
|
143
|
-
items.push(...group.sessions.map(session => this.toPickItem(session)));
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return items;
|
|
147
|
-
}
|
|
148
|
-
toPickItem(session) {
|
|
149
|
-
const description = getSessionDescription(session);
|
|
150
|
-
const buttons = getSessionButtons(session, createAgentSessionArchiveButtons(this.configurationService));
|
|
151
|
-
return {
|
|
152
|
-
id: ( session.resource.toString()),
|
|
153
|
-
label: session.label,
|
|
154
|
-
tooltip: session.tooltip,
|
|
155
|
-
description,
|
|
156
|
-
iconClass: ThemeIcon.asClassName(session.icon),
|
|
157
|
-
buttons,
|
|
158
|
-
session
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
AgentSessionsPicker = ( __decorate([( __param(2, IAgentSessionsService)), ( __param(3, IQuickInputService)), ( __param(4, IInstantiationService)), ( __param(5, ICommandService)), ( __param(6, IConfigurationService))], AgentSessionsPicker));
|
|
163
|
-
|
|
164
|
-
export { AgentSessionsPicker, createAgentSessionArchiveButtons, deleteButton, getSessionButtons, getSessionDescription, renameButton, shouldShowSessionInPicker };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
4
|
-
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
5
|
-
export declare const PICK_REPOSITORY_COMMAND_ID = "_chat.pickRepository";
|
|
6
|
-
export interface IRepositoryPickerOptions {
|
|
7
|
-
readonly allowRepositoryUrl?: boolean;
|
|
8
|
-
readonly placeholder?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface IRepositoryPickResult {
|
|
11
|
-
readonly repository?: string;
|
|
12
|
-
readonly cloneUrl?: string;
|
|
13
|
-
}
|
|
14
|
-
/** The repository picker shared by extension-backed cloud sessions and browser session creation. */
|
|
15
|
-
export declare class RepositoryPicker extends Disposable {
|
|
16
|
-
private readonly quickInputService;
|
|
17
|
-
private readonly logService;
|
|
18
|
-
private readonly _currentPick;
|
|
19
|
-
constructor(quickInputService: IQuickInputService, logService: ILogService);
|
|
20
|
-
pickRepository(getRepositories: (query: string, token: CancellationToken) => Promise<readonly string[]>, options?: IRepositoryPickerOptions, token?: CancellationToken): Promise<IRepositoryPickResult | undefined>;
|
|
21
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { raceCancellationError, RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { CancellationToken, cancelOnDispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
6
|
-
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
8
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
10
|
-
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
11
|
-
|
|
12
|
-
const PICK_REPOSITORY_COMMAND_ID = "_chat.pickRepository";
|
|
13
|
-
let RepositoryPicker = class RepositoryPicker extends Disposable {
|
|
14
|
-
constructor(quickInputService, logService) {
|
|
15
|
-
super();
|
|
16
|
-
this.quickInputService = quickInputService;
|
|
17
|
-
this.logService = logService;
|
|
18
|
-
this._currentPick = this._register(( new MutableDisposable()));
|
|
19
|
-
}
|
|
20
|
-
async pickRepository(getRepositories, options = {}, token = CancellationToken.None) {
|
|
21
|
-
if (this._store.isDisposed || token.isCancellationRequested) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const store = ( new DisposableStore());
|
|
25
|
-
this._currentPick.value = store;
|
|
26
|
-
const pickToken = cancelOnDispose(store);
|
|
27
|
-
const requests = store.add(( new DisposableStore()));
|
|
28
|
-
const quickPick = store.add(this.quickInputService.createQuickPick());
|
|
29
|
-
quickPick.placeholder = options.placeholder ?? (options.allowRepositoryUrl ? ( localize(10083, "Search for a repository or paste a repository URL...")) : ( localize(10084, "Search for a repository...")));
|
|
30
|
-
quickPick.ariaLabel = quickPick.placeholder;
|
|
31
|
-
quickPick.matchOnDescription = true;
|
|
32
|
-
quickPick.matchOnDetail = true;
|
|
33
|
-
const updateItems = async () => {
|
|
34
|
-
requests.clear();
|
|
35
|
-
const requestToken = cancelOnDispose(requests);
|
|
36
|
-
const query = quickPick.value;
|
|
37
|
-
quickPick.busy = true;
|
|
38
|
-
try {
|
|
39
|
-
const repositories = await raceCancellationError(getRepositories(query, requestToken), requestToken);
|
|
40
|
-
if (!requestToken.isCancellationRequested) {
|
|
41
|
-
quickPick.items = getRepositoryQuickPickItems(repositories, query, options.allowRepositoryUrl === true);
|
|
42
|
-
}
|
|
43
|
-
} catch (error) {
|
|
44
|
-
if (!requestToken.isCancellationRequested && !isCancellationError(error)) {
|
|
45
|
-
this.logService.error("Error fetching repositories", error);
|
|
46
|
-
quickPick.items = getRepositoryQuickPickItems([], query, options.allowRepositoryUrl === true);
|
|
47
|
-
quickPick.validationMessage = ( localize(
|
|
48
|
-
10085,
|
|
49
|
-
"Could not load repositories. Check your GitHub sign-in and connection, then try searching again."
|
|
50
|
-
));
|
|
51
|
-
quickPick.severity = Severity.Error;
|
|
52
|
-
}
|
|
53
|
-
} finally {
|
|
54
|
-
if (!requestToken.isCancellationRequested) {
|
|
55
|
-
quickPick.busy = false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const search = store.add(( new RunOnceScheduler(() => void updateItems(), 300)));
|
|
60
|
-
try {
|
|
61
|
-
return await ( new Promise(resolve => {
|
|
62
|
-
let finished = false;
|
|
63
|
-
const finish = result => {
|
|
64
|
-
if (finished) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
finished = true;
|
|
68
|
-
search.cancel();
|
|
69
|
-
requests.clear();
|
|
70
|
-
resolve(result);
|
|
71
|
-
quickPick.hide();
|
|
72
|
-
};
|
|
73
|
-
store.add(token.onCancellationRequested(() => finish()));
|
|
74
|
-
store.add(pickToken.onCancellationRequested(() => finish()));
|
|
75
|
-
store.add(quickPick.onDidHide(() => finish()));
|
|
76
|
-
store.add(quickPick.onDidChangeValue(() => {
|
|
77
|
-
requests.clear();
|
|
78
|
-
quickPick.items = [];
|
|
79
|
-
quickPick.selectedItems = [];
|
|
80
|
-
quickPick.validationMessage = undefined;
|
|
81
|
-
quickPick.severity = Severity.Ignore;
|
|
82
|
-
quickPick.busy = true;
|
|
83
|
-
search.schedule();
|
|
84
|
-
}));
|
|
85
|
-
store.add(quickPick.onDidAccept(() => {
|
|
86
|
-
const selected = quickPick.selectedItems[0];
|
|
87
|
-
if (!quickPick.busy && selected && quickPick.items.includes(selected)) {
|
|
88
|
-
finish(selected.cloneUrl ? {
|
|
89
|
-
cloneUrl: selected.cloneUrl
|
|
90
|
-
} : {
|
|
91
|
-
repository: selected.repository
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}));
|
|
95
|
-
quickPick.show();
|
|
96
|
-
if (!finished) {
|
|
97
|
-
void updateItems();
|
|
98
|
-
}
|
|
99
|
-
}));
|
|
100
|
-
} finally {
|
|
101
|
-
store.dispose();
|
|
102
|
-
if (this._currentPick.value === store) {
|
|
103
|
-
this._currentPick.clear();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
RepositoryPicker = ( __decorate([( __param(0, IQuickInputService)), ( __param(1, ILogService))], RepositoryPicker));
|
|
109
|
-
function getRepositoryQuickPickItems(repositories, value, allowRepositoryUrl) {
|
|
110
|
-
const repositoryUrl = value.trim();
|
|
111
|
-
const canCloneUrl = allowRepositoryUrl && (/^(?:https?|ssh|git):\/\/\S+$/i.test(repositoryUrl) || /^[^@\s]+@[^:\s]+:\S+$/.test(repositoryUrl));
|
|
112
|
-
return [...(canCloneUrl ? [{
|
|
113
|
-
label: ( localize(10086, "Clone from URL")),
|
|
114
|
-
description: repositoryUrl,
|
|
115
|
-
cloneUrl: repositoryUrl
|
|
116
|
-
}] : []), ...[...repositories].sort((a, b) => a.localeCompare(b)).map(repository => ({
|
|
117
|
-
label: repository,
|
|
118
|
-
repository
|
|
119
|
-
}))];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { PICK_REPOSITORY_COMMAND_ID, RepositoryPicker };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
4
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
-
import { IDefaultAccountService } from "@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service";
|
|
6
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
7
|
-
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
8
|
-
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
9
|
-
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
10
|
-
import { IAuthenticationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service";
|
|
11
|
-
import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
|
|
12
|
-
import { IChatMicrosoftSignInProbeService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.service";
|
|
13
|
-
export declare enum MicrosoftSignInProbeOutcome {
|
|
14
|
-
Linked = "linked",
|
|
15
|
-
NotLinked = "notLinked",
|
|
16
|
-
NoMicrosoftAccounts = "noMicrosoftAccounts",
|
|
17
|
-
Error = "error"
|
|
18
|
-
}
|
|
19
|
-
export interface IMicrosoftSignInProbeResult {
|
|
20
|
-
readonly outcome: MicrosoftSignInProbeOutcome;
|
|
21
|
-
/** How many Microsoft work or school accounts could be asked about. */
|
|
22
|
-
readonly microsoftAccounts: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Checks, without showing the user anything, whether any Microsoft work or school account on this
|
|
26
|
-
* device is linked by GitHub to a GitHub account (for example, an Enterprise Managed User).
|
|
27
|
-
*
|
|
28
|
-
* Every step is silent. The Microsoft tokens are never handed to extensions other than the two
|
|
29
|
-
* authentication providers. The GitHub provider revokes the token it mints to answer where the host
|
|
30
|
-
* and build allow it, and otherwise leaves it to expire (see {@link ENTRA_EXCHANGE_PROBE_OPTION}).
|
|
31
|
-
* Both options are reserved for the workbench, so extensions cannot run this check.
|
|
32
|
-
*
|
|
33
|
-
* @param gitHubProviderId The GitHub authentication provider that sign-in would use.
|
|
34
|
-
* @throws {@link CancellationError} when `token` is cancelled; any provider failure is rethrown.
|
|
35
|
-
*/
|
|
36
|
-
export declare function probeMicrosoftSignIn(authenticationService: IAuthenticationService, gitHubProviderId: string, token: CancellationToken): Promise<IMicrosoftSignInProbeResult>;
|
|
37
|
-
export declare class ChatMicrosoftSignInProbeService extends Disposable implements IChatMicrosoftSignInProbeService {
|
|
38
|
-
private readonly authenticationService;
|
|
39
|
-
private readonly chatEntitlementService;
|
|
40
|
-
private readonly configurationService;
|
|
41
|
-
private readonly productService;
|
|
42
|
-
private readonly logService;
|
|
43
|
-
private readonly telemetryService;
|
|
44
|
-
readonly _serviceBrand: undefined;
|
|
45
|
-
readonly offerMicrosoftSignIn: IObservable<boolean>;
|
|
46
|
-
private readonly mode;
|
|
47
|
-
private readonly gitHubProviderId;
|
|
48
|
-
/** What the mode and the probes say, before whether offering Microsoft can matter at all. */
|
|
49
|
-
private readonly offered;
|
|
50
|
-
/** The GitHub provider a probe found a linked account for. */
|
|
51
|
-
private readonly linkedGitHubProviderId;
|
|
52
|
-
/**
|
|
53
|
-
* Runs one probe at a time for each GitHub provider. The authentication service cannot cancel a
|
|
54
|
-
* request once a provider has it, so a running probe is never abandoned: whatever asks for a probe
|
|
55
|
-
* meanwhile, such as a dialog or a Microsoft sign-in, is coalesced into one more probe after it.
|
|
56
|
-
*/
|
|
57
|
-
private readonly probes;
|
|
58
|
-
/** Stops a running probe from asking GitHub, and so from minting a token, once this service is gone. */
|
|
59
|
-
private readonly disposed;
|
|
60
|
-
/**
|
|
61
|
-
* Cancelled, and replaced, whenever a Microsoft account is added or removed: a probe still running
|
|
62
|
-
* then answers for accounts that may be gone, so its answer is discarded.
|
|
63
|
-
*/
|
|
64
|
-
private accountsCancellation;
|
|
65
|
-
constructor(authenticationService: IAuthenticationService, defaultAccountService: IDefaultAccountService, chatEntitlementService: IChatEntitlementService, configurationService: IConfigurationService, productService: IProductService, logService: ILogService, telemetryService: ITelemetryService);
|
|
66
|
-
notifySignInShown(): void;
|
|
67
|
-
/** Whether "Continue with Microsoft" can matter at all, in any mode: independent of the experiment arm. */
|
|
68
|
-
private isProbeRelevant;
|
|
69
|
-
/**
|
|
70
|
-
* Logs the setting's experiment trigger, unless the user or a policy chose a mode themselves: the
|
|
71
|
-
* assigned default then has no effect, and that holds the same in every arm.
|
|
72
|
-
*/
|
|
73
|
-
private logExperimentTrigger;
|
|
74
|
-
private probe;
|
|
75
|
-
private runProbe;
|
|
76
|
-
private report;
|
|
77
|
-
}
|
|
78
|
-
/** Creates {@link IChatMicrosoftSignInProbeService} after startup, so it can probe before a dialog needs the answer. */
|
|
79
|
-
export declare class ChatMicrosoftSignInProbeContribution implements IWorkbenchContribution {
|
|
80
|
-
static readonly ID = "workbench.contrib.chatMicrosoftSignInProbe";
|
|
81
|
-
constructor(_microsoftSignInProbeService: IChatMicrosoftSignInProbeService);
|
|
82
|
-
}
|