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

opencode-agentmesh

v0.1.1

Published

Peer-to-peer messaging between opencode agents running in different sessions, directories and servers

Readme

opencode-agentmesh

npm version license

Peer-to-peer messaging between opencode agents running in different sessions, directories, or even different servers.

It's a plugin, not an MCP server, not an app. There is no daemon, no port, and no config server to run — coordination happens entirely through a shared directory on disk. Install it, and any two opencode sessions that load it can discover each other and exchange messages, whether they're two terminals on your laptop or two sessions on different machines pointed at the same shared folder.

Why

If you run multiple opencode sessions side by side — one per repo, one per service, one for planning and others for implementation — they have no way to coordinate. opencode-agentmesh gives each session three tools so they can find each other and talk, without you copy-pasting between terminals.

Install

Add it to your opencode.json (global ~/.config/opencode/opencode.json or per-project):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "opencode-agentmesh"
  ]
}

opencode installs npm plugins automatically at startup — there is nothing to npm install yourself. To pin a fixed agent id or tune the defaults, use the tuple form:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "opencode-agentmesh",
      {
        "id": "api-gateway"
      }
    ]
  ]
}

How it works

Every session that loads the plugin registers itself on the mesh the moment you send your first message, and gets three tools:

| Tool | Purpose | |----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | agentmesh_register | Publish this agent's id, description, and metadata so peers can find it. Called automatically; call it again to update your description or change your id. | | agentmesh_peers | List every agent on the mesh right now: id, description, metadata, alive/stale status, last seen, directory. | | agentmesh_send | Send one message to a peer by id. It's injected into that peer's own opencode session as a new user turn. |

A message sent to a peer that's offline just waits — the recipient's own plugin instance watches its inbox and delivers the message the moment it comes back online. Sending never blocks on the recipient being reachable.

[agentmesh] from: planner | 2026-08-27T09:12:03Z | msg: agm_01… | re: T-001
review src/auth.ts please
(end of agentmesh message; to reply, call agentmesh_send with to "planner")

That's what shows up as a new turn in the recipient's session — no polling, no manual relay.

No daemon, just files

Every agent's plugin instance coordinates through one shared home directory (default ~/.local/share/opencode-agentmesh, or $XDG_DATA_HOME/opencode-agentmesh):

<home>/agents/<id>.json         one record per agent, written only by its owner
<home>/inbox/<id>/<msgid>.json  queued messages for <id>, written by senders
<home>/acks/<msgid>.json        delivery confirmation, written by the recipient

Each agent only ever writes its own record and its own acks, and a sender only ever writes into the recipient's inbox — so there is nothing to lock. Liveness is a heartbeat (file mtime) plus a process check, so a killed opencode shows up as stale immediately rather than lingering.

If your agents run on different machines, point AGENTMESH_HOME (see below) at a directory synced or shared between them (e.g. a network mount).

Configuration

Options can be passed via the plugin tuple, and every one has an environment variable that overrides it (env > plugin options > defaults):

| Plugin option | Env var | Default | Description | |-----------------------|-----------------------------------|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------| | id | AGENTMESH_ID | derived from the worktree directory name | Fixed agent id for this project. | | home | AGENTMESH_HOME | $XDG_DATA_HOME/opencode-agentmesh or ~/.local/share/opencode-agentmesh | Mesh home directory. | | autoRegister | AGENTMESH_AUTO_REGISTER | true | Register automatically on the first user message. | | injectSystemPrompt | AGENTMESH_INJECT_SYSTEM_PROMPT | true | Append the mesh protocol explanation to the system prompt. | | heartbeatIntervalMs | AGENTMESH_HEARTBEAT_INTERVAL_MS | 15000 | How often a registered agent refreshes its liveness. | | staleAfterMs | AGENTMESH_STALE_AFTER_MS | 60000 | No heartbeat for this long → agent shows as stale. | | expireAfterMs | AGENTMESH_EXPIRE_AFTER_MS | 300000 | No heartbeat for this long → agent's record is dropped entirely. | | ackWaitMs | AGENTMESH_ACK_WAIT_MS | 3000 | How long agentmesh_send waits for delivery confirmation before returning queued. | | pollIntervalMs | AGENTMESH_POLL_INTERVAL_MS | 2000 | Inbox poll interval, as a fallback for missed filesystem events. | | maxTextLength | AGENTMESH_MAX_TEXT_LENGTH | 8000 | Maximum message body length, in characters. |

AGENTMESH_DEBUG=1 enables info-level logging to stderr.

Requirements

  • opencode
  • Node.js >= 22 (only matters if you're developing the plugin itself; end users just add it to opencode.json)

Development

npm install
npm run typecheck   # tsc --noEmit
npm test            # node --test on test/*.test.ts
npm run build        # emits dist/

See AGENTS.md for architecture notes and conventions if you're contributing.

License

MIT © Abdulkadir Polat