@theia/remote-wsl 1.62.0

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 (47) hide show
  1. package/README.md +31 -0
  2. package/lib/electron-browser/remote-wsl-frontend-module.d.ts +4 -0
  3. package/lib/electron-browser/remote-wsl-frontend-module.d.ts.map +1 -0
  4. package/lib/electron-browser/remote-wsl-frontend-module.js +30 -0
  5. package/lib/electron-browser/remote-wsl-frontend-module.js.map +1 -0
  6. package/lib/electron-browser/wsl-connection-contribution.d.ts +29 -0
  7. package/lib/electron-browser/wsl-connection-contribution.d.ts.map +1 -0
  8. package/lib/electron-browser/wsl-connection-contribution.js +179 -0
  9. package/lib/electron-browser/wsl-connection-contribution.js.map +1 -0
  10. package/lib/electron-common/remote-wsl-connection-provider.d.ts +20 -0
  11. package/lib/electron-common/remote-wsl-connection-provider.d.ts.map +1 -0
  12. package/lib/electron-common/remote-wsl-connection-provider.js +21 -0
  13. package/lib/electron-common/remote-wsl-connection-provider.js.map +1 -0
  14. package/lib/electron-common/wsl-workspaces.d.ts +2 -0
  15. package/lib/electron-common/wsl-workspaces.d.ts.map +1 -0
  16. package/lib/electron-common/wsl-workspaces.js +20 -0
  17. package/lib/electron-common/wsl-workspaces.js.map +1 -0
  18. package/lib/electron-node/remote-wsl-backend-module.d.ts +5 -0
  19. package/lib/electron-node/remote-wsl-backend-module.d.ts.map +1 -0
  20. package/lib/electron-node/remote-wsl-backend-module.js +39 -0
  21. package/lib/electron-node/remote-wsl-backend-module.js.map +1 -0
  22. package/lib/electron-node/remote-wsl-connection-provider.d.ts +25 -0
  23. package/lib/electron-node/remote-wsl-connection-provider.d.ts.map +1 -0
  24. package/lib/electron-node/remote-wsl-connection-provider.js +121 -0
  25. package/lib/electron-node/remote-wsl-connection-provider.js.map +1 -0
  26. package/lib/electron-node/remote-wsl-connection.d.ts +31 -0
  27. package/lib/electron-node/remote-wsl-connection.d.ts.map +1 -0
  28. package/lib/electron-node/remote-wsl-connection.js +138 -0
  29. package/lib/electron-node/remote-wsl-connection.js.map +1 -0
  30. package/lib/electron-node/wsl-workspace-handler.d.ts +8 -0
  31. package/lib/electron-node/wsl-workspace-handler.d.ts.map +1 -0
  32. package/lib/electron-node/wsl-workspace-handler.js +23 -0
  33. package/lib/electron-node/wsl-workspace-handler.js.map +1 -0
  34. package/lib/package.spec.d.ts +1 -0
  35. package/lib/package.spec.d.ts.map +1 -0
  36. package/lib/package.spec.js +26 -0
  37. package/lib/package.spec.js.map +1 -0
  38. package/package.json +48 -0
  39. package/src/electron-browser/remote-wsl-frontend-module.ts +32 -0
  40. package/src/electron-browser/wsl-connection-contribution.ts +180 -0
  41. package/src/electron-common/remote-wsl-connection-provider.ts +39 -0
  42. package/src/electron-common/wsl-workspaces.ts +17 -0
  43. package/src/electron-node/remote-wsl-backend-module.ts +41 -0
  44. package/src/electron-node/remote-wsl-connection-provider.ts +123 -0
  45. package/src/electron-node/remote-wsl-connection.ts +161 -0
  46. package/src/electron-node/wsl-workspace-handler.ts +38 -0
  47. package/src/package.spec.ts +29 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - REMOTE WSL</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ This package extends the @theia/remote feature with functionality to connect to Windows Subsystem for Linux.
