@ultrst-armada/krnl 0.0.0-stage → 1.0.0
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 +84 -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 +757 -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 +704 -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,360 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file ServiceContract.ts
|
|
3
|
+
* @description Canonical service contracts for the KrnlTS Service Kernel.
|
|
4
|
+
* Invariant: KrnlTS.Service = Skipo.Service = RemoteService.Contract
|
|
5
|
+
*/
|
|
6
|
+
type ProtocolType = 'http' | 'https' | 'ws' | 'wss' | 'udp' | 'p2p' | 'signaling' | 'memory';
|
|
7
|
+
interface OperationContext {
|
|
8
|
+
caller?: string;
|
|
9
|
+
callerPort?: number;
|
|
10
|
+
accessKey?: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
protocol?: ProtocolType;
|
|
13
|
+
}
|
|
14
|
+
interface OperationContract<TInput = unknown, TOutput = unknown> {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
inputSchema?: Record<string, unknown>;
|
|
19
|
+
outputSchema?: Record<string, unknown>;
|
|
20
|
+
capabilities?: string[];
|
|
21
|
+
protocols?: ProtocolType[];
|
|
22
|
+
handler: (input: TInput, context: OperationContext) => Promise<TOutput> | TOutput;
|
|
23
|
+
}
|
|
24
|
+
interface StateContract<TState = Record<string, unknown>> {
|
|
25
|
+
initial: TState;
|
|
26
|
+
schema?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
interface EventContract<TPayload = unknown> {
|
|
29
|
+
name: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
payloadSchema?: Record<string, unknown>;
|
|
32
|
+
marker?: TPayload;
|
|
33
|
+
}
|
|
34
|
+
interface LifecycleContract {
|
|
35
|
+
onInit?: () => Promise<void> | void;
|
|
36
|
+
onStart?: () => Promise<void> | void;
|
|
37
|
+
onStop?: () => Promise<void> | void;
|
|
38
|
+
onDispose?: () => Promise<void> | void;
|
|
39
|
+
}
|
|
40
|
+
interface DependencyContract {
|
|
41
|
+
serviceId: string;
|
|
42
|
+
versionRange?: string;
|
|
43
|
+
requiredCapabilities?: string[];
|
|
44
|
+
preferredProtocols?: ProtocolType[];
|
|
45
|
+
optional?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface ServiceCapability {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
protocols: ProtocolType[];
|
|
51
|
+
metadata?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
interface EndpointDescriptor {
|
|
54
|
+
protocol: ProtocolType;
|
|
55
|
+
address: string;
|
|
56
|
+
port?: number;
|
|
57
|
+
path?: string;
|
|
58
|
+
channel?: string;
|
|
59
|
+
capabilities: string[];
|
|
60
|
+
}
|
|
61
|
+
interface ServiceDefinition<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
version: string;
|
|
65
|
+
inputs?: Record<string, Record<string, unknown>>;
|
|
66
|
+
outputs?: Record<string, Record<string, unknown>>;
|
|
67
|
+
operations: Record<string, OperationContract<any, any>>;
|
|
68
|
+
state?: StateContract<TState>;
|
|
69
|
+
events?: Record<keyof TEvents & string, EventContract<any>>;
|
|
70
|
+
lifecycle?: LifecycleContract;
|
|
71
|
+
dependencies?: DependencyContract[];
|
|
72
|
+
capabilities?: ServiceCapability[];
|
|
73
|
+
protocols?: ProtocolType[];
|
|
74
|
+
}
|
|
75
|
+
interface IService<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
readonly version: string;
|
|
79
|
+
call<TIn = unknown, TOut = unknown>(op: string, input?: TIn, ctx?: OperationContext): Promise<TOut>;
|
|
80
|
+
getState(): Readonly<TState>;
|
|
81
|
+
setState(mutation: Partial<TState>): void;
|
|
82
|
+
on<K extends keyof TEvents & string>(event: K, handler: (payload: TEvents[K]) => void): () => void;
|
|
83
|
+
emit<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): void;
|
|
84
|
+
start(): Promise<void>;
|
|
85
|
+
stop(): Promise<void>;
|
|
86
|
+
getDefinition(): ServiceDefinition<TState, TEvents>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @file ServiceInstance.ts
|
|
91
|
+
* @description Concrete service implementation in KrnlTS.
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
declare class ServiceInstance<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>> implements IService<TState, TEvents> {
|
|
95
|
+
private definition;
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly name: string;
|
|
98
|
+
readonly version: string;
|
|
99
|
+
private stateStore?;
|
|
100
|
+
private eventBus;
|
|
101
|
+
private lifecycle;
|
|
102
|
+
constructor(definition: ServiceDefinition<TState, TEvents>);
|
|
103
|
+
getDefinition(): ServiceDefinition<TState, TEvents>;
|
|
104
|
+
start(): Promise<void>;
|
|
105
|
+
stop(): Promise<void>;
|
|
106
|
+
call<TIn = unknown, TOut = unknown>(op: string, input?: TIn, ctx?: OperationContext): Promise<TOut>;
|
|
107
|
+
getState(): Readonly<TState>;
|
|
108
|
+
setState(mutation: Partial<TState>): void;
|
|
109
|
+
on<K extends keyof TEvents & string>(event: K, handler: (payload: TEvents[K]) => void): () => void;
|
|
110
|
+
emit<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): void;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @file ProtocolAdapter.ts
|
|
115
|
+
* @description Standard ProtocolAdapter interface and envelope abstractions.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
interface ProtocolCapabilities {
|
|
119
|
+
requestResponse: boolean;
|
|
120
|
+
streaming: boolean;
|
|
121
|
+
pubSub: boolean;
|
|
122
|
+
datagram: boolean;
|
|
123
|
+
peerToPeer: boolean;
|
|
124
|
+
signaling: boolean;
|
|
125
|
+
discovery: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface ProtocolEnvelope<TPayload = unknown> {
|
|
128
|
+
id: string;
|
|
129
|
+
type: 'request' | 'response' | 'event' | 'signal' | 'heartbeat';
|
|
130
|
+
operation?: string;
|
|
131
|
+
payload?: TPayload;
|
|
132
|
+
error?: string;
|
|
133
|
+
correlationId?: string;
|
|
134
|
+
timestamp: number;
|
|
135
|
+
}
|
|
136
|
+
interface Connection {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly protocol: ProtocolType;
|
|
139
|
+
send(envelope: ProtocolEnvelope): Promise<void>;
|
|
140
|
+
close(): Promise<void>;
|
|
141
|
+
}
|
|
142
|
+
interface ProtocolAdapter {
|
|
143
|
+
readonly protocol: ProtocolType;
|
|
144
|
+
readonly capabilities: ProtocolCapabilities;
|
|
145
|
+
listen?(port: number, host?: string): Promise<EndpointDescriptor>;
|
|
146
|
+
connect?(endpoint: EndpointDescriptor): Promise<Connection>;
|
|
147
|
+
expose?(service: IService, port?: number): Promise<EndpointDescriptor>;
|
|
148
|
+
stop?(): Promise<void>;
|
|
149
|
+
send?(target: EndpointDescriptor | Connection, envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
150
|
+
receive?(handler: (envelope: ProtocolEnvelope, ctx?: OperationContext) => Promise<ProtocolEnvelope | void>): () => void;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @file ServiceProxy.ts
|
|
155
|
+
* @description Transparent client proxy invoking a remote or mediated service.
|
|
156
|
+
* Invariant: LOCAL SERVICE = REMOTE SERVICE CONTRACT.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
declare class ServiceProxy<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>> implements IService<TState, TEvents> {
|
|
160
|
+
private definition;
|
|
161
|
+
private adapter;
|
|
162
|
+
private endpoint;
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly version: string;
|
|
166
|
+
private stateCache;
|
|
167
|
+
private eventHandlers;
|
|
168
|
+
constructor(definition: ServiceDefinition<TState, TEvents>, adapter: ProtocolAdapter, endpoint: EndpointDescriptor);
|
|
169
|
+
getDefinition(): ServiceDefinition<TState, TEvents>;
|
|
170
|
+
start(): Promise<void>;
|
|
171
|
+
stop(): Promise<void>;
|
|
172
|
+
call<TIn = unknown, TOut = unknown>(op: string, input?: TIn, ctx?: OperationContext): Promise<TOut>;
|
|
173
|
+
getState(): Readonly<TState>;
|
|
174
|
+
setState(mutation: Partial<TState>): void;
|
|
175
|
+
on<K extends keyof TEvents & string>(event: K, handler: (payload: TEvents[K]) => void): () => void;
|
|
176
|
+
emit<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): void;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @file ServiceGenerators.ts
|
|
181
|
+
* @description Factory generators for services and definitions.
|
|
182
|
+
*/
|
|
183
|
+
|
|
184
|
+
declare function createServiceDefinition<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>>(definition: ServiceDefinition<TState, TEvents>): ServiceDefinition<TState, TEvents>;
|
|
185
|
+
declare function createService<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>>(definition: ServiceDefinition<TState, TEvents>): ServiceInstance<TState, TEvents>;
|
|
186
|
+
declare function createServiceProxy<TState extends Record<string, unknown> = Record<string, unknown>, TEvents extends Record<string, unknown> = Record<string, unknown>>(definition: ServiceDefinition<TState, TEvents>, adapter: ProtocolAdapter, endpoint: EndpointDescriptor): IService<TState, TEvents>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @file HttpProtocolAdapter.ts
|
|
190
|
+
* @description HTTP/HTTPS adapter for service exposition and remote consumption.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
declare class HttpProtocolAdapter implements ProtocolAdapter {
|
|
194
|
+
readonly protocol: "http";
|
|
195
|
+
readonly capabilities: ProtocolCapabilities;
|
|
196
|
+
private server?;
|
|
197
|
+
private listeningPort?;
|
|
198
|
+
listen(port: number, host?: string): Promise<EndpointDescriptor>;
|
|
199
|
+
expose(service: IService, port?: number): Promise<EndpointDescriptor>;
|
|
200
|
+
send(endpoint: EndpointDescriptor, envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
201
|
+
stop(): Promise<void>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @file WebSocketProtocolAdapter.ts
|
|
206
|
+
* @description WebSocket full-duplex protocol adapter for services.
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
declare class WebSocketProtocolAdapter implements ProtocolAdapter {
|
|
210
|
+
readonly protocol: "ws";
|
|
211
|
+
readonly capabilities: ProtocolCapabilities;
|
|
212
|
+
private server?;
|
|
213
|
+
private wss?;
|
|
214
|
+
private port?;
|
|
215
|
+
expose(service: IService, port?: number): Promise<EndpointDescriptor>;
|
|
216
|
+
send(endpoint: EndpointDescriptor, envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
217
|
+
stop(): Promise<void>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @file UdpProtocolAdapter.ts
|
|
222
|
+
* @description UDP datagram adapter for services and beacon messaging.
|
|
223
|
+
*/
|
|
224
|
+
|
|
225
|
+
declare class UdpProtocolAdapter implements ProtocolAdapter {
|
|
226
|
+
readonly protocol: "udp";
|
|
227
|
+
readonly capabilities: ProtocolCapabilities;
|
|
228
|
+
private socket?;
|
|
229
|
+
private port?;
|
|
230
|
+
expose(service: IService, port?: number): Promise<EndpointDescriptor>;
|
|
231
|
+
send(endpoint: EndpointDescriptor, envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
232
|
+
stop(): Promise<void>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @file P2PProtocolAdapter.ts
|
|
237
|
+
* @description Signaling & P2P virtual routing protocol adapter.
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
declare class P2PProtocolAdapter implements ProtocolAdapter {
|
|
241
|
+
readonly protocol: "p2p";
|
|
242
|
+
readonly capabilities: ProtocolCapabilities;
|
|
243
|
+
private static peerHub;
|
|
244
|
+
expose(service: IService): Promise<EndpointDescriptor>;
|
|
245
|
+
send(endpoint: EndpointDescriptor, envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
246
|
+
stop(): Promise<void>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @file MemoryTransport.ts
|
|
251
|
+
* @description In-memory direct transport implementation.
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
declare class MemoryTransport {
|
|
255
|
+
private handlers;
|
|
256
|
+
onMessage(handler: (envelope: ProtocolEnvelope) => Promise<ProtocolEnvelope | void>): () => void;
|
|
257
|
+
send(envelope: ProtocolEnvelope): Promise<ProtocolEnvelope>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @file ServiceRegistry.ts
|
|
262
|
+
* @description Central service catalog and capabilities registry.
|
|
263
|
+
*/
|
|
264
|
+
|
|
265
|
+
interface RegisteredServiceRecord {
|
|
266
|
+
definition: ServiceDefinition;
|
|
267
|
+
endpoints: EndpointDescriptor[];
|
|
268
|
+
registeredAt: number;
|
|
269
|
+
}
|
|
270
|
+
declare class ServiceRegistry {
|
|
271
|
+
private services;
|
|
272
|
+
register(definition: ServiceDefinition, endpoints?: EndpointDescriptor[]): void;
|
|
273
|
+
unregister(serviceId: string): void;
|
|
274
|
+
get(serviceId: string): RegisteredServiceRecord | undefined;
|
|
275
|
+
list(): RegisteredServiceRecord[];
|
|
276
|
+
findByCapability(capabilityName: string): RegisteredServiceRecord[];
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @file ServiceRuntime.ts
|
|
281
|
+
* @description Isolated runtime managing service instances and execution boundaries.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
declare class ServiceRuntime {
|
|
285
|
+
private instances;
|
|
286
|
+
readonly registry: ServiceRegistry;
|
|
287
|
+
constructor(registry?: ServiceRegistry);
|
|
288
|
+
register(service: IService): this;
|
|
289
|
+
get(serviceId: string): IService | undefined;
|
|
290
|
+
execute<TIn = unknown, TOut = unknown>(target: string, operation: string, input?: TIn, ctx?: OperationContext): Promise<TOut>;
|
|
291
|
+
startAll(): Promise<void>;
|
|
292
|
+
stopAll(): Promise<void>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @file ServiceDiscovery.ts
|
|
297
|
+
* @description Discovery primitives for local and network services.
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
interface PeerRecord {
|
|
301
|
+
id: string;
|
|
302
|
+
name: string;
|
|
303
|
+
endpoints: EndpointDescriptor[];
|
|
304
|
+
lastSeen: number;
|
|
305
|
+
}
|
|
306
|
+
declare class ServiceDiscovery {
|
|
307
|
+
private peers;
|
|
308
|
+
registerPeer(id: string, name: string, endpoints: EndpointDescriptor[]): void;
|
|
309
|
+
getPeers(): PeerRecord[];
|
|
310
|
+
findPeer(id: string): PeerRecord | undefined;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @file ServiceStateStore.ts
|
|
315
|
+
* @description State management primitive for stateful services.
|
|
316
|
+
*/
|
|
317
|
+
declare class ServiceStateStore<TState extends Record<string, unknown> = Record<string, unknown>> {
|
|
318
|
+
private state;
|
|
319
|
+
private listeners;
|
|
320
|
+
constructor(initialState: TState);
|
|
321
|
+
getState(): Readonly<TState>;
|
|
322
|
+
setState(mutation: Partial<TState>): void;
|
|
323
|
+
subscribe(listener: (state: Readonly<TState>, delta: Partial<TState>) => void): () => void;
|
|
324
|
+
reset(newState?: TState): void;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* @file ServiceEventBus.ts
|
|
329
|
+
* @description In-memory strongly-typed event bus for services.
|
|
330
|
+
*/
|
|
331
|
+
declare class ServiceEventBus<TEvents extends Record<string, unknown> = Record<string, unknown>> {
|
|
332
|
+
private handlers;
|
|
333
|
+
on<K extends keyof TEvents & string>(event: K, handler: (payload: TEvents[K]) => void): () => void;
|
|
334
|
+
emit<K extends keyof TEvents & string>(event: K, payload: TEvents[K]): void;
|
|
335
|
+
clear(): void;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* @file LifecycleManager.ts
|
|
340
|
+
* @description Standard lifecycle transitions for services.
|
|
341
|
+
*/
|
|
342
|
+
type ServiceStatus = 'uninitialized' | 'initializing' | 'ready' | 'starting' | 'running' | 'stopping' | 'stopped';
|
|
343
|
+
declare class LifecycleManager {
|
|
344
|
+
private status;
|
|
345
|
+
getStatus(): ServiceStatus;
|
|
346
|
+
setStatus(next: ServiceStatus): void;
|
|
347
|
+
assertRunning(serviceName: string): void;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* @file ProtocolResolver.ts
|
|
352
|
+
* @description Protocol selection resolving matching adapters from capabilities.
|
|
353
|
+
*/
|
|
354
|
+
|
|
355
|
+
declare class ProtocolResolver {
|
|
356
|
+
static selectProtocol(requiredCapabilities: string[], availableEndpoints: EndpointDescriptor[]): EndpointDescriptor | undefined;
|
|
357
|
+
static getSupportedProtocols(definition: ServiceDefinition): ProtocolType[];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export { type Connection, type DependencyContract, type EndpointDescriptor, type EventContract, HttpProtocolAdapter, type IService, type LifecycleContract, LifecycleManager, MemoryTransport, type OperationContext, type OperationContract, P2PProtocolAdapter, type PeerRecord, type ProtocolAdapter, type ProtocolCapabilities, type ProtocolEnvelope, ProtocolResolver, type ProtocolType, type RegisteredServiceRecord, type ServiceCapability, type ServiceDefinition, ServiceDiscovery, ServiceEventBus, ServiceInstance, ServiceProxy, ServiceRegistry, ServiceRuntime, ServiceStateStore, type ServiceStatus, type StateContract, UdpProtocolAdapter, WebSocketProtocolAdapter, createService, createServiceDefinition, createServiceProxy };
|