@nekzus/liop 1.0.0-alpha.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/LICENSE +201 -0
- package/NOTICE +24 -0
- package/README.md +641 -0
- package/dist/bin/agent.d.ts +1 -0
- package/dist/bin/agent.js +897 -0
- package/dist/bin/agent.js.map +1 -0
- package/dist/bridge.d.ts +105 -0
- package/dist/bridge.js +5 -0
- package/dist/bridge.js.map +1 -0
- package/dist/chunk-3L2O2XKG.js +723 -0
- package/dist/chunk-3L2O2XKG.js.map +1 -0
- package/dist/chunk-7BSCUYUE.js +421 -0
- package/dist/chunk-7BSCUYUE.js.map +1 -0
- package/dist/chunk-7PITYWOV.js +68 -0
- package/dist/chunk-7PITYWOV.js.map +1 -0
- package/dist/chunk-7RXOIDXP.js +877 -0
- package/dist/chunk-7RXOIDXP.js.map +1 -0
- package/dist/chunk-BOISQ45Z.js +558 -0
- package/dist/chunk-BOISQ45Z.js.map +1 -0
- package/dist/chunk-DZ2FQGJD.js +206712 -0
- package/dist/chunk-DZ2FQGJD.js.map +1 -0
- package/dist/chunk-EG46XMJT.js +77 -0
- package/dist/chunk-EG46XMJT.js.map +1 -0
- package/dist/chunk-ESRXG36Y.js +115 -0
- package/dist/chunk-ESRXG36Y.js.map +1 -0
- package/dist/chunk-FTF6AMF6.js +3 -0
- package/dist/chunk-FTF6AMF6.js.map +1 -0
- package/dist/chunk-HA6YZ42O.js +64 -0
- package/dist/chunk-HA6YZ42O.js.map +1 -0
- package/dist/chunk-HD2N3IJX.js +3634 -0
- package/dist/chunk-HD2N3IJX.js.map +1 -0
- package/dist/chunk-IK7CGWAZ.js +24 -0
- package/dist/chunk-IK7CGWAZ.js.map +1 -0
- package/dist/chunk-L6J72C5X.js +1477 -0
- package/dist/chunk-L6J72C5X.js.map +1 -0
- package/dist/chunk-PAICJCKJ.js +332 -0
- package/dist/chunk-PAICJCKJ.js.map +1 -0
- package/dist/chunk-PEN3KFLF.js +114 -0
- package/dist/chunk-PEN3KFLF.js.map +1 -0
- package/dist/chunk-T7R5HUFD.js +775 -0
- package/dist/chunk-T7R5HUFD.js.map +1 -0
- package/dist/chunk-TKRX6CFI.js +168 -0
- package/dist/chunk-TKRX6CFI.js.map +1 -0
- package/dist/chunk-UCVP3XAL.js +279 -0
- package/dist/chunk-UCVP3XAL.js.map +1 -0
- package/dist/chunk-VH4K4U45.js +180 -0
- package/dist/chunk-VH4K4U45.js.map +1 -0
- package/dist/chunk-Y62GORQF.js +51 -0
- package/dist/chunk-Y62GORQF.js.map +1 -0
- package/dist/chunk-ZP3VVXOI.js +66 -0
- package/dist/chunk-ZP3VVXOI.js.map +1 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +13 -0
- package/dist/client.js.map +1 -0
- package/dist/gateway.d.ts +7 -0
- package/dist/gateway.js +13 -0
- package/dist/gateway.js.map +1 -0
- package/dist/hybrid-CrKB50nh.d.ts +170 -0
- package/dist/index-CX43dvMs.d.ts +170 -0
- package/dist/index-DoW2gzBZ.d.ts +566 -0
- package/dist/index.d.ts +810 -0
- package/dist/index.js +357 -0
- package/dist/index.js.map +1 -0
- package/dist/kyber-CGOA7Q6A.js +3 -0
- package/dist/kyber-CGOA7Q6A.js.map +1 -0
- package/dist/mesh.d.ts +32 -0
- package/dist/mesh.js +6 -0
- package/dist/mesh.js.map +1 -0
- package/dist/node-B0b2vUFS.d.ts +164 -0
- package/dist/protocol/liop_core.proto +47 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.js +9 -0
- package/dist/server.js.map +1 -0
- package/dist/types-lJIxBlWF.d.ts +256 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/verifier-COnid_dg.d.ts +31 -0
- package/dist/verifier-HRFXBKT5.js +6 -0
- package/dist/verifier-HRFXBKT5.js.map +1 -0
- package/dist/workers/logic-execution.d.ts +26 -0
- package/dist/workers/logic-execution.js +272 -0
- package/dist/workers/logic-execution.js.map +1 -0
- package/dist/workers/zk-verifier.d.ts +26 -0
- package/dist/workers/zk-verifier.js +174 -0
- package/dist/workers/zk-verifier.js.map +1 -0
- package/package.json +230 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { L as LiopVerifier } from './verifier-COnid_dg.js';
|
|
2
|
+
import { M as MeshNodeConfig } from './node-B0b2vUFS.js';
|
|
3
|
+
import { EventEmitter } from 'node:events';
|
|
4
|
+
import { M as McpEra, C as CallToolRequest, a as CallToolResult } from './types-lJIxBlWF.js';
|
|
5
|
+
|
|
6
|
+
interface CertManagerOptions {
|
|
7
|
+
/** Path to the root CA certificate (PEM format) */
|
|
8
|
+
rootCertPath?: string;
|
|
9
|
+
/** Path to the server/client certificate chain (PEM format) */
|
|
10
|
+
certChainPath: string;
|
|
11
|
+
/** Path to the private key (PEM format) */
|
|
12
|
+
privateKeyPath: string;
|
|
13
|
+
/** Expiration warning threshold in days (default: 30) */
|
|
14
|
+
warningDays?: number;
|
|
15
|
+
/** Enable file watching for automatic hot-reloading (default: true) */
|
|
16
|
+
watchFiles?: boolean;
|
|
17
|
+
/** Debounce delay in ms for hot reloading (default: 150) */
|
|
18
|
+
debounceMs?: number;
|
|
19
|
+
}
|
|
20
|
+
interface CertInfo {
|
|
21
|
+
subject: string;
|
|
22
|
+
issuer: string;
|
|
23
|
+
validFrom: string;
|
|
24
|
+
validTo: string;
|
|
25
|
+
fingerprint256: string;
|
|
26
|
+
daysRemaining: number;
|
|
27
|
+
isExpired: boolean;
|
|
28
|
+
isExpiringSoon: boolean;
|
|
29
|
+
}
|
|
30
|
+
declare class CertManager extends EventEmitter {
|
|
31
|
+
private readonly options;
|
|
32
|
+
private rootCertBuffer;
|
|
33
|
+
private certChainBuffer;
|
|
34
|
+
private privateKeyBuffer;
|
|
35
|
+
private watchers;
|
|
36
|
+
private reloadDebounceTimer;
|
|
37
|
+
private readonly warningDays;
|
|
38
|
+
private readonly debounceMs;
|
|
39
|
+
constructor(options: CertManagerOptions);
|
|
40
|
+
/**
|
|
41
|
+
* Synchronously loads or reloads certificates from filesystem into memory.
|
|
42
|
+
*/
|
|
43
|
+
loadCertificates(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Inspects the loaded server/client certificate chain using Node.js native X509Certificate.
|
|
46
|
+
*/
|
|
47
|
+
inspectCertificate(): CertInfo;
|
|
48
|
+
/**
|
|
49
|
+
* Sets up non-blocking filesystem watchers to detect certificate renewals
|
|
50
|
+
* and trigger hot-reloading without process restarts.
|
|
51
|
+
*/
|
|
52
|
+
private setupWatchers;
|
|
53
|
+
/**
|
|
54
|
+
* Debounces reload events to ensure files have finished writing.
|
|
55
|
+
*/
|
|
56
|
+
private scheduleReload;
|
|
57
|
+
/**
|
|
58
|
+
* Manually triggers a reload of certificates and emits the 'reload' event.
|
|
59
|
+
*/
|
|
60
|
+
reload(): CertInfo;
|
|
61
|
+
getRootCert(): Buffer | null;
|
|
62
|
+
getCertChain(): Buffer;
|
|
63
|
+
getPrivateKey(): Buffer;
|
|
64
|
+
/**
|
|
65
|
+
* Stops all active file watchers and releases resources.
|
|
66
|
+
*/
|
|
67
|
+
dispose(): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface LiopTlsOptions {
|
|
71
|
+
/** Path to the root CA certificate (PEM format) */
|
|
72
|
+
rootCert?: string;
|
|
73
|
+
/** Path to the server/client certificate (PEM format) */
|
|
74
|
+
certChain?: string;
|
|
75
|
+
/** Path to the private key (PEM format) */
|
|
76
|
+
privateKey?: string;
|
|
77
|
+
/** Require mutual TLS (mTLS): verify client certificate against root CA */
|
|
78
|
+
mutualTls?: boolean;
|
|
79
|
+
/** Optional CertManager instance for automated certificate management and hot reloading */
|
|
80
|
+
certManager?: CertManager;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* LIOP Client
|
|
85
|
+
* High-level orchestration for discovery and execution in the Logic-Injection-on-Origin mesh.
|
|
86
|
+
*/
|
|
87
|
+
declare class LiopClient {
|
|
88
|
+
private meshNode;
|
|
89
|
+
private rpcClients;
|
|
90
|
+
private manifests;
|
|
91
|
+
private tlsOptions?;
|
|
92
|
+
private serverInfo?;
|
|
93
|
+
verifier: LiopVerifier;
|
|
94
|
+
private oauthToken?;
|
|
95
|
+
private tokenManager?;
|
|
96
|
+
/** Protocol negotiation era */
|
|
97
|
+
era: McpEra;
|
|
98
|
+
/** Negotiated protocol version */
|
|
99
|
+
protocolVersion: string;
|
|
100
|
+
constructor(tls?: LiopTlsOptions);
|
|
101
|
+
/**
|
|
102
|
+
* Discovers and connects to the target server or mesh capability.
|
|
103
|
+
* If address is omitted, it sets up the MeshNode to act purely dynamically.
|
|
104
|
+
*/
|
|
105
|
+
connect(address?: string, options?: {
|
|
106
|
+
meshConfig?: MeshNodeConfig;
|
|
107
|
+
auth?: {
|
|
108
|
+
clientId?: string;
|
|
109
|
+
clientSecret?: string;
|
|
110
|
+
nexusUrl?: string;
|
|
111
|
+
audience?: string;
|
|
112
|
+
scope?: string;
|
|
113
|
+
token?: string;
|
|
114
|
+
};
|
|
115
|
+
}): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Selects the optimal IP from an array of multiaddrs.
|
|
118
|
+
* Prioritizes routable non-loopback IPv4 addresses (e.g. Docker bridge, LAN, WAN)
|
|
119
|
+
* over loopback (127.0.0.1) to prevent inter-container connection failures.
|
|
120
|
+
*/
|
|
121
|
+
private selectOptimalIp;
|
|
122
|
+
/**
|
|
123
|
+
* Dynamically queries Kademlia DHT to find the optimal PeerID providing the Capability
|
|
124
|
+
* and returns the physical gRPC target (host:port) resolved from the provider's manifest.
|
|
125
|
+
*/
|
|
126
|
+
resolveCapability(toolName: string): Promise<string>;
|
|
127
|
+
/**
|
|
128
|
+
* Probes a remote MCP endpoint using 'server/discover' to negotiate protocol era.
|
|
129
|
+
* Falls back to legacy initialize handshake if server/discover fails.
|
|
130
|
+
*/
|
|
131
|
+
probeServerDiscover(mcpUrl: string): Promise<{
|
|
132
|
+
era: McpEra;
|
|
133
|
+
protocolVersion: string;
|
|
134
|
+
supportedVersions: string[];
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* Discovers remote capabilities via the LIOP Manifest Protocol.
|
|
138
|
+
* Utilizes a memory cache to avoid redundant network dials against live peers.
|
|
139
|
+
*/
|
|
140
|
+
discoverTools(forceRefresh?: boolean): Promise<{
|
|
141
|
+
name: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
}[]>;
|
|
144
|
+
/**
|
|
145
|
+
* Invokes a tool.
|
|
146
|
+
*/
|
|
147
|
+
callTool(request: CallToolRequest, _wasmPayload?: Buffer): Promise<CallToolResult>;
|
|
148
|
+
private getOrCreateRpcClient;
|
|
149
|
+
/**
|
|
150
|
+
* Reads a specific resource by URI.
|
|
151
|
+
* In LIOP, resources can be static definitions or dynamic streams.
|
|
152
|
+
*/
|
|
153
|
+
readResource(uri: string): Promise<{
|
|
154
|
+
contents: Array<{
|
|
155
|
+
uri: string;
|
|
156
|
+
mimeType?: string;
|
|
157
|
+
text: string;
|
|
158
|
+
}>;
|
|
159
|
+
}>;
|
|
160
|
+
getServerInfo(): {
|
|
161
|
+
name: string;
|
|
162
|
+
version: string;
|
|
163
|
+
} | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Destroys the active Mesh Node resources.
|
|
166
|
+
*/
|
|
167
|
+
close(): Promise<void>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export { type CertInfo as C, type LiopTlsOptions as L, CertManager as a, type CertManagerOptions as b, LiopClient as c };
|