16
+
17
+ ## Additional Information
18
+
19
+ - [API documentation for `@theia/remote-wsl`](https://eclipse-theia.github.io/theia/docs/next/modules/remote-wsl.html)
20
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
+ - [Theia - Website](https://theia-ide.org/)
22
+
23
+ ## License
24
+
25
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
+
28
+ ## Trademark
29
+
30
+ "Theia" is a trademark of the Eclipse Foundation
31
+ <https://www.eclipse.org/theia>
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=remote-wsl-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-frontend-module.d.ts","sourceRoot":"","sources":["../../src/electron-browser/remote-wsl-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAO/D,wBAQG"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const inversify_1 = require("@theia/core/shared/inversify");
19
+ const remote_registry_contribution_1 = require("@theia/remote/lib/electron-browser/remote-registry-contribution");
20
+ const remote_wsl_connection_provider_1 = require("../electron-common/remote-wsl-connection-provider");
21
+ const wsl_connection_contribution_1 = require("./wsl-connection-contribution");
22
+ const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
23
+ const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
24
+ exports.default = new inversify_1.ContainerModule(bind => {
25
+ bind(wsl_connection_contribution_1.WslConnectionContribution).toSelf().inSingletonScope();
26
+ bind(remote_registry_contribution_1.RemoteRegistryContribution).toService(wsl_connection_contribution_1.WslConnectionContribution);
27
+ bind(workspace_service_1.WorkspaceOpenHandlerContribution).toService(wsl_connection_contribution_1.WslConnectionContribution);
28
+ bind(remote_wsl_connection_provider_1.RemoteWslConnectionProvider).toDynamicValue(ctx => service_connection_provider_1.ServiceConnectionProvider.createLocalProxy(ctx.container, remote_wsl_connection_provider_1.RemoteWslConnectionProviderPath)).inSingletonScope();
29
+ });
30
+ //# sourceMappingURL=remote-wsl-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-frontend-module.js","sourceRoot":"","sources":["../../src/electron-browser/remote-wsl-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,4DAA+D;AAC/D,kHAA6G;AAC7G,sGAAiI;AACjI,+EAA0E;AAC1E,+GAA0G;AAC1G,sFAAkG;AAElG,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,yDAA0B,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IACtE,IAAI,CAAC,oDAAgC,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAE5E,IAAI,CAAC,4DAA2B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACnD,uDAAyB,CAAC,gBAAgB,CAA8B,GAAG,CAAC,SAAS,EAAE,gEAA+B,CAAC,CAC1H,CAAC,gBAAgB,EAAE,CAAC;AACzB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { AbstractRemoteRegistryContribution, RemoteRegistry } from '@theia/remote/lib/electron-browser/remote-registry-contribution';
2
+ import { RemotePreferences } from '@theia/remote/lib/electron-browser/remote-preferences';
3
+ import { WorkspaceStorageService } from '@theia/workspace/lib/browser/workspace-storage-service';
4
+ import { Command, MessageService, QuickInputService, URI } from '@theia/core';
5
+ import { WorkspaceInput, WorkspaceOpenHandlerContribution, WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
6
+ import { WorkspaceServer } from '@theia/workspace/lib/common';
7
+ import { RemoteWslConnectionProvider, WslDistribution } from '../electron-common/remote-wsl-connection-provider';
8
+ export declare namespace RemoteWslCommands {
9
+ const CONNECT_TO_WSL: Command;
10
+ const CONNECT_TO_WSL_WITH_DISTRO: Command;
11
+ const OPEN_CURRENT_FOLDER_IN_WSL: Command;
12
+ }
13
+ export declare class WslConnectionContribution extends AbstractRemoteRegistryContribution implements WorkspaceOpenHandlerContribution, WorkspaceOpenHandlerContribution {
14
+ protected readonly connectionProvider: RemoteWslConnectionProvider;
15
+ protected readonly remotePreferences: RemotePreferences;
16
+ protected readonly workspaceStorageService: WorkspaceStorageService;
17
+ protected readonly workspaceService: WorkspaceService;
18
+ protected readonly workspaceServer: WorkspaceServer;
19
+ protected readonly quickInputService: QuickInputService;
20
+ protected readonly messageService: MessageService;
21
+ registerRemoteCommands(registry: RemoteRegistry): void;
22
+ connectToWSL(distribution: WslDistribution, workspace?: string, preserveWindow?: boolean): Promise<void>;
23
+ getOrSelectWslDistribution(): Promise<WslDistribution | undefined>;
24
+ canHandle(uri: URI): boolean;
25
+ openWorkspace(uri: URI, options?: WorkspaceInput | undefined): Promise<void>;
26
+ getWorkspaceLabel(uri: URI): Promise<string | undefined>;
27
+ protected toWSLMountPath(path: string): string;
28
+ }
29
+ //# sourceMappingURL=wsl-connection-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,cAAc,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBrG,0BAA0B,IAAI,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAsBxE,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAItB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5E,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9D,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAKjD"}
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WslConnectionContribution = exports.RemoteWslCommands = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const remote_registry_contribution_1 = require("@theia/remote/lib/electron-browser/remote-registry-contribution");
22
+ const remote_preferences_1 = require("@theia/remote/lib/electron-browser/remote-preferences");
23
+ const workspace_storage_service_1 = require("@theia/workspace/lib/browser/workspace-storage-service");
24
+ const core_1 = require("@theia/core");
25
+ const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
26
+ const common_1 = require("@theia/workspace/lib/common");
27
+ const remote_wsl_connection_provider_1 = require("../electron-common/remote-wsl-connection-provider");
28
+ const wsl_workspaces_1 = require("../electron-common/wsl-workspaces");
29
+ var RemoteWslCommands;
30
+ (function (RemoteWslCommands) {
31
+ RemoteWslCommands.CONNECT_TO_WSL = core_1.Command.toLocalizedCommand({
32
+ id: 'remote-wsl.connect-to-wsl',
33
+ label: 'Connect to WSL',
34
+ category: 'WSL'
35
+ }, 'theia/remote/wsl/connectToWsl');
36
+ RemoteWslCommands.CONNECT_TO_WSL_WITH_DISTRO = core_1.Command.toLocalizedCommand({
37
+ id: 'remote-wsl.connect-to-wsl-with-distro',
38
+ label: 'Connect to WSL using Distro...',
39
+ category: 'WSL'
40
+ }, 'theia/remote/wsl/connectToWslUsingDistro');
41
+ RemoteWslCommands.OPEN_CURRENT_FOLDER_IN_WSL = core_1.Command.toLocalizedCommand({
42
+ id: 'remote-wsl.open-current-folder-in-wsl',
43
+ label: 'Reopen Folder in WSL',
44
+ category: 'WSL'
45
+ }, 'theia/remote/wsl/reopenInWsl');
46
+ })(RemoteWslCommands || (exports.RemoteWslCommands = RemoteWslCommands = {}));
47
+ let WslConnectionContribution = class WslConnectionContribution extends remote_registry_contribution_1.AbstractRemoteRegistryContribution {
48
+ registerRemoteCommands(registry) {
49
+ if (!core_1.isWindows) {
50
+ // ignore this feature on non-Windows platforms
51
+ return;
52
+ }
53
+ registry.registerCommand(RemoteWslCommands.CONNECT_TO_WSL, {
54
+ execute: () => {
55
+ this.connectionProvider.getWslDistributions().then(distributions => {
56
+ const defaultDistro = distributions.find(dist => dist.default);
57
+ if (defaultDistro) {
58
+ this.connectToWSL(defaultDistro);
59
+ }
60
+ else {
61
+ this.getOrSelectWslDistribution().then(distribution => {
62
+ if (distribution) {
63
+ this.connectToWSL(distribution);
64
+ }
65
+ });
66
+ }
67
+ });
68
+ }
69
+ });
70
+ registry.registerCommand(RemoteWslCommands.CONNECT_TO_WSL_WITH_DISTRO, {
71
+ execute: () => this.getOrSelectWslDistribution().then(distribution => {
72
+ if (distribution) {
73
+ this.connectToWSL(distribution);
74
+ }
75
+ })
76
+ });
77
+ registry.registerCommand(RemoteWslCommands.OPEN_CURRENT_FOLDER_IN_WSL, {
78
+ execute: () => this.getOrSelectWslDistribution().then(distribution => {
79
+ var _a;
80
+ if (distribution) {
81
+ const workspacePath = (_a = this.workspaceService.workspace) === null || _a === void 0 ? void 0 : _a.resource.path.fsPath();
82
+ if (workspacePath) {
83
+ this.connectToWSL(distribution, this.toWSLMountPath(workspacePath));
84
+ }
85
+ }
86
+ }),
87
+ isVisible: () => !!this.workspaceService.workspace
88
+ });
89
+ }
90
+ async connectToWSL(distribution, workspace, preserveWindow = true) {
91
+ var _a, _b;
92
+ const connectionResult = await this.connectionProvider.connectToWsl({
93
+ nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate'],
94
+ distribution: distribution.name,
95
+ workspacePath: (_b = (_a = this.workspaceService.workspace) === null || _a === void 0 ? void 0 : _a.resource.path) === null || _b === void 0 ? void 0 : _b.fsPath()
96
+ });
97
+ if (workspace) {
98
+ this.workspaceServer.setMostRecentlyUsedWorkspace(`${wsl_workspaces_1.WSL_WORKSPACE_SCHEME}:${workspace}?distro=${distribution.name}`);
99
+ }
100
+ this.openRemote(connectionResult.port.toString(), !preserveWindow, workspace);
101
+ }
102
+ async getOrSelectWslDistribution() {
103
+ var _a;
104
+ const distributions = await this.connectionProvider.getWslDistributions();
105
+ if (distributions.length === 0) {
106
+ this.messageService.error(core_1.nls.localize('theia/remote/wsl/noWslDistroFound', 'No WSL distributions found. Please install a WSL distribution first.'));
107
+ return undefined;
108
+ }
109
+ if (distributions.length === 1) {
110
+ return distributions[0];
111
+ }
112
+ return (_a = (await this.quickInputService.pick(distributions.map(dist => ({
113
+ type: 'item',
114
+ label: dist.name,
115
+ description: dist.default ? core_1.nls.localizeByDefault('Default') : dist.version,
116
+ distribution: dist,
117
+ })), {
118
+ title: core_1.nls.localize('theia/remote/wsl/selectWSLDistro', 'Select a WSL distribution')
119
+ }))) === null || _a === void 0 ? void 0 : _a.distribution;
120
+ }
121
+ canHandle(uri) {
122
+ return uri.scheme === wsl_workspaces_1.WSL_WORKSPACE_SCHEME; // WSL doesn't use a special URI scheme
123
+ }
124
+ async openWorkspace(uri, options) {
125
+ const workspacePath = uri.path.toString();
126
+ const distroName = new URLSearchParams(uri.query).get('distro');
127
+ if (distroName) {
128
+ const distros = await this.connectionProvider.getWslDistributions();
129
+ const distro = distros.find(d => d.name === distroName);
130
+ if (!distro) {
131
+ throw new Error(`Invalid WSL workspace URI. Distribution ${distroName} not found.`);
132
+ }
133
+ this.connectToWSL(distro, workspacePath, options === null || options === void 0 ? void 0 : options.preserveWindow);
134
+ }
135
+ throw new Error('Invalid WSL workspace URI. No distrubution specified.');
136
+ }
137
+ async getWorkspaceLabel(uri) {
138
+ return `[WSL] ${uri.path.base}`;
139
+ }
140
+ toWSLMountPath(path) {
141
+ const driveLetter = path.charAt(0).toLowerCase();
142
+ const wslPath = path.replace(/^[a-zA-Z]:\\/, `/mnt/${driveLetter}/`);
143
+ return wslPath.replace(/\\/g, '/');
144
+ }
145
+ };
146
+ exports.WslConnectionContribution = WslConnectionContribution;
147
+ tslib_1.__decorate([
148
+ (0, inversify_1.inject)(remote_wsl_connection_provider_1.RemoteWslConnectionProvider),
149
+ tslib_1.__metadata("design:type", Object)
150
+ ], WslConnectionContribution.prototype, "connectionProvider", void 0);
151
+ tslib_1.__decorate([
152
+ (0, inversify_1.inject)(remote_preferences_1.RemotePreferences),
153
+ tslib_1.__metadata("design:type", Object)
154
+ ], WslConnectionContribution.prototype, "remotePreferences", void 0);
155
+ tslib_1.__decorate([
156
+ (0, inversify_1.inject)(workspace_storage_service_1.WorkspaceStorageService),
157
+ tslib_1.__metadata("design:type", workspace_storage_service_1.WorkspaceStorageService)
158
+ ], WslConnectionContribution.prototype, "workspaceStorageService", void 0);
159
+ tslib_1.__decorate([
160
+ (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
161
+ tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
162
+ ], WslConnectionContribution.prototype, "workspaceService", void 0);
163
+ tslib_1.__decorate([
164
+ (0, inversify_1.inject)(common_1.WorkspaceServer),
165
+ tslib_1.__metadata("design:type", Object)
166
+ ], WslConnectionContribution.prototype, "workspaceServer", void 0);
167
+ tslib_1.__decorate([
168
+ (0, inversify_1.inject)(core_1.QuickInputService),
169
+ tslib_1.__metadata("design:type", Object)
170
+ ], WslConnectionContribution.prototype, "quickInputService", void 0);
171
+ tslib_1.__decorate([
172
+ (0, inversify_1.inject)(core_1.MessageService),
173
+ tslib_1.__metadata("design:type", core_1.MessageService)
174
+ ], WslConnectionContribution.prototype, "messageService", void 0);
175
+ exports.WslConnectionContribution = WslConnectionContribution = tslib_1.__decorate([
176
+ (0, inversify_1.injectable)()
177
+ ], WslConnectionContribution);
178
+ ;
179
+ //# sourceMappingURL=wsl-connection-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wsl-connection-contribution.js","sourceRoot":"","sources":["../../src/electron-browser/wsl-connection-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,kHAAqI;AACrI,8FAA0F;AAC1F,sGAAiG;AACjG,sCAA8F;AAC9F,sFAAoI;AACpI,wDAA8D;AAC9D,sGAAiH;AACjH,sEAAyE;AAEzE,IAAiB,iBAAiB,CAkBjC;AAlBD,WAAiB,iBAAiB;IACjB,gCAAc,GAAG,cAAO,CAAC,kBAAkB,CAAC;QACrD,EAAE,EAAE,2BAA2B;QAC/B,KAA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BAAM,EAAC,4DAA2B,CAAC;;qEAC+B;AAGhD;IADlB,IAAA,kBAAM,EAAC,sCAAiB,CAAC;;oEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,mDAAuB,CAAC;sCACY,mDAAuB;0EAAC;AAGjD;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;sCACY,oCAAgB;mEAAC;AAGnC;IADlB,IAAA,kBAAM,EAAC,wBAAe,CAAC;;kEAC4B;AAGjC;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;oEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;iEAAC;oCAtBzC,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAoIrC;AAAA,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface WslDistribution {
2
+ name: string;
3
+ default: boolean;
4
+ version: string;
5
+ }
6
+ export interface WslConnectionOptions {
7
+ nodeDownloadTemplate: string;
8
+ distribution: string;
9
+ workspacePath?: string;
10
+ }
11
+ export interface WslConnectionResult {
12
+ port: number;
13
+ }
14
+ export declare const RemoteWslConnectionProviderPath = "/remote/wsl";
15
+ export declare const RemoteWslConnectionProvider: unique symbol;
16
+ export interface RemoteWslConnectionProvider {
17
+ getWslDistributions(): Promise<WslDistribution[]>;
18
+ connectToWsl(options: WslConnectionOptions): Promise<WslConnectionResult>;
19
+ }
20
+ //# sourceMappingURL=remote-wsl-connection-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-connection-provider.d.ts","sourceRoot":"","sources":["../../src/electron-common/remote-wsl-connection-provider.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,+BAA+B,gBAAgB,CAAC;AAE7D,eAAO,MAAM,2BAA2B,eAAwC,CAAC;AACjF,MAAM,WAAW,2BAA2B;IACxC,mBAAmB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAClD,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7E"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RemoteWslConnectionProvider = exports.RemoteWslConnectionProviderPath = void 0;
19
+ exports.RemoteWslConnectionProviderPath = '/remote/wsl';
20
+ exports.RemoteWslConnectionProvider = Symbol('RemoteWslConnectionProvider');
21
+ //# sourceMappingURL=remote-wsl-connection-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-connection-provider.js","sourceRoot":"","sources":["../../src/electron-common/remote-wsl-connection-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAkBnE,QAAA,+BAA+B,GAAG,aAAa,CAAC;AAEhD,QAAA,2BAA2B,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const WSL_WORKSPACE_SCHEME = "wsl";
2
+ //# sourceMappingURL=wsl-workspaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wsl-workspaces.d.ts","sourceRoot":"","sources":["../../src/electron-common/wsl-workspaces.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,oBAAoB,QAAQ,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WSL_WORKSPACE_SCHEME = void 0;
19
+ exports.WSL_WORKSPACE_SCHEME = 'wsl';
20
+ //# sourceMappingURL=wsl-workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wsl-workspaces.js","sourceRoot":"","sources":["../../src/electron-common/wsl-workspaces.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEnE,QAAA,oBAAoB,GAAG,KAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ export declare const wslRemoteConnectionModule: ContainerModule;
3
+ declare const _default: ContainerModule;
4
+ export default _default;
5
+ //# sourceMappingURL=remote-wsl-backend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-backend-module.d.ts","sourceRoot":"","sources":["../../src/electron-node/remote-wsl-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQ/D,eAAO,MAAM,yBAAyB,iBAQpC,CAAC;;AAEH,wBAMG"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.wslRemoteConnectionModule = void 0;
19
+ const inversify_1 = require("@theia/core/shared/inversify");
20
+ const remote_wsl_connection_provider_1 = require("./remote-wsl-connection-provider");
21
+ const remote_wsl_connection_provider_2 = require("../electron-common/remote-wsl-connection-provider");
22
+ const connection_container_module_1 = require("@theia/core/lib/node/messaging/connection-container-module");
23
+ const core_1 = require("@theia/core");
24
+ const wsl_workspace_handler_1 = require("./wsl-workspace-handler");
25
+ const default_workspace_server_1 = require("@theia/workspace/lib/node/default-workspace-server");
26
+ exports.wslRemoteConnectionModule = connection_container_module_1.ConnectionContainerModule.create(({ bind, bindBackendService }) => {
27
+ bind(remote_wsl_connection_provider_1.RemoteWslConnectionProviderImpl).toSelf().inSingletonScope();
28
+ bind(remote_wsl_connection_provider_2.RemoteWslConnectionProvider).toService(remote_wsl_connection_provider_1.RemoteWslConnectionProviderImpl);
29
+ bind(core_1.ConnectionHandler).toDynamicValue(ctx => new core_1.RpcConnectionHandler(remote_wsl_connection_provider_2.RemoteWslConnectionProviderPath, client => {
30
+ const server = ctx.container.get(remote_wsl_connection_provider_2.RemoteWslConnectionProvider);
31
+ return server;
32
+ }));
33
+ });
34
+ exports.default = new inversify_1.ContainerModule(bind => {
35
+ bind(connection_container_module_1.ConnectionContainerModule).toConstantValue(exports.wslRemoteConnectionModule);
36
+ bind(wsl_workspace_handler_1.WslWorkspaceHandler).toSelf().inSingletonScope();
37
+ bind(default_workspace_server_1.WorkspaceHandlerContribution).toService(wsl_workspace_handler_1.WslWorkspaceHandler);
38
+ });
39
+ //# sourceMappingURL=remote-wsl-backend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-backend-module.js","sourceRoot":"","sources":["../../src/electron-node/remote-wsl-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,4DAA+D;AAC/D,qFAAmF;AACnF,sGAAiI;AACjI,4GAAuG;AACvG,sCAAsE;AACtE,mEAA8D;AAC9D,iGAAkG;AAErF,QAAA,yBAAyB,GAAG,uDAAyB,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE;IACvG,IAAI,CAAC,gEAA+B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,4DAA2B,CAAC,CAAC,SAAS,CAAC,gEAA+B,CAAC,CAAC;IAC7E,IAAI,CAAC,wBAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,2BAAoB,CAA8B,gEAA+B,EAAE,MAAM,CAAC,EAAE;QAC5F,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAA8B,4DAA2B,CAAC,CAAC;QAC3F,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC,CAAC;AAEH,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,uDAAyB,CAAC,CAAC,eAAe,CAAC,iCAAyB,CAAC,CAAC;IAE3E,IAAI,CAAC,2CAAmB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACtD,IAAI,CAAC,uDAA4B,CAAC,CAAC,SAAS,CAAC,2CAAmB,CAAC,CAAC;AAEtE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { RemoteWslConnectionProvider, WslDistribution, WslConnectionOptions, WslConnectionResult } from '../electron-common/remote-wsl-connection-provider';
2
+ import { RemoteConnectionService } from '@theia/remote/lib/electron-node/remote-connection-service';
3
+ import { RemoteSetupService } from '@theia/remote/lib/electron-node/setup/remote-setup-service';
4
+ import { MessageService } from '@theia/core';
5
+ export declare class RemoteWslConnectionProviderImpl implements RemoteWslConnectionProvider {
6
+ protected readonly remoteConnectionService: RemoteConnectionService;
7
+ protected readonly remoteSetup: RemoteSetupService;
8
+ protected readonly messageService: MessageService;
9
+ dispose(): void;
10
+ /**
11
+ * executes `wsl.exe --list` to get the list of WSL distributions.
12
+ * The Output format look like this:
13
+ * ```
14
+ * NAME STATE VERSION
15
+ * * Ubuntu Stopped 2
16
+ * Other Distro Stopped 2
17
+ * ```
18
+ * so we split the output by lines and then by whitespace. The * indicates the default distribution so this has to be handled slightly different.
19
+ *
20
+ * @returns a list of WslDistribution objects, each containing the name, default status, and version.
21
+ */
22
+ getWslDistributions(): Promise<WslDistribution[]>;
23
+ connectToWsl(options: WslConnectionOptions): Promise<WslConnectionResult>;
24
+ }
25
+ //# sourceMappingURL=remote-wsl-connection-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-connection-provider.d.ts","sourceRoot":"","sources":["../../src/electron-node/remote-wsl-connection-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAC5J,OAAO,EAAE,uBAAuB,EAAE,MAAM,2DAA2D,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAEhG,OAAO,EAAE,cAAc,EAAgB,MAAM,aAAa,CAAC;AAG3D,qBACa,+BAAgC,YAAW,2BAA2B;IAG/E,SAAS,CAAC,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAGpE,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IAGnD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAElD,OAAO,IAAI,IAAI;IAGf;;;;;;;;;;;OAWG;IACG,mBAAmB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAgCjD,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAsClF"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2025 TypeFox and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RemoteWslConnectionProviderImpl = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const remote_connection_service_1 = require("@theia/remote/lib/electron-node/remote-connection-service");
22
+ const remote_setup_service_1 = require("@theia/remote/lib/electron-node/setup/remote-setup-service");
23
+ const child_process_1 = require("child_process");
24
+ const core_1 = require("@theia/core");
25
+ const remote_wsl_connection_1 = require("./remote-wsl-connection");
26
+ let RemoteWslConnectionProviderImpl = class RemoteWslConnectionProviderImpl {
27
+ dispose() {
28
+ }
29
+ /**
30
+ * executes `wsl.exe --list` to get the list of WSL distributions.
31
+ * The Output format look like this:
32
+ * ```
33
+ * NAME STATE VERSION
34
+ * * Ubuntu Stopped 2
35
+ * Other Distro Stopped 2
36
+ * ```
37
+ * so we split the output by lines and then by whitespace. The * indicates the default distribution so this has to be handled slightly different.
38
+ *
39
+ * @returns a list of WslDistribution objects, each containing the name, default status, and version.
40
+ */
41
+ async getWslDistributions() {
42
+ return new Promise((resolve, reject) => {
43
+ (0, child_process_1.exec)('wsl.exe --list --verbose --all', (error, stdout, stderr) => {
44
+ if (error) {
45
+ const errorMessage = `Error executing wsl.exe: ${error} \n ${stderr}`;
46
+ console.error(errorMessage);
47
+ reject(errorMessage);
48
+ return;
49
+ }
50
+ const lines = stdout
51
+ .replace(/\0/g, '')
52
+ .split('\n')
53
+ .map(line => line.replace('\r', '').trim())
54
+ .filter(line => line.length > 0)
55
+ .slice(1); // Skip header line
56
+ resolve(lines.map(line => {
57
+ const parts = line.split(/\s+/);
58
+ const isDefault = parts[0] === '*';
59
+ const name = isDefault ? parts[1] : parts[0];
60
+ const version = isDefault ? parts[3] : parts[2];
61
+ return {
62
+ name,
63
+ default: isDefault,
64
+ version
65
+ };
66
+ }));
67
+ });
68
+ });
69
+ }
70
+ async connectToWsl(options) {
71
+ const progress = await this.messageService.showProgress({
72
+ text: 'Connecting to WSL'
73
+ });
74
+ try {
75
+ const connection = new remote_wsl_connection_1.RemoteWslConnection({
76
+ id: (0, core_1.generateUuid)(),
77
+ name: options.distribution,
78
+ type: 'WSL',
79
+ distribution: options.distribution,
80
+ });
81
+ const report = message => progress.report({ message });
82
+ report('Setting up remote environment...');
83
+ await this.remoteSetup.setup({
84
+ connection,
85
+ report,
86
+ nodeDownloadTemplate: options.nodeDownloadTemplate
87
+ });
88
+ const registration = this.remoteConnectionService.register(connection);
89
+ connection.onDidDisconnect(() => {
90
+ registration.dispose();
91
+ });
92
+ return {
93
+ port: connection.remotePort,
94
+ };
95
+ }
96
+ catch (e) {
97
+ this.messageService.error(`Failed to connect to WSL: ${e.message}`);
98
+ throw e;
99
+ }
100
+ finally {
101
+ progress.cancel();
102
+ }
103
+ }
104
+ };
105
+ exports.RemoteWslConnectionProviderImpl = RemoteWslConnectionProviderImpl;
106
+ tslib_1.__decorate([
107
+ (0, inversify_1.inject)(remote_connection_service_1.RemoteConnectionService),
108
+ tslib_1.__metadata("design:type", remote_connection_service_1.RemoteConnectionService)
109
+ ], RemoteWslConnectionProviderImpl.prototype, "remoteConnectionService", void 0);
110
+ tslib_1.__decorate([
111
+ (0, inversify_1.inject)(remote_setup_service_1.RemoteSetupService),
112
+ tslib_1.__metadata("design:type", remote_setup_service_1.RemoteSetupService)
113
+ ], RemoteWslConnectionProviderImpl.prototype, "remoteSetup", void 0);
114
+ tslib_1.__decorate([
115
+ (0, inversify_1.inject)(core_1.MessageService),
116
+ tslib_1.__metadata("design:type", core_1.MessageService)
117
+ ], RemoteWslConnectionProviderImpl.prototype, "messageService", void 0);
118
+ exports.RemoteWslConnectionProviderImpl = RemoteWslConnectionProviderImpl = tslib_1.__decorate([
119
+ (0, inversify_1.injectable)()
120
+ ], RemoteWslConnectionProviderImpl);
121
+ //# sourceMappingURL=remote-wsl-connection-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-wsl-connection-provider.js","sourceRoot":"","sources":["../../src/electron-node/remote-wsl-connection-provider.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAElE,yGAAoG;AACpG,qGAAgG;AAChG,iDAAqC;AACrC,sCAA2D;AAC3D,mEAA8D;AAGvD,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAWxC,OAAO;IACP,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,mBAAmB;QACrB,OAAO,IAAI,OAAO,CAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,IAAA,oBAAI,EAAC,gCAAgC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBAC7D,IAAI,KAAK,EAAE,CAAC;oBACR,MAAM,YAAY,GAAG,4BAA4B,KAAK,OAAO,MAAM,EAAE,CAAC;oBACtE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;oBAC5B,MAAM,CAAC,YAAY,CAAC,CAAC;oBACrB,OAAO;gBACX,CAAC;gBAED,MAAM,KAAK,GAAG,MAAM;qBACf,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;qBAClB,KAAK,CAAC,IAAI,CAAC;qBACX,GAAG,CAAC,IAAI,CAAC,EAA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