@codingame/monaco-vscode-remote-agent-service-override 4.1.0 → 4.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 (24) hide show
  1. package/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
  2. package/override/vs/platform/dialogs/common/dialogs.js +10 -0
  3. package/package.json +3 -3
  4. package/remoteAgent.js +8 -8
  5. package/vscode/src/vs/platform/download/common/downloadIpc.js +18 -0
  6. package/vscode/src/vs/platform/log/common/logIpc.js +28 -0
  7. package/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.js +110 -0
  8. package/vscode/src/vs/workbench/contrib/remote/browser/explorerViewItems.js +135 -0
  9. package/vscode/src/vs/workbench/contrib/remote/browser/media/remoteViewlet.css.js +6 -0
  10. package/vscode/src/vs/workbench/contrib/remote/browser/remote.contribution.js +19 -0
  11. package/vscode/src/vs/workbench/contrib/remote/browser/remote.js +831 -0
  12. package/vscode/src/vs/workbench/contrib/remote/browser/remoteConnectionHealth.js +166 -0
  13. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIndicator.js +802 -0
  14. package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.contribution.js +6 -0
  15. package/vscode/src/vs/workbench/contrib/remote/browser/remoteStartEntry.js +97 -0
  16. package/vscode/src/vs/workbench/contrib/remote/browser/showCandidate.js +35 -0
  17. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelFactory.js +110 -0
  18. package/vscode/src/vs/workbench/contrib/remote/common/remote.contribution.js +515 -0
  19. package/vscode/src/vs/workbench/services/remote/browser/browserRemoteResourceHandler.js +49 -0
  20. package/vscode/src/vs/workbench/services/remote/browser/remoteAgentService.js +78 -0
  21. package/vscode/src/vs/workbench/services/remote/common/abstractRemoteAgentService.js +179 -0
  22. package/vscode/src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.js +54 -0
  23. package/vscode/src/vs/workbench/services/remote/common/remoteExtensionsScanner.js +73 -0
  24. package/vscode/src/vs/workbench/services/tunnel/browser/tunnelService.js +36 -0
