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

soma-heart

v1.0.0

Published

The Soma trust machine for AI agents — one package: execution heart (HMAC, birth certs, heartbeat chain, credential rotation, human-consent session mode) + sensorium (temporal fingerprinting, behavioral landscape, phenotype atlas) + MCP middleware.

Downloads

199

Readme

soma-heart

The Soma trust machine for AI agents — one package, everything.

Execution heart (runner) + sensorium (observer) + MCP middleware, unified in a single install. The heart is the beating core of the Soma protocol: every function — identity, signing, heartbeat chain, birth certificates, credential rotation, session-mode consent ceremonies, phenotypic verification — runs through it.

Part of the Soma protocol. Read the paper.

Install

npm install soma-heart

Previously Soma shipped as two packages (soma-heart + soma-sense). As of 0.3.0 they are unified under soma-heart. The soma-sense package is deprecated — import from soma-heart/sense instead. See CHANGELOG.md.

Usage — runner

import { createSomaHeart } from 'soma-heart';
import { createGenome, commitGenome } from 'soma-heart/core';

const genome = createGenome({
  modelProvider: 'anthropic',
  modelId: 'claude-sonnet-4',
  modelVersion: '1.0.0',
  systemPrompt: 'You are a helpful assistant',
  toolManifest: 'search,database',
  runtimeId: 'my-agent',
  cloudProvider: 'aws',
  region: 'us-east-1',
  deploymentTier: 'tier1',
});

const commitment = commitGenome(genome, signingKeyPair);

const heart = createSomaHeart({
  genome: commitment,
  signingKeyPair: keyPair,
  modelApiKey: process.env.ANTHROPIC_API_KEY,
  modelBaseUrl: 'https://api.anthropic.com/v1',
  modelId: 'claude-sonnet-4',
});

const stream = heart.generate({ messages: [...] });
const toolResult = await heart.callTool('database', args, executor);
const data = await heart.fetchData('market-api', 'query', fetcher);

Usage — observer (sense)

import { withSomaSense } from 'soma-heart/sense';

const transport = withSomaSense(new StdioServerTransport(), {
  profileStorePath: '.soma/profiles',
  onVerdict: (sessionId, verdict) => {
    if (verdict.status === 'RED') denyAccess(sessionId);
  },
});

await server.connect(transport);

Subpath exports

| Import path | What | | -------------------------------- | ------------------------------------------------------------------------------------------------ | | soma-heart | createSomaHeart, HeartRuntime, BirthCertificate, heartbeat chain, delegation, session mode | | soma-heart/core | createGenome, commitGenome, genome types | | soma-heart/credential-rotation | 12-invariant credential rotation controller + Ed25519 identity backend | | soma-heart/crypto-provider | Pluggable crypto provider (Ed25519 / X25519 / HKDF primitives) | | soma-heart/sense | withSomaSense, sensorium entry — phenotypic verification | | soma-heart/senses | Individual sense modules (temporal, topology, vocabulary, …) | | soma-heart/atlas | Phenotype atlas reference classifier | | soma-heart/mcp | MCP middleware (withSoma, Soma transport, profile store) | | soma-heart/signals | Shared signal primitive types |

Tree-shaking is free: import only the subpath you need and your bundler drops everything else.

What it does

Runner (heart)

  • Per-token HMAC authentication — every token carries cryptographic proof it passed through this heart
  • Dynamic seed generation — continuous behavioral parameter space (HKDF-derived) makes enumeration infeasible
  • Heartbeat chain — tamper-evident hash chain recording every computational step
  • Birth certificates — co-signed data provenance for hearted-to-hearted flows
  • Credential vault — API keys and tool credentials are only accessible through generate / callTool / fetchData
  • Credential rotation — 12-invariant controller with KERI pre-rotation and pluggable backends. Historical verifiers call lookupHistoricalCredential(identityId, key) to resolve a past credentialId or publicKey against the retained event chain and receive its effectiveFrom / effectiveUntil window. RotationEvent.effectiveAt annotates when witness made an event effective (post-hoc, excluded from rotation hash/signing). Snapshot persistence is first-class: SNAPSHOT_VERSION and ControllerSnapshot are exported for durable round-trip, and restore() fails closed on any other version.
  • Session mode — signed human-consent envelope binding agent ephemeral DID to a human durable DID under a bounded capability envelope

Observer (sense)

  • Temporal fingerprint (5× weight) — 22 features including conditional timing surface. 100% local, 93.2% cloud accuracy.
  • Topology fingerprint (2× weight) — response structure patterns
  • Vocabulary fingerprint (1× weight) — word choice distribution
  • Phenotype atlas — memoryless reference classifier that catches slow drift at 55% interpolation
  • Behavioral landscape — multi-dimensional identity map that catches sudden swaps
  • Verdict engine — GREEN / AMBER / RED / UNCANNY

Inverted verification model

The agent runs the heart, the observer runs the sense. The agent does not verify itself — self-verification is self-attestation, not cryptographic proof. The unified package ships both sides so integrators can install one dependency and wire whichever half they own.

ClawNet demonstrates this pattern: ClawNet runs the heart on its orchestrator and exposes soma-heart/sense over MCP for any caller who wants to verify. ClawNet makes itself verifiable — it doesn't claim to have verified itself.

ClawNet (imports soma-heart)       Your Agent (imports soma-heart/sense)
┌─────────────────────┐            ┌─────────────────────┐
│  heart.generate()   │  Encrypted │  Temporal fingerprint│
│  heart.fetchData()  │◄──Channel─►│  Behavioral landscape│
│  Per-token HMACs    │  (X25519)  │  Verdict: GREEN/RED  │
└─────────────────────┘            └─────────────────────┘

Verdicts from independent observers are submitted to ClawNet's public verdict API (POST /v1/soma/verdicts) and anchored on-chain via Merkle trees — creating a public, immutable verification history for any agent.

License

MIT