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

@openvtc/trust-tasks-capability-client

v0.1.0

Published

Client-side wire helpers for the capability Trust Task families (governance/capability/* and git-trust/*): document builders and reply classification, no crypto.

Readme

@openvtc/trust-tasks-capability-client

Client-side wire helpers for the capability Trust Task families — governance/capability/* (enable / disable / list a community capability) and git-trust/* (grant / revoke commit-signing trust).

This package owns the documents, not a transport: it builds request documents, parses inbound envelope replies, and classifies them. A capability producer (a community service) and a management UI share this wire layer, so they cannot drift on the contract. Zero runtime dependencies beyond @openvtc/trust-tasks; it is the TypeScript port of the Rust trust-tasks-capability-client crate.

Signing is deliberately not here. Attach a Data Integrity proof with @openvtc/trust-tasks-proof over the document minus its proof member (eddsa-jcs-2022), so this package stays free of any crypto dependency.

Install

npm install @openvtc/trust-tasks-capability-client

Build a request, hold its thread, act on the reply

import {
  buildGitTrustGrant,
  correlationThread,
  classifyGitTrustReply,
} from "@openvtc/trust-tasks-capability-client";

const doc = buildGitTrustGrant(authorityDid, registryDid, subjectDid, "openvtc");
const thread = correlationThread(doc); // hold this from the moment you send

// ...sign `doc`, send it over your transport, receive an envelope body...

const outcome = classifyGitTrustReply(replyDoc, thread);
switch (outcome?.kind) {
  case "success":
  case "idempotentSuccess": // already_granted / not_granted — the end state holds
    // the write is done
    break;
  case "rejected":
    console.error(outcome.code, outcome.message);
    break;
  case undefined:
    // not an answer to this request — keep waiting
    break;
}

Retries vs. new attempts

A retry is a bit-for-bit resend of the same document (same id); the consumer's SPEC §7.2 item-11 record absorbs it and returns the first outcome. A new attempt is a different document — anything that changes the bytes, including a re-stamped issuedAt or a re-signed proof, makes it one — and MUST carry a fresh id. Use newAttempt(previous) for that (it clears proof and re-stamps issuedAt); reusing an id with altered content is rejected with idConflict.

Governance management UIs

import { buildListDocument, correlationThread, parseEnvelopeReply } from "@openvtc/trust-tasks-capability-client";

const list = buildListDocument(myDid, vtcDid);
const thread = correlationThread(list);
// ...on an inbound envelope body:
const reply = parseEnvelopeReply(body, thread);
if (reply?.kind === "listing") render(reply.entries); // CapabilitySummary[]

Idempotent success (git-trust) and every classification are keyed on the SPEC §8.5 extended error code, never on the non-normative free-text message.