@nekzus/liop 2.4.0-alpha.21 → 2.4.0-alpha.23
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 +72 -36
- package/dist/bin/agent.js +8 -7
- package/dist/bin/agent.js.map +1 -1
- package/dist/bridge.d.ts +4 -3
- package/dist/bridge.js +3 -2
- package/dist/{chunk-FCFTYOAS.js → chunk-3WKFZQ34.js} +22 -12
- package/dist/chunk-3WKFZQ34.js.map +1 -0
- package/dist/{chunk-VRB5HUYU.js → chunk-AMSFSS2I.js} +14 -9
- package/dist/chunk-AMSFSS2I.js.map +1 -0
- package/dist/{chunk-VRDZ5IKE.js → chunk-E2CFIWD6.js} +15 -9
- package/dist/chunk-E2CFIWD6.js.map +1 -0
- package/dist/{chunk-EJ426URA.js → chunk-E7RSX476.js} +4 -4
- package/dist/{chunk-EJ426URA.js.map → chunk-E7RSX476.js.map} +1 -1
- package/dist/{chunk-UJFWPRDM.js → chunk-GFGSHQN5.js} +3 -3
- package/dist/{chunk-UJFWPRDM.js.map → chunk-GFGSHQN5.js.map} +1 -1
- package/dist/{chunk-XRDN232O.js → chunk-KB3HUVMD.js} +2 -2
- package/dist/chunk-KB3HUVMD.js.map +1 -0
- package/dist/chunk-OHMZZMMC.js +58 -0
- package/dist/chunk-OHMZZMMC.js.map +1 -0
- package/dist/chunk-P34HDRN5.js +213 -0
- package/dist/chunk-P34HDRN5.js.map +1 -0
- package/dist/{chunk-PAICJCKJ.js → chunk-Q3FKHJ3B.js} +17 -4
- package/dist/chunk-Q3FKHJ3B.js.map +1 -0
- package/dist/{chunk-5SWHE62F.js → chunk-T2QDHVUD.js} +71 -11
- package/dist/chunk-T2QDHVUD.js.map +1 -0
- package/dist/{chunk-2KSO3W4A.js → chunk-YLFNJQI2.js} +2 -2
- package/dist/{chunk-2KSO3W4A.js.map → chunk-YLFNJQI2.js.map} +1 -1
- package/dist/{chunk-2STZHJ24.js → chunk-ZRWNMP5L.js} +58 -7
- package/dist/chunk-ZRWNMP5L.js.map +1 -0
- package/dist/client.d.ts +5 -4
- package/dist/client.js +7 -6
- package/dist/gateway.d.ts +6 -5
- package/dist/gateway.js +7 -6
- package/dist/{hybrid-DWe1bMoV.d.ts → hybrid-B7EjCj3q.d.ts} +4 -4
- package/dist/{index-CdW8j8Bn.d.ts → index-D2P6Z_hP.d.ts} +25 -2
- package/dist/{index-BuEQtBHD.d.ts → index-DDwiS7tf.d.ts} +8 -4
- package/dist/index.d.ts +51 -9
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/mesh.d.ts +1 -1
- package/dist/mesh.js +1 -1
- package/dist/{node-B0b2vUFS.d.ts → node-Djzm6UYd.d.ts} +8 -0
- package/dist/protocol/liop_core.proto +22 -6
- package/dist/server.d.ts +4 -3
- package/dist/server.js +5 -4
- package/dist/{types-CzRSOlOo.d.ts → types-rxL19f0l.d.ts} +3 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.js +2 -1
- package/dist/{verifier-COnid_dg.d.ts → verifier-DTn1LXDU.d.ts} +25 -3
- package/dist/verifier-UBJTZQSA.js +6 -0
- package/dist/{verifier-XFU7ZB2W.js.map → verifier-UBJTZQSA.js.map} +1 -1
- package/dist/workers/logic-execution.d.ts +6 -0
- package/dist/workers/logic-execution.js +56 -1
- package/dist/workers/logic-execution.js.map +1 -1
- package/dist/workers/zk-verifier.d.ts +9 -0
- package/dist/workers/zk-verifier.js +119 -47
- package/dist/workers/zk-verifier.js.map +1 -1
- package/dist/zk-CYImPsa6.d.ts +91 -0
- package/package.json +2 -1
- package/dist/chunk-2STZHJ24.js.map +0 -1
- package/dist/chunk-5SWHE62F.js.map +0 -1
- package/dist/chunk-FCFTYOAS.js.map +0 -1
- package/dist/chunk-PAICJCKJ.js.map +0 -1
- package/dist/chunk-VRB5HUYU.js.map +0 -1
- package/dist/chunk-VRDZ5IKE.js.map +0 -1
- package/dist/chunk-XRDN232O.js.map +0 -1
- package/dist/verifier-XFU7ZB2W.js +0 -6
|
@@ -73,5 +73,5 @@ var PromptSchema = z.object({
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
export { MCP_LEGACY_SUPPORT_ENABLED, MCP_PROTOCOL_VERSION, MCP_PROTOCOL_VERSION_LEGACY, PromptSchema, ResourceSchema, ToolSchema, adaptResponseForLegacyClient, buildLegacyInitializeResponse, isLegacyRequest };
|
|
76
|
-
//# sourceMappingURL=chunk-
|
|
77
|
-
//# sourceMappingURL=chunk-
|
|
76
|
+
//# sourceMappingURL=chunk-YLFNJQI2.js.map
|
|
77
|
+
//# sourceMappingURL=chunk-YLFNJQI2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/gateway/mcp-compat.ts","../src/types.ts"],"names":[],"mappings":";;;;;AAiBO,IAAM,0BAAA,GAA6B;AAKnC,IAAM,2BAAA,GAA8B;AAKpC,SAAS,6BAAA,CACf,YACA,EAAA,EACc;AACd,EAAA,OAAO;AAAA,IACN,OAAA,EAAS,KAAA;AAAA,IACT,IAAI,EAAA,IAAM,IAAA;AAAA,IACV,MAAA,EAAQ;AAAA,MACP,eAAA,EAAiB,2BAAA;AAAA,MACjB,YAAA,EAAc;AAAA,QACb,KAAA,EAAO,EAAE,WAAA,EAAa,IAAA,EAAK;AAAA,QAC3B,SAAA,EAAW,EAAE,WAAA,EAAa,IAAA,EAAK;AAAA,QAC/B,OAAA,EAAS,EAAE,WAAA,EAAa,IAAA;AAAK,OAC9B;AAAA,MACA;AAAA;AACD,GACD;AACD;AAOO,SAAS,gBAAgB,OAAA,EAA8B;AAC7D,EAAA,IACC,OAAA,CAAQ,MAAA,KAAW,YAAA,IACnB,OAAA,CAAQ,WAAW,2BAAA,EAClB;AACD,IAAA,OAAO,IAAA;AAAA,EACR;AAEA,EAAA,MAAM,SAAS,OAAA,CAAQ,MAAA;AACvB,EAAA,MAAM,OAAO,MAAA,EAAQ,KAAA;AACrB,EAAA,MAAM,OAAA,GAAU,OAA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A,MACf,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA,MACjC,QAAA,EAAU,CAAA,CAAE,OAAA,EAAQ,CAAE,QAAA;AAAS,KAC/B;AAAA,IAED,QAAA;AACH,CAAC","file":"chunk-YLFNJQI2.js","sourcesContent":["// Copyright 2026 Nekzus Solutions and contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { McpRequest, McpResponse, ServerInfo } from \"../types.js\";\n\n/**\n * @mcp-legacy ENTIRE FILE — MCP 2025-era backward compatibility layer.\n * Remove this file when MCP v1 (2025-11-25) reaches EOL.\n *\n * SUNSET INSTRUCTION: Delete this file, then grep for \"@mcp-legacy\" in the\n * codebase to find and remove all remaining legacy seams.\n */\n\n/**\n * @mcp-legacy Master kill switch for MCP 2025-era backward compatibility.\n * Set to `false` when MCP v1 reaches End-of-Life (EOL) to disable all legacy seams.\n */\nexport const MCP_LEGACY_SUPPORT_ENABLED = true;\n\n/**\n * @mcp-legacy Legacy protocol version constant.\n */\nexport const MCP_PROTOCOL_VERSION_LEGACY = \"2025-11-25\" as const;\n\n/**\n * @mcp-legacy Build the legacy initialize handshake response.\n */\nexport function buildLegacyInitializeResponse(\n\tserverInfo: ServerInfo,\n\tid?: string | number | null,\n): McpResponse {\n\treturn {\n\t\tjsonrpc: \"2.0\",\n\t\tid: id ?? null,\n\t\tresult: {\n\t\t\tprotocolVersion: MCP_PROTOCOL_VERSION_LEGACY,\n\t\t\tcapabilities: {\n\t\t\t\ttools: { listChanged: true },\n\t\t\t\tresources: { listChanged: true },\n\t\t\t\tprompts: { listChanged: true },\n\t\t\t},\n\t\t\tserverInfo,\n\t\t},\n\t};\n}\n\n/**\n * @mcp-legacy Detect if a request is strictly from a 2025-era legacy client.\n * Legacy requests either invoke 'initialize', 'notifications/initialized',\n * or lack modern '_meta' protocol envelopes.\n */\nexport function isLegacyRequest(request: McpRequest): boolean {\n\tif (\n\t\trequest.method === \"initialize\" ||\n\t\trequest.method === \"notifications/initialized\"\n\t) {\n\t\treturn true;\n\t}\n\n\tconst params = request.params as Record<string, unknown> | undefined;\n\tconst meta = params?._meta as Record<string, unknown> | undefined;\n\tconst version = meta?.[\"io.modelcontextprotocol/protocolVersion\"];\n\n\tif (!version || version === MCP_PROTOCOL_VERSION_LEGACY) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * @mcp-legacy Wrap and strip modern-era fields (resultType, ttlMs, cacheScope, etc.)\n * from a response to ensure 100% wire-compatibility with strict 2025 MCP clients.\n */\nexport function adaptResponseForLegacyClient(\n\tresponse: McpResponse,\n): McpResponse {\n\tif (!response.result || typeof response.result !== \"object\") {\n\t\treturn response;\n\t}\n\n\tconst rawResult = { ...(response.result as Record<string, unknown>) };\n\n\t// Strip modern-only envelope tags\n\tdelete rawResult.resultType;\n\tdelete rawResult.ttlMs;\n\tdelete rawResult.cacheScope;\n\n\treturn {\n\t\t...response,\n\t\tresult: rawResult,\n\t};\n}\n","// Copyright 2026 Nekzus Solutions and contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport { z } from \"zod\";\n\n/**\n * Protocol Version Identifiers\n */\nexport const MCP_PROTOCOL_VERSION = \"2026-07-28\" as const;\n\nexport {\n\tMCP_LEGACY_SUPPORT_ENABLED,\n\tMCP_PROTOCOL_VERSION_LEGACY,\n} from \"./gateway/mcp-compat.js\";\n\n/**\n * Protocol Era Classification\n */\nexport type McpEra = \"legacy\" | \"modern\";\n\n/**\n * Caching Hints for MCP 2026-07-28 Spec\n */\nexport interface CacheableResult {\n\tttlMs?: number;\n\tcacheScope?: \"public\" | \"private\";\n}\n\n/**\n * Multi-Round-Trip Requests (MRTR) Specification Types\n */\nexport interface InputRequest {\n\tid: string;\n\tmessage: string;\n\tschema?: Record<string, unknown>;\n}\n\nexport interface InputResponse {\n\tid: string;\n\tvalue: unknown;\n}\n\nexport interface InputRequiredResult {\n\tresultType: \"input_required\";\n\tinputRequests: InputRequest[];\n\trequestState?: string;\n}\n\n/**\n * Modern Envelope Metadata (_meta)\n */\nexport interface McpRequestMeta {\n\t\"io.modelcontextprotocol/protocolVersion\"?: string;\n\t\"io.modelcontextprotocol/clientInfo\"?: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n\t\"io.modelcontextprotocol/clientCapabilities\"?: Record<string, unknown>;\n\t[key: string]: unknown;\n}\n\n/**\n * Base Protocol Types representing parity with Model Context Protocol\n */\n\nexport const ToolSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tinputSchema: z.record(z.string(), z.unknown()), // Represents a JSON Schema\n});\n\nexport type Tool = z.infer<typeof ToolSchema>;\n\nexport const ResourceSchema = z.object({\n\turi: z.string(),\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\tmimeType: z.string().optional(),\n});\n\nexport type Resource = z.infer<typeof ResourceSchema>;\n\nexport const PromptSchema = z.object({\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\targuments: z\n\t\t.array(\n\t\t\tz.object({\n\t\t\t\tname: z.string(),\n\t\t\t\tdescription: z.string().optional(),\n\t\t\t\trequired: z.boolean().optional(),\n\t\t\t}),\n\t\t)\n\t\t.optional(),\n});\n\nexport type Prompt = z.infer<typeof PromptSchema>;\n\nexport interface CallToolRequest {\n\tname: string;\n\targuments?: Record<string, unknown>;\n}\n\nexport interface CallToolResult {\n\tcontent: Array<{\n\t\ttype: \"text\" | \"image\" | \"resource\";\n\t\ttext?: string;\n\t\tdata?: string;\n\t\tmimeType?: string;\n\t\tresource?: {\n\t\t\turi: string;\n\t\t\ttext?: string;\n\t\t\tblob?: string;\n\t\t};\n\t}>;\n\tisError?: boolean;\n\tzkVerified?: boolean;\n\tzkProofType?: import(\"./security/zk.js\").ProofType;\n}\n\nexport interface GetPromptRequest {\n\tname: string;\n\targuments?: Record<string, string>;\n}\n\nexport interface GetPromptResult {\n\tdescription?: string;\n\tmessages: Array<{\n\t\trole: \"user\" | \"assistant\";\n\t\tcontent:\n\t\t\t| { type: \"text\"; text: string }\n\t\t\t| { type: \"image\"; data: string; mimeType: string }\n\t\t\t| {\n\t\t\t\t\ttype: \"resource\";\n\t\t\t\t\tresource: { uri: string; text?: string; blob?: string };\n\t\t\t };\n\t}>;\n}\n\nexport interface ServerInfo {\n\tname: string;\n\tversion: string;\n\tcapabilities?: {\n\t\tprompts?: { listChanged?: boolean };\n\t\tresources?: { subscribe?: boolean; listChanged?: boolean };\n\t\ttools?: { listChanged?: boolean };\n\t\t/** @mcp-legacy @deprecated Deprecated in MCP 2026-07-28 spec */\n\t\tlogging?: Record<string, unknown>;\n\t};\n}\n\nexport interface DiscoverResult {\n\tresultType: \"complete\";\n\tsupportedVersions: string[];\n\tcapabilities: ServerInfo[\"capabilities\"];\n\tserverInfo: ServerInfo;\n\tinstructions?: string;\n}\n\nexport interface McpRequest {\n\tmethod: string;\n\tparams?: unknown;\n\tid?: string | number | null;\n\tjsonrpc?: \"2.0\";\n}\n\nexport interface McpResponse {\n\tjsonrpc: \"2.0\";\n\tid?: string | number | null;\n\tresult?: unknown;\n\terror?: {\n\t\tcode: number;\n\t\tmessage: string;\n\t\tdata?: unknown;\n\t};\n}\n\n/**\n * Re-export Gateway Interceptor types for consumer convenience.\n */\nexport type {\n\tGatewayAdmissionResult,\n\tGatewayInterceptor,\n\tGatewayInterceptorContext,\n\tGatewayInterceptorOptions,\n} from \"./gateway/interceptor.js\";\nexport type { AuditInterceptor } from \"./interceptors/audit-interceptor.js\";\n/**\n * Re-export Log & Audit Interceptor types for consumer convenience.\n */\nexport type {\n\tLogEvent,\n\tLogInterceptor,\n} from \"./interceptors/log-interceptor.js\";\n/**\n * Re-export AuthInfo from the security module for convenience.\n * Compatible with MCP TypeScript SDK AuthInfo interface shape.\n */\nexport type { AuthInfo } from \"./security/jwt-validator.js\";\nexport type {\n\tZkJournalV2,\n\tZkPolicy,\n\tZkReceipt,\n} from \"./security/zk.js\";\n/**\n * Re-export Zero-Knowledge Proof & Verification types for consumer convenience.\n */\nexport {\n\tProofType,\n\tRECEIPT_VERSION_V1,\n\tRECEIPT_VERSION_V2,\n\tZK_JOURNAL_V2_SIZE,\n} from \"./security/zk.js\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { deriveLogicImageDigest } from './chunk-IK7CGWAZ.js';
|
|
2
|
-
import { zkVerificationDurationMs } from './chunk-
|
|
2
|
+
import { zkVkeyCacheSize, zkVerificationDurationMs, zkProofsByTypeTotal } from './chunk-Q3FKHJ3B.js';
|
|
3
3
|
import { log } from './chunk-K3DGJLUY.js';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
5
|
import { createRequire } from 'module';
|
|
@@ -12,6 +12,24 @@ var __dirname$1 = path.dirname(__filename$1);
|
|
|
12
12
|
var LiopVerifier = class _LiopVerifier {
|
|
13
13
|
// Singleton Worker Pool for heavy ZK verification
|
|
14
14
|
static zkWorkerPool = null;
|
|
15
|
+
// Static registry of embedded verification keys for canonical circuits
|
|
16
|
+
static vkeyRegistry = /* @__PURE__ */ new Map();
|
|
17
|
+
/**
|
|
18
|
+
* Registers a verification key for a canonical analytical circuit.
|
|
19
|
+
*/
|
|
20
|
+
static registerVKey(circuitName, vkeyRaw) {
|
|
21
|
+
_LiopVerifier.vkeyRegistry.set(circuitName, vkeyRaw);
|
|
22
|
+
try {
|
|
23
|
+
zkVkeyCacheSize.set(_LiopVerifier.vkeyRegistry.size);
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a registered verification key by circuit name.
|
|
29
|
+
*/
|
|
30
|
+
static getRegisteredVKey(circuitName) {
|
|
31
|
+
return _LiopVerifier.vkeyRegistry.get(circuitName);
|
|
32
|
+
}
|
|
15
33
|
getZkPool() {
|
|
16
34
|
if (!_LiopVerifier.zkWorkerPool) {
|
|
17
35
|
const isTS = import.meta.url.endsWith(".ts");
|
|
@@ -54,29 +72,62 @@ var LiopVerifier = class _LiopVerifier {
|
|
|
54
72
|
}
|
|
55
73
|
/**
|
|
56
74
|
* Verifies a Zero-Knowledge Receipt from a remote LIOP node via Worker Pool.
|
|
75
|
+
* Supports both legacy positional arguments and structured options.
|
|
57
76
|
*
|
|
58
77
|
* @param logicPayload The raw WASM or JS logic that was sent to the provider.
|
|
59
78
|
* @param remoteImageIdHex The ImageID reported by the provider (must match our local calculation).
|
|
60
|
-
* @param zkReceipt The mathematical proof (Seal + Journal) from the zkVM.
|
|
79
|
+
* @param zkReceipt The mathematical proof (Seal + Journal) from the zkVM or Groth16.
|
|
80
|
+
* @param sessionSecretOrOptions Shared secret (Buffer) or structured VerifyZkOptions.
|
|
81
|
+
* @param expectedOutput Optional expected output value for anti-replay verification.
|
|
61
82
|
*/
|
|
62
|
-
async verifyZkReceipt(logicPayload, remoteImageIdHex, zkReceipt,
|
|
83
|
+
async verifyZkReceipt(logicPayload, remoteImageIdHex, zkReceipt, sessionSecretOrOptions, expectedOutput) {
|
|
63
84
|
const pool = this.getZkPool();
|
|
64
85
|
if (!pool) throw new Error("Worker pool initialization failed");
|
|
86
|
+
let sessionSecret;
|
|
87
|
+
let actualExpectedOutput = expectedOutput;
|
|
88
|
+
let guestImageIdHex;
|
|
89
|
+
let vkeyRaw;
|
|
90
|
+
let zkPolicy;
|
|
91
|
+
if (Buffer.isBuffer(sessionSecretOrOptions)) {
|
|
92
|
+
sessionSecret = sessionSecretOrOptions;
|
|
93
|
+
} else if (sessionSecretOrOptions && typeof sessionSecretOrOptions === "object") {
|
|
94
|
+
sessionSecret = sessionSecretOrOptions.sessionSecret;
|
|
95
|
+
if (sessionSecretOrOptions.expectedOutput !== void 0) {
|
|
96
|
+
actualExpectedOutput = sessionSecretOrOptions.expectedOutput;
|
|
97
|
+
}
|
|
98
|
+
guestImageIdHex = sessionSecretOrOptions.guestImageIdHex;
|
|
99
|
+
vkeyRaw = sessionSecretOrOptions.vkeyRaw;
|
|
100
|
+
zkPolicy = sessionSecretOrOptions.zkPolicy;
|
|
101
|
+
if (!vkeyRaw && sessionSecretOrOptions.circuitName) {
|
|
102
|
+
vkeyRaw = _LiopVerifier.getRegisteredVKey(
|
|
103
|
+
sessionSecretOrOptions.circuitName
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
65
107
|
const startTime = performance.now();
|
|
66
108
|
const result = await pool.run({
|
|
67
109
|
action: "verify_receipt",
|
|
68
110
|
logicPayload: new Uint8Array(logicPayload),
|
|
69
111
|
remoteImageIdHex,
|
|
112
|
+
guestImageIdHex,
|
|
70
113
|
zkReceipt: new Uint8Array(zkReceipt),
|
|
71
114
|
sessionSecret: sessionSecret ? new Uint8Array(sessionSecret) : void 0,
|
|
72
|
-
|
|
115
|
+
vkeyRaw: vkeyRaw ? new Uint8Array(vkeyRaw) : void 0,
|
|
116
|
+
expectedOutput: actualExpectedOutput,
|
|
117
|
+
zkPolicy
|
|
73
118
|
});
|
|
74
119
|
const durationMs = performance.now() - startTime;
|
|
75
120
|
try {
|
|
76
121
|
zkVerificationDurationMs.observe(
|
|
77
|
-
{
|
|
122
|
+
{
|
|
123
|
+
status: result.verified ? "verified" : "failed",
|
|
124
|
+
proof_type: result.proofType || "unknown"
|
|
125
|
+
},
|
|
78
126
|
durationMs
|
|
79
127
|
);
|
|
128
|
+
if (result.verified && result.proofType) {
|
|
129
|
+
zkProofsByTypeTotal.inc({ proof_type: result.proofType });
|
|
130
|
+
}
|
|
80
131
|
} catch {
|
|
81
132
|
}
|
|
82
133
|
if (result.verified) {
|
|
@@ -110,5 +161,5 @@ var LiopVerifier = class _LiopVerifier {
|
|
|
110
161
|
};
|
|
111
162
|
|
|
112
163
|
export { LiopVerifier };
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-ZRWNMP5L.js.map
|
|
165
|
+
//# sourceMappingURL=chunk-ZRWNMP5L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/crypto/verifier.ts"],"names":["__filename","__dirname"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,OAAO,KAAA;AAAA,IACR;AAAA,EACD;AAAA;AAAA;AAAA;AAAA,EAKO,cAAc,YAAA,EAA8B;AAClD,IAAA,OAAO,uBAAuB,YAAY,CAAA;AAAA,EAC3C;AACD","file":"chunk-ZRWNMP5L.js","sourcesContent":["// Copyright 2026 Nekzus Solutions and contributors\n// SPDX-License-Identifier: Apache-2.0\n\nimport * as fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { Piscina } from \"piscina\";\nimport {\n\tzkProofsByTypeTotal,\n\tzkVerificationDurationMs,\n\tzkVkeyCacheSize,\n} from \"../observability/metrics.js\";\nimport { log } from \"../utils/logger.js\";\nimport { deriveLogicImageDigest } from \"./logic-image-id.js\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport interface VerifyZkOptions {\n\tsessionSecret?: Buffer;\n\texpectedOutput?: unknown;\n\tguestImageIdHex?: string;\n\tvkeyRaw?: Buffer;\n\tzkPolicy?: import(\"../security/zk.js\").ZkPolicy;\n\tcircuitName?: string;\n}\n\n/**\n * LIOP Tier-0 Industrial Verifier\n *\n * This engine is responsible for the trustless verification of remote logic execution.\n * It validates both the integrity of the code (ZkImageID) and the mathematical proof\n * of its execution (ZkSeal/Groth16), as well as hardware-level attestation (TEE).\n */\nexport class LiopVerifier {\n\t// Singleton Worker Pool for heavy ZK verification\n\tprivate static zkWorkerPool: Piscina | null = null;\n\t// Static registry of embedded verification keys for canonical circuits\n\tprivate static vkeyRegistry = new Map<string, Buffer>();\n\n\t/**\n\t * Registers a verification key for a canonical analytical circuit.\n\t */\n\tpublic static registerVKey(circuitName: string, vkeyRaw: Buffer): void {\n\t\tLiopVerifier.vkeyRegistry.set(circuitName, vkeyRaw);\n\t\ttry {\n\t\t\tzkVkeyCacheSize.set(LiopVerifier.vkeyRegistry.size);\n\t\t} catch {}\n\t}\n\n\t/**\n\t * Retrieves a registered verification key by circuit name.\n\t */\n\tpublic static getRegisteredVKey(circuitName: string): Buffer | undefined {\n\t\treturn LiopVerifier.vkeyRegistry.get(circuitName);\n\t}\n\n\tprivate getZkPool() {\n\t\tif (!LiopVerifier.zkWorkerPool) {\n\t\t\tconst isTS = import.meta.url.endsWith(\".ts\");\n\t\t\tconst workerExt = isTS ? \".ts\" : \".js\";\n\n\t\t\tlet execArgv: string[] = [];\n\t\t\tif (isTS) {\n\t\t\t\ttry {\n\t\t\t\t\tconst req = createRequire(import.meta.url);\n\t\t\t\t\tconst tsxPkg = req.resolve(\"tsx/package.json\");\n\t\t\t\t\tconst absoluteTsx = pathToFileURL(\n\t\t\t\t\t\tpath.join(path.dirname(tsxPkg), \"dist\", \"loader.mjs\"),\n\t\t\t\t\t).href;\n\t\t\t\t\texecArgv = [\"--import\", absoluteTsx];\n\t\t\t\t} catch (_e) {\n\t\t\t\t\texecArgv = [\"--import\", \"tsx\"];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Support both flat dist/ and original src/ structure\n\t\t\tconst workerPaths = [\n\t\t\t\tpath.resolve(__dirname, `./workers/zk-verifier${workerExt}`), // Flat dist/ (tsup)\n\t\t\t\tpath.resolve(__dirname, `../workers/zk-verifier${workerExt}`), // Original src/\n\t\t\t];\n\n\t\t\tconst workerFilename =\n\t\t\t\tworkerPaths.find((p) => fs.existsSync(p)) || workerPaths[1];\n\n\t\t\tLiopVerifier.zkWorkerPool = new Piscina({\n\t\t\t\tfilename: workerFilename,\n\t\t\t\tminThreads: 1,\n\t\t\t\tmaxThreads: 2, // Minimal footprint since verification is fast compared to generation\n\t\t\t\tidleTimeout: 30000,\n\t\t\t\texecArgv,\n\t\t\t});\n\n\t\t\t// Pre-warm the verification worker\n\t\t\tLiopVerifier.zkWorkerPool.run({ action: \"warmup\" }).catch((err) => {\n\t\t\t\tlog.debug(\n\t\t\t\t\t`[LiopVerifier] Verification pool warm-up ping failed: ${err.message}`,\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\t\treturn LiopVerifier.zkWorkerPool;\n\t}\n\n\t/**\n\t * Verifies a Zero-Knowledge Receipt from a remote LIOP node via Worker Pool.\n\t * Supports both legacy positional arguments and structured options.\n\t *\n\t * @param logicPayload The raw WASM or JS logic that was sent to the provider.\n\t * @param remoteImageIdHex The ImageID reported by the provider (must match our local calculation).\n\t * @param zkReceipt The mathematical proof (Seal + Journal) from the zkVM or Groth16.\n\t * @param sessionSecretOrOptions Shared secret (Buffer) or structured VerifyZkOptions.\n\t * @param expectedOutput Optional expected output value for anti-replay verification.\n\t */\n\tpublic async verifyZkReceipt(\n\t\tlogicPayload: Buffer,\n\t\tremoteImageIdHex: string,\n\t\tzkReceipt: Buffer,\n\t\tsessionSecretOrOptions?: Buffer | VerifyZkOptions,\n\t\texpectedOutput?: unknown,\n\t): Promise<boolean> {\n\t\tconst pool = this.getZkPool();\n\t\tif (!pool) throw new Error(\"Worker pool initialization failed\");\n\n\t\tlet sessionSecret: Buffer | undefined;\n\t\tlet actualExpectedOutput: unknown = expectedOutput;\n\t\tlet guestImageIdHex: string | undefined;\n\t\tlet vkeyRaw: Buffer | undefined;\n\t\tlet zkPolicy: import(\"../security/zk.js\").ZkPolicy | undefined;\n\n\t\tif (Buffer.isBuffer(sessionSecretOrOptions)) {\n\t\t\tsessionSecret = sessionSecretOrOptions;\n\t\t} else if (\n\t\t\tsessionSecretOrOptions &&\n\t\t\ttypeof sessionSecretOrOptions === \"object\"\n\t\t) {\n\t\t\tsessionSecret = sessionSecretOrOptions.sessionSecret;\n\t\t\tif (sessionSecretOrOptions.expectedOutput !== undefined) {\n\t\t\t\tactualExpectedOutput = sessionSecretOrOptions.expectedOutput;\n\t\t\t}\n\t\t\tguestImageIdHex = sessionSecretOrOptions.guestImageIdHex;\n\t\t\tvkeyRaw = sessionSecretOrOptions.vkeyRaw;\n\t\t\tzkPolicy = sessionSecretOrOptions.zkPolicy;\n\n\t\t\tif (!vkeyRaw && sessionSecretOrOptions.circuitName) {\n\t\t\t\tvkeyRaw = LiopVerifier.getRegisteredVKey(\n\t\t\t\t\tsessionSecretOrOptions.circuitName,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst startTime = performance.now();\n\t\tconst result = await pool.run({\n\t\t\taction: \"verify_receipt\",\n\t\t\tlogicPayload: new Uint8Array(logicPayload),\n\t\t\tremoteImageIdHex,\n\t\t\tguestImageIdHex,\n\t\t\tzkReceipt: new Uint8Array(zkReceipt),\n\t\t\tsessionSecret: sessionSecret ? new Uint8Array(sessionSecret) : undefined,\n\t\t\tvkeyRaw: vkeyRaw ? new Uint8Array(vkeyRaw) : undefined,\n\t\t\texpectedOutput: actualExpectedOutput,\n\t\t\tzkPolicy,\n\t\t});\n\t\tconst durationMs = performance.now() - startTime;\n\n\t\ttry {\n\t\t\tzkVerificationDurationMs.observe(\n\t\t\t\t{\n\t\t\t\t\tstatus: result.verified ? \"verified\" : \"failed\",\n\t\t\t\t\tproof_type: result.proofType || \"unknown\",\n\t\t\t\t},\n\t\t\t\tdurationMs,\n\t\t\t);\n\t\t\tif (result.verified && result.proofType) {\n\t\t\t\tzkProofsByTypeTotal.inc({ proof_type: result.proofType });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Metrics observation failure must never disrupt cryptographic verification\n\t\t}\n\n\t\tif (result.verified) {\n\t\t\tlog.info(`[LiopVerifier] ${result.message}`);\n\t\t\treturn true;\n\t\t}\n\n\t\tlog.error(`[LiopVerifier] FAILED: ${result.message}`);\n\t\treturn false;\n\t}\n\n\t/**\n\t * Verifies if a node is running inside an authenticated TEE (e.g. AWS Nitro).\n\t *\n\t * @param attestationReport The COSE-signed attestation document from the hardware.\n\t */\n\tpublic async verifyTeeAttestation(\n\t\tattestationReport: Buffer,\n\t): Promise<boolean> {\n\t\tif (attestationReport.length === 0) return true; // Optional in Mesh Alpha\n\n\t\ttry {\n\t\t\t// Architecture for AWS Nitro Enclaves:\n\t\t\t// 1. Decode CBOR/COSE\n\t\t\t// 2. Verify Signature against AWS Nitro Root CA\n\t\t\t// 3. Compare PCRs\n\t\t\tlog.info(\"[LiopVerifier] TEE Attestation: Not configured (no-op).\");\n\t\t\treturn true;\n\t\t} catch (err) {\n\t\t\tlog.error(\"[LiopVerifier] TEE Verification Failed:\", err);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Derives the ImageID of a logic payload following the LIOP v1 Standard.\n\t */\n\tpublic deriveImageId(logicPayload: Buffer): Buffer {\n\t\treturn deriveLogicImageDigest(logicPayload);\n\t}\n}\n"]}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import './verifier-
|
|
2
|
-
import './node-
|
|
3
|
-
export { c as LiopClient } from './index-
|
|
4
|
-
import './
|
|
1
|
+
import './verifier-DTn1LXDU.js';
|
|
2
|
+
import './node-Djzm6UYd.js';
|
|
3
|
+
export { c as LiopClient } from './index-DDwiS7tf.js';
|
|
4
|
+
import './zk-CYImPsa6.js';
|
|
5
|
+
import './types-rxL19f0l.js';
|
|
5
6
|
import '@grpc/grpc-js';
|
|
6
7
|
import 'node:events';
|
|
7
8
|
import 'zod';
|
package/dist/client.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { LiopClient } from './chunk-
|
|
1
|
+
export { LiopClient } from './chunk-3WKFZQ34.js';
|
|
2
2
|
import './chunk-3QH44NKZ.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-ZRWNMP5L.js';
|
|
4
4
|
import './chunk-IK7CGWAZ.js';
|
|
5
5
|
import './chunk-7PITYWOV.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
6
|
+
import './chunk-GFGSHQN5.js';
|
|
7
|
+
import './chunk-Q3FKHJ3B.js';
|
|
8
|
+
import './chunk-YLFNJQI2.js';
|
|
9
|
+
import './chunk-P34HDRN5.js';
|
|
10
|
+
import './chunk-KB3HUVMD.js';
|
|
10
11
|
import './chunk-K3DGJLUY.js';
|
|
11
12
|
//# sourceMappingURL=client.js.map
|
|
12
13
|
//# sourceMappingURL=client.js.map
|
package/dist/gateway.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import './node-
|
|
2
|
-
import './index-
|
|
3
|
-
import './types-
|
|
4
|
-
export { L as LiopHybridGateway } from './hybrid-
|
|
1
|
+
import './node-Djzm6UYd.js';
|
|
2
|
+
import './index-D2P6Z_hP.js';
|
|
3
|
+
import './types-rxL19f0l.js';
|
|
4
|
+
export { L as LiopHybridGateway } from './hybrid-B7EjCj3q.js';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import './zk-CYImPsa6.js';
|
|
6
7
|
import 'jose';
|
|
7
|
-
import './verifier-
|
|
8
|
+
import './verifier-DTn1LXDU.js';
|
package/dist/gateway.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export { LiopHybridGateway } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { LiopHybridGateway } from './chunk-E7RSX476.js';
|
|
2
|
+
import './chunk-AMSFSS2I.js';
|
|
3
|
+
import './chunk-ZRWNMP5L.js';
|
|
4
4
|
import './chunk-IK7CGWAZ.js';
|
|
5
5
|
import './chunk-7PITYWOV.js';
|
|
6
6
|
import './chunk-WPTOJYN5.js';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
7
|
+
import './chunk-GFGSHQN5.js';
|
|
8
|
+
import './chunk-Q3FKHJ3B.js';
|
|
9
|
+
import './chunk-YLFNJQI2.js';
|
|
10
|
+
import './chunk-P34HDRN5.js';
|
|
10
11
|
import './chunk-K3DGJLUY.js';
|
|
11
12
|
//# sourceMappingURL=gateway.js.map
|
|
12
13
|
//# sourceMappingURL=gateway.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as MeshNode } from './node-
|
|
2
|
-
import { L as LiopServer } from './index-
|
|
3
|
-
import { b as McpRequest, M as McpEra, A as AuthInfo, c as McpResponse, G as GatewayInterceptorOptions } from './types-
|
|
4
|
-
import { L as LiopVerifier } from './verifier-
|
|
1
|
+
import { a as MeshNode } from './node-Djzm6UYd.js';
|
|
2
|
+
import { L as LiopServer } from './index-D2P6Z_hP.js';
|
|
3
|
+
import { b as McpRequest, M as McpEra, A as AuthInfo, c as McpResponse, G as GatewayInterceptorOptions } from './types-rxL19f0l.js';
|
|
4
|
+
import { L as LiopVerifier } from './verifier-DTn1LXDU.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* LIOP Sliding-Window Rate Limiter
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { M as MeshNodeConfig, a as MeshNode } from './node-
|
|
3
|
-
import { d as AuditLogger, J as JwtValidator, S as ServerInfo, a as CallToolResult, P as Prompt, e as GetPromptRequest, f as GetPromptResult, C as CallToolRequest, T as Tool, R as Resource } from './types-
|
|
2
|
+
import { M as MeshNodeConfig, a as MeshNode } from './node-Djzm6UYd.js';
|
|
3
|
+
import { d as AuditLogger, J as JwtValidator, S as ServerInfo, a as CallToolResult, P as Prompt, e as GetPromptRequest, f as GetPromptResult, C as CallToolRequest, T as Tool, R as Resource } from './types-rxL19f0l.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* LIOP OAuth 2.1 Hybrid Auth — Configuration Types
|
|
@@ -281,6 +281,10 @@ interface LiopServerOptions {
|
|
|
281
281
|
* Path to a shared JSON file for persistent Query Budget tracking across multiple server instances.
|
|
282
282
|
*/
|
|
283
283
|
budgetStorePath?: string;
|
|
284
|
+
/** Expected guest image identifier hash for sovereign enclaves (Hex) */
|
|
285
|
+
guestImageId?: string;
|
|
286
|
+
/** Static verification key mappings for fast-path analytical circuits */
|
|
287
|
+
zkVkeys?: Record<string, unknown>;
|
|
284
288
|
}
|
|
285
289
|
interface AggregationPolicy {
|
|
286
290
|
/** Maximum number of object-type array elements allowed (default: 10) */
|
|
@@ -331,6 +335,25 @@ interface LogicExecutionPolicy {
|
|
|
331
335
|
* Path to a shared JSON file for persistent Query Budget tracking across multiple server instances.
|
|
332
336
|
*/
|
|
333
337
|
budgetStorePath?: string;
|
|
338
|
+
/**
|
|
339
|
+
* Zero-Knowledge proof mode required for this tool capability.
|
|
340
|
+
* - "none": standard HMAC-SHA256 session commitment
|
|
341
|
+
* - "optimistic": Groth16 v2 receipt generated if prover available, otherwise fallback
|
|
342
|
+
* - "required": strictly enforces Groth16 v2 proof generation; rejects if unavailable
|
|
343
|
+
*/
|
|
344
|
+
zkMode?: "none" | "optimistic" | "required";
|
|
345
|
+
/**
|
|
346
|
+
* Optional custom guest image identifier hash for this capability.
|
|
347
|
+
*/
|
|
348
|
+
guestImageId?: string;
|
|
349
|
+
/**
|
|
350
|
+
* Name of the designated R1CS circuit (e.g. "sum", "count", "average", "filter").
|
|
351
|
+
*/
|
|
352
|
+
circuitName?: string;
|
|
353
|
+
/**
|
|
354
|
+
* Static verification key JSON structure for this capability.
|
|
355
|
+
*/
|
|
356
|
+
vkey?: Record<string, unknown>;
|
|
334
357
|
}
|
|
335
358
|
declare class LiopServer {
|
|
336
359
|
private serverInfo;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { L as LiopVerifier } from './verifier-
|
|
2
|
-
import { M as MeshNodeConfig } from './node-
|
|
1
|
+
import { L as LiopVerifier } from './verifier-DTn1LXDU.js';
|
|
2
|
+
import { M as MeshNodeConfig } from './node-Djzm6UYd.js';
|
|
3
3
|
import * as grpc from '@grpc/grpc-js';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
|
-
import {
|
|
5
|
+
import { Z as ZkPolicy } from './zk-CYImPsa6.js';
|
|
6
|
+
import { M as McpEra, C as CallToolRequest, a as CallToolResult } from './types-rxL19f0l.js';
|
|
6
7
|
|
|
7
8
|
interface CertManagerOptions {
|
|
8
9
|
/** Path to the root CA certificate (PEM format) */
|
|
@@ -166,7 +167,10 @@ declare class LiopClient {
|
|
|
166
167
|
/**
|
|
167
168
|
* Invokes a tool.
|
|
168
169
|
*/
|
|
169
|
-
callTool(request: CallToolRequest, _wasmPayload?: Buffer
|
|
170
|
+
callTool(request: CallToolRequest, _wasmPayload?: Buffer, options?: {
|
|
171
|
+
zkPolicy?: ZkPolicy;
|
|
172
|
+
circuitName?: string;
|
|
173
|
+
}): Promise<CallToolResult>;
|
|
170
174
|
private getOrCreateRpcClient;
|
|
171
175
|
/**
|
|
172
176
|
* Reads a specific resource by URI.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,48 @@
|
|
|
1
1
|
export { LiopBridgeOptions, LiopMcpBridge, LiopStreamBridge, LiopStreamBridgeOptions } from './bridge.js';
|
|
2
|
-
import { L as LiopTlsOptions } from './index-
|
|
3
|
-
export { C as CertInfo, a as CertManager, b as CertManagerOptions, c as LiopClient, d as createChannelCredentials, e as createServerCredentials } from './index-
|
|
2
|
+
import { L as LiopTlsOptions } from './index-DDwiS7tf.js';
|
|
3
|
+
export { C as CertInfo, a as CertManager, b as CertManagerOptions, c as LiopClient, d as createChannelCredentials, e as createServerCredentials } from './index-DDwiS7tf.js';
|
|
4
|
+
import { ProofWithSignals, VerificationKey } from 'micro-zk-proofs';
|
|
5
|
+
export { ProofWithSignals, VerificationKey } from 'micro-zk-proofs';
|
|
4
6
|
import * as http from 'node:http';
|
|
5
|
-
export { I as InMemoryRateLimiter, L as LiopHybridGateway, a as LiopMcpRouter, R as RateLimitStatus, b as RateLimiterOptions } from './hybrid-
|
|
6
|
-
import { A as AuthInfo } from './types-
|
|
7
|
-
export { g as AuditEntry, h as AuditInterceptor, d as AuditLogger, i as AuditRecordParams, j as AuditStatus, k as CacheableResult, C as CallToolRequest, a as CallToolResult, D as DiscoverResult, l as GENESIS_HASH, 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, J as JwtValidator, L as LiopLogger, r as LogEvent, s as LogInterceptor, t as LogLevel, 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, E as computeEntryHash, F as executeGatewayInterceptor, H as globalAuditLogger, K as log } from './types-
|
|
8
|
-
export { L as LiopManifest, a as MeshNode, M as MeshNodeConfig } from './node-
|
|
7
|
+
export { I as InMemoryRateLimiter, L as LiopHybridGateway, a as LiopMcpRouter, R as RateLimitStatus, b as RateLimiterOptions } from './hybrid-B7EjCj3q.js';
|
|
8
|
+
import { A as AuthInfo } from './types-rxL19f0l.js';
|
|
9
|
+
export { g as AuditEntry, h as AuditInterceptor, d as AuditLogger, i as AuditRecordParams, j as AuditStatus, k as CacheableResult, C as CallToolRequest, a as CallToolResult, D as DiscoverResult, l as GENESIS_HASH, 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, J as JwtValidator, L as LiopLogger, r as LogEvent, s as LogInterceptor, t as LogLevel, 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, E as computeEntryHash, F as executeGatewayInterceptor, H as globalAuditLogger, K as log } from './types-rxL19f0l.js';
|
|
10
|
+
export { L as LiopManifest, a as MeshNode, M as MeshNodeConfig } from './node-Djzm6UYd.js';
|
|
9
11
|
export { SWARM_KEY_BYTE_LENGTH, createSwarmKey, deserializeSwarmKey, loadSwarmKey, parseSwarmKey, saveSwarmKey, serializeSwarmKey } from './mesh.js';
|
|
10
12
|
import * as grpc from '@grpc/grpc-js';
|
|
11
|
-
export { A as AUTH_DEFAULTS, b as AggregationPolicy, c as AuthRole, d as LiopAuthConfig, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, O as OAuthClientConfig, f as OutputSanitizerConfig, P as PII_PATTERNS, g as PII_PRESETS, h as PiiRule, i as PiiScanner, T as ToolHandler, s as sanitizeOutput } from './index-
|
|
13
|
+
export { A as AUTH_DEFAULTS, b as AggregationPolicy, c as AuthRole, d as LiopAuthConfig, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, O as OAuthClientConfig, f as OutputSanitizerConfig, P as PII_PATTERNS, g as PII_PRESETS, h as PiiRule, i as PiiScanner, T as ToolHandler, s as sanitizeOutput } from './index-D2P6Z_hP.js';
|
|
12
14
|
import * as jose from 'jose';
|
|
13
15
|
import Provider from 'oidc-provider';
|
|
16
|
+
export { D as DecodedReceipt, 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, e as ZkVerificationError, f as ZkVerifier, g as decodeJournalV2, h as encodeJournalV2, r as receiptCodec } from './zk-CYImPsa6.js';
|
|
14
17
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
15
18
|
import 'zod';
|
|
16
|
-
import './verifier-
|
|
19
|
+
import './verifier-DTn1LXDU.js';
|
|
17
20
|
import 'node:events';
|
|
18
21
|
|
|
22
|
+
declare const VERIFICATION_LATENCY_BUDGET_MS = 250;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Verifies a Groth16 Zero-Knowledge proof against a verification key.
|
|
26
|
+
* Traps curve validation errors gracefully to ensure safe verification.
|
|
27
|
+
*/
|
|
28
|
+
declare function verifyGroth16Proof(vkey: VerificationKey, proofWithSignals: ProofWithSignals): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Serializes a VerificationKey into a Buffer.
|
|
31
|
+
*/
|
|
32
|
+
declare function serializeVKey(vkey: VerificationKey): Buffer;
|
|
33
|
+
/**
|
|
34
|
+
* Deserializes a Buffer into a typed VerificationKey.
|
|
35
|
+
*/
|
|
36
|
+
declare function deserializeVKey(buf: Buffer): VerificationKey;
|
|
37
|
+
/**
|
|
38
|
+
* Serializes a ProofWithSignals into a Buffer.
|
|
39
|
+
*/
|
|
40
|
+
declare function serializeGrothProof(proofWithSignals: ProofWithSignals): Buffer;
|
|
41
|
+
/**
|
|
42
|
+
* Deserializes a Buffer into a typed ProofWithSignals.
|
|
43
|
+
*/
|
|
44
|
+
declare function deserializeGrothProof(buf: Buffer): ProofWithSignals;
|
|
45
|
+
|
|
19
46
|
/**
|
|
20
47
|
* TokenEstimator — Pluggable strategy for counting tokens in text content.
|
|
21
48
|
*
|
|
@@ -322,6 +349,9 @@ declare const manifestCacheSize: Gauge;
|
|
|
322
349
|
declare const egressBlocksTotal: Counter;
|
|
323
350
|
declare const zkVerificationDurationMs: Histogram;
|
|
324
351
|
declare const zkVerificationsTotal: Counter;
|
|
352
|
+
declare const zkProofsByTypeTotal: Counter;
|
|
353
|
+
declare const zkProvingDurationMs: Histogram;
|
|
354
|
+
declare const zkVkeyCacheSize: Gauge;
|
|
325
355
|
declare const tokensInputTotal: Counter;
|
|
326
356
|
declare const tokensOutputTotal: Counter;
|
|
327
357
|
declare const tokensSavedTotal: Counter;
|
|
@@ -389,6 +419,15 @@ declare const GRPC_CHANNEL_OPTIONS: Readonly<Record<string, string | number>>;
|
|
|
389
419
|
* TypeScript interfaces reflecting liop_core.proto (LIOP v1)
|
|
390
420
|
* Optimized for logic-on-origin and high-performance serialization.
|
|
391
421
|
*/
|
|
422
|
+
declare enum ProofMode {
|
|
423
|
+
PROOF_MODE_LEGACY_HMAC = 0,
|
|
424
|
+
PROOF_MODE_ZK_OPTIMISTIC = 1,
|
|
425
|
+
PROOF_MODE_ZK_BLOCKING = 2
|
|
426
|
+
}
|
|
427
|
+
declare enum ProofType {
|
|
428
|
+
PROOF_TYPE_HMAC_LEGACY = 0,
|
|
429
|
+
PROOF_TYPE_GROTH16 = 2
|
|
430
|
+
}
|
|
392
431
|
interface IntentRequest {
|
|
393
432
|
agent_did: string;
|
|
394
433
|
capability_hash: string;
|
|
@@ -406,12 +445,15 @@ interface LogicRequest {
|
|
|
406
445
|
inputs: Record<string, Uint8Array>;
|
|
407
446
|
pqc_ciphertext: Uint8Array;
|
|
408
447
|
aes_nonce: Uint8Array;
|
|
448
|
+
requested_proof_mode?: ProofMode;
|
|
409
449
|
}
|
|
410
450
|
interface LogicResponse {
|
|
411
451
|
semantic_evidence: string;
|
|
412
452
|
cryptographic_proof: Uint8Array;
|
|
413
453
|
zk_receipt: Uint8Array;
|
|
414
454
|
is_error: boolean;
|
|
455
|
+
proof_type?: ProofType;
|
|
456
|
+
guest_image_id?: Uint8Array;
|
|
415
457
|
}
|
|
416
458
|
|
|
417
459
|
type TokenProvider = string | (() => Promise<string | undefined> | string | undefined);
|
|
@@ -807,4 +849,4 @@ declare function authorizeRequest(method: string, auth: AuthInfo | null, additio
|
|
|
807
849
|
declare const LIOP_SCOPES: readonly ["liop:tools:list", "liop:tools:call", "liop:resources:read", "liop:schema:read", "liop:mesh:query"];
|
|
808
850
|
type LiopScope = (typeof LIOP_SCOPES)[number];
|
|
809
851
|
|
|
810
|
-
export { type AIProvider, AesGcmWrapper, AuthInfo, Counter, DILITHIUM65_CONSTANTS, Dilithium65Wrapper, ErrorCode, GRPC_CHANNEL_OPTIONS, GRPC_WEB_CONSTANTS, type GatewayTopologyInfo, Gauge, type GrpcWebFrame, HeuristicTokenEstimator, Histogram, Kyber768Wrapper, LIOP_SCOPES, LiopError, LiopOTelBridge, LiopRpcClient, LiopRpcServer, type LiopScope, type LiopSpan, LiopTlsOptions, LiopTracer, type MeshTopologyInfo, type MetricDefinition, type MetricLabels, MetricsRegistry, type PromptConfig, RealTokenEstimator, RoutingTable, type SandboxConfig, type SpanContext, type TokenEstimator, TokenManager, type TokenManagerOptions, type TokenOperationMetric, type TokenProvider, type TokenSessionReport, TokenTelemetryEngine, type ToolDefinition, type ToolRoute, type ToolTokenBreakdown, type TopologyProbeOptions, type TopologyProbeResult, type TransportProvider, WasiSandbox, authorizeRequest, buildProtectedResourceMetadata, calculateAstInstructionFuel, createOAuthServer, createSyncTokenEstimator, createTokenEstimator, decodeFrames, defaultTracer, dispatchGrpcWebRequest, egressBlocksTotal, encodeDataFrame, encodeTrailerFrame, fuelConsumed, generateSystemInstructions, getDefaultEnvironment, isGrpcWebRequest, manifestCacheSize, meshPeersConnected, operationDurationMs, pqcHandshakeDurationMs, pqcHandshakesTotal, probeTopology, protocolMetrics, tokensInputTotal, tokensOutputTotal, tokensSavedTotal, toolCallErrorsTotal, toolCallsTotal, wireEgressBytesTotal, wireSavedBytesTotal, zkVerificationDurationMs, zkVerificationsTotal };
|
|
852
|
+
export { type AIProvider, AesGcmWrapper, AuthInfo, Counter, DILITHIUM65_CONSTANTS, Dilithium65Wrapper, ErrorCode, GRPC_CHANNEL_OPTIONS, GRPC_WEB_CONSTANTS, type GatewayTopologyInfo, Gauge, type GrpcWebFrame, HeuristicTokenEstimator, Histogram, Kyber768Wrapper, LIOP_SCOPES, LiopError, LiopOTelBridge, LiopRpcClient, LiopRpcServer, type LiopScope, type LiopSpan, LiopTlsOptions, LiopTracer, type MeshTopologyInfo, type MetricDefinition, type MetricLabels, MetricsRegistry, type PromptConfig, RealTokenEstimator, RoutingTable, type SandboxConfig, type SpanContext, type TokenEstimator, TokenManager, type TokenManagerOptions, type TokenOperationMetric, type TokenProvider, type TokenSessionReport, TokenTelemetryEngine, type ToolDefinition, type ToolRoute, type ToolTokenBreakdown, type TopologyProbeOptions, type TopologyProbeResult, type TransportProvider, VERIFICATION_LATENCY_BUDGET_MS, WasiSandbox, authorizeRequest, buildProtectedResourceMetadata, calculateAstInstructionFuel, createOAuthServer, createSyncTokenEstimator, createTokenEstimator, decodeFrames, defaultTracer, deserializeGrothProof, deserializeVKey, dispatchGrpcWebRequest, egressBlocksTotal, encodeDataFrame, encodeTrailerFrame, fuelConsumed, generateSystemInstructions, getDefaultEnvironment, isGrpcWebRequest, manifestCacheSize, meshPeersConnected, operationDurationMs, pqcHandshakeDurationMs, pqcHandshakesTotal, probeTopology, protocolMetrics, serializeGrothProof, serializeVKey, tokensInputTotal, tokensOutputTotal, tokensSavedTotal, toolCallErrorsTotal, toolCallsTotal, verifyGroth16Proof, wireEgressBytesTotal, wireSavedBytesTotal, zkProofsByTypeTotal, zkProvingDurationMs, zkVerificationDurationMs, zkVerificationsTotal, zkVkeyCacheSize };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
export { WasiSandbox, calculateAstInstructionFuel, getDefaultEnvironment } from './chunk-7BSCUYUE.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
2
|
+
export { VERIFICATION_LATENCY_BUDGET_MS, deserializeGrothProof, deserializeVKey, serializeGrothProof, serializeVKey, verifyGroth16Proof } from './chunk-OHMZZMMC.js';
|
|
3
|
+
export { AesGcmWrapper, LiopClient, LiopRpcClient } from './chunk-3WKFZQ34.js';
|
|
4
|
+
export { LiopMcpBridge, LiopStreamBridge } from './chunk-E2CFIWD6.js';
|
|
5
|
+
export { GRPC_WEB_CONSTANTS, InMemoryRateLimiter, LiopHybridGateway, buildProtectedResourceMetadata, decodeFrames, dispatchGrpcWebRequest, encodeDataFrame, encodeTrailerFrame, executeGatewayInterceptor, isGrpcWebRequest } from './chunk-E7RSX476.js';
|
|
5
6
|
export { RoutingTable, probeTopology } from './chunk-PUDETPL4.js';
|
|
6
7
|
export { TokenManager } from './chunk-3QH44NKZ.js';
|
|
7
|
-
export { AUTH_DEFAULTS, AuditLogger, GENESIS_HASH, JwtValidator, LiopRpcServer, LiopServer, NerScanner, PII_PATTERNS, PII_PRESETS, PiiScanner, computeEntryHash, createOAuthServer, globalAuditLogger } from './chunk-
|
|
8
|
+
export { AUTH_DEFAULTS, AuditLogger, GENESIS_HASH, JwtValidator, LiopRpcServer, LiopServer, NerScanner, PII_PATTERNS, PII_PRESETS, PiiScanner, computeEntryHash, createOAuthServer, globalAuditLogger } from './chunk-T2QDHVUD.js';
|
|
8
9
|
export { sanitizeOutput } from './chunk-Y62GORQF.js';
|
|
9
|
-
export { LiopMcpRouter } from './chunk-
|
|
10
|
-
import './chunk-
|
|
10
|
+
export { LiopMcpRouter } from './chunk-AMSFSS2I.js';
|
|
11
|
+
import './chunk-ZRWNMP5L.js';
|
|
11
12
|
import './chunk-IK7CGWAZ.js';
|
|
12
13
|
export { Kyber768Wrapper } from './chunk-7PITYWOV.js';
|
|
13
14
|
export { DILITHIUM65_CONSTANTS, Dilithium65Wrapper, LIOP_SCOPES, authorizeRequest } from './chunk-WPTOJYN5.js';
|
|
14
|
-
export { GRPC_CHANNEL_OPTIONS, HeuristicTokenEstimator, LiopOTelBridge, RealTokenEstimator, TokenTelemetryEngine, createChannelCredentials, createServerCredentials, createSyncTokenEstimator, createTokenEstimator } from './chunk-
|
|
15
|
-
export { Counter, Gauge, Histogram, MetricsRegistry, egressBlocksTotal, fuelConsumed, manifestCacheSize, meshPeersConnected, operationDurationMs, pqcHandshakeDurationMs, pqcHandshakesTotal, protocolMetrics, tokensInputTotal, tokensOutputTotal, tokensSavedTotal, toolCallErrorsTotal, toolCallsTotal, wireEgressBytesTotal, wireSavedBytesTotal, zkVerificationDurationMs, zkVerificationsTotal } from './chunk-
|
|
16
|
-
export { MCP_LEGACY_SUPPORT_ENABLED, MCP_PROTOCOL_VERSION, MCP_PROTOCOL_VERSION_LEGACY, PromptSchema, ResourceSchema, ToolSchema } from './chunk-
|
|
15
|
+
export { GRPC_CHANNEL_OPTIONS, HeuristicTokenEstimator, LiopOTelBridge, RealTokenEstimator, TokenTelemetryEngine, createChannelCredentials, createServerCredentials, createSyncTokenEstimator, createTokenEstimator } from './chunk-GFGSHQN5.js';
|
|
16
|
+
export { Counter, Gauge, Histogram, MetricsRegistry, egressBlocksTotal, fuelConsumed, manifestCacheSize, meshPeersConnected, operationDurationMs, pqcHandshakeDurationMs, pqcHandshakesTotal, protocolMetrics, tokensInputTotal, tokensOutputTotal, tokensSavedTotal, toolCallErrorsTotal, toolCallsTotal, wireEgressBytesTotal, wireSavedBytesTotal, zkProofsByTypeTotal, zkProvingDurationMs, zkVerificationDurationMs, zkVerificationsTotal, zkVkeyCacheSize } from './chunk-Q3FKHJ3B.js';
|
|
17
|
+
export { MCP_LEGACY_SUPPORT_ENABLED, MCP_PROTOCOL_VERSION, MCP_PROTOCOL_VERSION_LEGACY, PromptSchema, ResourceSchema, ToolSchema } from './chunk-YLFNJQI2.js';
|
|
18
|
+
export { ProofType, RECEIPT_VERSION_V1, RECEIPT_VERSION_V2, ZK_JOURNAL_V2_SIZE, ZkVerificationError, ZkVerifier, decodeJournalV2, encodeJournalV2, receiptCodec } from './chunk-P34HDRN5.js';
|
|
17
19
|
export { SWARM_KEY_BYTE_LENGTH, createSwarmKey, deserializeSwarmKey, loadSwarmKey, parseSwarmKey, saveSwarmKey, serializeSwarmKey } from './chunk-ZP3VVXOI.js';
|
|
18
|
-
export { MeshNode } from './chunk-
|
|
20
|
+
export { MeshNode } from './chunk-KB3HUVMD.js';
|
|
19
21
|
import { log } from './chunk-K3DGJLUY.js';
|
|
20
22
|
export { LiopLogger, log } from './chunk-K3DGJLUY.js';
|
|
21
23
|
import * as crypto from 'crypto';
|