@nekzus/liop 2.5.0-beta.1 → 2.5.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/NOTICE +19 -0
  2. package/README.md +148 -69
  3. package/dist/bin/agent.js +27 -303
  4. package/dist/bridge.d.ts +4 -3
  5. package/dist/bridge.js +1 -4
  6. package/dist/chunk-2XHSALII.js +3 -0
  7. package/dist/chunk-2ZYX736J.js +2 -0
  8. package/dist/chunk-3WRKTVOF.js +2 -0
  9. package/dist/chunk-6KFKO6ZX.js +2 -0
  10. package/dist/chunk-6VK2XALI.js +2 -0
  11. package/dist/chunk-AYDF3IFZ.js +2 -0
  12. package/dist/chunk-CTTTLCGL.js +31 -0
  13. package/dist/chunk-ECRS6N33.js +4 -0
  14. package/dist/chunk-FDJMH4CB.js +2 -0
  15. package/dist/chunk-FTF6AMF6.js +2 -0
  16. package/dist/chunk-GWVSCZUS.js +2 -0
  17. package/dist/chunk-LEXMMIQI.js +15 -0
  18. package/dist/chunk-LM26HOJ6.js +31 -0
  19. package/dist/chunk-MQ5SU26J.js +2 -0
  20. package/dist/chunk-N35BC62H.js +2 -0
  21. package/dist/chunk-P6IJ3VBD.js +3 -0
  22. package/dist/chunk-TKLRW52V.js +2 -0
  23. package/dist/chunk-V35CXJQN.js +2 -0
  24. package/dist/chunk-WP5ER7RH.js +3 -0
  25. package/dist/chunk-XLVEDKM6.js +2 -0
  26. package/dist/chunk-Y675R34Z.js +2 -0
  27. package/dist/chunk-YD2AF2M6.js +46 -0
  28. package/dist/chunk-YLCNV764.js +3 -0
  29. package/dist/chunk-ZZMSFCJP.js +3 -0
  30. package/dist/client.d.ts +6 -4
  31. package/dist/client.js +1 -9
  32. package/dist/gateway.d.ts +6 -5
  33. package/dist/gateway.js +1 -10
  34. package/dist/{hybrid-CF__0YnC.d.ts → hybrid-BZpCiUaV.d.ts} +6 -5
  35. package/dist/{index-cMV0_yD9.d.ts → index-BYDtRGue.d.ts} +45 -36
  36. package/dist/{index-BW95kAL4.d.ts → index-ByzjpRCk.d.ts} +37 -72
  37. package/dist/index.d.ts +221 -50
  38. package/dist/index.js +4 -312
  39. package/dist/kyber-PULV7PQX.js +2 -0
  40. package/dist/mesh.d.ts +27 -143
  41. package/dist/mesh.js +1 -4
  42. package/dist/node-Djzm6UYd.d.ts +172 -0
  43. package/dist/protocol/liop_core.proto +25 -6
  44. package/dist/server.d.ts +4 -3
  45. package/dist/server.js +1 -7
  46. package/dist/types-29zv9X1V.d.ts +455 -0
  47. package/dist/types.d.ts +2 -1
  48. package/dist/types.js +1 -2
  49. package/dist/verifier-DqZ9MQ9l.d.ts +82 -0
  50. package/dist/verifier-J4NQYZX5.js +2 -0
  51. package/dist/workers/logic-execution.d.ts +7 -0
  52. package/dist/workers/logic-execution.js +1 -271
  53. package/dist/workers/zk-verifier.d.ts +9 -0
  54. package/dist/workers/zk-verifier.js +1 -173
  55. package/dist/zk-DzYNWBgo.d.ts +104 -0
  56. package/package.json +56 -45
  57. package/dist/bin/agent.js.map +0 -1
  58. package/dist/bridge.js.map +0 -1
  59. package/dist/chunk-32ADSAJS.js +0 -104
  60. package/dist/chunk-32ADSAJS.js.map +0 -1
  61. package/dist/chunk-547TYL27.js +0 -208109
  62. package/dist/chunk-547TYL27.js.map +0 -1
  63. package/dist/chunk-72MNYFR6.js +0 -64
  64. package/dist/chunk-72MNYFR6.js.map +0 -1
  65. package/dist/chunk-74CISO2I.js +0 -853
  66. package/dist/chunk-74CISO2I.js.map +0 -1
  67. package/dist/chunk-CRZBVFDV.js +0 -616
  68. package/dist/chunk-CRZBVFDV.js.map +0 -1
  69. package/dist/chunk-GA3Q2S7O.js +0 -558
  70. package/dist/chunk-GA3Q2S7O.js.map +0 -1
  71. package/dist/chunk-JIJPZFR2.js +0 -51
  72. package/dist/chunk-JIJPZFR2.js.map +0 -1
  73. package/dist/chunk-OUUTDSOW.js +0 -24
  74. package/dist/chunk-OUUTDSOW.js.map +0 -1
  75. package/dist/chunk-PYKRQAER.js +0 -77
  76. package/dist/chunk-PYKRQAER.js.map +0 -1
  77. package/dist/chunk-QLCOEP5J.js +0 -68
  78. package/dist/chunk-QLCOEP5J.js.map +0 -1
  79. package/dist/chunk-RWRRBYG4.js +0 -3
  80. package/dist/chunk-RWRRBYG4.js.map +0 -1
  81. package/dist/chunk-SONUORBT.js +0 -421
  82. package/dist/chunk-SONUORBT.js.map +0 -1
  83. package/dist/chunk-T5IUZF47.js +0 -716
  84. package/dist/chunk-T5IUZF47.js.map +0 -1
  85. package/dist/chunk-U5BZ66VX.js +0 -447
  86. package/dist/chunk-U5BZ66VX.js.map +0 -1
  87. package/dist/chunk-WCCGE4QR.js +0 -3520
  88. package/dist/chunk-WCCGE4QR.js.map +0 -1
  89. package/dist/chunk-WSW6YJNY.js +0 -168
  90. package/dist/chunk-WSW6YJNY.js.map +0 -1
  91. package/dist/client.js.map +0 -1
  92. package/dist/gateway.js.map +0 -1
  93. package/dist/index.js.map +0 -1
  94. package/dist/kyber-3ULIJSE3.js +0 -3
  95. package/dist/kyber-3ULIJSE3.js.map +0 -1
  96. package/dist/mesh.js.map +0 -1
  97. package/dist/server.js.map +0 -1
  98. package/dist/types-lJIxBlWF.d.ts +0 -256
  99. package/dist/types.js.map +0 -1
  100. package/dist/verifier-3FAKCFNN.js +0 -5
  101. package/dist/verifier-3FAKCFNN.js.map +0 -1
  102. package/dist/verifier-COnid_dg.d.ts +0 -31
  103. package/dist/workers/logic-execution.js.map +0 -1
  104. package/dist/workers/zk-verifier.js.map +0 -1
