@nekzus/liop 2.4.0-alpha.6 → 2.4.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/NOTICE +19 -0
  2. package/README.md +36 -17
  3. package/dist/bin/agent.js +674 -82
  4. package/dist/bin/agent.js.map +1 -1
  5. package/dist/bridge.d.ts +2 -2
  6. package/dist/bridge.js +3 -3
  7. package/dist/{chunk-T5IUZF47.js → chunk-3L2O2XKG.js} +12 -5
  8. package/dist/chunk-3L2O2XKG.js.map +1 -0
  9. package/dist/{chunk-SONUORBT.js → chunk-7BSCUYUE.js} +2 -2
  10. package/dist/chunk-7BSCUYUE.js.map +1 -0
  11. package/dist/{chunk-QLCOEP5J.js → chunk-7PITYWOV.js} +2 -2
  12. package/dist/chunk-7PITYWOV.js.map +1 -0
  13. package/dist/{chunk-74CISO2I.js → chunk-7RXOIDXP.js} +28 -4
  14. package/dist/chunk-7RXOIDXP.js.map +1 -0
  15. package/dist/{chunk-GA3Q2S7O.js → chunk-BOISQ45Z.js} +5 -5
  16. package/dist/chunk-BOISQ45Z.js.map +1 -0
  17. package/dist/{chunk-547TYL27.js → chunk-DZ2FQGJD.js} +26 -1423
  18. package/dist/chunk-DZ2FQGJD.js.map +1 -0
  19. package/dist/{chunk-PYKRQAER.js → chunk-EG46XMJT.js} +2 -2
  20. package/dist/chunk-EG46XMJT.js.map +1 -0
  21. package/dist/chunk-ESRXG36Y.js +115 -0
  22. package/dist/chunk-ESRXG36Y.js.map +1 -0
  23. package/dist/chunk-FTF6AMF6.js +3 -0
  24. package/dist/{chunk-RWRRBYG4.js.map → chunk-FTF6AMF6.js.map} +1 -1
  25. package/dist/{chunk-72MNYFR6.js → chunk-HA6YZ42O.js} +2 -2
  26. package/dist/chunk-HA6YZ42O.js.map +1 -0
  27. package/dist/{chunk-WCCGE4QR.js → chunk-HD2N3IJX.js} +144 -30
  28. package/dist/chunk-HD2N3IJX.js.map +1 -0
  29. package/dist/{chunk-OUUTDSOW.js → chunk-IK7CGWAZ.js} +3 -3
  30. package/dist/chunk-IK7CGWAZ.js.map +1 -0
  31. package/dist/chunk-L6J72C5X.js +1477 -0
  32. package/dist/chunk-L6J72C5X.js.map +1 -0
  33. package/dist/{chunk-U5BZ66VX.js → chunk-PAICJCKJ.js} +60 -175
  34. package/dist/chunk-PAICJCKJ.js.map +1 -0
  35. package/dist/{chunk-32ADSAJS.js → chunk-PEN3KFLF.js} +14 -4
  36. package/dist/chunk-PEN3KFLF.js.map +1 -0
  37. package/dist/{chunk-CRZBVFDV.js → chunk-T7R5HUFD.js} +225 -66
  38. package/dist/chunk-T7R5HUFD.js.map +1 -0
  39. package/dist/{chunk-WSW6YJNY.js → chunk-TKRX6CFI.js} +3 -3
  40. package/dist/chunk-TKRX6CFI.js.map +1 -0
  41. package/dist/chunk-UCVP3XAL.js +279 -0
  42. package/dist/chunk-UCVP3XAL.js.map +1 -0
  43. package/dist/chunk-VH4K4U45.js +180 -0
  44. package/dist/chunk-VH4K4U45.js.map +1 -0
  45. package/dist/{chunk-JIJPZFR2.js → chunk-Y62GORQF.js} +2 -2
  46. package/dist/chunk-Y62GORQF.js.map +1 -0
  47. package/dist/chunk-ZP3VVXOI.js +66 -0
  48. package/dist/chunk-ZP3VVXOI.js.map +1 -0
  49. package/dist/client.d.ts +2 -2
  50. package/dist/client.js +11 -8
  51. package/dist/gateway.d.ts +3 -3
  52. package/dist/gateway.js +11 -9
  53. package/dist/{hybrid-CF__0YnC.d.ts → hybrid-CrKB50nh.d.ts} +2 -2
  54. package/dist/{index-cMV0_yD9.d.ts → index-CX43dvMs.d.ts} +2 -32
  55. package/dist/{index-BW95kAL4.d.ts → index-DoW2gzBZ.d.ts} +3 -21
  56. package/dist/index.d.ts +170 -46
  57. package/dist/index.js +20 -15
  58. package/dist/index.js.map +1 -1
  59. package/dist/kyber-CGOA7Q6A.js +3 -0
  60. package/dist/{kyber-3ULIJSE3.js.map → kyber-CGOA7Q6A.js.map} +1 -1
  61. package/dist/mesh.d.ts +27 -143
  62. package/dist/mesh.js +4 -3
  63. package/dist/node-B0b2vUFS.d.ts +164 -0
  64. package/dist/protocol/liop_core.proto +3 -0
  65. package/dist/server.d.ts +2 -2
  66. package/dist/server.js +7 -6
  67. package/dist/types.js +1 -1
  68. package/dist/verifier-HRFXBKT5.js +6 -0
  69. package/dist/{verifier-3FAKCFNN.js.map → verifier-HRFXBKT5.js.map} +1 -1
  70. package/dist/workers/logic-execution.js +3 -3
  71. package/dist/workers/logic-execution.js.map +1 -1
  72. package/dist/workers/zk-verifier.js +1 -1
  73. package/dist/workers/zk-verifier.js.map +1 -1
  74. package/package.json +15 -3
  75. package/dist/chunk-32ADSAJS.js.map +0 -1
  76. package/dist/chunk-547TYL27.js.map +0 -1
  77. package/dist/chunk-72MNYFR6.js.map +0 -1
  78. package/dist/chunk-74CISO2I.js.map +0 -1
  79. package/dist/chunk-CRZBVFDV.js.map +0 -1
  80. package/dist/chunk-GA3Q2S7O.js.map +0 -1
  81. package/dist/chunk-JIJPZFR2.js.map +0 -1
  82. package/dist/chunk-OUUTDSOW.js.map +0 -1
  83. package/dist/chunk-PYKRQAER.js.map +0 -1
  84. package/dist/chunk-QLCOEP5J.js.map +0 -1
  85. package/dist/chunk-RWRRBYG4.js +0 -3
  86. package/dist/chunk-SONUORBT.js.map +0 -1
  87. package/dist/chunk-T5IUZF47.js.map +0 -1
  88. package/dist/chunk-U5BZ66VX.js.map +0 -1
  89. package/dist/chunk-WCCGE4QR.js.map +0 -1
  90. package/dist/chunk-WSW6YJNY.js.map +0 -1
  91. package/dist/kyber-3ULIJSE3.js +0 -3
  92. package/dist/verifier-3FAKCFNN.js +0 -5
