@powerlines/engine 0.15.3 → 0.15.5

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 (42) hide show
  1. package/dist/create-execution-host-C-IDgIxZ.d.mts +21 -0
  2. package/dist/create-execution-host-C-IDgIxZ.d.mts.map +1 -0
  3. package/dist/create-execution-host-C0ubgqhz.d.cts +21 -0
  4. package/dist/create-execution-host-C0ubgqhz.d.cts.map +1 -0
  5. package/dist/execution-host-worker-B8TS4clU.d.mts +68 -0
  6. package/dist/execution-host-worker-B8TS4clU.d.mts.map +1 -0
  7. package/dist/execution-host-worker-BjXO7l3Q.d.cts +68 -0
  8. package/dist/execution-host-worker-BjXO7l3Q.d.cts.map +1 -0
  9. package/dist/finalize-CW0cO75l.d.cts +12 -0
  10. package/dist/finalize-CW0cO75l.d.cts.map +1 -0
  11. package/dist/finalize-DeSY1r74.d.mts +12 -0
  12. package/dist/finalize-DeSY1r74.d.mts.map +1 -0
  13. package/dist/helpers/create-execution-host.d.cts +2 -21
  14. package/dist/helpers/create-execution-host.d.mts +2 -21
  15. package/dist/helpers/create-execution-host.mjs.map +1 -1
  16. package/dist/helpers/execution-host-worker.d.cts +2 -68
  17. package/dist/helpers/execution-host-worker.d.mts +2 -68
  18. package/dist/helpers/finalize.d.cts +2 -12
  19. package/dist/helpers/finalize.d.mts +2 -12
  20. package/dist/helpers/index.cjs +10 -0
  21. package/dist/helpers/index.d.cts +5 -0
  22. package/dist/helpers/index.d.mts +5 -0
  23. package/dist/helpers/index.mjs +6 -0
  24. package/dist/helpers/rpc.d.cts +2 -7
  25. package/dist/helpers/rpc.d.mts +2 -7
  26. package/dist/index.cjs +3 -0
  27. package/dist/index.d.cts +5 -4
  28. package/dist/index.d.mts +5 -4
  29. package/dist/index.mjs +3 -1
  30. package/dist/rpc-BsFxzyAK.d.cts +7 -0
  31. package/dist/rpc-BsFxzyAK.d.cts.map +1 -0
  32. package/dist/rpc-xwbFMMNu.d.mts +7 -0
  33. package/dist/rpc-xwbFMMNu.d.mts.map +1 -0
  34. package/package.json +7 -3
  35. package/dist/helpers/create-execution-host.d.cts.map +0 -1
  36. package/dist/helpers/create-execution-host.d.mts.map +0 -1
  37. package/dist/helpers/execution-host-worker.d.cts.map +0 -1
  38. package/dist/helpers/execution-host-worker.d.mts.map +0 -1
  39. package/dist/helpers/finalize.d.cts.map +0 -1
  40. package/dist/helpers/finalize.d.mts.map +0 -1
  41. package/dist/helpers/rpc.d.cts.map +0 -1
  42. package/dist/helpers/rpc.d.mts.map +0 -1
