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

@vdineshk/trust-provider

v0.1.0

Published

x402 Trust-Provider Interface — behavioral trust scoring for the agent economy. Query 14,800+ MCP servers via Dominion Observatory.

Readme

@dominion/trust-provider

EXPERIMENTAL · PRE-1.0 · NO SUPPORT. Reference implementation of the x402 Trust-Provider Interface v0.1 spec draft. APIs may change between minor versions. No SLA. No support channel. Use at your own risk.

x402 Trust-Provider Interface — behavioral trust scoring for the agent economy.

npm License: MIT

Query 14,800+ MCP servers via Dominion Observatory and gate payments using the x402 Trust-Provider Interface v0.1.

Install

npm install @dominion/trust-provider

Quick start

import { query } from "@dominion/trust-provider";

const result = await query("my-agent-id");

if (result.decision === "PASS") {
  // proceed with payment settlement
} else {
  // block or hold settlement
  console.log(result.reason_code);
}

Usage with x402 beforeSettle

import {
  createObservatoryProvider,
  beforeSettle,
  advisoryHeaders,
  type TrustQuery,
  type BeforeSettleConfig,
} from "@dominion/trust-provider";

// Build query
const trustQuery: TrustQuery = {
  schema: "x402-trust-query-v0.1",
  payer: { agent_id: "requesting-agent" },
  resource: {
    url: "https://api.example.com/data",
    method: "GET",
    amount: { value: "1.00", currency: "USDC", chain: "base" },
  },
  requested_at: new Date().toISOString(),
};

// Configure providers
const config: BeforeSettleConfig = {
  providers: [createObservatoryProvider()],
  policy: { kind: "strict" },
  failureMode: "fail-closed",
  perProviderTimeoutMs: 5000,
};

// Run the gate
const result = await beforeSettle(trustQuery, config);

if (result.decision === "PASS") {
  // Settlement authorized — call facilitator
  const hdrs = advisoryHeaders(result);
  // hdrs = { "X-Trust-Decision": "PASS", "X-Trust-Score": "0.850", ... }
}

API

query(agentId, config?)

One-call trust evaluation. Returns a TrustEvaluation with decision, score, and evidence.

| Param | Type | Default | Description | |-------|------|---------|-------------| | agentId | string | — | Agent identifier to query | | config.baseUrl | string | Observatory URL | Custom provider URL | | config.timeoutMs | number | 5000 | Request timeout |

createObservatoryProvider(config?)

Creates a TrustProvider for use with beforeSettle. Accepts the same config as query.

beforeSettle(query, config)

Full hook implementation. Queries all providers in parallel, applies aggregation policy, returns final decision.

| Config field | Type | Description | |-------------|------|-------------| | providers | TrustProvider[] | Array of trust providers | | policy | AggregationPolicy | strict, quorum, or custom | | failureMode | "fail-closed" \| "fail-open" | Behavior on provider error | | perProviderTimeoutMs | number | Per-provider timeout |

advisoryHeaders(result)

Generates x402 advisory response headers from a BeforeSettleResult.

aggregateStrict(evals) / aggregateQuorum(evals)

Aggregation functions per SPEC.md section 5. Strict requires all PASS; quorum requires majority.

Decision thresholds

| Score range | Decision | Meaning | |------------|----------|---------| | >= 60 | PASS | Trusted — proceed with settlement | | 40–59 | UNCERTAIN | Review band — policy-dependent | | < 40 | FAIL | Untrusted — block settlement |

Wire types

interface TrustQuery {
  schema: "x402-trust-query-v0.1";
  payer: { wallet?: string; agent_id?: string; session_id?: string };
  resource: { url: string; method?: string; amount?: { value: string; currency: string; chain: string } };
  context?: { category?: string; risk_band?: "low" | "medium" | "high" };
  requested_at: string;
}

type TrustDecision = "PASS" | "FAIL" | "UNCERTAIN";

interface TrustEvaluation {
  schema: "x402-trust-evaluation-v0.1";
  provider: string;
  provider_url: string;
  decision: TrustDecision;
  score?: number;
  evidence_uri?: string;
  reason_code?: string;
  ttl_seconds?: number;
  evaluated_at: string;
}

Links

License

MIT