@powerlines/core 0.9.1 → 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 (432) hide show
  1. package/dist/constants/api.cjs +18 -0
  2. package/dist/constants/api.d.cts +6 -0
  3. package/dist/constants/api.d.cts.map +1 -0
  4. package/dist/constants/api.d.mts +6 -0
  5. package/dist/constants/api.d.mts.map +1 -0
  6. package/dist/constants/api.mjs +16 -0
  7. package/dist/constants/api.mjs.map +1 -0
  8. package/dist/constants/commands.cjs +3 -11
  9. package/dist/constants/commands.d.cts +1 -1
  10. package/dist/constants/commands.d.cts.map +1 -1
  11. package/dist/constants/commands.d.mts +1 -1
  12. package/dist/constants/commands.d.mts.map +1 -1
  13. package/dist/constants/commands.mjs +3 -11
  14. package/dist/constants/commands.mjs.map +1 -1
  15. package/dist/constants/devtools.cjs +23 -0
  16. package/dist/constants/devtools.d.cts +13 -0
  17. package/dist/constants/devtools.d.cts.map +1 -0
  18. package/dist/constants/devtools.d.mts +13 -0
  19. package/dist/constants/devtools.d.mts.map +1 -0
  20. package/dist/constants/devtools.mjs +14 -0
  21. package/dist/constants/devtools.mjs.map +1 -0
  22. package/dist/constants/environments.cjs +1 -0
  23. package/dist/constants/extensions.cjs +21 -0
  24. package/dist/constants/extensions.d.cts +5 -0
  25. package/dist/constants/extensions.d.cts.map +1 -0
  26. package/dist/constants/extensions.d.mts +5 -0
  27. package/dist/constants/extensions.d.mts.map +1 -0
  28. package/dist/constants/extensions.mjs +20 -0
  29. package/dist/constants/extensions.mjs.map +1 -0
  30. package/dist/constants/fs.cjs +1 -0
  31. package/dist/constants/hooks.cjs +1 -0
  32. package/dist/constants/index.cjs +48 -24
  33. package/dist/constants/index.d.cts +5 -1
  34. package/dist/constants/index.d.mts +5 -1
  35. package/dist/constants/index.mjs +6 -2
  36. package/dist/constants/log-level.cjs +90 -0
  37. package/dist/constants/log-level.d.cts +63 -0
  38. package/dist/constants/log-level.d.cts.map +1 -0
  39. package/dist/constants/log-level.d.mts +63 -0
  40. package/dist/constants/log-level.d.mts.map +1 -0
  41. package/dist/constants/log-level.mjs +82 -0
  42. package/dist/constants/log-level.mjs.map +1 -0
  43. package/dist/constants/meta.cjs +1 -0
  44. package/dist/constants/plugin.cjs +3 -2
  45. package/dist/constants/plugin.d.cts +2 -2
  46. package/dist/constants/plugin.d.mts +2 -2
  47. package/dist/context/base-context.cjs +127 -0
  48. package/dist/context/base-context.d.cts +81 -0
  49. package/dist/context/base-context.d.cts.map +1 -0
  50. package/dist/context/base-context.d.mts +81 -0
  51. package/dist/context/base-context.d.mts.map +1 -0
  52. package/dist/context/base-context.mjs +125 -0
  53. package/dist/context/base-context.mjs.map +1 -0
  54. package/dist/context/context.cjs +934 -0
  55. package/dist/context/context.d.cts +369 -0
  56. package/dist/context/context.d.cts.map +1 -0
  57. package/dist/context/context.d.mts +369 -0
  58. package/dist/context/context.d.mts.map +1 -0
  59. package/dist/context/context.mjs +932 -0
  60. package/dist/context/context.mjs.map +1 -0
  61. package/dist/context/environment-context.cjs +219 -0
  62. package/dist/context/environment-context.d.cts +100 -0
  63. package/dist/context/environment-context.d.cts.map +1 -0
  64. package/dist/context/environment-context.d.mts +100 -0
  65. package/dist/context/environment-context.d.mts.map +1 -0
  66. package/dist/context/environment-context.mjs +218 -0
  67. package/dist/context/environment-context.mjs.map +1 -0
  68. package/dist/context/execution-context.cjs +230 -0
  69. package/dist/context/execution-context.d.cts +101 -0
  70. package/dist/context/execution-context.d.cts.map +1 -0
  71. package/dist/context/execution-context.d.mts +101 -0
  72. package/dist/context/execution-context.d.mts.map +1 -0
  73. package/dist/context/execution-context.mjs +228 -0
  74. package/dist/context/execution-context.mjs.map +1 -0
  75. package/dist/context/index.cjs +12 -0
  76. package/dist/context/index.d.cts +6 -0
  77. package/dist/context/index.d.mts +6 -0
  78. package/dist/context/index.mjs +7 -0
  79. package/dist/context/plugin-context.cjs +83 -0
  80. package/dist/context/plugin-context.d.cts +18 -0
  81. package/dist/context/plugin-context.d.cts.map +1 -0
  82. package/dist/context/plugin-context.d.mts +18 -0
  83. package/dist/context/plugin-context.d.mts.map +1 -0
  84. package/dist/context/plugin-context.mjs +82 -0
  85. package/dist/context/plugin-context.mjs.map +1 -0
  86. package/dist/index.cjs +62 -6
  87. package/dist/index.d.cts +23 -11
  88. package/dist/index.d.mts +23 -11
  89. package/dist/index.mjs +17 -5
  90. package/dist/lib/config.cjs +167 -28
  91. package/dist/lib/config.d.cts +95 -14
  92. package/dist/lib/config.d.cts.map +1 -1
  93. package/dist/lib/config.d.mts +95 -14
  94. package/dist/lib/config.d.mts.map +1 -1
  95. package/dist/lib/config.mjs +160 -28
  96. package/dist/lib/config.mjs.map +1 -1
  97. package/dist/lib/context-helpers.cjs +43 -0
  98. package/dist/lib/context-helpers.d.cts +19 -0
  99. package/dist/lib/context-helpers.d.cts.map +1 -0
  100. package/dist/lib/context-helpers.d.mts +19 -0
  101. package/dist/lib/context-helpers.d.mts.map +1 -0
  102. package/dist/lib/context-helpers.mjs +41 -0
  103. package/dist/lib/context-helpers.mjs.map +1 -0
  104. package/dist/lib/entry.cjs +9 -9
  105. package/dist/lib/entry.d.cts.map +1 -1
  106. package/dist/lib/entry.d.mts.map +1 -1
  107. package/dist/lib/entry.mjs +9 -9
  108. package/dist/lib/entry.mjs.map +1 -1
  109. package/dist/lib/environment.cjs +72 -0
  110. package/dist/lib/environment.d.cts +12 -0
  111. package/dist/lib/environment.d.cts.map +1 -0
  112. package/dist/lib/environment.d.mts +12 -0
  113. package/dist/lib/environment.d.mts.map +1 -0
  114. package/dist/lib/environment.mjs +67 -0
  115. package/dist/lib/environment.mjs.map +1 -0
  116. package/dist/lib/events.cjs +43 -0
  117. package/dist/lib/events.d.cts +10 -0
  118. package/dist/lib/events.d.cts.map +1 -0
  119. package/dist/lib/events.d.mts +10 -0
  120. package/dist/lib/events.d.mts.map +1 -0
  121. package/dist/lib/events.mjs +42 -0
  122. package/dist/lib/events.mjs.map +1 -0
  123. package/dist/lib/generate-types.cjs +371 -0
  124. package/dist/lib/generate-types.d.cts +67 -0
  125. package/dist/lib/generate-types.d.cts.map +1 -0
  126. package/dist/lib/generate-types.d.mts +67 -0
  127. package/dist/lib/generate-types.d.mts.map +1 -0
  128. package/dist/lib/generate-types.mjs +368 -0
  129. package/dist/lib/generate-types.mjs.map +1 -0
  130. package/dist/lib/hooks.cjs +152 -0
  131. package/dist/lib/hooks.d.cts +28 -0
  132. package/dist/lib/hooks.d.cts.map +1 -0
  133. package/dist/lib/hooks.d.mts +28 -0
  134. package/dist/lib/hooks.d.mts.map +1 -0
  135. package/dist/lib/hooks.mjs +147 -0
  136. package/dist/lib/hooks.mjs.map +1 -0
  137. package/dist/lib/index.cjs +64 -6
  138. package/dist/lib/index.d.cts +15 -3
  139. package/dist/lib/index.d.mts +15 -3
  140. package/dist/lib/index.mjs +19 -5
  141. package/dist/lib/install-dependencies.cjs +25 -0
  142. package/dist/lib/install-dependencies.d.cts +12 -0
  143. package/dist/lib/install-dependencies.d.cts.map +1 -0
  144. package/dist/lib/install-dependencies.d.mts +12 -0
  145. package/dist/lib/install-dependencies.d.mts.map +1 -0
  146. package/dist/lib/install-dependencies.mjs +24 -0
  147. package/dist/lib/install-dependencies.mjs.map +1 -0
  148. package/dist/lib/meta.cjs +57 -0
  149. package/dist/lib/meta.d.cts +34 -0
  150. package/dist/lib/meta.d.cts.map +1 -0
  151. package/dist/lib/meta.d.mts +34 -0
  152. package/dist/lib/meta.d.mts.map +1 -0
  153. package/dist/lib/meta.mjs +54 -0
  154. package/dist/lib/meta.mjs.map +1 -0
  155. package/dist/lib/plugins.cjs +150 -0
  156. package/dist/lib/plugins.d.cts +40 -0
  157. package/dist/lib/plugins.d.cts.map +1 -0
  158. package/dist/lib/plugins.d.mts +40 -0
  159. package/dist/lib/plugins.d.mts.map +1 -0
  160. package/dist/lib/plugins.mjs +146 -0
  161. package/dist/lib/plugins.mjs.map +1 -0
  162. package/dist/lib/resolver.cjs +35 -0
  163. package/dist/lib/resolver.d.cts +21 -0
  164. package/dist/lib/resolver.d.cts.map +1 -0
  165. package/dist/lib/resolver.d.mts +21 -0
  166. package/dist/lib/resolver.d.mts.map +1 -0
  167. package/dist/lib/resolver.mjs +33 -0
  168. package/dist/lib/resolver.mjs.map +1 -0
  169. package/dist/lib/schemas.cjs +9 -0
  170. package/dist/lib/schemas.d.cts +2 -0
  171. package/dist/lib/schemas.d.mts +2 -0
  172. package/dist/lib/schemas.mjs +3 -0
  173. package/dist/lib/streaming-channel.cjs +260 -0
  174. package/dist/lib/streaming-channel.d.cts +133 -0
  175. package/dist/lib/streaming-channel.d.cts.map +1 -0
  176. package/dist/lib/streaming-channel.d.mts +133 -0
  177. package/dist/lib/streaming-channel.d.mts.map +1 -0
  178. package/dist/lib/streaming-channel.mjs +258 -0
  179. package/dist/lib/streaming-channel.mjs.map +1 -0
  180. package/dist/lib/typescript/index.cjs +16 -0
  181. package/dist/lib/typescript/index.d.cts +3 -0
  182. package/dist/lib/typescript/index.d.mts +3 -0
  183. package/dist/lib/typescript/index.mjs +4 -0
  184. package/dist/lib/typescript/ts-morph.cjs +105 -0
  185. package/dist/lib/typescript/ts-morph.d.cts +38 -0
  186. package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
  187. package/dist/lib/typescript/ts-morph.d.mts +38 -0
  188. package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
  189. package/dist/lib/typescript/ts-morph.mjs +102 -0
  190. package/dist/lib/typescript/ts-morph.mjs.map +1 -0
  191. package/dist/lib/typescript/tsconfig.cjs +253 -0
  192. package/dist/lib/typescript/tsconfig.d.cts +77 -0
  193. package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
  194. package/dist/lib/typescript/tsconfig.d.mts +77 -0
  195. package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
  196. package/dist/lib/typescript/tsconfig.mjs +240 -0
  197. package/dist/lib/typescript/tsconfig.mjs.map +1 -0
  198. package/dist/lib/unplugin/helpers.cjs +2 -2
  199. package/dist/lib/unplugin/module-resolution.cjs +21 -20
  200. package/dist/lib/unplugin/module-resolution.d.cts +8 -0
  201. package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
  202. package/dist/lib/unplugin/module-resolution.d.mts +8 -0
  203. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
  204. package/dist/lib/unplugin/module-resolution.mjs +20 -20
  205. package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
  206. package/dist/lib/unplugin/plugin.cjs +57 -63
  207. package/dist/lib/unplugin/plugin.d.cts +11 -5
  208. package/dist/lib/unplugin/plugin.d.cts.map +1 -1
  209. package/dist/lib/unplugin/plugin.d.mts +11 -5
  210. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  211. package/dist/lib/unplugin/plugin.mjs +57 -63
  212. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  213. package/dist/lib/utilities/file-header.cjs +2 -2
  214. package/dist/lib/utilities/file-header.mjs +2 -2
  215. package/dist/lib/utilities/file-header.mjs.map +1 -1
  216. package/dist/lib/utilities/format.cjs +16 -8
  217. package/dist/lib/utilities/format.d.cts.map +1 -1
  218. package/dist/lib/utilities/format.d.mts.map +1 -1
  219. package/dist/lib/utilities/format.mjs +15 -8
  220. package/dist/lib/utilities/format.mjs.map +1 -1
  221. package/dist/lib/utilities/index.cjs +2 -2
  222. package/dist/lib/utilities/index.mjs +2 -2
  223. package/dist/lib/utilities/source-file.cjs +1 -1
  224. package/dist/lib/utilities/source-map.cjs +1 -1
  225. package/dist/lib/utilities/write-file.cjs +1 -2
  226. package/dist/lib/utilities/write-file.d.cts +1 -1
  227. package/dist/lib/utilities/write-file.d.cts.map +1 -1
  228. package/dist/lib/utilities/write-file.d.mts +1 -1
  229. package/dist/lib/utilities/write-file.d.mts.map +1 -1
  230. package/dist/lib/utilities/write-file.mjs +1 -2
  231. package/dist/lib/utilities/write-file.mjs.map +1 -1
  232. package/dist/lib/vfs.cjs +1104 -0
  233. package/dist/lib/vfs.d.cts +321 -0
  234. package/dist/lib/vfs.d.cts.map +1 -0
  235. package/dist/lib/vfs.d.mts +321 -0
  236. package/dist/lib/vfs.d.mts.map +1 -0
  237. package/dist/lib/vfs.mjs +1102 -0
  238. package/dist/lib/vfs.mjs.map +1 -0
  239. package/dist/plugin-base.cjs +5 -9
  240. package/dist/plugin-base.mjs +5 -9
  241. package/dist/plugin-base.mjs.map +1 -1
  242. package/dist/plugin-utils/build-helpers.cjs +2 -2
  243. package/dist/plugin-utils/build-helpers.mjs +2 -2
  244. package/dist/plugin-utils/build-helpers.mjs.map +1 -1
  245. package/dist/plugin-utils/combine-plugins.d.cts +7 -8
  246. package/dist/plugin-utils/combine-plugins.d.cts.map +1 -1
  247. package/dist/plugin-utils/combine-plugins.d.mts +7 -8
  248. package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
  249. package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
  250. package/dist/plugin-utils/context-helpers.cjs +29 -16
  251. package/dist/plugin-utils/context-helpers.d.cts +10 -2
  252. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  253. package/dist/plugin-utils/context-helpers.d.mts +10 -2
  254. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  255. package/dist/plugin-utils/context-helpers.mjs +29 -17
  256. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  257. package/dist/plugin-utils/docs-helper.cjs +17 -0
  258. package/dist/plugin-utils/docs-helper.d.cts +11 -0
  259. package/dist/plugin-utils/docs-helper.d.cts.map +1 -0
  260. package/dist/plugin-utils/docs-helper.d.mts +11 -0
  261. package/dist/plugin-utils/docs-helper.d.mts.map +1 -0
  262. package/dist/plugin-utils/docs-helper.mjs +16 -0
  263. package/dist/plugin-utils/docs-helper.mjs.map +1 -0
  264. package/dist/plugin-utils/extend.mjs.map +1 -1
  265. package/dist/plugin-utils/filter.cjs +101 -0
  266. package/dist/plugin-utils/filter.d.cts +16 -0
  267. package/dist/plugin-utils/filter.d.cts.map +1 -0
  268. package/dist/plugin-utils/filter.d.mts +16 -0
  269. package/dist/plugin-utils/filter.d.mts.map +1 -0
  270. package/dist/plugin-utils/filter.mjs +91 -0
  271. package/dist/plugin-utils/filter.mjs.map +1 -0
  272. package/dist/plugin-utils/format-package-json.cjs +1 -1
  273. package/dist/plugin-utils/format-package-json.mjs +1 -1
  274. package/dist/plugin-utils/format-package-json.mjs.map +1 -1
  275. package/dist/plugin-utils/format.cjs +44 -0
  276. package/dist/plugin-utils/format.d.cts +11 -0
  277. package/dist/plugin-utils/format.d.cts.map +1 -0
  278. package/dist/plugin-utils/format.d.mts +11 -0
  279. package/dist/plugin-utils/format.d.mts.map +1 -0
  280. package/dist/plugin-utils/format.mjs +43 -0
  281. package/dist/plugin-utils/format.mjs.map +1 -0
  282. package/dist/plugin-utils/get-config-path.cjs +34 -32
  283. package/dist/plugin-utils/get-config-path.d.cts +4 -1
  284. package/dist/plugin-utils/get-config-path.d.cts.map +1 -1
  285. package/dist/plugin-utils/get-config-path.d.mts +4 -1
  286. package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
  287. package/dist/plugin-utils/get-config-path.mjs +34 -32
  288. package/dist/plugin-utils/get-config-path.mjs.map +1 -1
  289. package/dist/plugin-utils/helpers.cjs +25 -10
  290. package/dist/plugin-utils/helpers.d.cts +31 -24
  291. package/dist/plugin-utils/helpers.d.cts.map +1 -1
  292. package/dist/plugin-utils/helpers.d.mts +31 -24
  293. package/dist/plugin-utils/helpers.d.mts.map +1 -1
  294. package/dist/plugin-utils/helpers.mjs +22 -8
  295. package/dist/plugin-utils/helpers.mjs.map +1 -1
  296. package/dist/plugin-utils/index.cjs +48 -4
  297. package/dist/plugin-utils/index.d.cts +9 -3
  298. package/dist/plugin-utils/index.d.mts +9 -3
  299. package/dist/plugin-utils/index.mjs +11 -5
  300. package/dist/plugin-utils/install.cjs +47 -0
  301. package/dist/plugin-utils/install.d.cts +23 -0
  302. package/dist/plugin-utils/install.d.cts.map +1 -0
  303. package/dist/plugin-utils/install.d.mts +23 -0
  304. package/dist/plugin-utils/install.d.mts.map +1 -0
  305. package/dist/plugin-utils/install.mjs +45 -0
  306. package/dist/plugin-utils/install.mjs.map +1 -0
  307. package/dist/plugin-utils/logging.cjs +605 -0
  308. package/dist/plugin-utils/logging.d.cts +111 -0
  309. package/dist/plugin-utils/logging.d.cts.map +1 -0
  310. package/dist/plugin-utils/logging.d.mts +111 -0
  311. package/dist/plugin-utils/logging.d.mts.map +1 -0
  312. package/dist/plugin-utils/logging.mjs +588 -0
  313. package/dist/plugin-utils/logging.mjs.map +1 -0
  314. package/dist/plugin-utils/merge.cjs +4 -4
  315. package/dist/plugin-utils/merge.d.cts +0 -1
  316. package/dist/plugin-utils/merge.d.cts.map +1 -1
  317. package/dist/plugin-utils/merge.d.mts.map +1 -1
  318. package/dist/plugin-utils/merge.mjs +3 -3
  319. package/dist/plugin-utils/merge.mjs.map +1 -1
  320. package/dist/plugin-utils/modules.cjs +1 -1
  321. package/dist/plugin-utils/modules.mjs +1 -1
  322. package/dist/plugin-utils/modules.mjs.map +1 -1
  323. package/dist/plugin-utils/paths.cjs +18 -4
  324. package/dist/plugin-utils/paths.d.cts +12 -2
  325. package/dist/plugin-utils/paths.d.cts.map +1 -1
  326. package/dist/plugin-utils/paths.d.mts +12 -2
  327. package/dist/plugin-utils/paths.d.mts.map +1 -1
  328. package/dist/plugin-utils/paths.mjs +18 -4
  329. package/dist/plugin-utils/paths.mjs.map +1 -1
  330. package/dist/plugin-utils/virtual.cjs +80 -0
  331. package/dist/plugin-utils/virtual.d.cts +69 -0
  332. package/dist/plugin-utils/virtual.d.cts.map +1 -0
  333. package/dist/plugin-utils/virtual.d.mts +69 -0
  334. package/dist/plugin-utils/virtual.d.mts.map +1 -0
  335. package/dist/plugin-utils/virtual.mjs +73 -0
  336. package/dist/plugin-utils/virtual.mjs.map +1 -0
  337. package/dist/schemas/fs.cjs +232 -0
  338. package/dist/schemas/fs.d.cts +127 -0
  339. package/dist/schemas/fs.d.cts.map +1 -0
  340. package/dist/schemas/fs.d.mts +127 -0
  341. package/dist/schemas/fs.d.mts.map +1 -0
  342. package/dist/schemas/fs.mjs +226 -0
  343. package/dist/schemas/fs.mjs.map +1 -0
  344. package/dist/storage/base.cjs +216 -0
  345. package/dist/storage/base.d.cts +201 -0
  346. package/dist/storage/base.d.cts.map +1 -0
  347. package/dist/storage/base.d.mts +201 -0
  348. package/dist/storage/base.d.mts.map +1 -0
  349. package/dist/storage/base.mjs +215 -0
  350. package/dist/storage/base.mjs.map +1 -0
  351. package/dist/storage/file-system.cjs +180 -0
  352. package/dist/storage/file-system.d.cts +129 -0
  353. package/dist/storage/file-system.d.cts.map +1 -0
  354. package/dist/storage/file-system.d.mts +129 -0
  355. package/dist/storage/file-system.d.mts.map +1 -0
  356. package/dist/storage/file-system.mjs +179 -0
  357. package/dist/storage/file-system.mjs.map +1 -0
  358. package/dist/storage/helpers.cjs +37 -0
  359. package/dist/storage/helpers.d.cts +25 -0
  360. package/dist/storage/helpers.d.cts.map +1 -0
  361. package/dist/storage/helpers.d.mts +25 -0
  362. package/dist/storage/helpers.d.mts.map +1 -0
  363. package/dist/storage/helpers.mjs +34 -0
  364. package/dist/storage/helpers.mjs.map +1 -0
  365. package/dist/storage/index.cjs +12 -0
  366. package/dist/storage/index.d.cts +5 -0
  367. package/dist/storage/index.d.mts +5 -0
  368. package/dist/storage/index.mjs +6 -0
  369. package/dist/storage/virtual.cjs +98 -0
  370. package/dist/storage/virtual.d.cts +80 -0
  371. package/dist/storage/virtual.d.cts.map +1 -0
  372. package/dist/storage/virtual.d.mts +80 -0
  373. package/dist/storage/virtual.d.mts.map +1 -0
  374. package/dist/storage/virtual.mjs +97 -0
  375. package/dist/storage/virtual.mjs.map +1 -0
  376. package/dist/types/api.d.cts +18 -99
  377. package/dist/types/api.d.cts.map +1 -1
  378. package/dist/types/api.d.mts +18 -99
  379. package/dist/types/api.d.mts.map +1 -1
  380. package/dist/types/config.d.cts +239 -141
  381. package/dist/types/config.d.cts.map +1 -1
  382. package/dist/types/config.d.mts +240 -142
  383. package/dist/types/config.d.mts.map +1 -1
  384. package/dist/types/context.d.cts +228 -117
  385. package/dist/types/context.d.cts.map +1 -1
  386. package/dist/types/context.d.mts +231 -120
  387. package/dist/types/context.d.mts.map +1 -1
  388. package/dist/types/fs.d.cts +49 -5
  389. package/dist/types/fs.d.cts.map +1 -1
  390. package/dist/types/fs.d.mts +50 -6
  391. package/dist/types/fs.d.mts.map +1 -1
  392. package/dist/types/hooks.d.cts +26 -38
  393. package/dist/types/hooks.d.cts.map +1 -1
  394. package/dist/types/hooks.d.mts +26 -38
  395. package/dist/types/hooks.d.mts.map +1 -1
  396. package/dist/types/index.d.cts +9 -0
  397. package/dist/types/index.d.mts +8 -8
  398. package/dist/types/logging.d.cts +161 -0
  399. package/dist/types/logging.d.cts.map +1 -0
  400. package/dist/types/logging.d.mts +161 -0
  401. package/dist/types/logging.d.mts.map +1 -0
  402. package/dist/types/plugin.d.cts +23 -24
  403. package/dist/types/plugin.d.cts.map +1 -1
  404. package/dist/types/plugin.d.mts +23 -24
  405. package/dist/types/plugin.d.mts.map +1 -1
  406. package/dist/types/tsconfig.d.cts +15 -12
  407. package/dist/types/tsconfig.d.cts.map +1 -1
  408. package/dist/types/tsconfig.d.mts +16 -13
  409. package/dist/types/tsconfig.d.mts.map +1 -1
  410. package/dist/types/unplugin.d.cts +10 -23
  411. package/dist/types/unplugin.d.cts.map +1 -1
  412. package/dist/types/unplugin.d.mts +10 -23
  413. package/dist/types/unplugin.d.mts.map +1 -1
  414. package/package.json +270 -425
  415. package/schemas/fs.capnp +42 -0
  416. package/dist/lib/logger.cjs +0 -59
  417. package/dist/lib/logger.d.cts +0 -23
  418. package/dist/lib/logger.d.cts.map +0 -1
  419. package/dist/lib/logger.d.mts +0 -23
  420. package/dist/lib/logger.d.mts.map +0 -1
  421. package/dist/lib/logger.mjs +0 -56
  422. package/dist/lib/logger.mjs.map +0 -1
  423. package/dist/types/_internal.cjs +0 -0
  424. package/dist/types/_internal.d.cts +0 -106
  425. package/dist/types/_internal.d.cts.map +0 -1
  426. package/dist/types/_internal.d.mts +0 -106
  427. package/dist/types/_internal.d.mts.map +0 -1
  428. package/dist/types/_internal.mjs +0 -1
  429. package/dist/types/commands.d.cts +0 -13
  430. package/dist/types/commands.d.cts.map +0 -1
  431. package/dist/types/commands.d.mts +0 -13
  432. package/dist/types/commands.d.mts.map +0 -1