@@ -0,0 +1,21 @@
1
+ import { r as EngineResolvedConfig } from "./config-BNe23XHx.mjs";
2
+ import { r as EngineSystemContext } from "./context-DzgsMSWr.mjs";
3
+ import { r as ExecutionHostParams } from "./api-Cdw4v0W4.mjs";
4
+ import { InlineConfig } from "@powerlines/core";
5
+ import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
6
+ import { DeepPartial, MaybePromise } from "@stryke/types/base";
7
+
8
+ //#region src/helpers/create-execution-host.d.ts
9
+ /**
10
+ * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
11
+ *
12
+ * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
13
+ * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
14
+ * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
15
+ */
16
+ declare function createExecutionHost<TContext extends PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext> = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
17
+ [k: string]: (params: ExecutionHostParams) => Promise<void>;
18
+ };
19
+ //#endregion
20
+ export { createExecutionHost as t };
21
+ //# sourceMappingURL=create-execution-host-C-IDgIxZ.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-execution-host-C-IDgIxZ.d.mts","names":[],"sources":["../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;;AAyCA;;;;;iBAAgB,mBAAA,kBACG,0BAAA,CACf,oBAAA,EACA,mBAAA,IACE,0BAAA,CAA2B,oBAAA,EAAsB,mBAAA,EAAA,CAErD,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -0,0 +1,21 @@
1
+ import { r as EngineResolvedConfig } from "./config-D6xUniHh.cjs";
2
+ import { r as EngineSystemContext } from "./context-epL7NPvL.cjs";
3
+ import { r as ExecutionHostParams } from "./api-6w4hZL6n.cjs";
4
+ import { InlineConfig } from "@powerlines/core";
5
+ import { DeepPartial, MaybePromise } from "@stryke/types/base";
6
+ import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
7
+
8
+ //#region src/helpers/create-execution-host.d.ts
9
+ /**
10
+ * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
11
+ *
12
+ * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
13
+ * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
14
+ * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
15
+ */
16
+ declare function createExecutionHost<TContext extends PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext> = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
17
+ [k: string]: (params: ExecutionHostParams) => Promise<void>;
18
+ };
19
+ //#endregion
20
+ export { createExecutionHost as t };
21
+ //# sourceMappingURL=create-execution-host-C0ubgqhz.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-execution-host-C0ubgqhz.d.cts","names":[],"sources":["../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;;AAyCA;;;;;iBAAgB,mBAAA,kBACG,0BAAA,CACf,oBAAA,EACA,mBAAA,IACE,0BAAA,CAA2B,oBAAA,EAAsB,mBAAA,EAAA,CAErD,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -0,0 +1,68 @@
1
+ import { t as EngineContext } from "./context-DzgsMSWr.mjs";
2
+ import { n as ExecutionHost } from "./api-Cdw4v0W4.mjs";
3
+ import { Worker } from "jest-worker";
4
+ import { Mode } from "@powerlines/core";
5
+
6
+ //#region src/helpers/execution-host-worker.d.ts
7
+ type NodeOptions = Record<string, string | boolean | undefined>;
8
+ interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
+ /**
10
+ * The maximum time in milliseconds a worker can run before being terminated.
11
+ *
12
+ * @defaultValue 900000 (15 minutes)
13
+ */
14
+ timeout?: number;
15
+ /**
16
+ * True if `--max-old-space-size` should not be forwarded to the worker.
17
+ */
18
+ isolatedMemory?: boolean;
19
+ /**
20
+ * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
21
+ */
22
+ mode?: Mode;
23
+ /**
24
+ * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
25
+ */
26
+ root?: string;
27
+ /**
28
+ * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
29
+ */
30
+ context: EngineContext;
31
+ /**
32
+ * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
+ */
34
+ executionMethods: TExecutionAPI;
35
+ }
36
+ declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
+ #private;
38
+ protected executionHostPath: string;
39
+ protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
40
+ /**
41
+ * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.
42
+ *
43
+ * @param executionHostPath - The path to the Execution Host file.
44
+ * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
45
+ * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
46
+ */
47
+ static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
48
+ /**
49
+ * Create a new worker instance.
50
+ *
51
+ * @param executionHostPath - The path to the worker file.
52
+ * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
53
+ */
54
+ constructor(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>);
55
+ /**
56
+ * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
57
+ *
58
+ * @returns A promise that resolves when the worker has been successfully terminated.
59
+ */
60
+ end(): ReturnType<Worker["end"]>;
61
+ /**
62
+ * Quietly end the worker if it exists
63
+ */
64
+ close(): void;
65
+ }
66
+ //#endregion
67
+ export { ExecutionHostWorkerOptions as n, NodeOptions as r, ExecutionHostWorker as t };
68
+ //# sourceMappingURL=execution-host-worker-B8TS4clU.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-host-worker-B8TS4clU.d.mts","names":[],"sources":["../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
@@ -0,0 +1,68 @@
1
+ import { t as EngineContext } from "./context-epL7NPvL.cjs";
2
+ import { n as ExecutionHost } from "./api-6w4hZL6n.cjs";
3
+ import { Mode } from "@powerlines/core";
4
+ import { Worker } from "jest-worker";
5
+
6
+ //#region src/helpers/execution-host-worker.d.ts
7
+ type NodeOptions = Record<string, string | boolean | undefined>;
8
+ interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
+ /**
10
+ * The maximum time in milliseconds a worker can run before being terminated.
11
+ *
12
+ * @defaultValue 900000 (15 minutes)
13
+ */
14
+ timeout?: number;
15
+ /**
16
+ * True if `--max-old-space-size` should not be forwarded to the worker.
17
+ */
18
+ isolatedMemory?: boolean;
19
+ /**
20
+ * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
21
+ */
22
+ mode?: Mode;
23
+ /**
24
+ * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
25
+ */
26
+ root?: string;
27
+ /**
28
+ * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
29
+ */
30
+ context: EngineContext;
31
+ /**
32
+ * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
+ */
34
+ executionMethods: TExecutionAPI;
35
+ }
36
+ declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
+ #private;
38
+ protected executionHostPath: string;
39
+ protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
40
+ /**
41
+ * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.
42
+ *
43
+ * @param executionHostPath - The path to the Execution Host file.
44
+ * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
45
+ * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
46
+ */
47
+ static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
48
+ /**
49
+ * Create a new worker instance.
50
+ *
51
+ * @param executionHostPath - The path to the worker file.
52
+ * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
53
+ */
54
+ constructor(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>);
55
+ /**
56
+ * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
57
+ *
58
+ * @returns A promise that resolves when the worker has been successfully terminated.
59
+ */
60
+ end(): ReturnType<Worker["end"]>;
61
+ /**
62
+ * Quietly end the worker if it exists
63
+ */
64
+ close(): void;
65
+ }
66
+ //#endregion
67
+ export { ExecutionHostWorkerOptions as n, NodeOptions as r, ExecutionHostWorker as t };
68
+ //# sourceMappingURL=execution-host-worker-BjXO7l3Q.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-host-worker-BjXO7l3Q.d.cts","names":[],"sources":["../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
@@ -0,0 +1,12 @@
1
+ import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
+
3
+ //#region src/helpers/finalize.d.ts
4
+ /**
5
+ * Finalize the execution context by disposing resources and cleaning up.
6
+ *
7
+ * @param context - The execution context to finalize
8
+ */
9
+ declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
+ //#endregion
11
+ export { finalize as t };
12
+ //# sourceMappingURL=finalize-CW0cO75l.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalize-CW0cO75l.d.cts","names":[],"sources":["../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}
@@ -0,0 +1,12 @@
1
+ import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
+
3
+ //#region src/helpers/finalize.d.ts
4
+ /**
5
+ * Finalize the execution context by disposing resources and cleaning up.
6
+ *
7
+ * @param context - The execution context to finalize
8
+ */
9
+ declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
+ //#endregion
11
+ export { finalize as t };
12
+ //# sourceMappingURL=finalize-DeSY1r74.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"finalize-DeSY1r74.d.mts","names":[],"sources":["../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}
@@ -1,21 +1,2 @@
1
- import { r as EngineResolvedConfig } from "../config-D6xUniHh.cjs";
2
- import { r as EngineSystemContext } from "../context-epL7NPvL.cjs";
3
- import { r as ExecutionHostParams } from "../api-6w4hZL6n.cjs";
4
- import { InlineConfig } from "@powerlines/core";
5
- import { DeepPartial, MaybePromise } from "@stryke/types/base";
6
- import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
7
-
8
- //#region src/helpers/create-execution-host.d.ts
9
- /**
10
- * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
11
- *
12
- * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
13
- * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
14
- * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
15
- */
16
- declare function createExecutionHost<TContext extends PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext> = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
17
- [k: string]: (params: ExecutionHostParams) => Promise<void>;
18
- };
19
- //#endregion
20
- export { createExecutionHost };
21
- //# sourceMappingURL=create-execution-host.d.cts.map
1
+ import { t as createExecutionHost } from "../create-execution-host-C0ubgqhz.cjs";
2
+ export { createExecutionHost };
@@ -1,21 +1,2 @@
1
- import { r as EngineResolvedConfig } from "../config-BNe23XHx.mjs";
2
- import { r as EngineSystemContext } from "../context-DzgsMSWr.mjs";
3
- import { r as ExecutionHostParams } from "../api-Cdw4v0W4.mjs";
4
- import { InlineConfig } from "@powerlines/core";
5
- import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
6
- import { DeepPartial, MaybePromise } from "@stryke/types/base";
7
-
8
- //#region src/helpers/create-execution-host.d.ts
9
- /**
10
- * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
11
- *
12
- * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
13
- * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
14
- * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
15
- */
16
- declare function createExecutionHost<TContext extends PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext> = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
17
- [k: string]: (params: ExecutionHostParams) => Promise<void>;
18
- };
19
- //#endregion
20
- export { createExecutionHost };
21
- //# sourceMappingURL=create-execution-host.d.mts.map
1
+ import { t as createExecutionHost } from "../create-execution-host-C-IDgIxZ.mjs";
2
+ export { createExecutionHost };
@@ -1 +1 @@
1
- {"version":3,"file":"create-execution-host.mjs","names":[],"sources":["../../src/helpers/create-execution-host.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { InlineConfig, LogFnMeta } from \"@powerlines/core\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { consoleLogger } from \"@powerlines/core/plugin-utils\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { DeepPartial, MaybePromise } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { defu } from \"defu\";\nimport { RpcClient } from \"../types\";\nimport { ExecutionHostParams } from \"../types/api\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { createRpcClient } from \"./rpc\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(\n methods: Record<string, (context: TContext) => Promise<void>>,\n inlineConfig:\n | DeepPartial<InlineConfig>\n | ((prev: InlineConfig) => MaybePromise<InlineConfig>) = {}\n) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const { options } = params;\n\n let rpc!: RpcClient;\n if (options.baseURL && options.connection) {\n rpc = createRpcClient(options);\n } else {\n throw new Error(\n `Execution RPC client could not be created - Missing ${\n !options.baseURL\n ? `baseURL${options.connection ? ` and connection information` : \"\"}`\n : \"connection\"\n } or connection information.`\n );\n }\n\n const logFn = (meta: LogFnMeta, message: string) => {\n consoleLogger(meta, message);\n if (rpc) {\n void rpc.callEvent(\"powerlines:log\", {\n meta: {\n category: \"general\",\n ...options,\n ...(isSetObject(meta) ? meta : { type: meta }),\n logId: uuid(),\n timestamp: Date.now()\n },\n message\n });\n }\n };\n\n const context = (await PowerlinesExecutionContext.from<\n EngineResolvedConfig,\n EngineSystemContext\n >(\n { ...options, logFn },\n isFunction(inlineConfig)\n ? await Promise.resolve(inlineConfig(params.inlineConfig ?? {}))\n : (defu(inlineConfig, params.inlineConfig ?? {}) as InlineConfig),\n {\n rpc\n }\n )) as TContext;\n\n context.logger.info(\n `Starting ${\n titleCase(options.framework?.name) || \"Powerlines\"\n } - ${titleCase(method)} execution (${options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,SAAgB,oBAMd,SACA,eAE2D,EAAE,EAC7D;AACA,QAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,KAAK,CAAC,QAAQ,QAAQ,CAC5C,QACA,OAAO,WAAgC;EACrC,MAAM,EAAE,YAAY;EAEpB,IAAI;AACJ,MAAI,QAAQ,WAAW,QAAQ,WAC7B,OAAM,gBAAgB,QAAQ;MAE9B,OAAM,IAAI,MACR,uDACE,CAAC,QAAQ,UACL,UAAU,QAAQ,aAAa,gCAAgC,OAC/D,aACL,6BACF;EAGH,MAAM,SAAS,MAAiB,YAAoB;AAClD,iBAAc,MAAM,QAAQ;AAC5B,OAAI,IACF,CAAK,IAAI,UAAU,kBAAkB;IACnC,MAAM;KACJ,UAAU;KACV,GAAG;KACH,GAAI,YAAY,KAAK,GAAG,OAAO,EAAE,MAAM,MAAM;KAC7C,OAAO,MAAM;KACb,WAAW,KAAK,KAAK;KACtB;IACD;IACD,CAAC;;EAIN,MAAM,UAAW,MAAM,2BAA2B,KAIhD;GAAE,GAAG;GAAS;GAAO,EACrB,WAAW,aAAa,GACpB,MAAM,QAAQ,QAAQ,aAAa,OAAO,gBAAgB,EAAE,CAAC,CAAC,GAC7D,KAAK,cAAc,OAAO,gBAAgB,EAAE,CAAC,EAClD,EACE,KACD,CACF;AAED,UAAQ,OAAO,KACb,YACE,UAAU,QAAQ,WAAW,KAAK,IAAI,aACvC,KAAK,UAAU,OAAO,CAAC,cAAc,QAAQ,YAAY,GAC3D;AAED,QAAM,oBAAoB,QAA2C;AAErE,QAAM,GAAG,QAAQ;GAEpB,CAAC,CACH"}
1
+ {"version":3,"file":"create-execution-host.mjs","names":[],"sources":["../../src/helpers/create-execution-host.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { InlineConfig, LogFnMeta } from \"@powerlines/core\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { consoleLogger } from \"@powerlines/core/plugin-utils\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport type { DeepPartial, MaybePromise } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { defu } from \"defu\";\nimport type { RpcClient } from \"../types\";\nimport type { ExecutionHostParams } from \"../types/api\";\nimport type { EngineResolvedConfig } from \"../types/config\";\nimport type { EngineSystemContext } from \"../types/context\";\nimport { createRpcClient } from \"./rpc\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(\n methods: Record<string, (context: TContext) => Promise<void>>,\n inlineConfig:\n | DeepPartial<InlineConfig>\n | ((prev: InlineConfig) => MaybePromise<InlineConfig>) = {}\n) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const { options } = params;\n\n let rpc!: RpcClient;\n if (options.baseURL && options.connection) {\n rpc = createRpcClient(options);\n } else {\n throw new Error(\n `Execution RPC client could not be created - Missing ${\n !options.baseURL\n ? `baseURL${options.connection ? ` and connection information` : \"\"}`\n : \"connection\"\n } or connection information.`\n );\n }\n\n const logFn = (meta: LogFnMeta, message: string) => {\n consoleLogger(meta, message);\n if (rpc) {\n void rpc.callEvent(\"powerlines:log\", {\n meta: {\n category: \"general\",\n ...options,\n ...(isSetObject(meta) ? meta : { type: meta }),\n logId: uuid(),\n timestamp: Date.now()\n },\n message\n });\n }\n };\n\n const context = (await PowerlinesExecutionContext.from<\n EngineResolvedConfig,\n EngineSystemContext\n >(\n { ...options, logFn },\n isFunction(inlineConfig)\n ? await Promise.resolve(inlineConfig(params.inlineConfig ?? {}))\n : (defu(inlineConfig, params.inlineConfig ?? {}) as InlineConfig),\n {\n rpc\n }\n )) as TContext;\n\n context.logger.info(\n `Starting ${\n titleCase(options.framework?.name) || \"Powerlines\"\n } - ${titleCase(method)} execution (${options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,SAAgB,oBAMd,SACA,eAE2D,EAAE,EAC7D;AACA,QAAO,OAAO,YACZ,OAAO,QAAQ,QAAQ,CAAC,KAAK,CAAC,QAAQ,QAAQ,CAC5C,QACA,OAAO,WAAgC;EACrC,MAAM,EAAE,YAAY;EAEpB,IAAI;AACJ,MAAI,QAAQ,WAAW,QAAQ,WAC7B,OAAM,gBAAgB,QAAQ;MAE9B,OAAM,IAAI,MACR,uDACE,CAAC,QAAQ,UACL,UAAU,QAAQ,aAAa,gCAAgC,OAC/D,aACL,6BACF;EAGH,MAAM,SAAS,MAAiB,YAAoB;AAClD,iBAAc,MAAM,QAAQ;AAC5B,OAAI,IACF,CAAK,IAAI,UAAU,kBAAkB;IACnC,MAAM;KACJ,UAAU;KACV,GAAG;KACH,GAAI,YAAY,KAAK,GAAG,OAAO,EAAE,MAAM,MAAM;KAC7C,OAAO,MAAM;KACb,WAAW,KAAK,KAAK;KACtB;IACD;IACD,CAAC;;EAIN,MAAM,UAAW,MAAM,2BAA2B,KAIhD;GAAE,GAAG;GAAS;GAAO,EACrB,WAAW,aAAa,GACpB,MAAM,QAAQ,QAAQ,aAAa,OAAO,gBAAgB,EAAE,CAAC,CAAC,GAC7D,KAAK,cAAc,OAAO,gBAAgB,EAAE,CAAC,EAClD,EACE,KACD,CACF;AAED,UAAQ,OAAO,KACb,YACE,UAAU,QAAQ,WAAW,KAAK,IAAI,aACvC,KAAK,UAAU,OAAO,CAAC,cAAc,QAAQ,YAAY,GAC3D;AAED,QAAM,oBAAoB,QAA2C;AAErE,QAAM,GAAG,QAAQ;GAEpB,CAAC,CACH"}
@@ -1,68 +1,2 @@
1
- import { t as EngineContext } from "../context-epL7NPvL.cjs";
2
- import { n as ExecutionHost } from "../api-6w4hZL6n.cjs";
3
- import { Mode } from "@powerlines/core";
4
- import { Worker } from "jest-worker";
5
-
6
- //#region src/helpers/execution-host-worker.d.ts
7
- type NodeOptions = Record<string, string | boolean | undefined>;
8
- interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
- /**
10
- * The maximum time in milliseconds a worker can run before being terminated.
11
- *
12
- * @defaultValue 900000 (15 minutes)
13
- */
14
- timeout?: number;
15
- /**
16
- * True if `--max-old-space-size` should not be forwarded to the worker.
17
- */
18
- isolatedMemory?: boolean;
19
- /**
20
- * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
21
- */
22
- mode?: Mode;
23
- /**
24
- * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
25
- */
26
- root?: string;
27
- /**
28
- * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
29
- */
30
- context: EngineContext;
31
- /**
32
- * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
- */
34
- executionMethods: TExecutionAPI;
35
- }
36
- declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
- #private;
38
- protected executionHostPath: string;
39
- protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
40
- /**
41
- * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.
42
- *
43
- * @param executionHostPath - The path to the Execution Host file.
44
- * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
45
- * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
46
- */
47
- static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
48
- /**
49
- * Create a new worker instance.
50
- *
51
- * @param executionHostPath - The path to the worker file.
52
- * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
53
- */
54
- constructor(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>);
55
- /**
56
- * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
57
- *
58
- * @returns A promise that resolves when the worker has been successfully terminated.
59
- */
60
- end(): ReturnType<Worker["end"]>;
61
- /**
62
- * Quietly end the worker if it exists
63
- */
64
- close(): void;
65
- }
66
- //#endregion
67
- export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions };
68
- //# sourceMappingURL=execution-host-worker.d.cts.map
1
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "../execution-host-worker-BjXO7l3Q.cjs";
2
+ export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions };
@@ -1,68 +1,2 @@
1
- import { t as EngineContext } from "../context-DzgsMSWr.mjs";
2
- import { n as ExecutionHost } from "../api-Cdw4v0W4.mjs";
3
- import { Worker } from "jest-worker";
4
- import { Mode } from "@powerlines/core";
5
-
6
- //#region src/helpers/execution-host-worker.d.ts
7
- type NodeOptions = Record<string, string | boolean | undefined>;
8
- interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
- /**
10
- * The maximum time in milliseconds a worker can run before being terminated.
11
- *
12
- * @defaultValue 900000 (15 minutes)
13
- */
14
- timeout?: number;
15
- /**
16
- * True if `--max-old-space-size` should not be forwarded to the worker.
17
- */
18
- isolatedMemory?: boolean;
19
- /**
20
- * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).
21
- */
22
- mode?: Mode;
23
- /**
24
- * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.
25
- */
26
- root?: string;
27
- /**
28
- * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.
29
- */
30
- context: EngineContext;
31
- /**
32
- * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
- */
34
- executionMethods: TExecutionAPI;
35
- }
36
- declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
- #private;
38
- protected executionHostPath: string;
39
- protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
40
- /**
41
- * Creates a new instance of the ExecutionHostWorker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.
42
- *
43
- * @param executionHostPath - The path to the Execution Host file.
44
- * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
45
- * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
46
- */
47
- static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
48
- /**
49
- * Create a new worker instance.
50
- *
51
- * @param executionHostPath - The path to the worker file.
52
- * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
53
- */
54
- constructor(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>);
55
- /**
56
- * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
57
- *
58
- * @returns A promise that resolves when the worker has been successfully terminated.
59
- */
60
- end(): ReturnType<Worker["end"]>;
61
- /**
62
- * Quietly end the worker if it exists
63
- */
64
- close(): void;
65
- }
66
- //#endregion
67
- export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions };
68
- //# sourceMappingURL=execution-host-worker.d.mts.map
1
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "../execution-host-worker-B8TS4clU.mjs";
2
+ export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions };
@@ -1,12 +1,2 @@
1
- import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
-
3
- //#region src/helpers/finalize.d.ts
4
- /**
5
- * Finalize the execution context by disposing resources and cleaning up.
6
- *
7
- * @param context - The execution context to finalize
8
- */
9
- declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
- //#endregion
11
- export { finalize };
12
- //# sourceMappingURL=finalize.d.cts.map
1
+ import { t as finalize } from "../finalize-CW0cO75l.cjs";
2
+ export { finalize };
@@ -1,12 +1,2 @@
1
- import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
-
3
- //#region src/helpers/finalize.d.ts
4
- /**
5
- * Finalize the execution context by disposing resources and cleaning up.
6
- *
7
- * @param context - The execution context to finalize
8
- */
9
- declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
- //#endregion
11
- export { finalize };
12
- //# sourceMappingURL=finalize.d.mts.map
1
+ import { t as finalize } from "../finalize-DeSY1r74.mjs";
2
+ export { finalize };
@@ -0,0 +1,10 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_helpers_execution_host_worker = require('./execution-host-worker.cjs');
3
+ const require_helpers_rpc = require('./rpc.cjs');
4
+ const require_helpers_create_execution_host = require('./create-execution-host.cjs');
5
+ const require_helpers_finalize = require('./finalize.cjs');
6
+
7
+ exports.ExecutionHostWorker = require_helpers_execution_host_worker.ExecutionHostWorker;
8
+ exports.createExecutionHost = require_helpers_create_execution_host.createExecutionHost;
9
+ exports.createRpcClient = require_helpers_rpc.createRpcClient;
10
+ exports.finalize = require_helpers_finalize.finalize;
@@ -0,0 +1,5 @@
1
+ import { t as createExecutionHost } from "../create-execution-host-C0ubgqhz.cjs";
2
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "../execution-host-worker-BjXO7l3Q.cjs";
3
+ import { t as finalize } from "../finalize-CW0cO75l.cjs";
4
+ import { t as createRpcClient } from "../rpc-BsFxzyAK.cjs";
5
+ export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions, createExecutionHost, createRpcClient, finalize };
@@ -0,0 +1,5 @@
1
+ import { t as createExecutionHost } from "../create-execution-host-C-IDgIxZ.mjs";
2
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "../execution-host-worker-B8TS4clU.mjs";
3
+ import { t as finalize } from "../finalize-DeSY1r74.mjs";
4
+ import { t as createRpcClient } from "../rpc-xwbFMMNu.mjs";
5
+ export { ExecutionHostWorker, ExecutionHostWorkerOptions, NodeOptions, createExecutionHost, createRpcClient, finalize };
@@ -0,0 +1,6 @@
1
+ import { ExecutionHostWorker } from "./execution-host-worker.mjs";
2
+ import { createRpcClient } from "./rpc.mjs";
3
+ import { createExecutionHost } from "./create-execution-host.mjs";
4
+ import { finalize } from "./finalize.mjs";
5
+
6
+ export { ExecutionHostWorker, createExecutionHost, createRpcClient, finalize };
@@ -1,7 +1,2 @@
1
- import { i as RpcClientOptions, u as RpcClient } from "../config-D6xUniHh.cjs";
2
-
3
- //#region src/helpers/rpc.d.ts
4
- declare function createRpcClient(options: RpcClientOptions): RpcClient;
5
- //#endregion
6
- export { createRpcClient };
7
- //# sourceMappingURL=rpc.d.cts.map
1
+ import { t as createRpcClient } from "../rpc-BsFxzyAK.cjs";
2
+ export { createRpcClient };
@@ -1,7 +1,2 @@
1
- import { i as RpcClientOptions, u as RpcClient } from "../config-BNe23XHx.mjs";
2
-
3
- //#region src/helpers/rpc.d.ts
4
- declare function createRpcClient(options: RpcClientOptions): RpcClient;
5
- //#endregion
6
- export { createRpcClient };
7
- //# sourceMappingURL=rpc.d.mts.map
1
+ import { t as createRpcClient } from "../rpc-xwbFMMNu.mjs";
2
+ export { createRpcClient };
package/dist/index.cjs CHANGED
@@ -1,11 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_context_engine_context = require('./context/engine-context.cjs');
3
+ const require_helpers_execution_host_worker = require('./helpers/execution-host-worker.cjs');
3
4
  const require_engine = require('./engine.cjs');