@@ -0,0 +1,455 @@
1
+ import { P as ProofType } from './zk-DzYNWBgo.js';
2
+ import { z } from 'zod';
3
+ import * as jose from 'jose';
4
+
5
+ /**
6
+ * Technology-agnostic cryptographic audit interceptor.
7
+ *
8
+ * Fires asynchronously (fire-and-forget) AFTER each AuditEntry
9
+ * has been sealed (hash computed, chain linked, and optionally
10
+ * persisted to JSONL). The interceptor receives a frozen deep-clone
11
+ * of the completed AuditEntry — mutations cannot tamper with the
12
+ * hash chain.
13
+ *
14
+ * Use cases: forward audit entries to TypeSafe Jev for threat
15
+ * pattern detection, stream to SOC 2 SIEM aggregators, trigger
16
+ * PagerDuty alerts on BLOCKED_EGRESS/POLICY_VIOLATION statuses,
17
+ * or feed into compliance dashboards.
18
+ */
19
+ type AuditInterceptor = (entry: Readonly<AuditEntry>) => void | Promise<void>;
20
+
21
+ type AuditStatus = "SUCCESS" | "BLOCKED_EGRESS" | "ERROR" | "POLICY_VIOLATION" | "TAINT_ANALYSIS_VIOLATION";
22
+ interface AuditEntry {
23
+ id: string;
24
+ timestamp: string;
25
+ traceId: string;
26
+ agentDid: string;
27
+ peerId: string;
28
+ toolName: string;
29
+ datasetHash: string;
30
+ fuelConsumed: number;
31
+ outputHash: string;
32
+ zkReceiptSig: string;
33
+ status: AuditStatus;
34
+ prevEntryHash: string;
35
+ entryHash: string;
36
+ }
37
+ interface AuditRecordParams {
38
+ timestamp?: string;
39
+ traceId?: string;
40
+ agentDid: string;
41
+ peerId: string;
42
+ toolName: string;
43
+ datasetHash?: string;
44
+ fuelConsumed: number;
45
+ outputHash?: string;
46
+ zkReceiptSig?: string;
47
+ status: AuditStatus;
48
+ }
49
+ declare const GENESIS_HASH: string;
50
+ declare function computeEntryHash(entryWithoutHash: Omit<AuditEntry, "entryHash">): string;
51
+ declare class AuditLogger {
52
+ private entries;
53
+ private lastEntryHash;
54
+ private filePath?;
55
+ private interceptor?;
56
+ constructor(filePath?: string);
57
+ /**
58
+ * Registers a technology-agnostic audit interceptor.
59
+ * The interceptor fires AFTER the entry is sealed (hash computed)
60
+ * and appended to the chain. It receives a frozen deep-clone
61
+ * that cannot tamper with the hash chain.
62
+ * Pass `undefined` to disable interception (zero overhead).
63
+ */
64
+ setInterceptor(interceptor: AuditInterceptor | undefined): void;
65
+ recordExecution(params: AuditRecordParams): AuditEntry;
66
+ getEntries(): readonly AuditEntry[];
67
+ getEntryCount(): number;
68
+ verifyIntegrity(): {
69
+ valid: boolean;
70
+ totalEntries: number;
71
+ brokenIndex?: number;
72
+ reason?: string;
73
+ };
74
+ exportJsonl(): string;
75
+ private loadFromFile;
76
+ }
77
+ declare const globalAuditLogger: AuditLogger;
78
+
79
+ /**
80
+ * LIOP JWT Validator — Token Verification Engine
81
+ *
82
+ * Validates JWT Access Tokens using the `jose` library.
83
+ * Supports two modes:
84
+ * - Local JWKS (Nexus role): Keys in memory, zero network latency.
85
+ * - Remote JWKS (Node role): Fetched from Nexus /oidc/jwks with 10min cache.
86
+ *
87
+ * Standards: NIST SP 800-207 (continuous verification), OWASP API-A01
88
+ * Source: panva/jose DeepWiki — createRemoteJWKSet, jwtVerify
89
+ */
90
+
91
+ /**
92
+ * Authorization context extracted from a validated JWT.
93
+ * Compatible with MCP TypeScript SDK AuthInfo interface.
94
+ */
95
+ interface AuthInfo {
96
+ /** Raw JWT string. */
97
+ token: string;
98
+ /** Subject claim (client_id for M2M flows). */
99
+ clientId: string;
100
+ /** Space-delimited scopes parsed into an array. */
101
+ scopes: string[];
102
+ /** Token expiration timestamp (Unix seconds). */
103
+ expiresAt?: number;
104
+ }
105
+ /**
106
+ * JWT Validator with dual-mode JWKS resolution.
107
+ *
108
+ * - Nexus role: `new JwtValidator(issuer, audience, localJwks)` (createLocalJWKSet)
109
+ * - Node role: `new JwtValidator(issuer, audience, new URL(jwksUri))` (createRemoteJWKSet)
110
+ */
111
+ declare class JwtValidator {
112
+ private readonly jwksResolver;
113
+ private readonly issuer;
114
+ private readonly audience;
115
+ constructor(issuer: string, audience: string, jwksSource: URL | jose.JSONWebKeySet);
116
+ /**
117
+ * Validates a JWT access token and extracts authorization context.
118
+ *
119
+ * Checks performed (jose.jwtVerify):
120
+ * - Cryptographic signature verification (EdDSA or ES256)
121
+ * - Issuer claim matches configured issuer
122
+ * - Audience claim matches configured audience
123
+ * - Token is not expired (with clock tolerance for mesh skew)
124
+ * - Required claims (sub, scope) are present
125
+ *
126
+ * @throws JOSEError if validation fails (expired, wrong issuer, bad signature, etc.)
127
+ */
128
+ validate(token: string): Promise<AuthInfo>;
129
+ /**
130
+ * Builds a complete set of issuer URL aliases for the LIOP demo topology.
131
+ *
132
+ * The LIOP mesh runs on Docker Desktop with the following network layout:
133
+ * Container hostnames: "nexus", "liop-nexus" (internal port 3000)
134
+ * Host-published ports: 13000 (HTTP/MCP), 13001 (libp2p TCP)
135
+ * Loopback addresses: 127.0.0.1, localhost
136
+ *
137
+ * The Nexus OAuth server may set its issuer to any of these depending on
138
+ * how it was configured, and nodes may resolve it via LIOP_NEXUS_URL
139
+ * which varies by context. This method generates all equivalent aliases
140
+ * so that jose.jwtVerify accepts the token regardless of which alias
141
+ * was used as `iss` in the JWT.
142
+ *
143
+ * Security note: This does NOT weaken validation — the cryptographic
144
+ * signature is still verified against the same JWKS keys. Only the
145
+ * string comparison of the `iss` claim is relaxed across known aliases.
146
+ */
147
+ private buildIssuerAliases;
148
+ /**
149
+ * Returns the configured issuer URL for PRM (RFC 9728) metadata.
150
+ */
151
+ getIssuer(): string;
152
+ /**
153
+ * Returns the configured audience for PRM metadata.
154
+ */
155
+ getAudience(): string;
156
+ }
157
+
158
+ /**
159
+ * @mcp-legacy ENTIRE FILE — MCP 2025-era backward compatibility layer.
160
+ * Remove this file when MCP v1 (2025-11-25) reaches EOL.
161
+ *
162
+ * SUNSET INSTRUCTION: Delete this file, then grep for "@mcp-legacy" in the
163
+ * codebase to find and remove all remaining legacy seams.
164
+ */
165
+ /**
166
+ * @mcp-legacy Master kill switch for MCP 2025-era backward compatibility.
167
+ * Set to `false` when MCP v1 reaches End-of-Life (EOL) to disable all legacy seams.
168
+ */
169
+ declare const MCP_LEGACY_SUPPORT_ENABLED = true;
170
+ /**
171
+ * @mcp-legacy Legacy protocol version constant.
172
+ */
173
+ declare const MCP_PROTOCOL_VERSION_LEGACY: "2025-11-25";
174
+
175
+ /**
176
+ * Verdict returned by a GatewayInterceptor function.
177
+ * Determines whether the request is admitted into the routing pipeline.
178
+ */
179
+ interface GatewayAdmissionResult {
180
+ /** true = request passes to router.dispatch(). false = rejected at perimeter. */
181
+ allowed: boolean;
182
+ /** Human-readable denial reason (included in JSON-RPC error response). */
183
+ reason?: string;
184
+ /** Custom JSON-RPC error code. Defaults to -32099 when omitted. */
185
+ errorCode?: number;
186
+ /** Opaque metadata bag for telemetry or audit logging downstream. */
187
+ metadata?: Record<string, unknown>;
188
+ }
189
+ /**
190
+ * Contextual information passed to the interceptor alongside the request.
191
+ * Contains only non-sensitive, non-cryptographic perimeter metadata.
192
+ */
193
+ interface GatewayInterceptorContext {
194
+ /** Originating client IP address (post-JWT, post-rate-limit). */
195
+ clientIp: string;
196
+ /** Authenticated identity from JWT validation, or null for unauthenticated gateways. */
197
+ authInfo: AuthInfo | null;
198
+ /** Transport protocol that received this request. */
199
+ protocol: "http1" | "http2";
200
+ /** Abort signal that fires when the interceptor timeout expires. */
201
+ signal: AbortSignal;
202
+ }
203
+ /**
204
+ * Technology-agnostic admission function.
205
+ * The developer implements this in their application code, connecting
206
+ * any decision engine (TypeSafe Jev, ONNX, regex rules, custom logic).
207
+ *
208
+ * Receives a frozen deep-clone of the request to prevent prototype pollution.
209
+ * May return synchronously or asynchronously.
210
+ */
211
+ type GatewayInterceptor = (request: Readonly<McpRequest>, context: GatewayInterceptorContext) => Promise<GatewayAdmissionResult> | GatewayAdmissionResult;
212
+ /**
213
+ * Configuration for the perimeter admission hook.
214
+ */
215
+ interface GatewayInterceptorOptions {
216
+ /** The interceptor function. When undefined, the gateway skips interception entirely. */
217
+ interceptor?: GatewayInterceptor;
218
+ /** Maximum milliseconds to wait for the interceptor. Default: 2500. */
219
+ timeoutMs?: number;
220
+ /** Behavior when the interceptor throws or times out. Default: "closed". */
221
+ failMode?: "closed" | "open";
222
+ }
223
+ /**
224
+ * Executes the interceptor with timeout enforcement via AbortSignal.timeout(),
225
+ * prototype pollution isolation via structuredClone + Object.freeze,
226
+ * and fail-mode policy enforcement.
227
+ *
228
+ * AbortSignal.timeout() is stable since Node.js 17.3 (available in Node.js 20+ LTS).
229
+ * Promise.race guarantees the gateway never blocks beyond timeoutMs even if the
230
+ * interceptor ignores the signal.
231
+ */
232
+ declare function executeGatewayInterceptor(request: McpRequest, context: Omit<GatewayInterceptorContext, "signal">, options: Required<Pick<GatewayInterceptorOptions, "interceptor">> & GatewayInterceptorOptions): Promise<GatewayAdmissionResult>;
233
+
234
+ type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
235
+ /**
236
+ * LiopLogger - Structured Logging Abstraction
237
+ * Configurable via `process.env.LIOP_LOG_LEVEL`.
238
+ * Emits strictly to stderr to comply with MCP stdio protocols.
239
+ */
240
+ declare class LiopLogger {
241
+ private static instance;
242
+ private level;
243
+ private interceptor?;
244
+ private _isIntercepting;
245
+ private constructor();
246
+ static getInstance(): LiopLogger;
247
+ private setLevelFromEnv;
248
+ setLevel(level: LogLevel): void;
249
+ /**
250
+ * Registers a technology-agnostic log interceptor.
251
+ * Pass `undefined` to disable interception (zero overhead).
252
+ */
253
+ setInterceptor(interceptor: LogInterceptor | undefined): void;
254
+ private shouldLog;
255
+ private formatMessage;
256
+ /**
257
+ * Fire-and-forget async dispatch to the registered interceptor.
258
+ * Recursion guard prevents infinite loops when the interceptor
259
+ * itself triggers logging (directly or transitively).
260
+ */
261
+ private emitToInterceptor;
262
+ error(message: string, ...args: unknown[]): void;
263
+ warn(message: string, ...args: unknown[]): void;
264
+ info(message: string, ...args: unknown[]): void;
265
+ debug(message: string, ...args: unknown[]): void;
266
+ }
267
+ declare const log: LiopLogger;
268
+
269
+ /**
270
+ * Structured snapshot of an operational log event.
271
+ * Frozen copy — mutations have no effect on the logger.
272
+ */
273
+ interface LogEvent {
274
+ /** ISO 8601 timestamp of the log emission. */
275
+ timestamp: string;
276
+ /** Severity level that triggered this event. */
277
+ level: LogLevel;
278
+ /** Formatted log message (already interpolated by LiopLogger). */
279
+ message: string;
280
+ /** Additional variadic arguments passed to the log method. */
281
+ args: readonly unknown[];
282
+ }
283
+ /**
284
+ * Technology-agnostic operational log interceptor.
285
+ *
286
+ * Fires asynchronously (fire-and-forget) after each log emission
287
+ * that passes the current level filter. The interceptor receives
288
+ * a frozen snapshot of the log event. Errors thrown by the
289
+ * interceptor are caught silently and never propagate to the caller.
290
+ *
291
+ * Use cases: forward logs to TypeSafe Jev for anomaly detection,
292
+ * stream to a SIEM (Splunk, Datadog), aggregate in NotebookLM,
293
+ * or persist to a custom observability backend.
294
+ */
295
+ type LogInterceptor = (event: Readonly<LogEvent>) => void | Promise<void>;
296
+
297
+ /**
298
+ * Protocol Version Identifiers
299
+ */
300
+ declare const MCP_PROTOCOL_VERSION: "2026-07-28";
301
+
302
+ /**
303
+ * Protocol Era Classification
304
+ */
305
+ type McpEra = "legacy" | "modern";
306
+ /**
307
+ * Caching Hints for MCP 2026-07-28 Spec
308
+ */
309
+ interface CacheableResult {
310
+ ttlMs?: number;
311
+ cacheScope?: "public" | "private";
312
+ }
313
+ /**
314
+ * Multi-Round-Trip Requests (MRTR) Specification Types
315
+ */
316
+ interface InputRequest {
317
+ id: string;
318
+ message: string;
319
+ schema?: Record<string, unknown>;
320
+ }
321
+ interface InputResponse {
322
+ id: string;
323
+ value: unknown;
324
+ }
325
+ interface InputRequiredResult {
326
+ resultType: "input_required";
327
+ inputRequests: InputRequest[];
328
+ requestState?: string;
329
+ }
330
+ /**
331
+ * Modern Envelope Metadata (_meta)
332
+ */
333
+ interface McpRequestMeta {
334
+ "io.modelcontextprotocol/protocolVersion"?: string;
335
+ "io.modelcontextprotocol/clientInfo"?: {
336
+ name: string;
337
+ version: string;
338
+ };
339
+ "io.modelcontextprotocol/clientCapabilities"?: Record<string, unknown>;
340
+ [key: string]: unknown;
341
+ }
342
+ /**
343
+ * Base Protocol Types representing parity with Model Context Protocol
344
+ */
345
+ declare const ToolSchema: z.ZodObject<{
346
+ name: z.ZodString;
347
+ description: z.ZodOptional<z.ZodString>;
348
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
349
+ }, z.core.$strip>;
350
+ type Tool = z.infer<typeof ToolSchema>;
351
+ declare const ResourceSchema: z.ZodObject<{
352
+ uri: z.ZodString;
353
+ name: z.ZodString;
354
+ description: z.ZodOptional<z.ZodString>;
355
+ mimeType: z.ZodOptional<z.ZodString>;
356
+ }, z.core.$strip>;
357
+ type Resource = z.infer<typeof ResourceSchema>;
358
+ declare const PromptSchema: z.ZodObject<{
359
+ name: z.ZodString;
360
+ description: z.ZodOptional<z.ZodString>;
361
+ arguments: z.ZodOptional<z.ZodArray<z.ZodObject<{
362
+ name: z.ZodString;
363
+ description: z.ZodOptional<z.ZodString>;
364
+ required: z.ZodOptional<z.ZodBoolean>;
365
+ }, z.core.$strip>>>;
366
+ }, z.core.$strip>;
367
+ type Prompt = z.infer<typeof PromptSchema>;
368
+ interface CallToolRequest {
369
+ name: string;
370
+ arguments?: Record<string, unknown>;
371
+ }
372
+ interface CallToolResult {
373
+ content: Array<{
374
+ type: "text" | "image" | "resource";
375
+ text?: string;
376
+ data?: string;
377
+ mimeType?: string;
378
+ resource?: {
379
+ uri: string;
380
+ text?: string;
381
+ blob?: string;
382
+ };
383
+ }>;
384
+ isError?: boolean;
385
+ zkVerified?: boolean;
386
+ zkProofType?: ProofType;
387
+ }
388
+ interface GetPromptRequest {
389
+ name: string;
390
+ arguments?: Record<string, string>;
391
+ }
392
+ interface GetPromptResult {
393
+ description?: string;
394
+ messages: Array<{
395
+ role: "user" | "assistant";
396
+ content: {
397
+ type: "text";
398
+ text: string;
399
+ } | {
400
+ type: "image";
401
+ data: string;
402
+ mimeType: string;
403
+ } | {
404
+ type: "resource";
405
+ resource: {
406
+ uri: string;
407
+ text?: string;
408
+ blob?: string;
409
+ };
410
+ };
411
+ }>;
412
+ }
413
+ interface ServerInfo {
414
+ name: string;
415
+ version: string;
416
+ capabilities?: {
417
+ prompts?: {
418
+ listChanged?: boolean;
419
+ };
420
+ resources?: {
421
+ subscribe?: boolean;
422
+ listChanged?: boolean;
423
+ };
424
+ tools?: {
425
+ listChanged?: boolean;
426
+ };
427
+ /** @mcp-legacy @deprecated Deprecated in MCP 2026-07-28 spec */
428
+ logging?: Record<string, unknown>;
429
+ };
430
+ }
431
+ interface DiscoverResult {
432
+ resultType: "complete";
433
+ supportedVersions: string[];
434
+ capabilities: ServerInfo["capabilities"];
435
+ serverInfo: ServerInfo;
436
+ instructions?: string;
437
+ }
438
+ interface McpRequest {
439
+ method: string;
440
+ params?: unknown;
441
+ id?: string | number | null;
442
+ jsonrpc?: "2.0";
443
+ }
444
+ interface McpResponse {
445
+ jsonrpc: "2.0";
446
+ id?: string | number | null;
447
+ result?: unknown;
448
+ error?: {
449
+ code: number;
450
+ message: string;
451
+ data?: unknown;
452
+ };
453
+ }
454
+
455
+ export { type AuthInfo as A, ToolSchema as B, type CallToolRequest as C, type DiscoverResult as D, computeEntryHash as E, executeGatewayInterceptor as F, type GatewayInterceptorOptions as G, globalAuditLogger as H, type InputRequest as I, JwtValidator as J, log as K, LiopLogger as L, type McpEra as M, type Prompt as P, type Resource as R, type ServerInfo as S, type Tool as T, type CallToolResult as a, type McpRequest as b, type McpResponse as c, AuditLogger as d, type GetPromptRequest as e, type GetPromptResult as f, type AuditEntry as g, type AuditInterceptor as h, type AuditRecordParams as i, type AuditStatus as j, type CacheableResult as k, GENESIS_HASH as l, type GatewayAdmissionResult as m, type GatewayInterceptor as n, type GatewayInterceptorContext as o, type InputRequiredResult as p, type InputResponse as q, type LogEvent as r, type LogInterceptor as s, type LogLevel as t, MCP_LEGACY_SUPPORT_ENABLED as u, MCP_PROTOCOL_VERSION as v, MCP_PROTOCOL_VERSION_LEGACY as w, type McpRequestMeta as x, PromptSchema as y, ResourceSchema as z };
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { P as ProofType, R as RECEIPT_VERSION_V1, a as RECEIPT_VERSION_V2, b as ZK_JOURNAL_V2_SIZE, c as ZkJournalV2, Z as ZkPolicy, d as ZkReceipt } from './zk-DzYNWBgo.js';
1
2
  import 'zod';