@@ -0,0 +1,166 @@
1
+ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
+ import { remoteConnectionLatencyMeasurer, IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
3
+ import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
4
+ import { localizeWithPath } from 'vscode/vscode/vs/nls';
5
+ import { isWeb } from 'vscode/vscode/vs/base/common/platform';
6
+ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
7
+ import { getRemoteName } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
8
+ import { IBannerService } from 'vscode/vscode/vs/workbench/services/banner/browser/bannerService';
9
+ import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
10
+ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
11
+ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
12
+ import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
13
+ import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
14
+ import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
15
+ import Severity$1 from 'vscode/vscode/vs/base/common/severity';
16
+ import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
17
+
18
+ const REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY = 'remote.unsupportedConnectionChoice';
19
+ const BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY = 'workbench.banner.remote.unsupportedConnection.dismissed';
20
+ let InitialRemoteConnectionHealthContribution = class InitialRemoteConnectionHealthContribution {
21
+ constructor(_remoteAgentService, _environmentService, _telemetryService, bannerService, dialogService, openerService, hostService, storageService, productService) {
22
+ this._remoteAgentService = _remoteAgentService;
23
+ this._environmentService = _environmentService;
24
+ this._telemetryService = _telemetryService;
25
+ this.bannerService = bannerService;
26
+ this.dialogService = dialogService;
27
+ this.openerService = openerService;
28
+ this.hostService = hostService;
29
+ this.storageService = storageService;
30
+ this.productService = productService;
31
+ if (this._environmentService.remoteAuthority) {
32
+ this._checkInitialRemoteConnectionHealth();
33
+ }
34
+ }
35
+ async _confirmConnection() {
36
+ const { result, checkboxChecked } = await this.dialogService.prompt({
37
+ type: Severity$1.Warning,
38
+ message: ( localizeWithPath(
39
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
40
+ 'unsupportedGlibcWarning',
41
+ "You are about to connect to an OS version that is unsupported by {0}.",
42
+ this.productService.nameLong
43
+ )),
44
+ buttons: [
45
+ {
46
+ label: ( localizeWithPath(
47
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
48
+ { key: 'allow', comment: ['&& denotes a mnemonic'] },
49
+ "&&Allow"
50
+ )),
51
+ run: () => 1
52
+ },
53
+ {
54
+ label: ( localizeWithPath(
55
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
56
+ { key: 'learnMore', comment: ['&& denotes a mnemonic'] },
57
+ "&&Learn More"
58
+ )),
59
+ run: async () => { await this.openerService.open('https://aka.ms/vscode-remote/faq/old-linux'); return 2 ; }
60
+ }
61
+ ],
62
+ cancelButton: {
63
+ run: () => 0
64
+ },
65
+ checkbox: {
66
+ label: ( localizeWithPath(
67
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
68
+ 'remember',
69
+ "Do not show again"
70
+ )),
71
+ }
72
+ });
73
+ if (result === 2 ) {
74
+ return await this._confirmConnection();
75
+ }
76
+ const allowed = result === 1 ;
77
+ if (allowed && checkboxChecked) {
78
+ this.storageService.store(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, allowed, 0 , 1 );
79
+ }
80
+ return allowed;
81
+ }
82
+ async _checkInitialRemoteConnectionHealth() {
83
+ try {
84
+ const environment = await this._remoteAgentService.getRawEnvironment();
85
+ if (environment && environment.isUnsupportedGlibc) {
86
+ let allowed = this.storageService.getBoolean(`${REMOTE_UNSUPPORTED_CONNECTION_CHOICE_KEY}.${this._environmentService.remoteAuthority}`, 0 );
87
+ if (allowed === undefined) {
88
+ allowed = await this._confirmConnection();
89
+ }
90
+ if (allowed) {
91
+ const bannerDismissedVersion = this.storageService.get(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, 0 ) ?? '';
92
+ const shouldShowBanner = bannerDismissedVersion.slice(0, bannerDismissedVersion.lastIndexOf('.')) !== this.productService.version.slice(0, this.productService.version.lastIndexOf('.'));
93
+ if (shouldShowBanner) {
94
+ const actions = [
95
+ {
96
+ label: ( localizeWithPath(
97
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
98
+ 'unsupportedGlibcBannerLearnMore',
99
+ "Learn More"
100
+ )),
101
+ href: 'https://aka.ms/vscode-remote/faq/old-linux'
102
+ }
103
+ ];
104
+ this.bannerService.show({
105
+ id: 'unsupportedGlibcWarning.banner',
106
+ message: ( localizeWithPath(
107
+ 'vs/workbench/contrib/remote/browser/remoteConnectionHealth',
108
+ 'unsupportedGlibcWarning.banner',
109
+ "You are connected to an OS version that is unsupported by {0}.",
110
+ this.productService.nameLong
111
+ )),
112
+ actions,
113
+ icon: Codicon.warning,
114
+ closeLabel: `Do not show again in v${this.productService.version}`,
115
+ onClose: () => {
116
+ this.storageService.store(`${BANNER_REMOTE_UNSUPPORTED_CONNECTION_DISMISSED_KEY}`, this.productService.version, 0 , 1 );
117
+ }
118
+ });
119
+ }
120
+ }
121
+ else {
122
+ this.hostService.openWindow({ forceReuseWindow: true, remoteAuthority: null });
123
+ return;
124
+ }
125
+ }
126
+ this._telemetryService.publicLog2('remoteConnectionSuccess', {
127
+ web: isWeb,
128
+ connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
129
+ remoteName: getRemoteName(this._environmentService.remoteAuthority)
130
+ });
131
+ await this._measureExtHostLatency();
132
+ }
133
+ catch (err) {
134
+ this._telemetryService.publicLog2('remoteConnectionFailure', {
135
+ web: isWeb,
136
+ connectionTimeMs: await this._remoteAgentService.getConnection()?.getInitialConnectionTimeMs(),
137
+ remoteName: getRemoteName(this._environmentService.remoteAuthority),
138
+ message: err ? err.message : ''
139
+ });
140
+ }
141
+ }
142
+ async _measureExtHostLatency() {
143
+ const measurement = await remoteConnectionLatencyMeasurer.measure(this._remoteAgentService);
144
+ if (measurement === undefined) {
145
+ return;
146
+ }
147
+ this._telemetryService.publicLog2('remoteConnectionLatency', {
148
+ web: isWeb,
149
+ remoteName: getRemoteName(this._environmentService.remoteAuthority),
150
+ latencyMs: measurement.current
151
+ });
152
+ }
153
+ };
154
+ InitialRemoteConnectionHealthContribution = ( __decorate([
155
+ ( __param(0, IRemoteAgentService)),
156
+ ( __param(1, IWorkbenchEnvironmentService)),
157
+ ( __param(2, ITelemetryService)),
158
+ ( __param(3, IBannerService)),
159
+ ( __param(4, IDialogService)),
160
+ ( __param(5, IOpenerService)),
161
+ ( __param(6, IHostService)),
162
+ ( __param(7, IStorageService)),
163
+ ( __param(8, IProductService))
164
+ ], InitialRemoteConnectionHealthContribution));
165
+
166
+ export { InitialRemoteConnectionHealthContribution };