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

usrcp-imessage

v0.1.8

Published

iMessage capture+reader adapter for USRCP — macOS-only, shells out to steipete/imsg for chat.db access

Readme

usrcp-imessage

iMessage capture adapter for USRCP. Polls the macOS Messages.app database (~/Library/Messages/chat.db) via steipete/imsg and appends new messages from allowlisted chats as encrypted timeline events in the local USRCP ledger.

macOS-only. Requires Full Disk Access for the binary that runs the adapter (Terminal, iTerm, Node binary, etc.) so it can read chat.db.

Install and run

cd packages/usrcp-imessage
npm install
npm run build
node dist/index.js                  # capture loop
node dist/index.js --reset-config   # re-prompt all config

First run is interactive: walks you through imsg detection, the FDA check, your user handle (phone or email), the chat allowlist, an optional message prefix filter, and an Anthropic API key (used by the companion reader, not capture itself).

Where secrets live

~/.usrcp/imessage-config.json at mode 0600:

{
  "anthropic_api_key": "...",
  "user_handle": "+15551234567",
  "allowlisted_chats": ["chatNNN", "chatMMM"],
  "prefix": "",
  "last_rowid": 123456
}

last_rowid is the high-water mark from chat.db, advanced after each poll so the adapter doesn't re-emit captured messages.

What lands in the ledger

Each iMessage becomes a timeline_events row with:

  • channel_id — the iMessage chat_identifier
  • external_user_id — sender's handle
  • All free-text fields (summary, detail) encrypted under the global key

Stream mode (Phase 6)

When usrcp-stream is installed alongside this adapter, you can choose where captured messages land via --mode:

  • --mode ledger — user-sent messages only (is_from_me=1), written to the local USRCP ledger. Existing behavior.
  • --mode stream — allowlisted, both sides (is_from_me=1 outbound + incoming inbound) flow into the encrypted stream.db. No ledger writes. iMessage has no notion of "bot," so no bot filter applies.
  • --mode both — ledger keeps the is_from_me filter; stream captures both sides on allowlisted chats. Default when usrcp-stream is installed.

If usrcp-stream is not installed, the default is --mode ledger. Passing --mode stream or --mode both without the package installed will error at startup with a message instructing you to install it.

USRCP_PASSPHRASE=… node dist/index.js --mode both

Stream events on the same (surface, channel_ref) within same_channel_window_ms are stitched into one thread by the cross-surface stitcher; see packages/usrcp-stream/README.md for the keyspace, threat model, and recall surface.