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

@agentproto/computer-api

v0.4.0

Published

@agentproto/computer-api — versioned public contract for the computer controller HTTP API: zod schemas and inferred types for create/get/exec/suspend/resume/rm of computers, published ports, status and the error envelope.

Readme

@agentproto/computer-api

Versioned public contract for the computer controller's HTTP API (POST/GET/DELETE /v1/computers...): zod schemas plus inferred types for every request body, response body, the error envelope, computer states and published ports.

Generic and deployment-independent: no host names, no IPs, no tenant names, no deployment specifics. Template ids are an OPEN string (any id a controller has registered); controller error strings are also open.

Design rules

  • MINIMAL: only fields a client actually consumes are declared.
  • Passthrough everywhere: a controller adding fields never breaks an older client.
  • Read-tolerant computer states: unknown future states bucket under "unknown" instead of throwing.
  • Synchronous, no-throw status reads: the state transform is a widening map, not an enum validator.

Versioning

COMPUTER_API_VERSION (currently "v1") is the API version the schemas describe. A major bump of this package is where that constant changes.

Endpoints covered

| Method | Route | Request schema | Response schema | | ------ | ---------------------------- | --------------------------- | ---------------------------- | | POST | /v1/computers | createComputerRequestSchema | createComputerResponseSchema | | GET | /v1/computers/:id | - | computerStatusSchema | | POST | /v1/computers/:id/exec | execRequestSchema | execResponseSchema | | POST | /v1/computers/:id/suspend | - | suspendResponseSchema | | POST | /v1/computers/:id/resume | - | resumeResponseSchema | | POST | /v1/computers/:id/attach | attachRequestSchema (optional body) | sessionsResponseSchema | | POST | /v1/computers/:id/detach | attachRequestSchema (optional body) | sessionsResponseSchema | | DELETE | /v1/computers/:id | - (?force=true optional) | suspendResponseSchema shape (all-optional) | | any | error body | - | errorResponseSchema |

Contract tests

src/__tests__/fixtures.ts carries a valid and an invalid fixture per payload; contract.test.ts pins them. The fake controller used by @agentproto/sandbox-computer validates everything it emits against the same schemas, so the test double cannot drift from the published contract.

Notes

  • Sessions: maxSessions on create sizes the computer for that many concurrent sessions. attach takes a slot (409 at the cap; an attach by a holder that already holds a slot is idempotent: 200 with the count unchanged), detach releases one (floors at 0), and DELETE answers 409 while sessions are attached unless ?force=true is passed.
  • resume MAY rename the computer: the controller can restore the suspend snapshot into a fresh computer under a NEW generated id and answer { id: <new>, state: "running" }. Callers must treat the old id as gone and adopt the returned id.
  • Egress is deny-by-default: a computer created without an egress.allow list has no DNS.