@ultrst-armada/krnl 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/README.md +95 -2
  2. package/package.json +75 -4
  3. package/packages/cli/dist/K_ENT_Entity-PQ5MURQY-ZG6FZXXX.js +13 -0
  4. package/packages/cli/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-K4CRQYA5.js +8 -0
  5. package/packages/cli/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-LNPXZYOE.js +110 -0
  6. package/packages/cli/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-3ALZPNX4.js +11 -0
  7. package/packages/cli/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-PJTICYSW.js +11 -0
  8. package/packages/cli/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-M5TYU55O.js +8 -0
  9. package/packages/cli/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-H6STOXRK.js +20 -0
  10. package/packages/cli/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-XPJXSF7D.js +19 -0
  11. package/packages/cli/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-CUYGTWOW.js +7 -0
  12. package/packages/cli/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-VR6T4N6J.js +17 -0
  13. package/packages/cli/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-RLJ4QWDP.js +58 -0
  14. package/packages/cli/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-BOQGUASC.js +22 -0
  15. package/packages/cli/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-XJI7KIT5.js +8 -0
  16. package/packages/cli/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-K5VCWAFW.js +9 -0
  17. package/packages/cli/dist/bin/krnl.cjs +9758 -0
  18. package/packages/cli/dist/bin/krnl.d.cts +1 -0
  19. package/packages/cli/dist/bin/krnl.d.ts +1 -0
  20. package/packages/cli/dist/bin/krnl.js +2006 -0
  21. package/packages/cli/dist/chunk-3TRM6CYL.js +152 -0
  22. package/packages/cli/dist/chunk-5JDK35TG.js +3872 -0
  23. package/packages/cli/dist/chunk-63PTK33I.js +997 -0
  24. package/packages/cli/dist/chunk-6NIKAMUZ.js +82 -0
  25. package/packages/cli/dist/chunk-BOXWWXQG.js +400 -0
  26. package/packages/cli/dist/chunk-EEKLK7QJ.js +565 -0
  27. package/packages/cli/dist/chunk-EG7T2IAD.js +107 -0
  28. package/packages/cli/dist/chunk-F5EHXE2O.js +1036 -0
  29. package/packages/cli/dist/chunk-F65ANSQG.js +269 -0
  30. package/packages/cli/dist/chunk-FDNCADFE.js +71 -0
  31. package/packages/cli/dist/chunk-GDLRMDAN.js +127 -0
  32. package/packages/cli/dist/chunk-HWMTCMOS.js +656 -0
  33. package/packages/cli/dist/chunk-I74QIQOD.js +5536 -0
  34. package/packages/cli/dist/chunk-JTLSTO25.js +71 -0
  35. package/packages/cli/dist/chunk-JULBBJ27.js +1033 -0
  36. package/packages/cli/dist/chunk-OHVMVRBP.js +117 -0
  37. package/packages/cli/dist/chunk-P2PCLEKX.js +666 -0
  38. package/packages/cli/dist/chunk-PJQIUOX2.js +7767 -0
  39. package/packages/cli/dist/chunk-PPOF3DJW.js +471 -0
  40. package/packages/cli/dist/chunk-Q45257P6.js +173 -0
  41. package/packages/cli/dist/chunk-QNROWGBI.js +1036 -0
  42. package/packages/cli/dist/chunk-RJNYUXZD.js +977 -0
  43. package/packages/cli/dist/chunk-SRTOPJ5W.js +104 -0
  44. package/packages/cli/dist/chunk-TCEX3MPS.js +702 -0
  45. package/packages/cli/dist/chunk-TNOAJO2J.js +675 -0
  46. package/packages/cli/dist/chunk-UR2SUCSF.js +701 -0
  47. package/packages/cli/dist/chunk-X5LOIFM7.js +68 -0
  48. package/packages/cli/dist/chunk-XIRFOO3H.js +589 -0
  49. package/packages/cli/dist/chunk-ZAAV3JXQ.js +809 -0
  50. package/packages/cli/dist/index.cjs +7798 -0
  51. package/packages/cli/dist/index.d.cts +7 -0
  52. package/packages/cli/dist/index.d.ts +7 -0
  53. package/packages/cli/dist/index.js +29 -0
  54. package/packages/cli/package.json +34 -0
  55. package/packages/core/dist/K_ENT_Entity-4MB7CU4A.js +12 -0
  56. package/packages/core/dist/K_ENT_Entity-DEJGIDGH.js +12 -0
  57. package/packages/core/dist/K_ENT_Entity-FXZO5UZ2.js +12 -0
  58. package/packages/core/dist/K_ENT_Entity-HDSCXC5F.js +12 -0
  59. package/packages/core/dist/K_ENT_Entity-JILABHLW.js +12 -0
  60. package/packages/core/dist/K_ENT_Entity-PQ5MURQY.js +13 -0
  61. package/packages/core/dist/K_ENT_Entity-ROAKDIHW.js +12 -0
  62. package/packages/core/dist/K_ENT_Entity-TBVFSKDV.js +12 -0
  63. package/packages/core/dist/K_ENT_Entity-ZFLKG3JO.js +12 -0
  64. package/packages/core/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW.js +8 -0
  65. package/packages/core/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF.js +110 -0
  66. package/packages/core/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF.js +9 -0
  67. package/packages/core/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X.js +9 -0
  68. package/packages/core/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW.js +8 -0
  69. package/packages/core/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2.js +20 -0
  70. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-4C6GBQAG.js +18 -0
  71. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-6V23A6F6.js +18 -0
  72. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK.js +19 -0
  73. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-DYLLC5G2.js +18 -0
  74. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-F4FOFAUP.js +18 -0
  75. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-FBOXXMI3.js +18 -0
  76. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-Q73BWLNP.js +18 -0
  77. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QM2C4MVA.js +18 -0
  78. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QUGI6SMP.js +18 -0
  79. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RGMTBHNP.js +18 -0
  80. package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RWR7UNDW.js +18 -0
  81. package/packages/core/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7.js +7 -0
  82. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-32MFJJ5Z.js +17 -0
  83. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-4J4CEWRY.js +17 -0
  84. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-A366YHF2.js +17 -0
  85. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-LK4LYJHI.js +17 -0
  86. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU.js +17 -0
  87. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-NW3K63II.js +17 -0
  88. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-QDHTI5ZV.js +17 -0
  89. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-VHCT6VIW.js +17 -0
  90. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-WBRKF24R.js +17 -0
  91. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-XKYQYT6Q.js +17 -0
  92. package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-Z2PWZYDZ.js +17 -0
  93. package/packages/core/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5.js +58 -0
  94. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-2EZU7QF4.js +21 -0
  95. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-6G3AQNAV.js +21 -0
  96. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-B2NZMQUG.js +21 -0
  97. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-C2RABMZP.js +21 -0
  98. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-HHE3NZ4F.js +21 -0
  99. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-LHFGR6WK.js +21 -0
  100. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-M74BLM3N.js +21 -0
  101. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-PT6ZA6EA.js +21 -0
  102. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-SP52V3CX.js +21 -0
  103. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF.js +22 -0
  104. package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-YNSEUHJJ.js +21 -0
  105. package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-M6SBHIVA.js +8 -0
  106. package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG.js +8 -0
  107. package/packages/core/dist/K_LIB_Krnl_Telemetry-77FRZ3KV.js +9 -0
  108. package/packages/core/dist/chunk-33L2J7V7.js +82 -0
  109. package/packages/core/dist/chunk-3ES4K2ZP.js +817 -0
  110. package/packages/core/dist/chunk-3SMHVVLL.js +82 -0
  111. package/packages/core/dist/chunk-3UEZ7JQA.js +4877 -0
  112. package/packages/core/dist/chunk-3XIE6KBD.js +4877 -0
  113. package/packages/core/dist/chunk-46ZLCML6.js +107 -0
  114. package/packages/core/dist/chunk-4UEL3DWJ.js +107 -0
  115. package/packages/core/dist/chunk-54GWZ5PC.js +82 -0
  116. package/packages/core/dist/chunk-6QCYRS5L.js +127 -0
  117. package/packages/core/dist/chunk-6ULMHNXR.js +104 -0
  118. package/packages/core/dist/chunk-7WUETJEV.js +117 -0
  119. package/packages/core/dist/chunk-A5KRAYDB.js +107 -0
  120. package/packages/core/dist/chunk-ANEAZ3PO.js +107 -0
  121. package/packages/core/dist/chunk-BE76RL6F.js +82 -0
  122. package/packages/core/dist/chunk-CIARVYDO.js +107 -0
  123. package/packages/core/dist/chunk-CR2ANE62.js +107 -0
  124. package/packages/core/dist/chunk-DI27MOR7.js +173 -0
  125. package/packages/core/dist/chunk-E6RLFHM5.js +596 -0
  126. package/packages/core/dist/chunk-EELAPMNV.js +4877 -0
  127. package/packages/core/dist/chunk-ENZ2RQVJ.js +107 -0
  128. package/packages/core/dist/chunk-F2U6CX4F.js +4877 -0
  129. package/packages/core/dist/chunk-FKG64OHL.js +82 -0
  130. package/packages/core/dist/chunk-FYAZJYM5.js +772 -0
  131. package/packages/core/dist/chunk-G4NP4RDQ.js +82 -0
  132. package/packages/core/dist/chunk-GADIRLRS.js +473 -0
  133. package/packages/core/dist/chunk-GR6CSLQJ.js +772 -0
  134. package/packages/core/dist/chunk-HDS7AT6O.js +772 -0
  135. package/packages/core/dist/chunk-HIMEZUU2.js +71 -0
  136. package/packages/core/dist/chunk-IB4UHG5I.js +596 -0
  137. package/packages/core/dist/chunk-J7ZYNVRS.js +772 -0
  138. package/packages/core/dist/chunk-JVLZU4K7.js +604 -0
  139. package/packages/core/dist/chunk-JYXXI7Q3.js +82 -0
  140. package/packages/core/dist/chunk-K54K2KZW.js +192 -0
  141. package/packages/core/dist/chunk-K6VHLBNH.js +3316 -0
  142. package/packages/core/dist/chunk-KCBP7ZYA.js +596 -0
  143. package/packages/core/dist/chunk-KFQGP6VL.js +33 -0
  144. package/packages/core/dist/chunk-KIUEUI7K.js +82 -0
  145. package/packages/core/dist/chunk-LB67NIZP.js +949 -0
  146. package/packages/core/dist/chunk-LDTYFUNW.js +596 -0
  147. package/packages/core/dist/chunk-MLVWARD4.js +596 -0
  148. package/packages/core/dist/chunk-MPYVXHKO.js +2777 -0
  149. package/packages/core/dist/chunk-MRQ3MITU.js +772 -0
  150. package/packages/core/dist/chunk-MVUN7I7O.js +107 -0
  151. package/packages/core/dist/chunk-NDDOIRW7.js +596 -0
  152. package/packages/core/dist/chunk-O3KDB5MH.js +3330 -0
  153. package/packages/core/dist/chunk-OEINUDSE.js +400 -0
  154. package/packages/core/dist/chunk-OPDENPT4.js +4877 -0
  155. package/packages/core/dist/chunk-P6XEM2LA.js +429 -0
  156. package/packages/core/dist/chunk-QKMRSQV4.js +82 -0
  157. package/packages/core/dist/chunk-R6CCWALL.js +4877 -0
  158. package/packages/core/dist/chunk-RAMMOO73.js +774 -0
  159. package/packages/core/dist/chunk-S3FTZFG6.js +772 -0
  160. package/packages/core/dist/chunk-T2ZVN434.js +4877 -0
  161. package/packages/core/dist/chunk-TFHLDMIA.js +107 -0
  162. package/packages/core/dist/chunk-TI3QUCIJ.js +107 -0
  163. package/packages/core/dist/chunk-TR2BAIGI.js +107 -0
  164. package/packages/core/dist/chunk-UGVVJKC6.js +4877 -0
  165. package/packages/core/dist/chunk-V2DX7YIU.js +984 -0
  166. package/packages/core/dist/chunk-W4IHYUYD.js +772 -0
  167. package/packages/core/dist/chunk-W6WBG5OY.js +4877 -0
  168. package/packages/core/dist/chunk-WN3M7O7H.js +3312 -0
  169. package/packages/core/dist/chunk-WR3NCU7U.js +4877 -0
  170. package/packages/core/dist/chunk-XC6B6L27.js +82 -0
  171. package/packages/core/dist/chunk-XNSE64ZY.js +3316 -0
  172. package/packages/core/dist/chunk-XROES2WN.js +634 -0
  173. package/packages/core/dist/chunk-XSCKNRCZ.js +5020 -0
  174. package/packages/core/dist/chunk-XVABPAUZ.js +82 -0
  175. package/packages/core/dist/chunk-YOBCB5C5.js +596 -0
  176. package/packages/core/dist/chunk-YUK6Q563.js +666 -0
  177. package/packages/core/dist/chunk-YXGL3ZEU.js +1030 -0
  178. package/packages/core/dist/chunk-ZINJ5OUX.js +596 -0
  179. package/packages/core/dist/chunk-ZPFD4BIQ.js +604 -0
  180. package/packages/core/dist/chunk-ZQZBFG6F.js +4826 -0
  181. package/packages/core/dist/chunk-ZZFRJGXM.js +4877 -0
  182. package/packages/core/dist/index.cjs +760 -0
  183. package/packages/core/dist/index.d.cts +360 -0
  184. package/packages/core/dist/index.d.ts +360 -0
  185. package/packages/core/dist/index.js +707 -0
  186. package/packages/core/package.json +34 -0
  187. package/packages/create-krnl/dist/K_ENT_Entity-PQ5MURQY-R2OH4VXE.js +14 -0
  188. package/packages/create-krnl/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-AZM5HF4M.js +9 -0
  189. package/packages/create-krnl/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-X5N6SV2S.js +111 -0
  190. package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-5PFHF4JU.js +12 -0
  191. package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-ED33OQPH.js +12 -0
  192. package/packages/create-krnl/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-YGQLVR4P.js +9 -0
  193. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-VM7CTU2L.js +21 -0
  194. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-Y2GQFJ7I.js +21 -0
  195. package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-L3JQWO54.js +8 -0
  196. package/packages/create-krnl/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-KQARASPR.js +19 -0
  197. package/packages/create-krnl/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-OF3IGLVL.js +59 -0
  198. package/packages/create-krnl/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-JOLHKOEX.js +24 -0
  199. package/packages/create-krnl/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-L46LSHKQ.js +10 -0
  200. package/packages/create-krnl/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-4JUPRR3X.js +10 -0
  201. package/packages/create-krnl/dist/chunk-3TRM6CYL.js +152 -0
  202. package/packages/create-krnl/dist/chunk-3URCB3QS.js +127 -0
  203. package/packages/create-krnl/dist/chunk-5JDK35TG.js +3872 -0
  204. package/packages/create-krnl/dist/chunk-A2XAXDOW.js +812 -0
  205. package/packages/create-krnl/dist/chunk-AN6TMQHG.js +1033 -0
  206. package/packages/create-krnl/dist/chunk-BOXWWXQG.js +400 -0
  207. package/packages/create-krnl/dist/chunk-BPTBREBG.js +38 -0
  208. package/packages/create-krnl/dist/chunk-FDNCADFE.js +71 -0
  209. package/packages/create-krnl/dist/chunk-JTLSTO25.js +71 -0
  210. package/packages/create-krnl/dist/chunk-M3NCUIPL.js +107 -0
  211. package/packages/create-krnl/dist/chunk-N2EONSOC.js +7769 -0
  212. package/packages/create-krnl/dist/chunk-OHVMVRBP.js +117 -0
  213. package/packages/create-krnl/dist/chunk-Q45257P6.js +173 -0
  214. package/packages/create-krnl/dist/chunk-QGM4M3NI.js +37 -0
  215. package/packages/create-krnl/dist/chunk-RJNYUXZD.js +977 -0
  216. package/packages/create-krnl/dist/chunk-SRTOPJ5W.js +104 -0
  217. package/packages/create-krnl/dist/chunk-UPBIGEC3.js +666 -0
  218. package/packages/create-krnl/dist/chunk-V2DB7UD7.js +82 -0
  219. package/packages/create-krnl/dist/chunk-WMHLIUI6.js +3644 -0
  220. package/packages/create-krnl/dist/chunk-XIRFOO3H.js +589 -0
  221. package/packages/create-krnl/dist/chunk-Y2CEEVZP.js +5536 -0
  222. package/packages/create-krnl/dist/index.cjs +395 -0
  223. package/packages/create-krnl/dist/index.js +372 -0
  224. package/packages/create-krnl/dist/main-DXUMPBND.js +2217 -0
  225. package/packages/create-krnl/dist/wrapper-SDF2VKX3.js +31 -0
  226. package/packages/create-krnl/package.json +23 -0
  227. package/packages/eslint-plugin/dist/index.cjs +439 -0
  228. package/packages/eslint-plugin/dist/index.d.cts +336 -0
  229. package/packages/eslint-plugin/dist/index.d.ts +336 -0
  230. package/packages/eslint-plugin/dist/index.js +416 -0
  231. package/packages/eslint-plugin/package.json +24 -0
  232. package/packages/validate/dist/index.cjs +499 -0
  233. package/packages/validate/dist/index.d.cts +49 -0
  234. package/packages/validate/dist/index.d.ts +49 -0
  235. package/packages/validate/dist/index.js +462 -0
  236. package/packages/validate/package.json +27 -0
