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

@sagemindai/threadline-core

v0.1.2

Published

Threadline's agent-to-agent fundamentals with no framework attached: identity keys, end-to-end encrypted and signed envelopes, pairing by invite, pinned keys and the credential gate. Used by threadline-mcp and Instar.

Readme

threadline-core

Threadline's agent-to-agent fundamentals, with no framework attached. ESM only (import, not require), Node 20 or later. It's used by threadline-mcp (any agent, through MCP) and by Instar, so both speak exactly the same protocol and can pair with each other.

What's in it:

  • Identity: Ed25519 keys; an agent's fingerprint is the first 16 bytes of its key.
  • Encrypted, signed envelopes: X25519 (derived from the identity key) with HKDF and XChaCha20-Poly1305, and an Ed25519 signature over the canonical envelope. Byte-compatible with Instar, which the tests prove against vectors generated by Instar's own code. What this gives: confidentiality and sender authentication. What it does not give: forward secrecy against the recipient's key. Each message uses a fresh ephemeral key, but it is combined with the recipient's long-term key, so whoever later obtains that key can decrypt every past message recorded for it. The envelope also does not stop replay by itself; callers keep a message-id ledger (threadline-mcp does, plus a freshness window for credentials).
  • Pairing by invite: one person sends an invite privately, the other person approves it, and the first person finishes. The accept carries a MAC under a one-time secret and a signature, and both sides check keys against the relay's public card. If an invite is used twice, the first acceptor is paused and one alarm is raised.
  • Pinned keys: PinnedKeyStore, a 0600 file that never swaps a verified key.
  • Pinning: the full 32-byte identity key is stored and compared, and small-order or non-canonical keys are refused (isAcceptableIdentityKey). A pin also carries encryptedSeenAt, the first time that peer sent encrypted chat, after which plaintext in its name is refused.
  • The credential gate: credentialSendKey allows a secret only to a mutual-verified peer whose pairing still matches your current key, and returns the only key it may be encrypted to (derived from the pinned identity, never one the relay supplied). credentialAcceptFrom gates what you receive, with the same key-binding check when you pass your own key.
  • Safe stores: a store file that is not valid JSON is moved aside and reported, never overwritten; one that cannot be read stops the store from starting.

What it leaves to you: EnvelopeCrypto.decrypt checks the signature, the key binding and the ciphertext. Checking that the envelope is addressed to you (to), how old it is, and whether you have seen it before (replay) is the caller's job; threadline-mcp does the replay check by sender and message id.

The person, never the agent, approves pairing. How they're asked is up to the host: Instar uses its dashboard and Telegram buttons, and threadline-mcp uses MCP elicitation.

Spec: docs/specs/threadline-standalone-pairing.md in the Instar repository.