
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
@enclave-vm/types
Advanced tools
Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol
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.
npm install @enclave-vm/types
# or
yarn add @enclave-vm/types
# or
pnpm add @enclave-vm/types
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;
}
}
import { StreamMessageSchema, StreamMessage } from '@enclave-vm/types';
// Validate incoming messages
const message = StreamMessageSchema.parse(rawMessage);
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: 'alice@example.com' },
};
import { SessionState, SessionStatus } from '@enclave-vm/types';
const session: SessionState = {
id: 'session_abc',
status: 'running',
createdAt: new Date(),
toolCallCount: 5,
};
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);
}
| 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 |
Apache-2.0
FAQs
Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol
We found that @enclave-vm/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.