2
- export { A as AuthInfo, e as CacheableResult, C as CallToolRequest, a as CallToolResult, D as DiscoverResult, G as GetPromptRequest, d as GetPromptResult, I as InputRequest, f as InputRequiredResult, g as InputResponse, h as MCP_LEGACY_SUPPORT_ENABLED, i as MCP_PROTOCOL_VERSION, j as MCP_PROTOCOL_VERSION_LEGACY, M as McpEra, b as McpRequest, k as McpRequestMeta, c as McpResponse, P as Prompt, l as PromptSchema, R as Resource, m as ResourceSchema, S as ServerInfo, T as Tool, n as ToolSchema } from './types-lJIxBlWF.js';
3
+ export { h as AuditInterceptor, A as AuthInfo, k as CacheableResult, C as CallToolRequest, a as CallToolResult, D as DiscoverResult, m as GatewayAdmissionResult, n as GatewayInterceptor, o as GatewayInterceptorContext, G as GatewayInterceptorOptions, e as GetPromptRequest, f as GetPromptResult, I as InputRequest, p as InputRequiredResult, q as InputResponse, r as LogEvent, s as LogInterceptor, u as MCP_LEGACY_SUPPORT_ENABLED, v as MCP_PROTOCOL_VERSION, w as MCP_PROTOCOL_VERSION_LEGACY, M as McpEra, b as McpRequest, x as McpRequestMeta, c as McpResponse, P as Prompt, y as PromptSchema, R as Resource, z as ResourceSchema, S as ServerInfo, T as Tool, B as ToolSchema } from './types-29zv9X1V.js';
3
4
  import 'jose';
