@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.
Files changed (144) hide show
  1. package/common.js +0 -53
  2. package/index.js +0 -3
  3. package/package.json +5 -5
  4. package/session.js +0 -3
  5. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.js +1 -1
  6. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1 -1
  7. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +1 -1
  8. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +6 -6
  9. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.d.ts +1 -1
  10. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionListController.js +1 -1
  11. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.d.ts +1 -1
  12. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/editorCloudSandboxContribution.js +2 -2
  13. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentActions.js +1 -1
  14. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHost.contribution.js +7 -7
  15. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/remoteAgentHostChatContribution.js +4 -4
  16. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +1 -1
  17. package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.d.ts +0 -135
  18. package/vscode/src/vs/platform/agentHost/browser/webPubSubRelayTransport.js +0 -510
  19. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +0 -22
  20. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +0 -21
  21. package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.d.ts +0 -273
  22. package/vscode/src/vs/platform/agentHost/common/cloudSandboxAgentHost.js +0 -61
  23. package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.d.ts +0 -7
  24. package/vscode/src/vs/platform/agentHost/common/meta/agentModelMeta.js +0 -17
  25. package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.d.ts +0 -12
  26. package/vscode/src/vs/platform/agentHost/common/meta/copilotd/cloudSandboxProjectMeta.js +0 -48
  27. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.d.ts +0 -8
  28. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelEnsembleMeta.js +0 -11
  29. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.d.ts +0 -114
  30. package/vscode/src/vs/platform/agentHost/common/meta/vscode/agentModelPricing.js +0 -141
  31. package/vscode/src/vs/platform/agentHost/common/taskEventReplay.d.ts +0 -48
  32. package/vscode/src/vs/platform/agentHost/common/taskEventReplay.js +0 -238
  33. package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.d.ts +0 -102
  34. package/vscode/src/vs/platform/agentHost/common/webPubSub/chunking.js +0 -260
  35. package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.d.ts +0 -102
  36. package/vscode/src/vs/platform/agentHost/common/webPubSub/framing.js +0 -115
  37. package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.d.ts +0 -46
  38. package/vscode/src/vs/platform/agentHost/common/webPubSub/groups.js +0 -92
  39. package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -9
  40. package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +0 -14
  41. package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +0 -385
  42. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.d.ts +0 -67
  43. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudAutomationStore.js +0 -695
  44. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.d.ts +0 -4
  45. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/cloudSandboxSessionConfig.js +0 -39
  46. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +0 -1
  47. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +0 -59
  48. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +0 -1
  49. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +0 -83
  50. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +0 -87
  51. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +0 -176
  52. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +0 -422
  53. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +0 -2444
  54. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.d.ts +0 -91
  55. package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/githubCloudAutomationStore.js +0 -620
  56. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +0 -1
  57. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +0 -5
  58. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +0 -46
  59. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +0 -321
  60. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +0 -104
  61. package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +0 -345
  62. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +0 -2
  63. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +0 -611
  64. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +0 -20
  65. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +0 -85
  66. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +0 -200
  67. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +0 -981
  68. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +0 -24
  69. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +0 -206
  70. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +0 -65
  71. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +0 -368
  72. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +0 -10
  73. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +0 -57
  74. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +0 -33
  75. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +0 -98
  76. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +0 -32
  77. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +0 -186
  78. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +0 -12
  79. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +0 -116
  80. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +0 -32
  81. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +0 -226
  82. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +0 -18
  83. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +0 -138
  84. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +0 -32
  85. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +0 -29
  86. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +0 -13
  87. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +0 -108
  88. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +0 -13
  89. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +0 -63
  90. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +0 -252
  91. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +0 -1
  92. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +0 -178
  93. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +0 -47
  94. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +0 -322
  95. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +0 -146
  96. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +0 -890
  97. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +0 -132
  98. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +0 -237
  99. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +0 -120
  100. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +0 -234
  101. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +0 -36
  102. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +0 -164
  103. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.d.ts +0 -21
  104. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/repositoryPicker.js +0 -122
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.d.ts +0 -82
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupMicrosoftProbe.js +0 -213
  107. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.d.ts +0 -40
  108. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxAgentHostService.js +0 -561
  109. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.d.ts +0 -133
  110. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxApiService.js +0 -1176
  111. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.d.ts +0 -17
  112. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxConnectionCustomization.js +0 -76
  113. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.d.ts +0 -54
  114. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxCredentialRefresh.js +0 -220
  115. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.d.ts +0 -21
  116. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxHistoryCache.js +0 -184
  117. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.d.ts +0 -8
  118. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxLegacySessionPreparation.js +0 -165
  119. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.d.ts +0 -43
  120. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxModels.js +0 -162
  121. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.d.ts +0 -40
  122. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxReadOnlySessionHandler.js +0 -129
  123. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.d.ts +0 -166
  124. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionContribution.js +0 -838
  125. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.d.ts +0 -40
  126. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxSessionHandler.js +0 -604
  127. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.d.ts +0 -289
  128. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/cloudSandboxTelemetry.js +0 -497
  129. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.d.ts +0 -6
  130. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlCredentialSealing.js +0 -41
  131. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.d.ts +0 -73
  132. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlEnvironmentService.js +0 -398
  133. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.d.ts +0 -45
  134. package/vscode/src/vs/workbench/contrib/chat/browser/remoteAgentHost/missionControlSharingService.js +0 -296
  135. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +0 -63
  136. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +0 -361
  137. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +0 -34
  138. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +0 -198
  139. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +0 -131
  140. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +0 -871
  141. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +0 -66
  142. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +0 -297
  143. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +0 -31
  144. 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
- }