@ultrst-armada/krnl 1.0.1 → 1.0.3

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 (235) hide show
  1. package/README.md +67 -65
  2. package/package.json +13 -9
  3. package/packages/cli/dist/bin/krnl.cjs +1535 -9508
  4. package/packages/cli/dist/bin/krnl.js +55 -1915
  5. package/packages/cli/dist/chunk-6SHSECXR.js +1628 -0
  6. package/packages/cli/dist/index.cjs +1244 -7373
  7. package/packages/cli/dist/index.d.cts +45 -2
  8. package/packages/cli/dist/index.d.ts +45 -2
  9. package/packages/cli/dist/index.js +5 -20
  10. package/packages/cli/package.json +17 -10
  11. package/packages/core/dist/index.cjs +3039 -141
  12. package/packages/core/dist/index.d.cts +633 -27
  13. package/packages/core/dist/index.d.ts +633 -27
  14. package/packages/core/dist/index.js +3028 -139
  15. package/packages/core/package.json +15 -7
  16. package/packages/create-krnl/dist/index.cjs +322 -316
  17. package/packages/create-krnl/dist/index.js +322 -316
  18. package/packages/create-krnl/package.json +5 -3
  19. package/packages/eslint-plugin/dist/index.cjs +17 -55
  20. package/packages/eslint-plugin/dist/index.d.cts +8 -43
  21. package/packages/eslint-plugin/dist/index.d.ts +8 -43
  22. package/packages/eslint-plugin/dist/index.js +17 -55
  23. package/packages/eslint-plugin/package.json +5 -4
  24. package/packages/validate/dist/index.cjs +692 -361
  25. package/packages/validate/dist/index.d.cts +12 -14
  26. package/packages/validate/dist/index.d.ts +12 -14
  27. package/packages/validate/dist/index.js +692 -361
  28. package/packages/validate/package.json +14 -7
  29. package/packages/cli/dist/K_ENT_Entity-PQ5MURQY-ZG6FZXXX.js +0 -13
  30. package/packages/cli/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-K4CRQYA5.js +0 -8
  31. package/packages/cli/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-LNPXZYOE.js +0 -110
  32. package/packages/cli/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-3ALZPNX4.js +0 -11
  33. package/packages/cli/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-PJTICYSW.js +0 -11
  34. package/packages/cli/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-M5TYU55O.js +0 -8
  35. package/packages/cli/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-H6STOXRK.js +0 -20
  36. package/packages/cli/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-XPJXSF7D.js +0 -19
  37. package/packages/cli/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-CUYGTWOW.js +0 -7
  38. package/packages/cli/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-VR6T4N6J.js +0 -17
  39. package/packages/cli/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-RLJ4QWDP.js +0 -58
  40. package/packages/cli/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-BOQGUASC.js +0 -22
  41. package/packages/cli/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-XJI7KIT5.js +0 -8
  42. package/packages/cli/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-K5VCWAFW.js +0 -9
  43. package/packages/cli/dist/chunk-3TRM6CYL.js +0 -152
  44. package/packages/cli/dist/chunk-5JDK35TG.js +0 -3872
  45. package/packages/cli/dist/chunk-63PTK33I.js +0 -997
  46. package/packages/cli/dist/chunk-6NIKAMUZ.js +0 -82
  47. package/packages/cli/dist/chunk-BOXWWXQG.js +0 -400
  48. package/packages/cli/dist/chunk-EEKLK7QJ.js +0 -565
  49. package/packages/cli/dist/chunk-EG7T2IAD.js +0 -107
  50. package/packages/cli/dist/chunk-F5EHXE2O.js +0 -1036
  51. package/packages/cli/dist/chunk-F65ANSQG.js +0 -269
  52. package/packages/cli/dist/chunk-FDNCADFE.js +0 -71
  53. package/packages/cli/dist/chunk-GDLRMDAN.js +0 -127
  54. package/packages/cli/dist/chunk-HWMTCMOS.js +0 -656
  55. package/packages/cli/dist/chunk-I74QIQOD.js +0 -5536
  56. package/packages/cli/dist/chunk-JTLSTO25.js +0 -71
  57. package/packages/cli/dist/chunk-JULBBJ27.js +0 -1033
  58. package/packages/cli/dist/chunk-OHVMVRBP.js +0 -117
  59. package/packages/cli/dist/chunk-P2PCLEKX.js +0 -666
  60. package/packages/cli/dist/chunk-PJQIUOX2.js +0 -7767
  61. package/packages/cli/dist/chunk-PPOF3DJW.js +0 -471
  62. package/packages/cli/dist/chunk-Q45257P6.js +0 -173
  63. package/packages/cli/dist/chunk-QNROWGBI.js +0 -1036
  64. package/packages/cli/dist/chunk-RJNYUXZD.js +0 -977
  65. package/packages/cli/dist/chunk-SRTOPJ5W.js +0 -104
  66. package/packages/cli/dist/chunk-TCEX3MPS.js +0 -702
  67. package/packages/cli/dist/chunk-TNOAJO2J.js +0 -675
  68. package/packages/cli/dist/chunk-UR2SUCSF.js +0 -701
  69. package/packages/cli/dist/chunk-X5LOIFM7.js +0 -68
  70. package/packages/cli/dist/chunk-XIRFOO3H.js +0 -589
  71. package/packages/cli/dist/chunk-ZAAV3JXQ.js +0 -809
  72. package/packages/core/dist/K_ENT_Entity-4MB7CU4A.js +0 -12
  73. package/packages/core/dist/K_ENT_Entity-DEJGIDGH.js +0 -12
  74. package/packages/core/dist/K_ENT_Entity-FXZO5UZ2.js +0 -12
  75. package/packages/core/dist/K_ENT_Entity-HDSCXC5F.js +0 -12
  76. package/packages/core/dist/K_ENT_Entity-JILABHLW.js +0 -12
  77. package/packages/core/dist/K_ENT_Entity-PQ5MURQY.js +0 -13
  78. package/packages/core/dist/K_ENT_Entity-ROAKDIHW.js +0 -12
  79. package/packages/core/dist/K_ENT_Entity-TBVFSKDV.js +0 -12
  80. package/packages/core/dist/K_ENT_Entity-ZFLKG3JO.js +0 -12
  81. package/packages/core/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW.js +0 -8
  82. package/packages/core/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF.js +0 -110
  83. package/packages/core/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF.js +0 -9
  84. package/packages/core/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X.js +0 -9
  85. package/packages/core/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW.js +0 -8
  86. package/packages/core/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2.js +0 -20
  87. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-4C6GBQAG.js +0 -18
  88. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-6V23A6F6.js +0 -18
  89. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK.js +0 -19
  90. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-DYLLC5G2.js +0 -18
  91. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-F4FOFAUP.js +0 -18
  92. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-FBOXXMI3.js +0 -18
  93. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-Q73BWLNP.js +0 -18
  94. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QM2C4MVA.js +0 -18
  95. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QUGI6SMP.js +0 -18
  96. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RGMTBHNP.js +0 -18
  97. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RWR7UNDW.js +0 -18
  98. package/packages/core/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7.js +0 -7
  99. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-32MFJJ5Z.js +0 -17
  100. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-4J4CEWRY.js +0 -17
  101. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-A366YHF2.js +0 -17
  102. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-LK4LYJHI.js +0 -17
  103. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU.js +0 -17
  104. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-NW3K63II.js +0 -17
  105. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-QDHTI5ZV.js +0 -17
  106. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-VHCT6VIW.js +0 -17
  107. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-WBRKF24R.js +0 -17
  108. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-XKYQYT6Q.js +0 -17
  109. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-Z2PWZYDZ.js +0 -17
  110. package/packages/core/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5.js +0 -58
  111. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-2EZU7QF4.js +0 -21
  112. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-6G3AQNAV.js +0 -21
  113. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-B2NZMQUG.js +0 -21
  114. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-C2RABMZP.js +0 -21
  115. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-HHE3NZ4F.js +0 -21
  116. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-LHFGR6WK.js +0 -21
  117. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-M74BLM3N.js +0 -21
  118. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-PT6ZA6EA.js +0 -21
  119. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-SP52V3CX.js +0 -21
  120. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF.js +0 -22
  121. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-YNSEUHJJ.js +0 -21
  122. package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-M6SBHIVA.js +0 -8
  123. package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG.js +0 -8
  124. package/packages/core/dist/K_LIB_Krnl_Telemetry-77FRZ3KV.js +0 -9
  125. package/packages/core/dist/chunk-33L2J7V7.js +0 -82
  126. package/packages/core/dist/chunk-3ES4K2ZP.js +0 -817
  127. package/packages/core/dist/chunk-3SMHVVLL.js +0 -82
  128. package/packages/core/dist/chunk-3UEZ7JQA.js +0 -4877
  129. package/packages/core/dist/chunk-3XIE6KBD.js +0 -4877
  130. package/packages/core/dist/chunk-46ZLCML6.js +0 -107
  131. package/packages/core/dist/chunk-4UEL3DWJ.js +0 -107
  132. package/packages/core/dist/chunk-54GWZ5PC.js +0 -82
  133. package/packages/core/dist/chunk-6QCYRS5L.js +0 -127
  134. package/packages/core/dist/chunk-6ULMHNXR.js +0 -104
  135. package/packages/core/dist/chunk-7WUETJEV.js +0 -117
  136. package/packages/core/dist/chunk-A5KRAYDB.js +0 -107
  137. package/packages/core/dist/chunk-ANEAZ3PO.js +0 -107
  138. package/packages/core/dist/chunk-BE76RL6F.js +0 -82
  139. package/packages/core/dist/chunk-CIARVYDO.js +0 -107
  140. package/packages/core/dist/chunk-CR2ANE62.js +0 -107
  141. package/packages/core/dist/chunk-DI27MOR7.js +0 -173
  142. package/packages/core/dist/chunk-E6RLFHM5.js +0 -596
  143. package/packages/core/dist/chunk-EELAPMNV.js +0 -4877
  144. package/packages/core/dist/chunk-ENZ2RQVJ.js +0 -107
  145. package/packages/core/dist/chunk-F2U6CX4F.js +0 -4877
  146. package/packages/core/dist/chunk-FKG64OHL.js +0 -82
  147. package/packages/core/dist/chunk-FYAZJYM5.js +0 -772
  148. package/packages/core/dist/chunk-G4NP4RDQ.js +0 -82
  149. package/packages/core/dist/chunk-GADIRLRS.js +0 -473
  150. package/packages/core/dist/chunk-GR6CSLQJ.js +0 -772
  151. package/packages/core/dist/chunk-HDS7AT6O.js +0 -772
  152. package/packages/core/dist/chunk-HIMEZUU2.js +0 -71
  153. package/packages/core/dist/chunk-IB4UHG5I.js +0 -596
  154. package/packages/core/dist/chunk-J7ZYNVRS.js +0 -772
  155. package/packages/core/dist/chunk-JVLZU4K7.js +0 -604
  156. package/packages/core/dist/chunk-JYXXI7Q3.js +0 -82
  157. package/packages/core/dist/chunk-K54K2KZW.js +0 -192
  158. package/packages/core/dist/chunk-K6VHLBNH.js +0 -3316
  159. package/packages/core/dist/chunk-KCBP7ZYA.js +0 -596
  160. package/packages/core/dist/chunk-KFQGP6VL.js +0 -33
  161. package/packages/core/dist/chunk-KIUEUI7K.js +0 -82
  162. package/packages/core/dist/chunk-LB67NIZP.js +0 -949
  163. package/packages/core/dist/chunk-LDTYFUNW.js +0 -596
  164. package/packages/core/dist/chunk-MLVWARD4.js +0 -596
  165. package/packages/core/dist/chunk-MPYVXHKO.js +0 -2777
  166. package/packages/core/dist/chunk-MRQ3MITU.js +0 -772
  167. package/packages/core/dist/chunk-MVUN7I7O.js +0 -107
  168. package/packages/core/dist/chunk-NDDOIRW7.js +0 -596
  169. package/packages/core/dist/chunk-O3KDB5MH.js +0 -3330
  170. package/packages/core/dist/chunk-OEINUDSE.js +0 -400
  171. package/packages/core/dist/chunk-OPDENPT4.js +0 -4877
  172. package/packages/core/dist/chunk-P6XEM2LA.js +0 -429
  173. package/packages/core/dist/chunk-QKMRSQV4.js +0 -82
  174. package/packages/core/dist/chunk-R6CCWALL.js +0 -4877
  175. package/packages/core/dist/chunk-RAMMOO73.js +0 -774
  176. package/packages/core/dist/chunk-S3FTZFG6.js +0 -772
  177. package/packages/core/dist/chunk-T2ZVN434.js +0 -4877
  178. package/packages/core/dist/chunk-TFHLDMIA.js +0 -107
  179. package/packages/core/dist/chunk-TI3QUCIJ.js +0 -107
  180. package/packages/core/dist/chunk-TR2BAIGI.js +0 -107
  181. package/packages/core/dist/chunk-UGVVJKC6.js +0 -4877
  182. package/packages/core/dist/chunk-V2DX7YIU.js +0 -984
  183. package/packages/core/dist/chunk-W4IHYUYD.js +0 -772
  184. package/packages/core/dist/chunk-W6WBG5OY.js +0 -4877
  185. package/packages/core/dist/chunk-WN3M7O7H.js +0 -3312
  186. package/packages/core/dist/chunk-WR3NCU7U.js +0 -4877
  187. package/packages/core/dist/chunk-XC6B6L27.js +0 -82
  188. package/packages/core/dist/chunk-XNSE64ZY.js +0 -3316
  189. package/packages/core/dist/chunk-XROES2WN.js +0 -634
  190. package/packages/core/dist/chunk-XSCKNRCZ.js +0 -5020
  191. package/packages/core/dist/chunk-XVABPAUZ.js +0 -82
  192. package/packages/core/dist/chunk-YOBCB5C5.js +0 -596
  193. package/packages/core/dist/chunk-YUK6Q563.js +0 -666
  194. package/packages/core/dist/chunk-YXGL3ZEU.js +0 -1030
  195. package/packages/core/dist/chunk-ZINJ5OUX.js +0 -596
  196. package/packages/core/dist/chunk-ZPFD4BIQ.js +0 -604
  197. package/packages/core/dist/chunk-ZQZBFG6F.js +0 -4826
  198. package/packages/core/dist/chunk-ZZFRJGXM.js +0 -4877
  199. package/packages/create-krnl/dist/K_ENT_Entity-PQ5MURQY-R2OH4VXE.js +0 -14
  200. package/packages/create-krnl/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-AZM5HF4M.js +0 -9
  201. package/packages/create-krnl/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-X5N6SV2S.js +0 -111
  202. package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-5PFHF4JU.js +0 -12
  203. package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-ED33OQPH.js +0 -12
  204. package/packages/create-krnl/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-YGQLVR4P.js +0 -9
  205. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-VM7CTU2L.js +0 -21
  206. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-Y2GQFJ7I.js +0 -21
  207. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-L3JQWO54.js +0 -8
  208. package/packages/create-krnl/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-KQARASPR.js +0 -19
  209. package/packages/create-krnl/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-OF3IGLVL.js +0 -59
  210. package/packages/create-krnl/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-JOLHKOEX.js +0 -24
  211. package/packages/create-krnl/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-L46LSHKQ.js +0 -10
  212. package/packages/create-krnl/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-4JUPRR3X.js +0 -10
  213. package/packages/create-krnl/dist/chunk-3TRM6CYL.js +0 -152
  214. package/packages/create-krnl/dist/chunk-3URCB3QS.js +0 -127
  215. package/packages/create-krnl/dist/chunk-5JDK35TG.js +0 -3872
  216. package/packages/create-krnl/dist/chunk-A2XAXDOW.js +0 -812
  217. package/packages/create-krnl/dist/chunk-AN6TMQHG.js +0 -1033
  218. package/packages/create-krnl/dist/chunk-BOXWWXQG.js +0 -400
  219. package/packages/create-krnl/dist/chunk-BPTBREBG.js +0 -38
  220. package/packages/create-krnl/dist/chunk-FDNCADFE.js +0 -71
  221. package/packages/create-krnl/dist/chunk-JTLSTO25.js +0 -71
  222. package/packages/create-krnl/dist/chunk-M3NCUIPL.js +0 -107
  223. package/packages/create-krnl/dist/chunk-N2EONSOC.js +0 -7769
  224. package/packages/create-krnl/dist/chunk-OHVMVRBP.js +0 -117
  225. package/packages/create-krnl/dist/chunk-Q45257P6.js +0 -173
  226. package/packages/create-krnl/dist/chunk-QGM4M3NI.js +0 -37
  227. package/packages/create-krnl/dist/chunk-RJNYUXZD.js +0 -977
  228. package/packages/create-krnl/dist/chunk-SRTOPJ5W.js +0 -104
  229. package/packages/create-krnl/dist/chunk-UPBIGEC3.js +0 -666
  230. package/packages/create-krnl/dist/chunk-V2DB7UD7.js +0 -82
  231. package/packages/create-krnl/dist/chunk-WMHLIUI6.js +0 -3644
  232. package/packages/create-krnl/dist/chunk-XIRFOO3H.js +0 -589
  233. package/packages/create-krnl/dist/chunk-Y2CEEVZP.js +0 -5536
  234. package/packages/create-krnl/dist/main-DXUMPBND.js +0 -2217
  235. package/packages/create-krnl/dist/wrapper-SDF2VKX3.js +0 -31
