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

@hanzo/zap

v1.0.0

Published

ZAP — Zero-copy Agent Protocol. Hanzo-branded wrapper over @zap-proto/zap.

Downloads

43

Readme

@hanzo/zap

Zero-copy Agent Protocol (ZAP) SDK for TypeScript/JavaScript.

1000x faster than MCP/JSON-RPC through binary wire protocol with zero-copy serialization.

Installation

npm install @hanzo/zap
# or
pnpm add @hanzo/zap

Quick Start

Client

import { ZapClient } from '@hanzo/zap';

// Connect to a ZAP server
const client = await ZapClient.connect('zap://localhost:9999');

// List available tools
const tools = await client.listTools();
console.log('Tools:', tools.map(t => t.name));

// Call a tool
const result = await client.callTool('read_file', { path: 'README.md' });
console.log('Content:', result.content);

// Batch multiple calls
const results = await client.batch([
  { name: 'read_file', args: { path: 'package.json' } },
  { name: 'git_status', args: {} },
]);

// Clean up
await client.close();

Server

import { ZapServer } from '@hanzo/zap';

const server = new ZapServer({
  name: 'my-tools',
  version: '1.0.0',
});

// Register a tool
server.registerTool({
  name: 'greet',
  description: 'Greet someone by name',
  inputSchema: {
    type: 'object',
    properties: {
      name: { type: 'string', description: 'Name to greet' },
    },
    required: ['name'],
  },
  handler: async ({ name }) => `Hello, ${name}!`,
});

// Start server
await server.listen(9999);
console.log('ZAP server listening on port 9999');

Wire Protocol

ZAP uses a simple length-prefixed binary format:

+----------+----------+------------------+
| Length   | MsgType  | Payload          |
| (4 bytes)| (1 byte) | (variable)       |
| LE u32   |          | JSON             |
+----------+----------+------------------+

API

ZapClient

  • ZapClient.connect(url) - Connect to server
  • client.listTools() - List available tools
  • client.callTool(name, args) - Call a tool
  • client.batch(calls) - Call multiple tools
  • client.ping() - Check connection
  • client.close() - Close connection

ZapServer

  • new ZapServer({ name, version }) - Create server
  • server.registerTool({ name, description, inputSchema, handler }) - Register tool
  • server.listen(port, options) - Start listening
  • server.close() - Stop server

Policies

import { ApprovalPolicy, SandboxPolicy } from '@hanzo/zap';

// Approval policies (when to ask for human approval)
ApprovalPolicy.UnlessTrusted  // Only auto-approve known-safe reads
ApprovalPolicy.OnFailure      // Auto-approve, escalate on failure
ApprovalPolicy.OnRequest      // Model decides (default)
ApprovalPolicy.Never          // Never ask

// Sandbox policies
const sandbox: SandboxPolicy = {
  mode: 'workspace-write',
  writableRoots: ['/home/user/project'],
  networkAccess: true,
};

License

MIT - Hanzo AI Inc.