@theia/remote 1.76.0-next.6 → 1.76.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.
- package/lib/electron-browser/remote-cli-args-collector.d.ts +16 -0
- package/lib/electron-browser/remote-cli-args-collector.d.ts.map +1 -0
- package/lib/electron-browser/remote-cli-args-collector.js +59 -0
- package/lib/electron-browser/remote-cli-args-collector.js.map +1 -0
- package/lib/electron-browser/remote-cli-args-collector.spec.d.ts +2 -0
- package/lib/electron-browser/remote-cli-args-collector.spec.d.ts.map +1 -0
- package/lib/electron-browser/remote-cli-args-collector.spec.js +45 -0
- package/lib/electron-browser/remote-cli-args-collector.spec.js.map +1 -0
- package/lib/electron-browser/remote-frontend-module.d.ts.map +1 -1
- package/lib/electron-browser/remote-frontend-module.js +2 -0
- package/lib/electron-browser/remote-frontend-module.js.map +1 -1
- package/lib/electron-node/setup/remote-setup-service.d.ts +7 -1
- package/lib/electron-node/setup/remote-setup-service.d.ts.map +1 -1
- package/lib/electron-node/setup/remote-setup-service.js +6 -3
- package/lib/electron-node/setup/remote-setup-service.js.map +1 -1
- package/package.json +9 -9
- package/src/electron-browser/remote-cli-args-collector.spec.ts +48 -0
- package/src/electron-browser/remote-cli-args-collector.ts +49 -0
- package/src/electron-browser/remote-frontend-module.ts +3 -0
- package/src/electron-node/setup/remote-setup-service.ts +15 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContributionProvider, ILogger } from '@theia/core';
|
|
2
|
+
import { RemoteCliArgsContribution } from '@theia/core/lib/common/remote-cli-args-contribution';
|
|
3
|
+
/**
|
|
4
|
+
* Collects the extra CLI arguments to pass to a remote backend from all
|
|
5
|
+
* {@link RemoteCliArgsContribution}s. This carries per-window options (e.g. the forwarded
|
|
6
|
+
* `--session-preference` values of a second-instance window) that the shared local backend cannot
|
|
7
|
+
* provide. Usable by any remote attach flow (dev container, SSH) so they stay consistent.
|
|
8
|
+
*
|
|
9
|
+
* @experimental
|
|
10
|
+
*/
|
|
11
|
+
export declare class RemoteCliArgsCollector {
|
|
12
|
+
protected readonly contributions: ContributionProvider<RemoteCliArgsContribution>;
|
|
13
|
+
protected readonly logger: ILogger;
|
|
14
|
+
collect(): Promise<string[]>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=remote-cli-args-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-cli-args-collector.d.ts","sourceRoot":"","sources":["../../src/electron-browser/remote-cli-args-collector.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAEhG;;;;;;;GAOG;AACH,qBACa,sBAAsB;IAG/B,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC;IAGlF,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAE7B,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAWrC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource GmbH 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.RemoteCliArgsCollector = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const core_1 = require("@theia/core");
|
|
22
|
+
const remote_cli_args_contribution_1 = require("@theia/core/lib/common/remote-cli-args-contribution");
|
|
23
|
+
/**
|
|
24
|
+
* Collects the extra CLI arguments to pass to a remote backend from all
|
|
25
|
+
* {@link RemoteCliArgsContribution}s. This carries per-window options (e.g. the forwarded
|
|
26
|
+
* `--session-preference` values of a second-instance window) that the shared local backend cannot
|
|
27
|
+
* provide. Usable by any remote attach flow (dev container, SSH) so they stay consistent.
|
|
28
|
+
*
|
|
29
|
+
* @experimental
|
|
30
|
+
*/
|
|
31
|
+
let RemoteCliArgsCollector = class RemoteCliArgsCollector {
|
|
32
|
+
async collect() {
|
|
33
|
+
const args = [];
|
|
34
|
+
for (const contribution of this.contributions.getContributions()) {
|
|
35
|
+
try {
|
|
36
|
+
args.push(...await contribution.getRemoteCliArgs());
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
this.logger.warn('Failed to collect remote CLI args from a contribution:', e);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return args;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.RemoteCliArgsCollector = RemoteCliArgsCollector;
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, inversify_1.inject)(core_1.ContributionProvider),
|
|
48
|
+
(0, inversify_1.named)(remote_cli_args_contribution_1.RemoteCliArgsContribution),
|
|
49
|
+
tslib_1.__metadata("design:type", Object)
|
|
50
|
+
], RemoteCliArgsCollector.prototype, "contributions", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, inversify_1.inject)(core_1.ILogger),
|
|
53
|
+
(0, inversify_1.named)('remote:RemoteCliArgsCollector'),
|
|
54
|
+
tslib_1.__metadata("design:type", Object)
|
|
55
|
+
], RemoteCliArgsCollector.prototype, "logger", void 0);
|
|
56
|
+
exports.RemoteCliArgsCollector = RemoteCliArgsCollector = tslib_1.__decorate([
|
|
57
|
+
(0, inversify_1.injectable)()
|
|
58
|
+
], RemoteCliArgsCollector);
|
|
59
|
+
//# sourceMappingURL=remote-cli-args-collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-cli-args-collector.js","sourceRoot":"","sources":["../../src/electron-browser/remote-cli-args-collector.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAAyE;AACzE,sCAA4D;AAC5D,sGAAgG;AAEhG;;;;;;;GAOG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAQ/B,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACD,IAAI,CAAC,IAAI,CAAC,GAAG,MAAM,YAAY,CAAC,gBAAgB,EAAE,CAAC,CAAC;YACxD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wDAAwD,EAAE,CAAC,CAAC,CAAC;YAClF,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAnBY,wDAAsB;AAGZ;IADlB,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,wDAAyB,CAAC;;6DACmB;AAG/D;IADlB,IAAA,kBAAM,EAAC,cAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,+BAA+B,CAAC;;sDACrB;iCAN1B,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAmBlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-cli-args-collector.spec.d.ts","sourceRoot":"","sources":["../../src/electron-browser/remote-cli-args-collector.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource GmbH 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 chai_1 = require("chai");
|
|
19
|
+
const remote_cli_args_collector_1 = require("./remote-cli-args-collector");
|
|
20
|
+
function collectorWith(contributions) {
|
|
21
|
+
const collector = new remote_cli_args_collector_1.RemoteCliArgsCollector();
|
|
22
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
|
+
collector.contributions = { getContributions: () => contributions };
|
|
24
|
+
collector.logger = { warn: () => { } };
|
|
25
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
26
|
+
return collector;
|
|
27
|
+
}
|
|
28
|
+
describe('RemoteCliArgsCollector', () => {
|
|
29
|
+
it('flattens the args from every contribution', async () => {
|
|
30
|
+
const collector = collectorWith([
|
|
31
|
+
{ getRemoteCliArgs: () => ['--session-preference=a=base64:MQ=='] },
|
|
32
|
+
{ getRemoteCliArgs: () => [] },
|
|
33
|
+
{ getRemoteCliArgs: async () => ['--x', '--y'] }
|
|
34
|
+
]);
|
|
35
|
+
(0, chai_1.expect)(await collector.collect()).to.deep.equal(['--session-preference=a=base64:MQ==', '--x', '--y']);
|
|
36
|
+
});
|
|
37
|
+
it('ignores a failing contribution and keeps the others', async () => {
|
|
38
|
+
const collector = collectorWith([
|
|
39
|
+
{ getRemoteCliArgs: () => { throw new Error('boom'); } },
|
|
40
|
+
{ getRemoteCliArgs: () => ['--ok'] }
|
|
41
|
+
]);
|
|
42
|
+
(0, chai_1.expect)(await collector.collect()).to.deep.equal(['--ok']);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=remote-cli-args-collector.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-cli-args-collector.spec.js","sourceRoot":"","sources":["../../src/electron-browser/remote-cli-args-collector.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,+BAA8B;AAE9B,2EAAqE;AAErE,SAAS,aAAa,CAAC,aAA0C;IAC7D,MAAM,SAAS,GAAG,IAAI,kDAAsB,EAAE,CAAC;IAC/C,uDAAuD;IACtD,SAAiB,CAAC,aAAa,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC;IAC5E,SAAiB,CAAC,MAAM,GAA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appings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAgB/D,OAAO,6DAA6D,CAAC;;
|
|
1
|
+
{"version":3,"file":"remote-frontend-module.d.ts","sourceRoot":"","sources":["../../src/electron-browser/remote-frontend-module.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAgB/D,OAAO,6DAA6D,CAAC;;AAWrE,wBAuDG"}
|
|
@@ -41,6 +41,7 @@ const env_variables_1 = require("@theia/core/lib/common/env-variables");
|
|
|
41
41
|
const browser_2 = require("@theia/workspace/lib/browser");
|
|
42
42
|
const remote_local_workspace_contribution_1 = require("./remote-local-workspace-contribution");
|
|
43
43
|
const file_service_1 = require("@theia/filesystem/lib/browser/file-service");
|
|
44
|
+
const remote_cli_args_collector_1 = require("./remote-cli-args-collector");
|
|
44
45
|
exports.default = new inversify_1.ContainerModule((bind, _, __, rebind) => {
|
|
45
46
|
bind(remote_frontend_contribution_1.RemoteFrontendContribution).toSelf().inSingletonScope();
|
|
46
47
|
bind(browser_1.FrontendApplicationContribution).toService(remote_frontend_contribution_1.RemoteFrontendContribution);
|
|
@@ -51,6 +52,7 @@ exports.default = new inversify_1.ContainerModule((bind, _, __, rebind) => {
|
|
|
51
52
|
(0, remote_preferences_1.bindRemotePreferences)(bind);
|
|
52
53
|
rebind(electron_file_dialog_service_1.ElectronFileDialogService).to(remote_electron_file_dialog_service_1.RemoteElectronFileDialogService).inSingletonScope();
|
|
53
54
|
bind(remote_service_1.RemoteService).toSelf().inSingletonScope();
|
|
55
|
+
bind(remote_cli_args_collector_1.RemoteCliArgsCollector).toSelf().inSingletonScope();
|
|
54
56
|
bind(port_forwarding_widget_1.PortForwardingWidget).toSelf();
|
|
55
57
|
bind(browser_1.WidgetFactory).toDynamicValue(context => ({
|
|
56
58
|
id: port_forwarding_widget_1.PORT_FORWARDING_WIDGET_ID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-frontend-module.js","sourceRoot":"","sources":["../../src/electron-browser/remote-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,sCAAgF;AAChF,4DAA+D;AAC/D,qDAAyH;AACzH,uEAAkE;AAClE,sGAAiI;AACjI,iFAA4E;AAC5E,iFAA4E;AAC5E,qDAAiD;AACjD,oFAAwG;AACxG,kIAA4H;AAC5H,+FAAwF;AACxF,8EAA8E;AAC9E,qFAA2G;AAC3G,+FAA2F;AAC3F,uFAAkF;AAClF,wGAA0I;AAC1I,+GAA0G;AAC1G,uEAAqE;AACrE,wGAAmG;AACnG,iFAA+E;AAC/E,0GAAgL;AAChL,qEAAiK;AACjK,wEAA4F;AAC5F,0DAA+G;AAC/G,+FAAyF;AACzF,6EAAqF;
|
|
1
|
+
{"version":3,"file":"remote-frontend-module.js","sourceRoot":"","sources":["../../src/electron-browser/remote-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,sCAAgF;AAChF,4DAA+D;AAC/D,qDAAyH;AACzH,uEAAkE;AAClE,sGAAiI;AACjI,iFAA4E;AAC5E,iFAA4E;AAC5E,qDAAiD;AACjD,oFAAwG;AACxG,kIAA4H;AAC5H,+FAAwF;AACxF,8EAA8E;AAC9E,qFAA2G;AAC3G,+FAA2F;AAC3F,uFAAkF;AAClF,wGAA0I;AAC1I,+G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IAAI,CAAC,gDAAuB,CAAC,CAAC,SAAS,CAAC,kCAAkB,CAAC,CAAC;QAC5D,IAAI,CAAC,sDAA6B,CAAC,CAAC,SAAS,CAAC,sDAAwB,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,CAAC,mDAAuB,CAAC,CAAC,EAAE,CAAC,4DAA6B,CAAC,CAAC;IAElE,IAAI,kBAAQ,EAAE,CAAC;QACX,IAAI,CAAC,sEAAgC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACnE,IAAI,CAAC,0CAAgC,CAAC,CAAC,SAAS,CAAC,sEAAgC,CAAC,CAAC;QACnF,IAAI,CAAC,uCAA6B,CAAC,CAAC,SAAS,CAAC,sEAAgC,CAAC,CAAC;QAChF,IAAI,CAAC,0DAAiC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACpE,IAAI,CAAC,sCAAuB,CAAC,CAAC,SAAS,CAAC,0DAAiC,CAAC,CAAC;IAC/E,CAAC;AAEL,CAAC,CAAC,CAAC"}
|
|
@@ -10,6 +10,12 @@ export interface RemoteSetupOptions {
|
|
|
10
10
|
connection: RemoteConnection;
|
|
11
11
|
report: RemoteStatusReport;
|
|
12
12
|
nodeDownloadTemplate?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CLI arguments to append when starting the remote backend, after the arguments
|
|
15
|
+
* contributed by {@link RemoteCliContribution}s. Used to carry per-window options (e.g.
|
|
16
|
+
* `--session-preference`) that the shared local backend cannot provide.
|
|
17
|
+
*/
|
|
18
|
+
additionalArgs?: string[];
|
|
13
19
|
}
|
|
14
20
|
export interface RemoteSetupResult {
|
|
15
21
|
applicationDirectory: string;
|
|
@@ -23,7 +29,7 @@ export declare class RemoteSetupService {
|
|
|
23
29
|
protected readonly applicationPackage: ApplicationPackage;
|
|
24
30
|
protected readonly cliContributions: ContributionProvider<RemoteCliContribution>;
|
|
25
31
|
setup(options: RemoteSetupOptions): Promise<RemoteSetupResult>;
|
|
26
|
-
protected startApplication(connection: RemoteConnection, platform: RemotePlatform, remotePath: string, nodeDir: string): Promise<number>;
|
|
32
|
+
protected startApplication(connection: RemoteConnection, platform: RemotePlatform, remotePath: string, nodeDir: string, additionalArgs?: string[]): Promise<number>;
|
|
27
33
|
protected detectRemotePlatform(connection: RemoteConnection): Promise<RemotePlatform>;
|
|
28
34
|
protected getRemoteHomeDirectory(connection: RemoteConnection, platform: RemotePlatform): Promise<string>;
|
|
29
35
|
protected getRemoteAppName(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAoB,qBAAqB,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAC9H,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAqB,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IAC/B,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,kBAAkB,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"remote-setup-service.d.ts","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzF,O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AAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,GAAE,MAAM,EAAO,GAC3H,OAAO,CAAC,MAAM,CAAC;cAoCF,oBAAoB,CAAC,UAAU,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC;cAgD3E,sBAAsB,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/G,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAMpC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;cAIpC,WAAW,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAOtG,eAAe,CAAC,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;cAKnF,WAAW,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAO/H,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAGzI"}
|
|
@@ -27,7 +27,7 @@ const remote_node_setup_service_1 = require("./remote-node-setup-service");
|
|
|
27
27
|
const remote_setup_script_service_1 = require("./remote-setup-script-service");
|
|
28
28
|
let RemoteSetupService = class RemoteSetupService {
|
|
29
29
|
async setup(options) {
|
|
30
|
-
const { connection, report, nodeDownloadTemplate } = options;
|
|
30
|
+
const { connection, report, nodeDownloadTemplate, additionalArgs } = options;
|
|
31
31
|
report('Identifying remote system...');
|
|
32
32
|
// 1. Identify remote platform
|
|
33
33
|
const platform = await this.detectRemotePlatform(connection);
|
|
@@ -59,14 +59,14 @@ let RemoteSetupService = class RemoteSetupService {
|
|
|
59
59
|
}
|
|
60
60
|
// 5. start remote backend
|
|
61
61
|
report('Starting application on remote...');
|
|
62
|
-
const port = await this.startApplication(connection, platform, applicationDirectory, remoteNodeDirectory);
|
|
62
|
+
const port = await this.startApplication(connection, platform, applicationDirectory, remoteNodeDirectory, additionalArgs);
|
|
63
63
|
connection.remotePort = port;
|
|
64
64
|
return {
|
|
65
65
|
applicationDirectory: libDir,
|
|
66
66
|
nodeDirectory: remoteNodeDirectory
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
async startApplication(connection, platform, remotePath, nodeDir) {
|
|
69
|
+
async startApplication(connection, platform, remotePath, nodeDir, additionalArgs = []) {
|
|
70
70
|
const nodeExecutable = this.scriptService.joinPath(platform, nodeDir, ...(platform.os === core_1.OS.Type.Windows ? ['node.exe'] : ['bin', 'node']));
|
|
71
71
|
const mainJsFile = this.scriptService.joinPath(platform, remotePath, 'lib', 'backend', 'main.js');
|
|
72
72
|
const localAddressRegex = /listening on http:\/\/0.0.0.0:(\d+)/;
|
|
@@ -85,6 +85,9 @@ let RemoteSetupService = class RemoteSetupService {
|
|
|
85
85
|
args.push(...await cli.enhanceArgs(remoteContext));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
// Per-window arguments (e.g. session preferences forwarded to a second-instance window)
|
|
89
|
+
// are appended last so they take precedence over the shared backend's contributions.
|
|
90
|
+
args.push(...additionalArgs);
|
|
88
91
|
// Change to the remote application path and start a node process with the copied main.js file
|
|
89
92
|
// This way, our current working directory is set as expected
|
|
90
93
|
const result = await connection.execPartial(`${prefix}cd "${remotePath}";${nodeExecutable}`, stdout => localAddressRegex.test(stdout), [mainJsFile, ...args]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote-setup-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-service.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,4DAAyE;AAEzE,iGAA8H;AAC9H,uFAAmF;AACnF,+DAA0D;AAC1D,yFAAmF;AACnF,sCAAsE;AACtE,2EAAqE;AACrE,+EAAyE;
|
|
1
|
+
{"version":3,"file":"remote-setup-service.js","sourceRoot":"","sources":["../../../src/electron-node/setup/remote-setup-service.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,4DAAyE;AAEzE,iGAA8H;AAC9H,uFAAmF;AACnF,+DAA0D;AAC1D,yFAAmF;AACnF,sCAAsE;AACtE,2EAAqE;AACrE,+EAAyE;AAoBlE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAoB3B,KAAK,CAAC,KAAK,CAAC,OAA2B;QACnC,MAAM,EACF,UAAU,EACV,MAAM,EACN,oBAAoB,EACpB,cAAc,EACjB,GAAG,OAAO,CAAC;QACZ,MAAM,CAAC,8BAA8B,CAAC,CAAC;QACvC,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC7D,0BAA0B;QAC1B,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC3E,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC,gBAAgB,EA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,EAAE,MAAc;QACtG,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACxE,CAAC;CACJ,CAAA;AA7LY,gDAAkB;AAGR;IADlB,IAAA,kBAAM,EAAC,uCAAiB,CAAC;sCACM,uCAAiB;uDAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,gEAA6B,CAAC;sCACM,gEAA6B;mEAAC;AAGvD;IADlB,IAAA,kBAAM,EAAC,kDAAsB,CAAC;sCACM,kDAAsB;4DAAC;AAGzC;IADlB,IAAA,kBAAM,EAAC,sDAAwB,CAAC;sCACC,sDAAwB;yDAAC;AAGxC;IADlB,IAAA,kBAAM,EAAC,wCAAkB,CAAC;sCACY,wCAAkB;8DAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAAE,IAAA,iBAAK,EAAC,+CAAqB,CAAC;;4DACsB;6BAlBxE,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CA6L9B"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/remote",
|
|
3
|
-
"version": "1.76.0
|
|
3
|
+
"version": "1.76.0",
|
|
4
4
|
"description": "Theia - Remote",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.76.0
|
|
7
|
-
"@theia/filesystem": "1.76.0
|
|
8
|
-
"@theia/userstorage": "1.76.0
|
|
9
|
-
"@theia/variable-resolver": "1.76.0
|
|
10
|
-
"@theia/workspace": "1.76.0
|
|
6
|
+
"@theia/core": "1.76.0",
|
|
7
|
+
"@theia/filesystem": "1.76.0",
|
|
8
|
+
"@theia/userstorage": "1.76.0",
|
|
9
|
+
"@theia/variable-resolver": "1.76.0",
|
|
10
|
+
"@theia/workspace": "1.76.0",
|
|
11
11
|
"archiver": "^5.3.2",
|
|
12
12
|
"decompress": "^4.2.1",
|
|
13
13
|
"decompress-tar": "^4.1.1",
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
"watch": "theiaext watch"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@theia/ext-scripts": "1.
|
|
59
|
+
"@theia/ext-scripts": "1.76.0",
|
|
60
60
|
"@types/archiver": "^5.3.4",
|
|
61
61
|
"@types/decompress": "^4.2.7",
|
|
62
62
|
"@types/express-http-proxy": "^1.6.7",
|
|
63
63
|
"@types/glob": "^8.1.0",
|
|
64
|
-
"@types/ssh2": "^1.15.
|
|
64
|
+
"@types/ssh2": "^1.15.6",
|
|
65
65
|
"@types/ssh2-sftp-client": "^9.0.6"
|
|
66
66
|
},
|
|
67
67
|
"nyc": {
|
|
68
68
|
"extends": "../../configs/nyc.json"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "b9b54c500b46515512e2b44371bc0c7122947bed"
|
|
71
71
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import { RemoteCliArgsContribution } from '@theia/core/lib/common/remote-cli-args-contribution';
|
|
19
|
+
import { RemoteCliArgsCollector } from './remote-cli-args-collector';
|
|
20
|
+
|
|
21
|
+
function collectorWith(contributions: RemoteCliArgsContribution[]): RemoteCliArgsCollector {
|
|
22
|
+
const collector = new RemoteCliArgsCollector();
|
|
23
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
24
|
+
(collector as any).contributions = { getContributions: () => contributions };
|
|
25
|
+
(collector as any).logger = { warn: () => { } };
|
|
26
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
27
|
+
return collector;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
describe('RemoteCliArgsCollector', () => {
|
|
31
|
+
|
|
32
|
+
it('flattens the args from every contribution', async () => {
|
|
33
|
+
const collector = collectorWith([
|
|
34
|
+
{ getRemoteCliArgs: () => ['--session-preference=a=base64:MQ=='] },
|
|
35
|
+
{ getRemoteCliArgs: () => [] },
|
|
36
|
+
{ getRemoteCliArgs: async () => ['--x', '--y'] }
|
|
37
|
+
]);
|
|
38
|
+
expect(await collector.collect()).to.deep.equal(['--session-preference=a=base64:MQ==', '--x', '--y']);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('ignores a failing contribution and keeps the others', async () => {
|
|
42
|
+
const collector = collectorWith([
|
|
43
|
+
{ getRemoteCliArgs: () => { throw new Error('boom'); } },
|
|
44
|
+
{ getRemoteCliArgs: () => ['--ok'] }
|
|
45
|
+
]);
|
|
46
|
+
expect(await collector.collect()).to.deep.equal(['--ok']);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource GmbH and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
18
|
+
import { ContributionProvider, ILogger } from '@theia/core';
|
|
19
|
+
import { RemoteCliArgsContribution } from '@theia/core/lib/common/remote-cli-args-contribution';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Collects the extra CLI arguments to pass to a remote backend from all
|
|
23
|
+
* {@link RemoteCliArgsContribution}s. This carries per-window options (e.g. the forwarded
|
|
24
|
+
* `--session-preference` values of a second-instance window) that the shared local backend cannot
|
|
25
|
+
* provide. Usable by any remote attach flow (dev container, SSH) so they stay consistent.
|
|
26
|
+
*
|
|
27
|
+
* @experimental
|
|
28
|
+
*/
|
|
29
|
+
@injectable()
|
|
30
|
+
export class RemoteCliArgsCollector {
|
|
31
|
+
|
|
32
|
+
@inject(ContributionProvider) @named(RemoteCliArgsContribution)
|
|
33
|
+
protected readonly contributions: ContributionProvider<RemoteCliArgsContribution>;
|
|
34
|
+
|
|
35
|
+
@inject(ILogger) @named('remote:RemoteCliArgsCollector')
|
|
36
|
+
protected readonly logger: ILogger;
|
|
37
|
+
|
|
38
|
+
async collect(): Promise<string[]> {
|
|
39
|
+
const args: string[] = [];
|
|
40
|
+
for (const contribution of this.contributions.getContributions()) {
|
|
41
|
+
try {
|
|
42
|
+
args.push(...await contribution.getRemoteCliArgs());
|
|
43
|
+
} catch (e) {
|
|
44
|
+
this.logger.warn('Failed to collect remote CLI args from a contribution:', e);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return args;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -40,6 +40,7 @@ import { envVariablesPath, EnvVariablesServer } from '@theia/core/lib/common/env
|
|
|
40
40
|
import { WorkspaceHandlingContribution, WorkspaceOpenHandlerContribution } from '@theia/workspace/lib/browser';
|
|
41
41
|
import { RemoteLocalWorkspaceContribution } from './remote-local-workspace-contribution';
|
|
42
42
|
import { FileServiceContribution } from '@theia/filesystem/lib/browser/file-service';
|
|
43
|
+
import { RemoteCliArgsCollector } from './remote-cli-args-collector';
|
|
43
44
|
|
|
44
45
|
export default new ContainerModule((bind, _, __, rebind) => {
|
|
45
46
|
bind(RemoteFrontendContribution).toSelf().inSingletonScope();
|
|
@@ -56,6 +57,8 @@ export default new ContainerModule((bind, _, __, rebind) => {
|
|
|
56
57
|
|
|
57
58
|
bind(RemoteService).toSelf().inSingletonScope();
|
|
58
59
|
|
|
60
|
+
bind(RemoteCliArgsCollector).toSelf().inSingletonScope();
|
|
61
|
+
|
|
59
62
|
bind(PortForwardingWidget).toSelf();
|
|
60
63
|
bind(WidgetFactory).toDynamicValue(context => ({
|
|
61
64
|
id: PORT_FORWARDING_WIDGET_ID,
|
|
@@ -28,6 +28,12 @@ export interface RemoteSetupOptions {
|
|
|
28
28
|
connection: RemoteConnection;
|
|
29
29
|
report: RemoteStatusReport;
|
|
30
30
|
nodeDownloadTemplate?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Additional CLI arguments to append when starting the remote backend, after the arguments
|
|
33
|
+
* contributed by {@link RemoteCliContribution}s. Used to carry per-window options (e.g.
|
|
34
|
+
* `--session-preference`) that the shared local backend cannot provide.
|
|
35
|
+
*/
|
|
36
|
+
additionalArgs?: string[];
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
export interface RemoteSetupResult {
|
|
@@ -60,7 +66,8 @@ export class RemoteSetupService {
|
|
|
60
66
|
const {
|
|
61
67
|
connection,
|
|
62
68
|
report,
|
|
63
|
-
nodeDownloadTemplate
|
|
69
|
+
nodeDownloadTemplate,
|
|
70
|
+
additionalArgs
|
|
64
71
|
} = options;
|
|
65
72
|
report('Identifying remote system...');
|
|
66
73
|
// 1. Identify remote platform
|
|
@@ -93,7 +100,7 @@ export class RemoteSetupService {
|
|
|
93
100
|
}
|
|
94
101
|
// 5. start remote backend
|
|
95
102
|
report('Starting application on remote...');
|
|
96
|
-
const port = await this.startApplication(connection, platform, applicationDirectory, remoteNodeDirectory);
|
|
103
|
+
const port = await this.startApplication(connection, platform, applicationDirectory, remoteNodeDirectory, additionalArgs);
|
|
97
104
|
connection.remotePort = port;
|
|
98
105
|
return {
|
|
99
106
|
applicationDirectory: libDir,
|
|
@@ -101,7 +108,9 @@ export class RemoteSetupService {
|
|
|
101
108
|
};
|
|
102
109
|
}
|
|
103
110
|
|
|
104
|
-
protected async startApplication(
|
|
111
|
+
protected async startApplication(
|
|
112
|
+
connection: RemoteConnection, platform: RemotePlatform, remotePath: string, nodeDir: string, additionalArgs: string[] = []
|
|
113
|
+
): Promise<number> {
|
|
105
114
|
const nodeExecutable = this.scriptService.joinPath(platform, nodeDir, ...(platform.os === OS.Type.Windows ? ['node.exe'] : ['bin', 'node']));
|
|
106
115
|
const mainJsFile = this.scriptService.joinPath(platform, remotePath, 'lib', 'backend', 'main.js');
|
|
107
116
|
const localAddressRegex = /listening on http:\/\/0.0.0.0:(\d+)/;
|
|
@@ -120,6 +129,9 @@ export class RemoteSetupService {
|
|
|
120
129
|
args.push(...await cli.enhanceArgs(remoteContext));
|
|
121
130
|
}
|
|
122
131
|
}
|
|
132
|
+
// Per-window arguments (e.g. session preferences forwarded to a second-instance window)
|
|
133
|
+
// are appended last so they take precedence over the shared backend's contributions.
|
|
134
|
+
args.push(...additionalArgs);
|
|
123
135
|
// Change to the remote application path and start a node process with the copied main.js file
|
|
124
136
|
// This way, our current working directory is set as expected
|
|
125
137
|
const result = await connection.execPartial(`${prefix}cd "${remotePath}";${nodeExecutable}`,
|