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

@sudp-protocol/requester

v0.1.1

Published

Requester-side SUDP types and operation builders. Wire-shape only — no crypto, no HTTP, no framework adapters.

Readme

@sudp-protocol/requester

Wire-shape types and operation builders for the SUDP Requester role.

The Requester R is the autonomous agent (LLM tool runtime, automated job) that proposes a secret-backed operation o to the Custodian and relays the resulting Grant. SUDP's threat model assumes R can be fully compromised — so this package ships only the protocol-shape glue R needs and no security-critical code.

Scope (this is on purpose)

What's in:

  • TypeScript types for Operation, Act, Bind, Valid, RecipientPk, Grant, GrantOpt, ActType, Multiplicity, BatchOperations, BatchGrant — matching the Rust crate's wire layout one-to-one.
  • Builders: useOp, exportOp, writeOp, rotateOp, enrollOp, revokeOp, customOp — each returns a plain Operation object with sensible defaults (iat = now, multiplicity = "one", scope = {}).
  • Batch helpers: batchOps([...]) — validates the array (non-empty, ≤ 1 rotation-class op per batch) and returns the wire-shape BatchOperations.
  • Structural validators: validateOperation, validateGrant, validateBatchOperations, validateBatchGrant, plus isBuiltinActType / isRotationClassActType predicates.

What's not in, and why:

| Not included | Reason | |--------------|--------| | HTTP / RPC client | SUDP does not define an on-the-wire transport. Build your own fetch / gRPC / Bun.serve / etc. on top of these types. | | Canonical JSON, β, key derivation | R does no crypto. That all lives on the Authorizer side — see @sudp-protocol/authorizer. | | LangChain / OpenAI / Anthropic adapters | Per-framework, per-deployment. Trying to be all of them at once means being none of them well. | | Polling helpers / status enums | A polling shape implies a wire spec. SUDP intentionally has no normative wire spec yet. |

This is a deliberate package constitution. If you want one of the above, write your own package on top of @sudp-protocol/requester — do not grow this one.

Usage sketch

import { useOp, exportOp } from "@sudp-protocol/requester";

// 1) Build an operation in your tool-call adapter.
const op = useOp({
  target: "env.api_key",
  redeemer: "custodian.example.com",
  scope: { request_id: "abc-123" },
});

// 2) Submit to the Custodian over your chosen transport.
//    (This package does NOT supply `fetch` — that's deployment glue.)
const resp = await fetch("https://custodian.example.com/use", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ o: op }),
});

// 3) Authorization (β computation + signing + W_c derivation) happens
//    at the Authorizer — see @sudp-protocol/authorizer for that side.
// 4) The Grant the Authorizer produces flows back to T; R sees only the
//    final response ρ.

const result = await resp.json();

For an Export operation (recipient is required by the protocol):

import { exportOp } from "@sudp-protocol/requester";

const op = exportOp({
  target: "env.api_key",
  redeemer: "custodian.example.com",
  recipient: {
    alg: "hpke-p256-sha256-aes128gcm",
    bytes: bytesToB64(recipientPubKey),
  },
});

For a custom (profile-defined) act type:

import { customOp } from "@sudp-protocol/requester";

const op = customOp("co-sign", {
  target: "wallet.eth_main",
  redeemer: "custodian.example.com",
  scope: { tx_hash: "0x..." },
});
// The Custodian's deployment is responsible for dispatching "co-sign".
// sudp's built-in execute_use / execute_export / execute_lifecycle
// reject custom types with ActTypeMismatch.

For a batch (multiple operations under one Authorizer signature):

import { batchOps, useOp, writeOp } from "@sudp-protocol/requester";

const ops = batchOps([
  useOp({ target: "env.api_key", redeemer: "T" }),
  useOp({ target: "env.refresh_token", redeemer: "T" }),
  writeOp({ target: "env.last_used", scope: { v: "now" }, redeemer: "T" }),
]);
// `ops` is wire-ready as a JSON array. SUDP rejects batches with more
// than one rotation-class operation (`write` / `rotate` / `enroll` /
// `revoke`); `batchOps` enforces this client-side so you fail fast.

End-to-end protocol walkthrough

Runnable three-process demo over HTTP showing where the Requester sits relative to the Authorizer and Custodian: ../../examples/protocol-demo/.

Status

Pre-1.0, alongside @sudp-protocol/authorizer and the Rust custodian crate. Wire-shape changes will ripple to all three.

License

Apache-2.0. See LICENSE.