@powerlines/engine 0.49.62 โ†’ 0.49.64

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.
@@ -61,5 +61,5 @@ declare class ExecutionApiWorker implements ExecutionApiWorkerInterface {
61
61
  protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
62
62
  }
63
63
  //#endregion
64
- export { ExecutionApiWorker };
64
+ export { ExecutionApiWorker, ExecutionApiWorkerOptions };
65
65
  //# sourceMappingURL=execution-api-worker.d.cts.map
@@ -61,5 +61,5 @@ declare class ExecutionApiWorker implements ExecutionApiWorkerInterface {
61
61
  protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
62
62
  }
63
63
  //#endregion
64
- export { ExecutionApiWorker };
64
+ export { ExecutionApiWorker, ExecutionApiWorkerOptions };
65
65
  //# sourceMappingURL=execution-api-worker.d.mts.map
package/dist/engine.cjs CHANGED
@@ -251,10 +251,11 @@ async function createContext(options) {
251
251
  async function createEngine(options, apiPath = "@powerlines/engine/api") {
252
252
  node_events.EventEmitter.setMaxListeners(Infinity);
253
253
  const context = await createContext(options);
254
- return new PowerlinesEngine(context, await require_execution_api_worker.ExecutionApiWorker.from(apiPath, {
254
+ const host = await require_execution_api_worker.ExecutionApiWorker.from(apiPath, {
255
255
  root: options.root,
256
256
  context
257
- }));
257
+ });
258
+ return new PowerlinesEngine(context, host);
258
259
  }
259
260
 
260
261
  //#endregion
package/dist/engine.mjs CHANGED
@@ -248,10 +248,11 @@ async function createContext(options) {
248
248
  async function createEngine(options, apiPath = "@powerlines/engine/api") {
249
249
  EventEmitter.setMaxListeners(Infinity);
250
250
  const context = await createContext(options);
251
- return new PowerlinesEngine(context, await ExecutionApiWorker.from(apiPath, {
251
+ const host = await ExecutionApiWorker.from(apiPath, {
252
252
  root: options.root,
253
253
  context
254
- }));
254
+ });
255
+ return new PowerlinesEngine(context, host);
255
256
  }
256
257
 
257
258
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"engine.mjs","names":["#context","#api"],"sources":["../src/engine.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 {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport type { PartialKeys } from \"@stryke/types/base\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { ExecutionApiWorker } from \"./_internal/execution-api-worker\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { Engine } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine implements Engine, AsyncDisposable {\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #api: ExecutionApiWorker;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get api(): ExecutionApiWorker {\n return this.#api;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param api - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(context: EngineContext, api: ExecutionApiWorker) {\n this.#context = context;\n this.#api = api;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(\n inlineConfig: PartialKeys<CreateInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"๐Ÿ†• Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"โœ” Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: PartialKeys<TypesInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"๐Ÿ—๏ธ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"โœ” Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(\n inlineConfig: PartialKeys<PrepareInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"๐Ÿ—๏ธ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"โœ” Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: PartialKeys<CleanInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"๐Ÿงน Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"โœ” Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: PartialKeys<LintInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"๐Ÿ“ Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"โœ” Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: PartialKeys<TestInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"๐Ÿงช Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"โœ” Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: PartialKeys<BuildInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"๐Ÿ“ฆ Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"โœ” Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: PartialKeys<DocsInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"๐Ÿ““ Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"โœ” Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(\n inlineConfig: PartialKeys<DeployInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"๐Ÿš€ Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"โœ” Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"๐Ÿ Finalization processes started\");\n\n await this.api.finalize();\n\n this.context.debug(\"โœ” Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(\n command: string,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ) {\n await Promise.all(\n (await this.context.loadExecutions(command, inlineConfig)).map(\n async execution => {\n try {\n await this.api.execute(command, execution.options, inlineConfig);\n } catch (error) {\n this.context.error(\n `Execution of method \"${command}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId!\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine(\n options: EngineOptions,\n apiPath = \"@powerlines/engine/api\"\n) {\n EventEmitter.setMaxListeners(Infinity);\n\n const context = await createContext(options);\n const host = await ExecutionApiWorker.from(apiPath, {\n root: options.root,\n context\n });\n\n return new PowerlinesEngine(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAAiE;;;;CAI/D;;;;CAKA;;;;CAKA,IAAW,UAAyB;EAClC,OAAO,KAAKA;CACd;;;;CAKA,IAAW,MAA0B;EACnC,OAAO,KAAKC;CACd;;;;;;;;CASA,AAAO,YAAY,SAAwB,KAAyB;EAClE,KAAKD,WAAW;EAChB,KAAKC,OAAO;CACd;;;;;;;;;;CAWA,MAAa,OACX,cACA;EACA,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;EACzC,KAAK,QAAQ,KAAK,2BAA2B;EAE7C,MAAM,KAAK,QAAQ,UAAU,YAAY;EAEzC,KAAK,QAAQ,MAAM,yCAAyC;EAC5D,MAAM;CACR;;;;;;;;;CAUA,MAAa,MAAM,cAAyD;EAC1E,MAAM,QAAQ,KAAK,QAAQ,MAAM,OAAO;EACxC,KA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AQ,UAAU,QAAQ,QAAQ,YAAY,GAAG;EACjD,QAAQ,MAAM,QAAQ;GACpB,IAAI,IAAI,MAAM,mBAAmB,KAAK,KAAK;IAAE,KAAK;IAAM,QAAQ;GAAK,CAAC,CAAC,CAAC;EAC1E;CACF,CAAC;CAED,OAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;CACb,CAAC;AACH;AAEA,eAAsB,aACpB,SACA,UAAU,0BACV;CACA,aAAa,gBAAgB,QAAQ;CAErC,MAAM,UAAU,MAAM,cAAc,OAAO;CAM3C,OAAO,IAAI,iBAAiB,SAAS,MALlB,mBAAmB,KAAK,SAAS;EAClD,MAAM,QAAQ;EACd;CACF,CAAC,CAEwC;AAC3C"}
1
+ {"version":3,"file":"engine.mjs","names":["#context","#api"],"sources":["../src/engine.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 {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport type { PartialKeys } from \"@stryke/types/base\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { ExecutionApiWorker } from \"./_internal/execution-api-worker\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { Engine } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine implements Engine, AsyncDisposable {\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #api: ExecutionApiWorker;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get api(): ExecutionApiWorker {\n return this.#api;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param api - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(context: EngineContext, api: ExecutionApiWorker) {\n this.#context = context;\n this.#api = api;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(\n inlineConfig: PartialKeys<CreateInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"๐Ÿ†• Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"โœ” Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: PartialKeys<TypesInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"๐Ÿ—๏ธ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"โœ” Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(\n inlineConfig: PartialKeys<PrepareInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"๐Ÿ—๏ธ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"โœ” Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: PartialKeys<CleanInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"๐Ÿงน Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"โœ” Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: PartialKeys<LintInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"๐Ÿ“ Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"โœ” Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: PartialKeys<TestInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"๐Ÿงช Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"โœ” Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: PartialKeys<BuildInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"๐Ÿ“ฆ Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"โœ” Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: PartialKeys<DocsInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"๐Ÿ““ Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"โœ” Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(\n inlineConfig: PartialKeys<DeployInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"๐Ÿš€ Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"โœ” Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"๐Ÿ Finalization processes started\");\n\n await this.api.finalize();\n\n this.context.debug(\"โœ” Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(\n command: string,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ) {\n await Promise.all(\n (await this.context.loadExecutions(command, inlineConfig)).map(\n async execution => {\n try {\n await this.api.execute(command, execution.options, inlineConfig);\n } catch (error) {\n this.context.error(\n `Execution of method \"${command}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId!\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine(\n options: EngineOptions,\n apiPath = \"@powerlines/engine/api\"\n) {\n EventEmitter.setMaxListeners(Infinity);\n\n const context = await createContext(options);\n const host = await ExecutionApiWorker.from(apiPath, {\n root: options.root,\n context\n });\n\n return new PowerlinesEngine(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAAiE;;;;CAI/D;;;;CAKA;;;;CAKA,IAAW,UAAyB;EAClC,OAAO,KAAKA;CACd;;;;CAKA,IAAW,MAA0B;EACnC,OAAO,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YAAY,SACnD,iBAAiB,QACb,MAAM,SAAS,MAAM,UACrB,OAAO,KAAK,GAEpB;IAEA,MAAM;GACR,UAAU;IACR,KAAK,QAAQ,kBACX,UAAU,cACV,UAAU,QAAQ,WACpB;GACF;EACF,CACF,CACF;CACF;AACF;AAEA,eAAsB,cAAc,SAAwB;CAC1D,MAAM,OACJ,QAAQ,QACP,MAAM,QAAQ;EACb,MAAM,QAAQ,QAAQ;EACtB,QAAQ;CACV,CAAC;CAEH,MAAM,MAAM,UAAU;CACtB,MAAM,OAAO,qBAAqB;EAChC,SAAS,QAAQ,WAAW,QAAQ;EACpC,QAAQ,UAAU,QAAQ,QAAQ,YAAY,GAAG;EACjD,QAAQ,MAAM,QAAQ;GACpB,IAAI,IAAI,MAAM,mBAAmB,KAAK,KAAK;IAAE,KAAK;IAAM,QAAQ;GAAK,CAAC,CAAC,CAAC;EAC1E;CACF,CAAC;CAED,OAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;CACb,CAAC;AACH;AAEA,eAAsB,aACpB,SACA,UAAU,0BACV;CACA,aAAa,gBAAgB,QAAQ;CAErC,MAAM,UAAU,MAAM,cAAc,OAAO;CAC3C,MAAM,OAAO,MAAM,mBAAmB,KAAK,SAAS;EAClD,MAAM,QAAQ;EACd;CACF,CAAC;CAED,OAAO,IAAI,iBAAiB,SAAS,IAAI;AAC3C"}
@@ -1,4 +1,5 @@
1
1
  import { ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions } from "./rpc.cjs";
2
2
  import { ApiExecutionOptions, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, RpcClientOptions } from "./config.cjs";
3
3
  import { EngineContext, EngineExecutionItem, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState } from "./context.cjs";
4
- import { Engine, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionInterface } from "./api.cjs";
4
+ import { Engine, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionInterface } from "./api.cjs";
5
+ export { ApiExecutionOptions, Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions };
@@ -1,4 +1,5 @@
1
1
  import { ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions } from "./rpc.mjs";
2
2
  import { ApiExecutionOptions, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, RpcClientOptions } from "./config.mjs";
3
3
  import { EngineContext, EngineExecutionItem, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState } from "./context.mjs";
4
- import { Engine, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionInterface } from "./api.mjs";
4
+ import { Engine, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionInterface } from "./api.mjs";
5
+ export { ApiExecutionOptions, Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionApi, ExecutionApiParams, ExecutionApiWorkerInterface, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.49.62",
3
+ "version": "0.49.64",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -120,21 +120,21 @@
120
120
  "types": "./dist/index.d.cts",
121
121
  "files": ["dist"],
122
122
  "dependencies": {
123
- "@powerlines/core": "^0.48.60",
124
- "@storm-software/config": "^1.138.6",
125
- "@storm-software/config-tools": "^1.190.69",
126
- "@stryke/async": "^0.1.13",
127
- "@stryke/convert": "^0.7.16",
128
- "@stryke/env": "^0.20.103",
129
- "@stryke/fs": "^0.33.86",
130
- "@stryke/hash": "^0.13.39",
131
- "@stryke/helpers": "^0.10.25",
132
- "@stryke/json": "^0.15.9",
133
- "@stryke/path": "^0.29.12",
134
- "@stryke/string-format": "^0.17.27",
135
- "@stryke/type-checks": "^0.6.18",
136
- "@stryke/unique-id": "^0.3.97",
137
- "@stryke/url": "^0.4.36",
123
+ "@powerlines/core": "^0.48.62",
124
+ "@storm-software/config": "^1.138.26",
125
+ "@storm-software/config-tools": "^1.190.89",
126
+ "@stryke/async": "^0.1.23",
127
+ "@stryke/convert": "^0.7.26",
128
+ "@stryke/env": "^0.20.113",
129
+ "@stryke/fs": "^0.33.96",
130
+ "@stryke/hash": "^0.13.49",
131
+ "@stryke/helpers": "^0.10.35",
132
+ "@stryke/json": "^0.15.19",
133
+ "@stryke/path": "^0.29.22",
134
+ "@stryke/string-format": "^0.17.37",
135
+ "@stryke/type-checks": "^0.6.28",
136
+ "@stryke/unique-id": "^0.3.107",
137
+ "@stryke/url": "^0.4.46",
138
138
  "birpc": "^4.0.0",
139
139
  "defu": "^6.1.7",
140
140
  "devframe": "^0.1.22",
@@ -148,13 +148,13 @@
148
148
  "tinypool": "^2.1.0",
149
149
  "ua-parser-modern": "^0.1.1",
150
150
  "unimport": "^5.7.0",
151
- "unplugin": "^3.0.0"
151
+ "unplugin": "^3.3.0"
152
152
  },
153
153
  "devDependencies": {
154
- "@storm-software/testing-tools": "^1.119.222",
155
- "@stryke/types": "^0.12.13",
156
- "@types/node": "^25.9.3",
154
+ "@storm-software/testing-tools": "^1.119.242",
155
+ "@stryke/types": "^0.12.23",
156
+ "@types/node": "^25.9.4",
157
157
  "typescript": "^6.0.3"
158
158
  },
159
- "gitHead": "2378e0896bcd3f99c735faa3be578440c7ce0d2a"
159
+ "gitHead": "c2c932341c73ce708ac8e69c0d6c692ea41b4675"
160
160
  }