@codingame/monaco-vscode-chat-service-override 38.0.6 → 38.1.1

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,296 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Throttler, RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
- import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
5
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
- import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
7
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
8
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
9
- import { extUriBiasedIgnorePathCase, joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
10
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
11
- import { IAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service';
12
- import { AgentHostRemoteConnectionsSettingId, isGitHubEnvironmentBackend } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/missionControlEnvironment';
13
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
14
- import { toFileOperationResult, FileOperationResult } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
15
- import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
16
- import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
17
- import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
18
- import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
19
- import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/platform/path/common/pathService.service';
20
- import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
21
- import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
22
- import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
23
- import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
24
- import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
25
- import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
26
-
27
- const sharingStorageKey = "agentHost.missionControl.sharing";
28
- const missionControlUseLocalCredentials = "chat.agentHost.experimentalMissionControl.useLocalCredentials";
29
- const missionControlIgnoreRemoteControlPolicy = "chat.agentHost.experimentalMissionControl.ignoreRemoteControlPolicy";
30
- let MissionControlSharingService = class MissionControlSharingService extends Disposable {
31
- constructor(
32
- _agentHost,
33
- _configuration,
34
- _authentication,
35
- _entitlement,
36
- _workspace,
37
- _product,
38
- _logService,
39
- _storage,
40
- _notificationService,
41
- _pathService,
42
- _fileService
43
- ) {
44
- super();
45
- this._agentHost = _agentHost;
46
- this._configuration = _configuration;
47
- this._authentication = _authentication;
48
- this._entitlement = _entitlement;
49
- this._workspace = _workspace;
50
- this._product = _product;
51
- this._logService = _logService;
52
- this._storage = _storage;
53
- this._notificationService = _notificationService;
54
- this._pathService = _pathService;
55
- this._fileService = _fileService;
56
- this.state = observableValue(this, "disabled");
57
- this._enabled = false;
58
- this._configured = false;
59
- this._generation = 0;
60
- this._accountSessionIds = ( new Set());
61
- this._updates = this._register(( new Throttler()));
62
- this._update = this._register(( new RunOnceScheduler(() => {
63
- void this._updates.queue(() => this._configure()).catch(error => {
64
- this._logService.error("Mission Control configuration failed", error);
65
- this._notificationService.error(error);
66
- });
67
- }, 0)));
68
- if (!this._agentHost.configureMissionControl) {
69
- return;
70
- }
71
- this._enabled = this._usesMissionControl() && this._storage.getBoolean(sharingStorageKey, StorageScope.APPLICATION, false);
72
- this._register(this._configuration.onDidChangeConfiguration(e => {
73
- if (e.affectsConfiguration(AgentHostRemoteConnectionsSettingId)) {
74
- void this.setEnabled(false).catch(error => this._reportWithdrawalError(error));
75
- } else if (e.affectsConfiguration(missionControlUseLocalCredentials) || e.affectsConfiguration(missionControlIgnoreRemoteControlPolicy)) {
76
- void this._withdraw().catch(error => this._reportWithdrawalError(error));
77
- this._update.schedule();
78
- }
79
- }));
80
- this._register(
81
- this._storage.onDidChangeValue(StorageScope.APPLICATION, sharingStorageKey, this._store)(e => {
82
- if (e.external) {
83
- const enabled = this._storage.getBoolean(sharingStorageKey, StorageScope.APPLICATION, false);
84
- if (enabled === this._enabled) {
85
- return;
86
- }
87
- this._enabled = enabled;
88
- if (!enabled) {
89
- void this._withdraw().catch(error => this._reportWithdrawalError(error));
90
- }
91
- this._update.schedule();
92
- }
93
- })
94
- );
95
- this._register(this._workspace.onDidChangeWorkspaceFolders(() => {
96
- this._generation++;
97
- this._update.schedule();
98
- }));
99
- this._register(this._authentication.onDidChangeSessions(e => {
100
- const providerId = this._product.defaultChatAgent?.provider?.default?.id ?? "github";
101
- if (e.providerId !== providerId) {
102
- return;
103
- }
104
- const removed = e.event.removed?.filter(session => session.account.id === this._accountId) ?? [];
105
- for (const session of removed) {
106
- this._accountSessionIds.delete(session.id);
107
- }
108
- for (const session of e.event.added ?? []) {
109
- if (session.account.id === this._accountId && this._getScopes().every(scope => session.scopes.includes(scope))) {
110
- this._accountSessionIds.add(session.id);
111
- }
112
- }
113
- if (removed.length && !this._accountSessionIds.size) {
114
- void this._withdraw().catch(error => this._reportWithdrawalError(error));
115
- } else {
116
- this._generation++;
117
- }
118
- this._update.schedule();
119
- }));
120
- this._register(this._entitlement.onDidChangeSentiment(() => {
121
- if (this._entitlement.sentiment.hidden) {
122
- void this.setEnabled(false).catch(error => this._reportWithdrawalError(error));
123
- }
124
- this._update.schedule();
125
- }));
126
- this._register(this._agentHost.onAgentHostStart(() => {
127
- if (this._configured) {
128
- this._generation++;
129
- this._configured = false;
130
- this.state.set("connecting", undefined);
131
- this._update.schedule();
132
- }
133
- }));
134
- this._update.schedule();
135
- }
136
- setProjectFolders(folders) {
137
- const localFolders = [...( new ResourceSet(
138
- folders.filter(folder => folder.scheme === Schemas.file),
139
- folder => extUriBiasedIgnorePathCase.getComparisonKey(folder)
140
- ))];
141
- if (this._projectFolders && equals(
142
- this._projectFolders,
143
- localFolders,
144
- (a, b) => extUriBiasedIgnorePathCase.isEqual(a, b)
145
- )) {
146
- return;
147
- }
148
- this._projectFolders = localFolders;
149
- this._generation++;
150
- this._update.schedule();
151
- }
152
- async setEnabled(enabled) {
153
- if (enabled && (!this._agentHost.configureMissionControl || !this._usesMissionControl() || this._entitlement.sentiment.hidden)) {
154
- throw ( new Error(( localize(13297, "GitHub environment sharing is unavailable."))));
155
- }
156
- this._enabled = enabled;
157
- this._generation++;
158
- this._update.cancel();
159
- if (!enabled) {
160
- this._storage.store(sharingStorageKey, false, StorageScope.APPLICATION, StorageTarget.MACHINE);
161
- await this._withdraw();
162
- return;
163
- }
164
- this.state.set("connecting", undefined);
165
- await this._updates.queue(() => this._configure(true));
166
- }
167
- _usesMissionControl() {
168
- return isGitHubEnvironmentBackend(this._configuration.getValue(AgentHostRemoteConnectionsSettingId));
169
- }
170
- _reportWithdrawalError(error) {
171
- this._logService.error("Mission Control withdrawal failed", error);
172
- this._notificationService.error(error);
173
- }
174
- async _withdraw() {
175
- this._generation++;
176
- this._configured = false;
177
- this._accountSessionIds.clear();
178
- this.state.set("disabled", undefined);
179
- if (this._accountId !== undefined) {
180
- await this._agentHost.configureMissionControl?.(undefined, this._accountId);
181
- }
182
- }
183
- _getScopes() {
184
- return this._product.defaultChatAgent?.providerScopes?.[0] ?? ["read:user", "user:email", "repo", "workflow"];
185
- }
186
- async _configure(interactive = false) {
187
- const generation = this._generation;
188
- if (!this._enabled || !this._usesMissionControl() || this._entitlement.sentiment.hidden) {
189
- return;
190
- }
191
- if (!this._configured) {
192
- this.state.set("connecting", undefined);
193
- }
194
- try {
195
- const providerId = this._product.defaultChatAgent?.provider?.default?.id ?? "github";
196
- const scopes = this._getScopes();
197
- let sessions = await this._authentication.getSessions(providerId, [...scopes], undefined, true);
198
- if (!sessions.length && interactive && generation === this._generation && !this._store.isDisposed) {
199
- sessions = [await this._authentication.createSession(providerId, [...scopes])];
200
- }
201
- if (generation !== this._generation || this._store.isDisposed) {
202
- return;
203
- }
204
- if (( new Set(sessions.map(session => session.account.id))).size !== 1) {
205
- throw ( new Error(( localize(
206
- 13298,
207
- "Mission Control requires exactly one local GitHub account with Copilot scopes."
208
- ))));
209
- }
210
- const home = this._pathService.userHome({
211
- preferLocal: true
212
- });
213
- const defaultDirectory = joinPath(home, ".copilot");
214
- await this._fileService.createFolder(defaultDirectory);
215
- const folders = this._projectFolders ?? this._workspace.getWorkspace().folders.map(folder => folder.uri);
216
- const projects = (await Promise.all(
217
- folders.filter(folder => folder.scheme === Schemas.file).map(async folder => {
218
- try {
219
- if ((await this._fileService.stat(folder)).isDirectory) {
220
- return folder.fsPath;
221
- }
222
- this._logService.warn(
223
- "[Mission Control] Ignoring a recent project path that is not a directory",
224
- ( folder.toString())
225
- );
226
- } catch (error) {
227
- const result = error instanceof Error ? toFileOperationResult(error) : undefined;
228
- if (result !== FileOperationResult.FILE_NOT_FOUND && result !== FileOperationResult.FILE_NOT_DIRECTORY) {
229
- throw error;
230
- }
231
- this._logService.warn(
232
- "[Mission Control] Ignoring a missing or invalid recent project directory",
233
- ( folder.toString())
234
- );
235
- }
236
- return undefined;
237
- })
238
- )).filter(project => project !== undefined);
239
- if (generation !== this._generation || this._store.isDisposed) {
240
- return;
241
- }
242
- this._agentHost.startAgentHost();
243
- if (generation !== this._generation) {
244
- return;
245
- }
246
- this._accountId = sessions[0].account.id;
247
- this._accountSessionIds = ( new Set(sessions.map(session => session.id)));
248
- const localCredentialSetting = this._configuration.inspect(missionControlUseLocalCredentials);
249
- const useLocalCredentials = (localCredentialSetting.userLocalValue ?? localCredentialSetting.applicationValue) === true;
250
- if (useLocalCredentials) {
251
- this._logService.warn(
252
- "[Mission Control] Local credential delegation enabled: same-owner remote clients will run Copilot work with the desktop credential and its permissions"
253
- );
254
- }
255
- const remoteControlPolicySetting = this._configuration.inspect(missionControlIgnoreRemoteControlPolicy);
256
- const ignoreRemoteControlPolicy = (remoteControlPolicySetting.userLocalValue ?? remoteControlPolicySetting.applicationValue) === true;
257
- if (ignoreRemoteControlPolicy) {
258
- this._logService.warn(
259
- "[Mission Control] Device remote-control policy override enabled: registration will omit enterprise remote-control restrictions"
260
- );
261
- }
262
- await this._agentHost.configureMissionControl?.({
263
- baseUrl: "https://api.github.com",
264
- accountId: sessions[0].account.id,
265
- credential: sessions[0].accessToken,
266
- roots: [...( new Set([home.fsPath, ...projects]))],
267
- projects,
268
- defaultDirectory: defaultDirectory.fsPath,
269
- live: true,
270
- ...(useLocalCredentials ? {
271
- useLocalCredentials: true
272
- } : {}),
273
- ...(ignoreRemoteControlPolicy ? {
274
- ignoreRemoteControlPolicy: true
275
- } : {})
276
- });
277
- if (generation === this._generation && !this._store.isDisposed) {
278
- this._configured = true;
279
- this._storage.store(sharingStorageKey, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
280
- this.state.set("enabled", undefined);
281
- }
282
- } catch (error) {
283
- if (generation === this._generation && !this._store.isDisposed) {
284
- if (interactive) {
285
- this._enabled = false;
286
- this._storage.store(sharingStorageKey, false, StorageScope.APPLICATION, StorageTarget.MACHINE);
287
- }
288
- await this._withdraw().catch(withdrawalError => this._reportWithdrawalError(withdrawalError));
289
- }
290
- throw error;
291
- }
292
- }
293
- };
294
- MissionControlSharingService = ( __decorate([( __param(0, IAgentHostService)), ( __param(1, IConfigurationService)), ( __param(2, IAuthenticationService)), ( __param(3, IChatEntitlementService)), ( __param(4, IWorkspaceContextService)), ( __param(5, IProductService)), ( __param(6, ILogService)), ( __param(7, IStorageService)), ( __param(8, INotificationService)), ( __param(9, IPathService)), ( __param(10, IFileService))], MissionControlSharingService));
295
-
296
- export { MissionControlSharingService };
@@ -1,63 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
4
- import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
5
- import { IVoiceCodeTranscriptionClient } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.service";
6
- export interface IVoiceCodeTranscription {
7
- readonly turnId: string;
8
- readonly text: string;
9
- readonly status: "partial" | "final";
10
- readonly revision: number;
11
- readonly committed: string;
12
- }
13
- export interface IVoiceCodeTranscriptionError {
14
- readonly detail: string;
15
- readonly code?: string;
16
- readonly turnId?: string;
17
- readonly terminal?: boolean;
18
- }
19
- export declare class VoiceCodeTranscriptionClient extends Disposable implements IVoiceCodeTranscriptionClient {
20
- private readonly _configurationService;
21
- private readonly _productService;
22
- private readonly _logService;
23
- readonly _serviceBrand: undefined;
24
- private readonly _onTranscription;
25
- readonly onTranscription: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<IVoiceCodeTranscription>;
26
- private readonly _onError;
27
- readonly onError: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<IVoiceCodeTranscriptionError>;
28
- private readonly _onDidClose;
29
- readonly onDidClose: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<number>;
30
- private _socket;
31
- private _connectDeferred;
32
- private _sessionInit;
33
- private _connectTimeout;
34
- private _sessionInitTimeout;
35
- private _intentionalClose;
36
- private _window;
37
- private _pingTimer;
38
- private _pongTimer;
39
- private readonly _activeTurns;
40
- private readonly _lastRevisionByTurn;
41
- get isConnected(): boolean;
42
- constructor(_configurationService: IConfigurationService, _productService: IProductService, _logService: ILogService);
43
- connect(window: Window & typeof globalThis, authToken: string): Promise<void>;
44
- startSession(): Promise<void>;
45
- sendPttStart(turnId: string): void;
46
- sendPttAudioChunk(turnId: string, audio: string): void;
47
- sendPttEnd(turnId: string): void;
48
- disconnect(): void;
49
- dispose(): void;
50
- private _handleMessage;
51
- private _handleTranscription;
52
- private _handleError;
53
- private _reportError;
54
- private _send;
55
- private _assertConnected;
56
- private _assertTurnId;
57
- private _assertActiveTurn;
58
- private _startPing;
59
- private _stopPing;
60
- private _clearPongTimeout;
61
- private _clearConnectTimeout;
62
- private _clearSessionInitTimeout;
63
- }