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

@zero-ar/tool-kit

v0.5.0

Published

Define and host typed tools for Zero-AR runs.

Downloads

921

Readme

@zero-ar/tool-kit

Define a typed tool once, derive its model-visible schema and serve the same definition through the Zero-AR Tool Host protocol. The development host checks input, output, cancellation and declared cost against that definition.

The handler remains in the tool host. It is not serialized into an agent publication or imported into the runtime server.

The Zero-AR runtime boundary showing replaceable tools outside the W0 Kernel and Quality Plane.

Install

Node.js 24.11.0 through the Node 24 LTS line is required.

npm install @zero-ar/tool-kit @zero-ar/contracts

First working example

Define an observation tool, invoke it through the development host and inspect the same manifest that a publication pins.

import { makeId } from '@zero-ar/contracts';
import {
  defineTool,
  object,
  serveTools,
  string,
} from '@zero-ar/tool-kit';

const archiveSearch = defineTool({
  name: 'archive.search',
  version: '1.0.0',
  description: 'Search the admitted archive and return a source handle.',
  input: object({ query: string(), collection: string() }),
  output: object({ resultRef: string() }),
  operationClass: 'observation',
  isolation: 'process',
  cost: { denomination: 'bytes', maximum: 4_096 },
  execute(input) {
    return { resultRef: `handle:${input.collection}:${input.query}` };
  },
});

const host = serveTools({ tools: [archiveSearch] });
const answer = await host.invoke({
  invoke_id: makeId('ctl'),
  run_id: makeId('run'),
  tool: archiveSearch.name,
  input: { query: 'renewal date', collection: 'contracts-2026' },
});

console.log(archiveSearch.manifest_ref, answer);

An undeclared field or wrong type returns a typed failed answer. It does not reach the handler.

Lists, choices and optional fields

A tool that takes structured input declares it with typed builders, so the model sees the schema and the host refuses a wrong value by its path.

import { array, boolean, enumOf, integer, nullable, object, optional, string } from '@zero-ar/tool-kit';

const stops = object({
  stop: enumOf(['pickup', 'delivery']),
  arrival: string(),
  minutes: integer({ minimum: 0, maximum: 1_440 }),
});

const input = object({
  load_id: string(),
  stops: array(stops, { minItems: 1 }),
  lumper_receipt: nullable(string()),
  lumper_allowed: boolean(),
  note: optional(string()),
});

object lists required fields in the order they are written, the order a model sees and fills them, and leaves out each optional field. A declaration may list its required fields in another order; publication compares them as a set and publishes the declaration's order.

Public surface

  • string, number, integer, boolean, enumOf, array, nullable, optional and object schema builders.
  • defineTool for one typed declaration and handler.
  • serveTools for the development Tool Host protocol.
  • conformance for positive and negative input fixtures.
  • Manifest, request, response and host TypeScript types.

What this does not establish

Defining or serving a tool does not register it with a tenant or grant it authority to change another system. A run can call only an admitted manifest through an admitted host, and only when its budget covers the declared cost. A change to an outside system also needs the separate Effect Plane and a matching grant.

Where to go next