Skip to main content

Installation

Each library in the Enclave monorepo can be installed independently.

Prerequisites

  • Node.js: >= 22.0.0
  • npm: >= 10 (or yarn/pnpm equivalent)

Core Libraries

@enclave-vm/core

Secure AgentScript execution environment with defense-in-depth.

@enclave-vm/ast

AST-based JavaScript validator: the static layer in front of the sandbox.

EnclaveJS Streaming Runtime

The EnclaveJS packages provide a streaming runtime for real-time code execution with tool orchestration. Install all packages needed for a complete streaming setup:

Individual Packages

@enclave-vm/types

Protocol types and Zod schemas (automatically installed as dependency).

@enclave-vm/stream

NDJSON parsing and reconnection helpers. It also exports encryption primitives, which the client and the broker do not use.

@enclave-vm/broker

Tool broker with session management and HTTP API. It does not authenticate callers: put your own authentication in front of its routes. Authentication alone does not keep the sessions of one caller from another: a broker that serves more than one caller also needs the identify hook of its session handler (see Who may see a session).

@enclave-vm/client

Browser and Node.js client SDK. Requests and events are plain JSON over HTTP: use an https: base URL.

@enclave-vm/react

React hooks and components.
Peer dependency: React >= 18.0.0

@enclave-vm/runtime

Building blocks of a runtime worker (session bookkeeping and channels). It is not a runnable service and does not execute scripts yet: an execute request ends with RuntimeNotImplementedError. To run scripts, use @enclave-vm/broker or @enclave-vm/core.

Quick Start Examples

Basic Sandbox (@enclave-vm/core)

Streaming with React

Development Setup

To work on the Enclave monorepo itself:

Package Versions