@powerlines/engine 0.47.4 → 0.49.1

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 (249) 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 +28 -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 +24 -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 +24 -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 +27 -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 +68 -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 +27 -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 +70 -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-BgyEi2hF.d.mts +138 -0
  65. package/dist/api-BgyEi2hF.d.mts.map +1 -0
  66. package/dist/api-DcHfCjQK.d.cts +138 -0
  67. package/dist/api-DcHfCjQK.d.cts.map +1 -0
  68. package/dist/api.cjs +39 -1268
  69. package/dist/api.d.cts +11 -300
  70. package/dist/api.d.cts.map +1 -1
  71. package/dist/api.d.mts +11 -300
  72. package/dist/api.d.mts.map +1 -1
  73. package/dist/api.mjs +31 -1264
  74. package/dist/api.mjs.map +1 -1
  75. package/dist/config-ByLyzMI0.d.mts +204 -0
  76. package/dist/config-ByLyzMI0.d.mts.map +1 -0
  77. package/dist/config-DKEmqMrh.d.cts +204 -0
  78. package/dist/config-DKEmqMrh.d.cts.map +1 -0
  79. package/dist/context/engine-context.cjs +177 -0
  80. package/dist/context/engine-context.d.cts +2 -0
  81. package/dist/context/engine-context.d.mts +2 -0
  82. package/dist/context/engine-context.mjs +175 -0
  83. package/dist/context/engine-context.mjs.map +1 -0
  84. package/dist/context/index.cjs +2 -9
  85. package/dist/context/index.d.cts +2 -150
  86. package/dist/context/index.d.mts +2 -150
  87. package/dist/context/index.mjs +2 -4
  88. package/dist/context-D0_a0kRO.d.cts +149 -0
  89. package/dist/context-D0_a0kRO.d.cts.map +1 -0
  90. package/dist/context-DcXV6_GL.d.mts +149 -0
  91. package/dist/context-DcXV6_GL.d.mts.map +1 -0
  92. package/dist/engine-Dz6BvkFY.cjs +590 -0
  93. package/dist/engine-context-B8K6Jtkk.d.cts +53 -0
  94. package/dist/engine-context-B8K6Jtkk.d.cts.map +1 -0
  95. package/dist/engine-context-DKlA5Pgu.d.mts +53 -0
  96. package/dist/engine-context-DKlA5Pgu.d.mts.map +1 -0
  97. package/dist/engine-q6YKXXcB.mjs +571 -0
  98. package/dist/engine-q6YKXXcB.mjs.map +1 -0
  99. package/dist/engine.cjs +6 -0
  100. package/dist/engine.d.cts +143 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +143 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +3 -0
  105. package/dist/helpers/create-execution-host.cjs +57 -0
  106. package/dist/helpers/create-execution-host.d.cts +20 -0
  107. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  108. package/dist/helpers/create-execution-host.d.mts +20 -0
  109. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  110. package/dist/helpers/create-execution-host.mjs +57 -0
  111. package/dist/helpers/create-execution-host.mjs.map +1 -0
  112. package/dist/helpers/finalize.cjs +26 -0
  113. package/dist/helpers/finalize.d.cts +12 -0
  114. package/dist/helpers/finalize.d.cts.map +1 -0
  115. package/dist/helpers/finalize.d.mts +12 -0
  116. package/dist/helpers/finalize.d.mts.map +1 -0
  117. package/dist/helpers/finalize.mjs +26 -0
  118. package/dist/helpers/finalize.mjs.map +1 -0
  119. package/dist/helpers/index.cjs +12 -0
  120. package/dist/helpers/index.d.cts +5 -0
  121. package/dist/helpers/index.d.mts +5 -0
  122. package/dist/helpers/index.mjs +6 -0
  123. package/dist/helpers/rpc.cjs +139 -0
  124. package/dist/helpers/rpc.d.cts +7 -0
  125. package/dist/helpers/rpc.d.cts.map +1 -0
  126. package/dist/helpers/rpc.d.mts +7 -0
  127. package/dist/helpers/rpc.d.mts.map +1 -0
  128. package/dist/helpers/rpc.mjs +139 -0
  129. package/dist/helpers/rpc.mjs.map +1 -0
  130. package/dist/helpers/stream.cjs +119 -0
  131. package/dist/helpers/stream.d.cts +45 -0
  132. package/dist/helpers/stream.d.cts.map +1 -0
  133. package/dist/helpers/stream.d.mts +45 -0
  134. package/dist/helpers/stream.d.mts.map +1 -0
  135. package/dist/helpers/stream.mjs +117 -0
  136. package/dist/helpers/stream.mjs.map +1 -0
  137. package/dist/index-BVVgDSdq.d.cts +1 -0
  138. package/dist/index-BVVgDSdq.d.mts +1 -0
  139. package/dist/index.cjs +8 -748
  140. package/dist/index.d.cts +6 -140
  141. package/dist/index.d.mts +6 -140
  142. package/dist/index.mjs +4 -747
  143. package/package.json +102 -132
  144. package/dist/_internal/worker.cjs +0 -5192
  145. package/dist/_internal/worker.d.cts +0 -46
  146. package/dist/_internal/worker.d.cts.map +0 -1
  147. package/dist/_internal/worker.d.mts +0 -46
  148. package/dist/_internal/worker.d.mts.map +0 -1
  149. package/dist/_internal/worker.mjs +0 -5153
  150. package/dist/_internal/worker.mjs.map +0 -1
  151. package/dist/base-context-DLemGRbd.cjs +0 -322
  152. package/dist/base-context-DUha4Lz-.mjs +0 -315
  153. package/dist/base-context-DUha4Lz-.mjs.map +0 -1
  154. package/dist/context/index.d.cts.map +0 -1
  155. package/dist/context/index.d.mts.map +0 -1
  156. package/dist/engine-context-BfFiKN53.mjs +0 -86
  157. package/dist/engine-context-BfFiKN53.mjs.map +0 -1
  158. package/dist/engine-context-D0y88i_J.cjs +0 -91
  159. package/dist/execution-context-CE5H90Um.mjs +0 -2845
  160. package/dist/execution-context-CE5H90Um.mjs.map +0 -1
  161. package/dist/execution-context-CnyaM3Ul.cjs +0 -2889
  162. package/dist/execution-context-NyDjVZ6T.d.cts +0 -647
  163. package/dist/execution-context-NyDjVZ6T.d.cts.map +0 -1
  164. package/dist/execution-context-YrjFeD9k.d.mts +0 -647
  165. package/dist/execution-context-YrjFeD9k.d.mts.map +0 -1
  166. package/dist/fs-CeEdzPKE.cjs +0 -262
  167. package/dist/fs-Dcle8lUp.mjs +0 -226
  168. package/dist/fs-Dcle8lUp.mjs.map +0 -1
  169. package/dist/index.d.cts.map +0 -1
  170. package/dist/index.d.mts.map +0 -1
  171. package/dist/index.mjs.map +0 -1
  172. package/dist/rpc/client.cjs +0 -74
  173. package/dist/rpc/client.d.cts +0 -31
  174. package/dist/rpc/client.d.cts.map +0 -1
  175. package/dist/rpc/client.d.mts +0 -31
  176. package/dist/rpc/client.d.mts.map +0 -1
  177. package/dist/rpc/client.mjs +0 -71
  178. package/dist/rpc/client.mjs.map +0 -1
  179. package/dist/rpc/serialization.cjs +0 -82
  180. package/dist/rpc/serialization.d.cts +0 -46
  181. package/dist/rpc/serialization.d.cts.map +0 -1
  182. package/dist/rpc/serialization.d.mts +0 -46
  183. package/dist/rpc/serialization.d.mts.map +0 -1
  184. package/dist/rpc/serialization.mjs +0 -76
  185. package/dist/rpc/serialization.mjs.map +0 -1
  186. package/dist/rpc/server.cjs +0 -69
  187. package/dist/rpc/server.d.cts +0 -29
  188. package/dist/rpc/server.d.cts.map +0 -1
  189. package/dist/rpc/server.d.mts +0 -29
  190. package/dist/rpc/server.d.mts.map +0 -1
  191. package/dist/rpc/server.mjs +0 -66
  192. package/dist/rpc/server.mjs.map +0 -1
  193. package/dist/rpc/types.cjs +0 -0
  194. package/dist/rpc/types.d.cts +0 -70
  195. package/dist/rpc/types.d.cts.map +0 -1
  196. package/dist/rpc/types.d.mts +0 -70
  197. package/dist/rpc/types.d.mts.map +0 -1
  198. package/dist/rpc/types.mjs +0 -1
  199. package/dist/schemas.cjs +0 -9
  200. package/dist/schemas.d.cts +0 -127
  201. package/dist/schemas.d.cts.map +0 -1
  202. package/dist/schemas.d.mts +0 -127
  203. package/dist/schemas.d.mts.map +0 -1
  204. package/dist/schemas.mjs +0 -3
  205. package/dist/storage/base.cjs +0 -216
  206. package/dist/storage/base.d.cts +0 -199
  207. package/dist/storage/base.d.cts.map +0 -1
  208. package/dist/storage/base.d.mts +0 -199
  209. package/dist/storage/base.d.mts.map +0 -1
  210. package/dist/storage/base.mjs +0 -215
  211. package/dist/storage/base.mjs.map +0 -1
  212. package/dist/storage/file-system.cjs +0 -180
  213. package/dist/storage/file-system.d.cts +0 -127
  214. package/dist/storage/file-system.d.cts.map +0 -1
  215. package/dist/storage/file-system.d.mts +0 -127
  216. package/dist/storage/file-system.d.mts.map +0 -1
  217. package/dist/storage/file-system.mjs +0 -179
  218. package/dist/storage/file-system.mjs.map +0 -1
  219. package/dist/storage/helpers.cjs +0 -37
  220. package/dist/storage/helpers.d.cts +0 -25
  221. package/dist/storage/helpers.d.cts.map +0 -1
  222. package/dist/storage/helpers.d.mts +0 -25
  223. package/dist/storage/helpers.d.mts.map +0 -1
  224. package/dist/storage/helpers.mjs +0 -34
  225. package/dist/storage/helpers.mjs.map +0 -1
  226. package/dist/storage/index.cjs +0 -12
  227. package/dist/storage/index.d.cts +0 -5
  228. package/dist/storage/index.d.mts +0 -5
  229. package/dist/storage/index.mjs +0 -6
  230. package/dist/storage/virtual.cjs +0 -98
  231. package/dist/storage/virtual.d.cts +0 -80
  232. package/dist/storage/virtual.d.cts.map +0 -1
  233. package/dist/storage/virtual.d.mts +0 -80
  234. package/dist/storage/virtual.d.mts.map +0 -1
  235. package/dist/storage/virtual.mjs +0 -97
  236. package/dist/storage/virtual.mjs.map +0 -1
  237. package/dist/ts-morph-BbM83PT9.cjs +0 -114
  238. package/dist/ts-morph-C6YBNc46.mjs +0 -102
  239. package/dist/ts-morph-C6YBNc46.mjs.map +0 -1
  240. package/dist/tsconfig-DeKMGasE.cjs +0 -198
  241. package/dist/tsconfig-HzJsMUrr.mjs +0 -155
  242. package/dist/tsconfig-HzJsMUrr.mjs.map +0 -1
  243. package/dist/typescript/index.cjs +0 -13
  244. package/dist/typescript/index.d.cts +0 -106
  245. package/dist/typescript/index.d.cts.map +0 -1
  246. package/dist/typescript/index.d.mts +0 -106
  247. package/dist/typescript/index.d.mts.map +0 -1
  248. package/dist/typescript/index.mjs +0 -4
  249. /package/dist/{chunk-C0xms8kb.cjs → chunk-C_NdSu1c.cjs} +0 -0
