npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@enclave-vm/types

v2.12.0

Published

Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol

Readme

@enclave-vm/types

npm version License TypeScript

Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol

The @enclave-vm/types package provides TypeScript type definitions and runtime validation schemas for the EnclaveJS streaming protocol. It serves as the foundation for type-safe communication between EnclaveJS components.

Features

  • TypeScript-First: Full TypeScript support with strict typing
  • Zod Schemas: Runtime validation for all protocol messages
  • Protocol Types: Complete type definitions for streaming messages
  • Session Types: Types for session management and state
  • Tool Types: Type definitions for tool calls and responses

Installation

npm install @enclave-vm/types
# or
yarn add @enclave-vm/types
# or
pnpm add @enclave-vm/types

Quick Start

import { StreamMessage, ToolCallMessage, ToolResultMessage, SessionState } from '@enclave-vm/types';

// Type-safe message handling
function handleMessage(message: StreamMessage) {
  switch (message.type) {
    case 'tool_call':
      const toolCall = message as ToolCallMessage;
      console.log(`Tool: ${toolCall.name}, Args:`, toolCall.args);
      break;
    case 'tool_result':
      const result = message as ToolResultMessage;
      console.log(`Result:`, result.data);
      break;
  }
}

Protocol Messages

Stream Messages

import { StreamMessageSchema, StreamMessage } from '@enclave-vm/types';

// Validate incoming messages
const message = StreamMessageSchema.parse(rawMessage);

Tool Calls

import { ToolCallMessage, ToolResultMessage } from '@enclave-vm/types';

const toolCall: ToolCallMessage = {
  type: 'tool_call',
  id: 'call_123',
  name: 'getUser',
  args: { userId: 1 },
};

const toolResult: ToolResultMessage = {
  type: 'tool_result',
  id: 'call_123',
  data: { name: 'Alice', email: '[email protected]' },
};

Session State

import { SessionState, SessionStatus } from '@enclave-vm/types';

const session: SessionState = {
  id: 'session_abc',
  status: 'running',
  createdAt: new Date(),
  toolCallCount: 5,
};

Zod Schemas

All types have corresponding Zod schemas for runtime validation:

import { StreamMessageSchema, ToolCallMessageSchema, SessionStateSchema } from '@enclave-vm/types';

// Parse and validate
const message = StreamMessageSchema.safeParse(untrustedData);
if (message.success) {
  // message.data is typed correctly
  handleMessage(message.data);
} else {
  console.error('Invalid message:', message.error);
}

Related Packages

| Package | Description | | ------------------------------------------- | ---------------------------------- | | @enclave-vm/stream | Streaming protocol implementation | | @enclave-vm/broker | Tool broker and session management | | @enclave-vm/client | Browser/Node.js client SDK | | @enclave-vm/react | React hooks and components | | @enclave-vm/runtime | Standalone runtime worker |

License

Apache-2.0