@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.
- package/README.md +95 -2
- package/package.json +75 -4
- package/packages/cli/dist/K_ENT_Entity-PQ5MURQY-ZG6FZXXX.js +13 -0
- package/packages/cli/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-K4CRQYA5.js +8 -0
- package/packages/cli/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-LNPXZYOE.js +110 -0
- package/packages/cli/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-3ALZPNX4.js +11 -0
- package/packages/cli/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-PJTICYSW.js +11 -0
- package/packages/cli/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-M5TYU55O.js +8 -0
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-H6STOXRK.js +20 -0
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-XPJXSF7D.js +19 -0
- package/packages/cli/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-CUYGTWOW.js +7 -0
- package/packages/cli/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-VR6T4N6J.js +17 -0
- package/packages/cli/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-RLJ4QWDP.js +58 -0
- package/packages/cli/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-BOQGUASC.js +22 -0
- package/packages/cli/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-XJI7KIT5.js +8 -0
- package/packages/cli/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-K5VCWAFW.js +9 -0
- package/packages/cli/dist/bin/krnl.cjs +9758 -0
- package/packages/cli/dist/bin/krnl.d.cts +1 -0
- package/packages/cli/dist/bin/krnl.d.ts +1 -0
- package/packages/cli/dist/bin/krnl.js +2006 -0
- package/packages/cli/dist/chunk-3TRM6CYL.js +152 -0
- package/packages/cli/dist/chunk-5JDK35TG.js +3872 -0
- package/packages/cli/dist/chunk-63PTK33I.js +997 -0
- package/packages/cli/dist/chunk-6NIKAMUZ.js +82 -0
- package/packages/cli/dist/chunk-BOXWWXQG.js +400 -0
- package/packages/cli/dist/chunk-EEKLK7QJ.js +565 -0
- package/packages/cli/dist/chunk-EG7T2IAD.js +107 -0
- package/packages/cli/dist/chunk-F5EHXE2O.js +1036 -0
- package/packages/cli/dist/chunk-F65ANSQG.js +269 -0
- package/packages/cli/dist/chunk-FDNCADFE.js +71 -0
- package/packages/cli/dist/chunk-GDLRMDAN.js +127 -0
- package/packages/cli/dist/chunk-HWMTCMOS.js +656 -0
- package/packages/cli/dist/chunk-I74QIQOD.js +5536 -0
- package/packages/cli/dist/chunk-JTLSTO25.js +71 -0
- package/packages/cli/dist/chunk-JULBBJ27.js +1033 -0
- package/packages/cli/dist/chunk-OHVMVRBP.js +117 -0
- package/packages/cli/dist/chunk-P2PCLEKX.js +666 -0
- package/packages/cli/dist/chunk-PJQIUOX2.js +7767 -0
- package/packages/cli/dist/chunk-PPOF3DJW.js +471 -0
- package/packages/cli/dist/chunk-Q45257P6.js +173 -0
- package/packages/cli/dist/chunk-QNROWGBI.js +1036 -0
- package/packages/cli/dist/chunk-RJNYUXZD.js +977 -0
- package/packages/cli/dist/chunk-SRTOPJ5W.js +104 -0
- package/packages/cli/dist/chunk-TCEX3MPS.js +702 -0
- package/packages/cli/dist/chunk-TNOAJO2J.js +675 -0
- package/packages/cli/dist/chunk-UR2SUCSF.js +701 -0
- package/packages/cli/dist/chunk-X5LOIFM7.js +68 -0
- package/packages/cli/dist/chunk-XIRFOO3H.js +589 -0
- package/packages/cli/dist/chunk-ZAAV3JXQ.js +809 -0
- package/packages/cli/dist/index.cjs +7798 -0
- package/packages/cli/dist/index.d.cts +7 -0
- package/packages/cli/dist/index.d.ts +7 -0
- package/packages/cli/dist/index.js +29 -0
- package/packages/cli/package.json +34 -0
- package/packages/core/dist/K_ENT_Entity-4MB7CU4A.js +12 -0
- package/packages/core/dist/K_ENT_Entity-DEJGIDGH.js +12 -0
- package/packages/core/dist/K_ENT_Entity-FXZO5UZ2.js +12 -0
- package/packages/core/dist/K_ENT_Entity-HDSCXC5F.js +12 -0
- package/packages/core/dist/K_ENT_Entity-JILABHLW.js +12 -0
- package/packages/core/dist/K_ENT_Entity-PQ5MURQY.js +13 -0
- package/packages/core/dist/K_ENT_Entity-ROAKDIHW.js +12 -0
- package/packages/core/dist/K_ENT_Entity-TBVFSKDV.js +12 -0
- package/packages/core/dist/K_ENT_Entity-ZFLKG3JO.js +12 -0
- package/packages/core/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW.js +8 -0
- package/packages/core/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF.js +110 -0
- package/packages/core/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF.js +9 -0
- package/packages/core/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X.js +9 -0
- package/packages/core/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW.js +8 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2.js +20 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-4C6GBQAG.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-6V23A6F6.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK.js +19 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-DYLLC5G2.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-F4FOFAUP.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-FBOXXMI3.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-Q73BWLNP.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QM2C4MVA.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-QUGI6SMP.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RGMTBHNP.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Registry-RWR7UNDW.js +18 -0
- package/packages/core/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7.js +7 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-32MFJJ5Z.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-4J4CEWRY.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-A366YHF2.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-LK4LYJHI.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-NW3K63II.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-QDHTI5ZV.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-VHCT6VIW.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-WBRKF24R.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-XKYQYT6Q.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_App_Adapter-Z2PWZYDZ.js +17 -0
- package/packages/core/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5.js +58 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-2EZU7QF4.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-6G3AQNAV.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-B2NZMQUG.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-C2RABMZP.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-HHE3NZ4F.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-LHFGR6WK.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-M74BLM3N.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-PT6ZA6EA.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-SP52V3CX.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF.js +22 -0
- package/packages/core/dist/K_LIB_Krnl_System_Magnetic_Loader-YNSEUHJJ.js +21 -0
- package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-M6SBHIVA.js +8 -0
- package/packages/core/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG.js +8 -0
- package/packages/core/dist/K_LIB_Krnl_Telemetry-77FRZ3KV.js +9 -0
- package/packages/core/dist/chunk-33L2J7V7.js +82 -0
- package/packages/core/dist/chunk-3ES4K2ZP.js +817 -0
- package/packages/core/dist/chunk-3SMHVVLL.js +82 -0
- package/packages/core/dist/chunk-3UEZ7JQA.js +4877 -0
- package/packages/core/dist/chunk-3XIE6KBD.js +4877 -0
- package/packages/core/dist/chunk-46ZLCML6.js +107 -0
- package/packages/core/dist/chunk-4UEL3DWJ.js +107 -0
- package/packages/core/dist/chunk-54GWZ5PC.js +82 -0
- package/packages/core/dist/chunk-6QCYRS5L.js +127 -0
- package/packages/core/dist/chunk-6ULMHNXR.js +104 -0
- package/packages/core/dist/chunk-7WUETJEV.js +117 -0
- package/packages/core/dist/chunk-A5KRAYDB.js +107 -0
- package/packages/core/dist/chunk-ANEAZ3PO.js +107 -0
- package/packages/core/dist/chunk-BE76RL6F.js +82 -0
- package/packages/core/dist/chunk-CIARVYDO.js +107 -0
- package/packages/core/dist/chunk-CR2ANE62.js +107 -0
- package/packages/core/dist/chunk-DI27MOR7.js +173 -0
- package/packages/core/dist/chunk-E6RLFHM5.js +596 -0
- package/packages/core/dist/chunk-EELAPMNV.js +4877 -0
- package/packages/core/dist/chunk-ENZ2RQVJ.js +107 -0
- package/packages/core/dist/chunk-F2U6CX4F.js +4877 -0
- package/packages/core/dist/chunk-FKG64OHL.js +82 -0
- package/packages/core/dist/chunk-FYAZJYM5.js +772 -0
- package/packages/core/dist/chunk-G4NP4RDQ.js +82 -0
- package/packages/core/dist/chunk-GADIRLRS.js +473 -0
- package/packages/core/dist/chunk-GR6CSLQJ.js +772 -0
- package/packages/core/dist/chunk-HDS7AT6O.js +772 -0
- package/packages/core/dist/chunk-HIMEZUU2.js +71 -0
- package/packages/core/dist/chunk-IB4UHG5I.js +596 -0
- package/packages/core/dist/chunk-J7ZYNVRS.js +772 -0
- package/packages/core/dist/chunk-JVLZU4K7.js +604 -0
- package/packages/core/dist/chunk-JYXXI7Q3.js +82 -0
- package/packages/core/dist/chunk-K54K2KZW.js +192 -0
- package/packages/core/dist/chunk-K6VHLBNH.js +3316 -0
- package/packages/core/dist/chunk-KCBP7ZYA.js +596 -0
- package/packages/core/dist/chunk-KFQGP6VL.js +33 -0
- package/packages/core/dist/chunk-KIUEUI7K.js +82 -0
- package/packages/core/dist/chunk-LB67NIZP.js +949 -0
- package/packages/core/dist/chunk-LDTYFUNW.js +596 -0
- package/packages/core/dist/chunk-MLVWARD4.js +596 -0
- package/packages/core/dist/chunk-MPYVXHKO.js +2777 -0
- package/packages/core/dist/chunk-MRQ3MITU.js +772 -0
- package/packages/core/dist/chunk-MVUN7I7O.js +107 -0
- package/packages/core/dist/chunk-NDDOIRW7.js +596 -0
- package/packages/core/dist/chunk-O3KDB5MH.js +3330 -0
- package/packages/core/dist/chunk-OEINUDSE.js +400 -0
- package/packages/core/dist/chunk-OPDENPT4.js +4877 -0
- package/packages/core/dist/chunk-P6XEM2LA.js +429 -0
- package/packages/core/dist/chunk-QKMRSQV4.js +82 -0
- package/packages/core/dist/chunk-R6CCWALL.js +4877 -0
- package/packages/core/dist/chunk-RAMMOO73.js +774 -0
- package/packages/core/dist/chunk-S3FTZFG6.js +772 -0
- package/packages/core/dist/chunk-T2ZVN434.js +4877 -0
- package/packages/core/dist/chunk-TFHLDMIA.js +107 -0
- package/packages/core/dist/chunk-TI3QUCIJ.js +107 -0
- package/packages/core/dist/chunk-TR2BAIGI.js +107 -0
- package/packages/core/dist/chunk-UGVVJKC6.js +4877 -0
- package/packages/core/dist/chunk-V2DX7YIU.js +984 -0
- package/packages/core/dist/chunk-W4IHYUYD.js +772 -0
- package/packages/core/dist/chunk-W6WBG5OY.js +4877 -0
- package/packages/core/dist/chunk-WN3M7O7H.js +3312 -0
- package/packages/core/dist/chunk-WR3NCU7U.js +4877 -0
- package/packages/core/dist/chunk-XC6B6L27.js +82 -0
- package/packages/core/dist/chunk-XNSE64ZY.js +3316 -0
- package/packages/core/dist/chunk-XROES2WN.js +634 -0
- package/packages/core/dist/chunk-XSCKNRCZ.js +5020 -0
- package/packages/core/dist/chunk-XVABPAUZ.js +82 -0
- package/packages/core/dist/chunk-YOBCB5C5.js +596 -0
- package/packages/core/dist/chunk-YUK6Q563.js +666 -0
- package/packages/core/dist/chunk-YXGL3ZEU.js +1030 -0
- package/packages/core/dist/chunk-ZINJ5OUX.js +596 -0
- package/packages/core/dist/chunk-ZPFD4BIQ.js +604 -0
- package/packages/core/dist/chunk-ZQZBFG6F.js +4826 -0
- package/packages/core/dist/chunk-ZZFRJGXM.js +4877 -0
- package/packages/core/dist/index.cjs +760 -0
- package/packages/core/dist/index.d.cts +360 -0
- package/packages/core/dist/index.d.ts +360 -0
- package/packages/core/dist/index.js +707 -0
- package/packages/core/package.json +34 -0
- package/packages/create-krnl/dist/K_ENT_Entity-PQ5MURQY-R2OH4VXE.js +14 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Aiko_Client-OPZAVZCW-AZM5HF4M.js +9 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF-X5N6SV2S.js +111 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF-5PFHF4JU.js +12 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X-ED33OQPH.js +12 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Registry_Client-NXV6D2QW-YGQLVR4P.js +9 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Engine-7HR5HWW2-VM7CTU2L.js +21 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Registry-7XYGDKJK-Y2GQFJ7I.js +21 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_SubApp_Worker_Host-CQVTGGG7-L3JQWO54.js +8 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_System_App_Adapter-M6FJKLGU-KQARASPR.js +19 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-OF3IGLVL.js +59 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Magnetic_Loader-XBQO2KXF-JOLHKOEX.js +24 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_System_Unified_Http_Adapter-RCEGP3OG-L46LSHKQ.js +10 -0
- package/packages/create-krnl/dist/K_LIB_Krnl_Telemetry-77FRZ3KV-4JUPRR3X.js +10 -0
- package/packages/create-krnl/dist/chunk-3TRM6CYL.js +152 -0
- package/packages/create-krnl/dist/chunk-3URCB3QS.js +127 -0
- package/packages/create-krnl/dist/chunk-5JDK35TG.js +3872 -0
- package/packages/create-krnl/dist/chunk-A2XAXDOW.js +812 -0
- package/packages/create-krnl/dist/chunk-AN6TMQHG.js +1033 -0
- package/packages/create-krnl/dist/chunk-BOXWWXQG.js +400 -0
- package/packages/create-krnl/dist/chunk-BPTBREBG.js +38 -0
- package/packages/create-krnl/dist/chunk-FDNCADFE.js +71 -0
- package/packages/create-krnl/dist/chunk-JTLSTO25.js +71 -0
- package/packages/create-krnl/dist/chunk-M3NCUIPL.js +107 -0
- package/packages/create-krnl/dist/chunk-N2EONSOC.js +7769 -0
- package/packages/create-krnl/dist/chunk-OHVMVRBP.js +117 -0
- package/packages/create-krnl/dist/chunk-Q45257P6.js +173 -0
- package/packages/create-krnl/dist/chunk-QGM4M3NI.js +37 -0
- package/packages/create-krnl/dist/chunk-RJNYUXZD.js +977 -0
- package/packages/create-krnl/dist/chunk-SRTOPJ5W.js +104 -0
- package/packages/create-krnl/dist/chunk-UPBIGEC3.js +666 -0
- package/packages/create-krnl/dist/chunk-V2DB7UD7.js +82 -0
- package/packages/create-krnl/dist/chunk-WMHLIUI6.js +3644 -0
- package/packages/create-krnl/dist/chunk-XIRFOO3H.js +589 -0
- package/packages/create-krnl/dist/chunk-Y2CEEVZP.js +5536 -0
- package/packages/create-krnl/dist/index.cjs +395 -0
- package/packages/create-krnl/dist/index.js +372 -0
- package/packages/create-krnl/dist/main-DXUMPBND.js +2217 -0
- package/packages/create-krnl/dist/wrapper-SDF2VKX3.js +31 -0
- package/packages/create-krnl/package.json +23 -0
- package/packages/eslint-plugin/dist/index.cjs +439 -0
- package/packages/eslint-plugin/dist/index.d.cts +336 -0
- package/packages/eslint-plugin/dist/index.d.ts +336 -0
- package/packages/eslint-plugin/dist/index.js +416 -0
- package/packages/eslint-plugin/package.json +24 -0
- package/packages/validate/dist/index.cjs +499 -0
- package/packages/validate/dist/index.d.cts +49 -0
- package/packages/validate/dist/index.d.ts +49 -0
- package/packages/validate/dist/index.js +462 -0
- package/packages/validate/package.json +27 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dinilmusick/krnl-core",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Core runtime engine, Service facades, Protocols, Transports, and Execution flows for Krnl backend services",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"registry": "https://npm.pkg.github.com"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup src/index.ts --dts --format esm,cjs --external ws,zod,zod-to-json-schema,esbuild"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"esbuild": "^0.25.0",
|
|
22
|
+
"protobufjs": "^8.7.1",
|
|
23
|
+
"ws": "^8.18.0",
|
|
24
|
+
"zod": "3.24.1",
|
|
25
|
+
"zod-to-json-schema": "3.24.1"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^25.6.0",
|
|
29
|
+
"@types/ws": "^8.18.1",
|
|
30
|
+
"protobufjs-cli": "^2.6.1",
|
|
31
|
+
"tsup": "^8.4.0",
|
|
32
|
+
"typescript": "^5.7.3"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity
|
|
3
|
+
} from "./chunk-RJNYUXZD.js";
|
|
4
|
+
import "./chunk-BOXWWXQG.js";
|
|
5
|
+
import "./chunk-FDNCADFE.js";
|
|
6
|
+
import "./chunk-5JDK35TG.js";
|
|
7
|
+
import "./chunk-Q45257P6.js";
|
|
8
|
+
import "./chunk-XIRFOO3H.js";
|
|
9
|
+
import "./chunk-JTLSTO25.js";
|
|
10
|
+
import "./chunk-BPTBREBG.js";
|
|
11
|
+
import "./chunk-QGM4M3NI.js";
|
|
12
|
+
export {
|
|
13
|
+
Entity
|
|
14
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import "./chunk-BPTBREBG.js";
|
|
2
|
+
import "./chunk-QGM4M3NI.js";
|
|
3
|
+
|
|
4
|
+
// ../core/dist/K_LIB_Krnl_Ep_Tools-ROOE2TQF.js
|
|
5
|
+
var KrnlEpTools = {
|
|
6
|
+
calculator: {
|
|
7
|
+
id: "calculator",
|
|
8
|
+
description: "eval arith-expr(str) \u2192 num. use-when: derive numeric val from schema fields.",
|
|
9
|
+
schema: {
|
|
10
|
+
input: { expression: "str: arith expr. ops: +,-,*,/,(). e.g. '(a+b)*c'" },
|
|
11
|
+
output: "num"
|
|
12
|
+
},
|
|
13
|
+
examples: [
|
|
14
|
+
{ input: { expression: "10 + 5 * 2" }, output: 20 },
|
|
15
|
+
{ input: { expression: "(100-30)/7" }, output: 10 }
|
|
16
|
+
],
|
|
17
|
+
execute: (expression) => {
|
|
18
|
+
const sanitized = expression.replace(/[^0-9+\-*/().\s]/g, "");
|
|
19
|
+
try {
|
|
20
|
+
const result = new Function(`return (${sanitized});`)();
|
|
21
|
+
if (typeof result === "number") return result;
|
|
22
|
+
throw new Error("Result is not a number");
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw new Error(`Math evaluation failed: ${e.message}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
jsonCreator: {
|
|
29
|
+
id: "jsonCreator",
|
|
30
|
+
description: "parse(jsonStr) \u2192 obj | merge(obj,base) \u2192 merged. use-when: validate/build payload.",
|
|
31
|
+
schema: {
|
|
32
|
+
input: { jsonStr: "str: valid JSON", mergeWith: "obj? base to merge into" },
|
|
33
|
+
output: "obj"
|
|
34
|
+
},
|
|
35
|
+
examples: [
|
|
36
|
+
{ input: { jsonStr: '{"a":1}' }, output: { a: 1 } },
|
|
37
|
+
{ input: { jsonStr: '{"b":2}', mergeWith: { a: 1 } }, output: { a: 1, b: 2 } }
|
|
38
|
+
],
|
|
39
|
+
execute: (jsonStr, mergeWith) => {
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(jsonStr);
|
|
42
|
+
if (mergeWith && typeof mergeWith === "object") {
|
|
43
|
+
return { ...mergeWith, ...parsed };
|
|
44
|
+
}
|
|
45
|
+
return parsed;
|
|
46
|
+
} catch (e) {
|
|
47
|
+
throw new Error(`JSON validation/parsing failed: ${e.message}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
textFormatter: {
|
|
52
|
+
id: "textFormatter",
|
|
53
|
+
description: "render(template,vars) \u2192 str. use-when: replace placeholders in templates.",
|
|
54
|
+
schema: {
|
|
55
|
+
input: { template: "str w/ {{key}} placeholders", variables: "obj mapping keys \u2192 values" },
|
|
56
|
+
output: "str"
|
|
57
|
+
},
|
|
58
|
+
examples: [
|
|
59
|
+
{ input: { template: "hello {{name}}", variables: { name: "alice" } }, output: "hello alice" }
|
|
60
|
+
],
|
|
61
|
+
execute: (template, variables) => {
|
|
62
|
+
let result = template;
|
|
63
|
+
for (const [key, value] of Object.entries(variables)) {
|
|
64
|
+
result = result.replace(new RegExp(`{{\\s*${key}\\s*}}`, "g"), String(value));
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
endpointCaller: {
|
|
70
|
+
id: "endpointCaller",
|
|
71
|
+
description: "call(endpointId,payload) \u2192 res. use-when: invoke sibling endpoint in same system.",
|
|
72
|
+
schema: {
|
|
73
|
+
input: { endpointId: "str: target endpoint", payload: "obj: input matching target schema" },
|
|
74
|
+
output: "any"
|
|
75
|
+
},
|
|
76
|
+
examples: [
|
|
77
|
+
{ input: { endpointId: "StoreKey", payload: { name: "test", value: "val" } }, output: { status: "success" } }
|
|
78
|
+
],
|
|
79
|
+
execute: async (system, endpointId, payload) => {
|
|
80
|
+
if (!system || typeof system.call !== "function") {
|
|
81
|
+
throw new Error("System host entity not available or invalid.");
|
|
82
|
+
}
|
|
83
|
+
return await system.call(endpointId, payload, { unwrap: true });
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
healthChecker: {
|
|
87
|
+
id: "healthChecker",
|
|
88
|
+
description: "ping(peerId) \u2192 status. use-when: verify component/sibling system is alive.",
|
|
89
|
+
schema: {
|
|
90
|
+
input: { peerId: "str: peer system identifier" },
|
|
91
|
+
output: "obj"
|
|
92
|
+
},
|
|
93
|
+
examples: [
|
|
94
|
+
{ input: { peerId: "Aiko" }, output: { status: "alive" } }
|
|
95
|
+
],
|
|
96
|
+
execute: async (system, peerId) => {
|
|
97
|
+
if (!system) throw new Error("System host entity not available.");
|
|
98
|
+
const peer = system.getRemoteEntity ? system.getRemoteEntity(peerId) : null;
|
|
99
|
+
if (peer) {
|
|
100
|
+
return await peer.call("heartbeat", {});
|
|
101
|
+
}
|
|
102
|
+
if (system.localFunctionalities?.has("heartbeat")) {
|
|
103
|
+
return await system.call("heartbeat", {});
|
|
104
|
+
}
|
|
105
|
+
throw new Error(`Peer or heartbeat endpoint not found for: ${peerId}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
KrnlEpTools
|
|
111
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlFrontendBuilder,
|
|
3
|
+
init_K_LIB_Krnl_Frontend_Builder
|
|
4
|
+
} from "./chunk-3URCB3QS.js";
|
|
5
|
+
import "./chunk-BPTBREBG.js";
|
|
6
|
+
import "./chunk-QGM4M3NI.js";
|
|
7
|
+
|
|
8
|
+
// ../core/dist/K_LIB_Krnl_Frontend_Builder-2ZDUH6PF.js
|
|
9
|
+
init_K_LIB_Krnl_Frontend_Builder();
|
|
10
|
+
export {
|
|
11
|
+
KrnlFrontendBuilder
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlFrontendGenerator,
|
|
3
|
+
init_K_LIB_Krnl_Frontend_Generator
|
|
4
|
+
} from "./chunk-AN6TMQHG.js";
|
|
5
|
+
import "./chunk-BPTBREBG.js";
|
|
6
|
+
import "./chunk-QGM4M3NI.js";
|
|
7
|
+
|
|
8
|
+
// ../core/dist/K_LIB_Krnl_Frontend_Generator-UYNRNX2X.js
|
|
9
|
+
init_K_LIB_Krnl_Frontend_Generator();
|
|
10
|
+
export {
|
|
11
|
+
KrnlFrontendGenerator
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DefaultEventRegistrar,
|
|
3
|
+
DefaultOperationRegistrar,
|
|
4
|
+
DefaultServiceContainer,
|
|
5
|
+
KrnlSubAppDiscovery,
|
|
6
|
+
KrnlSubAppLifecycle,
|
|
7
|
+
KrnlSubAppValidator,
|
|
8
|
+
createHttpsAppAdapter
|
|
9
|
+
} from "./chunk-BOXWWXQG.js";
|
|
10
|
+
import "./chunk-JTLSTO25.js";
|
|
11
|
+
import "./chunk-BPTBREBG.js";
|
|
12
|
+
import "./chunk-QGM4M3NI.js";
|
|
13
|
+
export {
|
|
14
|
+
DefaultEventRegistrar,
|
|
15
|
+
DefaultOperationRegistrar,
|
|
16
|
+
DefaultServiceContainer,
|
|
17
|
+
KrnlSubAppDiscovery,
|
|
18
|
+
KrnlSubAppLifecycle,
|
|
19
|
+
KrnlSubAppValidator,
|
|
20
|
+
createHttpsAppAdapter
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlSubAppLoader
|
|
3
|
+
} from "./chunk-V2DB7UD7.js";
|
|
4
|
+
import "./chunk-UPBIGEC3.js";
|
|
5
|
+
import "./chunk-FDNCADFE.js";
|
|
6
|
+
import "./chunk-N2EONSOC.js";
|
|
7
|
+
import "./chunk-AN6TMQHG.js";
|
|
8
|
+
import "./chunk-3URCB3QS.js";
|
|
9
|
+
import "./chunk-Y2CEEVZP.js";
|
|
10
|
+
import "./chunk-A2XAXDOW.js";
|
|
11
|
+
import "./chunk-5JDK35TG.js";
|
|
12
|
+
import "./chunk-Q45257P6.js";
|
|
13
|
+
import "./chunk-3TRM6CYL.js";
|
|
14
|
+
import "./chunk-XIRFOO3H.js";
|
|
15
|
+
import "./chunk-WMHLIUI6.js";
|
|
16
|
+
import "./chunk-JTLSTO25.js";
|
|
17
|
+
import "./chunk-BPTBREBG.js";
|
|
18
|
+
import "./chunk-QGM4M3NI.js";
|
|
19
|
+
export {
|
|
20
|
+
KrnlSubAppLoader
|
|
21
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlNonKrnlAppAdapter
|
|
3
|
+
} from "./chunk-M3NCUIPL.js";
|
|
4
|
+
import "./chunk-N2EONSOC.js";
|
|
5
|
+
import "./chunk-AN6TMQHG.js";
|
|
6
|
+
import "./chunk-3URCB3QS.js";
|
|
7
|
+
import "./chunk-Y2CEEVZP.js";
|
|
8
|
+
import "./chunk-A2XAXDOW.js";
|
|
9
|
+
import "./chunk-5JDK35TG.js";
|
|
10
|
+
import "./chunk-Q45257P6.js";
|
|
11
|
+
import "./chunk-3TRM6CYL.js";
|
|
12
|
+
import "./chunk-XIRFOO3H.js";
|
|
13
|
+
import "./chunk-WMHLIUI6.js";
|
|
14
|
+
import "./chunk-JTLSTO25.js";
|
|
15
|
+
import "./chunk-BPTBREBG.js";
|
|
16
|
+
import "./chunk-QGM4M3NI.js";
|
|
17
|
+
export {
|
|
18
|
+
KrnlNonKrnlAppAdapter
|
|
19
|
+
};
|
package/packages/create-krnl/dist/K_LIB_Krnl_System_Base_Functionality_APIs-ZZUZ6ZG5-OF3IGLVL.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
adminCommandApi,
|
|
3
|
+
aiOrchestrationApi,
|
|
4
|
+
buildEndpointDefinition,
|
|
5
|
+
deregisterAppApi,
|
|
6
|
+
discoverPeersApi,
|
|
7
|
+
findFreePortsApi,
|
|
8
|
+
getAikoCatalogApi,
|
|
9
|
+
getEndpointDefinitionsApi,
|
|
10
|
+
getFullDocumentationApi,
|
|
11
|
+
getIngressNetworkTopologyApi,
|
|
12
|
+
getLastActionDocsApi,
|
|
13
|
+
getManifestApi,
|
|
14
|
+
getSiblingNetworkTopologyApi,
|
|
15
|
+
getSubAppTopologyApi,
|
|
16
|
+
getTaskListApi,
|
|
17
|
+
getTelemetryLogApi,
|
|
18
|
+
getUsedPortsApi,
|
|
19
|
+
heartbeatApi,
|
|
20
|
+
heartbeatAppApi,
|
|
21
|
+
listAppsApi,
|
|
22
|
+
lookupAppApi,
|
|
23
|
+
registerAppApi,
|
|
24
|
+
setEndpointDefinitionApi,
|
|
25
|
+
shutdownApi,
|
|
26
|
+
systemCommandsCollectorHandler,
|
|
27
|
+
telemetryApi
|
|
28
|
+
} from "./chunk-Y2CEEVZP.js";
|
|
29
|
+
import "./chunk-Q45257P6.js";
|
|
30
|
+
import "./chunk-BPTBREBG.js";
|
|
31
|
+
import "./chunk-QGM4M3NI.js";
|
|
32
|
+
export {
|
|
33
|
+
adminCommandApi,
|
|
34
|
+
aiOrchestrationApi,
|
|
35
|
+
buildEndpointDefinition,
|
|
36
|
+
deregisterAppApi,
|
|
37
|
+
discoverPeersApi,
|
|
38
|
+
findFreePortsApi,
|
|
39
|
+
getAikoCatalogApi,
|
|
40
|
+
getEndpointDefinitionsApi,
|
|
41
|
+
getFullDocumentationApi,
|
|
42
|
+
getIngressNetworkTopologyApi,
|
|
43
|
+
getLastActionDocsApi,
|
|
44
|
+
getManifestApi,
|
|
45
|
+
getSiblingNetworkTopologyApi,
|
|
46
|
+
getSubAppTopologyApi,
|
|
47
|
+
getTaskListApi,
|
|
48
|
+
getTelemetryLogApi,
|
|
49
|
+
getUsedPortsApi,
|
|
50
|
+
heartbeatApi,
|
|
51
|
+
heartbeatAppApi,
|
|
52
|
+
listAppsApi,
|
|
53
|
+
lookupAppApi,
|
|
54
|
+
registerAppApi,
|
|
55
|
+
setEndpointDefinitionApi,
|
|
56
|
+
shutdownApi,
|
|
57
|
+
systemCommandsCollectorHandler,
|
|
58
|
+
telemetryApi
|
|
59
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlMagneticLoader,
|
|
3
|
+
magneticStorage,
|
|
4
|
+
subappLocalStorage
|
|
5
|
+
} from "./chunk-UPBIGEC3.js";
|
|
6
|
+
import "./chunk-FDNCADFE.js";
|
|
7
|
+
import "./chunk-N2EONSOC.js";
|
|
8
|
+
import "./chunk-AN6TMQHG.js";
|
|
9
|
+
import "./chunk-3URCB3QS.js";
|
|
10
|
+
import "./chunk-Y2CEEVZP.js";
|
|
11
|
+
import "./chunk-A2XAXDOW.js";
|
|
12
|
+
import "./chunk-5JDK35TG.js";
|
|
13
|
+
import "./chunk-Q45257P6.js";
|
|
14
|
+
import "./chunk-3TRM6CYL.js";
|
|
15
|
+
import "./chunk-XIRFOO3H.js";
|
|
16
|
+
import "./chunk-WMHLIUI6.js";
|
|
17
|
+
import "./chunk-JTLSTO25.js";
|
|
18
|
+
import "./chunk-BPTBREBG.js";
|
|
19
|
+
import "./chunk-QGM4M3NI.js";
|
|
20
|
+
export {
|
|
21
|
+
KrnlMagneticLoader,
|
|
22
|
+
magneticStorage,
|
|
23
|
+
subappLocalStorage
|
|
24
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KrnlHTTP
|
|
3
|
+
} from "./chunk-XIRFOO3H.js";
|
|
4
|
+
|
|
5
|
+
// ../core/dist/chunk-GADIRLRS.js
|
|
6
|
+
import { exec, spawn } from "child_process";
|
|
7
|
+
import path3 from "path";
|
|
8
|
+
import fs3 from "fs";
|
|
9
|
+
var KrnlShell = class {
|
|
10
|
+
/**
|
|
11
|
+
* Promisified command execution.
|
|
12
|
+
*/
|
|
13
|
+
static exec(cmd, opts = {}) {
|
|
14
|
+
const timeout = opts.timeout || 3e4;
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
exec(cmd, { ...opts, timeout }, (error, stdout, stderr) => {
|
|
17
|
+
if (error) {
|
|
18
|
+
reject(new Error(`[KrnlShellError] Command failed: ${cmd}
|
|
19
|
+
Exit Code: ${error.code}
|
|
20
|
+
Stderr: ${String(stderr)}`));
|
|
21
|
+
} else {
|
|
22
|
+
resolve({ stdout: String(stdout), stderr: String(stderr) });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Streaming command execution.
|
|
29
|
+
*/
|
|
30
|
+
static spawn(cmd, args, opts = {}) {
|
|
31
|
+
const child = spawn(cmd, args, opts);
|
|
32
|
+
const promise = new Promise((resolve, reject) => {
|
|
33
|
+
child.on("close", (code, signal) => {
|
|
34
|
+
resolve({ code, signal });
|
|
35
|
+
});
|
|
36
|
+
child.on("error", (err) => {
|
|
37
|
+
reject(err);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
pid: child.pid,
|
|
42
|
+
kill: (signal) => child.kill(signal),
|
|
43
|
+
promise
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Defines posix vs win32 specific commands.
|
|
48
|
+
*/
|
|
49
|
+
static platform(routing) {
|
|
50
|
+
return process.platform === "win32" ? routing.win32 : routing.posix;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Resolves the full path of a binary.
|
|
54
|
+
*/
|
|
55
|
+
static which(cmd) {
|
|
56
|
+
const envPath = process.env.PATH || "";
|
|
57
|
+
const paths = envPath.split(path3.delimiter);
|
|
58
|
+
const extensions = process.platform === "win32" ? [".exe", ".cmd", ".bat", ""] : [""];
|
|
59
|
+
for (const p of paths) {
|
|
60
|
+
for (const ext of extensions) {
|
|
61
|
+
const fullPath = path3.join(p, `${cmd}${ext}`);
|
|
62
|
+
try {
|
|
63
|
+
if (fs3.existsSync(fullPath) && fs3.statSync(fullPath).isFile()) {
|
|
64
|
+
return fullPath;
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var KrnlAikoClient = class _KrnlAikoClient {
|
|
74
|
+
baseUrl;
|
|
75
|
+
lastUsedModelId = null;
|
|
76
|
+
constructor(aikoPort, aikoHost = "localhost") {
|
|
77
|
+
this.baseUrl = `http://${aikoHost}:${aikoPort}`;
|
|
78
|
+
}
|
|
79
|
+
static discover(system) {
|
|
80
|
+
const aikoPeer = system.peers?.get("Aiko");
|
|
81
|
+
if (aikoPeer && aikoPeer.address) {
|
|
82
|
+
let addr = aikoPeer.address;
|
|
83
|
+
if (!addr.startsWith("http")) {
|
|
84
|
+
addr = `http://${addr}`;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const url = new URL(addr);
|
|
88
|
+
return new _KrnlAikoClient(Number(url.port || 10095), url.hostname);
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error("[KrnlAikoClient] Failed to parse discovered Aiko address:", addr, e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
async infer(intelligenceSpec, systemPrompt, userPrompt) {
|
|
96
|
+
const client = KrnlHTTP.createClient(this.baseUrl);
|
|
97
|
+
const result = await client.post("/call/infer", {
|
|
98
|
+
intelligenceSpec,
|
|
99
|
+
systemPrompt,
|
|
100
|
+
userPrompt
|
|
101
|
+
});
|
|
102
|
+
if (result && result.status === "success" && result.data && result.data.status === "success" && result.data.payload && result.data.payload.status === "success" && result.data.payload.response) {
|
|
103
|
+
this.lastUsedModelId = result.data.payload.modelId || null;
|
|
104
|
+
return result.data.payload.response;
|
|
105
|
+
}
|
|
106
|
+
const errMsg = result.status === "success" ? result.data?.payload?.message || result.data?.message : result.message;
|
|
107
|
+
throw new Error(errMsg || "Invalid or empty response from Aiko infer endpoint");
|
|
108
|
+
}
|
|
109
|
+
async downrankModel(modelId) {
|
|
110
|
+
try {
|
|
111
|
+
const client = KrnlHTTP.createClient(this.baseUrl);
|
|
112
|
+
await client.post("/call/downrankModel", { modelId });
|
|
113
|
+
} catch (e) {
|
|
114
|
+
console.error("[KrnlAikoClient] Failed to send downrank request to Aiko:", e.message);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async fetchCatalog() {
|
|
118
|
+
const client = KrnlHTTP.createClient(this.baseUrl);
|
|
119
|
+
const result = await client.post("/call/SessionManager/AgentProfileManager", {
|
|
120
|
+
action: "list"
|
|
121
|
+
});
|
|
122
|
+
if (result && result.status === "success" && result.data && result.data.status === "success" && result.data.profiles) {
|
|
123
|
+
return result.data.profiles;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
"endpoint-grade-1": { description: "Nano \u2014 simple CRUD" },
|
|
127
|
+
"endpoint-grade-2": { description: "Mini \u2014 standard ops" },
|
|
128
|
+
"endpoint-grade-3": { description: "Standard \u2014 moderate logic" },
|
|
129
|
+
"endpoint-grade-4": { description: "Large \u2014 complex reasoning" },
|
|
130
|
+
"endpoint-grade-5": { description: "Expert \u2014 escalation handler" },
|
|
131
|
+
"orchestrator-standard": { description: "Standard routing" },
|
|
132
|
+
"orchestrator-pro": { description: "Complex routing + escalation" }
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async isAlive() {
|
|
136
|
+
try {
|
|
137
|
+
const client = KrnlHTTP.createClient(this.baseUrl);
|
|
138
|
+
const result = await client.post("/call/heartbeat", {});
|
|
139
|
+
return result && result.status === "success";
|
|
140
|
+
} catch (e) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
static getNotRunningMessage() {
|
|
145
|
+
return "Aiko is not running. Please start it with: cd ~/Projects/Javascript/Aiko && node src/Aiko.js";
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
KrnlShell,
|
|
151
|
+
KrnlAikoClient
|
|
152
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__esm,
|
|
3
|
+
__export
|
|
4
|
+
} from "./chunk-BPTBREBG.js";
|
|
5
|
+
|
|
6
|
+
// ../core/dist/chunk-6QCYRS5L.js
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
9
|
+
var K_LIB_Krnl_Frontend_Builder_exports = {};
|
|
10
|
+
__export(K_LIB_Krnl_Frontend_Builder_exports, {
|
|
11
|
+
KrnlFrontendBuilder: () => KrnlFrontendBuilder
|
|
12
|
+
});
|
|
13
|
+
var KrnlFrontendBuilder;
|
|
14
|
+
var init_K_LIB_Krnl_Frontend_Builder = __esm({
|
|
15
|
+
"src/core/K_LIB_Krnl_Frontend_Builder.ts"() {
|
|
16
|
+
KrnlFrontendBuilder = class {
|
|
17
|
+
static activeContexts = /* @__PURE__ */ new Map();
|
|
18
|
+
/**
|
|
19
|
+
* Bundles frontend/src/index.ts -> frontend/dist/bundle.js
|
|
20
|
+
*/
|
|
21
|
+
static async build(frontendDir) {
|
|
22
|
+
const entryFileTs = path.join(frontendDir, "src", "index.ts");
|
|
23
|
+
const entryFileTsx = path.join(frontendDir, "src", "index.tsx");
|
|
24
|
+
const entryFile = fs.existsSync(entryFileTs) ? entryFileTs : entryFileTsx;
|
|
25
|
+
if (!fs.existsSync(entryFile)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const distDir = path.join(frontendDir, "dist");
|
|
29
|
+
fs.mkdirSync(distDir, { recursive: true });
|
|
30
|
+
try {
|
|
31
|
+
const candidates = [
|
|
32
|
+
// When running from inside KrnlTS dist (relative to __dirname)
|
|
33
|
+
path.resolve(__dirname, "..", "..", "frontend", "atoms"),
|
|
34
|
+
path.resolve(__dirname, "..", "frontend", "atoms"),
|
|
35
|
+
// Scoped package (@dinilmusick/krnlts) installed in consuming app
|
|
36
|
+
path.resolve(process.cwd(), "node_modules", "@dinilmusick", "krnlts", "dist", "frontend", "atoms"),
|
|
37
|
+
path.resolve(process.cwd(), "node_modules", "@dinilmusick", "krnlts", "src", "krnl", "frontend", "atoms"),
|
|
38
|
+
// Unscoped fallback (krnlts)
|
|
39
|
+
path.resolve(process.cwd(), "node_modules", "krnlts", "dist", "frontend", "atoms"),
|
|
40
|
+
path.resolve(process.cwd(), "node_modules", "krnlts", "src", "krnl", "frontend", "atoms")
|
|
41
|
+
];
|
|
42
|
+
const nodeModulesAtoms = candidates.find((c) => fs.existsSync(c));
|
|
43
|
+
const srcAtoms = path.join(frontendDir, "src", "atoms");
|
|
44
|
+
if (nodeModulesAtoms) {
|
|
45
|
+
fs.mkdirSync(srcAtoms, { recursive: true });
|
|
46
|
+
fs.cpSync(nodeModulesAtoms, srcAtoms, { recursive: true, force: true });
|
|
47
|
+
console.log(`[KrnlFrontendBuilder] Atoms synced from ${nodeModulesAtoms}`);
|
|
48
|
+
} else {
|
|
49
|
+
console.warn(`[KrnlFrontendBuilder] No atoms source found in any candidate path.`);
|
|
50
|
+
}
|
|
51
|
+
} catch (e) {
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const esbuild = await import("./main-DXUMPBND.js");
|
|
55
|
+
console.log(`[KrnlFrontendBuilder] Bundling ${entryFile} -> ${distDir}/bundle.js...`);
|
|
56
|
+
await esbuild.build({
|
|
57
|
+
entryPoints: [entryFile],
|
|
58
|
+
bundle: true,
|
|
59
|
+
outfile: path.join(distDir, "bundle.js"),
|
|
60
|
+
loader: {
|
|
61
|
+
".css": "css",
|
|
62
|
+
".ts": "ts",
|
|
63
|
+
".js": "js"
|
|
64
|
+
},
|
|
65
|
+
sourcemap: process.env.NODE_ENV !== "production",
|
|
66
|
+
minify: process.env.NODE_ENV === "production",
|
|
67
|
+
logLevel: "warning"
|
|
68
|
+
});
|
|
69
|
+
console.log(`[KrnlFrontendBuilder] Bundle build successful.`);
|
|
70
|
+
return true;
|
|
71
|
+
} catch (err) {
|
|
72
|
+
if (err.code === "ERR_MODULE_NOT_FOUND" || err.message?.includes("Cannot find module")) {
|
|
73
|
+
console.warn(`[KrnlFrontendBuilder] esbuild peer dependency not found. Skipping build. Run 'npm i esbuild' to enable in-process UI compilation.`);
|
|
74
|
+
} else {
|
|
75
|
+
console.error(`[KrnlFrontendBuilder] Build failed:`, err.message || err);
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Starts esbuild watch mode for live updates during development
|
|
82
|
+
*/
|
|
83
|
+
static async watch(frontendDir) {
|
|
84
|
+
if (this.activeContexts.has(frontendDir)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const entryFileTs = path.join(frontendDir, "src", "index.ts");
|
|
88
|
+
const entryFileTsx = path.join(frontendDir, "src", "index.tsx");
|
|
89
|
+
const entryFile = fs.existsSync(entryFileTs) ? entryFileTs : entryFileTsx;
|
|
90
|
+
if (!fs.existsSync(entryFile)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const esbuild = await import("./main-DXUMPBND.js");
|
|
95
|
+
const ctx = await esbuild.context({
|
|
96
|
+
entryPoints: [entryFile],
|
|
97
|
+
bundle: true,
|
|
98
|
+
outfile: path.join(frontendDir, "dist", "bundle.js"),
|
|
99
|
+
loader: {
|
|
100
|
+
".css": "css",
|
|
101
|
+
".ts": "ts",
|
|
102
|
+
".js": "js"
|
|
103
|
+
},
|
|
104
|
+
logLevel: "warning"
|
|
105
|
+
});
|
|
106
|
+
await ctx.watch();
|
|
107
|
+
this.activeContexts.set(frontendDir, ctx);
|
|
108
|
+
console.log(`[KrnlFrontendBuilder] esbuild watching ${frontendDir}/src for changes.`);
|
|
109
|
+
} catch (err) {
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
static stop(frontendDir) {
|
|
113
|
+
const ctx = this.activeContexts.get(frontendDir);
|
|
114
|
+
if (ctx) {
|
|
115
|
+
ctx.dispose();
|
|
116
|
+
this.activeContexts.delete(frontendDir);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
K_LIB_Krnl_Frontend_Builder_exports,
|
|
125
|
+
KrnlFrontendBuilder,
|
|
126
|
+
init_K_LIB_Krnl_Frontend_Builder
|
|
127
|
+
};
|