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

@dadieng/sdk

v0.1.0

Published

Local-first security SDK and shared immune system for AI agents.

Readme

@dadieng/sdk

The Dadieng SDK intercepts model and tool lifecycle events, normalizes them into validated Dadieng events, evaluates local Defense Modules, and creates privacy-safe Threat Receipts for blocked or observed incidents.

Quick start

import { createDadieng } from "@dadieng/sdk";

const dadieng = createDadieng({
  agentId: "agent_001",
  framework: "my-agent",
  channel: "stable",
  mode: "enforce",
  failMode: "last-known-good",
  evidenceEncryption: {
    key: await loadEvidenceKey(), // exactly 32 bytes from your secret manager
    keyId: "tenant-evidence-key-v1",
  },
});

dadieng.onDecision((decision) => {
  console.log(decision.outcome, decision.reasonCodes);
});

dadieng.onIncident((receipt, _decision, encryptedEvidence) => {
  // Publish only the receipt. Store the opaque envelope in private storage.
  console.log(receipt.evidence.hash);
  void storePrivateEvidence(receipt.evidence.encryptedUri, encryptedEvidence);
});

const result = dadieng.afterToolResult({
  tool: "external-report-reader",
  result: toolResult,
  source: {
    type: "mcp_tool_result",
    identity: "external-report-reader",
    trustZone: "untrusted",
  },
  capability: {
    name: "filesystem.write",
    impact: "high",
  },
});

if (result.decision.outcome === "BLOCK") {
  throw new Error("Dadieng blocked the tool result");
}

Lifecycle hooks

  • beforeModel() — inspect model input.
  • afterModel() — inspect model output.
  • beforeToolCall() — inspect a proposed tool call and arguments.
  • afterToolResult() — inspect data returned by a tool or MCP server.
  • onDecision() — subscribe to every local decision.
  • onIncident() — receive a sanitized receipt and its encrypted private evidence envelope.

Decision and incident listener failures are isolated from enforcement. Diagnostics remain available through getDiagnostics().

If evidenceEncryption is omitted, the SDK creates an in-memory ephemeral key. Production adopters should supply a managed 32-byte key so encrypted evidence remains recoverable. Reporter agent IDs are hashed by default; set publishReporterAgentId: true only when public attribution is intentional.

Failure behavior

  • open: allow when evaluation fails.
  • closed: block when evaluation fails.
  • last-known-good: block high/critical capabilities and observe low/medium capabilities if local evaluation fails.

Stable channel synchronization

Configure a trusted manifest signer and the deployed Monad Registry, then synchronize before serving agent traffic:

import {
  FileSystemManifestCache,
  ManifestSynchronizer,
  createDadieng,
  createManifestChainReader,
} from "@dadieng/sdk";

const synchronizer = new ManifestSynchronizer({
  manifestUrl: "https://api.dadieng.dev/v1/channels/stable/manifest",
  signerAddress: "0x...trustedManifestSigner",
  chainId: 10143,
  registryAddress: "0x...registry",
  sdkVersion: "0.1.0",
  adapters: ["mcp"],
  failMode: "last-known-good",
}, createManifestChainReader("https://testnet-rpc.monad.xyz", 10143), undefined,
new FileSystemManifestCache("./.dadieng/cache/stable.json"));

const dadieng = createDadieng({
  agentId: "agent_001",
  framework: "my-agent",
  manifestSynchronizer: synchronizer,
});

await dadieng.syncDefenses();

The SDK verifies the EIP-191 signature, expiry, manifest lineage, artifact hashes, compatibility declarations, current Monad Stable state and commitments, and the complete shadow suite before replacing the active local rules. The file cache retains current and previous verified sets with owner-only permissions. On refresh failure, last-known-good restores the cached set, closed rejects the refresh, and open leaves the existing engine unchanged.