@nekzus/liop 2.5.0-beta.2 → 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.
- 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/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="
|
|
4
|
-
<img alt="Logic-Injection-on-Origin Protocol Logo" src="
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Nekzus/LIOP/main/docs/logo/dark.svg">
|
|
4
|
+
<img alt="Logic-Injection-on-Origin Protocol Logo" src="https://raw.githubusercontent.com/Nekzus/LIOP/main/docs/logo/light.svg" width="700">
|
|
5
5
|
</picture>
|
|
6
6
|
|
|
7
|
-
<h1>Logic-Injection-on-Origin Protocol (LIOP)
|
|
7
|
+
<h1>Logic-Injection-on-Origin Protocol (LIOP), TypeScript SDK</h1>
|
|
8
8
|
<p><strong>The official TypeScript SDK and MCP Bridge for the Logic-Injection-on-Origin Protocol.</strong></p>
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Official Documentation
|
|
23
23
|
|
|
24
24
|
Comprehensive interactive guides, architectural deep dives, and API specifications are hosted on our official portal:
|
|
25
25
|
|
|
@@ -37,7 +37,7 @@ Comprehensive interactive guides, architectural deep dives, and API specificatio
|
|
|
37
37
|
|
|
38
38
|
## Overview
|
|
39
39
|
|
|
40
|
-
`@nekzus/liop` is an SDK that implements the **Logic-Injection-on-Origin (LIO)** paradigm: instead of extracting raw data from a server and sending it to an LLM, the LLM injects a micro-module of logic to be executed *at the data source*, inside a secure sandbox. The result
|
|
40
|
+
`@nekzus/liop` is an SDK that implements the **Logic-Injection-on-Origin (LIO)** paradigm: instead of extracting raw data from a server and sending it to an LLM, the LLM injects a micro-module of logic to be executed *at the data source*, inside a secure sandbox. The result, and never the raw data, is returned.
|
|
41
41
|
|
|
42
42
|
This addresses the data privacy, bandwidth, and latency bottlenecks of distributed agent data analysis.
|
|
43
43
|
|
|
@@ -52,7 +52,7 @@ This addresses the data privacy, bandwidth, and latency bottlenecks of distribut
|
|
|
52
52
|
| **Multi-Tier Sovereign Enclaves** | Physical socket isolation via `@libp2p/pnet` (256-bit Swarm Key PSK) and Border LIO Gateway (`blg`) with OAuth 2.1 authentication. |
|
|
53
53
|
| **AST Fuel Metering** | Deterministic AST instruction fuel scoring with 100-bucket quantization for NIST SP 800-53 timing side-channel elimination (`stddev = 0`).|
|
|
54
54
|
| **Differential Privacy Engine** | NIST SP 800-226 Laplace mechanism with CSPRNG entropy, query-aware sensitivity, and deterministic ZK-Receipt auditing (`DpEngine`). |
|
|
55
|
-
| **MCP Drop-in Replacement** | `LiopServer` mirrors the Anthropic MCP `Server` API
|
|
55
|
+
| **MCP Drop-in Replacement** | `LiopServer` mirrors the Anthropic MCP `Server` API (tools, resources, and prompts with `Zod` schemas). |
|
|
56
56
|
| **Guardian AST** | Pre-execution heuristic inspection blocks sandbox escapes (`require`, `fs`, `eval`, `fetch`, prototype pollution). |
|
|
57
57
|
| **IFC Taint Analyzer** | 5-pass Acorn AST information flow control tracking collection aliases, correlation guards, and extrema gates at preflight. |
|
|
58
58
|
| **WASI Sandbox** | JavaScript payloads execute inside V8 isolates with CPU fuel limits, no Node.js globals, and safe environment isolation (`allowEnv`). |
|
|
@@ -60,8 +60,8 @@ This addresses the data privacy, bandwidth, and latency bottlenecks of distribut
|
|
|
60
60
|
| **Resilient Hybrid Routing** | Deterministic per-tool multiplexing across `http-gateway`, `p2p-grpc`, and `local` with 5-failure circuit breaker (`RoutingTable`).|
|
|
61
61
|
| **OAuth 2.1 M2M Lifecycle** | Concurrency in-flight de-duplication, 30-second preemptive refresh buffer, and reactive invalidation (`TokenManager`). |
|
|
62
62
|
| **Sliding-Window Rate Limiter**| In-memory OWASP API4:2023 rate limiting with background cleanup unreferenced intervals (`InMemoryRateLimiter`). |
|
|
63
|
-
| **
|
|
64
|
-
| **
|
|
63
|
+
| **ZK-Receipts** | Tri-modal Zero-Knowledge proofs: HMAC-SHA256 (v1), Groth16 BN254 with 144-byte binary journal (v2), and dual-layer ML-DSA-65 post-quantum hybrid receipts (v2.1). Enforces `ZK_BLOCKING` on Tier 1 Enclaves. |
|
|
64
|
+
| **Hardware TEE Attestation** | Pre-flight validation of confidential hardware root-of-trust evidence for AMD SEV-SNP (1,184-byte report) and AWS Nitro Enclaves (`verifyTeeAttestationDetailed`). |
|
|
65
65
|
| **Worker Pool** | Heavy computation (crypto, sandboxing) dispatched to OS threads via `piscina` with background async warmup. |
|
|
66
66
|
| **Post-Quantum Ready** | ML-KEM-768 (Kyber) + ML-DSA-65 (Dilithium) with 1-hour session lifetime and AES-256-GCM encryption. |
|
|
67
67
|
| **Enterprise Observability** | Immutable SOC 2 Hash-Chain audit log (`AuditLogger`), physical wire egress tracking, Prometheus metrics (`/metrics`), and K8s probes. |
|
|
@@ -121,7 +121,7 @@ npm install -g @nekzus/liop@latest
|
|
|
121
121
|
liop
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
###
|
|
124
|
+
### Claude Desktop Configuration
|
|
125
125
|
|
|
126
126
|
To integrate LIOP into Claude Desktop, update your `claude_desktop_config.json` (typically found in `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
127
127
|
|
|
@@ -185,7 +185,7 @@ server.tool(
|
|
|
185
185
|
"Analyzes local log files without sending raw data to the LLM.",
|
|
186
186
|
{ target_error: z.string().describe("The error pattern to search for") },
|
|
187
187
|
async ({ target_error }) => {
|
|
188
|
-
// This logic runs at origin
|
|
188
|
+
// This logic runs at origin, data never leaves the server
|
|
189
189
|
return {
|
|
190
190
|
content: [{ type: "text", text: `Found 51 occurrences of ${target_error}` }],
|
|
191
191
|
};
|
|
@@ -324,13 +324,13 @@ await bridge.connect();
|
|
|
324
324
|
|
|
325
325
|
**Supported JSON-RPC methods:**
|
|
326
326
|
|
|
327
|
-
- `initialize
|
|
328
|
-
- `tools/list
|
|
329
|
-
- `tools/call
|
|
330
|
-
- `resources/list
|
|
331
|
-
- `resources/read
|
|
332
|
-
- `prompts/list
|
|
333
|
-
- `prompts/get
|
|
327
|
+
- `initialize`: Returns server capabilities and info
|
|
328
|
+
- `tools/list`: Lists available tools
|
|
329
|
+
- `tools/call`: Calls a tool (with ZK-Receipt verification)
|
|
330
|
+
- `resources/list`: Lists available resources
|
|
331
|
+
- `resources/read`: Reads a resource
|
|
332
|
+
- `prompts/list`: Lists available prompts
|
|
333
|
+
- `prompts/get`: Gets a specific prompt
|
|
334
334
|
|
|
335
335
|
---
|
|
336
336
|
|
|
@@ -343,13 +343,13 @@ await bridge.connect();
|
|
|
343
343
|
│ Layer 1: Guardian AST (Pre-Execution Static Analysis) │
|
|
344
344
|
│ 14-function WASI allowlist • 128 import cap • Blocks │
|
|
345
345
|
│ require, import(), fs, eval, fetch, __proto__ │
|
|
346
|
-
|
|
346
|
+
├───────────────────────────────────────────────────────────┤
|
|
347
347
|
│ Layer 2: WASI Sandbox (V8 Isolate) │
|
|
348
348
|
│ 25 poisoned globals (incl. Date, TypedArrays) • │
|
|
349
349
|
│ CPU Fuel limits • 5s timeout • maxHeapMb (64MB default) │
|
|
350
350
|
│ Object.freeze() on 11 core prototypes • allowEnv allowlist │
|
|
351
351
|
├───────────────────────────────────────────────────────────┤
|
|
352
|
-
│ Layer 3: Taint Analyzer (IFC
|
|
352
|
+
│ Layer 3: Taint Analyzer (IFC, Static) │
|
|
353
353
|
│ Acorn AST 3-pass analysis blocks PII side-channels: │
|
|
354
354
|
│ charCodeAt, boolean inference, arithmetic derivation │
|
|
355
355
|
├───────────────────────────────────────────────────────────┤
|
|
@@ -362,8 +362,9 @@ await bridge.connect();
|
|
|
362
362
|
│ Blocks raw row export • maxOutputRows (default: 10) • │
|
|
363
363
|
│ Conditional error: detailed (dev) vs opaque (production) │
|
|
364
364
|
├───────────────────────────────────────────────────────────┤
|
|
365
|
-
│ Layer 6: ZK-Receipt (
|
|
366
|
-
│
|
|
365
|
+
│ Layer 6: ZK-Receipt (Groth16 BN254 & Replay Mitigation) │
|
|
366
|
+
│ Version 2: 144-byte binary journal + Groth16 curve points │
|
|
367
|
+
│ Version 1: HMAC-SHA256 session commitment (Kyber768) │
|
|
367
368
|
│ output_hash cross-verification • Balanced-brace extractor │
|
|
368
369
|
└───────────────────────────────────────────────────────────┘
|
|
369
370
|
```
|
|
@@ -407,7 +408,7 @@ const server = new LiopServer(info, {
|
|
|
407
408
|
|
|
408
409
|
To avoid false positive triggers caused by HMAC-SHA256 ZK-Receipt signatures or transport wrapper frames (such as `{ content: [{ type: "text", text: "..." }] }`), the PII Shield and Aggregation-First engines scan only the unwrapped business data (via `unwrapForAggregationPolicyScan`). Cryptographic seals and protocol routing structures are isolated and excluded from compliance scans.
|
|
409
410
|
|
|
410
|
-
###
|
|
411
|
+
### 3-Tier Query Budget (NIST SP 800-226)
|
|
411
412
|
|
|
412
413
|
To prevent advanced statistical differentiation or database reconstruction attacks, the SDK implements a tiered, session-based budget engine:
|
|
413
414
|
|
|
@@ -417,27 +418,27 @@ To prevent advanced statistical differentiation or database reconstruction attac
|
|
|
417
418
|
|
|
418
419
|
If an injected payload queries a field beyond its budget limit, the preflight static analysis immediately blocks execution.
|
|
419
420
|
|
|
420
|
-
###
|
|
421
|
+
### K-Anonymity on Small Datasets
|
|
421
422
|
|
|
422
423
|
When operating on high-privacy datasets, if the source records count is **less than 10**, the SDK forces a strict K-Anonymity restriction:
|
|
423
424
|
- Rejects any output that contains nested objects or arrays.
|
|
424
425
|
- Restricts the returned structure to a maximum of **3 scalar keys** (e.g., simple aggregate counts or statistics).
|
|
425
426
|
- Prevents structural data leakage in low-entropy datasets.
|
|
426
427
|
|
|
427
|
-
###
|
|
428
|
+
### Sandbox Poisoned Globals & Date Workaround
|
|
428
429
|
|
|
429
430
|
For maximum host security, the WASI sandbox enforces a poisoned environment that strips dangerous globals and prevents timing side-channels:
|
|
430
431
|
- **Poisoned/Disabled**: `Date` (Date.now, parse, etc. throw an exception to prevent timing analysis), `eval`, `Function`, `setTimeout`, `setInterval`, `Buffer`, `ArrayBuffer`, and all `TypedArrays`.
|
|
431
432
|
- **Date Workaround**: To perform date checks, use lexicographical string comparison on ISO 8601 strings (e.g., `record.date >= "2026-01-01"`).
|
|
432
433
|
|
|
433
|
-
###
|
|
434
|
+
### Recursive In-Memory Numerical Sanitization
|
|
434
435
|
|
|
435
436
|
To mitigate timing channels, statistical differentiation, and floats side-channels, the SDK executes a recursive sanitization pipeline before the PII scanner runs:
|
|
436
437
|
- Positive floating-point numbers are recursively rounded to exactly **4 decimal places**.
|
|
437
438
|
- Negative values are safely clamped to **0** (via `sanitizeOutput()`).
|
|
438
439
|
- This operation runs entirely in-memory and recursively on all fields, preserving data structure immutability without expensive and fragile serialization-deserialization cycles.
|
|
439
440
|
|
|
440
|
-
###
|
|
441
|
+
### Environment Isolation & allowEnv Allowlist
|
|
441
442
|
|
|
442
443
|
For robust sandboxing, the WASI execution path isolates host environment variables. Propagation can be enabled explicitly:
|
|
443
444
|
```typescript
|
|
@@ -450,11 +451,57 @@ To block arbitrary command execution (e.g., Shellshock) and prevent exposure of
|
|
|
450
451
|
- **Unix/Linux Allowlist**: `HOME`, `LOGNAME`, `PATH`, `SHELL`, `TERM`, `USER`.
|
|
451
452
|
Variables starting with shell functions `()` are dropped.
|
|
452
453
|
|
|
453
|
-
###
|
|
454
|
+
### Sovereign Tri-Modal ZK-Receipts & Hardware Attestation
|
|
455
|
+
|
|
456
|
+
LIOP ZK-Receipts provide cryptographic evidence that a computation was executed honestly under zero-trust bounds. The protocol implements three complementary cryptographic modes:
|
|
457
|
+
- **Mode 0 (`HMAC_LEGACY`, v1)**: Session commitments sealed with the ML-KEM-768 quantum-resistant shared key.
|
|
458
|
+
- **Mode 2 (`GROTH16`, v2)**: Compact Zero-Knowledge SNARK proofs over the BN254 pairing-friendly elliptic curve packing a 144-byte binary journal (~252 bytes total).
|
|
459
|
+
- **Mode 3 (`GROTH16_PQC_HYBRID`, v2.1)**: Dual-layer receipts combining Groth16 BN254 mathematical proofs with an ML-DSA-65 post-quantum digital signature conforming to NIST FIPS 204 (~5.6 KB total).
|
|
460
|
+
|
|
461
|
+
- **144-Byte Binary Journal Layout**:
|
|
462
|
+
- `guest_image_id` (32 bytes): Sovereign enclave guest runtime image identifier
|
|
463
|
+
- `logic_digest` (32 bytes): SHA-256 fingerprint of the executed JavaScript/WASM logic
|
|
464
|
+
- `dataset_digest` (32 bytes): SHA-256 fingerprint of the origin dataset at execution time
|
|
465
|
+
- `output_digest` (32 bytes): SHA-256 fingerprint of the sanitized computation result
|
|
466
|
+
- `fuel_consumed` (8 bytes uint64 BE): Quantized instruction-level AST fuel units consumed
|
|
467
|
+
- `execution_timestamp` (8 bytes uint64 BE): Epoch timestamp in milliseconds
|
|
468
|
+
- **Tampering & Replay Mitigation**: The client computes the local SHA-256 hash of the received output and asserts strict equality with `journal.outputDigest`. Any modified bit in either the journal, curve proof, or post-quantum signature causes immediate rejection.
|
|
469
|
+
- **Enclave Policy Invariant (`ZK_BLOCKING`)**: Tier 1 Sovereign Enclaves configure `zkMode: "required"`, rejecting queries if a valid Groth16 proof cannot be synthesized or if mock proofs are supplied. When `pqcSign: true` is configured, the enclave emits a Version 2.1 hybrid receipt co-signed with ML-DSA-65.
|
|
470
|
+
|
|
471
|
+
```typescript
|
|
472
|
+
import { LiopServer } from "@nekzus/liop/server";
|
|
473
|
+
import { LiopVerifier, verifyTeeAttestationDetailed } from "@nekzus/liop";
|
|
474
|
+
|
|
475
|
+
// 1. Enclave configuration with ZK_BLOCKING and PQC signing
|
|
476
|
+
const server = new LiopServer({ name: "bank-enclave", version: "1.0.0" });
|
|
477
|
+
server.tool(
|
|
478
|
+
"calculate_payroll_aggregate",
|
|
479
|
+
"Aggregates payroll without egressing employee identities",
|
|
480
|
+
{ payload: z.string() },
|
|
481
|
+
async () => ({ content: [{ type: "text", text: "ok" }] }),
|
|
482
|
+
{
|
|
483
|
+
zkMode: "required", // Enforces Groth16 proof generation (ZK_BLOCKING)
|
|
484
|
+
pqcSign: true, // Enables ML-DSA-65 digital signature (Receipt v2.1)
|
|
485
|
+
circuitName: "sum",
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
// 2. Client verification via LiopVerifier
|
|
490
|
+
const verifier = new LiopVerifier();
|
|
491
|
+
const isValid = await verifier.verifyZkReceipt(
|
|
492
|
+
Buffer.from(logicPayload),
|
|
493
|
+
remoteImageIdHex,
|
|
494
|
+
rawReceiptBuffer,
|
|
495
|
+
{ zkPolicy: "required" }
|
|
496
|
+
);
|
|
454
497
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
498
|
+
// 3. Pre-flight Hardware TEE Attestation (AMD SEV-SNP / AWS Nitro Enclaves)
|
|
499
|
+
const teeStatus = await verifyTeeAttestationDetailed(
|
|
500
|
+
attestationBytes,
|
|
501
|
+
expectedNonce,
|
|
502
|
+
{ requireHardwareSigned: true }
|
|
503
|
+
);
|
|
504
|
+
```
|
|
458
505
|
|
|
459
506
|
---
|
|
460
507
|
|
|
@@ -469,7 +516,7 @@ The following shows a complete Logic-Injection-on-Origin execution cycle (handle
|
|
|
469
516
|
4. Code executes inside a V8 isolate with CPU fuel limits (no Node.js globals)
|
|
470
517
|
5. Taint Analyzer blocks PII side-channel derivation (charCodeAt, boolean inference)
|
|
471
518
|
6. PII Shield scans output for forbidden data and keys
|
|
472
|
-
7. ZK-Receipt generated (
|
|
519
|
+
7. ZK-Receipt generated (Tri-modal: HMAC v1, Groth16 v2, or Groth16 + ML-DSA-65 v2.1)
|
|
473
520
|
8. Result + receipt returned to the LLM (raw data never exposed)
|
|
474
521
|
```
|
|
475
522
|
|
|
@@ -498,7 +545,7 @@ Node.js is single-threaded. Heavy operations like Kyber768 decryption, AES-GCM a
|
|
|
498
545
|
This SDK dispatches all heavy computation to OS-level threads via [`piscina`](https://github.com/piscinajs/piscina), achieving Rust-like concurrency. On server or verifier initialization, background warmup tasks are automatically dispatched to pre-warm the pool workers, eliminating V8/WASI cold-start overhead (~820k fuel units) for subsequent calls:
|
|
499
546
|
|
|
500
547
|
```typescript
|
|
501
|
-
// Automatic
|
|
548
|
+
// Automatic, no configuration needed
|
|
502
549
|
// When a Logic-Injection-on-Origin payload is received:
|
|
503
550
|
// 1. Main thread receives JSON-RPC request
|
|
504
551
|
// 2. Worker thread: AST inspection + PQC decryption + Sandbox execution
|
|
@@ -571,7 +618,7 @@ Navigate to **`http://localhost:16000`** in your browser:
|
|
|
571
618
|
|
|
572
619
|
* **Live 7-Phase Streaming:** Visualizes Bootstrap, DHT Discovery, ML-KEM-768 Handshake, AES-256-GCM Sealing, WASI Sandbox Execution, ZK-Receipt Verification, and Output Aggregation via real-time Server-Sent Events (SSE).
|
|
573
620
|
* **Tri-Tab Results Panel:** Switch between `Aggregated Output` (sanitized JSON), `Fuel & Telemetry` (WASI fuel metering, token economy comparison banner), and `Crypto Proofs` (ImageID, Dataset Hash, and HMAC-SHA256 signature with instant copy).
|
|
574
|
-
* **Token Economy Dashboard:** Live comparison showing **98.9%
|
|
621
|
+
* **Token Economy Dashboard:** Live comparison showing **98.9% to 99.6% token reduction** and **99.6% network bandwidth savings** over traditional MCP context-pulling.
|
|
575
622
|
* **REST Telemetry Endpoint:** Query session analytics programmatically at `GET http://localhost:16000/api/telemetry`.
|
|
576
623
|
* **Built-in Scenario Presets:** Ready-to-run micro-modules for High-Frequency Trading (HFT Level 2 order books), Banking transaction analysis, Medical Vault HIPAA records, and Edge IoT industrial sensor telemetry.
|
|
577
624
|
* **Dual Dark Modes:** Toggle between Obsidian OLED (`#000000`) and Slate Navy (`#0f172a`) interfaces.
|
|
@@ -618,7 +665,7 @@ This package is continuously tested across multiple platforms and Node.js versio
|
|
|
618
665
|
- **Multi-OS matrix:** Ubuntu, Windows, macOS
|
|
619
666
|
- **Node.js versions:** 20.x, 22.x
|
|
620
667
|
- **Code quality:** Enforced by [Biome.js](https://biomejs.dev/) (linting + formatting)
|
|
621
|
-
- **Security:** Verified 6-layer defense-in-depth architecture
|
|
668
|
+
- **Security:** Verified 6-layer defense-in-depth architecture (see [Security Architecture](https://nekzus-32.mintlify.app/typescript-sdk/security))
|
|
622
669
|
|
|
623
670
|
> To run tests locally or contribute, clone the [repository](https://github.com/Nekzus/LIOP) and follow the [Contributing Guide](https://github.com/Nekzus/LIOP/blob/main/CONTRIBUTING.md).
|
|
624
671
|
|
|
@@ -638,12 +685,12 @@ The codebase undergoes regular dependencies audits. As of June 2026, the SDK is
|
|
|
638
685
|
|
|
639
686
|
## Related
|
|
640
687
|
|
|
641
|
-
- [LIOP Documentation](https://nekzus-32.mintlify.app/)
|
|
642
|
-
- [LIOP Specification](https://github.com/Nekzus/LIOP/blob/main/protocol/SPECIFICATION.md)
|
|
643
|
-
- [LIOP Manifesto](https://github.com/Nekzus/LIOP/blob/main/MANIFESTO.md)
|
|
644
|
-
- [Contributing Guide](https://github.com/Nekzus/LIOP/blob/main/CONTRIBUTING.md)
|
|
645
|
-
- [Rust Mesh Node](https://github.com/Nekzus/LIOP/tree/main/servers/liop-node)
|
|
646
|
-
- [LIOP CLI](https://github.com/Nekzus/LIOP/tree/main/tools/liop-cli)
|
|
688
|
+
- [LIOP Documentation](https://nekzus-32.mintlify.app/): Full conceptual and API documentation
|
|
689
|
+
- [LIOP Specification](https://github.com/Nekzus/LIOP/blob/main/protocol/SPECIFICATION.md): Technical specification
|
|
690
|
+
- [LIOP Manifesto](https://github.com/Nekzus/LIOP/blob/main/MANIFESTO.md): Project philosophy
|
|
691
|
+
- [Contributing Guide](https://github.com/Nekzus/LIOP/blob/main/CONTRIBUTING.md): How to contribute
|
|
692
|
+
- [Rust Mesh Node](https://github.com/Nekzus/LIOP/tree/main/servers/liop-node): Native high-performance backend
|
|
693
|
+
- [LIOP CLI](https://github.com/Nekzus/LIOP/tree/main/tools/liop-cli): Developer diagnostics
|
|
647
694
|
|
|
648
695
|
---
|
|
649
696
|
|