> ## Documentation Index
> Fetch the complete documentation index at: https://nekzus-32.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK Overview

> Bringing the power of the Logic-Injection-on-Origin Protocol to the Node.js ecosystem

The official `@nekzus/liop` provides a complete, strongly-typed toolkit for building LIOP Clients (Agent Nodes) and LIOP Servers (Data Nodes) in TypeScript and JavaScript.

If you are migrating from the Model Context Protocol (MCP), you will find the API surface remarkably familiar. LIOP was designed to provide a **Drop-in Replacement** Developer Experience (DX), abstracting away the immense complexity of Protobuf, WebAssembly, and Kademlia DHT under simple TypeScript classes.

## Package Architecture

The SDK is published to npm as a single unified package containing both Client and Server logic:

<CodeGroup>
  ```bash npm theme={null}
  npm install @nekzus/liop@latest zod
  ```

  ```bash pnpm theme={null}
  pnpm add @nekzus/liop@latest zod
  ```

  ```bash yarn theme={null}
  yarn add @nekzus/liop@latest zod
  ```
</CodeGroup>

<Note>
  We strongly recommend installing `zod` alongside the SDK. Just like the official MCP specification, LIOP relies on Zod parsing to guarantee that Execution Arguments passed by the AI Agent perfectly match the Server's capability manifest.
</Note>

## Zero-Bloat Architecture (Opt-Out Installations)

By default, `@nekzus/liop` provides out-of-the-box backward compatibility with the Model Context Protocol (MCP) via the `LiopMcpBridge` module. To make this integration seamless, the package lists `@modelcontextprotocol/sdk` as an optional and peer dependency, meaning standard installations (`npm install @nekzus/liop`) will automatically resolve and install it.

However, for constrained production environments (such as Docker edge containers, AWS Lambda, or IoT deployments) where every megabyte counts, you can perform a **pure, zero-bloat LIOP installation** by opting out of the optional dependencies:

<CodeGroup>
  ```bash npm theme={null}
  npm install @nekzus/liop@latest --no-optional
  ```

  ```bash pnpm theme={null}
  pnpm add @nekzus/liop@latest --without optional
  ```

  ```bash yarn theme={null}
  yarn add @nekzus/liop@latest --ignore-optional
  ```
</CodeGroup>

This drops the installation size dramatically. The SDK uses dynamic `import()` under the hood, meaning the MCP bridge logic is only loaded if requested, maintaining a pristine runtime memory footprint.

## Under the Hood: The Javy Compiler

You might be wondering: *If LIOP relies on injecting compiled WebAssembly (`.wasm`) logic, how can I build Agents purely in TypeScript?*

The `@nekzus/liop` includes a native compilation bridge (the **Component Builder**). When your TypeScript Agent invokes `.execute()`, the SDK transparently serializes the JavaScript payload, bundles it utilizing a Javy-like engine into a highly restrictive `.wasm` payload, strings it through the Protobuf `LogicRequest`, and injects it into the Mesh.

The developer never has to manually write or compile Rust/Wasm.

## Vanguard Enterprise Features

The TypeScript SDK operates at strict architectural parity with the high-performance Rust core, ensuring true Zero-Trust enterprise constraints:

* **Post-Quantum Cryptography (ML-KEM-768):** End-to-end asymmetric encapsulation (`crystals-kyber`) and symmetric AES-256-GCM authentication.
* **Hybrid Mesh Transport:** Unrestricted Node.js & browser peering through WebSockets (WS) and TCP (Yamux) libp2p listeners.
* **Guardian-TS (Zero-Time AST Inspection):** Proactive sandbox-escape mitigation that blocks illegal host capabilities *before* `node:wasi` execution logic triggers.
* **ZK-Receipt Ready:** Native architectural support for trustless Mathematical Execution Proofs against Zero-Knowledge Virtual Machines (zkVMs).
* **Multi-Core Scaling (Worker Pool):** Hardware-accelerated transactional performance using `piscina`. Bypasses V8's Single-Thread Event Loop bottleneck by offloading PQC decryption, AST inspection, and WASI Sandboxing to isolated OS-level threads.

## Key Exports

The SDK exports three primary classes for orchestrating Mesh applications:

<CardGroup cols={3}>
  <Card title="LiopServer" icon="server" href="/typescript-sdk/server">
    The Data Node receiver. Exposes local secure capabilities, files, and handles incoming Logic-Injection-on-Origin intent safely.
  </Card>

  <Card title="LiopClient" icon="robot" href="/typescript-sdk/client">
    The Intelligence Node. Searches the DHT Mesh for available capabilities and injects the dynamic WebAssembly payload to process data.
  </Card>

  <Card title="LiopMcpBridge" icon="bridge-water" href="/typescript-sdk/server#liopmcpbridge">
    The Legacy Translator. Instantly bridges `tools` and `resources` between legacy JSON-RPC MCP clients and your high-performance LIOP network.
  </Card>
</CardGroup>

## Architectural Deep Dive: Multi-Core Transactional Pool

A severe limitation historically cited regarding Node.js was its single-threaded Event Loop bottleneck under grueling CPU workloads. The SDK shatters this limit by routing cryptographic ingestion to isolated OS Threads via `piscina`.

<Frame>
  <img className="block dark:hidden w-full" src="https://mintcdn.com/nekzus-32/CeoRGheNFctGW1BW/images/animated-sdk-flow-light.svg?fit=max&auto=format&n=CeoRGheNFctGW1BW&q=85&s=3a334dad8170517c76b00aa1e9862ea8" alt="LIOP SDK Architecture Flow" width="800" height="400" data-path="images/animated-sdk-flow-light.svg" />

  <img className="hidden dark:block w-full" src="https://mintcdn.com/nekzus-32/CeoRGheNFctGW1BW/images/animated-sdk-flow-dark.svg?fit=max&auto=format&n=CeoRGheNFctGW1BW&q=85&s=13c07368a47b845590663000ab2e90f9" alt="LIOP SDK Architecture Flow" width="800" height="400" data-path="images/animated-sdk-flow-dark.svg" />
</Frame>

## Getting Started

Ready to write your first line of LIOP code? Jump straight into building either side of the Mesh constraint:

* Construct a [Logic Server](/typescript-sdk/server) to protect your data.
* Design a [Logic Client](/typescript-sdk/client) to search out intelligence.
