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

@spoons-and-mirrors/iam

v0.1.11

Published

Inter-agent messaging for OpenCode parallel subagents

Readme

IAM (Inter-Agent Messaging)

Enable parallel agents communication for opencode

header

How It Works

sequenceDiagram
    participant Parent as Parent Session
    participant A as AgentA
    participant B as AgentB

    Parent->>A: spawn task
    Parent->>B: spawn task

    Note over A,B: Attention mechanism activation

    A->>B: broadcast(message="Doing X")
    Note over B: Get announcement in synthetic tool result


    A->>B: broadcast(send_to="agentB", message="Question?")
    A->>B: broadcast(send_to="agentB", message="Other question?")

    Note over B: Get messages in synthetic tool result

    B->>A: broadcast(reply_to=1, message="Answer!")
    Note over B: Tool result shows source message
    Note over B: Clear message 1 from synthetic

    Note over A: Receives reply

Installation

Add to your OpenCode config:

"plugin": ["@spoons-and-mirrors/iam@latest"]

The broadcast Tool

broadcast(message="...")                     # Send to all agents
broadcast(send_to="agentB", message="...")   # Send to specific agent
broadcast(reply_to=1, message="...")         # Reply to message #1 (auto-wires recipient)

Parameters

| Parameter | Required | Description | | ---------- | -------- | --------------------------------------------------------------- | | message | Yes | Your message content | | send_to | No | Target agent (single agent only) | | reply_to | No | Message ID to reply to - auto-wires recipient to message sender |

Receiving Messages

Messages are injected as a synthetic broadcast tool result. Here's the complete structure:

{
  "tool": "broadcast",
  "state": {
    "status": "completed",
    "input": { "synthetic": true },
    "output": {
      "hint": "ACTION REQUIRED: Announce yourself...",
      "agents": [
        { "name": "agentA", "status": "Working on frontend components" }
      ],
      "messages": [
        {
          "id": 1,
          "from": "agentA",
          "content": "What's the status on the API?"
        },
        {
          "id": 2,
          "from": "agentA",
          "content": "Also, can you check the tests?"
        }
      ]
    },
    "title": "1 agent(s), 2 message(s)"
  }
}
  • input.synthetic: Indicates this was injected by IAM, not a real agent call
  • output.hint: Shown only if agent hasn't announced yet (disappears after first broadcast)
  • output.agents: Other agents and their status (not replyable)
  • output.messages: Messages you can reply to using reply_to

Messages persist in the inbox until the agent marks them as handled using reply_to.

Discovery: Agents discover each other through synthetic injection. The first broadcast call sets the agent's status, which other agents see in the agents array.

Attention Layer

On every LLM fetch, pending inbox messages are injected as a synthetic broadcast tool result at the end of the message chain. The synthetic call has input: { synthetic: true } to indicate it was injected by IAM, not a real agent call.

After injection, the message chain looks like:

  1. system prompt
  2. user message
  3. assistant response
  4. tool calls...
  5. user message
  6. [broadcast] 1 agent(s), 2 message(s) ← injected at end

Example Workflow

# Parent spawns two agents to work on different parts of a feature

AgentA (working on frontend):
  -> broadcast(message="Starting frontend work")
     # Tool result shows: "Available agents: agentB"
  -> ... does work ...
  -> broadcast(send_to="agentB", message="Need the API schema")

AgentB (working on backend):
  -> broadcast(message="Starting backend work")
     # Tool result shows: "Available agents: agentA"
  -> ... sees AgentA's question in inbox ...
  -> broadcast(reply_to=1, message="Here's the schema: {...}")
     # Tool result shows: Marked as handled: #1 from agentA
     # Recipient auto-wired to agentA

AgentA:
  -> ... sees AgentB's response in inbox ...
  -> broadcast(reply_to=1, message="Got it, thanks!")
     # Recipient auto-wired to agentB