Skip to content

Commit 4f44eee

Browse files
refactor: update package names from @enclavejs to @enclave-vm across the codebase (#39)
* refactor: update package names from @enclavejs to @enclave-vm across the codebase * refactor: update package names from @enclavejs to @enclave-vm across the codebase
1 parent 6f30699 commit 4f44eee

126 files changed

Lines changed: 2533 additions & 2245 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish-release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ jobs:
209209
210210
The Enclave ecosystem includes:
211211
- ast-guard: AST security guard with CVE protection
212-
- enclave-vm: Secure AgentScript execution environment
213-
- @enclavejs/types: Protocol types and Zod schemas
214-
- @enclavejs/stream: NDJSON streaming with encryption
215-
- @enclavejs/broker: Tool broker with session management
216-
- @enclavejs/client: Browser and Node.js client SDK
217-
- @enclavejs/react: React hooks and components
218-
- @enclavejs/runtime: Standalone deployable runtime
212+
- @enclave-vm/core: Secure AgentScript execution environment
213+
- @enclave-vm/types: Protocol types and Zod schemas
214+
- @enclave-vm/stream: NDJSON streaming with encryption
215+
- @enclave-vm/broker: Tool broker with session management
216+
- @enclave-vm/client: Browser and Node.js client SDK
217+
- @enclave-vm/react: React hooks and components
218+
- @enclave-vm/runtime: Standalone deployable runtime
219219
220220
Version: ${version}
221221
Release Date: ${releaseDate}

README-ARCHITECTURE.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ The design intentionally supports:
1212

1313
## Implementation Status
1414

15-
| Package | Status | Description |
16-
| -------------------- | ------- | --------------------------------------- |
17-
| `enclave-vm` | ✅ Done | Core sandbox VM engine |
18-
| `@enclavejs/types` | ✅ Done | Shared TypeScript types and Zod schemas |
19-
| `@enclavejs/stream` | ✅ Done | NDJSON streaming protocol |
20-
| `@enclavejs/broker` | ✅ Done | Middleware/tool broker with HTTP API |
21-
| `@enclavejs/client` | ✅ Done | Browser + Node client SDK |
22-
| `@enclavejs/runtime` | ✅ Done | Extracted runtime worker |
23-
| `@enclavejs/react` | ✅ Done | React hooks & components |
15+
| Package | Status | Description |
16+
| --------------------- | ------- | --------------------------------------- |
17+
| `@enclave-vm/core` | ✅ Done | Core sandbox VM engine |
18+
| `@enclave-vm/types` | ✅ Done | Shared TypeScript types and Zod schemas |
19+
| `@enclave-vm/stream` | ✅ Done | NDJSON streaming protocol |
20+
| `@enclave-vm/broker` | ✅ Done | Middleware/tool broker with HTTP API |
21+
| `@enclave-vm/client` | ✅ Done | Browser + Node client SDK |
22+
| `@enclave-vm/runtime` | ✅ Done | Extracted runtime worker |
23+
| `@enclave-vm/react` | ✅ Done | React hooks & components |
2424

2525
## Table of contents
2626

@@ -67,7 +67,7 @@ The design intentionally supports:
6767
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
6868
| **Runtime** | The component that runs AgentScript continuously (built on `enclave-vm`). |
6969
| **Client** | JS SDK used from browser/server to start a session with the middleware and consume the streamed events/results. |
70-
| **Middleware / Broker** | Node.js service (often inside a VPC) that owns secrets and executes tool calls. Implemented in `@enclavejs/broker`. |
70+
| **Middleware / Broker** | Node.js service (often inside a VPC) that owns secrets and executes tool calls. Implemented in `@enclave-vm/broker`. |
7171
| **Session** | A long-lived, continuous execution context for a single piece of code (plus its stream + tool roundtrips). |
7272
| **Tool** | An external action callable from AgentScript via `callTool(name, args)`. |
7373
| **Reference Sidecar** | Per-session in-memory store of large/sensitive values addressed by `refId`. |
@@ -85,8 +85,8 @@ The design intentionally supports:
8585
├─────────────────────────────────────────────────────────────────────────────┤
8686
│ │
8787
│ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │
88-
│ │ @enclavejs/ │ │ @enclavejs/ │ │ enclave-vm │ │
89-
│ │ client │────▶│ broker │────▶│ (runtime) │ │
88+
│ │ @enclave-vm/ │ │ @enclave-vm/ │ │ @enclave-vm/ │ │
89+
│ │ client │────▶│ broker │────▶│ core (runtime) │ │
9090
│ │ (browser/node) │ │ (middleware) │ │ (sandboxed) │ │
9191
│ └──────────────────┘ └──────────────────┘ └──────────────────┘ │
9292
│ │ │ │ │
@@ -103,15 +103,15 @@ The design intentionally supports:
103103

104104
### Packages
105105

106-
| Package | npm | Description |
107-
| -------------------- | -------------------- | ------------------------------------------------------------------------- |
108-
| `enclave-vm` | `enclave-vm` | Core sandbox VM engine. Executes untrusted code safely. |
109-
| `@enclavejs/types` | `@enclavejs/types` | Shared TypeScript types, Zod schemas, protocol constants. |
110-
| `@enclavejs/stream` | `@enclavejs/stream` | NDJSON streaming protocol, event parsing, reconnection logic. |
111-
| `@enclavejs/broker` | `@enclavejs/broker` | Middleware: tool registry, secret management, session API, HTTP handlers. |
112-
| `@enclavejs/client` | `@enclavejs/client` | Browser + Node SDK for connecting to middleware. (Planned) |
113-
| `@enclavejs/runtime` | `@enclavejs/runtime` | Extracted runtime worker for Lambda/DO/containers. (Planned) |
114-
| `@enclavejs/react` | `@enclavejs/react` | React hooks for session management. (Planned) |
106+
| Package | npm | Description |
107+
| --------------------- | --------------------- | ------------------------------------------------------------------------- |
108+
| `@enclave-vm/core` | `@enclave-vm/core` | Core sandbox VM engine. Executes untrusted code safely. |
109+
| `@enclave-vm/types` | `@enclave-vm/types` | Shared TypeScript types, Zod schemas, protocol constants. |
110+
| `@enclave-vm/stream` | `@enclave-vm/stream` | NDJSON streaming protocol, event parsing, reconnection logic. |
111+
| `@enclave-vm/broker` | `@enclave-vm/broker` | Middleware: tool registry, secret management, session API, HTTP handlers. |
112+
| `@enclave-vm/client` | `@enclave-vm/client` | Browser + Node SDK for connecting to middleware. (Planned) |
113+
| `@enclave-vm/runtime` | `@enclave-vm/runtime` | Extracted runtime worker for Lambda/DO/containers. (Planned) |
114+
| `@enclave-vm/react` | `@enclave-vm/react` | React hooks for session management. (Planned) |
115115

116116
---
117117

@@ -126,7 +126,7 @@ Browser connects to your VPC where middleware runs the runtime in-process. **Sim
126126
│ Browser │ ◄────────────────────────► │ VPC / Your Server │
127127
│ (Client) │ POST /sessions │ │
128128
│ │ Stream events │ ┌─────────────────────────┐ │
129-
└─────────────┘ │ │ @enclavejs/broker │ │
129+
└─────────────┘ │ │ @enclave-vm/broker │ │
130130
│ │ • Tool Registry │ │
131131
│ │ • Secrets (API keys) │ │
132132
│ │ • Session Manager │ │
@@ -143,7 +143,7 @@ Browser connects to your VPC where middleware runs the runtime in-process. **Sim
143143

144144
```typescript
145145
import express from 'express';
146-
import { createBroker, createSessionHandler, registerExpressRoutes } from '@enclavejs/broker';
146+
import { createBroker, createSessionHandler, registerExpressRoutes } from '@enclave-vm/broker';
147147
import { z } from 'zod';
148148

149149
const broker = createBroker()
@@ -202,7 +202,7 @@ Browser connects to middleware, but code execution happens on a separate Lambda/
202202
```
203203
┌─────────────┐ HTTPS/NDJSON ┌─────────────────────┐ WebSocket ┌─────────────────┐
204204
│ Browser │ ◄────────────────► │ VPC Middleware │ ◄─────────────► │ Lambda/Vercel │
205-
│ (Client) │ POST /sessions │ @enclavejs/broker │ session channel │ Runtime │
205+
│ (Client) │ POST /sessions │ @enclave-vm/broker │ session channel │ Runtime │
206206
│ │ Stream events │ │ │ │
207207
└─────────────┘ │ • Tool Registry │ │ • enclave-vm │
208208
│ • Secrets │ │ • NO secrets │
@@ -260,7 +260,7 @@ Your backend server (Node.js) executes code directly. No HTTP/browser involved.
260260
│ │ │
261261
│ ▼ │
262262
│ ┌─────────────────────────────────────────────────┐ │
263-
│ │ @enclavejs/broker │ │
263+
│ │ @enclave-vm/broker │ │
264264
│ │ • Tool Registry • Secrets │ │
265265
│ │ • enclave-vm (sandboxed execution) │ │
266266
│ └─────────────────────────────────────────────────┘ │
@@ -270,7 +270,7 @@ Your backend server (Node.js) executes code directly. No HTTP/browser involved.
270270
**Example:**
271271

272272
```typescript
273-
import { createBroker } from '@enclavejs/broker';
273+
import { createBroker } from '@enclave-vm/broker';
274274
import { z } from 'zod';
275275

276276
const broker = createBroker()
@@ -332,7 +332,7 @@ Your server orchestrates but offloads code execution to Lambda/Vercel. **Best fo
332332
```
333333
┌──────────────────────────┐ WebSocket/HTTP ┌─────────────────────┐
334334
│ Your Server (Node) │ ◄───────────────────────────► │ Lambda Runtime │
335-
│ @enclavejs/broker │ │ @enclavejs/runtime│
335+
│ @enclave-vm/broker │ │ @enclave-vm/runtime│
336336
│ │ session channel │ │
337337
│ • Tool Registry │ (tool_call/tool_result) │ • enclave-vm │
338338
│ • Secrets │ │ • NO secrets │
@@ -468,10 +468,10 @@ Every message includes:
468468
| `heartbeat` | Keep-alive signal |
469469
| `error` | Non-fatal error during execution |
470470

471-
### TypeScript Types (from `@enclavejs/types`)
471+
### TypeScript Types (from `@enclave-vm/types`)
472472

473473
```typescript
474-
import type { StreamEvent, SessionId, CallId } from '@enclavejs/types';
474+
import type { StreamEvent, SessionId, CallId } from '@enclave-vm/types';
475475

476476
// Event union type
477477
type StreamEvent =
@@ -514,7 +514,7 @@ const result = await callTool('toolName', { arg1: 'value' });
514514
### Tool Registration
515515

516516
```typescript
517-
import { createBroker } from '@enclavejs/broker';
517+
import { createBroker } from '@enclave-vm/broker';
518518
import { z } from 'zod';
519519

520520
const broker = createBroker()
@@ -649,7 +649,7 @@ Per-hop encryption using:
649649

650650
### Recommendations
651651

652-
- **Server/container**: Best for most deployments. Run Node.js with `@enclavejs/broker`.
652+
- **Server/container**: Best for most deployments. Run Node.js with `@enclave-vm/broker`.
653653
- **Cloudflare DO**: Best for edge deployment with global distribution.
654654
- **Lambda**: Use for short-lived sessions or as extracted runtime with middleware coordination.
655655
- **Vercel Edge**: Use only as gateway/proxy to stateful runtime.

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
**Secure sandbox runtime for AI agents**
1414

1515
[![npm ast-guard](https://img.shields.io/npm/v/ast-guard.svg?label=ast-guard&color=e8a045)](https://www.npmjs.com/package/ast-guard)
16-
[![npm enclave-vm](https://img.shields.io/npm/v/enclave-vm.svg?label=enclave-vm&color=e8a045)](https://www.npmjs.com/package/enclave-vm)
16+
[![npm @enclave-vm/core](https://img.shields.io/npm/v/@enclave-vm/core.svg?label=@enclave-vm/core&color=e8a045)](https://www.npmjs.com/package/@enclave-vm/core)
1717
<br>
18-
[![npm @enclavejs/broker](https://img.shields.io/npm/v/@enclavejs/broker.svg?label=@enclavejs/broker&color=e8a045)](https://www.npmjs.com/package/@enclavejs/broker)
19-
[![npm @enclavejs/client](https://img.shields.io/npm/v/@enclavejs/client.svg?label=@enclavejs/client&color=e8a045)](https://www.npmjs.com/package/@enclavejs/client)
20-
[![npm @enclavejs/react](https://img.shields.io/npm/v/@enclavejs/react.svg?label=@enclavejs/react&color=e8a045)](https://www.npmjs.com/package/@enclavejs/react)
18+
[![npm @enclave-vm/broker](https://img.shields.io/npm/v/@enclave-vm/broker.svg?label=@enclave-vm/broker&color=e8a045)](https://www.npmjs.com/package/@enclave-vm/broker)
19+
[![npm @enclave-vm/client](https://img.shields.io/npm/v/@enclave-vm/client.svg?label=@enclave-vm/client&color=e8a045)](https://www.npmjs.com/package/@enclave-vm/client)
20+
[![npm @enclave-vm/react](https://img.shields.io/npm/v/@enclave-vm/react.svg?label=@enclave-vm/react&color=e8a045)](https://www.npmjs.com/package/@enclave-vm/react)
2121
<br>
2222
[![Node](https://img.shields.io/badge/node-%3E%3D22-339933)](https://nodejs.org)
2323
[![License](https://img.shields.io/badge/license-Apache--2.0-blue)](./LICENSE)
@@ -41,35 +41,35 @@
4141
### Core Packages
4242

4343
```bash
44-
npm install enclave-vm # Secure JS sandbox
45-
npm install ast-guard # AST security validation
44+
npm install @enclave-vm/core # Secure JS sandbox
45+
npm install ast-guard # AST security validation
4646
```
4747

4848
### Streaming Runtime
4949

5050
```bash
51-
npm install @enclavejs/broker # Tool broker & session management
52-
npm install @enclavejs/client # Browser/Node client SDK
53-
npm install @enclavejs/react # React hooks & components
51+
npm install @enclave-vm/broker # Tool broker & session management
52+
npm install @enclave-vm/client # Browser/Node client SDK
53+
npm install @enclave-vm/react # React hooks & components
5454
```
5555

5656
## Packages
5757

58-
| Package | Description |
59-
| ------------------------------------------------ | --------------------------------------------------- |
60-
| [`enclave-vm`](./libs/enclave-vm) | Secure JavaScript sandbox with 6 security layers |
61-
| [`@enclavejs/broker`](./libs/enclavejs-broker) | Tool registry, secrets management, session API |
62-
| [`@enclavejs/client`](./libs/enclavejs-client) | Browser & Node.js client for streaming sessions |
63-
| [`@enclavejs/react`](./libs/enclavejs-react) | React hooks: `useEnclaveSession`, `EnclaveProvider` |
64-
| [`@enclavejs/runtime`](./libs/enclavejs-runtime) | Deployable runtime worker (Lambda, Vercel, etc.) |
65-
| [`@enclavejs/types`](./libs/enclavejs-types) | TypeScript types & Zod schemas |
66-
| [`@enclavejs/stream`](./libs/enclavejs-stream) | NDJSON streaming, encryption, reconnection |
67-
| [`ast-guard`](./libs/ast-guard) | AST-based security validator |
58+
| Package | Description |
59+
| ------------------------------------------------- | --------------------------------------------------- |
60+
| [`@enclave-vm/core`](./libs/enclave-vm) | Secure JavaScript sandbox with 6 security layers |
61+
| [`@enclave-vm/broker`](./libs/enclavejs-broker) | Tool registry, secrets management, session API |
62+
| [`@enclave-vm/client`](./libs/enclavejs-client) | Browser & Node.js client for streaming sessions |
63+
| [`@enclave-vm/react`](./libs/enclavejs-react) | React hooks: `useEnclaveSession`, `EnclaveProvider` |
64+
| [`@enclave-vm/runtime`](./libs/enclavejs-runtime) | Deployable runtime worker (Lambda, Vercel, etc.) |
65+
| [`@enclave-vm/types`](./libs/enclavejs-types) | TypeScript types & Zod schemas |
66+
| [`@enclave-vm/stream`](./libs/enclavejs-stream) | NDJSON streaming, encryption, reconnection |
67+
| [`ast-guard`](./libs/ast-guard) | AST-based security validator |
6868

6969
## Quick Start
7070

7171
```typescript
72-
import { Enclave } from 'enclave-vm';
72+
import { Enclave } from '@enclave-vm/core';
7373

7474
const enclave = new Enclave({
7575
securityLevel: 'SECURE',
@@ -94,7 +94,7 @@ enclave.dispose();
9494
## React Integration
9595

9696
```tsx
97-
import { EnclaveProvider, useEnclaveSession } from '@enclavejs/react';
97+
import { EnclaveProvider, useEnclaveSession } from '@enclave-vm/react';
9898

9999
function App() {
100100
return (

apps/enclave-demo/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Demonstrates secure JavaScript execution with defense-in-depth
55
*/
66

7-
import { Enclave, ToolHandler } from 'enclave-vm';
7+
import { Enclave, ToolHandler } from '@enclave-vm/core';
88

99
async function main() {
1010
console.log('=== enclave Demo ===\n');

apps/streaming-demo/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"runtime": "ts-node src/runtime-server.ts"
1212
},
1313
"dependencies": {
14-
"@enclavejs/broker": "0.1.0",
15-
"@enclavejs/client": "0.1.0",
16-
"@enclavejs/types": "0.1.0",
17-
"enclave-vm": "2.7.0",
14+
"@enclave-vm/broker": "0.1.0",
15+
"@enclave-vm/client": "0.1.0",
16+
"@enclave-vm/types": "0.1.0",
17+
"@enclave-vm/core": "2.8.0",
1818
"express": "^4.21.0",
1919
"zod": "^3.24.0"
2020
},

apps/streaming-demo/src/__tests__/broker-server.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
import express, { Express } from 'express';
1515
import { Server } from 'http';
1616
import request from 'supertest';
17-
import { WebSocket, WebSocketServer } from 'ws';
1817
import type { AddressInfo } from 'net';
19-
import type { SessionId, CallId, StreamEvent } from '@enclavejs/types';
20-
import { generateSessionId, PROTOCOL_VERSION } from '@enclavejs/types';
18+
import type { CallId } from '@enclave-vm/types';
19+
import { generateSessionId, PROTOCOL_VERSION } from '@enclave-vm/types';
2120
import { z } from 'zod';
22-
import { Enclave } from 'enclave-vm';
23-
import { parseNdjson, delay, testCode } from './test-utils';
21+
import { Enclave } from '@enclave-vm/core';
22+
import { parseNdjson, testCode } from './test-utils';
2423

2524
// Tool handlers for testing
2625
const testToolHandlers: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {

0 commit comments

Comments
 (0)