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

@tensflare/truss-sdk

v0.1.0

Published

Truss TypeScript SDK — Ed25519 signing and TAP protocol client

Readme

Banner

@tensflare/truss-sdk

TypeScript SDK for the Truss trust infrastructure API — create mandates, record actions, manage agents, and verify evidence.

npm version License CI


What is Truss?

Truss is an accountability layer for AI agents — it records every agent action as a cryptographically signed, tamper-evident audit trail. Learn more →

Features

  • Ed25519 cryptography — Key generation, payload signing, and signature verification via libsodium-wrappers
  • TrussClient — Full-featured HTTP client for the Truss API (mandates, actions, agents, delegations, evidence, alerts, and more)
  • ActionContext — Builder pattern for recording actions with proper chain-of-custody linkage
  • TypeScript-first — Full type coverage derived from TAP schemas

Installation

npm install @tensflare/truss-sdk

Quick start

import {
  generateKeypair,
  signPayload,
  verifySignature,
  TrussClient,
} from "@tensflare/truss-sdk";

// 1. Generate an Ed25519 keypair
const kp = generateKeypair();
console.log("Public key:", kp.publicKey);
console.log("Private key:", kp.privateKey); // keep secret!

// 2. Sign and verify
const sig = signPayload({ action: "read", value: 42 }, kp.privateKey);
const valid = verifySignature({ action: "read", value: 42 }, sig, kp.publicKey);
console.log("Signature valid:", valid); // true

// 3. Create an API client
const client = new TrussClient({ apiKey: "tr_your_api_key" });

// 4. Register an agent
const agent = await client.createAgent({
  name: "My Agent",
  public_key: kp.publicKey,
  description: "My autonomous agent",
});

// 5. Create a mandate
const mandate = await client.createMandate({
  agent_id: agent.id,
  agent_name: agent.name,
  scope: { permitted_actions: ["read", "write"] },
  validity: {
    issued_at: new Date().toISOString(),
    expires_at: new Date(Date.now() + 86400000).toISOString(),
  },
  private_key: kp.privateKey,
});

// 6. Record an action
const ctx = client.action("read", mandate.id, kp.privateKey);
ctx.recordInput({ file: "/data/report.pdf" });
ctx.recordOutput({ summary: "Report contains 42 records" });
const result = await ctx.commit(agent.id, 1, null);
console.log("Action recorded:", result.id);

API reference

generateKeypair()

Returns { publicKey: string, privateKey: string } — Ed25519 keypair via libsodium-wrappers.

signPayload(payload, privateKey)

Signs any JSON-serialisable payload and returns a hex-encoded Ed25519 signature.

verifySignature(payload, signature, publicKey)

Verifies an Ed25519 signature. Returns boolean.

new TrussClient(options)

| Option | Type | Description | |---|---|---| | apiKey | string | Truss API key (tr_ prefix) | | apiUrl | string | API base URL (default http://localhost:4000) |

Client methods: createAgent, getAgent, listAgents, createMandate, getMandate, listMandates, recordAction, getAction, listActions, createDelegation, generateEvidence, verifyEvidence, and more.

client.action(actionType, mandateId, privateKey)

Returns an ActionContext builder with .recordInput(), .recordOutput(), and .commit().

Related packages

| Package | Description | |---|---| | @tensflare/tap | Core Zod schemas for mandates, actions, and delegations | | @tensflare/cli | Command-line interface for the Truss API | | truss-sdk (Python) | Python SDK equivalent |

Development

npm install
npm run build
npm test

Contributing

Pull requests are welcome. Please see the contribution guidelines.

License

Apache 2.0 — see LICENSE.