@@ -0,0 +1,161 @@
1
+ import { LOG_CATEGORIES, LOG_LEVELS } from "../constants/log-level.cjs";
2
+ import { Mode } from "./config.cjs";
3
+ import { PartialKeys, RequiredKeys } from "@stryke/types/base";
4
+ import { UnpluginMessage } from "unplugin";
5
+
6
+ //#region src/types/logging.d.ts
7
+ type LogLevel = (typeof LOG_LEVELS)[number];
8
+ type LogCategory = (typeof LOG_CATEGORIES)[number];
9
+ interface LogMeta {
10
+ /**
11
+ * A unique identifier for the log message, which can be used to correlate related log entries across different parts of the system or different executions.
12
+ */
13
+ logId: string;
14
+ /**
15
+ * The log level of the message, which indicates the severity or importance of the log entry. The log level can be used to filter log messages based on their importance, allowing users to focus on critical issues or relevant information while ignoring less important messages.
16
+ */
17
+ type: LogLevel;
18
+ /**
19
+ * The category of the log message, which can be used to classify and filter log entries based on their purpose or origin.
20
+ */
21
+ category: LogCategory;
22
+ /**
23
+ * The timestamp when the RPC message was created, represented as the number of milliseconds since the Unix epoch.
24
+ */
25
+ timestamp: number;
26
+ /**
27
+ * The name of the project or package associated with the log message, which can be used to identify the source of the log entry and provide context for the message.
28
+ */
29
+ name?: string;
30
+ /**
31
+ * A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
32
+ */
33
+ executionId?: string;
34
+ /**
35
+ * The zero-based index of the current execution within the sequence of executions in the same process.
36
+ */
37
+ configIndex?: number;
38
+ /**
39
+ * Optional command identifier to specify the command or task associated with the log message, which can be used to provide additional context about the operation being performed when the log entry was generated.
40
+ */
41
+ command?: string;
42
+ /**
43
+ * Optional hook name to specify the plugin hook associated with the log message, which can be used to provide additional context about the specific plugin hook being executed when the log entry was generated.
44
+ */
45
+ hook?: string;
46
+ /**
47
+ * Optional environment identifier to specify the context or environment in which the message is being processed.
48
+ */
49
+ environment?: string;
50
+ /**
51
+ * Optional plugin name to specify the source plugin of the log message.
52
+ */
53
+ plugin?: string;
54
+ /**
55
+ * The name of the logger or source of the log message, which can be used to identify the origin of the log entry.
56
+ */
57
+ source?: string;
58
+ /**
59
+ * Indicates whether the log message is related to inter-process communication (IPC).
60
+ *
61
+ * @internal
62
+ */
63
+ $$ipc?: boolean;
64
+ }
65
+ type LogFnOptions = Omit<Partial<LogMeta>, "logId" | "timestamp" | "name" | "type"> & {
66
+ mode?: Mode;
67
+ logLevel?: LogLevelUserConfig;
68
+ };
69
+ type LogFnMeta = LogLevel | PartialKeys<LogMeta, "logId" | "timestamp" | "name" | "category">;
70
+ type LogFn = (meta: LogFnMeta, message: string) => void;
71
+ type LoggerMeta = PartialKeys<Omit<LogMeta, "type">, "logId" | "timestamp" | "name" | "category">;
72
+ type LoggerOptions = Omit<LoggerMeta, "logId" | "timestamp" | "type"> & {
73
+ mode?: Mode;
74
+ logLevel?: LogLevelUserConfig;
75
+ };
76
+ interface PowerlinesMessage<TMeta> extends UnpluginMessage {
77
+ meta: TMeta;
78
+ error?: Error;
79
+ }
80
+ type LogMessage = PowerlinesMessage<Partial<LogMeta>>;
81
+ /**
82
+ * A type representing a log message that can be passed to the logging methods defined in the {@link Logger} interface, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link Logger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in the logging implementation.
83
+ */
84
+ type LoggerMessage = PowerlinesMessage<LoggerMeta>;
85
+ /**
86
+ * An internal interface representing a logger instance used within Powerlines for logging messages at various log levels, including "error", "warn", "info", "debug", and "trace". This interface defines methods for logging messages at each log level, which accept a message parameter that can be either a string or an object containing the log metadata and message content. The logger instance also includes an options property that contains the configuration options used for the logger, such as the source, command, environment, plugin, log level, and other relevant metadata. This interface is intended for internal use within Powerlines and is not meant to be implemented by users directly; instead, users can provide a custom logger that implements the {@link CustomLogger} interface to integrate with Powerlines' logging system.
87
+ */
88
+ interface Logger {
89
+ options: LoggerOptions;
90
+ error: (message: string | LoggerMessage | Error) => void;
91
+ warn: (message: string | LoggerMessage) => void;
92
+ info: (message: string | LoggerMessage) => void;
93
+ debug: (message: string | LoggerMessage) => void;
94
+ trace: (message: string | LoggerMessage) => void;
95
+ log: (type: LogLevel, message: string | LoggerMessage) => void;
96
+ }
97
+ /**
98
+ * A type representing a log message that can be passed to a custom logger, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link CustomLogger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in their custom logging implementation.
99
+ */
100
+ type CustomLoggerMessage = PowerlinesMessage<Omit<LogMeta, "type">>;
101
+ /**
102
+ * An interface representing a custom logger that can be provided by the user to override the default logging behavior of Powerlines. This interface defines methods for logging messages at different log levels, including "error", "warn", "info", "debug", and "trace". Each method accepts a message parameter, which can be either a string or an object containing the log metadata and message content. By implementing this interface, users can integrate their own logging system with Powerlines or customize the logging behavior to suit their specific needs.
103
+ */
104
+ interface CustomLogger {
105
+ /**
106
+ * A function to log messages at the "error" level, which indicates a serious issue that has caused a failure in the build process or a critical problem that needs immediate attention.
107
+ *
108
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the error being reported.
109
+ * @returns void
110
+ */
111
+ error?: (message: CustomLoggerMessage) => void;
112
+ /**
113
+ * A function to log messages at the "warn" level, which indicates a potential issue or a situation that may require attention but does not necessarily cause a failure in the build process.
114
+ *
115
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the warning being reported.
116
+ * @returns void
117
+ */
118
+ warn?: (message: CustomLoggerMessage) => void;
119
+ /**
120
+ * A function to log messages at the "info" level, which indicates general informational messages about the build process, such as the start and completion of tasks, configuration details, or other relevant information that may be useful for monitoring the build process.
121
+ *
122
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the informational message being reported.
123
+ * @returns void
124
+ */
125
+ info?: (message: CustomLoggerMessage) => void;
126
+ /**
127
+ * A function to log messages at the "debug" level, which indicates detailed debugging information that may be useful for diagnosing issues during development or troubleshooting problems in the build process.
128
+ *
129
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the debug information being reported.
130
+ * @returns void
131
+ */
132
+ debug?: (message: CustomLoggerMessage) => void;
133
+ /**
134
+ * A function to log messages at the "trace" level, which indicates very detailed tracing information that may be useful for in-depth analysis of the build process or for tracking the flow of execution through various stages of the build.
135
+ *
136
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the trace information being reported.
137
+ * @returns void
138
+ */
139
+ trace?: (message: CustomLoggerMessage) => void;
140
+ }
141
+ type LogLevelUserConfig = LogLevel | RequiredKeys<Partial<Record<LogCategory, LogLevel | boolean | undefined>>, "general">;
142
+ type LogLevelResolvedConfig = Record<LogCategory, LogLevel>;
143
+ declare type __ΩLogLevel = any[];
144
+ declare type __ΩLogCategory = any[];
145
+ declare type __ΩLogMeta = any[];
146
+ declare type __ΩLogFnOptions = any[];
147
+ declare type __ΩLogFnMeta = any[];
148
+ declare type __ΩLogFn = any[];
149
+ declare type __ΩLoggerMeta = any[];
150
+ declare type __ΩLoggerOptions = any[];
151
+ declare type __ΩPowerlinesMessage = any[];
152
+ declare type __ΩLogMessage = any[];
153
+ declare type __ΩLoggerMessage = any[];
154
+ declare type __ΩLogger = any[];
155
+ declare type __ΩCustomLoggerMessage = any[];
156
+ declare type __ΩCustomLogger = any[];
157
+ declare type __ΩLogLevelUserConfig = any[];
158
+ declare type __ΩLogLevelResolvedConfig = any[];
159
+ //#endregion
160
+ export { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage };
161
+ //# sourceMappingURL=logging.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.cts","names":[],"sources":["../../src/types/logging.ts"],"mappings":";;;;;;KAuBY,QAAA,WAAmB,UAAA;AAAA,KAEnB,WAAA,WAAsB,cAAA;AAAA,UAEjB,OAAA;EAJG;;;EAQlB,KAAA;EANU;;;EAUV,IAAA,EAAM,QAAA;EAVwC;AAEhD;;EAYE,QAAA,EAAU,WAAA;EAAW;;;EAIrB,SAAA;EAJA;;;EAQA,IAAA;EAIA;;;EAAA,WAAA;EAgBA;;;EAZA,WAAA;EA0BK;;AAGP;EAzBE,OAAA;;;;EAIA,IAAA;EAyBO;;;EArBP,WAAA;EAiByB;;;EAbzB,MAAA;EAiBO;;;EAbP,MAAA;EAc6B;AAG/B;;;;EAXE,KAAA;AAAA;AAAA,KAGU,YAAA,GAAe,IAAA,CACzB,OAAA,CAAQ,OAAA;EAGR,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,KAGD,SAAA,GACR,QAAA,GACA,WAAA,CAAY,OAAA;AAAA,KAEJ,KAAA,IAAS,IAAA,EAAM,SAAA,EAAW,OAAA;AAAA,KAE1B,UAAA,GAAa,WAAA,CACvB,IAAA,CAAK,OAAA;AAAA,KAIK,aAAA,GAAgB,IAAA,CAAK,UAAA;EAC/B,IAAA,GAAO,IAAA;EACP,QAAA,GAAW,kBAAA;AAAA;AAAA,UAGI,iBAAA,gBAAiC,eAAA;EAChD,IAAA,EAAM,KAAA;EACN,KAAA,GAAQ,KAAA;AAAA;AAAA,KAGE,UAAA,GAAa,iBAAA,CAAkB,OAAA,CAAQ,OAAA;AAfnD;;;AAAA,KAoBY,aAAA,GAAgB,iBAAA,CAAkB,UAAA;;;;UAK7B,MAAA;EACf,OAAA,EAAS,aAAA;EACT,KAAA,GAAQ,OAAA,WAAkB,aAAA,GAAgB,KAAA;EAC1C,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,IAAA,GAAO,OAAA,WAAkB,aAAA;EACzB,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,KAAA,GAAQ,OAAA,WAAkB,aAAA;EAC1B,GAAA,GAAM,IAAA,EAAM,QAAA,EAAU,OAAA,WAAkB,aAAA;AAAA;;;;KAM9B,mBAAA,GAAsB,iBAAA,CAAkB,IAAA,CAAK,OAAA;;;;UAKxC,YAAA;EArCf;;;;;;EA4CA,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxCc;;;;;;EA+ChC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EA/CgB;;;;;;EAsDjC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EApDJ;AAGf;;;;;EAwDE,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxDsB;;;;;;EA+DxC,KAAA,IAAS,OAAA,EAAS,mBAAA;AAAA;AAAA,KAGR,kBAAA,GACR,QAAA,GACA,YAAA,CACE,OAAA,CAAQ,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA,KAItB,sBAAA,GAAyB,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA"}
@@ -0,0 +1,161 @@
1
+ import { LOG_CATEGORIES, LOG_LEVELS } from "../constants/log-level.mjs";
2
+ import { Mode } from "./config.mjs";
3
+ import { UnpluginMessage } from "unplugin";
4
+ import { PartialKeys, RequiredKeys } from "@stryke/types/base";
5
+
6
+ //#region src/types/logging.d.ts
7
+ type LogLevel = (typeof LOG_LEVELS)[number];
8
+ type LogCategory = (typeof LOG_CATEGORIES)[number];
9
+ interface LogMeta {
10
+ /**
11
+ * A unique identifier for the log message, which can be used to correlate related log entries across different parts of the system or different executions.
12
+ */
13
+ logId: string;
14
+ /**
15
+ * The log level of the message, which indicates the severity or importance of the log entry. The log level can be used to filter log messages based on their importance, allowing users to focus on critical issues or relevant information while ignoring less important messages.
16
+ */
17
+ type: LogLevel;
18
+ /**
19
+ * The category of the log message, which can be used to classify and filter log entries based on their purpose or origin.
20
+ */
21
+ category: LogCategory;
22
+ /**
23
+ * The timestamp when the RPC message was created, represented as the number of milliseconds since the Unix epoch.
24
+ */
25
+ timestamp: number;
26
+ /**
27
+ * The name of the project or package associated with the log message, which can be used to identify the source of the log entry and provide context for the message.
28
+ */
29
+ name?: string;
30
+ /**
31
+ * A unique identifier for the current execution instance, which can be used for logging and other purposes to distinguish between different executions in the same process.
32
+ */
33
+ executionId?: string;
34
+ /**
35
+ * The zero-based index of the current execution within the sequence of executions in the same process.
36
+ */
37
+ configIndex?: number;
38
+ /**
39
+ * Optional command identifier to specify the command or task associated with the log message, which can be used to provide additional context about the operation being performed when the log entry was generated.
40
+ */
41
+ command?: string;
42
+ /**
43
+ * Optional hook name to specify the plugin hook associated with the log message, which can be used to provide additional context about the specific plugin hook being executed when the log entry was generated.
44
+ */
45
+ hook?: string;
46
+ /**
47
+ * Optional environment identifier to specify the context or environment in which the message is being processed.
48
+ */
49
+ environment?: string;
50
+ /**
51
+ * Optional plugin name to specify the source plugin of the log message.
52
+ */
53
+ plugin?: string;
54
+ /**
55
+ * The name of the logger or source of the log message, which can be used to identify the origin of the log entry.
56
+ */
57
+ source?: string;
58
+ /**
59
+ * Indicates whether the log message is related to inter-process communication (IPC).
60
+ *
61
+ * @internal
62
+ */
63
+ $$ipc?: boolean;
64
+ }
65
+ type LogFnOptions = Omit<Partial<LogMeta>, "logId" | "timestamp" | "name" | "type"> & {
66
+ mode?: Mode;
67
+ logLevel?: LogLevelUserConfig;
68
+ };
69
+ type LogFnMeta = LogLevel | PartialKeys<LogMeta, "logId" | "timestamp" | "name" | "category">;
70
+ type LogFn = (meta: LogFnMeta, message: string) => void;
71
+ type LoggerMeta = PartialKeys<Omit<LogMeta, "type">, "logId" | "timestamp" | "name" | "category">;
72
+ type LoggerOptions = Omit<LoggerMeta, "logId" | "timestamp" | "type"> & {
73
+ mode?: Mode;
74
+ logLevel?: LogLevelUserConfig;
75
+ };
76
+ interface PowerlinesMessage<TMeta> extends UnpluginMessage {
77
+ meta: TMeta;
78
+ error?: Error;
79
+ }
80
+ type LogMessage = PowerlinesMessage<Partial<LogMeta>>;
81
+ /**
82
+ * A type representing a log message that can be passed to the logging methods defined in the {@link Logger} interface, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link Logger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in the logging implementation.
83
+ */
84
+ type LoggerMessage = PowerlinesMessage<LoggerMeta>;
85
+ /**
86
+ * An internal interface representing a logger instance used within Powerlines for logging messages at various log levels, including "error", "warn", "info", "debug", and "trace". This interface defines methods for logging messages at each log level, which accept a message parameter that can be either a string or an object containing the log metadata and message content. The logger instance also includes an options property that contains the configuration options used for the logger, such as the source, command, environment, plugin, log level, and other relevant metadata. This interface is intended for internal use within Powerlines and is not meant to be implemented by users directly; instead, users can provide a custom logger that implements the {@link CustomLogger} interface to integrate with Powerlines' logging system.
87
+ */
88
+ interface Logger {
89
+ options: LoggerOptions;
90
+ error: (message: string | LoggerMessage | Error) => void;
91
+ warn: (message: string | LoggerMessage) => void;
92
+ info: (message: string | LoggerMessage) => void;
93
+ debug: (message: string | LoggerMessage) => void;
94
+ trace: (message: string | LoggerMessage) => void;
95
+ log: (type: LogLevel, message: string | LoggerMessage) => void;
96
+ }
97
+ /**
98
+ * A type representing a log message that can be passed to a custom logger, which includes the log metadata and message content. This type is used as the parameter for the logging methods defined in the {@link CustomLogger} interface, allowing users to log messages with rich metadata that can be used for filtering, formatting, or other purposes in their custom logging implementation.
99
+ */
100
+ type CustomLoggerMessage = PowerlinesMessage<Omit<LogMeta, "type">>;
101
+ /**
102
+ * An interface representing a custom logger that can be provided by the user to override the default logging behavior of Powerlines. This interface defines methods for logging messages at different log levels, including "error", "warn", "info", "debug", and "trace". Each method accepts a message parameter, which can be either a string or an object containing the log metadata and message content. By implementing this interface, users can integrate their own logging system with Powerlines or customize the logging behavior to suit their specific needs.
103
+ */
104
+ interface CustomLogger {
105
+ /**
106
+ * A function to log messages at the "error" level, which indicates a serious issue that has caused a failure in the build process or a critical problem that needs immediate attention.
107
+ *
108
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the error being reported.
109
+ * @returns void
110
+ */
111
+ error?: (message: CustomLoggerMessage) => void;
112
+ /**
113
+ * A function to log messages at the "warn" level, which indicates a potential issue or a situation that may require attention but does not necessarily cause a failure in the build process.
114
+ *
115
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the warning being reported.
116
+ * @returns void
117
+ */
118
+ warn?: (message: CustomLoggerMessage) => void;
119
+ /**
120
+ * A function to log messages at the "info" level, which indicates general informational messages about the build process, such as the start and completion of tasks, configuration details, or other relevant information that may be useful for monitoring the build process.
121
+ *
122
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the informational message being reported.
123
+ * @returns void
124
+ */
125
+ info?: (message: CustomLoggerMessage) => void;
126
+ /**
127
+ * A function to log messages at the "debug" level, which indicates detailed debugging information that may be useful for diagnosing issues during development or troubleshooting problems in the build process.
128
+ *
129
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the debug information being reported.
130
+ * @returns void
131
+ */
132
+ debug?: (message: CustomLoggerMessage) => void;
133
+ /**
134
+ * A function to log messages at the "trace" level, which indicates very detailed tracing information that may be useful for in-depth analysis of the build process or for tracking the flow of execution through various stages of the build.
135
+ *
136
+ * @param message - The log message to be recorded, which can be a string or an object containing the log metadata and message content. The log message should provide sufficient information to understand the context and nature of the trace information being reported.
137
+ * @returns void
138
+ */
139
+ trace?: (message: CustomLoggerMessage) => void;
140
+ }
141
+ type LogLevelUserConfig = LogLevel | RequiredKeys<Partial<Record<LogCategory, LogLevel | boolean | undefined>>, "general">;
142
+ type LogLevelResolvedConfig = Record<LogCategory, LogLevel>;
143
+ declare type __ΩLogLevel = any[];
144
+ declare type __ΩLogCategory = any[];
145
+ declare type __ΩLogMeta = any[];
146
+ declare type __ΩLogFnOptions = any[];
147
+ declare type __ΩLogFnMeta = any[];
148
+ declare type __ΩLogFn = any[];
149
+ declare type __ΩLoggerMeta = any[];
150
+ declare type __ΩLoggerOptions = any[];
151
+ declare type __ΩPowerlinesMessage = any[];
152
+ declare type __ΩLogMessage = any[];
153
+ declare type __ΩLoggerMessage = any[];
154
+ declare type __ΩLogger = any[];
155
+ declare type __ΩCustomLoggerMessage = any[];
156
+ declare type __ΩCustomLogger = any[];
157
+ declare type __ΩLogLevelUserConfig = any[];
158
+ declare type __ΩLogLevelResolvedConfig = any[];
159
+ //#endregion
160
+ export { CustomLogger, CustomLoggerMessage, LogCategory, LogFn, LogFnMeta, LogFnOptions, LogLevel, LogLevelResolvedConfig, LogLevelUserConfig, LogMessage, LogMeta, Logger, LoggerMessage, LoggerMeta, LoggerOptions, PowerlinesMessage, __ΩCustomLogger, __ΩCustomLoggerMessage, __ΩLogCategory, __ΩLogFn, __ΩLogFnMeta, __ΩLogFnOptions, __ΩLogLevel, __ΩLogLevelResolvedConfig, __ΩLogLevelUserConfig, __ΩLogMessage, __ΩLogMeta, __ΩLogger, __ΩLoggerMessage, __ΩLoggerMeta, __ΩLoggerOptions, __ΩPowerlinesMessage };
161
+ //# sourceMappingURL=logging.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.mts","names":[],"sources":["../../src/types/logging.ts"],"mappings":";;;;;;KAuBY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AAA,EAAM,QAAA,EAAU,OAAA,WAAkB,aAAA;AAAA;;;;KAM9B,mBAAA,GAAsB,iBAAA,CAAkB,IAAA,CAAK,OAAA;;;;UAKxC,YAAA;EArCf;;;;;;EA4CA,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxCc;;;;;;EA+ChC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EA/CgB;;;;;;EAsDjC,IAAA,IAAQ,OAAA,EAAS,mBAAA;EApDJ;AAGf;;;;;EAwDE,KAAA,IAAS,OAAA,EAAS,mBAAA;EAxDsB;;;;;;EA+DxC,KAAA,IAAS,OAAA,EAAS,mBAAA;AAAA;AAAA,KAGR,kBAAA,GACR,QAAA,GACA,YAAA,CACE,OAAA,CAAQ,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA,KAItB,sBAAA,GAAyB,MAAA,CAAO,WAAA,EAAa,QAAA;AAAA"}
@@ -1,8 +1,8 @@
1
- import { KNOWN_PLUGIN_FIELDS, PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.cjs";
2
- import { CommandType } from "./commands.cjs";
3
- import { BuilderVariant, InferUnpluginOptions, UnpluginBuilderVariant } from "./unplugin.cjs";
1
+ import { PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.cjs";
2
+ import { BaseCommandType } from "./api.cjs";
3
+ import { UnpluginBuilderVariant, UnpluginOptions as UnpluginOptions$1 } from "./unplugin.cjs";
4
4
  import { BuildPluginContext, PluginContext, ResolveResult, UnresolvedContext } from "./context.cjs";
5
- import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.cjs";
5
+ import { EnvironmentConfig, PluginConfig, ResolvedEnvironmentConfig } from "./config.cjs";
6
6
  import { AnyFunction, MaybePromise } from "@stryke/types/base";
7
7
  import { HookFilter, TransformResult } from "unplugin";
8
8
  import { ArrayValues } from "@stryke/types/array";
@@ -60,7 +60,7 @@ interface Hooks<TContext extends PluginContext> {
60
60
  * @param environment - The Vite-like environment object containing information about the current build environment.
61
61
  * @returns A promise that resolves when the hook is complete.
62
62
  */
63
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
+ configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
64
64
  /**
65
65
  * A hook that is called when the plugin is resolved.
66
66
  *
@@ -129,14 +129,16 @@ interface Hooks<TContext extends PluginContext> {
129
129
  */
130
130
  writeBundle: (this: TContext) => MaybePromise<void>;
131
131
  }
132
- type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
133
- type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
134
- transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
135
- load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
136
- resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
137
- };
132
+ type HookFunctions<TContext extends PluginContext> = { [TCommandType in BaseCommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
138
133
  type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
139
- type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
134
+ type InferPluginHookFunction<TContext extends PluginContext, TKey extends string> = TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? PluginHook<HookFunctions<TContext>[TKey], TKey & keyof HookFilter> : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: InferPluginHookFunction<TContext, `${TKey}:${K & string}`> } : never : never;
135
+ type PluginHooks<TContext extends PluginContext> = { [TKey in keyof HookFunctions<TContext>]?: InferPluginHookFunction<TContext, TKey> } & {
136
+ types?: PluginHook<HookFunctions<TContext>["types"], never>;
137
+ transform?: PluginHook<HookFunctions<TContext>["transform"], "code" | "id">;
138
+ load?: PluginHook<HookFunctions<TContext>["load"], "id">;
139
+ resolveId?: PluginHook<HookFunctions<TContext>["resolveId"], "id">;
140
+ };
141
+ interface BasePlugin<TContext extends PluginContext> {
140
142
  /**
141
143
  * The name of the plugin, for use in deduplication, error messages and logs.
142
144
  */
@@ -174,16 +176,13 @@ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<Resol
174
176
  * @returns `true` if the two plugins are the same, `false` otherwise.
175
177
  */
176
178
  dedupe?: false | ((other: Plugin<any>) => boolean);
177
- /**
178
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
179
- */
180
179
  /**
181
180
  * Define environments where this plugin should be active. By default, the plugin is active in all environments.
182
181
  *
183
182
  * @param environment - The environment to check.
184
183
  * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
185
184
  */
186
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
+ applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
187
186
  /**
188
187
  * A function that returns configuration options to be merged with the build context's options.
189
188
  *
@@ -198,21 +197,21 @@ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<Resol
198
197
  * @param config - The partial configuration object to be modified.
199
198
  * @returns A promise that resolves to a partial configuration object.
200
199
  */
201
- config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
202
- } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
203
- type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> | UnpluginBuilderVariant;
204
- type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
205
- type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;
200
+ config?: PluginHook<(this: UnresolvedContext<TContext["config"], TContext["system"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
201
+ }
202
+ type Plugin<TContext extends PluginContext> = Partial<PluginHooks<TContext>> & BasePlugin<TContext> & Pick<UnpluginOptions$1<TContext>, UnpluginBuilderVariant>;
203
+ type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>;
204
+ type PluginHookFields<TContext extends PluginContext = PluginContext, TKey extends string = string> = TKey extends ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> ? never : TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? TKey : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: `${TKey}:${K & string}` }[keyof HookFunctions<TContext>[TKey]] : never : never;
206
205
  declare type __ΩPluginHookObject = any[];
207
206
  declare type __ΩPluginHook = any[];
208
207
  declare type __ΩTypesResult = any[];
209
208
  declare type __ΩHooks = any[];
210
- declare type __ΩPluginHookFunctions = any[];
209
+ declare type __ΩHookFunctions = any[];
211
210
  declare type __ΩPluginHooks = any[];
211
+ declare type __ΩBasePlugin = any[];
212
212
  declare type __ΩPlugin = any[];
213
213
  declare type __ΩPluginNonHookFields = any[];
214
214
  declare type __ΩPluginHookFields = any[];
215
- declare type __ΩPluginFields = any[];
216
215
  //#endregion
217
- export { Hooks, Plugin, PluginFields, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩHooks, __ΩPlugin, __ΩPluginFields, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
216
+ export { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
218
217
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;UA0CiB,gBAAA,uBACO,WAAA,wBACA,UAAA;EAFP;;;EAOf,KAAA;EALsB;;;EAUtB,MAAA,GAAS,IAAA,CAAK,UAAA,EAAY,OAAA;EAKjB;;;EAAT,OAAA,EAAS,aAAA;AAAA;AAAA,KAGC,UAAA,uBACY,WAAA,wBACA,UAAA,YACpB,aAAA,GAAgB,gBAAA,CAAiB,aAAA,EAAe,OAAA;;;;UAKnC,WAAA;EACf,UAAA;EACA,IAAA;AAAA;AAAA,UAGe,KAAA,kBAAuB,aAAA;EAhBhB;;AAGxB;;;;;;;;;;;;EA4BE,MAAA,GACE,IAAA,EAAM,iBAAA,CAAkB,QAAA,gBACrB,YAAA,CAAa,aAAA,CAAY,QAAA,cAAsB,MAAA;EA5BpD;;;;;;;;AAMF;;;;;EAqCE,iBAAA,GACE,IAAA,EAAM,QAAA,EACN,IAAA,UACA,WAAA,EAAa,iBAAA,KACV,YAAA,CAAa,OAAA,CAAQ,yBAAA;EApCN;;;;;;;;EA8CpB,cAAA,GAAiB,IAAA,EAAM,QAAA,KAAa,YAAA;EAb5B;;;;;;;EAsBR,KAAA,GACE,IAAA,EAAM,QAAA,EACN,IAAA,aACG,YAAA,CAAa,WAAA;EAAA;;;;;;EAQlB,UAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,QAAA,cAAsB,QAAA,KAC5C,YAAA;EASG;;;;;;EADR,QAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,QAAA,cAAsB,QAAA,KAC5C,YAAA;EAcA;;;;;;;;EAJL,SAAA,GACE,IAAA,EAAM,kBAAA,CAAmB,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IELDS } from "../constants/plugin.mjs";
2
- import { CommandType } from "./commands.mjs";
3
- import { BuilderVariant, InferUnpluginOptions, UnpluginBuilderVariant } from "./unplugin.mjs";
1
+ import { PLUGIN_NON_HOOK_FIELDS } from "../constants/plugin.mjs";
2
+ import { BaseCommandType } from "./api.mjs";
3
+ import { UnpluginBuilderVariant, UnpluginOptions as UnpluginOptions$1 } from "./unplugin.mjs";
4
4
  import { BuildPluginContext, PluginContext, ResolveResult, UnresolvedContext } from "./context.mjs";
5
- import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.mjs";
5
+ import { EnvironmentConfig, PluginConfig, ResolvedEnvironmentConfig } from "./config.mjs";
6
6
  import { HookFilter, TransformResult } from "unplugin";
7
7
  import { AnyFunction, MaybePromise } from "@stryke/types/base";
8
8
  import { ArrayValues } from "@stryke/types/array";
@@ -60,7 +60,7 @@ interface Hooks<TContext extends PluginContext> {
60
60
  * @param environment - The Vite-like environment object containing information about the current build environment.
61
61
  * @returns A promise that resolves when the hook is complete.
62
62
  */
63
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
+ configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<ResolvedEnvironmentConfig> | undefined | null>;
64
64
  /**
65
65
  * A hook that is called when the plugin is resolved.
66
66
  *
@@ -129,14 +129,16 @@ interface Hooks<TContext extends PluginContext> {
129
129
  */
130
130
  writeBundle: (this: TContext) => MaybePromise<void>;
131
131
  }
132
- type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
133
- type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
134
- transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
135
- load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
136
- resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
137
- };
132
+ type HookFunctions<TContext extends PluginContext> = { [TCommandType in BaseCommandType]: (this: TContext) => MaybePromise<void> } & Hooks<TContext>;
138
133
  type DeepPartial$1<T> = { [K in keyof T]?: DeepPartial$1<T[K]> };
139
- type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
134
+ type InferPluginHookFunction<TContext extends PluginContext, TKey extends string> = TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? PluginHook<HookFunctions<TContext>[TKey], TKey & keyof HookFilter> : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: InferPluginHookFunction<TContext, `${TKey}:${K & string}`> } : never : never;
135
+ type PluginHooks<TContext extends PluginContext> = { [TKey in keyof HookFunctions<TContext>]?: InferPluginHookFunction<TContext, TKey> } & {
136
+ types?: PluginHook<HookFunctions<TContext>["types"], never>;
137
+ transform?: PluginHook<HookFunctions<TContext>["transform"], "code" | "id">;
138
+ load?: PluginHook<HookFunctions<TContext>["load"], "id">;
139
+ resolveId?: PluginHook<HookFunctions<TContext>["resolveId"], "id">;
140
+ };
141
+ interface BasePlugin<TContext extends PluginContext> {
140
142
  /**
141
143
  * The name of the plugin, for use in deduplication, error messages and logs.
142
144
  */
@@ -174,16 +176,13 @@ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<Resol
174
176
  * @returns `true` if the two plugins are the same, `false` otherwise.
175
177
  */
176
178
  dedupe?: false | ((other: Plugin<any>) => boolean);
177
- /**
178
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
179
- */
180
179
  /**
181
180
  * Define environments where this plugin should be active. By default, the plugin is active in all environments.
182
181
  *
183
182
  * @param environment - The environment to check.
184
183
  * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
185
184
  */
186
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
+ applyToEnvironment?: (environment: ResolvedEnvironmentConfig) => boolean | PluginConfig<any>;
187
186
  /**
188
187
  * A function that returns configuration options to be merged with the build context's options.
189
188
  *
@@ -198,21 +197,21 @@ type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<Resol
198
197
  * @param config - The partial configuration object to be modified.
199
198
  * @returns A promise that resolves to a partial configuration object.
200
199
  */
201
- config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
202
- } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
203
- type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> | UnpluginBuilderVariant;
204
- type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
205
- type PluginFields = ArrayValues<typeof KNOWN_PLUGIN_FIELDS>;
200
+ config?: PluginHook<(this: UnresolvedContext<TContext["config"], TContext["system"]>) => MaybePromise<DeepPartial$1<TContext["config"]> & Record<string, any>>> | (DeepPartial$1<TContext["config"]> & Record<string, any>);
201
+ }
202
+ type Plugin<TContext extends PluginContext> = Partial<PluginHooks<TContext>> & BasePlugin<TContext> & Pick<UnpluginOptions$1<TContext>, UnpluginBuilderVariant>;
203
+ type PluginNonHookFields = ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS>;
204
+ type PluginHookFields<TContext extends PluginContext = PluginContext, TKey extends string = string> = TKey extends ArrayValues<typeof PLUGIN_NON_HOOK_FIELDS> ? never : TKey extends keyof HookFunctions<TContext> ? HookFunctions<TContext>[TKey] extends AnyFunction ? TKey : HookFunctions<TContext>[TKey] extends object ? { [K in keyof HookFunctions<TContext>[TKey]]?: `${TKey}:${K & string}` }[keyof HookFunctions<TContext>[TKey]] : never : never;
206
205
  declare type __ΩPluginHookObject = any[];