4
5
  const require_helpers_rpc = require('./helpers/rpc.cjs');
5
6
  const require_helpers_create_execution_host = require('./helpers/create-execution-host.cjs');
6
7
  require('./context/index.cjs');
7
8
  const require_helpers_finalize = require('./helpers/finalize.cjs');
9
+ require('./helpers/index.cjs');
8
10
 
11
+ exports.ExecutionHostWorker = require_helpers_execution_host_worker.ExecutionHostWorker;
9
12
  exports.PowerlinesEngine = require_engine.PowerlinesEngine;
10
13
  exports.PowerlinesEngineContext = require_context_engine_context.PowerlinesEngineContext;
11
14
  exports.createContext = require_engine.createContext;
package/dist/index.d.cts CHANGED
@@ -3,7 +3,8 @@ import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCo
3
3
  import { t as PowerlinesEngineContext } from "./engine-context-Dw8odBCo.cjs";
4
4
  import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-6w4hZL6n.cjs";
5
5
  import { PowerlinesEngine, createContext, createEngine } from "./engine.cjs";
6
- import { createExecutionHost } from "./helpers/create-execution-host.cjs";
7
- import { finalize } from "./helpers/finalize.cjs";
8
- import { createRpcClient } from "./helpers/rpc.cjs";
9
- export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
6
+ import { t as createExecutionHost } from "./create-execution-host-C0ubgqhz.cjs";
7
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "./execution-host-worker-BjXO7l3Q.cjs";
8
+ import { t as finalize } from "./finalize-CW0cO75l.cjs";
9
+ import { t as createRpcClient } from "./rpc-BsFxzyAK.cjs";
10
+ export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionHostWorker, ExecutionHostWorkerOptions, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, NodeOptions, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
package/dist/index.d.mts CHANGED
@@ -3,7 +3,8 @@ import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCo
3
3
  import { t as PowerlinesEngineContext } from "./engine-context-DEotmVzB.mjs";
