@theia/plugin-ext-headless 1.46.0-next.72

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 (107) hide show
  1. package/README.md +32 -0
  2. package/lib/common/headless-plugin-container.d.ts +8 -0
  3. package/lib/common/headless-plugin-container.d.ts.map +1 -0
  4. package/lib/common/headless-plugin-container.js +26 -0
  5. package/lib/common/headless-plugin-container.js.map +1 -0
  6. package/lib/common/headless-plugin-protocol.d.ts +21 -0
  7. package/lib/common/headless-plugin-protocol.d.ts.map +1 -0
  8. package/lib/common/headless-plugin-protocol.js +35 -0
  9. package/lib/common/headless-plugin-protocol.js.map +1 -0
  10. package/lib/common/headless-plugin-rpc.d.ts +23 -0
  11. package/lib/common/headless-plugin-rpc.d.ts.map +1 -0
  12. package/lib/common/headless-plugin-rpc.js +31 -0
  13. package/lib/common/headless-plugin-rpc.js.map +1 -0
  14. package/lib/common/index.d.ts +5 -0
  15. package/lib/common/index.d.ts.map +1 -0
  16. package/lib/common/index.js +35 -0
  17. package/lib/common/index.js.map +1 -0
  18. package/lib/common/plugin-ext-headless-api-contribution.d.ts +38 -0
  19. package/lib/common/plugin-ext-headless-api-contribution.d.ts.map +1 -0
  20. package/lib/common/plugin-ext-headless-api-contribution.js +29 -0
  21. package/lib/common/plugin-ext-headless-api-contribution.js.map +1 -0
  22. package/lib/hosted/node/headless-hosted-plugin.d.ts +30 -0
  23. package/lib/hosted/node/headless-hosted-plugin.d.ts.map +1 -0
  24. package/lib/hosted/node/headless-hosted-plugin.js +192 -0
  25. package/lib/hosted/node/headless-hosted-plugin.js.map +1 -0
  26. package/lib/hosted/node/plugin-ext-headless-hosted-module.d.ts +4 -0
  27. package/lib/hosted/node/plugin-ext-headless-hosted-module.d.ts.map +1 -0
  28. package/lib/hosted/node/plugin-ext-headless-hosted-module.js +69 -0
  29. package/lib/hosted/node/plugin-ext-headless-hosted-module.js.map +1 -0
  30. package/lib/hosted/node/plugin-host-headless-module.d.ts +5 -0
  31. package/lib/hosted/node/plugin-host-headless-module.d.ts.map +1 -0
  32. package/lib/hosted/node/plugin-host-headless-module.js +73 -0
  33. package/lib/hosted/node/plugin-host-headless-module.js.map +1 -0
  34. package/lib/hosted/node/plugin-host-headless-rpc.d.ts +21 -0
  35. package/lib/hosted/node/plugin-host-headless-rpc.d.ts.map +1 -0
  36. package/lib/hosted/node/plugin-host-headless-rpc.js +82 -0
  37. package/lib/hosted/node/plugin-host-headless-rpc.js.map +1 -0
  38. package/lib/hosted/node/plugin-host-headless.d.ts +2 -0
  39. package/lib/hosted/node/plugin-host-headless.d.ts.map +1 -0
  40. package/lib/hosted/node/plugin-host-headless.js +104 -0
  41. package/lib/hosted/node/plugin-host-headless.js.map +1 -0
  42. package/lib/hosted/node/scanners/scanner-theia-headless.d.ts +26 -0
  43. package/lib/hosted/node/scanners/scanner-theia-headless.d.ts.map +1 -0
  44. package/lib/hosted/node/scanners/scanner-theia-headless.js +91 -0
  45. package/lib/hosted/node/scanners/scanner-theia-headless.js.map +1 -0
  46. package/lib/hosted/node-electron/plugin-ext-headless-hosted-electron-module.d.ts +3 -0
  47. package/lib/hosted/node-electron/plugin-ext-headless-hosted-electron-module.d.ts.map +1 -0
  48. package/lib/hosted/node-electron/plugin-ext-headless-hosted-electron-module.js +24 -0
  49. package/lib/hosted/node-electron/plugin-ext-headless-hosted-electron-module.js.map +1 -0
  50. package/lib/index.d.ts +2 -0
  51. package/lib/index.d.ts.map +1 -0
  52. package/lib/index.js +29 -0
  53. package/lib/index.js.map +1 -0
  54. package/lib/main/node/handlers/plugin-theia-headless-directory-handler.d.ts +7 -0
  55. package/lib/main/node/handlers/plugin-theia-headless-directory-handler.d.ts.map +1 -0
  56. package/lib/main/node/handlers/plugin-theia-headless-directory-handler.js +43 -0
  57. package/lib/main/node/handlers/plugin-theia-headless-directory-handler.js.map +1 -0
  58. package/lib/main/node/headless-progress-client.d.ts +10 -0
  59. package/lib/main/node/headless-progress-client.d.ts.map +1 -0
  60. package/lib/main/node/headless-progress-client.js +52 -0
  61. package/lib/main/node/headless-progress-client.js.map +1 -0
  62. package/lib/main/node/main-context.d.ts +4 -0
  63. package/lib/main/node/main-context.d.ts.map +1 -0
  64. package/lib/main/node/main-context.js +19 -0
  65. package/lib/main/node/main-context.js.map +1 -0
  66. package/lib/main/node/plugin-ext-headless-main-module.d.ts +4 -0
  67. package/lib/main/node/plugin-ext-headless-main-module.d.ts.map +1 -0
  68. package/lib/main/node/plugin-ext-headless-main-module.js +38 -0
  69. package/lib/main/node/plugin-ext-headless-main-module.js.map +1 -0
  70. package/lib/package.spec.d.ts +1 -0
  71. package/lib/package.spec.d.ts.map +1 -0
  72. package/lib/package.spec.js +24 -0
  73. package/lib/package.spec.js.map +1 -0
  74. package/lib/plugin/headless-plugin-manager.d.ts +10 -0
  75. package/lib/plugin/headless-plugin-manager.d.ts.map +1 -0
  76. package/lib/plugin/headless-plugin-manager.js +56 -0
  77. package/lib/plugin/headless-plugin-manager.js.map +1 -0
  78. package/lib/plugin-ext-headless-electron-module.d.ts +4 -0
  79. package/lib/plugin-ext-headless-electron-module.d.ts.map +1 -0
  80. package/lib/plugin-ext-headless-electron-module.js +32 -0
  81. package/lib/plugin-ext-headless-electron-module.js.map +1 -0
  82. package/lib/plugin-ext-headless-module.d.ts +4 -0
  83. package/lib/plugin-ext-headless-module.d.ts.map +1 -0
  84. package/lib/plugin-ext-headless-module.js +31 -0
  85. package/lib/plugin-ext-headless-module.js.map +1 -0
  86. package/package.json +56 -0
  87. package/src/common/headless-plugin-container.ts +23 -0
  88. package/src/common/headless-plugin-protocol.ts +38 -0
  89. package/src/common/headless-plugin-rpc.ts +46 -0
  90. package/src/common/index.ts +23 -0
  91. package/src/common/plugin-ext-headless-api-contribution.ts +60 -0
  92. package/src/hosted/node/headless-hosted-plugin.ts +199 -0
  93. package/src/hosted/node/plugin-ext-headless-hosted-module.ts +75 -0
  94. package/src/hosted/node/plugin-host-headless-module.ts +76 -0
  95. package/src/hosted/node/plugin-host-headless-rpc.ts +80 -0
  96. package/src/hosted/node/plugin-host-headless.ts +111 -0
  97. package/src/hosted/node/scanners/scanner-theia-headless.ts +85 -0
  98. package/src/hosted/node-electron/plugin-ext-headless-hosted-electron-module.ts +22 -0
  99. package/src/index.ts +17 -0
  100. package/src/main/node/handlers/plugin-theia-headless-directory-handler.ts +35 -0
  101. package/src/main/node/headless-progress-client.ts +44 -0
  102. package/src/main/node/main-context.ts +35 -0
  103. package/src/main/node/plugin-ext-headless-main-module.ts +42 -0
  104. package/src/package.spec.ts +25 -0
  105. package/src/plugin/headless-plugin-manager.ts +50 -0
  106. package/src/plugin-ext-headless-electron-module.ts +32 -0
  107. package/src/plugin-ext-headless-module.ts +31 -0