@@ -0,0 +1,760 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ HttpProtocolAdapter: () => HttpProtocolAdapter,
34
+ LifecycleManager: () => LifecycleManager,
35
+ MemoryTransport: () => MemoryTransport,
36
+ P2PProtocolAdapter: () => P2PProtocolAdapter,
37
+ ProtocolResolver: () => ProtocolResolver,
38
+ ServiceDiscovery: () => ServiceDiscovery,
39
+ ServiceEventBus: () => ServiceEventBus,
40
+ ServiceInstance: () => ServiceInstance,
41
+ ServiceProxy: () => ServiceProxy,
42
+ ServiceRegistry: () => ServiceRegistry,
43
+ ServiceRuntime: () => ServiceRuntime,
44
+ ServiceStateStore: () => ServiceStateStore,
45
+ UdpProtocolAdapter: () => UdpProtocolAdapter,
46
+ WebSocketProtocolAdapter: () => WebSocketProtocolAdapter,
47
+ createService: () => createService,
48
+ createServiceDefinition: () => createServiceDefinition,
49
+ createServiceProxy: () => createServiceProxy
50
+ });
51
+ module.exports = __toCommonJS(index_exports);
52
+
53
+ // src/state/ServiceStateStore.ts
54
+ var ServiceStateStore = class {
55
+ state;
56
+ listeners = /* @__PURE__ */ new Set();
57
+ constructor(initialState) {
58
+ this.state = { ...initialState };
59
+ }
60
+ getState() {
61
+ return Object.freeze({ ...this.state });
62
+ }
63
+ setState(mutation) {
64
+ this.state = { ...this.state, ...mutation };
65
+ const snapshot = this.getState();
66
+ for (const listener of this.listeners) {
67
+ listener(snapshot, mutation);
68
+ }
69
+ }
70
+ subscribe(listener) {
71
+ this.listeners.add(listener);
72
+ return () => {
73
+ this.listeners.delete(listener);
74
+ };
75
+ }
76
+ reset(newState) {
77
+ this.state = { ...newState || {} };
78
+ }
79
+ };
80
+
81
+ // src/events/ServiceEventBus.ts
82
+ var ServiceEventBus = class {
83
+ handlers = /* @__PURE__ */ new Map();
84
+ on(event, handler) {
85
+ if (!this.handlers.has(event)) {
86
+ this.handlers.set(event, /* @__PURE__ */ new Set());
87
+ }
88
+ const set = this.handlers.get(event);
89
+ set.add(handler);
90
+ return () => {
91
+ set.delete(handler);
92
+ };
93
+ }
94
+ emit(event, payload) {
95
+ const set = this.handlers.get(event);
96
+ if (!set) return;
97
+ for (const handler of Array.from(set)) {
98
+ try {
99
+ handler(payload);
100
+ } catch (err) {
101
+ console.error(`[ServiceEventBus] Handler error for '${event}':`, err);
102
+ }
103
+ }
104
+ }
105
+ clear() {
106
+ this.handlers.clear();
107
+ }
108
+ };
109
+
110
+ // src/lifecycle/LifecycleManager.ts
111
+ var LifecycleManager = class {
112
+ status = "uninitialized";
113
+ getStatus() {
114
+ return this.status;
115
+ }
116
+ setStatus(next) {
117
+ this.status = next;
118
+ }
119
+ assertRunning(serviceName) {
120
+ if (this.status !== "running") {
121
+ throw new Error(`[Service:${serviceName}] Cannot invoke operation while status is '${this.status}' (expected 'running').`);
122
+ }
123
+ }
124
+ };
125
+
126
+ // src/services/ServiceInstance.ts
127
+ var ServiceInstance = class {
128
+ constructor(definition) {
129
+ this.definition = definition;
130
+ this.id = definition.id;
131
+ this.name = definition.name;
132
+ this.version = definition.version;
133
+ this.lifecycle = new LifecycleManager();
134
+ this.eventBus = new ServiceEventBus();
135
+ if (definition.state?.initial) {
136
+ this.stateStore = new ServiceStateStore(definition.state.initial);
137
+ }
138
+ }
139
+ definition;
140
+ id;
141
+ name;
142
+ version;
143
+ stateStore;
144
+ eventBus;
145
+ lifecycle;
146
+ getDefinition() {
147
+ return this.definition;
148
+ }
149
+ async start() {
150
+ this.lifecycle.setStatus("starting");
151
+ if (this.definition.lifecycle?.onInit) {
152
+ await this.definition.lifecycle.onInit();
153
+ }
154
+ if (this.definition.lifecycle?.onStart) {
155
+ await this.definition.lifecycle.onStart();
156
+ }
157
+ this.lifecycle.setStatus("running");
158
+ }
159
+ async stop() {
160
+ this.lifecycle.setStatus("stopping");
161
+ if (this.definition.lifecycle?.onStop) {
162
+ await this.definition.lifecycle.onStop();
163
+ }
164
+ if (this.definition.lifecycle?.onDispose) {
165
+ await this.definition.lifecycle.onDispose();
166
+ }
167
+ this.lifecycle.setStatus("stopped");
168
+ }
169
+ async call(op, input, ctx = {}) {
170
+ this.lifecycle.assertRunning(this.name);
171
+ const operation = this.definition.operations[op];
172
+ if (!operation) {
173
+ throw new Error(`[Service:${this.name}] Operation '${op}' not found.`);
174
+ }
175
+ return await operation.handler(input, ctx);
176
+ }
177
+ getState() {
178
+ if (!this.stateStore) {
179
+ return Object.freeze({});
180
+ }
181
+ return this.stateStore.getState();
182
+ }
183
+ setState(mutation) {
184
+ if (!this.stateStore) {
185
+ this.stateStore = new ServiceStateStore(mutation);
186
+ return;
187
+ }
188
+ this.stateStore.setState(mutation);
189
+ }
190
+ on(event, handler) {
191
+ return this.eventBus.on(event, handler);
192
+ }
193
+ emit(event, payload) {
194
+ this.eventBus.emit(event, payload);
195
+ }
196
+ };
197
+
198
+ // src/services/ServiceProxy.ts
199
+ var ServiceProxy = class {
200
+ constructor(definition, adapter, endpoint) {
201
+ this.definition = definition;
202
+ this.adapter = adapter;
203
+ this.endpoint = endpoint;
204
+ this.id = definition.id;
205
+ this.name = definition.name;
206
+ this.version = definition.version;
207
+ this.stateCache = definition.state?.initial || {};
208
+ }
209
+ definition;
210
+ adapter;
211
+ endpoint;
212
+ id;
213
+ name;
214
+ version;
215
+ stateCache;
216
+ eventHandlers = /* @__PURE__ */ new Map();
217
+ getDefinition() {
218
+ return this.definition;
219
+ }
220
+ async start() {
221
+ }
222
+ async stop() {
223
+ }
224
+ async call(op, input, ctx = {}) {
225
+ if (!this.adapter.send) {
226
+ throw new Error(`[ServiceProxy:${this.name}] Adapter does not support send().`);
227
+ }
228
+ const envelope = {
229
+ id: `req-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
230
+ type: "request",
231
+ operation: op,
232
+ payload: input,
233
+ timestamp: Date.now()
234
+ };
235
+ const response = await this.adapter.send(this.endpoint, envelope);
236
+ if (response.error) {
237
+ throw new Error(`[ServiceProxy:${this.name}] Remote error: ${response.error}`);
238
+ }
239
+ return response.payload;
240
+ }
241
+ getState() {
242
+ return Object.freeze({ ...this.stateCache });
243
+ }
244
+ setState(mutation) {
245
+ this.stateCache = { ...this.stateCache, ...mutation };
246
+ }
247
+ on(event, handler) {
248
+ if (!this.eventHandlers.has(event)) {
249
+ this.eventHandlers.set(event, /* @__PURE__ */ new Set());
250
+ }
251
+ const handlers = this.eventHandlers.get(event);
252
+ handlers.add(handler);
253
+ return () => {
254
+ handlers.delete(handler);
255
+ };
256
+ }
257
+ emit(event, payload) {
258
+ const handlers = this.eventHandlers.get(event);
259
+ if (handlers) {
260
+ for (const handler of Array.from(handlers)) {
261
+ handler(payload);
262
+ }
263
+ }
264
+ }
265
+ };
266
+
267
+ // src/services/ServiceGenerators.ts
268
+ function createServiceDefinition(definition) {
269
+ return definition;
270
+ }
271
+ function createService(definition) {
272
+ return new ServiceInstance(definition);
273
+ }
274
+ function createServiceProxy(definition, adapter, endpoint) {
275
+ return new ServiceProxy(definition, adapter, endpoint);
276
+ }
277
+
278
+ // src/protocols/HttpProtocolAdapter.ts
279
+ var import_http = __toESM(require("http"), 1);
280
+ var HttpProtocolAdapter = class {
281
+ protocol = "http";
282
+ capabilities = {
283
+ requestResponse: true,
284
+ streaming: true,
285
+ pubSub: false,
286
+ datagram: false,
287
+ peerToPeer: false,
288
+ signaling: false,
289
+ discovery: false
290
+ };
291
+ server;
292
+ listeningPort;
293
+ async listen(port, host = "127.0.0.1") {
294
+ this.server = import_http.default.createServer();
295
+ await new Promise((resolve, reject) => {
296
+ this.server.listen(port, host, () => {
297
+ const addr = this.server.address();
298
+ this.listeningPort = addr.port;
299
+ resolve();
300
+ });
301
+ this.server.on("error", reject);
302
+ });
303
+ return {
304
+ protocol: "http",
305
+ address: host,
306
+ port: this.listeningPort,
307
+ capabilities: ["requestResponse", "streaming"]
308
+ };
309
+ }
310
+ async expose(service, port = 0) {
311
+ this.server = import_http.default.createServer(async (req, res) => {
312
+ res.setHeader("Content-Type", "application/json");
313
+ const url = new URL(req.url || "/", `http://${req.headers.host || "localhost"}`);
314
+ if (url.pathname === "/manifest") {
315
+ res.writeHead(200);
316
+ res.end(JSON.stringify(service.getDefinition()));
317
+ return;
318
+ }
319
+ if (url.pathname === "/health") {
320
+ res.writeHead(200);
321
+ res.end(JSON.stringify({ status: "ok", service: service.name }));
322
+ return;
323
+ }
324
+ if (url.pathname.startsWith("/call/")) {
325
+ const op = url.pathname.slice("/call/".length);
326
+ let body = "";
327
+ req.on("data", (c) => body += c);
328
+ req.on("end", async () => {
329
+ try {
330
+ const parsed = body ? JSON.parse(body) : {};
331
+ const result = await service.call(op, parsed);
332
+ res.writeHead(200);
333
+ res.end(JSON.stringify({ status: "success", payload: result }));
334
+ } catch (err) {
335
+ res.writeHead(500);
336
+ res.end(JSON.stringify({ status: "error", error: err.message || String(err) }));
337
+ }
338
+ });
339
+ return;
340
+ }
341
+ res.writeHead(404);
342
+ res.end(JSON.stringify({ error: "Route not found" }));
343
+ });
344
+ await new Promise((resolve, reject) => {
345
+ this.server.listen(port, "127.0.0.1", () => {
346
+ const addr = this.server.address();
347
+ this.listeningPort = addr.port;
348
+ resolve();
349
+ });
350
+ this.server.on("error", reject);
351
+ });
352
+ return {
353
+ protocol: "http",
354
+ address: "127.0.0.1",
355
+ port: this.listeningPort,
356
+ capabilities: ["requestResponse", "streaming"]
357
+ };
358
+ }
359
+ async send(endpoint, envelope) {
360
+ const url = `http://${endpoint.address}:${endpoint.port}/call/${envelope.operation}`;
361
+ const res = await fetch(url, {
362
+ method: "POST",
363
+ headers: { "Content-Type": "application/json" },
364
+ body: JSON.stringify(envelope.payload || {})
365
+ });
366
+ const json = await res.json();
367
+ return {
368
+ id: `res-${Date.now()}`,
369
+ type: "response",
370
+ correlationId: envelope.id,
371
+ payload: json.payload,
372
+ error: json.error,
373
+ timestamp: Date.now()
374
+ };
375
+ }
376
+ async stop() {
377
+ if (this.server) {
378
+ await new Promise((resolve) => this.server.close(() => resolve()));
379
+ this.server = void 0;
380
+ }
381
+ }
382
+ };
383
+
384
+ // src/protocols/WebSocketProtocolAdapter.ts
385
+ var import_http2 = __toESM(require("http"), 1);
386
+ var WebSocketProtocolAdapter = class {
387
+ protocol = "ws";
388
+ capabilities = {
389
+ requestResponse: true,
390
+ streaming: true,
391
+ pubSub: true,
392
+ datagram: false,
393
+ peerToPeer: false,
394
+ signaling: false,
395
+ discovery: false
396
+ };
397
+ server;
398
+ wss;
399
+ port;
400
+ async expose(service, port = 0) {
401
+ const wsMod = await import("ws");
402
+ const WebSocketServer = wsMod.WebSocketServer || wsMod.default?.WebSocketServer || wsMod.Server;
403
+ this.server = import_http2.default.createServer();
404
+ this.wss = new WebSocketServer({ server: this.server });
405
+ this.wss.on("connection", (ws) => {
406
+ ws.on("message", async (raw) => {
407
+ try {
408
+ const envelope = JSON.parse(raw.toString());
409
+ if (envelope.type === "request" && envelope.operation) {
410
+ try {
411
+ const res = await service.call(envelope.operation, envelope.payload);
412
+ ws.send(JSON.stringify({
413
+ id: `res-${Date.now()}`,
414
+ type: "response",
415
+ correlationId: envelope.id,
416
+ payload: res,
417
+ timestamp: Date.now()
418
+ }));
419
+ } catch (err) {
420
+ ws.send(JSON.stringify({
421
+ id: `res-${Date.now()}`,
422
+ type: "response",
423
+ correlationId: envelope.id,
424
+ error: err.message || String(err),
425
+ timestamp: Date.now()
426
+ }));
427
+ }
428
+ }
429
+ } catch (_) {
430
+ }
431
+ });
432
+ });
433
+ await new Promise((resolve, reject) => {
434
+ this.server.listen(port, "127.0.0.1", () => {
435
+ const addr = this.server.address();
436
+ this.port = addr.port;
437
+ resolve();
438
+ });
439
+ this.server.on("error", reject);
440
+ });
441
+ return {
442
+ protocol: "ws",
443
+ address: "127.0.0.1",
444
+ port: this.port,
445
+ capabilities: ["requestResponse", "pubSub", "streaming"]
446
+ };
447
+ }
448
+ async send(endpoint, envelope) {
449
+ const wsMod = await import("ws");
450
+ const WS = wsMod.WebSocket || wsMod.default || globalThis.WebSocket;
451
+ return new Promise((resolve, reject) => {
452
+ const ws = new WS(`ws://${endpoint.address}:${endpoint.port}`);
453
+ ws.on("open", () => {
454
+ ws.send(JSON.stringify(envelope));
455
+ });
456
+ ws.on("message", (data) => {
457
+ try {
458
+ const res = JSON.parse(data.toString());
459
+ ws.close();
460
+ resolve(res);
461
+ } catch (e) {
462
+ ws.close();
463
+ reject(e);
464
+ }
465
+ });
466
+ ws.on("error", (err) => {
467
+ reject(err);
468
+ });
469
+ });
470
+ }
471
+ async stop() {
472
+ if (this.wss) {
473
+ await new Promise((r) => this.wss.close(() => r()));
474
+ this.wss = void 0;
475
+ }
476
+ if (this.server) {
477
+ await new Promise((r) => this.server.close(() => r()));
478
+ this.server = void 0;
479
+ }
480
+ }
481
+ };
482
+
483
+ // src/protocols/UdpProtocolAdapter.ts
484
+ var import_dgram = __toESM(require("dgram"), 1);
485
+ var UdpProtocolAdapter = class {
486
+ protocol = "udp";
487
+ capabilities = {
488
+ requestResponse: true,
489
+ streaming: false,
490
+ pubSub: false,
491
+ datagram: true,
492
+ peerToPeer: false,
493
+ signaling: false,
494
+ discovery: true
495
+ };
496
+ socket;
497
+ port;
498
+ async expose(service, port = 0) {
499
+ this.socket = import_dgram.default.createSocket("udp4");
500
+ this.socket.on("message", async (msg, rinfo) => {
501
+ try {
502
+ const envelope = JSON.parse(msg.toString());
503
+ if (envelope.type === "request" && envelope.operation) {
504
+ try {
505
+ const res = await service.call(envelope.operation, envelope.payload);
506
+ const resp = JSON.stringify({
507
+ id: `res-${Date.now()}`,
508
+ type: "response",
509
+ correlationId: envelope.id,
510
+ payload: res,
511
+ timestamp: Date.now()
512
+ });
513
+ this.socket.send(resp, rinfo.port, rinfo.address);
514
+ } catch (err) {
515
+ const resp = JSON.stringify({
516
+ id: `res-${Date.now()}`,
517
+ type: "response",
518
+ correlationId: envelope.id,
519
+ error: err.message || String(err),
520
+ timestamp: Date.now()
521
+ });
522
+ this.socket.send(resp, rinfo.port, rinfo.address);
523
+ }
524
+ }
525
+ } catch (_) {
526
+ }
527
+ });
528
+ await new Promise((resolve) => {
529
+ this.socket.bind(port, "127.0.0.1", () => {
530
+ this.port = this.socket.address().port;
531
+ resolve();
532
+ });
533
+ });
534
+ return {
535
+ protocol: "udp",
536
+ address: "127.0.0.1",
537
+ port: this.port,
538
+ capabilities: ["datagram", "requestResponse"]
539
+ };
540
+ }
541
+ async send(endpoint, envelope) {
542
+ return new Promise((resolve, reject) => {
543
+ const client = import_dgram.default.createSocket("udp4");
544
+ const payload = Buffer.from(JSON.stringify(envelope));
545
+ client.on("message", (msg) => {
546
+ try {
547
+ const res = JSON.parse(msg.toString());
548
+ client.close();
549
+ resolve(res);
550
+ } catch (e) {
551
+ client.close();
552
+ reject(e);
553
+ }
554
+ });
555
+ client.on("error", (err) => {
556
+ client.close();
557
+ reject(err);
558
+ });
559
+ client.send(payload, endpoint.port, endpoint.address);
560
+ });
561
+ }
562
+ async stop() {
563
+ if (this.socket) {
564
+ await new Promise((r) => this.socket.close(() => r()));
565
+ this.socket = void 0;
566
+ }
567
+ }
568
+ };
569
+
570
+ // src/protocols/P2PProtocolAdapter.ts
571
+ var P2PProtocolAdapter = class _P2PProtocolAdapter {
572
+ protocol = "p2p";
573
+ capabilities = {
574
+ requestResponse: true,
575
+ streaming: true,
576
+ pubSub: true,
577
+ datagram: false,
578
+ peerToPeer: true,
579
+ signaling: true,
580
+ discovery: true
581
+ };
582
+ static peerHub = /* @__PURE__ */ new Map();
583
+ async expose(service) {
584
+ _P2PProtocolAdapter.peerHub.set(service.id, service);
585
+ return {
586
+ protocol: "p2p",
587
+ address: `p2p://${service.id}`,
588
+ capabilities: ["peerToPeer", "requestResponse", "pubSub"]
589
+ };
590
+ }
591
+ async send(endpoint, envelope) {
592
+ const peerId = endpoint.address.replace("p2p://", "");
593
+ const service = _P2PProtocolAdapter.peerHub.get(peerId);
594
+ if (!service) {
595
+ return {
596
+ id: `res-${Date.now()}`,
597
+ type: "response",
598
+ correlationId: envelope.id,
599
+ error: `Peer '${peerId}' not discovered or offline.`,
600
+ timestamp: Date.now()
601
+ };
602
+ }
603
+ try {
604
+ const res = await service.call(envelope.operation || "", envelope.payload);
605
+ return {
606
+ id: `res-${Date.now()}`,
607
+ type: "response",
608
+ correlationId: envelope.id,
609
+ payload: res,
610
+ timestamp: Date.now()
611
+ };
612
+ } catch (err) {
613
+ return {
614
+ id: `res-${Date.now()}`,
615
+ type: "response",
616
+ correlationId: envelope.id,
617
+ error: err.message || String(err),
618
+ timestamp: Date.now()
619
+ };
620
+ }
621
+ }
622
+ async stop() {
623
+ _P2PProtocolAdapter.peerHub.clear();
624
+ }
625
+ };
626
+
627
+ // src/transports/MemoryTransport.ts
628
+ var MemoryTransport = class {
629
+ handlers = /* @__PURE__ */ new Set();
630
+ onMessage(handler) {
631
+ this.handlers.add(handler);
632
+ return () => {
633
+ this.handlers.delete(handler);
634
+ };
635
+ }
636
+ async send(envelope) {
637
+ for (const handler of this.handlers) {
638
+ const res = await handler(envelope);
639
+ if (res) return res;
640
+ }
641
+ return {
642
+ id: `res-${Date.now()}`,
643
+ type: "response",
644
+ correlationId: envelope.id,
645
+ payload: null,
646
+ timestamp: Date.now()
647
+ };
648
+ }
649
+ };
650
+
651
+ // src/registry/ServiceRegistry.ts
652
+ var ServiceRegistry = class {
653
+ services = /* @__PURE__ */ new Map();
654
+ register(definition, endpoints = []) {
655
+ this.services.set(definition.id, {
656
+ definition,
657
+ endpoints,
658
+ registeredAt: Date.now()
659
+ });
660
+ }
661
+ unregister(serviceId) {
662
+ this.services.delete(serviceId);
663
+ }
664
+ get(serviceId) {
665
+ return this.services.get(serviceId);
666
+ }
667
+ list() {
668
+ return Array.from(this.services.values());
669
+ }
670
+ findByCapability(capabilityName) {
671
+ return this.list().filter(
672
+ (record) => record.definition.capabilities?.some((cap) => cap.name === capabilityName)
673
+ );
674
+ }
675
+ };
676
+
677
+ // src/runtime/ServiceRuntime.ts
678
+ var ServiceRuntime = class {
679
+ instances = /* @__PURE__ */ new Map();
680
+ registry;
681
+ constructor(registry) {
682
+ this.registry = registry || new ServiceRegistry();
683
+ }
684
+ register(service) {
685
+ this.instances.set(service.id, service);
686
+ this.registry.register(service.getDefinition());
687
+ return this;
688
+ }
689
+ get(serviceId) {
690
+ return this.instances.get(serviceId);
691
+ }
692
+ async execute(target, operation, input, ctx) {
693
+ const service = this.instances.get(target);
694
+ if (!service) {
695
+ throw new Error(`[ServiceRuntime] Target service '${target}' not found.`);
696
+ }
697
+ return await service.call(operation, input, ctx);
698
+ }
699
+ async startAll() {
700
+ for (const service of this.instances.values()) {
701
+ await service.start();
702
+ }
703
+ }
704
+ async stopAll() {
705
+ for (const service of this.instances.values()) {
706
+ await service.stop();
707
+ }
708
+ }
709
+ };
710
+
711
+ // src/discovery/ServiceDiscovery.ts
712
+ var ServiceDiscovery = class {
713
+ peers = /* @__PURE__ */ new Map();
714
+ registerPeer(id, name, endpoints) {
715
+ this.peers.set(id, {
716
+ id,
717
+ name,
718
+ endpoints,
719
+ lastSeen: Date.now()
720
+ });
721
+ }
722
+ getPeers() {
723
+ return Array.from(this.peers.values());
724
+ }
725
+ findPeer(id) {
726
+ return this.peers.get(id);
727
+ }
728
+ };
729
+
730
+ // src/connectivity/ProtocolResolver.ts
731
+ var ProtocolResolver = class {
732
+ static selectProtocol(requiredCapabilities, availableEndpoints) {
733
+ return availableEndpoints.find(
734
+ (ep) => requiredCapabilities.every((req) => ep.capabilities.includes(req))
735
+ );
736
+ }
737
+ static getSupportedProtocols(definition) {
738
+ return definition.protocols || ["http"];
739
+ }
740
+ };
741
+ // Annotate the CommonJS export names for ESM import in node:
742
+ 0 && (module.exports = {
743
+ HttpProtocolAdapter,
744
+ LifecycleManager,
745
+ MemoryTransport,
746
+ P2PProtocolAdapter,
747
+ ProtocolResolver,
748
+ ServiceDiscovery,
749
+ ServiceEventBus,
750
+ ServiceInstance,
751
+ ServiceProxy,
752
+ ServiceRegistry,
753
+ ServiceRuntime,
754
+ ServiceStateStore,
755
+ UdpProtocolAdapter,
756
+ WebSocketProtocolAdapter,
757
+ createService,
758
+ createServiceDefinition,
759
+ createServiceProxy
760
+ });