@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,213 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { ThrottlerByKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { cancelOnDispose, CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { CancellationError, isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
6
|
-
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
7
|
-
import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
9
|
-
import { StopWatch } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stopwatch';
|
|
10
|
-
import { ChatMicrosoftAuthenticationEnabledSettingId, toChatMicrosoftAuthenticationMode, ChatMicrosoftAuthenticationMode } from '@codingame/monaco-vscode-api/vscode/vs/platform/chat/common/chatSettings';
|
|
11
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
12
|
-
import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
|
|
13
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
14
|
-
import { observableConfigValue } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
15
|
-
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
16
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
|
-
import { logSettingExperimentTrigger } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/experimentTrigger';
|
|
18
|
-
import { WORKBENCH_ONLY_SESSION_OPTION_PREFIX } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication';
|
|
19
|
-
import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
20
|
-
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
21
|
-
import { IChatMicrosoftSignInProbeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.service';
|
|
22
|
-
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
23
|
-
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
24
|
-
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
25
|
-
import { observableSignal } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignal';
|
|
26
|
-
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
27
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
28
|
-
|
|
29
|
-
const MICROSOFT_PROVIDER_ID = "microsoft";
|
|
30
|
-
const ENTRA_GITHUB_AUDIENCE_SCOPE = "12f6db80-0741-4a7e-b9c5-b85d737b3a31/.default";
|
|
31
|
-
const INCLUDE_UNAPPROVED_ACCOUNTS_OPTION = `${WORKBENCH_ONLY_SESSION_OPTION_PREFIX}IncludeUnapprovedAccounts`;
|
|
32
|
-
const ENTRA_EXCHANGE_PROBE_OPTION = `${WORKBENCH_ONLY_SESSION_OPTION_PREFIX}EntraExchangeProbe`;
|
|
33
|
-
var MicrosoftSignInProbeOutcome;
|
|
34
|
-
(function(MicrosoftSignInProbeOutcome) {
|
|
35
|
-
MicrosoftSignInProbeOutcome["Linked"] = "linked";
|
|
36
|
-
MicrosoftSignInProbeOutcome["NotLinked"] = "notLinked";
|
|
37
|
-
MicrosoftSignInProbeOutcome["NoMicrosoftAccounts"] = "noMicrosoftAccounts";
|
|
38
|
-
MicrosoftSignInProbeOutcome["Error"] = "error";
|
|
39
|
-
})(MicrosoftSignInProbeOutcome || (MicrosoftSignInProbeOutcome = {}));
|
|
40
|
-
async function probeMicrosoftSignIn(authenticationService, gitHubProviderId, token) {
|
|
41
|
-
const microsoftSessions = await authenticationService.getSessions(MICROSOFT_PROVIDER_ID, [ENTRA_GITHUB_AUDIENCE_SCOPE], {
|
|
42
|
-
silent: true,
|
|
43
|
-
[INCLUDE_UNAPPROVED_ACCOUNTS_OPTION]: true
|
|
44
|
-
}, true);
|
|
45
|
-
if (!microsoftSessions.length) {
|
|
46
|
-
return {
|
|
47
|
-
outcome: MicrosoftSignInProbeOutcome.NoMicrosoftAccounts,
|
|
48
|
-
microsoftAccounts: 0
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
if (token.isCancellationRequested) {
|
|
52
|
-
throw ( new CancellationError());
|
|
53
|
-
}
|
|
54
|
-
const linked = await authenticationService.getSessions(gitHubProviderId, [], {
|
|
55
|
-
silent: true,
|
|
56
|
-
[ENTRA_EXCHANGE_PROBE_OPTION]: {
|
|
57
|
-
subjectTokens: microsoftSessions.map(session => session.accessToken)
|
|
58
|
-
}
|
|
59
|
-
}, true);
|
|
60
|
-
if (token.isCancellationRequested) {
|
|
61
|
-
throw ( new CancellationError());
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
outcome: linked.length ? MicrosoftSignInProbeOutcome.Linked : MicrosoftSignInProbeOutcome.NotLinked,
|
|
65
|
-
microsoftAccounts: microsoftSessions.length
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
let ChatMicrosoftSignInProbeService = class ChatMicrosoftSignInProbeService extends Disposable {
|
|
69
|
-
constructor(
|
|
70
|
-
authenticationService,
|
|
71
|
-
defaultAccountService,
|
|
72
|
-
chatEntitlementService,
|
|
73
|
-
configurationService,
|
|
74
|
-
productService,
|
|
75
|
-
logService,
|
|
76
|
-
telemetryService
|
|
77
|
-
) {
|
|
78
|
-
super();
|
|
79
|
-
this.authenticationService = authenticationService;
|
|
80
|
-
this.chatEntitlementService = chatEntitlementService;
|
|
81
|
-
this.configurationService = configurationService;
|
|
82
|
-
this.productService = productService;
|
|
83
|
-
this.logService = logService;
|
|
84
|
-
this.telemetryService = telemetryService;
|
|
85
|
-
this.linkedGitHubProviderId = observableValue(this, undefined);
|
|
86
|
-
this.probes = this._register(( new ThrottlerByKey()));
|
|
87
|
-
this.disposed = cancelOnDispose(this._store);
|
|
88
|
-
this.accountsCancellation = ( new CancellationTokenSource(this.disposed));
|
|
89
|
-
const setting = observableConfigValue(
|
|
90
|
-
ChatMicrosoftAuthenticationEnabledSettingId,
|
|
91
|
-
undefined,
|
|
92
|
-
configurationService
|
|
93
|
-
);
|
|
94
|
-
this.mode = derived(this, reader => toChatMicrosoftAuthenticationMode(setting.read(reader)));
|
|
95
|
-
this.gitHubProviderId = observableFromEvent(
|
|
96
|
-
this,
|
|
97
|
-
defaultAccountService.onDidChangeDefaultAccount,
|
|
98
|
-
() => defaultAccountService.getDefaultAccountAuthenticationProvider().id
|
|
99
|
-
);
|
|
100
|
-
this.offered = derived(this, reader => {
|
|
101
|
-
switch (this.mode.read(reader)) {
|
|
102
|
-
case ChatMicrosoftAuthenticationMode.Always:
|
|
103
|
-
return true;
|
|
104
|
-
case ChatMicrosoftAuthenticationMode.Never:
|
|
105
|
-
return false;
|
|
106
|
-
default:
|
|
107
|
-
return this.linkedGitHubProviderId.read(reader) === this.gitHubProviderId.read(reader);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
this.offerMicrosoftSignIn = derived(this, reader => this.isProbeRelevant(reader) && this.offered.read(reader));
|
|
111
|
-
const microsoftAccountsChanged = observableSignal(this);
|
|
112
|
-
this._register(toDisposable(() => this.accountsCancellation.dispose(true)));
|
|
113
|
-
this._register(authenticationService.onDidChangeSessions((
|
|
114
|
-
{
|
|
115
|
-
providerId,
|
|
116
|
-
event
|
|
117
|
-
}
|
|
118
|
-
) => {
|
|
119
|
-
if (providerId !== MICROSOFT_PROVIDER_ID || !(event.added?.length || event.removed?.length)) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
this.accountsCancellation.dispose(true);
|
|
123
|
-
this.accountsCancellation = ( new CancellationTokenSource(this.disposed));
|
|
124
|
-
transaction(tx => {
|
|
125
|
-
this.linkedGitHubProviderId.set(undefined, tx);
|
|
126
|
-
microsoftAccountsChanged.trigger(tx);
|
|
127
|
-
});
|
|
128
|
-
}));
|
|
129
|
-
this._register(autorun(reader => {
|
|
130
|
-
microsoftAccountsChanged.read(reader);
|
|
131
|
-
const mode = this.mode.read(reader);
|
|
132
|
-
if (!this.isProbeRelevant(reader)) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
this.logExperimentTrigger();
|
|
136
|
-
if (mode === ChatMicrosoftAuthenticationMode.Auto && !this.offered.read(reader)) {
|
|
137
|
-
this.probe(this.gitHubProviderId.read(reader));
|
|
138
|
-
}
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
notifySignInShown() {
|
|
142
|
-
if (!this.isProbeRelevant(undefined)) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
this.logExperimentTrigger();
|
|
146
|
-
if (!this.offered.get() && this.mode.get() === ChatMicrosoftAuthenticationMode.Auto) {
|
|
147
|
-
this.probe(this.gitHubProviderId.get());
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
isProbeRelevant(reader) {
|
|
151
|
-
return !this.chatEntitlementService.sentimentObs.read(reader).hidden && !!this.productService.defaultChatAgent?.provider.microsoft?.id;
|
|
152
|
-
}
|
|
153
|
-
logExperimentTrigger() {
|
|
154
|
-
const {
|
|
155
|
-
userValue,
|
|
156
|
-
applicationValue,
|
|
157
|
-
policyValue
|
|
158
|
-
} = this.configurationService.inspect(ChatMicrosoftAuthenticationEnabledSettingId);
|
|
159
|
-
if (userValue === undefined && applicationValue === undefined && policyValue === undefined) {
|
|
160
|
-
logSettingExperimentTrigger(this.telemetryService, ChatMicrosoftAuthenticationEnabledSettingId);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
probe(gitHubProviderId) {
|
|
164
|
-
void this.probes.queue(gitHubProviderId, () => this.runProbe(gitHubProviderId));
|
|
165
|
-
}
|
|
166
|
-
async runProbe(gitHubProviderId) {
|
|
167
|
-
if (this.mode.get() !== ChatMicrosoftAuthenticationMode.Auto || this.linkedGitHubProviderId.get() === gitHubProviderId) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const watch = StopWatch.create();
|
|
171
|
-
try {
|
|
172
|
-
const result = await probeMicrosoftSignIn(
|
|
173
|
-
this.authenticationService,
|
|
174
|
-
gitHubProviderId,
|
|
175
|
-
this.accountsCancellation.token
|
|
176
|
-
);
|
|
177
|
-
this.report(gitHubProviderId, result, watch.elapsed());
|
|
178
|
-
if (result.outcome === MicrosoftSignInProbeOutcome.Linked) {
|
|
179
|
-
this.linkedGitHubProviderId.set(gitHubProviderId, undefined);
|
|
180
|
-
}
|
|
181
|
-
} catch (error) {
|
|
182
|
-
if (!isCancellationError(error)) {
|
|
183
|
-
this.logService.trace(
|
|
184
|
-
`[chat setup] Could not check for a Microsoft account linked to GitHub: ${toErrorMessage(error)}`
|
|
185
|
-
);
|
|
186
|
-
this.report(gitHubProviderId, {
|
|
187
|
-
outcome: MicrosoftSignInProbeOutcome.Error,
|
|
188
|
-
microsoftAccounts: 0
|
|
189
|
-
}, watch.elapsed());
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
report(gitHubProviderId, result, durationMs) {
|
|
194
|
-
this.logService.trace(
|
|
195
|
-
`[chat setup] Microsoft sign-in probe for ${gitHubProviderId}: ${result.outcome} (${result.microsoftAccounts} account(s))`
|
|
196
|
-
);
|
|
197
|
-
this.telemetryService.publicLog2("chatSetup.microsoftSignInProbe", {
|
|
198
|
-
outcome: result.outcome,
|
|
199
|
-
microsoftAccounts: result.microsoftAccounts,
|
|
200
|
-
durationMs: Math.round(durationMs)
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
ChatMicrosoftSignInProbeService = ( __decorate([( __param(0, IAuthenticationService)), ( __param(1, IDefaultAccountService)), ( __param(2, IChatEntitlementService)), ( __param(3, IConfigurationService)), ( __param(4, IProductService)), ( __param(5, ILogService)), ( __param(6, ITelemetryService))], ChatMicrosoftSignInProbeService));
|
|
205
|
-
let ChatMicrosoftSignInProbeContribution = class ChatMicrosoftSignInProbeContribution {
|
|
206
|
-
static {
|
|
207
|
-
this.ID = "workbench.contrib.chatMicrosoftSignInProbe";
|
|
208
|
-
}
|
|
209
|
-
constructor(_microsoftSignInProbeService) {}
|
|
210
|
-
};
|
|
211
|
-
ChatMicrosoftSignInProbeContribution = ( __decorate([( __param(0, IChatMicrosoftSignInProbeService))], ChatMicrosoftSignInProbeContribution));
|
|
212
|
-
|
|
213
|
-
export { ChatMicrosoftSignInProbeContribution, ChatMicrosoftSignInProbeService, MicrosoftSignInProbeOutcome, probeMicrosoftSignIn };
|
|
@@ -1,40 +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 { IAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service";
|
|
4
|
-
import { ICloudSandboxConnectOptions, type ICloudSandboxClientToken } from "../../../../../platform/agentHost/common/cloudSandboxAgentHost.js";
|
|
5
|
-
import { ICloudSandboxAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/cloudSandboxAgentHost.service";
|
|
6
|
-
import { ICloudSandboxApiService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/cloudSandboxAgentHost.service";
|
|
7
|
-
import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service";
|
|
8
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
9
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
-
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
11
|
-
/** Maximum number of credential refreshes while waiting for a sealed token. */
|
|
12
|
-
export declare const MAX_SEALED_TOKEN_RETRIES = 12;
|
|
13
|
-
/** Renderer-side coordinator for Copilot cloud sandbox connections. */
|
|
14
|
-
export declare class CloudSandboxAgentHostService extends Disposable implements ICloudSandboxAgentHostService {
|
|
15
|
-
private readonly _remoteAgentHostService;
|
|
16
|
-
private readonly _apiService;
|
|
17
|
-
private readonly _configurationService;
|
|
18
|
-
private readonly _instantiationService;
|
|
19
|
-
private readonly _logService;
|
|
20
|
-
private readonly _localAgentHostService;
|
|
21
|
-
readonly _serviceBrand: undefined;
|
|
22
|
-
private readonly _connectionFactory;
|
|
23
|
-
private _accountGeneration;
|
|
24
|
-
/** Overridable so tests can exercise the re-mint loop without waiting on real delays. */
|
|
25
|
-
protected readonly sealedTokenRetryDelayMs: number;
|
|
26
|
-
constructor(_remoteAgentHostService: IRemoteAgentHostService, _apiService: ICloudSandboxApiService, _configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ILogService, _localAgentHostService: IAgentHostService);
|
|
27
|
-
getSealedGitHubToken(environmentId: string): string | undefined;
|
|
28
|
-
refreshSealedGitHubToken(environmentId: string): Promise<string | undefined>;
|
|
29
|
-
disconnect(addressOrEnvironmentId: string): Promise<void>;
|
|
30
|
-
connect(options: ICloudSandboxConnectOptions, token: CancellationToken): Promise<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Stage already-minted credentials and wait for the remote connection service to handshake it.
|
|
33
|
-
*/
|
|
34
|
-
protected _establish(options: ICloudSandboxConnectOptions, address: string, clientToken: ICloudSandboxClientToken, token: CancellationToken): Promise<string>;
|
|
35
|
-
/** Mint credentials, retrying waking responses and network failures within the connection deadline. */
|
|
36
|
-
private _mintWithWaking;
|
|
37
|
-
private _wakingRetryDelay;
|
|
38
|
-
/** Refresh the initial client's credentials within the attempt limit; initialization validates the final bundle. */
|
|
39
|
-
private _awaitSealedToken;
|
|
40
|
-
}
|