package/dist/types.js CHANGED
@@ -1,3 +1,2 @@
1
- export { MCP_LEGACY_SUPPORT_ENABLED, MCP_PROTOCOL_VERSION, MCP_PROTOCOL_VERSION_LEGACY, PromptSchema, ResourceSchema, ToolSchema } from './chunk-PYKRQAER.js';
2
- //# sourceMappingURL=types.js.map
1
+ export{a as MCP_LEGACY_SUPPORT_ENABLED,h as MCP_PROTOCOL_VERSION,b as MCP_PROTOCOL_VERSION_LEGACY,k as PromptSchema,j as ResourceSchema,i as ToolSchema}from'./chunk-GWVSCZUS.js';export{a as ProofType,b as RECEIPT_VERSION_V1,c as RECEIPT_VERSION_V2,d as ZK_JOURNAL_V2_SIZE}from'./chunk-6VK2XALI.js';import'./chunk-AYDF3IFZ.js';//# sourceMappingURL=types.js.map
3
2
  //# sourceMappingURL=types.js.map
@@ -0,0 +1,82 @@
1
+ import { Z as ZkPolicy } from './zk-DzYNWBgo.js';
2
+
3
+ type TeePolicy = "required" | "preferred" | "none";
4
+ interface TeeVerificationOptions {
5
+ /** Enforcement policy for TEE attestation */
6
+ policy?: TeePolicy;
7
+ /** Expected cryptographic nonce used during negotiateIntent handshake */
8
+ expectedNonce?: Buffer | Uint8Array;
9
+ /** Expected enclave public key (e.g. ML-KEM-768 public key) */
10
+ expectedPublicKey?: Buffer | Uint8Array;
11
+ /** Expected platform configuration registers (PCRs) */
12
+ expectedPcrs?: Record<number, string>;
13
+ /** Allow synthetic / mesh PSK proofs in non-hardware environments */
14
+ allowSynthetic?: boolean;
15
+ }
16
+ interface TeeVerificationResult {
17
+ verified: boolean;
18
+ platform: "amd-sev-snp" | "aws-nitro" | "intel-tdx" | "synthetic" | "none";
19
+ message: string;
20
+ measurements?: {
21
+ reportDataHex?: string;
22
+ measurementHex?: string;
23
+ chipIdHex?: string;
24
+ };
25
+ }
26
+ interface VerifyZkOptions {
27
+ sessionSecret?: Buffer;
28
+ expectedOutput?: unknown;
29
+ guestImageIdHex?: string;
30
+ vkeyRaw?: Buffer;
31
+ zkPolicy?: ZkPolicy;
32
+ circuitName?: string;
33
+ }
34
+ /**
35
+ * LIOP Tier-0 Industrial Verifier
36
+ *
37
+ * This engine is responsible for the trustless verification of remote logic execution.
38
+ * It validates both the integrity of the code (ZkImageID) and the mathematical proof
39
+ * of its execution (ZkSeal/Groth16), as well as hardware-level attestation (TEE).
40
+ */
41
+ declare class LiopVerifier {
42
+ private static zkWorkerPool;
43
+ private static vkeyRegistry;
44
+ /**
45
+ * Registers a verification key for a canonical analytical circuit.
46
+ */
47
+ static registerVKey(circuitName: string, vkeyRaw: Buffer): void;
48
+ /**
49
+ * Retrieves a registered verification key by circuit name.
50
+ */
51
+ static getRegisteredVKey(circuitName: string): Buffer | undefined;
52
+ private getZkPool;
53
+ /**
54
+ * Verifies a Zero-Knowledge Receipt from a remote LIOP node via Worker Pool.
55
+ * Supports both legacy positional arguments and structured options.
56
+ *
57
+ * @param logicPayload The raw WASM or JS logic that was sent to the provider.
58
+ * @param remoteImageIdHex The ImageID reported by the provider (must match our local calculation).
59
+ * @param zkReceipt The mathematical proof (Seal + Journal) from the zkVM or Groth16.
60
+ * @param sessionSecretOrOptions Shared secret (Buffer) or structured VerifyZkOptions.
61
+ * @param expectedOutput Optional expected output value for anti-replay verification.
62
+ */
63
+ verifyZkReceipt(logicPayload: Buffer, remoteImageIdHex: string, zkReceipt: Buffer, sessionSecretOrOptions?: Buffer | VerifyZkOptions, expectedOutput?: unknown): Promise<boolean>;
64
+ /**
65
+ * Detailed hardware attestation verification supporting AMD SEV-SNP, AWS Nitro Enclaves,
66
+ * and synthetic mesh verification.
67
+ */
68
+ verifyTeeAttestationDetailed(attestationReport: Buffer, options?: TeeVerificationOptions): Promise<TeeVerificationResult>;
69
+ /**
70
+ * Verifies if a node is running inside an authenticated TEE (e.g. AMD SEV-SNP or AWS Nitro).
71
+ *
72
+ * @param attestationReport The attestation document from the hardware.
73
+ * @param options Verification policy and binding options.
74
+ */
75
+ verifyTeeAttestation(attestationReport: Buffer, options?: TeeVerificationOptions): Promise<boolean>;
76
+ /**
77
+ * Derives the ImageID of a logic payload following the LIOP v1 Standard.
78
+ */
79
+ deriveImageId(logicPayload: Buffer): Buffer;
80
+ }
81
+
82
+ export { LiopVerifier as L, type TeePolicy as T, type VerifyZkOptions as V, type TeeVerificationOptions as a, type TeeVerificationResult as b };
@@ -0,0 +1,2 @@
1
+ export{a as LiopVerifier}from'./chunk-6KFKO6ZX.js';import'./chunk-TKLRW52V.js';import'./chunk-ZZMSFCJP.js';import'./chunk-3WRKTVOF.js';import'./chunk-AYDF3IFZ.js';//# sourceMappingURL=verifier-J4NQYZX5.js.map
2
+ //# sourceMappingURL=verifier-J4NQYZX5.js.map
@@ -1,3 +1,5 @@
1
+ import { P as ProofType } from '../zk-DzYNWBgo.js';
2
+
1
3
  interface WorkerData {
2
4
  isWarmup?: boolean;
3
5
  ciphertext?: Uint8Array;
@@ -10,6 +12,9 @@ interface WorkerData {
10
12
  sessionTimestamp?: number;
11
13
  isEncrypted?: boolean;
12
14
  aesNonce?: Uint8Array;
15
+ proofMode?: number;
16
+ guestImageId?: string;
17
+ pqcSigningKey?: Uint8Array;
13
18
  dpConfig?: {
14
19
  epsilon: number;
15
20
  sensitivity: number;
@@ -21,6 +26,8 @@ declare function processLogicExecution(data: WorkerData): Promise<{
21
26
  output: unknown;
22
27
  fuel_consumed: number;
23
28
  zk_receipt?: string;
29
+ proof_type?: ProofType;
30
+ guest_image_id?: string;
24
31
  }>;
25
32
 
26
33
  export { type WorkerData, processLogicExecution as default };