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

@amail/plugin-host

v0.1.0

Published

Worker-thread sandbox host for AMail plugins. Enforces manifest-declared permissions at the worker boundary.

Downloads

30

Readme

@amail/plugin-host

Worker-thread sandbox host for AMail plugins. Enforces manifest-declared permissions at the worker boundary using Node 24's --permission flag and an in-process ctx_request/ctx_response protocol over MessagePort.

End users rarely import this directly — it's loaded by the AMail runtime to dispatch plugin tools. Plugin authors do import it via the ./testing subpath to drive their integration tests.

Installation

pnpm add -D @amail/plugin-host

Requires Node ≥ 24 (the --permission flag is stable from 24.x).

What's in dist/

  • index.js / index.d.tsPluginHost, bootPlugin, errors
  • worker-entry.mjs — the worker entrypoint that Worker spawns; not a user-facing API
  • testing.js / testing.d.ts — the boot({ pkgRoot, fixtures? }) helper

Testing helpers

import { boot } from "@amail/plugin-host/testing";

const host = await boot({
  pkgRoot: new URL("..", import.meta.url),
  fixtures: { /* AttachmentRef stubs etc. */ },
});

const result = await host.callTool("parse_compliance_csv", { /* ... */ });
await host.shutdown();

The helper hides the ~50 lines of boot boilerplate that Phase 4 flagged as a papercut. It loads plugin.manifest.yaml from pkgRoot, spawns the worker with the declared permissions, and provides an in-process implementation of ctx.attachments, ctx.s3, ctx.llm, and ctx.logger against the fixtures.

Permission enforcement

| Surface | Enforcer | Where | |---|---|---| | Filesystem read/write | Node --permission --allow-fs-read/--allow-fs-write flags computed from manifest paths | Host process spawn args | | Network outbound | fetch wrapped inside the worker; networkAllowsHost check on every URL | Worker process | | Child process spawn | Not granted (--allow-child-process is never set) | Node permission model | | Worker spawn | Granted (workers can spawn nested workers only via Node's API; AMail's plugins are single-worker) | --allow-worker | | Env vars | Only INSTANCE_ID, AMAIL_AGENT_EMAIL, plus permissions.env.required are forwarded | Host filters the spawn env | | S3 / attachments / LLM | No raw SDKs reachable; everything goes through ctx_request round-trip | ctx-server.ts |

The defense in depth is intentional: the SDK shim is the only surface plugin code sees, and the Node permission model blocks the syscalls that would let a plugin escape the shim.

Versioning + breaking changes

Released via Changesets alongside @amail/plugin-sdk. Major bumps follow a 6-month deprecation window with two preview releases (per plan.md #14). Pin to a major in production; the SDK is the contract, the host is the enforcement.

License

MIT — see LICENSE.