@@ -24,367 +24,373 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  ));
25
25
 
26
26
  // src/index.ts
27
- var fs = __toESM(require("fs"), 1);
28
- var path = __toESM(require("path"), 1);
29
- var import_krnl_core = require("@dinilmusick/krnl-core");
30
- var rawArg = process.argv[2] || "my-krnl-app";
31
- var targetDir = path.resolve(process.cwd(), rawArg);
32
- var projectName = path.basename(targetDir);
33
- console.log(`
34
- \u{1F680} [create-krnl] Scaffolding new Krnl project with symmetric backend/frontend planes in: ${targetDir}
35
- `);
36
- if (fs.existsSync(targetDir)) {
37
- console.error(`\u274C Directory "${projectName}" already exists.`);
38
- process.exit(1);
39
- }
40
- fs.mkdirSync(targetDir, { recursive: true });
41
- var bLibDir = path.join(targetDir, "krnl", "backend", "libraries", "AppConcepts");
42
- var bEntityDir = path.join(targetDir, "krnl", "backend", "entities", "App");
43
- var bFuncDir = path.join(targetDir, "krnl", "backend", "functionalities", "Hello");
44
- fs.mkdirSync(path.join(bLibDir, "tests"), { recursive: true });
45
- fs.mkdirSync(path.join(bEntityDir, "orchestrations"), { recursive: true });
46
- fs.mkdirSync(path.join(bEntityDir, "tests"), { recursive: true });
47
- fs.mkdirSync(path.join(bFuncDir, "main_function"), { recursive: true });
48
- fs.mkdirSync(path.join(bFuncDir, "state_data"), { recursive: true });
49
- fs.mkdirSync(path.join(bFuncDir, "helper_functions"), { recursive: true });
50
- fs.mkdirSync(path.join(bFuncDir, "events"), { recursive: true });
51
- fs.mkdirSync(path.join(bFuncDir, "tests"), { recursive: true });
52
- var fLibDir = path.join(targetDir, "krnl", "frontend", "libraries", "ButtonConcepts");
53
- var fEntityDir = path.join(targetDir, "krnl", "frontend", "entities", "App");
54
- var fFuncDir = path.join(targetDir, "krnl", "frontend", "functionalities", "Hello");
55
- fs.mkdirSync(path.join(fLibDir, "tests"), { recursive: true });
56
- fs.mkdirSync(path.join(fEntityDir, "tests"), { recursive: true });
57
- fs.mkdirSync(path.join(fFuncDir, "tests"), { recursive: true });
58
- fs.mkdirSync(path.join(targetDir, "docs"), { recursive: true });
59
- fs.mkdirSync(path.join(targetDir, ".skipo"), { recursive: true });
60
- fs.writeFileSync(path.join(targetDir, "package.json"), JSON.stringify({
61
- name: projectName,
62
- version: "1.0.0",
63
- description: "Full-stack application powered by Krnl symmetric architecture",
64
- type: "module",
65
- main: "dist/index.js",
66
- scripts: {
67
- dev: "krnl dev",
68
- build: "krnl build",
69
- validate: "krnl validate",
70
- test: "vitest run",
71
- sync: "krnl sync"
72
- },
73
- dependencies: {
74
- "@dinilmusick/krnl": "^1.0.0",
75
- "@dinilmusick/krnl-core": "^1.0.0",
76
- "@dinilmusick/krnl-ui": "^1.0.0"
77
- },
78
- devDependencies: {
79
- "@dinilmusick/krnl-cli": "^1.0.0",
80
- "@dinilmusick/krnl-validate": "^1.0.0",
81
- "@dinilmusick/eslint-plugin-krnl": "^1.0.0",
82
- "typescript": "^5.7.3",
83
- "vitest": "^1.6.0"
84
- }
85
- }, null, 2));
86
- fs.writeFileSync(path.join(targetDir, "tsconfig.json"), JSON.stringify({
87
- compilerOptions: {
88
- target: "ESNext",
89
- module: "NodeNext",
90
- moduleResolution: "NodeNext",
91
- lib: ["ESNext", "DOM"],
92
- jsx: "react-jsx",
93
- strict: true,
94
- outDir: "./dist",
95
- skipLibCheck: true,
96
- resolveJsonModule: true,
97
- paths: {
98
- "@/*": ["./krnl/*"]
99
- }
100
- },
101
- include: ["krnl/**/*", `${projectName}.ts`, "krnl-magnetic.d.ts"],
102
- exclude: ["node_modules", "dist"]
103
- }, null, 2));
104
- fs.writeFileSync(path.join(targetDir, `${projectName}.ts`), `import { defineApp, Protocols } from "@dinilmusick/krnl-core";
105
- import { App } from "./krnl/backend/entities/App/App.js";
27
+ var fs3 = __toESM(require("fs"), 1);
28
+ var path3 = __toESM(require("path"), 1);
29
+ var import_krnl_core = require("@ultrst-armada/krnl-core");
106
30
 
107
- export default defineApp({
108
- name: "${projectName}",
109
- version: "1.0.0",
110
- description: "${projectName} application entrypoint",
111
- protocols: [
112
- Protocols.HTTP({ port: 8080, prefix: "/api" }),
113
- Protocols.WebSocket({ port: 8081 }),
114
- Protocols.MCP({ name: "${projectName}-agent-tools" })
115
- ],
116
- entities: [
117
- App
118
- ],
119
- frontend: {
120
- rootEntity: "App",
121
- variant: 0
122
- }
123
- });
124
- `);
125
- fs.writeFileSync(path.join(bLibDir, "definitions.ts"), `/**
126
- * @file definitions.ts
127
- * @role component
128
- * @description Types, interfaces, and contracts for AppConcepts.
129
- */
130
-
131
- export interface AppTransformOptions {
132
- normalize?: boolean;
31
+ // src/templates/configTemplates.ts
32
+ function getBasePackageJson(projectName2) {
33
+ return JSON.stringify(
34
+ {
35
+ name: projectName2,
36
+ version: "1.0.0",
37
+ description: "Full-stack application powered by Krnl symmetric architecture",
38
+ type: "module",
39
+ main: "dist/index.js",
40
+ scripts: {
41
+ dev: "krnl dev",
42
+ build: "krnl build",
43
+ validate: "krnl validate",
44
+ test: "vitest run",
45
+ sync: "krnl sync"
46
+ },
47
+ dependencies: {
48
+ "@ultrst-armada/krnl": "^1.0.0",
49
+ "@ultrst-armada/krnl-core": "^1.0.0",
50
+ "react": "^18.3.1"
51
+ },
52
+ devDependencies: {
53
+ "@types/node": "^22.0.0",
54
+ "@types/react": "^18.3.1",
55
+ "@ultrst-armada/krnl-cli": "^1.0.0",
56
+ "@ultrst-armada/krnl-validate": "^1.0.0",
57
+ typescript: "^5.7.3",
58
+ vitest: "^1.6.0"
59
+ }
60
+ },
61
+ null,
62
+ 2
63
+ );
133
64
  }
134
- `);
135
- fs.writeFileSync(path.join(bLibDir, "functions.ts"), `/**
136
- * @file functions.ts
137
- * @role component
138
- * @description Pure functions (Layer 0A) for AppConcepts.
139
- */
65
+ function getTsConfig(projectName2) {
66
+ return JSON.stringify(
67
+ {
68
+ compilerOptions: {
69
+ target: "ESNext",
70
+ module: "NodeNext",
71
+ moduleResolution: "NodeNext",
72
+ lib: ["ESNext", "DOM"],
73
+ jsx: "react-jsx",
74
+ strict: true,
75
+ outDir: "./dist",
76
+ skipLibCheck: true,
77
+ resolveJsonModule: true,
78
+ paths: {
79
+ "@/*": ["./krnl/*"]
80
+ }
81
+ },
82
+ include: ["krnl/**/*", `${projectName2}.ts`, "krnl-magnetic.d.ts"],
83
+ exclude: ["node_modules", "dist"]
84
+ },
85
+ null,
86
+ 2
87
+ );
88
+ }
89
+ function getAppEntrypoint(projectName2) {
90
+ const safeIdentifier = projectName2.replace(/[^a-zA-Z0-9_$]/g, "_");
91
+ return `import { AppServiceFacade } from "./krnl/backend/services/App/AppServiceFacade.js";
140
92
 
141
- import type { AppTransformOptions } from "./definitions.js";
93
+ export const services = {
94
+ app: AppServiceFacade,
95
+ };
142
96
 
143
- export function pureTransform<T>(data: T, _options?: AppTransformOptions): T {
144
- return data;
97
+ export const ${safeIdentifier}Backend = {
98
+ services,
99
+ };
100
+
101
+ export default AppServiceFacade;
102
+ `;
145
103
  }
146
- `);
147
- fs.writeFileSync(path.join(bLibDir, "manifest.json"), JSON.stringify({
148
- name: "AppConcepts",
149
- description: "Core utility concept library for App",
150
- dependencies: {}
151
- }, null, 2));
152
- fs.writeFileSync(path.join(bLibDir, "tests", "AppConcepts.test.ts"), `import { describe, it, expect } from "vitest";
153
- import { pureTransform } from "../functions.js";
154
104
 
155
- describe("AppConcepts", () => {
156
- it("transforms data deterministically", () => {
157
- expect(pureTransform(42)).toBe(42);
158
- });
159
- });
160
- `);
161
- fs.writeFileSync(path.join(bEntityDir, "App.ts"), `import { Entity, KrnlMagneticLoader } from "@dinilmusick/krnl-core";
105
+ // src/templates/backendTemplates.ts
106
+ var fs = __toESM(require("fs"), 1);
107
+ var path = __toESM(require("path"), 1);
108
+ function scaffoldBackend(targetDir2) {
109
+ const bServiceDir = path.join(targetDir2, "krnl", "backend", "services", "App");
110
+ const bLibDir = path.join(bServiceDir, "libraries", "AppConcepts");
111
+ const bOrchDir = path.join(bServiceDir, "orchestrations", "App");
112
+ const bFuncDir = path.join(bServiceDir, "functionalities", "Hello");
113
+ fs.mkdirSync(path.join(bLibDir, "tests"), { recursive: true });
114
+ fs.mkdirSync(path.join(bOrchDir, "tests"), { recursive: true });
115
+ fs.mkdirSync(path.join(bServiceDir, "tests"), { recursive: true });
116
+ fs.mkdirSync(path.join(bFuncDir, "main_function"), { recursive: true });
117
+ fs.mkdirSync(path.join(bFuncDir, "helper_functions"), { recursive: true });
118
+ fs.mkdirSync(path.join(bFuncDir, "events"), { recursive: true });
119
+ fs.mkdirSync(path.join(bFuncDir, "tests"), { recursive: true });
120
+ fs.writeFileSync(
121
+ path.join(bLibDir, "definitions.ts"),
122
+ `export interface AppTransformOptions { normalize?: boolean; }
123
+ `
124
+ );
125
+ fs.writeFileSync(
126
+ path.join(bLibDir, "functions.ts"),
127
+ `import type { AppTransformOptions } from "./definitions.js";
128
+ export function appPureTransform<T>(data: T, _options?: AppTransformOptions): T { return data; }
129
+ `
130
+ );
131
+ fs.writeFileSync(
132
+ path.join(bLibDir, "index.ts"),
133
+ `export * from "./definitions.js";
134
+ export * from "./functions.js";
135
+ `
136
+ );
137
+ fs.writeFileSync(
138
+ path.join(bLibDir, "manifest.json"),
139
+ JSON.stringify({ name: "AppConcepts", service: "App", description: "Core utility concept library for App", dependencies: {} }, null, 2)
140
+ );
141
+ fs.writeFileSync(
142
+ path.join(bLibDir, "tests", "AppConcepts.test.ts"),
143
+ `import { describe, it, expect } from "vitest";
144
+ import { appPureTransform } from "../functions.js";
145
+ describe("AppConcepts", () => { it("transforms data", () => { expect(appPureTransform(42)).toBe(42); }); });
146
+ `
147
+ );
148
+ fs.writeFileSync(
149
+ path.join(bOrchDir, "AppFunctionalityOrchestration.ts"),
150
+ `import { FunctionalityOrchestration } from "@ultrst-armada/krnl-core";
162
151
 
163
152
  /**
164
- * @role skeleton
153
+ * @role functionality-orchestration
154
+ * Declarative FunctionalityOrchestration flow for App.
165
155
  */
166
- export class App extends Entity {
156
+ export class AppFunctionalityOrchestration extends FunctionalityOrchestration {
167
157
  constructor() {
168
158
  super({
169
- id: "App",
159
+ id: "AppFunctionalityOrchestration",
160
+ name: "App",
170
161
  version: "1.0.0",
171
- description: "Root application entity"
162
+ description: "Root service functionality orchestration flow",
172
163
  });
173
- }
174
164
 
175
- async boot(): Promise<void> {
176
- await KrnlMagneticLoader.loadAll(this, import.meta.url);
165
+ this.flow("default")
166
+ .thenFunctionality("Hello")
167
+ .register({ visibility: "public" });
177
168
  }
178
169
  }
179
170
 
180
- export default App;
181
- `);
182
- fs.writeFileSync(path.join(bEntityDir, "orchestrations", "BootFlow.ts"), `import { KrnlFlowBuilder } from "@dinilmusick/krnl-core";
171
+ export default AppFunctionalityOrchestration;
172
+ `
173
+ );
174
+ fs.writeFileSync(
175
+ path.join(bOrchDir, "tests", "AppFunctionalityOrchestration.test.ts"),
176
+ `import { describe, it, expect } from "vitest";
177
+ import { AppFunctionalityOrchestration } from "../AppFunctionalityOrchestration.js";
178
+ describe("AppFunctionalityOrchestration", () => { it("initializes flow correctly", () => { expect(new AppFunctionalityOrchestration().id).toBe("AppFunctionalityOrchestration"); }); });
179
+ `
180
+ );
181
+ fs.writeFileSync(
182
+ path.join(bServiceDir, "AppServiceFacade.ts"),
183
+ `import { ServiceFacade } from "@ultrst-armada/krnl-core";
184
+ import { AppFunctionalityOrchestration } from "./orchestrations/App/AppFunctionalityOrchestration.js";
185
+ import * as appConcepts from "./libraries/AppConcepts/index.js";
183
186
 
184
- export function configureBootFlow(entity: any) {
185
- return entity.flow("bootSequence")
186
- .thenFunctionality("Hello")
187
- .register({ visibility: "public" });
188
- }
189
- `);
190
- fs.writeFileSync(path.join(bEntityDir, "tests", "App.test.ts"), `import { describe, it, expect } from "vitest";
191
- import { App } from "../App.js";
187
+ export const AppServiceFacade = new ServiceFacade({
188
+ id: "app.service",
189
+ name: "AppService",
190
+ version: "1.0.0",
191
+ description: "Primary application service facade",
192
+ functionalityOrchestrations: {
193
+ App: new AppFunctionalityOrchestration(),
194
+ },
195
+ libraries: {
196
+ AppConcepts: appConcepts,
197
+ },
198
+ });
192
199
 
193
- describe("App Entity", () => {
194
- it("initializes with id App", () => {
195
- const app = new App();
196
- expect(app.id).toBe("App");
200
+ export default AppServiceFacade;
201
+ `
202
+ );
203
+ fs.writeFileSync(
204
+ path.join(bServiceDir, "tests", "AppServiceFacade.test.ts"),
205
+ `import { describe, it, expect } from "vitest";
206
+ import { AppServiceFacade } from "../AppServiceFacade.js";
207
+ describe("AppServiceFacade", () => {
208
+ it("exposes orchestrations and libraries correctly", () => {
209
+ expect(AppServiceFacade.id).toBe("app.service");
210
+ expect(AppServiceFacade.functionalityOrchestrations.App).toBeDefined();
211
+ expect(AppServiceFacade.libraries.AppConcepts).toBeDefined();
212
+ expect(typeof AppServiceFacade.libraries.AppConcepts.appPureTransform).toBe("function");
197
213
  });
198
214
  });
199
- `);
200
- fs.writeFileSync(path.join(bFuncDir, "HelloAtom.ts"), `export interface HelloInput {
201
- name?: string;
202
- }
203
-
204
- export interface HelloOutput {
205
- greeting: string;
206
- timestamp: number;
207
- }
208
- `);
209
- fs.writeFileSync(path.join(bFuncDir, "manifest.json"), JSON.stringify({
210
- name: "Hello",
211
- description: "Greeting quad-unit functionality",
212
- dependencies: {}
213
- }, null, 2));
214
- fs.writeFileSync(path.join(bFuncDir, "main_function", "logic.ts"), `import type { HelloInput, HelloOutput } from "../HelloAtom.js";
215
+ `
216
+ );
217
+ fs.writeFileSync(
218
+ path.join(bFuncDir, "HelloAtom.ts"),
219
+ `export interface HelloInput { name?: string; }
220
+ export interface HelloOutput { greeting: string; timestamp: number; }
221
+ `
222
+ );
223
+ fs.writeFileSync(
224
+ path.join(bFuncDir, "manifest.json"),
225
+ JSON.stringify({ name: "Hello", service: "App", description: "Greeting quad-unit functionality", dependencies: {} }, null, 2)
226
+ );
227
+ fs.writeFileSync(
228
+ path.join(bFuncDir, "main_function", "logic.ts"),
229
+ `import type { HelloInput, HelloOutput } from "../HelloAtom.js";
215
230
  import { formatGreeting } from "../helper_functions/formatGreeting.js";
216
-
217
- export const main = async (input: HelloInput, { state }: any): Promise<HelloOutput> => {
231
+ export const main = async (input: HelloInput, _ctx: any): Promise<HelloOutput> => {
218
232
  const greeting = formatGreeting(input.name || "World");
219
- if (state) state.callCount = (state.callCount || 0) + 1;
220
- return {
221
- greeting,
222
- timestamp: Date.now()
223
- };
233
+ return { greeting, timestamp: Date.now() };
224
234
  };
225
- `);
226
- fs.writeFileSync(path.join(bFuncDir, "main_function", "lifecycle.ts"), `export async function onMount() {
227
- console.log("[Hello] Mounted");
228
- }
229
-
230
- export async function onTeardown() {
231
- console.log("[Hello] Teardown");
232
- }
233
- `);
234
- fs.writeFileSync(path.join(bFuncDir, "state_data", "state.ts"), `export interface HelloState {
235
- callCount: number;
236
- }
237
-
238
- export const initialState: HelloState = {
239
- callCount: 0
240
- };
241
- `);
242
- fs.writeFileSync(path.join(bFuncDir, "helper_functions", "formatGreeting.ts"), `/**
243
- * @role component
244
- */
245
- export function formatGreeting(name: string): string {
246
- return "Hello, " + name + "! Welcome to Krnl.";
247
- }
248
- `);
249
- fs.writeFileSync(path.join(bFuncDir, "events", "helloEvents.ts"), `/**
250
- * @role component
251
- */
252
- export interface HelloGreetedEvent {
253
- name: string;
254
- timestamp: number;
255
- }
256
- `);
257
- fs.writeFileSync(path.join(bFuncDir, "tests", "Hello.test.ts"), `import { describe, it, expect } from "vitest";
235
+ `
236
+ );
237
+ fs.writeFileSync(
238
+ path.join(bFuncDir, "main_function", "lifecycle.ts"),
239
+ `export async function onMount() {}
240
+ export async function onTeardown() {}
241
+ `
242
+ );
243
+ fs.writeFileSync(
244
+ path.join(bFuncDir, "helper_functions", "formatGreeting.ts"),
245
+ `export function formatGreeting(name: string): string { return "Hello, " + name + "! Welcome to Krnl."; }
246
+ `
247
+ );
248
+ fs.writeFileSync(
249
+ path.join(bFuncDir, "events", "helloEvents.ts"),
250
+ `export interface HelloGreetedEvent { name: string; timestamp: number; }
251
+ `
252
+ );
253
+ fs.writeFileSync(
254
+ path.join(bFuncDir, "tests", "Hello.test.ts"),
255
+ `import { describe, it, expect } from "vitest";
258
256
  import { formatGreeting } from "../helper_functions/formatGreeting.js";
259
-
260
- describe("Hello functionality", () => {
261
- it("formats greeting properly", () => {
262
- expect(formatGreeting("Alice")).toContain("Alice");
263
- });
264
- });
265
- `);
266
- fs.writeFileSync(path.join(fLibDir, "definitions.ts"), `export type ButtonVariant = "primary" | "secondary" | "danger" | "ghost";
267
-
268
- export interface ButtonProps {
269
- label: string;
270
- variant?: ButtonVariant;
271
- disabled?: boolean;
272
- onClick?: () => void;
257
+ describe("Hello functionality", () => { it("formats greeting", () => { expect(formatGreeting("Alice")).toContain("Alice"); }); });
258
+ `
259
+ );
273
260
  }
274
- `);
275
- fs.writeFileSync(path.join(fLibDir, "components.tsx"), `import React from "react";
261
+
262
+ // src/templates/frontendTemplates.ts
263
+ var fs2 = __toESM(require("fs"), 1);
264
+ var path2 = __toESM(require("path"), 1);
265
+ function scaffoldFrontend(targetDir2, projectName2) {
266
+ const fLibDir = path2.join(targetDir2, "krnl", "frontend", "libraries", "ButtonConcepts");
267
+ const fOrchDir = path2.join(targetDir2, "krnl", "frontend", "orchestrations", "App");
268
+ const fFuncDir = path2.join(targetDir2, "krnl", "frontend", "functionalities", "Hello");
269
+ fs2.mkdirSync(path2.join(fLibDir, "tests"), { recursive: true });
270
+ fs2.mkdirSync(path2.join(fOrchDir, "tests"), { recursive: true });
271
+ fs2.mkdirSync(path2.join(fFuncDir, "tests"), { recursive: true });
272
+ fs2.mkdirSync(path2.join(targetDir2, "docs"), { recursive: true });
273
+ fs2.mkdirSync(path2.join(targetDir2, ".krnl"), { recursive: true });
274
+ fs2.writeFileSync(
275
+ path2.join(fLibDir, "definitions.ts"),
276
+ `export type ButtonVariant = "primary" | "secondary";
277
+ export interface ButtonProps { label: string; variant?: ButtonVariant; disabled?: boolean; onClick?: () => void; }
278
+ `
279
+ );
280
+ fs2.writeFileSync(
281
+ path2.join(fLibDir, "components.tsx"),
282
+ `import React from "react";
276
283
  import type { ButtonProps } from "./definitions.js";
277
284
  import "./styles.css";
278
-
279
285
  export const Button: React.FC<ButtonProps> = ({ label, variant = "primary", disabled, onClick }) => {
280
- return (
281
- <button className={"krnl-btn krnl-btn--" + variant} disabled={disabled} onClick={onClick}>
282
- {label}
283
- </button>
284
- );
286
+ return <button className={"krnl-btn krnl-btn--" + variant} disabled={disabled} onClick={onClick}>{label}</button>;
285
287
  };
286
- `);
287
- fs.writeFileSync(path.join(fLibDir, "styles.css"), `.krnl-btn {
288
- padding: 8px 16px;
289
- border-radius: 4px;
290
- font-weight: 600;
291
- cursor: pointer;
292
- border: 2px solid #111;
293
- box-shadow: 2px 2px 0px #111;
294
- }
295
- .krnl-btn--primary {
296
- background: #38bdf8;
297
- color: #0f172a;
298
- }
299
- `);
300
- fs.writeFileSync(path.join(fLibDir, "manifest.json"), JSON.stringify({
301
- name: "ButtonConcepts",
302
- dependencies: {
303
- "react": "^18.3.1"
304
- }
305
- }, null, 2));
306
- fs.writeFileSync(path.join(fLibDir, "tests", "Button.test.tsx"), `import { describe, it, expect } from "vitest";
307
-
308
- describe("Button component", () => {
309
- it("defined correctly", () => {
310
- expect(true).toBe(true);
311
- });
312
- });
313
- `);
314
- fs.writeFileSync(path.join(fEntityDir, "App0.tsx"), `import React from "react";
288
+ `
289
+ );
290
+ fs2.writeFileSync(
291
+ path2.join(fLibDir, "styles.css"),
292
+ `.krnl-btn { padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; }
293
+ .krnl-btn--primary { background: #38bdf8; color: #0f172a; }
294
+ `
295
+ );
296
+ fs2.writeFileSync(
297
+ path2.join(fLibDir, "manifest.json"),
298
+ JSON.stringify({ name: "ButtonConcepts", dependencies: { react: "^18.3.1" } }, null, 2)
299
+ );
300
+ fs2.writeFileSync(
301
+ path2.join(fLibDir, "tests", "Button.test.tsx"),
302
+ `import { describe, it, expect } from "vitest";
303
+ describe("Button component", () => { it("defined correctly", () => { expect(true).toBe(true); }); });
304
+ `
305
+ );
306
+ fs2.writeFileSync(
307
+ path2.join(fOrchDir, "App0.tsx"),
308
+ `import React from "react";
315
309
  import { Button } from "../../libraries/ButtonConcepts/components.js";
316
-
317
310
  export const App0: React.FC = () => {
318
311
  return (
319
- <div className="krnl-entity-app">
312
+ <div className="krnl-app-view">
320
313
  <h1>App View (Variant 0)</h1>
321
314
  <Button label="Click Me" onClick={() => alert("Welcome to Krnl!")} />
322
315
  </div>
323
316
  );
324
317
  };
325
-
326
318
  export default App0;
327
- `);
328
- fs.writeFileSync(path.join(fEntityDir, "tests", "App0.test.tsx"), `import { describe, it, expect } from "vitest";
329
-
330
- describe("App0 Component", () => {
331
- it("mounts variant 0", () => {
332
- expect(true).toBe(true);
333
- });
334
- });
335
- `);
336
- fs.writeFileSync(path.join(fFuncDir, "Hello0.tsx"), `import React from "react";
337
-
338
- export interface HelloProps {
339
- greeting?: string;
340
- }
341
-
342
- export const Hello0: React.FC<HelloProps> = ({ greeting = "Hello World!" }) => {
343
- return (
344
- <div className="krnl-func-hello">
345
- <p>{greeting}</p>
346
- </div>
319
+ `
347
320
  );
321
+ fs2.writeFileSync(
322
+ path2.join(fOrchDir, "tests", "App0.test.tsx"),
323
+ `import { describe, it, expect } from "vitest";
324
+ describe("App0 Component", () => { it("mounts variant 0", () => { expect(true).toBe(true); }); });
325
+ `
326
+ );
327
+ fs2.writeFileSync(
328
+ path2.join(fFuncDir, "Hello0.tsx"),
329
+ `import React from "react";
330
+ export interface HelloProps { greeting?: string; }
331
+ export const Hello0: React.FC<HelloProps> = ({ greeting = "Hello World!" }) => {
332
+ return <div className="krnl-func-hello"><p>{greeting}</p></div>;
348
333
  };
349
-
350
334
  export default Hello0;
351
- `);
352
- fs.writeFileSync(path.join(fFuncDir, "manifest.json"), JSON.stringify({
353
- name: "HelloUI",
354
- dependencies: {
355
- "react": "^18.3.1"
356
- }
357
- }, null, 2));
358
- fs.writeFileSync(path.join(fFuncDir, "tests", "Hello0.test.tsx"), `import { describe, it, expect } from "vitest";
335
+ `
336
+ );
337
+ fs2.writeFileSync(
338
+ path2.join(fFuncDir, "manifest.json"),
339
+ JSON.stringify({ name: "HelloUI", dependencies: { react: "^18.3.1" } }, null, 2)
340
+ );
341
+ fs2.writeFileSync(
342
+ path2.join(fFuncDir, "tests", "Hello0.test.tsx"),
343
+ `import { describe, it, expect } from "vitest";
344
+ describe("Hello0 Component", () => { it("renders correctly", () => { expect(true).toBe(true); }); });
345
+ `
346
+ );
347
+ fs2.writeFileSync(
348
+ path2.join(targetDir2, "docs", "HISTORY.md"),
349
+ `# ${projectName2} - Project History
359
350
 
360
- describe("Hello0 Component", () => {
361
- it("renders correctly", () => {
362
- expect(true).toBe(true);
363
- });
364
- });
365
- `);
366
- import_krnl_core.KrnlPackageReconciler.reconcile(targetDir, true);
367
- fs.writeFileSync(path.join(targetDir, "docs", "HISTORY.md"), `# ${projectName} - Project History & Invariants
351
+ Initialized Krnl symmetric architecture.
352
+ `
353
+ );
354
+ fs2.writeFileSync(
355
+ path2.join(targetDir2, ".krnl", "agent-state.json"),
356
+ JSON.stringify(
357
+ {
358
+ schemaVersion: "1.0.0",
359
+ turnsSinceLastAudit: 0,
360
+ auditCadenceThreshold: 5,
361
+ totalTurns: 0,
362
+ lastAudit: {
363
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
364
+ status: "INITIALIZED",
365
+ refactorsPerformed: [],
366
+ checksPassed: ["symmetric_planes", "concept_folders", "manifest_reconciliation"]
367
+ },
368
+ history: []
369
+ },
370
+ null,
371
+ 2
372
+ )
373
+ );
374
+ }
368
375
 
369
- ## Initial Scaffolding
370
- - Initialized Krnl symmetric architecture (krnl/backend & krnl/frontend).
371
- - Configured code-as-config entrypoint: ${projectName}.ts.
372
- - Co-located manifest.json and tests/ across all concept libraries and functionalities.
373
- - Programmatically reconciled package.json dependencies.
376
+ // src/index.ts
377
+ var rawArg = process.argv[2] || "my-krnl-app";
378
+ var targetDir = path3.resolve(process.cwd(), rawArg);
379
+ var projectName = path3.basename(targetDir);
380
+ console.log(`
381
+ \u{1F680} [create-krnl] Scaffolding new Krnl project in: ${targetDir}
374
382
  `);
375
- fs.writeFileSync(path.join(targetDir, ".skipo", "agent-state.json"), JSON.stringify({
376
- schemaVersion: "1.0.0",
377
- turnsSinceLastAudit: 0,
378
- auditCadenceThreshold: 5,
379
- totalTurns: 0,
380
- lastAudit: {
381
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
382
- status: "INITIALIZED",
383
- refactorsPerformed: [],
384
- checksPassed: ["symmetric_planes", "concept_folders", "manifest_reconciliation", "tests_colocation"]
385
- },
386
- history: []
387
- }, null, 2));
383
+ if (fs3.existsSync(targetDir)) {
384
+ console.error(`\u274C Directory "${projectName}" already exists.`);
385
+ process.exit(1);
386
+ }
387
+ fs3.mkdirSync(targetDir, { recursive: true });
388
+ fs3.writeFileSync(path3.join(targetDir, "package.json"), getBasePackageJson(projectName));
389
+ fs3.writeFileSync(path3.join(targetDir, "tsconfig.json"), getTsConfig(projectName));
390
+ fs3.writeFileSync(path3.join(targetDir, `${projectName}.ts`), getAppEntrypoint(projectName));
391
+ scaffoldBackend(targetDir);
392
+ scaffoldFrontend(targetDir, projectName);
393
+ import_krnl_core.KrnlPackageReconciler.reconcile(targetDir, true);
388
394
  console.log(`
389
395
  \u{1F389} Project successfully scaffolded at: ${targetDir}`);
390
396
  console.log(`