4
4
  import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-Cdw4v0W4.mjs";
5
5
  import { PowerlinesEngine, createContext, createEngine } from "./engine.mjs";
6
- import { createExecutionHost } from "./helpers/create-execution-host.mjs";
7
- import { finalize } from "./helpers/finalize.mjs";
8
- import { createRpcClient } from "./helpers/rpc.mjs";
9
- export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
6
+ import { t as createExecutionHost } from "./create-execution-host-C-IDgIxZ.mjs";
7
+ import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "./execution-host-worker-B8TS4clU.mjs";
8
+ import { t as finalize } from "./finalize-DeSY1r74.mjs";
9
+ import { t as createRpcClient } from "./rpc-xwbFMMNu.mjs";
10
+ export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionHostWorker, ExecutionHostWorkerOptions, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, NodeOptions, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
package/dist/index.mjs CHANGED
@@ -1,8 +1,10 @@
1
1
  import { PowerlinesEngineContext } from "./context/engine-context.mjs";
2
+ import { ExecutionHostWorker } from "./helpers/execution-host-worker.mjs";
2
3
  import { PowerlinesEngine, createContext, createEngine } from "./engine.mjs";
3
4
  import { createRpcClient } from "./helpers/rpc.mjs";
4
5
  import { createExecutionHost } from "./helpers/create-execution-host.mjs";