@@ -1,262 +0,0 @@
1
- const require_chunk = require('./chunk-C0xms8kb.cjs');
2
- let _stryke_capnp = require("@stryke/capnp");
3
- _stryke_capnp = require_chunk.__toESM(_stryke_capnp, 1);
4
-
5
- //#region schemas/fs.ts
6
- const _capnpFileId = BigInt("0xa56c61324b9d6e49");
7
- var FileMetadata_KeyValuePair = class extends _stryke_capnp.Struct {
8
- static _capnp = {
9
- displayName: "KeyValuePair",
10
- id: "eabb26cf58b2a14c",
11
- size: new _stryke_capnp.ObjectSize(0, 2)
12
- };
13
- get key() {
14
- return _stryke_capnp.utils.getText(0, this);
15
- }
16
- set key(value) {
17
- _stryke_capnp.utils.setText(0, value, this);
18
- }
19
- get value() {
20
- return _stryke_capnp.utils.getText(1, this);
21
- }
22
- set value(value) {
23
- _stryke_capnp.utils.setText(1, value, this);
24
- }
25
- toString() {
26
- return "FileMetadata_KeyValuePair_" + super.toString();
27
- }
28
- };
29
- /**
30
- * The identifier for the file data.
31
- *
32
- */
33
- var FileMetadata = class FileMetadata extends _stryke_capnp.Struct {
34
- static KeyValuePair = FileMetadata_KeyValuePair;
35
- static _capnp = {
36
- displayName: "FileMetadata",
37
- id: "8e2cab5d7e28c7b3",
38
- size: new _stryke_capnp.ObjectSize(8, 3),
39
- defaultType: "normal"
40
- };
41
- static _Properties;
42
- /**
43
- * The type of the file.
44
- *
45
- */
46
- get id() {
47
- return _stryke_capnp.utils.getText(0, this);
48
- }
49
- set id(value) {
50
- _stryke_capnp.utils.setText(0, value, this);
51
- }
52
- /**
53
- * The timestamp representing the file's creation date.
54
- *
55
- */
56
- get type() {
57
- return _stryke_capnp.utils.getText(1, this, FileMetadata._capnp.defaultType);
58
- }
59
- set type(value) {
60
- _stryke_capnp.utils.setText(1, value, this);
61
- }
62
- /**
63
- * Additional metadata associated with the file.
64
- *
65
- */
66
- get timestamp() {
67
- return _stryke_capnp.utils.getUint32(0, this);
68
- }
69
- set timestamp(value) {
70
- _stryke_capnp.utils.setUint32(0, value, this);
71
- }
72
- _adoptProperties(value) {
73
- _stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(2, this));
74
- }
75
- _disownProperties() {
76
- return _stryke_capnp.utils.disown(this.properties);
77
- }
78
- get properties() {
79
- return _stryke_capnp.utils.getList(2, FileMetadata._Properties, this);
80
- }
81
- _hasProperties() {
82
- return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(2, this));
83
- }
84
- _initProperties(length) {
85
- return _stryke_capnp.utils.initList(2, FileMetadata._Properties, length, this);
86
- }
87
- set properties(value) {
88
- _stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(2, this));
89
- }
90
- toString() {
91
- return "FileMetadata_" + super.toString();
92
- }
93
- };
94
- /**
95
- * An identifier for the file.
96
- *
97
- */
98
- var FileId = class extends _stryke_capnp.Struct {
99
- static _capnp = {
100
- displayName: "FileId",
101
- id: "990d6a471072f997",
102
- size: new _stryke_capnp.ObjectSize(0, 2)
103
- };
104
- /**
105
- * A virtual (or actual) path to the file in the file system.
106
- *
107
- */
108
- get id() {
109
- return _stryke_capnp.utils.getText(0, this);
110
- }
111
- set id(value) {
112
- _stryke_capnp.utils.setText(0, value, this);
113
- }
114
- get path() {
115
- return _stryke_capnp.utils.getText(1, this);
116
- }
117
- set path(value) {
118
- _stryke_capnp.utils.setText(1, value, this);
119
- }
120
- toString() {
121
- return "FileId_" + super.toString();
122
- }
123
- };
124
- /**
125
- * An identifier for the file.
126
- *
127
- */
128
- var FileStorage = class extends _stryke_capnp.Struct {
129
- static _capnp = {
130
- displayName: "FileStorage",
131
- id: "9dca66ac858c9ebe",
132
- size: new _stryke_capnp.ObjectSize(0, 2)
133
- };
134
- /**
135
- * A virtual (or actual) path to the file in the file system.
136
- *
137
- */
138
- get path() {
139
- return _stryke_capnp.utils.getText(0, this);
140
- }
141
- set path(value) {
142
- _stryke_capnp.utils.setText(0, value, this);
143
- }
144
- get code() {
145
- return _stryke_capnp.utils.getText(1, this);
146
- }
147
- set code(value) {
148
- _stryke_capnp.utils.setText(1, value, this);
149
- }
150
- toString() {
151
- return "FileStorage_" + super.toString();
152
- }
153
- };
154
- var FileSystem = class FileSystem extends _stryke_capnp.Struct {
155
- static _capnp = {
156
- displayName: "FileSystem",
157
- id: "ae0c23d43e56abcf",
158
- size: new _stryke_capnp.ObjectSize(0, 3)
159
- };
160
- static _Ids;
161
- static _Storage;
162
- static _Metadata;
163
- _adoptIds(value) {
164
- _stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(0, this));
165
- }
166
- _disownIds() {
167
- return _stryke_capnp.utils.disown(this.ids);
168
- }
169
- get ids() {
170
- return _stryke_capnp.utils.getList(0, FileSystem._Ids, this);
171
- }
172
- _hasIds() {
173
- return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(0, this));
174
- }
175
- _initIds(length) {
176
- return _stryke_capnp.utils.initList(0, FileSystem._Ids, length, this);
177
- }
178
- set ids(value) {
179
- _stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(0, this));
180
- }
181
- _adoptStorage(value) {
182
- _stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(1, this));
183
- }
184
- _disownStorage() {
185
- return _stryke_capnp.utils.disown(this.storage);
186
- }
187
- get storage() {
188
- return _stryke_capnp.utils.getList(1, FileSystem._Storage, this);
189
- }
190
- _hasStorage() {
191
- return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(1, this));
192
- }
193
- _initStorage(length) {
194
- return _stryke_capnp.utils.initList(1, FileSystem._Storage, length, this);
195
- }
196
- set storage(value) {
197
- _stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(1, this));
198
- }
199
- _adoptMetadata(value) {
200
- _stryke_capnp.utils.adopt(value, _stryke_capnp.utils.getPointer(2, this));
201
- }
202
- _disownMetadata() {
203
- return _stryke_capnp.utils.disown(this.metadata);
204
- }
205
- get metadata() {
206
- return _stryke_capnp.utils.getList(2, FileSystem._Metadata, this);
207
- }
208
- _hasMetadata() {
209
- return !_stryke_capnp.utils.isNull(_stryke_capnp.utils.getPointer(2, this));
210
- }
211
- _initMetadata(length) {
212
- return _stryke_capnp.utils.initList(2, FileSystem._Metadata, length, this);
213
- }
214
- set metadata(value) {
215
- _stryke_capnp.utils.copyFrom(value, _stryke_capnp.utils.getPointer(2, this));
216
- }
217
- toString() {
218
- return "FileSystem_" + super.toString();
219
- }
220
- };
221
- FileMetadata._Properties = _stryke_capnp.CompositeList(FileMetadata_KeyValuePair);
222
- FileSystem._Ids = _stryke_capnp.CompositeList(FileId);
223
- FileSystem._Storage = _stryke_capnp.CompositeList(FileStorage);
224
- FileSystem._Metadata = _stryke_capnp.CompositeList(FileMetadata);
225
-
226
- //#endregion
227
- Object.defineProperty(exports, 'FileId', {
228
- enumerable: true,
229
- get: function () {
230
- return FileId;
231
- }
232
- });
233
- Object.defineProperty(exports, 'FileMetadata', {
234
- enumerable: true,
235
- get: function () {
236
- return FileMetadata;
237
- }
238
- });
239
- Object.defineProperty(exports, 'FileMetadata_KeyValuePair', {
240
- enumerable: true,
241
- get: function () {
242
- return FileMetadata_KeyValuePair;
243
- }
244
- });
245
- Object.defineProperty(exports, 'FileStorage', {
246
- enumerable: true,
247
- get: function () {
248
- return FileStorage;
249
- }
250
- });
251
- Object.defineProperty(exports, 'FileSystem', {
252
- enumerable: true,
253
- get: function () {
254
- return FileSystem;
255
- }
256
- });
257
- Object.defineProperty(exports, '_capnpFileId', {
258
- enumerable: true,
259
- get: function () {
260
- return _capnpFileId;
261
- }
262
- });
@@ -1,226 +0,0 @@
1
- import * as $ from "@stryke/capnp";
2
-
3
- //#region schemas/fs.ts
4
- const _capnpFileId = BigInt("0xa56c61324b9d6e49");
5
- var FileMetadata_KeyValuePair = class extends $.Struct {
6
- static _capnp = {
7
- displayName: "KeyValuePair",
8
- id: "eabb26cf58b2a14c",
9
- size: new $.ObjectSize(0, 2)
10
- };
11
- get key() {
12
- return $.utils.getText(0, this);
13
- }
14
- set key(value) {
15
- $.utils.setText(0, value, this);
16
- }
17
- get value() {
18
- return $.utils.getText(1, this);
19
- }
20
- set value(value) {
21
- $.utils.setText(1, value, this);
22
- }
23
- toString() {
24
- return "FileMetadata_KeyValuePair_" + super.toString();
25
- }
26
- };
27
- /**
28
- * The identifier for the file data.
29
- *
30
- */
31
- var FileMetadata = class FileMetadata extends $.Struct {
32
- static KeyValuePair = FileMetadata_KeyValuePair;
33
- static _capnp = {
34
- displayName: "FileMetadata",
35
- id: "8e2cab5d7e28c7b3",
36
- size: new $.ObjectSize(8, 3),
37
- defaultType: "normal"
38
- };
39
- static _Properties;
40
- /**
41
- * The type of the file.
42
- *
43
- */
44
- get id() {
45
- return $.utils.getText(0, this);
46
- }
47
- set id(value) {
48
- $.utils.setText(0, value, this);
49
- }
50
- /**
51
- * The timestamp representing the file's creation date.
52
- *
53
- */
54
- get type() {
55
- return $.utils.getText(1, this, FileMetadata._capnp.defaultType);
56
- }
57
- set type(value) {
58
- $.utils.setText(1, value, this);
59
- }
60
- /**
61
- * Additional metadata associated with the file.
62
- *
63
- */
64
- get timestamp() {
65
- return $.utils.getUint32(0, this);
66
- }
67
- set timestamp(value) {
68
- $.utils.setUint32(0, value, this);
69
- }
70
- _adoptProperties(value) {
71
- $.utils.adopt(value, $.utils.getPointer(2, this));
72
- }
73
- _disownProperties() {
74
- return $.utils.disown(this.properties);
75
- }
76
- get properties() {
77
- return $.utils.getList(2, FileMetadata._Properties, this);
78
- }
79
- _hasProperties() {
80
- return !$.utils.isNull($.utils.getPointer(2, this));
81
- }
82
- _initProperties(length) {
83
- return $.utils.initList(2, FileMetadata._Properties, length, this);
84
- }
85
- set properties(value) {
86
- $.utils.copyFrom(value, $.utils.getPointer(2, this));
87
- }
88
- toString() {
89
- return "FileMetadata_" + super.toString();
90
- }
91
- };
92
- /**
93
- * An identifier for the file.
94
- *
95
- */
96
- var FileId = class extends $.Struct {
97
- static _capnp = {
98
- displayName: "FileId",
99
- id: "990d6a471072f997",
100
- size: new $.ObjectSize(0, 2)
101
- };
102
- /**
103
- * A virtual (or actual) path to the file in the file system.
104
- *
105
- */
106
- get id() {
107
- return $.utils.getText(0, this);
108
- }
109
- set id(value) {
110
- $.utils.setText(0, value, this);
111
- }
112
- get path() {
113
- return $.utils.getText(1, this);
114
- }
115
- set path(value) {
116
- $.utils.setText(1, value, this);
117
- }
118
- toString() {
119
- return "FileId_" + super.toString();
120
- }
121
- };
122
- /**
123
- * An identifier for the file.
124
- *
125
- */
126
- var FileStorage = class extends $.Struct {
127
- static _capnp = {
128
- displayName: "FileStorage",
129
- id: "9dca66ac858c9ebe",
130
- size: new $.ObjectSize(0, 2)
131
- };
132
- /**
133
- * A virtual (or actual) path to the file in the file system.
134
- *
135
- */
136
- get path() {
137
- return $.utils.getText(0, this);
138
- }
139
- set path(value) {
140
- $.utils.setText(0, value, this);
141
- }
142
- get code() {
143
- return $.utils.getText(1, this);
144
- }
145
- set code(value) {
146
- $.utils.setText(1, value, this);
147
- }
148
- toString() {
149
- return "FileStorage_" + super.toString();
150
- }
151
- };
152
- var FileSystem = class FileSystem extends $.Struct {
153
- static _capnp = {
154
- displayName: "FileSystem",
155
- id: "ae0c23d43e56abcf",
156
- size: new $.ObjectSize(0, 3)
157
- };
158
- static _Ids;
159
- static _Storage;
160
- static _Metadata;
161
- _adoptIds(value) {
162
- $.utils.adopt(value, $.utils.getPointer(0, this));
163
- }
164
- _disownIds() {
165
- return $.utils.disown(this.ids);
166
- }
167
- get ids() {
168
- return $.utils.getList(0, FileSystem._Ids, this);
169
- }
170
- _hasIds() {
171
- return !$.utils.isNull($.utils.getPointer(0, this));
172
- }
173
- _initIds(length) {
174
- return $.utils.initList(0, FileSystem._Ids, length, this);
175
- }
176
- set ids(value) {
177
- $.utils.copyFrom(value, $.utils.getPointer(0, this));
178
- }
179
- _adoptStorage(value) {
180
- $.utils.adopt(value, $.utils.getPointer(1, this));
181
- }
182
- _disownStorage() {
183
- return $.utils.disown(this.storage);
184
- }
185
- get storage() {
186
- return $.utils.getList(1, FileSystem._Storage, this);
187
- }
188
- _hasStorage() {
189
- return !$.utils.isNull($.utils.getPointer(1, this));
190
- }
191
- _initStorage(length) {
192
- return $.utils.initList(1, FileSystem._Storage, length, this);
193
- }
194
- set storage(value) {
195
- $.utils.copyFrom(value, $.utils.getPointer(1, this));
196
- }
197
- _adoptMetadata(value) {
198
- $.utils.adopt(value, $.utils.getPointer(2, this));
199
- }
200
- _disownMetadata() {
201
- return $.utils.disown(this.metadata);
202
- }
203
- get metadata() {
204
- return $.utils.getList(2, FileSystem._Metadata, this);
205
- }
206
- _hasMetadata() {
207
- return !$.utils.isNull($.utils.getPointer(2, this));
208
- }
209
- _initMetadata(length) {
210
- return $.utils.initList(2, FileSystem._Metadata, length, this);
211
- }
212
- set metadata(value) {
213
- $.utils.copyFrom(value, $.utils.getPointer(2, this));
214
- }
215
- toString() {
216
- return "FileSystem_" + super.toString();
217
- }
218
- };
219
- FileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);
220
- FileSystem._Ids = $.CompositeList(FileId);
221
- FileSystem._Storage = $.CompositeList(FileStorage);
222
- FileSystem._Metadata = $.CompositeList(FileMetadata);
223
-
224
- //#endregion
225
- export { FileSystem as a, FileStorage as i, FileMetadata as n, _capnpFileId as o, FileMetadata_KeyValuePair as r, FileId as t };
226
- //# sourceMappingURL=fs-Dcle8lUp.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs-Dcle8lUp.mjs","names":[],"sources":["../schemas/fs.ts"],"sourcesContent":["/* eslint-disable */\n// biome-ignore lint: disable\n// Generated by storm-capnpc\n// Note: Do not edit this file manually - it will be overwritten automatically\nimport * as $ from \"@stryke/capnp\";\nexport const _capnpFileId = BigInt(\"0xa56c61324b9d6e49\");\nexport class FileMetadata_KeyValuePair extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"KeyValuePair\",\n id: \"eabb26cf58b2a14c\",\n size: new $.ObjectSize(0, 2),\n };\n get key(): string {\n return $.utils.getText(0, this);\n }\n set key(value: string) {\n $.utils.setText(0, value, this);\n }\n get value(): string {\n return $.utils.getText(1, this);\n }\n set value(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileMetadata_KeyValuePair_\" + super.toString(); }\n}\n/**\n* The identifier for the file data.\n*\n*/\nexport class FileMetadata extends $.Struct {\n static readonly KeyValuePair = FileMetadata_KeyValuePair;\n public static override readonly _capnp = {\n displayName: \"FileMetadata\",\n id: \"8e2cab5d7e28c7b3\",\n size: new $.ObjectSize(8, 3),\n defaultType: \"normal\"\n };\n static _Properties: $.ListCtor<FileMetadata_KeyValuePair>;\n /**\n* The type of the file.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n /**\n* The timestamp representing the file's creation date.\n*\n*/\n get type(): string {\n return $.utils.getText(1, this, FileMetadata._capnp.defaultType);\n }\n set type(value: string) {\n $.utils.setText(1, value, this);\n }\n /**\n* Additional metadata associated with the file.\n*\n*/\n get timestamp(): number {\n return $.utils.getUint32(0, this);\n }\n set timestamp(value: number) {\n $.utils.setUint32(0, value, this);\n }\n _adoptProperties(value: $.Orphan<$.List<FileMetadata_KeyValuePair>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownProperties(): $.Orphan<$.List<FileMetadata_KeyValuePair>> {\n return $.utils.disown(this.properties);\n }\n get properties(): $.List<FileMetadata_KeyValuePair> {\n return $.utils.getList(2, FileMetadata._Properties, this);\n }\n _hasProperties(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initProperties(length: number): $.List<FileMetadata_KeyValuePair> {\n return $.utils.initList(2, FileMetadata._Properties, length, this);\n }\n set properties(value: $.List<FileMetadata_KeyValuePair>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileMetadata_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileId extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileId\",\n id: \"990d6a471072f997\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get id(): string {\n return $.utils.getText(0, this);\n }\n set id(value: string) {\n $.utils.setText(0, value, this);\n }\n get path(): string {\n return $.utils.getText(1, this);\n }\n set path(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileId_\" + super.toString(); }\n}\n/**\n* An identifier for the file.\n*\n*/\nexport class FileStorage extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileStorage\",\n id: \"9dca66ac858c9ebe\",\n size: new $.ObjectSize(0, 2),\n };\n /**\n* A virtual (or actual) path to the file in the file system.\n*\n*/\n get path(): string {\n return $.utils.getText(0, this);\n }\n set path(value: string) {\n $.utils.setText(0, value, this);\n }\n get code(): string {\n return $.utils.getText(1, this);\n }\n set code(value: string) {\n $.utils.setText(1, value, this);\n }\n public override toString(): string { return \"FileStorage_\" + super.toString(); }\n}\nexport class FileSystem extends $.Struct {\n public static override readonly _capnp = {\n displayName: \"FileSystem\",\n id: \"ae0c23d43e56abcf\",\n size: new $.ObjectSize(0, 3),\n };\n static _Ids: $.ListCtor<FileId>;\n static _Storage: $.ListCtor<FileStorage>;\n static _Metadata: $.ListCtor<FileMetadata>;\n _adoptIds(value: $.Orphan<$.List<FileId>>): void {\n $.utils.adopt(value, $.utils.getPointer(0, this));\n }\n _disownIds(): $.Orphan<$.List<FileId>> {\n return $.utils.disown(this.ids);\n }\n get ids(): $.List<FileId> {\n return $.utils.getList(0, FileSystem._Ids, this);\n }\n _hasIds(): boolean {\n return !$.utils.isNull($.utils.getPointer(0, this));\n }\n _initIds(length: number): $.List<FileId> {\n return $.utils.initList(0, FileSystem._Ids, length, this);\n }\n set ids(value: $.List<FileId>) {\n $.utils.copyFrom(value, $.utils.getPointer(0, this));\n }\n _adoptStorage(value: $.Orphan<$.List<FileStorage>>): void {\n $.utils.adopt(value, $.utils.getPointer(1, this));\n }\n _disownStorage(): $.Orphan<$.List<FileStorage>> {\n return $.utils.disown(this.storage);\n }\n get storage(): $.List<FileStorage> {\n return $.utils.getList(1, FileSystem._Storage, this);\n }\n _hasStorage(): boolean {\n return !$.utils.isNull($.utils.getPointer(1, this));\n }\n _initStorage(length: number): $.List<FileStorage> {\n return $.utils.initList(1, FileSystem._Storage, length, this);\n }\n set storage(value: $.List<FileStorage>) {\n $.utils.copyFrom(value, $.utils.getPointer(1, this));\n }\n _adoptMetadata(value: $.Orphan<$.List<FileMetadata>>): void {\n $.utils.adopt(value, $.utils.getPointer(2, this));\n }\n _disownMetadata(): $.Orphan<$.List<FileMetadata>> {\n return $.utils.disown(this.metadata);\n }\n get metadata(): $.List<FileMetadata> {\n return $.utils.getList(2, FileSystem._Metadata, this);\n }\n _hasMetadata(): boolean {\n return !$.utils.isNull($.utils.getPointer(2, this));\n }\n _initMetadata(length: number): $.List<FileMetadata> {\n return $.utils.initList(2, FileSystem._Metadata, length, this);\n }\n set metadata(value: $.List<FileMetadata>) {\n $.utils.copyFrom(value, $.utils.getPointer(2, this));\n }\n public override toString(): string { return \"FileSystem_\" + super.toString(); }\n}\nFileMetadata._Properties = $.CompositeList(FileMetadata_KeyValuePair);\nFileSystem._Ids = $.CompositeList(FileId);\nFileSystem._Storage = $.CompositeList(FileStorage);\nFileSystem._Metadata = $.CompositeList(FileMetadata);\n"],"mappings":";;;AAKA,MAAa,eAAe,OAAO,qBAAqB;AACxD,IAAa,4BAAb,cAA+C,EAAE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AA,CACZ,IAAA,CAAK,iBAAA,8BAIN,OAAA;EAnQiB;;;;;;EA4RP,IAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,gBAAA,8BAIN,OAAA;EA/RQ;;;;;;;;EA8TE,MAAA,CACX,YAAA,GAAc,WAAA,CACZ,IAAA,CAAK,kBAAA,8BAIN,OAAA;EArPU;;;;;;;;EAkRA,QAAA,CAAA,GAAQ,OAAA;EA9QE;;;EAAA,CA2RT,MAAA,CAAO,YAAA,KAAa,OAAA;EAzR5B;;;;;EAAA,UAkSG,WAAA,CAAa,OAAA,EAAS,aAAA;EAhSzB;;;;;EAAA,QAySQ,gBAAA;EAAA,QAuGA,cAAA;EAAA,QAsBA,kBAAA;EAAA,QAEA,gBAAA;EAAA,QAEA,mBAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":["Worker","#worker","JestWorker","#worker","Worker","#context"],"sources":["../src/_internal/ipc/parse.ts","../src/_internal/helpers/worker.ts","../src/index.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 { LogMeta } from \"@powerlines/core\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { Serializable } from \"node:worker_threads\";\nimport {\n IpcMessage,\n UpdateCommandMessagePayload,\n UpdateHookMessagePayload,\n UpdatePluginMessagePayload,\n WriteLogMessagePayload\n} from \"./messages\";\n\nexport function parseIpcMessage(data: Serializable): IpcMessage | undefined {\n let message: Record<string, any> | undefined;\n if (isSetObject(data)) {\n message = data;\n } else if (isString(data)) {\n try {\n const parsed = JSON.parse(data);\n if (isSetObject(parsed)) {\n message = parsed;\n }\n } catch {\n // Do nothing\n }\n }\n\n if (\n message &&\n isSetString(message.id) &&\n isSetString(message.type) &&\n isSetString(message.executionId) &&\n Number.isInteger(message.executionIndex) &&\n !Number.isNaN(message.timestamp)\n ) {\n return message as IpcMessage;\n }\n\n return undefined;\n}\n\nexport function parseWriteLogMessagePayload(\n data?: Record<string, any>\n): WriteLogMessagePayload {\n if (\n isSetObject(data) &&\n isSetObject(data.meta) &&\n isSetString((data.meta as LogMeta).type) &&\n (isSetString(data.message) || Array.isArray(data.message))\n ) {\n return {\n ...data,\n meta: data.meta as Omit<\n LogMeta,\n \"executionId\" | \"executionIndex\" | \"environment\" | \"timestamp\"\n >,\n message: toArray(data.message).filter(Boolean)\n };\n }\n\n throw new Error(\n `Invalid \"write-log\" message payload: ${JSON.stringify(data)}`\n );\n}\n\nexport function parseUpdateCommandMessagePayload(\n data?: Record<string, any>\n): UpdateCommandMessagePayload {\n if (isSetString(data?.command)) {\n return {\n command: data.command\n };\n }\n\n throw new Error(\n `Invalid \"update-command\" message payload: ${JSON.stringify(data)}`\n );\n}\n\nexport function parseUpdateHookMessagePayload(\n data?: Record<string, any>\n): UpdateHookMessagePayload {\n if (\n isSetString(data?.hook) &&\n [\"pre\", \"post\", \"normal\"].includes(data.order)\n ) {\n return {\n hook: data.hook,\n order: data.order\n };\n }\n\n throw new Error(\n `Invalid \"update-hook\" message payload: ${JSON.stringify(data)}`\n );\n}\n\nexport function parseUpdatePluginMessagePayload(\n data?: Record<string, any>\n): UpdatePluginMessagePayload {\n if (isSetString(data?.plugin)) {\n return {\n plugin: data.plugin\n };\n }\n\n throw new Error(\n `Invalid \"update-plugin\" message payload: ${JSON.stringify(data)}`\n );\n}\n","/* -------------------------------------------------------------------\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 { ExecutionWorkerParams, Logger } from \"@powerlines/core\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { MaybePromise } from \"@stryke/types/base\";\nimport { formatDuration } from \"date-fns/formatDuration\";\nimport { Worker as JestWorker } from \"jest-worker\";\nimport type { ChildProcess } from \"node:child_process\";\nimport { Transform } from \"node:stream\";\nimport { parseArgs } from \"node:util\";\nimport { IpcMessage, IpcMessageType } from \"../ipc/messages\";\nimport { parseIpcMessage } from \"../ipc/parse\";\n\nconst RESTARTED = Symbol(\"powerlines-worker:restarted\");\n\n/**\n * The debug address is in the form of `[host:]port`. The host is optional.\n */\ninterface DebugAddress {\n host?: string;\n port: number;\n}\n\n/**\n * Formats the debug address into a string.\n */\nconst formatDebugAddress = ({ host, port }: DebugAddress): string => {\n return host ? `${host}:${port}` : `${port}`;\n};\n\n/**\n * Node.js CLI flags that are not allowed in NODE_OPTIONS and must be\n * passed as direct CLI arguments via execArgv.\n * This set is the difference between all Node.js CLI flags and the ones **not**\n * allowed in NODE_OPTIONS, as listed in the Node.js documentation:\n * https://nodejs.org/api/cli.html#node_optionsoptions\n *\n * It is not exhaustive since not all options make sense for Powerlines (e.g. --test)\n */\nconst EXEC_ARGV_ONLY_OPTIONS = new Set([\n \"experimental-network-inspection\",\n \"experimental-storage-inspection\",\n \"experimental-worker-inspection\",\n \"experimental-inspector-network-resource\"\n]);\n\nfunction formatArg(\n key: string,\n value: string | boolean | undefined\n): string | null {\n if (value === true) {\n return `--${key}`;\n }\n\n if (value) {\n return `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n return null;\n}\n\n/**\n * Tokenizes the arguments string into an array of strings, supporting quoted\n * values and escaped characters.\n * Converted from: https://github.com/nodejs/node/blob/c29d53c5cfc63c5a876084e788d70c9e87bed880/src/node_options.cc#L1401\n *\n * @param input - The arguments string to be tokenized.\n * @returns An array of strings with the tokenized arguments.\n */\nconst tokenizeArgs = (input: string): string[] => {\n const args: string[] = [];\n let isInString = false;\n let willStartNewArg = true;\n\n for (let i = 0; i < input.length; i++) {\n let char = input[i];\n if (char) {\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (input.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = input[++i];\n if (!char) {\n continue;\n }\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n\n return args;\n};\n\n/**\n * Get the node options from the environment variable `NODE_OPTIONS` and returns\n * them as an array of strings.\n *\n * @returns An array of strings with the node options.\n */\nconst getNodeOptionsArgs = () => {\n if (!process.env.NODE_OPTIONS) return [];\n\n return tokenizeArgs(process.env.NODE_OPTIONS);\n};\n\n/**\n * Stringify the arguments to be used in a command line. It will ignore any\n * argument that has a value of `undefined`. Options that are not allowed in\n * NODE_OPTIONS are returned separately as execArgv.\n *\n * @param args - The arguments to be stringified.\n * @returns An object with `nodeOptions` string and `execArgv` array.\n */\nfunction formatNodeOptions(\n args: Record<string, string | boolean | undefined>\n): { nodeOptions: string; execArgv: string[] } {\n const nodeOptionsParts: string[] = [];\n const execArgv: string[] = [];\n\n for (const [key, value] of Object.entries(args)) {\n const formatted = formatArg(key, value);\n if (formatted === null) continue;\n\n if (EXEC_ARGV_ONLY_OPTIONS.has(key)) {\n execArgv.push(formatted);\n } else {\n nodeOptionsParts.push(formatted);\n }\n }\n\n return { nodeOptions: nodeOptionsParts.join(\" \"), execArgv };\n}\n\nexport type NodeOptions = Record<string, string | boolean | undefined>;\n\nconst parseNodeArgs = (args: string[]): NodeOptions => {\n const { values, tokens } = parseArgs({ args, strict: false, tokens: true });\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = !isSet(token.value) ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in values && isString(values[orphan.name])) {\n values[orphan.name] += ` ${token.value}`;\n } else {\n values[orphan.name] = token.value;\n }\n }\n\n return values;\n};\n\nfunction getParsedNodeOptions(): Record<string, string | boolean | undefined> {\n const args = [...process.execArgv, ...getNodeOptionsArgs()];\n if (args.length === 0) return {};\n\n return parseNodeArgs(args);\n}\n\n/**\n * Get's the debug address from the `NODE_OPTIONS` environment variable. If the\n * address is not found, it returns the default host (`undefined`) and port\n * (`9229`).\n *\n * @returns An object with the host and port of the debug address.\n */\nconst getParsedDebugAddress = (\n address: string | boolean | undefined\n): DebugAddress => {\n if (!address || !isString(address)) {\n return { host: undefined, port: 9229 };\n }\n\n // The address is in the form of `[host:]port`. Let's parse the address.\n if (address.includes(\":\")) {\n const [host, port] = address.split(\":\");\n if (!host || !port) {\n throw new Error(`Invalid debug address: ${address}`);\n }\n\n return { host, port: Number.parseInt(port, 10) };\n }\n\n return { host: undefined, port: Number.parseInt(address, 10) };\n};\n\ntype NodeInspectType = \"inspect\" | \"inspect-brk\" | undefined;\n\n/**\n * Get the debug type from the `NODE_OPTIONS` environment variable.\n */\nfunction getNodeDebugType(nodeOptions: NodeOptions): NodeInspectType {\n if (nodeOptions.inspect) {\n return \"inspect\";\n }\n if (nodeOptions[\"inspect-brk\"] || nodeOptions.inspect_brk) {\n return \"inspect-brk\";\n }\n\n return undefined;\n}\n\nconst cleanupWorkers = (worker: JestWorker) => {\n for (const curWorker of ((worker as any)._workerPool?._workers || []) as {\n _child?: ChildProcess;\n }[]) {\n curWorker._child?.kill(\"SIGINT\");\n }\n};\n\nexport type WorkerOptions = ConstructorParameters<typeof JestWorker>[1] & {\n /**\n * `-1` if not inspectable\n */\n debuggerPortOffset?: number;\n\n /**\n * Whether to enable source maps support in the worker, which can improve the quality of stack traces at the cost of increased memory usage and slower performance. Defaults to `false`.\n */\n enableSourceMaps?: boolean;\n\n /**\n * True if `--max-old-space-size` should not be forwarded to the worker.\n */\n isolatedMemory?: boolean;\n\n /**\n * The maximum time in milliseconds a worker can run before being terminated.\n *\n * @defaultValue 900000 (15 minutes)\n */\n timeout?: number;\n\n /**\n * A callback function that is called when the worker is active.\n */\n onActivity?: () => void;\n\n /**\n * A callback function that is called when the worker activity is aborted.\n */\n onActivityAbort?: () => void;\n\n /**\n * A callback function that is called when the worker is restarted.\n */\n onRestart?: (method: string, args: any[], attempts: number) => void;\n\n /**\n * 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.\n */\n exposedMethods: ReadonlyArray<string>;\n\n /**\n * Whether to use worker threads instead of child processes for the worker implementation. This is an experimental feature and may not be suitable for all use cases. Defaults to `false`.\n */\n enableWorkerThreads?: boolean;\n\n /**\n * A custom log function that can be used to log messages from the worker. This can be useful for debugging and monitoring the worker's activity. The function should accept a string message as its argument.\n */\n logger: Logger;\n\n /**\n * A callback function that is called when the worker sends a log message. This can be used to handle log messages from the worker and integrate them with the parent process's logging system. The function should accept a `WriteLogIpcMessage` object as its argument, which contains the log message and associated metadata.\n */\n onIpcMessage?: (message: IpcMessage) => MaybePromise<void>;\n};\n\nexport class Worker {\n #worker: JestWorker | undefined;\n\n /**\n * Create a new worker instance.\n *\n * @param workerPath - The path to the worker file.\n * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.\n */\n public constructor(\n protected workerPath: string,\n protected options: WorkerOptions\n ) {\n const {\n timeout = 900_000,\n onRestart,\n debuggerPortOffset = -1,\n enableSourceMaps = false,\n isolatedMemory = false,\n enableWorkerThreads = false,\n logger,\n ...rest\n } = this.options;\n\n let restartPromise: Promise<typeof RESTARTED>;\n let resolveRestartPromise: (arg: typeof RESTARTED) => void;\n let activeTasks = 0;\n\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n this.close();\n });\n\n const nodeOptions = getParsedNodeOptions();\n const originalOptions = { ...nodeOptions };\n delete nodeOptions.inspect;\n delete nodeOptions[\"inspect-brk\"];\n delete nodeOptions.inspect_brk;\n if (debuggerPortOffset !== -1) {\n const nodeDebugType = getNodeDebugType(originalOptions);\n if (nodeDebugType) {\n const debuggerAddress = getParsedDebugAddress(\n originalOptions[nodeDebugType]\n );\n const address: DebugAddress = {\n host: debuggerAddress.host,\n // current process runs on `address.port`\n port:\n debuggerAddress.port === 0\n ? 0\n : debuggerAddress.port + 1 + debuggerPortOffset\n };\n nodeOptions[nodeDebugType] = formatDebugAddress(address);\n }\n }\n\n if (enableSourceMaps) {\n nodeOptions[\"enable-source-maps\"] = true;\n }\n\n if (isolatedMemory) {\n delete nodeOptions[\"max-old-space-size\"];\n delete nodeOptions.max_old_space_size;\n }\n\n const { nodeOptions: formattedNodeOptions, execArgv } =\n formatNodeOptions(nodeOptions);\n\n const onHanging = () => {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n const resolve = resolveRestartPromise;\n // eslint-disable-next-line ts/no-use-before-define\n createWorker();\n\n logger.warn(\n `Sending SIGTERM signal to static worker due to timeout${\n timeout ? ` of ${formatDuration({ seconds: timeout / 1000 })}` : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void worker.end().then(() => {\n resolve(RESTARTED);\n });\n };\n\n let hangingTimer: NodeJS.Timeout | false = false;\n\n const onActivity = () => {\n if (hangingTimer) {\n clearTimeout(hangingTimer);\n }\n if (this.options.onActivity) {\n this.options.onActivity();\n }\n\n hangingTimer = activeTasks > 0 && setTimeout(onHanging, timeout);\n };\n\n const createWorker = () => {\n const workerEnv: NodeJS.ProcessEnv = {\n ...process.env,\n ...((rest.forkOptions?.env ?? {}) as any),\n NODE_OPTIONS: formattedNodeOptions,\n POWERLINES_EXECUTION_THREAD_TYPE: enableWorkerThreads\n ? \"worker-thread\"\n : \"child-process\"\n };\n\n if (workerEnv.FORCE_COLOR === undefined) {\n // Mirror the enablement heuristic from picocolors (see https://github.com/vercel/next.js/blob/6a40da0345939fe4f7b1ae519b296a86dd103432/packages/next/src/lib/picocolors.ts#L21-L24).\n // Picocolors snapshots `process.env`/`stdout.isTTY` at module load time, so when the worker\n // process bootstraps with piped stdio its own check would disable colors. Re-evaluating the\n // same conditions here lets us opt the worker into color output only when the parent would\n // have seen colors, while still respecting explicit opt-outs like NO_COLOR.\n const supportsColors =\n !workerEnv.NO_COLOR &&\n !workerEnv.CI &&\n workerEnv.TERM !== \"dumb\" &&\n (process.stdout.isTTY || process.stderr?.isTTY);\n\n if (supportsColors) {\n workerEnv.FORCE_COLOR = \"1\";\n }\n }\n\n this.#worker = new JestWorker(workerPath, {\n maxRetries: 0,\n computeWorkerKey: (_, ...args: Array<unknown>) => {\n let executionId = \"default\";\n let executionIndex = 0;\n if (args.length > 0 && isSetObject(args[0])) {\n const arg = args[0] as ExecutionWorkerParams;\n if (isSetObject(arg.options)) {\n executionIndex = arg.options.executionIndex ?? 0;\n executionId = arg.options.executionId || \"default\";\n }\n }\n\n return `${executionId}-${executionIndex}`;\n },\n ...rest,\n enableWorkerThreads,\n forkOptions: {\n ...rest.forkOptions,\n silent: true,\n execArgv: [...execArgv, ...(rest.forkOptions?.execArgv ?? [])],\n env: workerEnv\n }\n });\n restartPromise = new Promise(resolve => {\n resolveRestartPromise = resolve;\n });\n\n /**\n * Jest Worker has two worker types, ChildProcessWorker (uses child_process) and NodeThreadWorker (uses worker_threads)\n * Powerlines uses ChildProcessWorker by default, but it can be switched to NodeThreadWorker with an experimental flag\n *\n * We only want to handle ChildProcessWorker's orphan process issue, so we access the private property \"_child\":\n * https://github.com/facebook/jest/blob/b38d7d345a81d97d1dc3b68b8458b1837fbf19be/packages/jest-worker/src/workers/ChildProcessWorker.ts\n *\n * But this property is not available in NodeThreadWorker, so we need to check if we are using ChildProcessWorker\n */\n if (!enableWorkerThreads) {\n for (const worker of ((this.#worker as any)._workerPool?._workers ||\n []) as {\n _child?: ChildProcess;\n }[]) {\n worker._child?.on(\"exit\", (code, signal) => {\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n logger.error(\n `Worker exited with code: ${code} and signal: ${signal}`\n );\n\n // if a child process doesn't exit gracefully, we want to bubble up the exit code to the parent process\n process.exit(code ?? 1);\n }\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n worker._child?.on(\"message\", data => {\n if (\n isSetObject(data) &&\n (data as IpcMessage).type === IpcMessageType.ACTIVITY\n ) {\n onActivity();\n } else {\n const message = parseIpcMessage(data);\n if (message) {\n logger.trace(\n `Received IPC message from worker: ${JSON.stringify(message)}`\n );\n\n void Promise.resolve(this.options.onIpcMessage?.(message));\n }\n }\n });\n }\n }\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n this.options.onActivityAbort?.();\n aborted = true;\n }\n };\n\n // Listen to the worker's stdout and stderr, if there's any thing logged, abort the activity first\n const abortActivityStreamOnLog = new Transform({\n transform(_chunk, _encoding, callback) {\n onActivityAbort();\n callback();\n }\n });\n // Stop the activity if there's any output from the worker\n this.#worker.getStdout().pipe(abortActivityStreamOnLog);\n this.#worker.getStderr().pipe(abortActivityStreamOnLog);\n\n // Pipe the worker's stdout and stderr to the parent process\n this.#worker.getStdout().pipe(process.stdout);\n this.#worker.getStderr().pipe(process.stderr);\n };\n createWorker();\n\n for (const method of rest.exposedMethods) {\n if (method.startsWith(\"_\")) {\n continue;\n }\n\n (this as any)[method] = timeout\n ? async (...args: any[]) => {\n activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n onActivity();\n\n const result = await Promise.race([\n // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method](\n args.length > 0 && args[0] ? args[0] : {}\n ),\n restartPromise\n ]);\n if (result !== RESTARTED) {\n return result;\n }\n if (onRestart) {\n onRestart(method, args, ++attempts);\n }\n }\n } finally {\n activeTasks--;\n onActivity();\n }\n }\n : // eslint-disable-next-line ts/no-unsafe-call\n (this.#worker as any)[method].bind(this.#worker);\n }\n }\n\n public async end(): ReturnType<JestWorker[\"end\"]> {\n const worker = this.#worker;\n if (!worker) {\n throw new Error(\"Farm is ended, no more calls can be done to it\");\n }\n\n cleanupWorkers(worker);\n this.#worker = undefined;\n return worker.end();\n }\n\n /**\n * Quietly end the worker if it exists\n */\n public close(): void {\n if (this.#worker) {\n cleanupWorkers(this.#worker);\n void this.#worker.end();\n }\n }\n}\n","/* -------------------------------------------------------------------\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 DeployInlineConfig,\n DocsInlineConfig,\n Engine,\n EngineContext,\n EngineOptions,\n ExecutionWorkerProcess,\n LintInlineConfig,\n NewInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig,\n UserConfig\n} from \"@powerlines/core\";\nimport { POWERLINES_API_FUNCTIONS } from \"@powerlines/core/constants\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { DeepPartial, PartialKeys } from \"@stryke/types/base\";\nimport { Worker } from \"./_internal/helpers/worker\";\nimport {\n IpcMessage,\n IpcMessageType,\n UpdateCommandIpcMessage,\n UpdateHookIpcMessage,\n UpdatePluginIpcMessage,\n WriteLogIpcMessage\n} from \"./_internal/ipc/messages\";\nimport {\n parseUpdateCommandMessagePayload,\n parseUpdateHookMessagePayload,\n parseUpdatePluginMessagePayload,\n parseWriteLogMessagePayload\n} from \"./_internal/ipc/parse\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\n\n/**\n * The Powerlines Engine class\n *\n * @remarks\n * This class is responsible for managing the Powerlines project lifecycle, including initialization, building, and finalization.\n *\n * @public\n */\nexport class PowerlinesEngine implements Engine, AsyncDisposable {\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The worker pool for managing child threads\n */\n #worker!: ExecutionWorkerProcess;\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param options - The options to initialize the context with\n * @param initialConfig - The initial configuration for the context, which can be used to provide additional context or override certain configuration values during initialization. This is particularly useful when initializing the context from a CLI command, where the CLI flags can be passed as part of the initial configuration to ensure they are properly merged with the configuration file and made available to plugins during their setup and execution.\n * @returns A new instance of the Powerlines Engine\n */\n public static async from(\n options: EngineOptions,\n initialConfig: DeepPartial<UserConfig> = {}\n ): Promise<PowerlinesEngine> {\n const api = new PowerlinesEngine(\n await PowerlinesEngineContext.fromInitialConfig(options, initialConfig)\n );\n\n const packagePath = await resolvePackage(\"@powerlines/engine\");\n if (!packagePath) {\n throw new Error(\n \"Could not resolve `@powerlines/engine` package location.\"\n );\n }\n\n api.#worker = new Worker(joinPaths(packagePath, \"./_internal/worker.mjs\"), {\n onIpcMessage: api.handleIpcMessage.bind(api),\n enableSourceMaps: options.mode === \"development\",\n exposedMethods: POWERLINES_API_FUNCTIONS,\n logger: api.context.extendLogger({ category: \"ipc\" })\n }) as unknown as ExecutionWorkerProcess;\n\n return api;\n }\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\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(\n inlineConfig: PartialKeys<\n Omit<TypesInlineConfig, \"configFile\">,\n \"command\"\n > = {\n command: \"types\"\n }\n ) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\n \"🏗️ Generating typescript declarations for the Powerlines project\"\n );\n\n this.context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n inlineConfig.command ??= \"types\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.types({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as TypesInlineConfig\n })\n )\n );\n\n this.context.debug(\n \"✔ Powerlines types generation has completed successfully\"\n );\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:\n | PartialKeys<Omit<PrepareInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<TypesInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<NewInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<CleanInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<BuildInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<LintInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<DocsInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<DeployInlineConfig, \"configFile\">, \"command\"> = {\n command: \"prepare\"\n }\n ) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"🏗️ Preparing the Powerlines project\");\n\n this.context.debug(\n \"Aggregating configuration options for the Powerlines project\"\n );\n\n inlineConfig.command ??= \"prepare\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.prepare({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as PrepareInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines preparation has completed successfully\");\n timer();\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 new command\n * @returns A promise that resolves when the project has been created\n */\n public async new(inlineConfig: PartialKeys<NewInlineConfig, \"command\">) {\n const timer = this.context.timer(\"New\");\n this.context.info(\"🆕 Creating a new Powerlines project\");\n\n inlineConfig.command ??= \"new\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.new({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as NewInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines new command 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(\n inlineConfig:\n | PartialKeys<Omit<CleanInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<PrepareInlineConfig, \"configFile\">, \"command\"> = {\n command: \"clean\"\n }\n ) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"🧹 Cleaning the previous Powerlines artifacts\");\n\n inlineConfig.command ??= \"clean\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.clean({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as CleanInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines 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(\n inlineConfig:\n | PartialKeys<Omit<LintInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<BuildInlineConfig, \"configFile\">, \"command\"> = {\n command: \"lint\"\n }\n ) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"📝 Linting the Powerlines project\");\n\n inlineConfig.command ??= \"lint\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.lint({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as LintInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines 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(\n inlineConfig:\n | PartialKeys<Omit<TestInlineConfig, \"configFile\">, \"command\">\n | PartialKeys<Omit<BuildInlineConfig, \"configFile\">, \"command\"> = {\n command: \"test\"\n }\n ) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"🧪 Running tests for the Powerlines project\");\n\n inlineConfig.command ??= \"test\";\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.test({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as TestInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines 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(\n inlineConfig: PartialKeys<\n Omit<BuildInlineConfig, \"configFile\">,\n \"command\"\n > = {\n command: \"build\"\n }\n ) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"📦 Building the Powerlines project\");\n\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.build({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as BuildInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines 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(\n inlineConfig: PartialKeys<\n Omit<DocsInlineConfig, \"configFile\">,\n \"command\"\n > = {\n command: \"docs\"\n }\n ) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"📓 Generating documentation for the Powerlines project\");\n\n inlineConfig.command ??= \"docs\";\n\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.docs({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as DocsInlineConfig\n })\n )\n );\n\n this.context.debug(\n \"✔ Powerlines documentation generation completed successfully\"\n );\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 */\n public async deploy(\n inlineConfig: PartialKeys<\n Omit<DeployInlineConfig, \"configFile\">,\n \"command\"\n > = {\n command: \"deploy\"\n }\n ) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"🚀 Deploying the Powerlines project\");\n\n inlineConfig.command ??= \"deploy\";\n\n await Promise.all(\n this.#context.executions.map(async execution =>\n this.#worker.deploy({\n options: execution.options,\n initialConfig: this.#context.initialConfig,\n inlineConfig: inlineConfig as DeployInlineConfig\n })\n )\n );\n\n this.context.debug(\"✔ Powerlines deploy 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(\"Finalization\");\n this.context.info(\"🏁 Powerlines finalization processes started\");\n\n this.#worker.close();\n\n this.context.debug(\"✔ Powerlines 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 * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n */\n protected constructor(context: EngineContext) {\n this.#context = context;\n }\n\n /**\n * Handle incoming IPC messages from the worker processes, routing them to the appropriate handlers based on the message type.\n *\n * @param message - The IPC message received from a worker process\n */\n private async handleIpcMessage(message: IpcMessage) {\n switch (message.type) {\n case IpcMessageType.WRITE_LOG: {\n const payload = parseWriteLogMessagePayload(message.payload);\n\n this.context.logger.debug({\n meta: {\n category: \"ipc\",\n executionId: message.executionId,\n executionIndex: message.executionIndex,\n environment: message.environment\n },\n message: `Received a \"write-log\" IPC message from worker:\nType: ${payload.meta.type}\nMessage: ${toArray(payload.message).filter(Boolean).join(\"\\n\")}`\n });\n\n await this.handleWriteLog({\n ...message,\n type: IpcMessageType.WRITE_LOG,\n payload\n });\n\n break;\n }\n\n case IpcMessageType.UPDATE_COMMAND:\n this.context.logger.debug({\n meta: {\n category: \"ipc\",\n executionId: message.executionId,\n executionIndex: message.executionIndex,\n environment: message.environment\n },\n message: `Received an \"update-command\" IPC message from worker: \\n${JSON.stringify(\n message,\n null,\n 2\n )}`\n });\n\n await this.handleUpdateCommand({\n ...message,\n type: IpcMessageType.UPDATE_COMMAND,\n payload: parseUpdateCommandMessagePayload(message.payload)\n });\n\n break;\n\n case IpcMessageType.UPDATE_HOOK:\n this.context.logger.debug({\n meta: {\n category: \"ipc\",\n executionId: message.executionId,\n executionIndex: message.executionIndex,\n environment: message.environment\n },\n message: `Received an \"update-hook\" IPC message from worker: \\n${JSON.stringify(\n message,\n null,\n 2\n )}`\n });\n\n await this.handleUpdateHook({\n ...message,\n type: IpcMessageType.UPDATE_HOOK,\n payload: parseUpdateHookMessagePayload(message.payload)\n });\n\n break;\n\n case IpcMessageType.UPDATE_PLUGIN:\n this.context.logger.debug({\n meta: {\n category: \"ipc\",\n executionId: message.executionId,\n executionIndex: message.executionIndex,\n environment: message.environment\n },\n message: `Received an \"update-plugin\" IPC message from worker: \\n${JSON.stringify(\n message,\n null,\n 2\n )}`\n });\n\n await this.handleUpdatePlugin({\n ...message,\n type: IpcMessageType.UPDATE_PLUGIN,\n payload: parseUpdatePluginMessagePayload(message.payload)\n });\n\n break;\n\n case IpcMessageType.ACTIVITY:\n case undefined:\n default: {\n break;\n }\n }\n }\n\n private async handleWriteLog(message: WriteLogIpcMessage) {\n const { payload } = message;\n\n this.context.logger.log(payload.meta.type, {\n message: toArray(payload.message).filter(Boolean).join(\"\\n\"),\n meta: {\n category: payload.meta.category,\n logId: payload.meta.logId,\n name: payload.meta.name,\n executionId: message.executionId,\n executionIndex: message.executionIndex,\n command: payload.meta.command,\n hook: payload.meta.hook,\n environment: message.environment,\n plugin: payload.meta.plugin,\n source: payload.meta.source,\n timestamp: message.timestamp,\n $$ipc: true\n }\n });\n }\n\n private async handleUpdatePlugin(_: UpdatePluginIpcMessage) {}\n\n private async handleUpdateHook(_: UpdateHookIpcMessage) {}\n\n private async handleUpdateCommand(_: UpdateCommandIpcMessage) {}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgCA,SAAgB,gBAAgB,MAA4C;CAC1E,IAAI;AACJ,KAAI,YAAY,KAAK,CACnB,WA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