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

@pinet/imessage-bridge

v0.2.0

Published

macOS/iMessage send-first adapter and readiness helpers for pi

Readme

@pinet/imessage-bridge

Thin macOS/iMessage send-first package for the extensions repo.

What this slice does

This package now covers the smallest useful live transport path:

  • adapter-local readiness checks for a local macOS iMessage MVP
  • an AppleScript-backed outbound adapter for send-first delivery
  • transport-local helpers that the shared broker/runtime core can call without burying iMessage logic inside slack-bridge

Current MVP shape

The current implementation is intentionally narrow:

  • macOS only
  • send-first
  • AppleScript delivery through /usr/bin/osascript
  • shared-core delivery via the broker adapter seam
  • local history readiness still modeled against ~/Library/Messages/chat.db

That means outbound sends can work even when the local Messages database is unavailable, while startup/readiness reporting still makes the history blocker explicit.

Trust boundary notes

@pinet/imessage-bridge is an intentional same-host local-power surface.

  • When enabled, outbound sends run through the local Messages app via /usr/bin/osascript as the current macOS user.
  • There is no extra approval or policy layer inside this package today; the trust boundary is local operator intent on the same host.
  • The current MVP is still send-first, so outbound capability can be ready even when local history access is unavailable.
  • Missing chat.db only blocks local history/readiness depth. It does not remove the outbound send power when AppleScript remains available.

Treat this as explicit local outbound power, not as a remote-safe transport or a generic policy-enforced messaging surface.

In the current repo bring-up path, enable the adapter with slack-bridge.imessage.enabled: true and start the broker runtime with /pinet start.

What stays in this package

  • readiness detection
  • canonical local path assumptions for the Messages database
  • AppleScript send helper + adapter-local transport code
  • stable default thread-id helper for send-first bring-up

Publishing

This package is included in the full npm publish set tracked in ../plans/npm-publish.md. Use the GitHub Actions workflow's default dry-run/readiness path for validation; do not publish, tag, or bump versions without explicit maintainer release approval.

What stays out of scope

  • inbound iMessage sync
  • chat database query plumbing
  • generic transport UI redesign
  • WhatsApp or other transport work
  • broad Slack/Pinet separation cleanup beyond the existing broker adapter seam

Example

import {
  createIMessageAdapter,
  detectIMessageMvpEnvironment,
  getDefaultIMessageThreadId,
} from "@pinet/imessage-bridge";

const readiness = detectIMessageMvpEnvironment();
if (readiness.canAttemptSend) {
  const adapter = createIMessageAdapter();
  await adapter.connect();
  await adapter.send({
    threadId: getDefaultIMessageThreadId("chat:alice"),
    channel: "chat:alice",
    text: "hello from pi",
  });
}