@powerlines/engine 0.0.25 → 0.9.2

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 (191) hide show
  1. package/dist/api/build.cjs +66 -0
  2. package/dist/api/build.d.cts +14 -0
  3. package/dist/api/build.d.cts.map +1 -0
  4. package/dist/api/build.d.mts +14 -0
  5. package/dist/api/build.d.mts.map +1 -0
  6. package/dist/api/build.mjs +64 -0
  7. package/dist/api/build.mjs.map +1 -0
  8. package/dist/api/clean.cjs +29 -0
  9. package/dist/api/clean.d.cts +14 -0
  10. package/dist/api/clean.d.cts.map +1 -0
  11. package/dist/api/clean.d.mts +14 -0
  12. package/dist/api/clean.d.mts.map +1 -0
  13. package/dist/api/clean.mjs +28 -0
  14. package/dist/api/clean.mjs.map +1 -0
  15. package/dist/api/create.cjs +59 -0
  16. package/dist/api/create.d.cts +14 -0
  17. package/dist/api/create.d.cts.map +1 -0
  18. package/dist/api/create.d.mts +14 -0
  19. package/dist/api/create.d.mts.map +1 -0
  20. package/dist/api/create.mjs +57 -0
  21. package/dist/api/create.mjs.map +1 -0
  22. package/dist/api/deploy.cjs +25 -0
  23. package/dist/api/deploy.d.cts +17 -0
  24. package/dist/api/deploy.d.cts.map +1 -0
  25. package/dist/api/deploy.d.mts +17 -0
  26. package/dist/api/deploy.d.mts.map +1 -0
  27. package/dist/api/deploy.mjs +24 -0
  28. package/dist/api/deploy.mjs.map +1 -0
  29. package/dist/api/docs.cjs +25 -0
  30. package/dist/api/docs.d.cts +17 -0
  31. package/dist/api/docs.d.cts.map +1 -0
  32. package/dist/api/docs.d.mts +17 -0
  33. package/dist/api/docs.d.mts.map +1 -0
  34. package/dist/api/docs.mjs +24 -0
  35. package/dist/api/docs.mjs.map +1 -0
  36. package/dist/api/lint.cjs +28 -0
  37. package/dist/api/lint.d.cts +17 -0
  38. package/dist/api/lint.d.cts.map +1 -0
  39. package/dist/api/lint.d.mts +17 -0
  40. package/dist/api/lint.d.mts.map +1 -0
  41. package/dist/api/lint.mjs +27 -0
  42. package/dist/api/lint.mjs.map +1 -0
  43. package/dist/api/prepare.cjs +69 -0
  44. package/dist/api/prepare.d.cts +14 -0
  45. package/dist/api/prepare.d.cts.map +1 -0
  46. package/dist/api/prepare.d.mts +14 -0
  47. package/dist/api/prepare.d.mts.map +1 -0
  48. package/dist/api/prepare.mjs +68 -0
  49. package/dist/api/prepare.mjs.map +1 -0
  50. package/dist/api/test.cjs +28 -0
  51. package/dist/api/test.d.cts +17 -0
  52. package/dist/api/test.d.cts.map +1 -0
  53. package/dist/api/test.d.mts +17 -0
  54. package/dist/api/test.d.mts.map +1 -0
  55. package/dist/api/test.mjs +27 -0
  56. package/dist/api/test.mjs.map +1 -0
  57. package/dist/api/types.cjs +71 -0
  58. package/dist/api/types.d.cts +17 -0
  59. package/dist/api/types.d.cts.map +1 -0
  60. package/dist/api/types.d.mts +17 -0
  61. package/dist/api/types.d.mts.map +1 -0
  62. package/dist/api/types.mjs +70 -0
  63. package/dist/api/types.mjs.map +1 -0
  64. package/dist/api-Bi_h4LMX.d.cts +135 -0
  65. package/dist/api-Bi_h4LMX.d.cts.map +1 -0
  66. package/dist/api-oIs2Wp3t.d.mts +135 -0
  67. package/dist/api-oIs2Wp3t.d.mts.map +1 -0
  68. package/dist/config-B_E_HMcT.d.cts +200 -0
  69. package/dist/config-B_E_HMcT.d.cts.map +1 -0
  70. package/dist/config-FB8Zqjjz.d.mts +200 -0
  71. package/dist/config-FB8Zqjjz.d.mts.map +1 -0
  72. package/dist/context/index.cjs +2 -9
  73. package/dist/context/index.d.cts +2 -660
  74. package/dist/context/index.d.mts +2 -660
  75. package/dist/context/index.mjs +2 -4
  76. package/dist/context-DrNQXXRC.d.mts +149 -0
  77. package/dist/context-DrNQXXRC.d.mts.map +1 -0
  78. package/dist/context-LQBeYY23.d.cts +149 -0
  79. package/dist/context-LQBeYY23.d.cts.map +1 -0
  80. package/dist/engine-context-BBSMtv0b.d.mts +54 -0
  81. package/dist/engine-context-BBSMtv0b.d.mts.map +1 -0
  82. package/dist/engine-context-C6bNxumd.d.cts +54 -0
  83. package/dist/engine-context-C6bNxumd.d.cts.map +1 -0
  84. package/dist/engine-context-SEzTm1aq.cjs +179 -0
  85. package/dist/engine-context-f72fUF0N.mjs +173 -0
  86. package/dist/engine-context-f72fUF0N.mjs.map +1 -0
  87. package/dist/engine.cjs +267 -0
  88. package/dist/engine.d.cts +143 -0
  89. package/dist/engine.d.cts.map +1 -0
  90. package/dist/engine.d.mts +143 -0
  91. package/dist/engine.d.mts.map +1 -0
  92. package/dist/engine.mjs +263 -0
  93. package/dist/engine.mjs.map +1 -0
  94. package/dist/helpers/create-execution-host.cjs +48 -0
  95. package/dist/helpers/create-execution-host.d.cts +18 -0
  96. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  97. package/dist/helpers/create-execution-host.d.mts +18 -0
  98. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  99. package/dist/helpers/create-execution-host.mjs +47 -0
  100. package/dist/helpers/create-execution-host.mjs.map +1 -0
  101. package/dist/helpers/execution-host-worker.cjs +307 -0
  102. package/dist/helpers/execution-host-worker.d.cts +64 -0
  103. package/dist/helpers/execution-host-worker.d.cts.map +1 -0
  104. package/dist/helpers/execution-host-worker.d.mts +64 -0
  105. package/dist/helpers/execution-host-worker.d.mts.map +1 -0
  106. package/dist/helpers/execution-host-worker.mjs +306 -0
  107. package/dist/helpers/execution-host-worker.mjs.map +1 -0
  108. package/dist/helpers/finalize.cjs +27 -0
  109. package/dist/helpers/finalize.d.cts +12 -0
  110. package/dist/helpers/finalize.d.cts.map +1 -0
  111. package/dist/helpers/finalize.d.mts +12 -0
  112. package/dist/helpers/finalize.d.mts.map +1 -0
  113. package/dist/helpers/finalize.mjs +26 -0
  114. package/dist/helpers/finalize.mjs.map +1 -0
  115. package/dist/helpers/rpc.cjs +140 -0
  116. package/dist/helpers/rpc.d.cts +7 -0
  117. package/dist/helpers/rpc.d.cts.map +1 -0
  118. package/dist/helpers/rpc.d.mts +7 -0
  119. package/dist/helpers/rpc.d.mts.map +1 -0
  120. package/dist/helpers/rpc.mjs +139 -0
  121. package/dist/helpers/rpc.mjs.map +1 -0
  122. package/dist/index.cjs +4 -567
  123. package/dist/index.d.cts +5 -126
  124. package/dist/index.d.mts +5 -126
  125. package/dist/index.mjs +2 -567
  126. package/dist/worker/execution-host.cjs +577 -0
  127. package/dist/worker/execution-host.d.cts +76 -0
  128. package/dist/worker/execution-host.d.cts.map +1 -0
  129. package/dist/worker/execution-host.d.mts +76 -0
  130. package/dist/worker/execution-host.d.mts.map +1 -0
  131. package/dist/worker/execution-host.mjs +540 -0
  132. package/dist/worker/execution-host.mjs.map +1 -0
  133. package/package.json +88 -124
  134. package/dist/_internal/worker.cjs +0 -4844
  135. package/dist/_internal/worker.d.cts +0 -38
  136. package/dist/_internal/worker.d.cts.map +0 -1
  137. package/dist/_internal/worker.d.mts +0 -38
  138. package/dist/_internal/worker.d.mts.map +0 -1
  139. package/dist/_internal/worker.mjs +0 -4805
  140. package/dist/_internal/worker.mjs.map +0 -1
  141. package/dist/api.cjs +0 -1274
  142. package/dist/api.d.cts +0 -265
  143. package/dist/api.d.cts.map +0 -1
  144. package/dist/api.d.mts +0 -265
  145. package/dist/api.d.mts.map +0 -1
  146. package/dist/api.mjs +0 -1270
  147. package/dist/api.mjs.map +0 -1
  148. package/dist/base-context-BUnL_9z8.mjs +0 -241
  149. package/dist/base-context-BUnL_9z8.mjs.map +0 -1
  150. package/dist/base-context-CFvO2N9I.cjs +0 -248
  151. package/dist/context/index.d.cts.map +0 -1
  152. package/dist/context/index.d.mts.map +0 -1
  153. package/dist/engine-context-BuD9AGfd.mjs +0 -41
  154. package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
  155. package/dist/engine-context-NO6enYev.cjs +0 -45
  156. package/dist/execution-context-Cq9cjr28.mjs +0 -2571
  157. package/dist/execution-context-Cq9cjr28.mjs.map +0 -1
  158. package/dist/execution-context-CyDSAifN.cjs +0 -2615
  159. package/dist/fs-D1nIP45P.mjs +0 -226
  160. package/dist/fs-D1nIP45P.mjs.map +0 -1
  161. package/dist/fs-XogSgMqT.cjs +0 -262
  162. package/dist/index.d.cts.map +0 -1
  163. package/dist/index.d.mts.map +0 -1
  164. package/dist/index.mjs.map +0 -1
  165. package/dist/schemas.cjs +0 -9
  166. package/dist/schemas.d.cts +0 -127
  167. package/dist/schemas.d.cts.map +0 -1
  168. package/dist/schemas.d.mts +0 -127
  169. package/dist/schemas.d.mts.map +0 -1
  170. package/dist/schemas.mjs +0 -3
  171. package/dist/storage/index.cjs +0 -9
  172. package/dist/storage/index.d.cts +0 -419
  173. package/dist/storage/index.d.cts.map +0 -1
  174. package/dist/storage/index.d.mts +0 -419
  175. package/dist/storage/index.d.mts.map +0 -1
  176. package/dist/storage/index.mjs +0 -3
  177. package/dist/ts-morph-BaLPVAdB.cjs +0 -114
  178. package/dist/ts-morph-D0CaA37w.mjs +0 -102
  179. package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
  180. package/dist/tsconfig-Cstsoprg.mjs +0 -155
  181. package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
  182. package/dist/tsconfig-DeyWQC2N.cjs +0 -198
  183. package/dist/typescript/index.cjs +0 -13
  184. package/dist/typescript/index.d.cts +0 -106
  185. package/dist/typescript/index.d.cts.map +0 -1
  186. package/dist/typescript/index.d.mts +0 -106
  187. package/dist/typescript/index.d.mts.map +0 -1
  188. package/dist/typescript/index.mjs +0 -4
  189. package/dist/virtual-BNdKVkRw.cjs +0 -548
  190. package/dist/virtual-gIlTc3Lj.mjs +0 -513
  191. package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
