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

@writhq/demo

v0.2.0

Published

Writ end-to-end demo CLI — run the full KYA acceptance flow (onboard, mandate, ALLOW/DENY caps, revocation, anonymous block) against the live sandbox with one command: npx @writhq/demo.

Readme

@writhq/demo

Writ — KYA (Know Your Agent). See the whole thing work in one command.

npx @writhq/demo

Runs the full KYA acceptance flow against the live sandbox — no signup, no checkout, no config. It acts as both the principal and the agent, driving real HTTP through a demo brokerage's gated /api/refill and the real requireKYA middleware, and prints a readable transcript. It exits non-zero if any expected outcome fails, so it doubles as a smoke test.

What you'll see (SPEC §6):

  1. Principal onboards + passes sandbox KYC
  2. Registers agent treasury-bot
  3. Issues a mandate: account.refill ≤ $1,000/tx, ≤ $2,500/week @ Northbank
  4. $500 refill → ALLOW (resolved chain + verified receipt + co-signature)
  5. Replay the same assertion → DENY replay
  6. $2,000DENY per_tx_cap
  7. More $500s until the weekly cap → DENY period_cap
  8. Principal revokes → DENY mandate_revoked
  9. Anonymous (no header) → 403 KYA required with an onboarding link

Usage

npx @writhq/demo [command] [options]

| Command | What it does | |---|---| | (default) / live | Run the payment flow against the live sandbox. | | sign | Run the signature authority flow (see below). | | local | Spin up the passport + Northbank services from a repo checkout, run the flow, then tear them down. Prints a clear message if you're not inside a checkout. | | help | Show help. | | version | Print the version. |

Signature authority

npx @writhq/demo sign

The second wedge, same shape. counsel-bot holds one mandate: it may sign NDAs and order forms, up to $50,000 of liability per document and $100,000 a month, at this counterparty only.

  1. Principal onboards + passes sandbox KYC, registers agent counsel-bot
  2. Issues the signing mandate (document classes + liability caps)
  3. Signs a $25,000 NDAALLOW — the counterparty executes the envelope and co-signs; the receipt names the exact document
  4. Replay the same authority → DENY replay
  5. An MSADENY document_class (right agent, wrong kind of paper)
  6. A $75,000 NDADENY per_tx_cap (one document too big)
  7. Two $50,000 order forms → the second DENY period_cap
  8. Principal revokes → DENY mandate_revoked
  9. Anonymous (no header) → 403 KYA required

Writ attests the authority. It never produces the signature — the counterparty's e-signature step still does that — and none of this is a qualified electronic signature (eIDAS/QES).

| Option | Default | Purpose | |---|---|---| | --passport <url> | live sandbox / $PASSPORT_URL | Passport base URL. | | --northbank <url> | live sandbox / $NORTHBANK_URL | Demo brokerage base URL. | | --platform <id> | plt_northbank | Platform id. | | --json | off | Machine-readable JSON result (good for CI). | | --timeout <sec> | 120 | Startup timeout for local mode. |

Examples

npx @writhq/demo                    # live sandbox
npx @writhq/demo --json             # JSON result for CI
npx @writhq/demo local              # from a cloned repo
npx @writhq/demo --passport https://my-passport.example.com \
               --northbank https://my-broker.example.com

JSON output

--json prints one object:

{
  "ok": true,
  "mode": "live",
  "target": { "passport": "...", "northbank": "...", "platform": "plt_northbank" },
  "passed": 11, "failed": 0, "total": 11,
  "checks": [{ "name": "...", "ok": true, "detail": "..." }],
  "ids": { "principal": "prn_...", "agent": "agt_...", "mandate": "mnd_..." }
}

Exit code is 0 on all-pass, non-zero otherwise.

local mode

local runs npm run dev in the repo root it finds by walking up from your current directory, waits for both services to come up, runs the flow against localhost:3000 / localhost:3100, and tears the services down when done. It only works inside a Writ checkout; outside one it tells you so and points you at the default (live) command.

The plt_sk_northbank_dev platform key printed by the demo is an intentionally public sandbox key — it gates a fake brokerage with no real value.

Live sandbox: https://writhq.com · Home (soon): writhq.com

License

MIT © Tundra Industries