@nekzus/liop 2.6.0 → 2.7.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 +87 -40
- package/dist/bin/agent.js +27 -894
- package/dist/bridge.d.ts +4 -3
- package/dist/bridge.js +1 -4
- package/dist/chunk-2XHSALII.js +3 -0
- package/dist/chunk-2ZYX736J.js +2 -0
- package/dist/chunk-3WRKTVOF.js +2 -0
- package/dist/chunk-6KFKO6ZX.js +2 -0
- package/dist/chunk-6VK2XALI.js +2 -0
- package/dist/chunk-AYDF3IFZ.js +2 -0
- package/dist/chunk-CTTTLCGL.js +31 -0
- package/dist/chunk-ECRS6N33.js +4 -0
- package/dist/chunk-FDJMH4CB.js +2 -0
- package/dist/chunk-FTF6AMF6.js +0 -1
- package/dist/chunk-GWVSCZUS.js +2 -0
- package/dist/chunk-LEXMMIQI.js +15 -0
- package/dist/chunk-LM26HOJ6.js +31 -0
- package/dist/chunk-MQ5SU26J.js +2 -0
- package/dist/chunk-N35BC62H.js +2 -0
- package/dist/chunk-P6IJ3VBD.js +3 -0
- package/dist/chunk-TKLRW52V.js +2 -0
- package/dist/chunk-V35CXJQN.js +2 -0
- package/dist/chunk-WP5ER7RH.js +3 -0
- package/dist/chunk-XLVEDKM6.js +2 -0
- package/dist/chunk-Y675R34Z.js +2 -0
- package/dist/chunk-YD2AF2M6.js +46 -0
- package/dist/chunk-YLCNV764.js +3 -0
- package/dist/chunk-ZZMSFCJP.js +3 -0
- package/dist/client.d.ts +5 -4
- package/dist/client.js +1 -11
- package/dist/gateway.d.ts +6 -5
- package/dist/gateway.js +1 -11
- package/dist/{hybrid-DWe1bMoV.d.ts → hybrid-BZpCiUaV.d.ts} +4 -4
- package/dist/{index-BuEQtBHD.d.ts → index-BYDtRGue.d.ts} +8 -4
- package/dist/{index-CdW8j8Bn.d.ts → index-ByzjpRCk.d.ts} +30 -2
- package/dist/index.d.ts +57 -10
- package/dist/index.js +4 -317
- package/dist/kyber-PULV7PQX.js +2 -0
- package/dist/mesh.d.ts +1 -1
- package/dist/mesh.js +1 -5
- 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 +1 -8
- package/dist/{types-CzRSOlOo.d.ts → types-29zv9X1V.d.ts} +3 -0
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -2
- package/dist/verifier-DqZ9MQ9l.d.ts +82 -0
- package/dist/verifier-J4NQYZX5.js +2 -0
- package/dist/workers/logic-execution.d.ts +7 -0
- package/dist/workers/logic-execution.js +1 -271
- package/dist/workers/zk-verifier.d.ts +9 -0
- package/dist/workers/zk-verifier.js +1 -173
- package/dist/zk-DzYNWBgo.d.ts +104 -0
- package/package.json +7 -2
- package/dist/bin/agent.js.map +0 -1
- package/dist/bridge.js.map +0 -1
- package/dist/chunk-2KSO3W4A.js +0 -77
- package/dist/chunk-2KSO3W4A.js.map +0 -1
- package/dist/chunk-2STZHJ24.js +0 -114
- package/dist/chunk-2STZHJ24.js.map +0 -1
- package/dist/chunk-3QH44NKZ.js +0 -115
- package/dist/chunk-3QH44NKZ.js.map +0 -1
- package/dist/chunk-5SWHE62F.js +0 -3683
- package/dist/chunk-5SWHE62F.js.map +0 -1
- package/dist/chunk-7BSCUYUE.js +0 -421
- package/dist/chunk-7BSCUYUE.js.map +0 -1
- package/dist/chunk-7PITYWOV.js +0 -68
- package/dist/chunk-7PITYWOV.js.map +0 -1
- package/dist/chunk-EJ426URA.js +0 -818
- package/dist/chunk-EJ426URA.js.map +0 -1
- package/dist/chunk-FCFTYOAS.js +0 -793
- package/dist/chunk-FCFTYOAS.js.map +0 -1
- package/dist/chunk-FTF6AMF6.js.map +0 -1
- package/dist/chunk-IK7CGWAZ.js +0 -24
- package/dist/chunk-IK7CGWAZ.js.map +0 -1
- package/dist/chunk-K3DGJLUY.js +0 -106
- package/dist/chunk-K3DGJLUY.js.map +0 -1
- package/dist/chunk-PAICJCKJ.js +0 -332
- package/dist/chunk-PAICJCKJ.js.map +0 -1
- package/dist/chunk-PUDETPL4.js +0 -279
- package/dist/chunk-PUDETPL4.js.map +0 -1
- package/dist/chunk-UJFWPRDM.js +0 -206884
- package/dist/chunk-UJFWPRDM.js.map +0 -1
- package/dist/chunk-VRB5HUYU.js +0 -1492
- package/dist/chunk-VRB5HUYU.js.map +0 -1
- package/dist/chunk-VRDZ5IKE.js +0 -558
- package/dist/chunk-VRDZ5IKE.js.map +0 -1
- package/dist/chunk-WPTOJYN5.js +0 -181
- package/dist/chunk-WPTOJYN5.js.map +0 -1
- package/dist/chunk-XRDN232O.js +0 -877
- package/dist/chunk-XRDN232O.js.map +0 -1
- package/dist/chunk-Y62GORQF.js +0 -51
- package/dist/chunk-Y62GORQF.js.map +0 -1
- package/dist/chunk-ZP3VVXOI.js +0 -66
- package/dist/chunk-ZP3VVXOI.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/gateway.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/kyber-CGOA7Q6A.js +0 -3
- package/dist/kyber-CGOA7Q6A.js.map +0 -1
- package/dist/mesh.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/verifier-COnid_dg.d.ts +0 -31
- package/dist/verifier-XFU7ZB2W.js +0 -6
- package/dist/verifier-XFU7ZB2W.js.map +0 -1
- package/dist/workers/logic-execution.js.map +0 -1
- package/dist/workers/zk-verifier.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,145 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { AesGcmWrapper, LiopClient, LiopRpcClient } from './chunk-FCFTYOAS.js';
|
|
3
|
-
export { LiopMcpBridge, LiopStreamBridge } from './chunk-VRDZ5IKE.js';
|
|
4
|
-
export { GRPC_WEB_CONSTANTS, InMemoryRateLimiter, LiopHybridGateway, buildProtectedResourceMetadata, decodeFrames, dispatchGrpcWebRequest, encodeDataFrame, encodeTrailerFrame, executeGatewayInterceptor, isGrpcWebRequest } from './chunk-EJ426URA.js';
|
|
5
|
-
export { RoutingTable, probeTopology } from './chunk-PUDETPL4.js';
|
|
6
|
-
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-5SWHE62F.js';
|
|
8
|
-
export { sanitizeOutput } from './chunk-Y62GORQF.js';
|
|
9
|
-
export { LiopMcpRouter } from './chunk-VRB5HUYU.js';
|
|
10
|
-
import './chunk-2STZHJ24.js';
|
|
11
|
-
import './chunk-IK7CGWAZ.js';
|
|
12
|
-
export { Kyber768Wrapper } from './chunk-7PITYWOV.js';
|
|
13
|
-
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-UJFWPRDM.js';
|
|
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-PAICJCKJ.js';
|
|
16
|
-
export { MCP_LEGACY_SUPPORT_ENABLED, MCP_PROTOCOL_VERSION, MCP_PROTOCOL_VERSION_LEGACY, PromptSchema, ResourceSchema, ToolSchema } from './chunk-2KSO3W4A.js';
|
|
17
|
-
export { SWARM_KEY_BYTE_LENGTH, createSwarmKey, deserializeSwarmKey, loadSwarmKey, parseSwarmKey, saveSwarmKey, serializeSwarmKey } from './chunk-ZP3VVXOI.js';
|
|
18
|
-
export { MeshNode } from './chunk-XRDN232O.js';
|
|
19
|
-
import { log } from './chunk-K3DGJLUY.js';
|
|
20
|
-
export { LiopLogger, log } from './chunk-K3DGJLUY.js';
|
|
21
|
-
import * as crypto from 'crypto';
|
|
22
|
-
import { EventEmitter } from 'events';
|
|
23
|
-
import * as fs from 'fs';
|
|
24
|
-
|
|
25
|
-
// src/errors.ts
|
|
26
|
-
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
27
|
-
ErrorCode2["CapabilityViolation"] = "CapabilityViolation";
|
|
28
|
-
ErrorCode2["SandboxEscape"] = "SandboxEscape";
|
|
29
|
-
ErrorCode2["PiiLeak"] = "PiiLeak";
|
|
30
|
-
ErrorCode2["InvalidIntent"] = "InvalidIntent";
|
|
31
|
-
ErrorCode2["Throttled"] = "Throttled";
|
|
32
|
-
ErrorCode2["ZkVerificationFailed"] = "ZkVerificationFailed";
|
|
33
|
-
ErrorCode2["MeshUnavailable"] = "MeshUnavailable";
|
|
34
|
-
ErrorCode2["ConnectionFailed"] = "ConnectionFailed";
|
|
35
|
-
return ErrorCode2;
|
|
36
|
-
})(ErrorCode || {});
|
|
37
|
-
var LiopError = class extends Error {
|
|
38
|
-
code;
|
|
39
|
-
constructor(code, message) {
|
|
40
|
-
super(message);
|
|
41
|
-
this.name = "LiopError";
|
|
42
|
-
this.code = code;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var TRACEPARENT_REGEX = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/;
|
|
46
|
-
var LiopTracer = class _LiopTracer {
|
|
47
|
-
static generateTraceId() {
|
|
48
|
-
let id;
|
|
49
|
-
do {
|
|
50
|
-
id = crypto.randomBytes(16).toString("hex");
|
|
51
|
-
} while (id === "0".repeat(32));
|
|
52
|
-
return id;
|
|
53
|
-
}
|
|
54
|
-
static generateSpanId() {
|
|
55
|
-
let id;
|
|
56
|
-
do {
|
|
57
|
-
id = crypto.randomBytes(8).toString("hex");
|
|
58
|
-
} while (id === "0".repeat(16));
|
|
59
|
-
return id;
|
|
60
|
-
}
|
|
61
|
-
static formatTraceparent(traceId, spanId, sampled = true) {
|
|
62
|
-
const flags = sampled ? "01" : "00";
|
|
63
|
-
return `00-${traceId}-${spanId}-${flags}`;
|
|
64
|
-
}
|
|
65
|
-
static parseTraceparent(header) {
|
|
66
|
-
if (!header || typeof header !== "string") {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
const trimmed = header.trim();
|
|
70
|
-
const match = TRACEPARENT_REGEX.exec(trimmed);
|
|
71
|
-
if (!match) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
const [, version, traceId, spanId, flags] = match;
|
|
75
|
-
if (version === "00") {
|
|
76
|
-
if (traceId === "0".repeat(32) || spanId === "0".repeat(16)) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const sampled = (Number.parseInt(flags, 16) & 1) === 1;
|
|
81
|
-
return {
|
|
82
|
-
traceId,
|
|
83
|
-
spanId,
|
|
84
|
-
sampled
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
static injectTraceparent(carrier, context) {
|
|
88
|
-
carrier.traceparent = _LiopTracer.formatTraceparent(
|
|
89
|
-
context.traceId,
|
|
90
|
-
context.spanId,
|
|
91
|
-
context.sampled
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
static extractTraceparent(carrier) {
|
|
95
|
-
const val = carrier.traceparent || carrier.Traceparent;
|
|
96
|
-
if (Array.isArray(val)) {
|
|
97
|
-
return _LiopTracer.parseTraceparent(val[0]);
|
|
98
|
-
}
|
|
99
|
-
return _LiopTracer.parseTraceparent(val);
|
|
100
|
-
}
|
|
101
|
-
startSpan(name, parent, attributes = {}) {
|
|
102
|
-
const traceId = parent?.traceId || _LiopTracer.generateTraceId();
|
|
103
|
-
const spanId = _LiopTracer.generateSpanId();
|
|
104
|
-
const sampled = parent ? parent.sampled : true;
|
|
105
|
-
const context = {
|
|
106
|
-
traceId,
|
|
107
|
-
spanId,
|
|
108
|
-
sampled
|
|
109
|
-
};
|
|
110
|
-
const span = {
|
|
111
|
-
name,
|
|
112
|
-
context,
|
|
113
|
-
startTime: Date.now(),
|
|
114
|
-
attributes: { ...attributes },
|
|
115
|
-
status: "OK",
|
|
116
|
-
setAttribute(key, value) {
|
|
117
|
-
this.attributes[key] = value;
|
|
118
|
-
return this;
|
|
119
|
-
},
|
|
120
|
-
recordException(err) {
|
|
121
|
-
this.status = "ERROR";
|
|
122
|
-
this.error = typeof err === "string" ? err : err.message;
|
|
123
|
-
return this;
|
|
124
|
-
},
|
|
125
|
-
end() {
|
|
126
|
-
this.endTime = Date.now();
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
return span;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
var defaultTracer = new LiopTracer();
|
|
133
|
-
|
|
134
|
-
// src/prompts/adapters.ts
|
|
135
|
-
var PROVIDER_CONFIGS = {
|
|
136
|
-
claude: { xmlStandard: true, jsonSchemaPreferred: false },
|
|
137
|
-
openai: { xmlStandard: false, jsonSchemaPreferred: true },
|
|
138
|
-
gemini: { xmlStandard: false, jsonSchemaPreferred: true }
|
|
139
|
-
};
|
|
140
|
-
function generateSystemInstructions(provider) {
|
|
141
|
-
const config = PROVIDER_CONFIGS[provider];
|
|
142
|
-
let instructions = `[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]
|
|
1
|
+
export{d as WasiSandbox,c as calculateAstInstructionFuel,b as getDefaultEnvironment}from'./chunk-CTTTLCGL.js';export{a as VERIFICATION_LATENCY_BUDGET_MS,f as deserializeGrothProof,d as deserializeVKey,e as serializeGrothProof,c as serializeVKey,b as verifyGroth16Proof}from'./chunk-FDJMH4CB.js';export{b as AesGcmWrapper,c as LiopClient,a as LiopRpcClient}from'./chunk-WP5ER7RH.js';export{b as LiopMcpBridge,a as LiopStreamBridge}from'./chunk-P6IJ3VBD.js';export{a as GRPC_WEB_CONSTANTS,i as InMemoryRateLimiter,j as LiopHybridGateway,g as buildProtectedResourceMetadata,e as decodeFrames,f as dispatchGrpcWebRequest,c as encodeDataFrame,d as encodeTrailerFrame,h as executeGatewayInterceptor,b as isGrpcWebRequest}from'./chunk-LEXMMIQI.js';export{a as RoutingTable,b as probeTopology}from'./chunk-2XHSALII.js';export{a as TokenManager}from'./chunk-N35BC62H.js';export{f as AUTH_DEFAULTS,d as AuditLogger,b as GENESIS_HASH,g as JwtValidator,a as LiopRpcServer,m as LiopServer,i as NerScanner,j as PII_PATTERNS,k as PII_PRESETS,l as PiiScanner,c as computeEntryHash,h as createOAuthServer,e as globalAuditLogger}from'./chunk-YD2AF2M6.js';export{a as sanitizeOutput}from'./chunk-MQ5SU26J.js';export{a as LiopMcpRouter}from'./chunk-LM26HOJ6.js';export{a as LiopVerifier}from'./chunk-6KFKO6ZX.js';import'./chunk-TKLRW52V.js';export{a as Kyber768Wrapper}from'./chunk-Y675R34Z.js';export{b as LIOP_SCOPES,a as authorizeRequest}from'./chunk-XLVEDKM6.js';export{a as DILITHIUM65_CONSTANTS,b as Dilithium65Wrapper}from'./chunk-2ZYX736J.js';export{j as GRPC_CHANNEL_OPTIONS,b as HeuristicTokenEstimator,e as LiopOTelBridge,a as RealTokenEstimator,f as TokenTelemetryEngine,i as createChannelCredentials,h as createServerCredentials,d as createSyncTokenEstimator,c as createTokenEstimator}from'./chunk-ECRS6N33.js';export{a as Counter,b as Gauge,c as Histogram,d as MetricsRegistry,k as egressBlocksTotal,h as fuelConsumed,j as manifestCacheSize,i as meshPeersConnected,t as operationDurationMs,u as pqcHandshakeDurationMs,v as pqcHandshakesTotal,e as protocolMetrics,q as tokensInputTotal,r as tokensOutputTotal,s as tokensSavedTotal,g as toolCallErrorsTotal,f as toolCallsTotal,w as wireEgressBytesTotal,x as wireSavedBytesTotal,n as zkProofsByTypeTotal,o as zkProvingDurationMs,l as zkVerificationDurationMs,m as zkVerificationsTotal,p as zkVkeyCacheSize}from'./chunk-ZZMSFCJP.js';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,e as ZkVerificationError,i as ZkVerifier,g as decodeJournalV2,f as encodeJournalV2,h as receiptCodec}from'./chunk-6VK2XALI.js';export{a as SWARM_KEY_BYTE_LENGTH,b as createSwarmKey,d as deserializeSwarmKey,g as loadSwarmKey,e as parseSwarmKey,f as saveSwarmKey,c as serializeSwarmKey}from'./chunk-YLCNV764.js';export{a as MeshNode}from'./chunk-V35CXJQN.js';import {b}from'./chunk-3WRKTVOF.js';export{a as LiopLogger,b as log}from'./chunk-3WRKTVOF.js';import {a}from'./chunk-AYDF3IFZ.js';import*as h from'crypto';import {EventEmitter}from'events';import*as i from'fs';var A=(o=>(o.CapabilityViolation="CapabilityViolation",o.SandboxEscape="SandboxEscape",o.PiiLeak="PiiLeak",o.InvalidIntent="InvalidIntent",o.Throttled="Throttled",o.ZkVerificationFailed="ZkVerificationFailed",o.MeshUnavailable="MeshUnavailable",o.ConnectionFailed="ConnectionFailed",o))(A||{}),y=class extends Error{static{a(this,"LiopError");}code;constructor(t,e){super(e),this.name="LiopError",this.code=t;}};var D=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/,g=class n{static{a(this,"LiopTracer");}static generateTraceId(){let t;do t=h.randomBytes(16).toString("hex");while(t==="0".repeat(32));return t}static generateSpanId(){let t;do t=h.randomBytes(8).toString("hex");while(t==="0".repeat(16));return t}static formatTraceparent(t,e,r=true){return `00-${t}-${e}-${r?"01":"00"}`}static parseTraceparent(t){if(!t||typeof t!="string")return null;let e=t.trim(),r=D.exec(e);if(!r)return null;let[,a,c,l,m]=r;if(a==="00"&&(c==="0".repeat(32)||l==="0".repeat(16)))return null;let o=(Number.parseInt(m,16)&1)===1;return {traceId:c,spanId:l,sampled:o}}static injectTraceparent(t,e){t.traceparent=n.formatTraceparent(e.traceId,e.spanId,e.sampled);}static extractTraceparent(t){let e=t.traceparent||t.Traceparent;return Array.isArray(e)?n.parseTraceparent(e[0]):n.parseTraceparent(e)}startSpan(t,e,r={}){let a=e?.traceId||n.generateTraceId(),c=n.generateSpanId(),l=e?e.sampled:true;return {name:t,context:{traceId:a,spanId:c,sampled:l},startTime:Date.now(),attributes:{...r},status:"OK",setAttribute(d,T){return this.attributes[d]=T,this},recordException(d){return this.status="ERROR",this.error=typeof d=="string"?d:d.message,this},end(){this.endTime=Date.now();}}}},Mt=new g;var k={claude:{xmlStandard:true,jsonSchemaPreferred:false},openai:{xmlStandard:false,jsonSchemaPreferred:true},gemini:{xmlStandard:false,jsonSchemaPreferred:true}};function Bt(n){let t=k[n],e=`[LIOP-PROTO-V1: LOGIC-ON-ORIGIN SPECIFICATION]
|
|
143
2
|
You are interacting with a Logic-Injection-on-Origin Protocol (LIOP) Mesh Network.
|
|
144
3
|
Unlike standard MCP where you pull context to evaluate it remotely, in LIOP you WRITE code that executes on the data's origin.
|
|
145
4
|
|
|
@@ -164,9 +23,7 @@ To prevent database reconstruction and inference attacks, numeric query outputs
|
|
|
164
23
|
- Poisoned globals: eval, Function, setTimeout, setInterval, Buffer, ArrayBuffer, and TypedArrays are undefined.
|
|
165
24
|
- Frozen prototypes: Modifications to Object.prototype, Array.prototype, etc., are blocked.
|
|
166
25
|
- K-Anonymity constraints: Small datasets (< 10 records) limit outputs to max 3 scalar keys with NO nesting. Datasets with >= 10 records limit outputs to max 10 fields.
|
|
167
|
-
`;
|
|
168
|
-
if (config.xmlStandard) {
|
|
169
|
-
instructions += `
|
|
26
|
+
`;return t.xmlStandard?e+=`
|
|
170
27
|
### PAYLOAD FORMATTING (CLAUDE-XML PREFERRED)
|
|
171
28
|
You must wrap your logic precisely within <liop_logic> tags.
|
|
172
29
|
Example:
|
|
@@ -175,9 +32,7 @@ const records = await liop.readResource("liop://vault/patients");
|
|
|
175
32
|
const filtered = records.filter(r => r.disease === "Hypertension");
|
|
176
33
|
return { alert: "High risk demographic", targetCount: filtered.length };
|
|
177
34
|
</liop_logic>
|
|
178
|
-
|
|
179
|
-
} else if (config.jsonSchemaPreferred) {
|
|
180
|
-
instructions += `
|
|
35
|
+
`:t.jsonSchemaPreferred&&(e+=`
|
|
181
36
|
### PAYLOAD FORMATTING (JSON PARSING PREFERRED)
|
|
182
37
|
You must provide your logic strictly within a JSON string key called \`"logic_blob"\` inside your tool call parameters.
|
|
183
38
|
Example:
|
|
@@ -185,173 +40,5 @@ Example:
|
|
|
185
40
|
"target": "liop://vault/patients",
|
|
186
41
|
"logic_blob": "const records = await liop.readResource(args.target); return { targetCount: records.filter(r => r.disease === 'Hypertension').length };"
|
|
187
42
|
}
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
return instructions;
|
|
191
|
-
}
|
|
192
|
-
var CertManager = class extends EventEmitter {
|
|
193
|
-
constructor(options) {
|
|
194
|
-
super();
|
|
195
|
-
this.options = options;
|
|
196
|
-
this.warningDays = options.warningDays ?? 30;
|
|
197
|
-
this.debounceMs = options.debounceMs ?? 150;
|
|
198
|
-
this.loadCertificates();
|
|
199
|
-
if (options.watchFiles !== false) {
|
|
200
|
-
this.setupWatchers();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
options;
|
|
204
|
-
rootCertBuffer = null;
|
|
205
|
-
certChainBuffer = null;
|
|
206
|
-
privateKeyBuffer = null;
|
|
207
|
-
watchers = [];
|
|
208
|
-
reloadDebounceTimer = null;
|
|
209
|
-
warningDays;
|
|
210
|
-
debounceMs;
|
|
211
|
-
/**
|
|
212
|
-
* Synchronously loads or reloads certificates from filesystem into memory.
|
|
213
|
-
*/
|
|
214
|
-
loadCertificates() {
|
|
215
|
-
try {
|
|
216
|
-
if (this.options.rootCertPath && fs.existsSync(this.options.rootCertPath)) {
|
|
217
|
-
this.rootCertBuffer = fs.readFileSync(this.options.rootCertPath);
|
|
218
|
-
}
|
|
219
|
-
if (!fs.existsSync(this.options.certChainPath)) {
|
|
220
|
-
throw new Error(
|
|
221
|
-
`Certificate chain file not found: ${this.options.certChainPath}`
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
if (!fs.existsSync(this.options.privateKeyPath)) {
|
|
225
|
-
throw new Error(
|
|
226
|
-
`Private key file not found: ${this.options.privateKeyPath}`
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
this.certChainBuffer = fs.readFileSync(this.options.certChainPath);
|
|
230
|
-
this.privateKeyBuffer = fs.readFileSync(this.options.privateKeyPath);
|
|
231
|
-
log.info("[CertManager] Certificates loaded successfully.");
|
|
232
|
-
} catch (error) {
|
|
233
|
-
log.error(`[CertManager] Failed to load certificates: ${error}`);
|
|
234
|
-
throw error;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Inspects the loaded server/client certificate chain using Node.js native X509Certificate.
|
|
239
|
-
*/
|
|
240
|
-
inspectCertificate() {
|
|
241
|
-
if (!this.certChainBuffer) {
|
|
242
|
-
throw new Error("[CertManager] No certificate loaded to inspect.");
|
|
243
|
-
}
|
|
244
|
-
const x509 = new crypto.X509Certificate(this.certChainBuffer);
|
|
245
|
-
const validToDate = new Date(x509.validTo);
|
|
246
|
-
const now = /* @__PURE__ */ new Date();
|
|
247
|
-
const msRemaining = validToDate.getTime() - now.getTime();
|
|
248
|
-
const daysRemaining = Math.max(
|
|
249
|
-
0,
|
|
250
|
-
Math.floor(msRemaining / (1e3 * 60 * 60 * 24))
|
|
251
|
-
);
|
|
252
|
-
const isExpired = msRemaining <= 0;
|
|
253
|
-
const isExpiringSoon = daysRemaining <= this.warningDays;
|
|
254
|
-
return {
|
|
255
|
-
subject: x509.subject,
|
|
256
|
-
issuer: x509.issuer,
|
|
257
|
-
validFrom: x509.validFrom,
|
|
258
|
-
validTo: x509.validTo,
|
|
259
|
-
fingerprint256: x509.fingerprint256,
|
|
260
|
-
daysRemaining,
|
|
261
|
-
isExpired,
|
|
262
|
-
isExpiringSoon
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Sets up non-blocking filesystem watchers to detect certificate renewals
|
|
267
|
-
* and trigger hot-reloading without process restarts.
|
|
268
|
-
*/
|
|
269
|
-
setupWatchers() {
|
|
270
|
-
const filesToWatch = [
|
|
271
|
-
this.options.certChainPath,
|
|
272
|
-
this.options.privateKeyPath,
|
|
273
|
-
this.options.rootCertPath
|
|
274
|
-
].filter((p) => Boolean(p && fs.existsSync(p)));
|
|
275
|
-
for (const filePath of filesToWatch) {
|
|
276
|
-
try {
|
|
277
|
-
const watcher = fs.watch(filePath, () => {
|
|
278
|
-
this.scheduleReload();
|
|
279
|
-
});
|
|
280
|
-
this.watchers.push(watcher);
|
|
281
|
-
} catch (err) {
|
|
282
|
-
log.warn(
|
|
283
|
-
`[CertManager] Could not watch ${filePath} for hot reloading: ${err}`
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Debounces reload events to ensure files have finished writing.
|
|
290
|
-
*/
|
|
291
|
-
scheduleReload() {
|
|
292
|
-
if (this.reloadDebounceTimer) {
|
|
293
|
-
clearTimeout(this.reloadDebounceTimer);
|
|
294
|
-
}
|
|
295
|
-
this.reloadDebounceTimer = setTimeout(() => {
|
|
296
|
-
try {
|
|
297
|
-
this.loadCertificates();
|
|
298
|
-
const certInfo = this.inspectCertificate();
|
|
299
|
-
log.info(
|
|
300
|
-
`[CertManager] Hot reload complete. Certificate expires in ${certInfo.daysRemaining} days.`
|
|
301
|
-
);
|
|
302
|
-
this.emit("reload", certInfo);
|
|
303
|
-
} catch (error) {
|
|
304
|
-
log.error(`[CertManager] Hot reload failed: ${error}`);
|
|
305
|
-
this.emit("error", error);
|
|
306
|
-
}
|
|
307
|
-
}, this.debounceMs);
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Manually triggers a reload of certificates and emits the 'reload' event.
|
|
311
|
-
*/
|
|
312
|
-
reload() {
|
|
313
|
-
this.loadCertificates();
|
|
314
|
-
const certInfo = this.inspectCertificate();
|
|
315
|
-
log.info(
|
|
316
|
-
`[CertManager] Hot reload complete. Certificate expires in ${certInfo.daysRemaining} days.`
|
|
317
|
-
);
|
|
318
|
-
this.emit("reload", certInfo);
|
|
319
|
-
return certInfo;
|
|
320
|
-
}
|
|
321
|
-
getRootCert() {
|
|
322
|
-
return this.rootCertBuffer;
|
|
323
|
-
}
|
|
324
|
-
getCertChain() {
|
|
325
|
-
if (!this.certChainBuffer) {
|
|
326
|
-
throw new Error("[CertManager] Certificate chain not loaded.");
|
|
327
|
-
}
|
|
328
|
-
return this.certChainBuffer;
|
|
329
|
-
}
|
|
330
|
-
getPrivateKey() {
|
|
331
|
-
if (!this.privateKeyBuffer) {
|
|
332
|
-
throw new Error("[CertManager] Private key not loaded.");
|
|
333
|
-
}
|
|
334
|
-
return this.privateKeyBuffer;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Stops all active file watchers and releases resources.
|
|
338
|
-
*/
|
|
339
|
-
dispose() {
|
|
340
|
-
if (this.reloadDebounceTimer) {
|
|
341
|
-
clearTimeout(this.reloadDebounceTimer);
|
|
342
|
-
this.reloadDebounceTimer = null;
|
|
343
|
-
}
|
|
344
|
-
for (const watcher of this.watchers) {
|
|
345
|
-
try {
|
|
346
|
-
watcher.close();
|
|
347
|
-
} catch {
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
this.watchers = [];
|
|
351
|
-
this.removeAllListeners();
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
export { CertManager, ErrorCode, LiopError, LiopTracer, defaultTracer, generateSystemInstructions };
|
|
356
|
-
//# sourceMappingURL=index.js.map
|
|
43
|
+
`),e}a(Bt,"generateSystemInstructions");var x=class extends EventEmitter{constructor(e){super();this.options=e;this.warningDays=e.warningDays??30,this.debounceMs=e.debounceMs??150,this.loadCertificates(),e.watchFiles!==false&&this.setupWatchers();}options;static{a(this,"CertManager");}rootCertBuffer=null;certChainBuffer=null;privateKeyBuffer=null;watchers=[];reloadDebounceTimer=null;warningDays;debounceMs;loadCertificates(){try{if(this.options.rootCertPath&&i.existsSync(this.options.rootCertPath)&&(this.rootCertBuffer=i.readFileSync(this.options.rootCertPath)),!i.existsSync(this.options.certChainPath))throw new Error(`Certificate chain file not found: ${this.options.certChainPath}`);if(!i.existsSync(this.options.privateKeyPath))throw new Error(`Private key file not found: ${this.options.privateKeyPath}`);this.certChainBuffer=i.readFileSync(this.options.certChainPath),this.privateKeyBuffer=i.readFileSync(this.options.privateKeyPath),b.info("[CertManager] Certificates loaded successfully.");}catch(e){throw b.error(`[CertManager] Failed to load certificates: ${e}`),e}}inspectCertificate(){if(!this.certChainBuffer)throw new Error("[CertManager] No certificate loaded to inspect.");let e=new h.X509Certificate(this.certChainBuffer),r=new Date(e.validTo),a=new Date,c=r.getTime()-a.getTime(),l=Math.max(0,Math.floor(c/(1e3*60*60*24))),m=c<=0,o=l<=this.warningDays;return {subject:e.subject,issuer:e.issuer,validFrom:e.validFrom,validTo:e.validTo,fingerprint256:e.fingerprint256,daysRemaining:l,isExpired:m,isExpiringSoon:o}}setupWatchers(){let e=[this.options.certChainPath,this.options.privateKeyPath,this.options.rootCertPath].filter(r=>!!(r&&i.existsSync(r)));for(let r of e)try{let a=i.watch(r,()=>{this.scheduleReload();});this.watchers.push(a);}catch(a){b.warn(`[CertManager] Could not watch ${r} for hot reloading: ${a}`);}}scheduleReload(){this.reloadDebounceTimer&&clearTimeout(this.reloadDebounceTimer),this.reloadDebounceTimer=setTimeout(()=>{try{this.loadCertificates();let e=this.inspectCertificate();b.info(`[CertManager] Hot reload complete. Certificate expires in ${e.daysRemaining} days.`),this.emit("reload",e);}catch(e){b.error(`[CertManager] Hot reload failed: ${e}`),this.emit("error",e);}},this.debounceMs);}reload(){this.loadCertificates();let e=this.inspectCertificate();return b.info(`[CertManager] Hot reload complete. Certificate expires in ${e.daysRemaining} days.`),this.emit("reload",e),e}getRootCert(){return this.rootCertBuffer}getCertChain(){if(!this.certChainBuffer)throw new Error("[CertManager] Certificate chain not loaded.");return this.certChainBuffer}getPrivateKey(){if(!this.privateKeyBuffer)throw new Error("[CertManager] Private key not loaded.");return this.privateKeyBuffer}dispose(){this.reloadDebounceTimer&&(clearTimeout(this.reloadDebounceTimer),this.reloadDebounceTimer=null);for(let e of this.watchers)try{e.close();}catch{}this.watchers=[],this.removeAllListeners();}};export{x as CertManager,A as ErrorCode,y as LiopError,g as LiopTracer,Mt as defaultTracer,Bt as generateSystemInstructions};//# sourceMappingURL=index.js.map
|
|
357
44
|
//# sourceMappingURL=index.js.map
|
package/dist/mesh.d.ts
CHANGED
package/dist/mesh.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { SWARM_KEY_BYTE_LENGTH, createSwarmKey, deserializeSwarmKey, loadSwarmKey, parseSwarmKey, saveSwarmKey, serializeSwarmKey } from './chunk-ZP3VVXOI.js';
|
|
3
|
-
export { MeshNode } from './chunk-XRDN232O.js';
|
|
4
|
-
import './chunk-K3DGJLUY.js';
|
|
5
|
-
//# sourceMappingURL=mesh.js.map
|
|
1
|
+
import'./chunk-FTF6AMF6.js';export{a as SWARM_KEY_BYTE_LENGTH,b as createSwarmKey,d as deserializeSwarmKey,g as loadSwarmKey,e as parseSwarmKey,f as saveSwarmKey,c as serializeSwarmKey}from'./chunk-YLCNV764.js';export{a as MeshNode}from'./chunk-V35CXJQN.js';import'./chunk-3WRKTVOF.js';import'./chunk-AYDF3IFZ.js';//# sourceMappingURL=mesh.js.map
|
|
6
2
|
//# sourceMappingURL=mesh.js.map
|
|
@@ -9,6 +9,10 @@ interface LiopManifest {
|
|
|
9
9
|
name: string;
|
|
10
10
|
description?: string;
|
|
11
11
|
inputSchema?: Record<string, unknown>;
|
|
12
|
+
zkMode?: "none" | "optimistic" | "required";
|
|
13
|
+
guestImageId?: string;
|
|
14
|
+
circuitName?: string;
|
|
15
|
+
vkey?: Record<string, unknown>;
|
|
12
16
|
}>;
|
|
13
17
|
resources: Array<{
|
|
14
18
|
name: string;
|
|
@@ -29,6 +33,10 @@ interface LiopManifest {
|
|
|
29
33
|
authRequired?: boolean;
|
|
30
34
|
/** Canonical slug for deterministic token resolution. Agents resolve LIOP_TOKEN_<tokenSlug>. Must match /^[A-Z][A-Z0-9_]*$/. */
|
|
31
35
|
tokenSlug?: string;
|
|
36
|
+
/** Expected guest image identifier hash for sovereign enclaves (Hex) */
|
|
37
|
+
guestImageId?: string;
|
|
38
|
+
/** Static verification key mappings for fast-path analytical circuits */
|
|
39
|
+
vkeys?: Record<string, unknown>;
|
|
32
40
|
/** ML-DSA-65 (FIPS 204) Post-Quantum Digital Signature for Manifest Attestation (Base64) */
|
|
33
41
|
pqcSignature?: string;
|
|
34
42
|
/** ML-DSA-65 (FIPS 204) Post-Quantum Public Key (Base64) */
|
|
@@ -14,6 +14,19 @@ service LogicMesh {
|
|
|
14
14
|
rpc ExecuteLogic (LogicRequest) returns (stream LogicResponse);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
// Verification and proving policy requested by the caller
|
|
18
|
+
enum ProofMode {
|
|
19
|
+
PROOF_MODE_LEGACY_HMAC = 0;
|
|
20
|
+
PROOF_MODE_ZK_OPTIMISTIC = 1;
|
|
21
|
+
PROOF_MODE_ZK_BLOCKING = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Cryptographic proof format attached to computation receipts
|
|
25
|
+
enum ProofType {
|
|
26
|
+
PROOF_TYPE_HMAC_LEGACY = 0;
|
|
27
|
+
PROOF_TYPE_GROTH16 = 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
17
30
|
// Request to negotiate an intent to execute a WASM capability
|
|
18
31
|
message IntentRequest {
|
|
19
32
|
string agent_did = 1; // Decentralized Identifier (DID) e.g., spiffe:// or Noise PeerID
|
|
@@ -31,17 +44,20 @@ message IntentResponse {
|
|
|
31
44
|
|
|
32
45
|
// Request to push a WASM module down to the origin for execution
|
|
33
46
|
message LogicRequest {
|
|
34
|
-
string session_token = 1;
|
|
35
|
-
bytes wasm_binary = 2;
|
|
36
|
-
map<string, bytes> inputs = 3;
|
|
37
|
-
bytes pqc_ciphertext = 4;
|
|
38
|
-
bytes aes_nonce = 5;
|
|
47
|
+
string session_token = 1; // Token acquired from NegotiateIntent
|
|
48
|
+
bytes wasm_binary = 2; // AES-GCM Encrypted .wasm Logic-on-Origin filter code
|
|
49
|
+
map<string, bytes> inputs = 3; // AES-GCM Encrypted input parameters
|
|
50
|
+
bytes pqc_ciphertext = 4; // Kyber (ML-KEM-768) Ciphertext encapsulating the AES shared secret
|
|
51
|
+
bytes aes_nonce = 5; // 12-byte nonce for AES-GCM
|
|
52
|
+
ProofMode requested_proof_mode = 6; // Proving policy requested by caller
|
|
39
53
|
}
|
|
40
54
|
|
|
41
55
|
// Streamed Response back to the LLM agent containing reduced, semantically rich semantic responses
|
|
42
56
|
message LogicResponse {
|
|
43
57
|
string semantic_evidence = 1; // Condensed semantic result for the LLM
|
|
44
58
|
bytes cryptographic_proof = 2; // Integrity signature (SHA256)
|
|
45
|
-
bytes zk_receipt = 3; // Zero-Knowledge Proof Receipt
|
|
59
|
+
bytes zk_receipt = 3; // Zero-Knowledge Proof Receipt for Computational Integrity
|
|
46
60
|
bool is_error = 4; // Execution status
|
|
61
|
+
ProofType proof_type = 5; // Format of the zero-knowledge computational proof
|
|
62
|
+
bytes guest_image_id = 6; // Guest image identifier (32 bytes SHA-256)
|
|
47
63
|
}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { b as AggregationPolicy, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, 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-
|
|
1
|
+
export { b as AggregationPolicy, L as LiopServer, a as LiopServerOptions, e as LogicExecutionPolicy, N as NerScanner, 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-ByzjpRCk.js';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import './node-
|
|
4
|
-
import './types-
|
|
3
|
+
import './node-Djzm6UYd.js';
|
|
4
|
+
import './types-29zv9X1V.js';
|
|
5
|
+
import './zk-DzYNWBgo.js';
|
|
5
6
|
import 'jose';
|
package/dist/server.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { sanitizeOutput } from './chunk-Y62GORQF.js';
|
|
3
|
-
import './chunk-WPTOJYN5.js';
|
|
4
|
-
import './chunk-UJFWPRDM.js';
|
|
5
|
-
import './chunk-PAICJCKJ.js';
|
|
6
|
-
import './chunk-XRDN232O.js';
|
|
7
|
-
import './chunk-K3DGJLUY.js';
|
|
8
|
-
//# sourceMappingURL=server.js.map
|
|
1
|
+
export{m as LiopServer,i as NerScanner,j as PII_PATTERNS,k as PII_PRESETS,l as PiiScanner}from'./chunk-YD2AF2M6.js';export{a as sanitizeOutput}from'./chunk-MQ5SU26J.js';import'./chunk-XLVEDKM6.js';import'./chunk-2ZYX736J.js';import'./chunk-ECRS6N33.js';import'./chunk-ZZMSFCJP.js';import'./chunk-6VK2XALI.js';import'./chunk-V35CXJQN.js';import'./chunk-3WRKTVOF.js';import'./chunk-AYDF3IFZ.js';//# sourceMappingURL=server.js.map
|
|
9
2
|
//# sourceMappingURL=server.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { P as ProofType } from './zk-DzYNWBgo.js';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import * as jose from 'jose';
|
|
3
4
|
|
|
@@ -381,6 +382,8 @@ interface CallToolResult {
|
|
|
381
382
|
};
|
|
382
383
|
}>;
|
|
383
384
|
isError?: boolean;
|
|
385
|
+
zkVerified?: boolean;
|
|
386
|
+
zkProofType?: ProofType;
|
|
384
387
|
}
|
|
385
388
|
interface GetPromptRequest {
|
|
386
389
|
name: string;
|
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 { 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-
|
|
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
|
|
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 };
|
|
@@ -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 };
|