207
206
  declare type __ΩPluginHook = any[];
208
207
  declare type __ΩTypesResult = any[];
209
208
  declare type __ΩHooks = any[];
210
- declare type __ΩPluginHookFunctions = any[];
209
+ declare type __ΩHookFunctions = any[];
211
210
  declare type __ΩPluginHooks = any[];
211
+ declare type __ΩBasePlugin = any[];
212
212
  declare type __ΩPlugin = any[];
213
213
  declare type __ΩPluginNonHookFields = any[];
214
214
  declare type __ΩPluginHookFields = any[];
215
- declare type __ΩPluginFields = any[];
216
215
  //#endregion
217
- export { Hooks, Plugin, PluginFields, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩHooks, __ΩPlugin, __ΩPluginFields, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookFunctions, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
216
+ export { BasePlugin, HookFunctions, Hooks, Plugin, PluginHook, PluginHookFields, PluginHookObject, PluginHooks, PluginNonHookFields, TypesResult, __ΩBasePlugin, __ΩHookFunctions, __ΩHooks, __ΩPlugin, __ΩPluginHook, __ΩPluginHookFields, __ΩPluginHookObject, __ΩPluginHooks, __ΩPluginNonHookFields, __ΩTypesResult };
218
217
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;;;;UA0CiB,gBAAA,uBACO,WAAA,wBACA,UAAA;EAFP;;;EAOf,KAAA;EALsB;;;EAUtB,MAAA,GAAS,IAAA,CAAK,UAAA,EAAY,OAAA;EAKjB;;;EAAT,OAAA,EAAS,aAAA;AAAA;AAAA,KAGC,UAAA,uBACY,WAAA,wBACA,UAAA,YACpB,aAAA,GAAgB,gBAAA,CAAiB,aAAA,EAAe,OAAA;;;;UAKnC,WAAA;EACf,UAAA;EACA,IAAA;AAAA;AAAA,UAGe,KAAA,kBAAuB,aAAA;EAhBhB;;AAGxB;;;;;;;;;;;;EA4BE,MA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