@theia/dev-container 1.67.0-next.56 → 1.67.0-next.86

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 (82) hide show
  1. package/lib/dev-container-server/dev-container-server.d.ts +2 -0
  2. package/lib/dev-container-server/dev-container-server.d.ts.map +1 -0
  3. package/lib/dev-container-server/dev-container-server.js +48 -0
  4. package/lib/dev-container-server/dev-container-server.js.map +1 -0
  5. package/lib/electron-browser/container-connection-contribution.d.ts +29 -0
  6. package/lib/electron-browser/container-connection-contribution.d.ts.map +1 -0
  7. package/lib/electron-browser/container-connection-contribution.js +156 -0
  8. package/lib/electron-browser/container-connection-contribution.js.map +1 -0
  9. package/lib/electron-browser/container-info-contribution.d.ts +20 -0
  10. package/lib/electron-browser/container-info-contribution.d.ts.map +1 -0
  11. package/lib/electron-browser/container-info-contribution.js +85 -0
  12. package/lib/electron-browser/container-info-contribution.js.map +1 -0
  13. package/lib/electron-browser/container-output-provider.d.ts +8 -0
  14. package/lib/electron-browser/container-output-provider.d.ts.map +1 -0
  15. package/lib/electron-browser/container-output-provider.js +41 -0
  16. package/lib/electron-browser/container-output-provider.js.map +1 -0
  17. package/lib/electron-browser/dev-container-frontend-module.d.ts +4 -0
  18. package/lib/electron-browser/dev-container-frontend-module.d.ts.map +1 -0
  19. package/lib/electron-browser/dev-container-frontend-module.js +42 -0
  20. package/lib/electron-browser/dev-container-frontend-module.js.map +1 -0
  21. package/lib/electron-common/container-output-provider.d.ts +4 -0
  22. package/lib/electron-common/container-output-provider.d.ts.map +1 -0
  23. package/lib/electron-common/container-output-provider.js +18 -0
  24. package/lib/electron-common/container-output-provider.js.map +1 -0
  25. package/lib/electron-common/dev-container-workspaces.d.ts +3 -0
  26. package/lib/electron-common/dev-container-workspaces.d.ts.map +1 -0
  27. package/lib/electron-common/dev-container-workspaces.js +21 -0
  28. package/lib/electron-common/dev-container-workspaces.js.map +1 -0
  29. package/lib/electron-common/remote-container-connection-provider.d.ts +30 -0
  30. package/lib/electron-common/remote-container-connection-provider.d.ts.map +1 -0
  31. package/lib/electron-common/remote-container-connection-provider.js +21 -0
  32. package/lib/electron-common/remote-container-connection-provider.js.map +1 -0
  33. package/lib/electron-node/dev-container-backend-module.d.ts +5 -0
  34. package/lib/electron-node/dev-container-backend-module.d.ts.map +1 -0
  35. package/lib/electron-node/dev-container-backend-module.js +63 -0
  36. package/lib/electron-node/dev-container-backend-module.js.map +1 -0
  37. package/lib/electron-node/dev-container-file-service.d.ts +15 -0
  38. package/lib/electron-node/dev-container-file-service.d.ts.map +1 -0
  39. package/lib/electron-node/dev-container-file-service.js +105 -0
  40. package/lib/electron-node/dev-container-file-service.js.map +1 -0
  41. package/lib/electron-node/dev-container-workspace-handler.d.ts +7 -0
  42. package/lib/electron-node/dev-container-workspace-handler.d.ts.map +1 -0
  43. package/lib/electron-node/dev-container-workspace-handler.js +21 -0
  44. package/lib/electron-node/dev-container-workspace-handler.js.map +1 -0
  45. package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.d.ts +17 -0
  46. package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.d.ts.map +1 -0
  47. package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.js +69 -0
  48. package/lib/electron-node/devcontainer-contributions/cli-enhancing-creation-contributions.js.map +1 -0
  49. package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts +41 -0
  50. package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.d.ts.map +1 -0
  51. package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js +209 -0
  52. package/lib/electron-node/devcontainer-contributions/main-container-creation-contributions.js.map +1 -0
  53. package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.d.ts +11 -0
  54. package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.d.ts.map +1 -0
  55. package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.js +37 -0
  56. package/lib/electron-node/devcontainer-contributions/profile-file-modification-contribution.js.map +1 -0
  57. package/lib/electron-node/devcontainer-contributions/variable-resolver-contribution.d.ts +18 -0
  58. package/lib/electron-node/devcontainer-contributions/variable-resolver-contribution.d.ts.map +1 -0
  59. package/lib/electron-node/devcontainer-contributions/variable-resolver-contribution.js +58 -0
  60. package/lib/electron-node/devcontainer-contributions/variable-resolver-contribution.js.map +1 -0
  61. package/lib/electron-node/devcontainer-file.d.ts +354 -0
  62. package/lib/electron-node/devcontainer-file.d.ts.map +1 -0
  63. package/lib/electron-node/devcontainer-file.js +18 -0
  64. package/lib/electron-node/devcontainer-file.js.map +1 -0
  65. package/lib/electron-node/docker-compose/compose-service.d.ts +9 -0
  66. package/lib/electron-node/docker-compose/compose-service.d.ts.map +1 -0
  67. package/lib/electron-node/docker-compose/compose-service.js +73 -0
  68. package/lib/electron-node/docker-compose/compose-service.js.map +1 -0
  69. package/lib/electron-node/docker-container-service.d.ts +32 -0
  70. package/lib/electron-node/docker-container-service.d.ts.map +1 -0
  71. package/lib/electron-node/docker-container-service.js +122 -0
  72. package/lib/electron-node/docker-container-service.js.map +1 -0
  73. package/lib/electron-node/remote-container-connection-provider.d.ts +88 -0
  74. package/lib/electron-node/remote-container-connection-provider.d.ts.map +1 -0
  75. package/lib/electron-node/remote-container-connection-provider.js +345 -0
  76. package/lib/electron-node/remote-container-connection-provider.js.map +1 -0
  77. package/lib/package.spec.d.ts +1 -0
  78. package/lib/package.spec.d.ts.map +1 -0
  79. package/lib/package.spec.js +26 -0
  80. package/lib/package.spec.js.map +1 -0
  81. package/package.json +6 -6
  82. package/src/electron-node/remote-container-connection-provider.ts +7 -4
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dev-container-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-server.d.ts","sourceRoot":"","sources":["../../src/dev-container-server/dev-container-server.ts"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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 net_1 = require("net");
19
+ const process_1 = require("process");
20
+ /**
21
+ * this node.js Program is supposed to be executed by an docker exec session inside a docker container.
22
+ * It uses a tty session to listen on stdin and send on stdout all communication with the theia backend running inside the container.
23
+ */
24
+ let backendPort = undefined;
25
+ process_1.argv.slice(2).forEach(arg => {
26
+ if (arg.startsWith('-target-port')) {
27
+ backendPort = parseInt(arg.split('=')[1]);
28
+ }
29
+ });
30
+ if (!backendPort) {
31
+ throw new Error('please start with -target-port={port number}');
32
+ }
33
+ if (process_1.stdin.isTTY) {
34
+ process_1.stdin.setRawMode(true);
35
+ }
36
+ const connection = (0, net_1.createConnection)(backendPort, '0.0.0.0');
37
+ connection.pipe(process_1.stdout);
38
+ process_1.stdin.pipe(connection);
39
+ connection.on('error', error => {
40
+ console.error('connection error', error);
41
+ });
42
+ connection.on('close', () => {
43
+ console.log('connection closed');
44
+ process.exit(0);
45
+ });
46
+ // keep the process running
47
+ setInterval(() => { }, 1 << 30);
48
+ //# sourceMappingURL=dev-container-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-server.js","sourceRoot":"","sources":["../../src/dev-container-server/dev-container-server.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AAC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AC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { AbstractRemoteRegistryContribution, RemoteRegistry } from '@theia/remote/lib/electron-browser/remote-registry-contribution';
2
+ import { DevContainerFile, RemoteContainerConnectionProvider } from '../electron-common/remote-container-connection-provider';
3
+ import { WorkspaceStorageService } from '@theia/workspace/lib/browser/workspace-storage-service';
4
+ import { Command, MaybePromise, MessageService, QuickInputService, URI } from '@theia/core';
5
+ import { WorkspaceInput, WorkspaceOpenHandlerContribution, WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
6
+ import { ContainerOutputProvider } from './container-output-provider';
7
+ import { WorkspaceServer } from '@theia/workspace/lib/common';
8
+ import { RemotePreferences } from '@theia/remote/lib/electron-common/remote-preferences';
9
+ export declare namespace RemoteContainerCommands {
10
+ const REOPEN_IN_CONTAINER: Command;
11
+ }
12
+ export declare class ContainerConnectionContribution extends AbstractRemoteRegistryContribution implements WorkspaceOpenHandlerContribution {
13
+ protected readonly connectionProvider: RemoteContainerConnectionProvider;
14
+ protected readonly remotePreferences: RemotePreferences;
15
+ protected readonly messageService: MessageService;
16
+ protected readonly workspaceStorageService: WorkspaceStorageService;
17
+ protected readonly workspaceService: WorkspaceService;
18
+ protected readonly workspaceServer: WorkspaceServer;
19
+ protected readonly quickInputService: QuickInputService;
20
+ protected readonly containerOutputProvider: ContainerOutputProvider;
21
+ registerRemoteCommands(registry: RemoteRegistry): void;
22
+ canHandle(uri: URI): MaybePromise<boolean>;
23
+ openWorkspace(uri: URI, options?: WorkspaceInput | undefined): Promise<void>;
24
+ getWorkspaceLabel(uri: URI): Promise<string | undefined>;
25
+ openInContainer(): Promise<void>;
26
+ doOpenInContainer(devcontainerFile: DevContainerFile, workspacePath?: string): Promise<void>;
27
+ getOrSelectDevcontainerFile(): Promise<DevContainerFile | undefined>;
28
+ }
29
+ //# sourceMappingURL=container-connection-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-connection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cAAc,GAAG,IAAI;IAMtD,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC;IAIpC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB5E,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAUxD,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAQhC,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwB5F,2BAA2B,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;CAyB7E"}
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.ContainerConnectionContribution = exports.RemoteContainerCommands = 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_container_connection_provider_1 = require("../electron-common/remote-container-connection-provider");
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 container_output_provider_1 = require("./container-output-provider");
27
+ const common_1 = require("@theia/workspace/lib/common");
28
+ const dev_container_workspaces_1 = require("../electron-common/dev-container-workspaces");
29
+ const remote_preferences_1 = require("@theia/remote/lib/electron-common/remote-preferences");
30
+ var RemoteContainerCommands;
31
+ (function (RemoteContainerCommands) {
32
+ RemoteContainerCommands.REOPEN_IN_CONTAINER = core_1.Command.toLocalizedCommand({
33
+ id: 'dev-container:reopen-in-container',
34
+ label: 'Reopen in Container',
35
+ category: 'Dev Container'
36
+ }, 'theia/remote/dev-container/connect');
37
+ })(RemoteContainerCommands || (exports.RemoteContainerCommands = RemoteContainerCommands = {}));
38
+ const LAST_USED_CONTAINER = 'lastUsedContainer';
39
+ let ContainerConnectionContribution = class ContainerConnectionContribution extends remote_registry_contribution_1.AbstractRemoteRegistryContribution {
40
+ registerRemoteCommands(registry) {
41
+ registry.registerCommand(RemoteContainerCommands.REOPEN_IN_CONTAINER, {
42
+ execute: () => this.openInContainer()
43
+ });
44
+ }
45
+ canHandle(uri) {
46
+ return uri.scheme === dev_container_workspaces_1.DEV_CONTAINER_WORKSPACE_SCHEME;
47
+ }
48
+ async openWorkspace(uri, options) {
49
+ const filePath = new URLSearchParams(uri.query).get(dev_container_workspaces_1.DEV_CONTAINER_PATH_QUERY);
50
+ if (!filePath) {
51
+ throw new Error('No devcontainer file specified for workspace');
52
+ }
53
+ const devcontainerFiles = await this.connectionProvider.getDevContainerFiles(uri.path.toString());
54
+ const devcontainerFile = devcontainerFiles.find(file => file.path === filePath);
55
+ if (!devcontainerFile) {
56
+ throw new Error(`Devcontainer file at ${filePath} not found in workspace`);
57
+ }
58
+ return this.doOpenInContainer(devcontainerFile, uri.path.toString());
59
+ }
60
+ async getWorkspaceLabel(uri) {
61
+ const containerFilePath = new URLSearchParams(uri.query).get(dev_container_workspaces_1.DEV_CONTAINER_PATH_QUERY);
62
+ if (!containerFilePath) {
63
+ return;
64
+ }
65
+ ;
66
+ const files = await this.connectionProvider.getDevContainerFiles(uri.path.toString());
67
+ const devcontainerFile = files.find(file => file.path === containerFilePath);
68
+ return `${uri.path.base} [Dev Container: ${devcontainerFile === null || devcontainerFile === void 0 ? void 0 : devcontainerFile.name}]`;
69
+ }
70
+ async openInContainer() {
71
+ const devcontainerFile = await this.getOrSelectDevcontainerFile();
72
+ if (!devcontainerFile) {
73
+ return;
74
+ }
75
+ this.doOpenInContainer(devcontainerFile);
76
+ }
77
+ async doOpenInContainer(devcontainerFile, workspacePath) {
78
+ var _a;
79
+ const lastContainerInfoKey = `${LAST_USED_CONTAINER}:${devcontainerFile.path}`;
80
+ const lastContainerInfo = await this.workspaceStorageService.getData(lastContainerInfoKey);
81
+ this.containerOutputProvider.openChannel();
82
+ const connectionResult = await this.connectionProvider.connectToContainer({
83
+ nodeDownloadTemplate: this.remotePreferences['remote.nodeDownloadTemplate'],
84
+ lastContainerInfo,
85
+ devcontainerFile: devcontainerFile.path,
86
+ workspacePath: workspacePath
87
+ });
88
+ this.workspaceStorageService.setData(lastContainerInfoKey, {
89
+ id: connectionResult.containerId,
90
+ lastUsed: Date.now()
91
+ });
92
+ this.workspaceServer.setMostRecentlyUsedWorkspace(`${dev_container_workspaces_1.DEV_CONTAINER_WORKSPACE_SCHEME}:${workspacePath !== null && workspacePath !== void 0 ? workspacePath : (_a = this.workspaceService.workspace) === null || _a === void 0 ? void 0 : _a.resource.path}?${dev_container_workspaces_1.DEV_CONTAINER_PATH_QUERY}=${devcontainerFile.path}`);
93
+ this.openRemote(connectionResult.port, false, connectionResult.workspacePath);
94
+ }
95
+ async getOrSelectDevcontainerFile() {
96
+ var _a;
97
+ const workspace = this.workspaceService.workspace;
98
+ if (!workspace) {
99
+ return;
100
+ }
101
+ const devcontainerFiles = await this.connectionProvider.getDevContainerFiles(workspace.resource.path.toString());
102
+ if (devcontainerFiles.length === 1) {
103
+ return devcontainerFiles[0];
104
+ }
105
+ else if (devcontainerFiles.length === 0) {
106
+ // eslint-disable-next-line max-len
107
+ this.messageService.error(core_1.nls.localize('theia/remote/dev-container/noDevcontainerFiles', 'No devcontainer.json files found in the workspace. Please ensure you have a .devcontainer directory with a devcontainer.json file.'));
108
+ return undefined;
109
+ }
110
+ return (_a = (await this.quickInputService.pick(devcontainerFiles.map(file => ({
111
+ type: 'item',
112
+ label: file.name,
113
+ description: file.path,
114
+ file: file,
115
+ })), {
116
+ title: core_1.nls.localize('theia/remote/dev-container/selectDevcontainer', 'Select a devcontainer.json file')
117
+ }))) === null || _a === void 0 ? void 0 : _a.file;
118
+ }
119
+ };
120
+ exports.ContainerConnectionContribution = ContainerConnectionContribution;
121
+ tslib_1.__decorate([
122
+ (0, inversify_1.inject)(remote_container_connection_provider_1.RemoteContainerConnectionProvider),
123
+ tslib_1.__metadata("design:type", Object)
124
+ ], ContainerConnectionContribution.prototype, "connectionProvider", void 0);
125
+ tslib_1.__decorate([
126
+ (0, inversify_1.inject)(remote_preferences_1.RemotePreferences),
127
+ tslib_1.__metadata("design:type", Object)
128
+ ], ContainerConnectionContribution.prototype, "remotePreferences", void 0);
129
+ tslib_1.__decorate([
130
+ (0, inversify_1.inject)(core_1.MessageService),
131
+ tslib_1.__metadata("design:type", core_1.MessageService)
132
+ ], ContainerConnectionContribution.prototype, "messageService", void 0);
133
+ tslib_1.__decorate([
134
+ (0, inversify_1.inject)(workspace_storage_service_1.WorkspaceStorageService),
135
+ tslib_1.__metadata("design:type", workspace_storage_service_1.WorkspaceStorageService)
136
+ ], ContainerConnectionContribution.prototype, "workspaceStorageService", void 0);
137
+ tslib_1.__decorate([
138
+ (0, inversify_1.inject)(workspace_service_1.WorkspaceService),
139
+ tslib_1.__metadata("design:type", workspace_service_1.WorkspaceService)
140
+ ], ContainerConnectionContribution.prototype, "workspaceService", void 0);
141
+ tslib_1.__decorate([
142
+ (0, inversify_1.inject)(common_1.WorkspaceServer),
143
+ tslib_1.__metadata("design:type", Object)
144
+ ], ContainerConnectionContribution.prototype, "workspaceServer", void 0);
145
+ tslib_1.__decorate([
146
+ (0, inversify_1.inject)(core_1.QuickInputService),
147
+ tslib_1.__metadata("design:type", Object)
148
+ ], ContainerConnectionContribution.prototype, "quickInputService", void 0);
149
+ tslib_1.__decorate([
150
+ (0, inversify_1.inject)(container_output_provider_1.ContainerOutputProvider),
151
+ tslib_1.__metadata("design:type", container_output_provider_1.ContainerOutputProvider)
152
+ ], ContainerConnectionContribution.prototype, "containerOutputProvider", void 0);
153
+ exports.ContainerConnectionContribution = ContainerConnectionContribution = tslib_1.__decorate([
154
+ (0, inversify_1.injectable)()
155
+ ], ContainerConnectionContribution);
156
+ //# sourceMappingURL=container-connection-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-connection-contribution.js","sourceRoot":"","sources":["../../src/electron-browser/container-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,kHAAiJ;AACjJ,sGAAiG;AACjG,sCAAiG;AACjG,sFAAoI;AACpI,2EAAsE;AACtE,wDAA8D;AAC9D,0FAAuH;AACvH,6FAAyF;AAEzF,IAAiB,uBAAuB,CAMvC;AAND,WAAiB,uBAAuB;IACvB,2CAAmB,GAAG,cAAO,CAAC,kBAAkB,CAAC;QAC1D,EAAE,EAAE,mCAAmC;QACvC,KAAK,EAAE,qBAAqB;QAC5B,QAAQ,EAAE,eAAe;KAC5B,EAAE,oCAAoC,CAAC,CAAC;AAC7C,CAAC,EANgB,uBAAuB,uCAAvB,uBAAuB,QAMvC;AAED,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEzC,IAAM,+BAA+B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B,IAAI,EAAE,IAAI;SACb,CAAC,CAAC,EAAE;YACD,KAAK,EAAE,UAAG,CAAC,QAAQ,CAAC,+CAA+C,EAAE,iCAAiC,CAAC;SAC1G,CAAC,CAAC,0CAAE,IAAI,CAAC;IACd,CAAC;CAEJ,CAAA;AAxHY,0EAA+B;AAGrB;IADlB,IAAA,kBAAM,EAAC,wEAAiC,CAAC;;2EAC+B;AAGtD;IADlB,IAAA,kBAAM,EAAC,sCAAiB,CAAC;;0EAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,qBAAc,CAAC;sCACY,qBAAc;uEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,mDAAuB,CAAC;sCACY,mDAAuB;gFAAC;AAGjD;IADlB,IAAA,kBAAM,EAAC,oCAAgB,CAAC;sCACY,oCAAgB;yEAAC;AAGnC;IADlB,IAAA,kBAAM,EAAC,wBAAe,CAAC;;wEAC4B;AAGjC;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;0EAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,mDAAuB,CAAC;sCACY,mDAAuB;gFAAC;0CAxB3D,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAwH3C"}
@@ -0,0 +1,20 @@
1
+ import { WindowTitleContribution } from '@theia/core/lib/browser/window/window-title-service';
2
+ import { RemoteStatus, RemoteStatusService } from '@theia/remote/lib/electron-common/remote-status-service';
3
+ import { FrontendApplicationContribution, LabelProviderContribution } from '@theia/core/lib/browser';
4
+ import type { ContainerInspectInfo } from 'dockerode';
5
+ import { RemoteContainerConnectionProvider } from '../electron-common/remote-container-connection-provider';
6
+ import { PortForwardingService } from '@theia/remote/lib/electron-browser/port-forwarding/port-forwarding-service';
7
+ import { URI } from '@theia/core';
8
+ export declare class ContainerInfoContribution implements FrontendApplicationContribution, WindowTitleContribution, LabelProviderContribution {
9
+ protected readonly connectionProvider: RemoteContainerConnectionProvider;
10
+ protected readonly portForwardingService: PortForwardingService;
11
+ protected readonly remoteStatusService: RemoteStatusService;
12
+ protected status: RemoteStatus | undefined;
13
+ protected containerInfo: ContainerInspectInfo | undefined;
14
+ protected containerFilePath: string | undefined;
15
+ onStart(): Promise<void>;
16
+ enhanceTitle(title: string, parts: Map<string, string | undefined>): string;
17
+ canHandle(element: object): number;
18
+ getName(element: URI): string | undefined;
19
+ }
20
+ //# sourceMappingURL=container-info-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-info-contribution.d.ts","sourceRoot":"","sources":["../../src/electron-browser/container-info-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,+BAA+B,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,iCAAiC,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,qBAAqB,EAAE,MAAM,4EAA4E,CAAC;AAEnH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,qBACa,yBAA0B,YAAW,+BAA+B,EAAE,uBAAuB,EAAE,yBAAyB;IAEjI,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,iCAAiC,CAAC;IAGzE,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;IAGhE,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAE5D,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;IAC3C,SAAS,CAAC,aAAa,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC1D,SAAS,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAc9B,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAQ3E,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAelC,OAAO,CAAC,OAAO,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS;CAK5C"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.ContainerInfoContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const remote_status_service_1 = require("@theia/remote/lib/electron-common/remote-status-service");
22
+ const remote_container_connection_provider_1 = require("../electron-common/remote-container-connection-provider");
23
+ const port_forwarding_service_1 = require("@theia/remote/lib/electron-browser/port-forwarding/port-forwarding-service");
24
+ const dev_container_workspaces_1 = require("../electron-common/dev-container-workspaces");
25
+ const core_1 = require("@theia/core");
26
+ let ContainerInfoContribution = class ContainerInfoContribution {
27
+ async onStart() {
28
+ var _a, _b;
29
+ const containerPort = parseInt((_a = new URLSearchParams(location.search).get('port')) !== null && _a !== void 0 ? _a : '0');
30
+ const containerInfo = await this.connectionProvider.getCurrentContainerInfo(containerPort);
31
+ this.status = await this.remoteStatusService.getStatus(containerPort);
32
+ this.portForwardingService.forwardedPorts.push(...Object.entries((_b = containerInfo === null || containerInfo === void 0 ? void 0 : containerInfo.NetworkSettings.Ports) !== null && _b !== void 0 ? _b : {}).flatMap(([_, ports]) => (ports.map(port => {
33
+ var _a, _b;
34
+ return ({
35
+ editing: false,
36
+ address: (_a = port.HostIp) !== null && _a !== void 0 ? _a : '',
37
+ localPort: parseInt((_b = port.HostPort) !== null && _b !== void 0 ? _b : '0'),
38
+ origin: 'container'
39
+ });
40
+ }))));
41
+ }
42
+ enhanceTitle(title, parts) {
43
+ if (this.status && this.status.alive) {
44
+ const devcontainerName = this.status.name;
45
+ title = `${title} [Dev Container${devcontainerName ? ': ' + devcontainerName : ''}]`;
46
+ }
47
+ return title;
48
+ }
49
+ canHandle(element) {
50
+ if ('query' in element) {
51
+ let containerFilePath = new URLSearchParams(element.query).get(dev_container_workspaces_1.DEV_CONTAINER_PATH_QUERY);
52
+ if (containerFilePath) {
53
+ if (containerFilePath.startsWith(element.path.toString())) {
54
+ containerFilePath = containerFilePath.replace(element.path.toString(), '');
55
+ }
56
+ this.containerFilePath = containerFilePath;
57
+ return 100;
58
+ }
59
+ ;
60
+ return 0;
61
+ }
62
+ return 0;
63
+ }
64
+ getName(element) {
65
+ const dir = new core_1.URI(this.containerFilePath).path.dir.base;
66
+ return `${element.path.base} [Dev Container${dir && dir !== '.devcontainer' ? `: ${dir}` : ''}]`;
67
+ }
68
+ };
69
+ exports.ContainerInfoContribution = ContainerInfoContribution;
70
+ tslib_1.__decorate([
71
+ (0, inversify_1.inject)(remote_container_connection_provider_1.RemoteContainerConnectionProvider),
72
+ tslib_1.__metadata("design:type", Object)
73
+ ], ContainerInfoContribution.prototype, "connectionProvider", void 0);
74
+ tslib_1.__decorate([
75
+ (0, inversify_1.inject)(port_forwarding_service_1.PortForwardingService),
76
+ tslib_1.__metadata("design:type", port_forwarding_service_1.PortForwardingService)
77
+ ], ContainerInfoContribution.prototype, "portForwardingService", void 0);
78
+ tslib_1.__decorate([
79
+ (0, inversify_1.inject)(remote_status_service_1.RemoteStatusService),
80
+ tslib_1.__metadata("design:type", Object)
81
+ ], ContainerInfoContribution.prototype, "remoteStatusService", void 0);
82
+ exports.ContainerInfoContribution = ContainerInfoContribution = tslib_1.__decorate([
83
+ (0, inversify_1.injectable)()
84
+ ], ContainerInfoContribution);
85
+ //# sourceMappingURL=container-info-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-info-contribution.js","sourceRoot":"","sources":["../../src/electron-browser/container-info-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;AAElE,mGAA4G;AAG5G,kHAA4G;AAC5G,wHAAmH;AACnH,0FAAuF;AACvF,sCAAkC;AAG3B,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAclC,KAAK,CAAC,OAAO;;QACT,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAA,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,mCAAI,GAAG,CAAC,CAAC;QACxF,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC;QAC3F,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAEtE,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,eAAe,CAAC,KAAK,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAA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AAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAED,OAAO,CAAC,OAAY;QAChB,MAAM,GAAG,GAAG,IAAI,UAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAC1D,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,kBAAkB,GAAG,IAAI,GAAG,KAAK,eAAe,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACrG,CAAC;CAEJ,CAAA;AAxDY,8DAAyB;AAEf;IADlB,IAAA,kBAAM,EAAC,wEAAiC,CAAC;;qEAC+B;AAGtD;IADlB,IAAA,kBAAM,EAAC,+CAAqB,CAAC;sCACY,+CAAqB;wEAAC;AAG7C;IADlB,IAAA,kBAAM,EAAC,2CAAmB,CAAC;;sEACgC;oCARnD,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAwDrC"}
@@ -0,0 +1,8 @@
1
+ import { OutputChannel, OutputChannelManager } from '@theia/output/lib/browser/output-channel';
2
+ export declare class ContainerOutputProvider implements ContainerOutputProvider {
3
+ protected readonly outputChannelManager: OutputChannelManager;
4
+ protected currentChannel?: OutputChannel;
5
+ openChannel(): void;
6
+ onRemoteOutput(output: string): void;
7
+ }
8
+ //# sourceMappingURL=container-output-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-output-provider.d.ts","sourceRoot":"","sources":["../../src/electron-browser/container-output-provider.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAE/F,qBACa,uBAAwB,YAAW,uBAAuB;IAGnE,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAE9D,SAAS,CAAC,cAAc,CAAC,EAAE,aAAa,CAAC;IAEzC,WAAW,IAAI,IAAI;IAKnB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAGvC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.ContainerOutputProvider = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const inversify_1 = require("@theia/core/shared/inversify");
21
+ const output_channel_1 = require("@theia/output/lib/browser/output-channel");
22
+ let ContainerOutputProvider = class ContainerOutputProvider {
23
+ openChannel() {
24
+ this.currentChannel = this.outputChannelManager.getChannel('Container');
25
+ this.currentChannel.show();
26
+ }
27
+ ;
28
+ onRemoteOutput(output) {
29
+ var _a;
30
+ (_a = this.currentChannel) === null || _a === void 0 ? void 0 : _a.appendLine(output);
31
+ }
32
+ };
33
+ exports.ContainerOutputProvider = ContainerOutputProvider;
34
+ tslib_1.__decorate([
35
+ (0, inversify_1.inject)(output_channel_1.OutputChannelManager),
36
+ tslib_1.__metadata("design:type", output_channel_1.OutputChannelManager)
37
+ ], ContainerOutputProvider.prototype, "outputChannelManager", void 0);
38
+ exports.ContainerOutputProvider = ContainerOutputProvider = tslib_1.__decorate([
39
+ (0, inversify_1.injectable)()
40
+ ], ContainerOutputProvider);
41
+ //# sourceMappingURL=container-output-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-output-provider.js","sourceRoot":"","sources":["../../src/electron-browser/container-output-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;AAClE,6EAA+F;AAGxF,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAOhC,WAAW;QACP,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACxE,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAA,CAAC;IAEF,cAAc,CAAC,MAAc;;QACzB,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACJ,CAAA;AAfY,0DAAuB;AAGb;IADlB,IAAA,kBAAM,EAAC,qCAAoB,CAAC;sCACY,qCAAoB;qEAAC;kCAHrD,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAenC"}
@@ -0,0 +1,4 @@
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
+ //# sourceMappingURL=dev-container-frontend-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-frontend-module.d.ts","sourceRoot":"","sources":["../../src/electron-browser/dev-container-frontend-module.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAW/D,wBAgBG"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // *****************************************************************************
4
+ // Copyright (C) 2024 Typefox and others.
5
+ //
6
+ // This program and the accompanying materials are made available under the
7
+ // terms of the Eclipse Public License v. 2.0 which is available at
8
+ // http://www.eclipse.org/legal/epl-2.0.
9
+ //
10
+ // This Source Code may also be made available under the following Secondary
11
+ // Licenses when the conditions for such availability set forth in the Eclipse
12
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
13
+ // with the GNU Classpath Exception which is available at
14
+ // https://www.gnu.org/software/classpath/license.html.
15
+ //
16
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
17
+ // *****************************************************************************
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_container_connection_provider_1 = require("../electron-common/remote-container-connection-provider");
21
+ const container_connection_contribution_1 = require("./container-connection-contribution");
22
+ const service_connection_provider_1 = require("@theia/core/lib/browser/messaging/service-connection-provider");
23
+ const container_output_provider_1 = require("./container-output-provider");
24
+ const container_info_contribution_1 = require("./container-info-contribution");
25
+ const browser_1 = require("@theia/core/lib/browser");
26
+ const workspace_service_1 = require("@theia/workspace/lib/browser/workspace-service");
27
+ const window_title_service_1 = require("@theia/core/lib/browser/window/window-title-service");
28
+ exports.default = new inversify_1.ContainerModule(bind => {
29
+ bind(container_connection_contribution_1.ContainerConnectionContribution).toSelf().inSingletonScope();
30
+ bind(remote_registry_contribution_1.RemoteRegistryContribution).toService(container_connection_contribution_1.ContainerConnectionContribution);
31
+ bind(workspace_service_1.WorkspaceOpenHandlerContribution).toService(container_connection_contribution_1.ContainerConnectionContribution);
32
+ bind(container_output_provider_1.ContainerOutputProvider).toSelf().inSingletonScope();
33
+ bind(remote_container_connection_provider_1.RemoteContainerConnectionProvider).toDynamicValue(ctx => {
34
+ const outputProvider = ctx.container.get(container_output_provider_1.ContainerOutputProvider);
35
+ return service_connection_provider_1.ServiceConnectionProvider.createLocalProxy(ctx.container, remote_container_connection_provider_1.RemoteContainerConnectionProviderPath, outputProvider);
36
+ }).inSingletonScope();
37
+ bind(container_info_contribution_1.ContainerInfoContribution).toSelf().inSingletonScope();
38
+ bind(browser_1.FrontendApplicationContribution).toService(container_info_contribution_1.ContainerInfoContribution);
39
+ bind(window_title_service_1.WindowTitleContribution).toService(container_info_contribution_1.ContainerInfoContribution);
40
+ bind(browser_1.LabelProviderContribution).toService(container_info_contribution_1.ContainerInfoContribution);
41
+ });
42
+ //# sourceMappingURL=dev-container-frontend-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-frontend-module.js","sourceRoot":"","sources":["../../src/electron-browser/dev-container-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;AAChF,4DAA+D;AAC/D,kHAA6G;AAC7G,kHAAmJ;AACnJ,2FAAsF;AACtF,+GAA0G;AAC1G,2EAAsE;AACtE,+EAA0E;AAC1E,qDAAqG;AACrG,sFAAkG;AAClG,8FAA8F;AAE9F,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,mEAA+B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAClE,IAAI,CAAC,yDAA0B,CAAC,CAAC,SAAS,CAAC,mEAA+B,CAAC,CAAC;IAC5E,IAAI,CAAC,oDAAgC,CAAC,CAAC,SAAS,CAAC,mEAA+B,CAAC,CAAC;IAElF,IAAI,CAAC,mDAAuB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAE1D,IAAI,CAAC,wEAAiC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACzD,MAAM,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,mDAAuB,CAAC,CAAC;QAClE,OAAO,uDAAyB,CAAC,gBAAgB,CAAoC,GAAG,CAAC,SAAS,EAAE,4EAAqC,EAAE,cAAc,CAAC,CAAC;IAC/J,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAEtB,IAAI,CAAC,uDAAyB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5D,IAAI,CAAC,yCAA+B,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IAC3E,IAAI,CAAC,8CAAuB,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;IACnE,IAAI,CAAC,mCAAyB,CAAC,CAAC,SAAS,CAAC,uDAAyB,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export interface ContainerOutputProvider {
2
+ onRemoteOutput(output: string): void;
3
+ }
4
+ //# sourceMappingURL=container-output-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-output-provider.d.ts","sourceRoot":"","sources":["../../src/electron-common/container-output-provider.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,uBAAuB;IACpC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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
+ //# sourceMappingURL=container-output-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-output-provider.js","sourceRoot":"","sources":["../../src/electron-common/container-output-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"}
@@ -0,0 +1,3 @@
1
+ export declare const DEV_CONTAINER_WORKSPACE_SCHEME = "devcontainer";
2
+ export declare const DEV_CONTAINER_PATH_QUERY = "containerfile";
3
+ //# sourceMappingURL=dev-container-workspaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-workspaces.d.ts","sourceRoot":"","sources":["../../src/electron-common/dev-container-workspaces.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAC7D,eAAO,MAAM,wBAAwB,kBAAkB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 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.DEV_CONTAINER_PATH_QUERY = exports.DEV_CONTAINER_WORKSPACE_SCHEME = void 0;
19
+ exports.DEV_CONTAINER_WORKSPACE_SCHEME = 'devcontainer';
20
+ exports.DEV_CONTAINER_PATH_QUERY = 'containerfile';
21
+ //# sourceMappingURL=dev-container-workspaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-container-workspaces.js","sourceRoot":"","sources":["../../src/electron-common/dev-container-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,8BAA8B,GAAG,cAAc,CAAC;AAChD,QAAA,wBAAwB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { RpcServer } from '@theia/core';
2
+ import { ContainerOutputProvider } from './container-output-provider';
3
+ import type { ContainerInspectInfo } from 'dockerode';
4
+ export declare const RemoteContainerConnectionProviderPath = "/remote/container";
5
+ export declare const RemoteContainerConnectionProvider: unique symbol;
6
+ export interface ContainerConnectionOptions {
7
+ nodeDownloadTemplate?: string;
8
+ lastContainerInfo?: LastContainerInfo;
9
+ devcontainerFile: string;
10
+ workspacePath?: string;
11
+ }
12
+ export interface LastContainerInfo {
13
+ id: string;
14
+ lastUsed: number;
15
+ }
16
+ export interface ContainerConnectionResult {
17
+ port: string;
18
+ workspacePath: string;
19
+ containerId: string;
20
+ }
21
+ export interface DevContainerFile {
22
+ name: string;
23
+ path: string;
24
+ }
25
+ export interface RemoteContainerConnectionProvider extends RpcServer<ContainerOutputProvider> {
26
+ connectToContainer(options: ContainerConnectionOptions): Promise<ContainerConnectionResult>;
27
+ getDevContainerFiles(workspacePath: string): Promise<DevContainerFile[]>;
28
+ getCurrentContainerInfo(port: number): Promise<ContainerInspectInfo | undefined>;
29
+ }
30
+ //# sourceMappingURL=remote-container-connection-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-container-connection-provider.d.ts","sourceRoot":"","sources":["../../src/electron-common/remote-container-connection-provider.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAGtD,eAAO,MAAM,qCAAqC,sBAAsB,CAAC;AAEzE,eAAO,MAAM,iCAAiC,eAA8C,CAAC;AAE7F,MAAM,WAAW,0BAA0B;IACvC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iCAAkC,SAAQ,SAAS,CAAC,uBAAuB,CAAC;IACzF,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC5F,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzE,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;CACpF"}