@@ -0,0 +1,149 @@
1
+ import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-FB8Zqjjz.mjs";
2
+ import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
3
+ import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
4
+
5
+ //#region src/types/context.d.ts
6
+ /**
7
+ * The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
8
+ */
9
+ type ExecutionScopeType = "command" | "hook" | "plugin";
10
+ /**
11
+ * The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
12
+ */
13
+ interface ExecutionScopeState {
14
+ /**
15
+ * The timestamp when the command, hook, or plugin execution started
16
+ */
17
+ timestamp: number;
18
+ /**
19
+ * The name of the command, hook, or plugin being executed
20
+ */
21
+ name: string;
22
+ /**
23
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
24
+ */
25
+ type: ExecutionScopeType;
26
+ }
27
+ /**
28
+ * The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
29
+ */
30
+ interface ExecutionCommandScopeState extends ExecutionScopeState {
31
+ /**
32
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
33
+ */
34
+ type: "command";
35
+ }
36
+ /**
37
+ * The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
38
+ */
39
+ interface ExecutionHookScopeState extends ExecutionScopeState {
40
+ /**
41
+ * The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
42
+ */
43
+ order?: "pre" | "post";
44
+ /**
45
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
46
+ */
47
+ type: "hook";
48
+ }
49
+ /**
50
+ * The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
51
+ */
52
+ interface ExecutionPluginScopeState extends ExecutionScopeState {
53
+ /**
54
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
55
+ */
56
+ type: "plugin";
57
+ }
58
+ /**
59
+ * The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
60
+ */
61
+ interface ExecutionState {
62
+ /**
63
+ * The currently active command execution for this execution context
64
+ */
65
+ command: ExecutionCommandScopeState | null;
66
+ /**
67
+ * The currently active hook execution for this execution context, if any
68
+ */
69
+ hook: ExecutionHookScopeState | null;
70
+ /**
71
+ * The currently active plugin execution for this execution context, if any
72
+ */
73
+ plugin: ExecutionPluginScopeState | null;
74
+ }
75
+ /**
76
+ * The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
77
+ */
78
+ interface EngineExecutionItem {
79
+ /**
80
+ * A unique identifier for the current invocation (a single invocation can include multiple executions).
81
+ */
82
+ invocationId: string;
83
+ /**
84
+ * The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
85
+ */
86
+ method: string;
87
+ /**
88
+ * The options provided to the Powerlines process for this execution
89
+ */
90
+ options: EngineExecutionOptions;
91
+ /**
92
+ * The parsed user configuration file provided to the Powerlines process before any resolution or merging
93
+ */
94
+ configFile: ParsedUserConfig;
95
+ /**
96
+ * An object representing the currently active command, hook, and plugin executions for this execution context
97
+ */
98
+ state: ExecutionState;
99
+ }
100
+ /**
101
+ * The Powerlines engine context.
102
+ *
103
+ * @remarks
104
+ * This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
105
+ */
106
+ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
107
+ /**
108
+ * The options provided to the Powerlines process
109
+ */
110
+ options: EngineOptions;
111
+ /**
112
+ * The metadata information for the RPC connection
113
+ */
114
+ connection: ConnectionMeta;
115
+ /**
116
+ * The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
117
+ *
118
+ * @see https://devtools.vite.dev/devframe/guide/
119
+ * @see https://github.com/vitejs/devtools/blob/main/devframe
120
+ */
121
+ devtools: DevToolsNodeContext;
122
+ /**
123
+ * A list of all command executions that will be run during the lifecycle of the engine
124
+ */
125
+ executions: EngineExecutionItem[];
126
+ /**
127
+ * Initialize the context with the provided configuration options
128
+ *
129
+ * @remarks
130
+ * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
131
+ */
132
+ loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
133
+ /**
134
+ * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
135
+ *
136
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
137
+ * @param executionId - The unique identifier for the specific execution to be completed.
138
+ */
139
+ completeExecution: (invocationId: string, executionId: string) => void;
140
+ }
141
+ interface EngineSystemContext {
142
+ /**
143
+ * The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
144
+ */
145
+ rpc: RpcClient;
146
+ }
147
+ //#endregion
148
+ export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
149
+ //# sourceMappingURL=context-DrNQXXRC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-DrNQXXRC.d.mts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAA;AAAA"}
@@ -0,0 +1,149 @@
1
+ import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-B_E_HMcT.cjs";
2
+ import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
3
+ import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
4
+
5
+ //#region src/types/context.d.ts
6
+ /**
7
+ * The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
8
+ */
9
+ type ExecutionScopeType = "command" | "hook" | "plugin";
10
+ /**
11
+ * The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
12
+ */
13
+ interface ExecutionScopeState {
14
+ /**
15
+ * The timestamp when the command, hook, or plugin execution started
16
+ */
17
+ timestamp: number;
18
+ /**
19
+ * The name of the command, hook, or plugin being executed
20
+ */
21
+ name: string;
22
+ /**
23
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
24
+ */
25
+ type: ExecutionScopeType;
26
+ }
27
+ /**
28
+ * The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
29
+ */
30
+ interface ExecutionCommandScopeState extends ExecutionScopeState {
31
+ /**
32
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
33
+ */
34
+ type: "command";
35
+ }
36
+ /**
37
+ * The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
38
+ */
39
+ interface ExecutionHookScopeState extends ExecutionScopeState {
40
+ /**
41
+ * The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
42
+ */
43
+ order?: "pre" | "post";
44
+ /**
45
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
46
+ */
47
+ type: "hook";
48
+ }
49
+ /**
50
+ * The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
51
+ */
52
+ interface ExecutionPluginScopeState extends ExecutionScopeState {
53
+ /**
54
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
55
+ */
56
+ type: "plugin";
57
+ }
58
+ /**
59
+ * The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
60
+ */
61
+ interface ExecutionState {
62
+ /**
63
+ * The currently active command execution for this execution context
64
+ */
65
+ command: ExecutionCommandScopeState | null;
66
+ /**
67
+ * The currently active hook execution for this execution context, if any
68
+ */
69
+ hook: ExecutionHookScopeState | null;
70
+ /**
71
+ * The currently active plugin execution for this execution context, if any
72
+ */
73
+ plugin: ExecutionPluginScopeState | null;
74
+ }
75
+ /**
76
+ * The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
77
+ */
78
+ interface EngineExecutionItem {
79
+ /**
80
+ * A unique identifier for the current invocation (a single invocation can include multiple executions).
81
+ */
82
+ invocationId: string;
83
+ /**
84
+ * The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
85
+ */
86
+ method: string;
87
+ /**
88
+ * The options provided to the Powerlines process for this execution
89
+ */
90
+ options: EngineExecutionOptions;
91
+ /**
92
+ * The parsed user configuration file provided to the Powerlines process before any resolution or merging
93
+ */
94
+ configFile: ParsedUserConfig;
95
+ /**
96
+ * An object representing the currently active command, hook, and plugin executions for this execution context
97
+ */
98
+ state: ExecutionState;
99
+ }
100
+ /**
101
+ * The Powerlines engine context.
102
+ *
103
+ * @remarks
104
+ * This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
105
+ */
106
+ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
107
+ /**
108
+ * The options provided to the Powerlines process
109
+ */
110
+ options: EngineOptions;
111
+ /**
112
+ * The metadata information for the RPC connection
113
+ */
114
+ connection: ConnectionMeta;
115
+ /**
116
+ * The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
117
+ *
118
+ * @see https://devtools.vite.dev/devframe/guide/
119
+ * @see https://github.com/vitejs/devtools/blob/main/devframe
120
+ */
121
+ devtools: DevToolsNodeContext;
122
+ /**
123
+ * A list of all command executions that will be run during the lifecycle of the engine
124
+ */
125
+ executions: EngineExecutionItem[];
126
+ /**
127
+ * Initialize the context with the provided configuration options
128
+ *
129
+ * @remarks
130
+ * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
131
+ */
132
+ loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
133
+ /**
134
+ * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
135
+ *
136
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
137
+ * @param executionId - The unique identifier for the specific execution to be completed.
138
+ */
139
+ completeExecution: (invocationId: string, executionId: string) => void;
140
+ }
141
+ interface EngineSystemContext {
142
+ /**
143
+ * The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
144
+ */
145
+ rpc: RpcClient;
146
+ }
147
+ //#endregion
148
+ export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
149
+ //# sourceMappingURL=context-LQBeYY23.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-LQBeYY23.d.cts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAA;AAAA"}
@@ -0,0 +1,54 @@
1
+ import { n as EngineOptions } from "./config-FB8Zqjjz.mjs";
2
+ import { n as EngineExecutionItem, t as EngineContext } from "./context-DrNQXXRC.mjs";
3
+ import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
4
+ import { EnvPaths } from "@stryke/env/get-env-paths";
5
+ import * as _$_powerlines_core0 from "@powerlines/core";
6
+ import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
7
+ import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
8
+
9
+ //#region src/context/engine-context.d.ts
10
+ declare class PowerlinesEngineContext<TSystemContext = unknown> extends PowerlinesBaseContext<TSystemContext> implements EngineContext<TSystemContext> {
11
+ #private;
12
+ options: EngineOptions;
13
+ connection: ConnectionMeta;
14
+ /**
15
+ * Creates a new instance of the PowerlinesEngineContext class.
16
+ *
17
+ * @param options - The options to initialize the context with.
18
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
19
+ */
20
+ static from<TSystemContext = unknown>(options: EngineOptions, host: DevToolsHost, connection: ConnectionMeta): Promise<PowerlinesEngineContext<TSystemContext>>;
21
+ createLogger(options?: LoggerOptions, logFn?: LogFn): _$_powerlines_core0.Logger;
22
+ get executions(): EngineExecutionItem[];
23
+ get devtools(): DevToolsNodeContext;
24
+ get envPaths(): EnvPaths;
25
+ get framework(): FrameworkOptions;
26
+ get orgId(): string;
27
+ /**
28
+ * Creates a new Context instance.
29
+ *
30
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
31
+ * @param connection - The connection metadata for the dev server.
32
+ */
33
+ protected constructor(options: EngineOptions, connection: ConnectionMeta);
34
+ /**
35
+ * Initialize the context with the provided configuration options
36
+ *
37
+ * @remarks
38
+ * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
39
+ *
40
+ * @param method - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
41
+ * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
42
+ */
43
+ loadExecutions(method: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
44
+ /**
45
+ * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
46
+ *
47
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
48
+ * @param executionId - The unique identifier for the specific execution to be completed.
49
+ */
50
+ completeExecution(invocationId: string, executionId: string): void;
51
+ }
52
+ //#endregion
53
+ export { PowerlinesEngineContext as t };
54
+ //# sourceMappingURL=engine-context-BBSMtv0b.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-context-BBSMtv0b.d.mts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -0,0 +1,54 @@
1
+ import { n as EngineOptions } from "./config-B_E_HMcT.cjs";
2
+ import { n as EngineExecutionItem, t as EngineContext } from "./context-LQBeYY23.cjs";
3
+ import * as _$_powerlines_core0 from "@powerlines/core";
4
+ import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
5
+ import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
6
+ import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
7
+ import { EnvPaths } from "@stryke/env/get-env-paths";
8
+
9
+ //#region src/context/engine-context.d.ts
10
+ declare class PowerlinesEngineContext<TSystemContext = unknown> extends PowerlinesBaseContext<TSystemContext> implements EngineContext<TSystemContext> {
11
+ #private;
12
+ options: EngineOptions;
13
+ connection: ConnectionMeta;
14
+ /**
15
+ * Creates a new instance of the PowerlinesEngineContext class.
16
+ *
17
+ * @param options - The options to initialize the context with.
18
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
19
+ */
20
+ static from<TSystemContext = unknown>(options: EngineOptions, host: DevToolsHost, connection: ConnectionMeta): Promise<PowerlinesEngineContext<TSystemContext>>;
21
+ createLogger(options?: LoggerOptions, logFn?: LogFn): _$_powerlines_core0.Logger;
22
+ get executions(): EngineExecutionItem[];
23
+ get devtools(): DevToolsNodeContext;
24
+ get envPaths(): EnvPaths;
25
+ get framework(): FrameworkOptions;
26
+ get orgId(): string;
27
+ /**
28
+ * Creates a new Context instance.
29
+ *
30
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
31
+ * @param connection - The connection metadata for the dev server.
32
+ */
33
+ protected constructor(options: EngineOptions, connection: ConnectionMeta);
34
+ /**
35
+ * Initialize the context with the provided configuration options
36
+ *
37
+ * @remarks
38
+ * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
39
+ *
40
+ * @param method - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
41
+ * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
42
+ */
43
+ loadExecutions(method: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
44
+ /**
45
+ * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
46
+ *
47
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
48
+ * @param executionId - The unique identifier for the specific execution to be completed.
49
+ */
50
+ completeExecution(invocationId: string, executionId: string): void;
51
+ }
52
+ //#endregion
53
+ export { PowerlinesEngineContext as t };
54
+ //# sourceMappingURL=engine-context-C6bNxumd.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-context-C6bNxumd.d.cts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -0,0 +1,179 @@
1
+ const require_chunk = require('./chunk-C0xms8kb.cjs');
2
+ let devframe_node = require("devframe/node");
3
+ let _powerlines_core_context_base_context = require("@powerlines/core/context/base-context");
4
+ let _powerlines_core_lib_config = require("@powerlines/core/lib/config");
5
+ let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
6
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
7
+ let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
8
+ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
9
+ let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
10
+ let valibot = require("valibot");
11
+ valibot = require_chunk.__toESM(valibot, 1);
12
+
13
+ //#region src/context/engine-context.ts
14
+ var PowerlinesEngineContext = class PowerlinesEngineContext extends _powerlines_core_context_base_context.PowerlinesBaseContext {
15
+ #executions = [];
16
+ #devtools;
17
+ #logLevel;
18
+ /**
19
+ * Creates a new instance of the PowerlinesEngineContext class.
20
+ *
21
+ * @param options - The options to initialize the context with.
22
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
23
+ */
24
+ static async from(options, host, connection) {
25
+ const context = new PowerlinesEngineContext(options, connection);
26
+ context.#devtools = await (0, devframe_node.createHostContext)({
27
+ cwd: context.cwd,
28
+ mode: "dev",
29
+ host
30
+ });
31
+ await options.setup?.(context.#devtools);
32
+ context.#devtools.rpc.register({
33
+ name: "powerlines:log",
34
+ type: "event",
35
+ args: [valibot.object({
36
+ meta: valibot.object({
37
+ category: valibot.string(),
38
+ name: valibot.string(),
39
+ command: valibot.string(),
40
+ hook: valibot.string(),
41
+ plugin: valibot.string(),
42
+ source: valibot.string()
43
+ }),
44
+ message: valibot.string()
45
+ })],
46
+ setup: (_) => ({ handler: (payload) => {
47
+ switch (payload.meta.type) {
48
+ case "error":
49
+ context.error(payload);
50
+ break;
51
+ case "warn":
52
+ context.warn(payload);
53
+ break;
54
+ case "info":
55
+ context.info(payload);
56
+ break;
57
+ case "debug":
58
+ context.debug(payload);
59
+ break;
60
+ case "trace":
61
+ context.trace(payload);
62
+ break;
63
+ default:
64
+ context.info(payload);
65
+ break;
66
+ }
67
+ } })
68
+ });
69
+ context.#logLevel = options.logLevel ? (0, _powerlines_core_plugin_utils.resolveLogLevel)(options.logLevel) : await (0, _powerlines_core_lib_config.getDefaultLogLevel)(context.cwd);
70
+ return context;
71
+ }
72
+ createLogger(options = {}, logFn) {
73
+ let logger = (0, _powerlines_core_plugin_utils.createLogger)("engine", {
74
+ logLevel: this.#logLevel,
75
+ ...options
76
+ }, logFn);
77
+ if (this.options.customLogger) logger = (0, _powerlines_core_plugin_utils.withCustomLogger)(logger, this.options.customLogger);
78
+ return logger;
79
+ }
80
+ get executions() {
81
+ return this.#executions;
82
+ }
83
+ get devtools() {
84
+ return this.#devtools;
85
+ }
86
+ get envPaths() {
87
+ return (0, _stryke_env_get_env_paths.getEnvPaths)({
88
+ orgId: (0, _stryke_string_format_kebab_case.kebabCase)(this.orgId),
89
+ appId: (0, _stryke_string_format_kebab_case.kebabCase)(this.framework.name),
90
+ workspaceRoot: this.cwd
91
+ });
92
+ }
93
+ get framework() {
94
+ return {
95
+ name: "powerlines",
96
+ orgId: "storm-software",
97
+ ...this.options.framework
98
+ };
99
+ }
100
+ get orgId() {
101
+ return this.framework.orgId;
102
+ }
103
+ /**
104
+ * Creates a new Context instance.
105
+ *
106
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
107
+ * @param connection - The connection metadata for the dev server.
108
+ */
109
+ constructor(options, connection) {
110
+ super(options);
111
+ this.options = options;
112
+ this.connection = connection;
113
+ }
114
+ /**
115
+ * Initialize the context with the provided configuration options
116
+ *
117
+ * @remarks
118
+ * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
119
+ *
120
+ * @param method - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
121
+ * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
122
+ */
123
+ async loadExecutions(method, inlineConfig) {
124
+ const root = (0, _powerlines_core_lib_config.resolveRoot)(this.cwd, inlineConfig.root, inlineConfig.configFile);
125
+ const config = await (0, _powerlines_core_lib_config.loadParsedConfig)(this.cwd, root, this.framework?.name, this.orgId, inlineConfig);
126
+ if (!config) throw new Error("Failed to load configuration");
127
+ const invocationId = (0, _stryke_unique_id_uuid.uuid)();
128
+ const executions = await Promise.all((0, _stryke_convert_to_array.toArray)(config.config).map(async (_, configIndex) => {
129
+ const executionId = (0, _stryke_unique_id_uuid.uuid)();
130
+ const options = {
131
+ cwd: this.cwd,
132
+ root,
133
+ framework: this.framework,
134
+ orgId: this.orgId,
135
+ ...this.options,
136
+ command: method,
137
+ baseURL: this.#devtools.host.resolveOrigin(),
138
+ connection: this.connection,
139
+ configFile: config.configFile,
140
+ executionId,
141
+ configIndex
142
+ };
143
+ this.logger.debug({
144
+ meta: { category: "config" },
145
+ message: `Invoking ${method} with the following execution parameters: \n --- Options --- \n${(0, _powerlines_core_plugin_utils.formatConfig)(options)}\n --- Inline Config --- \n${(0, _powerlines_core_plugin_utils.formatConfig)(inlineConfig)}`
146
+ });
147
+ return {
148
+ invocationId,
149
+ method,
150
+ configFile: config,
151
+ options,
152
+ state: {
153
+ command: null,
154
+ hook: null,
155
+ plugin: null
156
+ }
157
+ };
158
+ }));
159
+ this.#executions = this.#executions.concat(executions);
160
+ return executions;
161
+ }
162
+ /**
163
+ * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
164
+ *
165
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
166
+ * @param executionId - The unique identifier for the specific execution to be completed.
167
+ */
168
+ completeExecution(invocationId, executionId) {
169
+ this.#executions = this.#executions.filter((execution) => execution.options.executionId !== executionId || execution.invocationId !== invocationId);
170
+ }
171
+ };
172
+
173
+ //#endregion
174
+ Object.defineProperty(exports, 'PowerlinesEngineContext', {
175
+ enumerable: true,
176
+ get: function () {
177
+ return PowerlinesEngineContext;
178
+ }
179
+ });