package/README.md ADDED
@@ -0,0 +1,32 @@
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 - HEADLESS PLUGIN-EXT EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/plugin-ext-headless` extension contributes functionality for the backend-only "headless `plugin`" API.
16
+ The plugin extension host managed by this extension is scoped to the single Theia NodeJS instance.
17
+ This is unlike the plugin extension hosts managed by the [`@theia/plugin-ext` extension][plugin-ext] which are scoped on a per-frontend-connection basis.
18
+
19
+ [plugin-ext]: ../plugin-ext/README.md
20
+
21
+ ## Implementation
22
+
23
+ The implementation is derived from the [`@theia/plugin-ext` extension][plugin-ext] for frontend-scoped plugins.
24
+
25
+ ## License
26
+
27
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
28
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
29
+
30
+ ## Trademark
31
+ "Theia" is a trademark of the Eclipse Foundation
32
+ https://www.eclipse.org/theia
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Service identifier for Inversify container modules that are used
3
+ * to configure the child Container in which scope the services supporting
4
+ * the Headless Plugin Host are isolated from connection-scoped frontend/backend
5
+ * plugin hosts and the rest of the Theia Node server.
6
+ */
7
+ export declare const HeadlessPluginContainerModule: unique symbol;
8
+ //# sourceMappingURL=headless-plugin-container.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-container.d.ts","sourceRoot":"","sources":["../../src/common/headless-plugin-container.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,eAA0C,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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.HeadlessPluginContainerModule = void 0;
19
+ /**
20
+ * Service identifier for Inversify container modules that are used
21
+ * to configure the child Container in which scope the services supporting
22
+ * the Headless Plugin Host are isolated from connection-scoped frontend/backend
23
+ * plugin hosts and the rest of the Theia Node server.
24
+ */
25
+ exports.HeadlessPluginContainerModule = Symbol('HeadlessPluginContainerModule');
26
+ //# sourceMappingURL=headless-plugin-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-container.js","sourceRoot":"","sources":["../../src/common/headless-plugin-container.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;;;GAKG;AACU,QAAA,6BAA6B,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export * from '@theia/plugin-ext';
2
+ declare module '@theia/plugin-ext' {
3
+ /**
4
+ * Extension of the package manifest interface defined by the core plugin framework.
5
+ */
6
+ interface PluginPackage {
7
+ /**
8
+ * Analogues of declarations offered by VS Code plugins, but for the headless instantiation.
9
+ */
10
+ headless?: {
11
+ /** Activation events supported in headless mode, if any. */
12
+ activationEvents?: string[];
13
+ };
14
+ }
15
+ }
16
+ /**
17
+ * Name for a `string[]` injection binding contributing headless activation event names
18
+ * supported by the application.
19
+ */
20
+ export declare const SupportedHeadlessActivationEvents: unique symbol;
21
+ //# sourceMappingURL=headless-plugin-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-protocol.d.ts","sourceRoot":"","sources":["../../src/common/headless-plugin-protocol.ts"],"names":[],"mappings":"AAgBA,cAAc,mBAAmB,CAAC;AAElC,OAAO,QAAQ,mBAAmB,CAAC;IACjC;;OAEG;IACH,UAAU,aAAa;QACnB;;WAEG;QACH,QAAQ,CAAC,EAAE;YACP,4DAA4D;YAC5D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;SAC/B,CAAA;KACJ;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,iCAAiC,eAA8C,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.SupportedHeadlessActivationEvents = void 0;
29
+ __exportStar(require("@theia/plugin-ext"), exports);
30
+ /**
31
+ * Name for a `string[]` injection binding contributing headless activation event names
32
+ * supported by the application.
33
+ */
34
+ exports.SupportedHeadlessActivationEvents = Symbol('SupportedHeadlessActivationEvents');
35
+ //# sourceMappingURL=headless-plugin-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-protocol.js","sourceRoot":"","sources":["../../src/common/headless-plugin-protocol.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,oDAAkC;AAiBlC;;;GAGG;AACU,QAAA,iCAAiC,GAAG,MAAM,CAAC,mCAAmC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { AbstractPluginManagerExt, EnvInit } from '@theia/plugin-ext';
2
+ import { KeysToKeysToAnyValue } from '@theia/plugin-ext/lib/common/types';
3
+ import { ExtPluginApi } from './plugin-ext-headless-api-contribution';
4
+ export declare const HEADLESSPLUGIN_RPC_CONTEXT: {
5
+ MESSAGE_REGISTRY_MAIN: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<import("@theia/plugin-ext").MessageRegistryMain>;
6
+ ENV_MAIN: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<import("@theia/plugin-ext").EnvMain>;
7
+ NOTIFICATION_MAIN: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<import("@theia/plugin-ext").NotificationMain>;
8
+ LOCALIZATION_MAIN: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<import("@theia/plugin-ext").LocalizationMain>;
9
+ };
10
+ export declare const HEADLESSMAIN_RPC_CONTEXT: {
11
+ HOSTED_PLUGIN_MANAGER_EXT: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<HeadlessPluginManagerExt>;
12
+ NOTIFICATION_EXT: import("@theia/plugin-ext/lib/common/rpc-protocol").ProxyIdentifier<import("@theia/plugin-ext").NotificationExt>;
13
+ };
14
+ export declare type HeadlessEnvInit = Pick<EnvInit, 'language' | 'shell' | 'appName' | 'appHost'>;
15
+ export interface HeadlessPluginManagerInitializeParams {
16
+ activationEvents: string[];
17
+ globalState: KeysToKeysToAnyValue;
18
+ env: HeadlessEnvInit;
19
+ extApi?: ExtPluginApi[];
20
+ }
21
+ export interface HeadlessPluginManagerExt extends AbstractPluginManagerExt<HeadlessPluginManagerInitializeParams> {
22
+ }
23
+ //# sourceMappingURL=headless-plugin-rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-rpc.d.ts","sourceRoot":"","sources":["../../src/common/headless-plugin-rpc.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAI1E,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;;;CAKtC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAGpC,CAAC;AAEF,oBAAY,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC,CAAC;AAE1F,MAAM,WAAW,qCAAqC;IAClD,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,oBAAoB,CAAC;IAClC,GAAG,EAAE,eAAe,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB,CAAC,qCAAqC,CAAC;CAAI"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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.HEADLESSMAIN_RPC_CONTEXT = exports.HEADLESSPLUGIN_RPC_CONTEXT = void 0;
19
+ const rpc_protocol_1 = require("@theia/plugin-ext/lib/common/rpc-protocol");
20
+ const plugin_api_rpc_1 = require("@theia/plugin-ext/lib/common/plugin-api-rpc");
21
+ exports.HEADLESSPLUGIN_RPC_CONTEXT = {
22
+ MESSAGE_REGISTRY_MAIN: plugin_api_rpc_1.PLUGIN_RPC_CONTEXT.MESSAGE_REGISTRY_MAIN,
23
+ ENV_MAIN: plugin_api_rpc_1.PLUGIN_RPC_CONTEXT.ENV_MAIN,
24
+ NOTIFICATION_MAIN: plugin_api_rpc_1.PLUGIN_RPC_CONTEXT.NOTIFICATION_MAIN,
25
+ LOCALIZATION_MAIN: plugin_api_rpc_1.PLUGIN_RPC_CONTEXT.LOCALIZATION_MAIN,
26
+ };
27
+ exports.HEADLESSMAIN_RPC_CONTEXT = {
28
+ HOSTED_PLUGIN_MANAGER_EXT: (0, rpc_protocol_1.createProxyIdentifier)('HeadlessPluginManagerExt'),
29
+ NOTIFICATION_EXT: plugin_api_rpc_1.MAIN_RPC_CONTEXT.NOTIFICATION_EXT,
30
+ };
31
+ //# sourceMappingURL=headless-plugin-rpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-plugin-rpc.js","sourceRoot":"","sources":["../../src/common/headless-plugin-rpc.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,4EAAkF;AAGlF,gFAEqD;AAGxC,QAAA,0BAA0B,GAAG;IACtC,qBAAqB,EAAE,mCAAkB,CAAC,qBAAqB;IAC/D,QAAQ,EAAE,mCAAkB,CAAC,QAAQ;IACrC,iBAAiB,EAAE,mCAAkB,CAAC,iBAAiB;IACvD,iBAAiB,EAAE,mCAAkB,CAAC,iBAAiB;CAC1D,CAAC;AAEW,QAAA,wBAAwB,GAAG;IACpC,yBAAyB,EAAE,IAAA,oCAAqB,EAA2B,0BAA0B,CAAC;IACtG,gBAAgB,EAAE,iCAAgB,CAAC,gBAAgB;CACtD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './headless-plugin-container';
2
+ export { ExtPluginApi, ExtPluginHeadlessApi, ExtPluginApiProvider, ExtPluginHeadlessApiProvider } from './plugin-ext-headless-api-contribution';
3
+ export { PluginPackage, SupportedHeadlessActivationEvents } from './headless-plugin-protocol';
4
+ export * from './headless-plugin-rpc';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAgBA,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACH,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EACxD,4BAA4B,EAC/B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAC9F,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.SupportedHeadlessActivationEvents = exports.ExtPluginApiProvider = void 0;
29
+ __exportStar(require("./headless-plugin-container"), exports);
30
+ var plugin_ext_headless_api_contribution_1 = require("./plugin-ext-headless-api-contribution");
31
+ Object.defineProperty(exports, "ExtPluginApiProvider", { enumerable: true, get: function () { return plugin_ext_headless_api_contribution_1.ExtPluginApiProvider; } });
32
+ var headless_plugin_protocol_1 = require("./headless-plugin-protocol");
33
+ Object.defineProperty(exports, "SupportedHeadlessActivationEvents", { enumerable: true, get: function () { return headless_plugin_protocol_1.SupportedHeadlessActivationEvents; } });
34
+ __exportStar(require("./headless-plugin-rpc"), exports);
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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,8DAA4C;AAC5C,+FAGgD;AAFR,4IAAA,oBAAoB,OAAA;AAG5D,uEAA8F;AAAtE,6IAAA,iCAAiC,OAAA;AACzD,wDAAsC"}
@@ -0,0 +1,38 @@
1
+ import { PluginManager } from '@theia/plugin-ext';
2
+ import { RPCProtocol } from '@theia/plugin-ext/lib/common/rpc-protocol';
3
+ export * from '@theia/plugin-ext';
4
+ declare module '@theia/plugin-ext' {
5
+ /**
6
+ * Plugin API extension description.
7
+ * This interface describes scripts for all three plugin runtimes: frontend (WebWorker), backend (NodeJs), and headless (NodeJs).
8
+ */
9
+ interface ExtPluginApi extends ExtPluginHeadlessApi {
10
+ }
11
+ }
12
+ /**
13
+ * Provider for headless extension API description.
14
+ */
15
+ export interface ExtPluginHeadlessApiProvider {
16
+ /**
17
+ * Provide API description.
18
+ */
19
+ provideApi(): ExtPluginHeadlessApi;
20
+ }
21
+ /**
22
+ * Headless Plugin API extension description.
23
+ * This interface describes a script for the headless (NodeJs) runtime outside of the scope of frontend connections.
24
+ */
25
+ export interface ExtPluginHeadlessApi {
26
+ /**
27
+ * Path to the script which should be loaded to provide api, module should export `provideApi` function with
28
+ * [ExtPluginApiBackendInitializationFn](#ExtPluginApiBackendInitializationFn) signature
29
+ */
30
+ headlessInitPath?: string;
31
+ }
32
+ /**
33
+ * Signature of the extension API initialization function for APIs contributed to headless plugins.
34
+ */
35
+ export interface ExtPluginApiHeadlessInitializationFn {
36
+ (rpc: RPCProtocol, pluginManager: PluginManager): void;
37
+ }
38
+ //# sourceMappingURL=plugin-ext-headless-api-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-ext-headless-api-contribution.d.ts","sourceRoot":"","sources":["../../src/common/plugin-ext-headless-api-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,cAAc,mBAAmB,CAAC;AAElC,OAAO,QAAQ,mBAAmB,CAAC;IAC/B;;;OAGG;IACH,UAAU,YAAa,SAAQ,oBAAoB;KAGlD;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC;;OAEG;IACH,UAAU,IAAI,oBAAoB,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD,CAAC,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CAC1D"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ __exportStar(require("@theia/plugin-ext"), exports);
29
+ //# sourceMappingURL=plugin-ext-headless-api-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-ext-headless-api-contribution.js","sourceRoot":"","sources":["../../src/common/plugin-ext-headless-api-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;;;;;;;;;;AAKhF,oDAAkC"}
@@ -0,0 +1,30 @@
1
+ import { DeployedPlugin, HostedPluginServer } from '@theia/plugin-ext/lib/common/plugin-protocol';
2
+ import { RPCProtocol } from '@theia/plugin-ext/lib/common/rpc-protocol';
3
+ import { ContributionProvider, Disposable, DisposableCollection } from '@theia/core';
4
+ import { HostedPluginProcess } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin-process';
5
+ import { IShellTerminalServer } from '@theia/terminal/lib/common/shell-terminal-protocol';
6
+ import { HeadlessPluginManagerExt } from '../../common/headless-plugin-rpc';
7
+ import { AbstractHostedPluginSupport, PluginContributions } from '@theia/plugin-ext/lib/hosted/common/hosted-plugin';
8
+ import { TheiaHeadlessPluginScanner } from './scanners/scanner-theia-headless';
9
+ import { PluginDeployerImpl } from '@theia/plugin-ext/lib/main/node/plugin-deployer-impl';
10
+ export declare type HeadlessPluginHost = string;
11
+ export declare function isHeadlessPlugin(plugin: DeployedPlugin): boolean;
12
+ export declare class HeadlessHostedPluginSupport extends AbstractHostedPluginSupport<HeadlessPluginManagerExt, HostedPluginServer> {
13
+ protected readonly pluginProcess: HostedPluginProcess;
14
+ protected readonly shellTerminalServer: IShellTerminalServer;
15
+ protected readonly scanner: TheiaHeadlessPluginScanner;
16
+ protected readonly pluginDeployer: PluginDeployerImpl;
17
+ protected readonly supportedActivationEventsContributions: ContributionProvider<string[]>;
18
+ constructor();
19
+ shutDown(): void;
20
+ protected createTheiaReadyPromise(): Promise<unknown>;
21
+ protected acceptPlugin(plugin: DeployedPlugin): boolean | DeployedPlugin;
22
+ protected handleContributions(_plugin: DeployedPlugin): Disposable;
23
+ protected beforeSyncPlugins(toDisconnect: DisposableCollection): Promise<void>;
24
+ protected obtainManager(host: string, hostContributions: PluginContributions[], toDisconnect: DisposableCollection): Promise<HeadlessPluginManagerExt | undefined>;
25
+ protected initRpc(host: HeadlessPluginHost, pluginId: string): RPCProtocol;
26
+ protected createServerRpc(pluginHostId: string): RPCProtocol;
27
+ protected getStoragePath(): Promise<string | undefined>;
28
+ protected getHostGlobalStoragePath(): Promise<string>;
29
+ }
30
+ //# sourceMappingURL=headless-hosted-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-hosted-plugin.d.ts","sourceRoot":"","sources":["../../../src/hosted/node/headless-hosted-plugin.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAe,cAAc,EAAE,kBAAkB,EAAkB,MAAM,8CAA8C,CAAC;AAE/H,OAAO,EAAE,WAAW,EAAmB,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB,EAAO,MAAM,aAAa,CAAC;AAI1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAA4B,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACrH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAM1F,oBAAY,kBAAkB,GAAG,MAAM,CAAC;AAExC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAEhE;AAED,qBACa,2BAA4B,SAAQ,2BAA2B,CAAC,wBAAwB,EAAE,kBAAkB,CAAC;IAGtH,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAGtD,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAG7D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAGvD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,kBAAkB,CAAC;IAItD,SAAS,CAAC,QAAQ,CAAC,sCAAsC,EAAE,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;;IAM1F,QAAQ,IAAI,IAAI;IAIhB,SAAS,CAAC,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IAKrD,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,cAAc;IAcxE,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,UAAU;cAKzC,iBAAiB,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;cAU7E,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAyCxK,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW;IAQ1E,SAAS,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;cAM5C,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;cAM7C,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC;CA4B9D"}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2024 EclipseSource 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
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ // some code copied and modified from https://github.com/microsoft/vscode/blob/da5fb7d5b865aa522abc7e82c10b746834b98639/src/vs/workbench/api/node/extHostExtensionService.ts
22
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
23
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
25
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
26
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
27
+ };
28
+ var __metadata = (this && this.__metadata) || function (k, v) {
29
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.HeadlessHostedPluginSupport = exports.isHeadlessPlugin = void 0;
33
+ const uuid_1 = require("@theia/core/lib/common/uuid");
34
+ const inversify_1 = require("@theia/core/shared/inversify");
35
+ const plugin_protocol_1 = require("@theia/plugin-ext/lib/common/plugin-protocol");
36
+ const main_context_1 = require("../../main/node/main-context");
37
+ const rpc_protocol_1 = require("@theia/plugin-ext/lib/common/rpc-protocol");
38
+ const core_1 = require("@theia/core");
39
+ const environment_1 = require("@theia/core/shared/@theia/application-package/lib/environment");
40
+ const node_1 = require("@theia/core/lib/node");
41
+ const backend_application_config_provider_1 = require("@theia/core/lib/node/backend-application-config-provider");
42
+ const hosted_plugin_process_1 = require("@theia/plugin-ext/lib/hosted/node/hosted-plugin-process");
43
+ const shell_terminal_protocol_1 = require("@theia/terminal/lib/common/shell-terminal-protocol");
44
+ const headless_plugin_rpc_1 = require("../../common/headless-plugin-rpc");
45
+ const hosted_plugin_1 = require("@theia/plugin-ext/lib/hosted/common/hosted-plugin");
46
+ const scanner_theia_headless_1 = require("./scanners/scanner-theia-headless");
47
+ const headless_plugin_protocol_1 = require("../../common/headless-plugin-protocol");
48
+ const plugin_deployer_impl_1 = require("@theia/plugin-ext/lib/main/node/plugin-deployer-impl");
49
+ const uri_1 = require("@theia/core/lib/common/uri");
50
+ const asyncFs = require("fs/promises");
51
+ function isHeadlessPlugin(plugin) {
52
+ return !!plugin.metadata.model.entryPoint.headless;
53
+ }
54
+ exports.isHeadlessPlugin = isHeadlessPlugin;
55
+ let HeadlessHostedPluginSupport = class HeadlessHostedPluginSupport extends hosted_plugin_1.AbstractHostedPluginSupport {
56
+ constructor() {
57
+ super((0, uuid_1.generateUuid)());
58
+ }
59
+ shutDown() {
60
+ this.pluginProcess.terminatePluginServer();
61
+ }
62
+ createTheiaReadyPromise() {
63
+ return Promise.all([this.envServer.getVariables()]);
64
+ }
65
+ // Only load headless plugins
66
+ acceptPlugin(plugin) {
67
+ if (!isHeadlessPlugin(plugin)) {
68
+ return false;
69
+ }
70
+ if (plugin.metadata.model.engine.type === this.scanner.apiType) {
71
+ // Easy case: take it as it is
72
+ return true;
73
+ }
74
+ // Adapt it for headless
75
+ return this.scanner.adaptForHeadless(plugin);
76
+ }
77
+ handleContributions(_plugin) {
78
+ // We have no contribution points, yet, for headless plugins
79
+ return core_1.Disposable.NULL;
80
+ }
81
+ async beforeSyncPlugins(toDisconnect) {
82
+ await super.beforeSyncPlugins(toDisconnect);
83
+ // Plugin deployment is asynchronous, so wait until that's finished.
84
+ return new Promise((resolve, reject) => {
85
+ this.pluginDeployer.onDidDeploy(resolve);
86
+ toDisconnect.push(core_1.Disposable.create(reject));
87
+ });
88
+ }
89
+ async obtainManager(host, hostContributions, toDisconnect) {
90
+ let manager = this.managers.get(host);
91
+ if (!manager) {
92
+ const pluginId = (0, plugin_protocol_1.getPluginId)(hostContributions[0].plugin.metadata.model);
93
+ const rpc = this.initRpc(host, pluginId);
94
+ toDisconnect.push(rpc);
95
+ manager = rpc.getProxy(headless_plugin_rpc_1.HEADLESSMAIN_RPC_CONTEXT.HOSTED_PLUGIN_MANAGER_EXT);
96
+ this.managers.set(host, manager);
97
+ toDisconnect.push(core_1.Disposable.create(() => this.managers.delete(host)));
98
+ const [extApi, globalState] = await Promise.all([
99
+ this.server.getExtPluginAPI(),
100
+ this.pluginServer.getAllStorageValues(undefined)
101
+ ]);
102
+ if (toDisconnect.disposed) {
103
+ return undefined;
104
+ }
105
+ const activationEvents = this.supportedActivationEventsContributions.getContributions().flatMap(array => array);
106
+ const shell = await this.shellTerminalServer.getDefaultShell();
107
+ const isElectron = environment_1.environment.electron.is();
108
+ await manager.$init({
109
+ activationEvents,
110
+ globalState,
111
+ env: {
112
+ language: core_1.nls.locale || core_1.nls.defaultLocale,
113
+ shell,
114
+ appName: backend_application_config_provider_1.BackendApplicationConfigProvider.get().applicationName,
115
+ appHost: isElectron ? 'desktop' : 'web' // TODO: 'web' could be the embedder's name, e.g. 'github.dev'
116
+ },
117
+ extApi
118
+ });
119
+ if (toDisconnect.disposed) {
120
+ return undefined;
121
+ }
122
+ }
123
+ return manager;
124
+ }
125
+ initRpc(host, pluginId) {
126
+ const rpc = this.createServerRpc(host);
127
+ this.container.bind(rpc_protocol_1.RPCProtocol).toConstantValue(rpc);
128
+ (0, main_context_1.setUpPluginApi)(rpc, this.container);
129
+ this.mainPluginApiProviders.getContributions().forEach(p => p.initialize(rpc, this.container));
130
+ return rpc;
131
+ }
132
+ createServerRpc(pluginHostId) {
133
+ const channel = new node_1.IPCChannel(this.pluginProcess['childProcess']);
134
+ return new rpc_protocol_1.RPCProtocolImpl(channel);
135
+ }
136
+ async getStoragePath() {
137
+ // Headless plugins are associated with the main Node process, so
138
+ // their storage is the global storage.
139
+ return this.getHostGlobalStoragePath();
140
+ }
141
+ async getHostGlobalStoragePath() {
142
+ const configDirUri = await this.envServer.getConfigDirUri();
143
+ const globalStorageFolderUri = new uri_1.default(configDirUri).resolve('globalStorage');
144
+ const globalStorageFolderUrl = new URL(globalStorageFolderUri.toString());
145
+ let stat;
146
+ try {
147
+ stat = await asyncFs.stat(globalStorageFolderUrl);
148
+ }
149
+ catch (_) {
150
+ // OK, no such directory
151
+ }
152
+ if (stat && !stat.isDirectory()) {
153
+ throw new Error(`Global storage folder is not a directory: ${globalStorageFolderUri}`);
154
+ }
155
+ // Make sure that folder by the path exists
156
+ if (!stat) {
157
+ await asyncFs.mkdir(globalStorageFolderUrl, { recursive: true });
158
+ }
159
+ const globalStorageFolderFsPath = await asyncFs.realpath(globalStorageFolderUrl);
160
+ if (!globalStorageFolderFsPath) {
161
+ throw new Error(`Could not resolve the FS path for URI: ${globalStorageFolderUri}`);
162
+ }
163
+ return globalStorageFolderFsPath;
164
+ }
165
+ };
166
+ __decorate([
167
+ (0, inversify_1.inject)(hosted_plugin_process_1.HostedPluginProcess),
168
+ __metadata("design:type", hosted_plugin_process_1.HostedPluginProcess)
169
+ ], HeadlessHostedPluginSupport.prototype, "pluginProcess", void 0);
170
+ __decorate([
171
+ (0, inversify_1.inject)(shell_terminal_protocol_1.IShellTerminalServer),
172
+ __metadata("design:type", Object)
173
+ ], HeadlessHostedPluginSupport.prototype, "shellTerminalServer", void 0);
174
+ __decorate([
175
+ (0, inversify_1.inject)(scanner_theia_headless_1.TheiaHeadlessPluginScanner),
176
+ __metadata("design:type", scanner_theia_headless_1.TheiaHeadlessPluginScanner)
177
+ ], HeadlessHostedPluginSupport.prototype, "scanner", void 0);
178
+ __decorate([
179
+ (0, inversify_1.inject)(plugin_protocol_1.PluginDeployer),
180
+ __metadata("design:type", plugin_deployer_impl_1.PluginDeployerImpl)
181
+ ], HeadlessHostedPluginSupport.prototype, "pluginDeployer", void 0);
182
+ __decorate([
183
+ (0, inversify_1.inject)(core_1.ContributionProvider),
184
+ (0, inversify_1.named)(headless_plugin_protocol_1.SupportedHeadlessActivationEvents),
185
+ __metadata("design:type", Object)
186
+ ], HeadlessHostedPluginSupport.prototype, "supportedActivationEventsContributions", void 0);
187
+ HeadlessHostedPluginSupport = __decorate([
188
+ (0, inversify_1.injectable)(),
189
+ __metadata("design:paramtypes", [])
190
+ ], HeadlessHostedPluginSupport);
191
+ exports.HeadlessHostedPluginSupport = HeadlessHostedPluginSupport;
192
+ //# sourceMappingURL=headless-hosted-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headless-hosted-plugin.js","sourceRoot":"","sources":["../../../src/hosted/node/headless-hosted-plugin.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,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;;;gGAGgG;AAChG,4KAA4K;;;;;;;;;;;;AAE5K,sDAA2D;AAC3D,4DAAyE;AACzE,kFAA+H;AAC/H,+DAA8D;AAC9D,4EAAyF;AACzF,sCAA0F;AAC1F,+FAA4F;AAC5F,+CAAkD;AAClD,kHAA4G;AAC5G,mGAA8F;AAC9F,gGAA0F;AAC1F,0EAAsG;AACtG,qFAAqH;AACrH,8EAA+E;AAC/E,oFAA0F;AAC1F,+FAA0F;AAE1F,oDAA6C;AAE7C,uCAAuC;AAIvC,SAAgB,gBAAgB,CAAC,MAAsB;IACnD,OAAO,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;AACvD,CAAC;AAFD,4CAEC;AAGD,IAAa,2BAA2B,GAAxC,MAAa,2BAA4B,SAAQ,2CAAyE;IAkBtH;QACI,KAAK,CAAC,IAAA,mBAAY,GAAE,CAAC,CAAC;IAC1B,CAAC;IAED,QAAQ;QACJ,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC;IAES,uBAAuB;QAC7B,OAAO,O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AM,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SACrD;QAAC,OAAO,CAAC,EAAE;YACR,wBAAwB;SAC3B;QAED,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,6CAA6C,sBAAsB,EAAE,CAAC,CAAC;SAC1F;QAED,2CAA2C;QAC3C,IAAI,CAAC,IAAI,EAAE;YACP,MAAM,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;SACpE;QAED,MAAM,yBAAyB,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,CAAC;QACjF,IAAI,CAAC,yBAAyB,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,0CAA0C,sBAAsB,EAAE,CAAC,CAAC;SACvF;QACD,OAAO,yBAAyB,CAAC;IACrC,CAAC;CACJ,CAAA;AAlJG;IADC,IAAA,kBAAM,EAAC,2CAAmB,CAAC;8BACM,2CAAmB;kEAAC;AAGtD;IADC,IAAA,kBAAM,EAAC,8CAAoB,CAAC;;wEACgC;AAG7D;IADC,IAAA,kBAAM,EAAC,mDAA0B,CAAC;8BACP,mDAA0B;4DAAC;AAGvD;IADC,IAAA,kBAAM,EAAC,gCAAc,CAAC;8BACY,yCAAkB;mEAAC;AAItD;IAFC,IAAA,kBAAM,EAAC,2BAAoB,CAAC;IAC5B,IAAA,iBAAK,EAAC,4DAAiC,CAAC;;2FACiD;AAhBjF,2BAA2B;IADvC,IAAA,sBAAU,GAAE;;GACA,2BAA2B,CAqJvC;AArJY,kEAA2B"}
@@ -0,0 +1,4 @@
1
+ import { interfaces } from '@theia/core/shared/inversify';
2
+ export declare function bindCommonHostedBackend(bind: interfaces.Bind): void;
3
+ export declare function bindHeadlessHosted(bind: interfaces.Bind): void;
4
+ //# sourceMappingURL=plugin-ext-headless-hosted-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-ext-headless-hosted-module.d.ts","sourceRoot":"","sources":["../../../src/hosted/node/plugin-ext-headless-hosted-module.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAmB,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAW3E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CAgBnE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,IAAI,CA0B9D"}