5
6
  import "./context/index.mjs";
6
7
  import { finalize } from "./helpers/finalize.mjs";
8
+ import "./helpers/index.mjs";
7
9
 
8
- export { PowerlinesEngine, PowerlinesEngineContext, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
10
+ export { ExecutionHostWorker, PowerlinesEngine, PowerlinesEngineContext, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
@@ -0,0 +1,7 @@
1
+ import { i as RpcClientOptions, u as RpcClient } from "./config-D6xUniHh.cjs";
2
+
3
+ //#region src/helpers/rpc.d.ts
4
+ declare function createRpcClient(options: RpcClientOptions): RpcClient;
5
+ //#endregion
6
+ export { createRpcClient as t };
7
+ //# sourceMappingURL=rpc-BsFxzyAK.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-BsFxzyAK.d.cts","names":[],"sources":["../src/helpers/rpc.ts"],"mappings":";;;iBA0LgB,eAAA,CAAgB,OAAA,EAAS,gBAAA,GAAgB,SAAA"}
@@ -0,0 +1,7 @@
1
+ import { i as RpcClientOptions, u as RpcClient } from "./config-BNe23XHx.mjs";
2
+
3
+ //#region src/helpers/rpc.d.ts
4
+ declare function createRpcClient(options: RpcClientOptions): RpcClient;
5
+ //#endregion
6
+ export { createRpcClient as t };
7
+ //# sourceMappingURL=rpc-xwbFMMNu.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc-xwbFMMNu.d.mts","names":[],"sources":["../src/helpers/rpc.ts"],"mappings":";;;iBA0LgB,eAAA,CAAgB,OAAA,EAAS,gBAAA,GAAgB,SAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -92,6 +92,10 @@
92
92
  "import": "./dist/execution-host.mjs",
93
93
  "require": "./dist/execution-host.cjs"
94
94
  },
95
+ "./helpers": {
96
+ "import": "./dist/helpers/index.mjs",
97
+ "require": "./dist/helpers/index.cjs"
98
+ },
95
99
  "./helpers/create-execution-host": {
96
100
  "import": "./dist/helpers/create-execution-host.mjs",
97
101
  "require": "./dist/helpers/create-execution-host.cjs"
@@ -115,7 +119,7 @@
115
119
  "types": "./dist/index.d.cts",
116
120
  "files": ["dist"],
117
121
  "dependencies": {
118
- "@powerlines/core": "^0.15.3",
122
+ "@powerlines/core": "^0.15.5",
119
123
  "@storm-software/config": "^1.137.52",
120
124
  "@storm-software/config-tools": "^1.190.20",
121
125
  "@stryke/async": "^0.1.5",
@@ -151,5 +155,5 @@
151
155
  "@types/node": "^25.8.0",
152
156
  "typescript": "^6.0.3"
153
157
  },
154
- "gitHead": "c4aaa370bc05ef2f3813ab165af0ae347657c63d"
158
+ "gitHead": "34fa72f913de6b8b7a33354f8382c531f3bae882"
155
159
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-execution-host.d.cts","names":[],"sources":["../../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;;AAyCA;;;;;iBAAgB,mBAAA,kBACG,0BAAA,CACf,oBAAA,EACA,mBAAA,IACE,0BAAA,CAA2B,oBAAA,EAAsB,mBAAA,EAAA,CAErD,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-execution-host.d.mts","names":[],"sources":["../../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;;AAyCA;;;;;iBAAgB,mBAAA,kBACG,0BAAA,CACf,oBAAA,EACA,mBAAA,IACE,0BAAA,CAA2B,oBAAA,EAAsB,mBAAA,EAAA,CAErD,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host-worker.d.cts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host-worker.d.mts","names":[],"sources":["../../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAmDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,EAAkB,aAAA;AAAA;AAAA,cAGP,mBAAA,uBAA0C,aAAA;EAAA;YAyCzC,iBAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAAA;;;;;;;EAAA,OAhC5B,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EA8BJ;;;;;;cADpC,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EA1CK;;;;;EAkbxC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAxaX;;;EAsbb,KAAA,CAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalize.d.cts","names":[],"sources":["../../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalize.d.mts","names":[],"sources":["../../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.d.cts","names":[],"sources":["../../src/helpers/rpc.ts"],"mappings":";;;iBA0LgB,eAAA,CAAgB,OAAA,EAAS,gBAAA,GAAgB,SAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"rpc.d.mts","names":[],"sources":["../../src/helpers/rpc.ts"],"mappings":";;;iBA0LgB,eAAA,CAAgB,OAAA,EAAS,gBAAA,GAAgB,SAAA"}