package/NOTICE CHANGED
@@ -3,3 +3,22 @@ Copyright 2026 Nekzus Solutions and contributors
3
3
 
4
4
  This product includes software developed by
5
5
  Nekzus Solutions (https://github.com/Nekzus/LIOP).
6
+
7
+ ========================================================================
8
+ Third-Party Bundled Dependencies and Acknowledgments
9
+ ========================================================================
10
+
11
+ This SDK statically bundles or adapts software from third parties:
12
+
13
+ 1. gpt-tokenizer (https://github.com/niieani/gpt-tokenizer)
14
+ Copyright (c) 2023-2024 Bazyli Brzoska
15
+ Licensed under the MIT License.
16
+
17
+ 2. OpenTelemetry JS API (@opentelemetry/api) (https://github.com/open-telemetry/opentelemetry-js)
18
+ Copyright The OpenTelemetry Authors
19
+ Licensed under the Apache License, Version 2.0.
20
+
21
+ 3. Model Context Protocol (MCP) (https://modelcontextprotocol.io)
22
+ Protocol schemas and interoperability semantics adapted for backward compatibility.
23
+ Copyright Anthropic, PBC and contributors.
24
+ Licensed under the MIT License.
package/README.md CHANGED
@@ -26,24 +26,32 @@
26
26
 
27
27
  `@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 — never the raw data — is returned.
28
28
 
29
- This fundamentally solves the data privacy, bandwidth, and latency challenges of AI-powered data analysis at scale.
29
+ This addresses the data privacy, bandwidth, and latency bottlenecks of distributed agent data analysis.
30
30
 
31
31
  ### Key Capabilities
32
32
 
33
33
  | Feature | Description |
34
34
  | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
35
35
  | **Logic-Injection-on-Origin** | LLMs send code, not queries. Data never leaves the origin server. |
36
- | **Dual-Era MCP Compliance** | Seamless support for modern stateless MCP v2 (2026-07-28) and legacy MCP (2025-11-25) clients (Claude Desktop, Cursor). |
36
+ | **Dual-Era MCP Compliance** | Dual-era compatibility supporting modern stateless MCP v2 (2026-07-28) and legacy MCP (2025-11-25) clients (Claude Desktop, Cursor). |
37
37
  | **Token Economy Engine** | Inlined BPE `o200k_base` tokenizer with zero runtime dependencies (16.5MB footprint reduction) and OpenTelemetry `gen_ai.*` bridge. |
38
- | **Interactive Playground UI** | Real-time Web UI (`:14000`) with live 7-phase SSE execution stream and cryptographic proof inspector. |
38
+ | **Interactive Playground UI** | Real-time Web UI (`:16000` prod / `:14000` dev) with 4-tab modular architecture (`Output`, `Debug`, `Telemetry`, `Export`), code generation (TS/cURL/Python), and dual OLED/Slate themes. |
39
+ | **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. |
40
+ | **AST Fuel Metering** | Deterministic AST instruction fuel scoring with 100-bucket quantization for NIST SP 800-53 timing side-channel elimination (`stddev = 0`).|
41
+ | **Differential Privacy Engine** | NIST SP 800-226 Laplace mechanism with CSPRNG entropy, query-aware sensitivity, and deterministic ZK-Receipt auditing (`DpEngine`). |
39
42
  | **MCP Drop-in Replacement** | `LiopServer` mirrors the Anthropic MCP `Server` API — tools, resources, and prompts with `Zod` schemas. |
40
- | **Guardian AST** | Zero-time heuristic inspection blocks sandbox escapes (`require`, `fs`, `eval`, `fetch`, prototype pollution). |
43
+ | **Guardian AST** | Pre-execution heuristic inspection blocks sandbox escapes (`require`, `fs`, `eval`, `fetch`, prototype pollution). |
44
+ | **IFC Taint Analyzer** | 5-pass Acorn AST information flow control tracking collection aliases, correlation guards, and extrema gates at preflight. |
41
45
  | **WASI Sandbox** | JavaScript payloads execute inside V8 isolates with CPU fuel limits, no Node.js globals, and safe environment isolation (`allowEnv`). |
46
+ | **Adaptive Network Discovery**| Single-URL RFC 9728 Protected Resource Metadata probe and adaptive execution mode resolution (`TopologyProbe`). |
47
+ | **Resilient Hybrid Routing** | Deterministic per-tool multiplexing across `http-gateway`, `p2p-grpc`, and `local` with 5-failure circuit breaker (`RoutingTable`).|
48
+ | **OAuth 2.1 M2M Lifecycle** | Concurrency in-flight de-duplication, 30-second preemptive refresh buffer, and reactive invalidation (`TokenManager`). |
49
+ | **Sliding-Window Rate Limiter**| In-memory OWASP API4:2023 rate limiting with background cleanup unreferenced intervals (`InMemoryRateLimiter`). |
42
50
  | **PII Shield** | Multi-layer egress filter with Regional Presets, custom keys, and recursive floats sanitization (`sanitizeOutput`). |
43
51
  | **ZK-Receipts** | Cryptographic proof with `output_hash` cross-verification (Replay Mitigation) and balanced-brace proxy extraction. |
44
52
  | **Worker Pool** | Heavy computation (crypto, sandboxing) dispatched to OS threads via `piscina` with background async warmup. |
45
53
  | **Post-Quantum Ready** | ML-KEM-768 (Kyber) + ML-DSA-65 (Dilithium) with 1-hour session lifetime and AES-256-GCM encryption. |
46
- | **Enterprise Observability** | Immutable SOC 2 Hash-Chain audit log (`AuditLogger`), Prometheus metrics (`/metrics`), and Kubernetes probes (`/healthz`, `/readyz`). |
54
+ | **Enterprise Observability** | Immutable SOC 2 Hash-Chain audit log (`AuditLogger`), physical wire egress tracking, Prometheus metrics (`/metrics`), and K8s probes. |
47
55
  | **P2P Mesh** | Kademlia DHT discovery via `libp2p` with TCP + WebSocket + Yamux multiplexing and Noise encryption. |
48
56
 
49
57
  ---
@@ -64,7 +72,7 @@ npm install @nekzus/liop@beta
64
72
 
65
73
  ### Zero-Bloat & Micro-Deployments (Opt-Out)
66
74
 
67
- By default, the SDK provides out-of-the-box MCP backward compatibility (`LiopMcpBridge`) by declaring `@modelcontextprotocol/sdk` as an optional dependency (which is automatically resolved by standard installations of NPM, PNPM, or Yarn).
75
+ By default, the SDK provides backward compatibility with MCP (`LiopMcpBridge`) by declaring `@modelcontextprotocol/sdk` as an optional dependency (which is automatically resolved by standard installations of NPM, PNPM, or Yarn).
68
76
 
69
77
  For constrained production environments (e.g., Docker, AWS Lambda, Edge/IoT) where every megabyte counts, you can perform a **pure, zero-bloat LIOP installation** by opting out of the optional dependencies:
70
78
 
@@ -315,11 +323,11 @@ await bridge.connect();
315
323
 
316
324
  ## Security Architecture
317
325
 
318
- ### The Shield — Multi-Layer Defense
326
+ ### Defense-in-Depth Architecture
319
327
 
320
328
  ```
321
329
  ┌───────────────────────────────────────────────────────────┐
322
- │ Layer 1: Guardian AST (Zero-Time Static Analysis)
330
+ │ Layer 1: Guardian AST (Pre-Execution Static Analysis)
323
331
  │ 14-function WASI allowlist • 128 import cap • Blocks │
324
332
  │ require, import(), fs, eval, fetch, __proto__ │
325
333
  ├───────────────────────────────────────────────────────────┐
@@ -444,7 +452,7 @@ The following shows a complete Logic-Injection-on-Origin execution cycle (handle
444
452
  ```
445
453
  1. LLM generates JavaScript analysis code wrapped in @LIOP / @END boundaries
446
454
  2. LiopServer receives the payload via tools/call (JSON-RPC or direct)
447
- 3. Guardian AST inspects for sandbox escapes (zero-time heuristic analysis)
455
+ 3. Guardian AST inspects for sandbox escapes (pre-execution heuristic analysis)
448
456
  4. Code executes inside a V8 isolate with CPU fuel limits (no Node.js globals)
449
457
  5. Taint Analyzer blocks PII side-channel derivation (charCodeAt, boolean inference)
450
458
  6. PII Shield scans output for forbidden data and keys
@@ -528,21 +536,32 @@ await server.connectToMesh();
528
536
 
529
537
  ---
530
538
 
531
- ## Interactive Web Playground (`:14000`)
539
+ ## Interactive Web Playground (`:16000` prod / `:14000` dev)
532
540
 
533
- The SDK includes an industrial, real-time developer interface to visually test Logic-Injection-on-Origin, trace post-quantum handshakes, and inspect cryptographic proofs:
541
+ The SDK includes a real-time developer interface to test Logic-Injection-on-Origin, trace post-quantum handshakes, evaluate AST fuel consumption, and inspect cryptographic proofs:
534
542
 
535
543
  ```bash
536
- # Launch the full Docker mesh and interactive Web UI
544
+ # 1. Launch the full 8-node production audit mesh with traffic shaping (http://localhost:16000)
545
+ pnpm run audit:prod:start
546
+
547
+ # Run the 10-suite automated production audit against the mesh
548
+ pnpm run audit:prod:run
549
+
550
+ # Teardown and cleanup production containers
551
+ pnpm run audit:prod:clean
552
+
553
+ # 2. Alternatively, launch the lightweight 5-node demo (http://localhost:14000)
537
554
  pnpm run demo:start
538
555
  ```
539
556
 
540
- Navigate to **`http://localhost:14000`** in your browser:
557
+ Navigate to **`http://localhost:16000`** in your browser:
541
558
 
542
559
  * **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).
543
- * **Built-in Industrial Presets:** Ready-to-run micro-modules for High-Frequency Trading (HFT Level 2 order books), Banking transaction analysis, Medical Vault HIPAA records, and PII exfiltration defense.
544
- * **Cryptographic Proof Inspector:** Validates SHA-256 `ImageID`, HMAC-SHA256 ZK-receipt seals, and dataset integrity digests on the fly.
545
- * **Dual Dark Modes:** Seamlessly toggle between OLED Obsidian and Slate Midnight interfaces.
560
+ * **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).
561
+ * **Token Economy Dashboard:** Live comparison showing **98.9% 99.6% token reduction** and **99.6% network bandwidth savings** over traditional MCP context-pulling.
562
+ * **REST Telemetry Endpoint:** Query session analytics programmatically at `GET http://localhost:16000/api/telemetry`.
563
+ * **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.
564
+ * **Dual Dark Modes:** Toggle between Obsidian OLED (`#000000`) and Slate Navy (`#0f172a`) interfaces.
546
565
 
547
566
  ---
548
567
 
@@ -600,7 +619,7 @@ You can run security audits and check package health scores directly from the mo
600
619
  - **Check SDK Security Score:** `pnpm socket:score` (shows the detailed package score for the SDK in Markdown format)
601
620
  - **Fix Vulnerabilities:** `pnpm socket:fix` (automatically remediates known CVEs in package.json)
602
621
 
603
- The codebase undergoes regular dependencies audits. As of June 2026, the SDK is verified to be 100% free of orphan packages and dead dependencies, ensuring an ultra-lightweight deployment footprint.
622
+ The codebase undergoes regular dependencies audits. As of June 2026, the SDK is verified to be 100% free of orphan packages and dead dependencies, ensuring a minimal deployment footprint.
604
623
 
605
624
  ---
606
625