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

@max10240/opencode-plugin-send-message-across-sessions

v1.0.39

Published

Send user-style messages between OpenCode sessions

Readme

@max10240/opencode-plugin-send-message-across-sessions

English | 简体中文

让你的 OpenCode session 互相说话。

真实工作很少能塞进一个目录。你可能一个 session 做前端、一个做后端,或者给不同功能各开一个 worktree。每个 session 都有自己的 上下文,于是你成了传话人:从这边复制发现,贴到那边,反复来回。

这个插件给 Agent 两个和别的 session 通信的工具。它可以列出在线的 session,并按合适的时机发送消息,让并行的工作自己保持同步。

什么时候需要它

  • 前端和后端 session 需要对齐 API 契约。
  • 两个 worktree 在改相关代码,需要共享发现。
  • 一个调研 session 发现了另一个实现 session 需要的信息。
  • 你想把任务交接给另一个项目,又不想复制一大段总结。
  • 你同时跑多个 Agent,希望它们能互相提问。

它能给你什么

  • 发现 session。 Agent 能看到其他在线 session 的标题、工作目录和状态。
  • 像用户一样发消息。 目标 session 收到一条普通消息,带发送方标记,并在自己的上下文里回应。
  • 投递时机可控。 忙着的 session 可以在下一次工具调用后被打断,也可以等当前回合结束。
  • 不用再复制粘贴。 发现、约束和交接直接在 session 之间流动。
  • 几乎不用配置。 加载插件即可。

快速开始

在 server 配置中加载:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["@max10240/opencode-plugin-send-message-across-sessions"]
}

使用 Unicorn 时默认开启:

{
  "plugins": [{
    "package": "@max10240/opencode-plugin-unicorn",
    "options": { "features": { "sendMessageAcrossSessions": true } }
  }]
}

使用

直接用自然语言告诉 Agent:

问一下后端 session,/users 接口的响应结构会是什么样,然后把我们的 client 类型改好。

Agent 会用 list_online_sessions 找到目标,再用 send_message_across_sessions 发送。如果它不知道你指哪个 session,会先把 列表返回给你选择。

list_online_sessions 每页最多返回 20 个 session;列表更大时传 offset 翻页,结果 metadata 包含 total 和下一页 offset。列表由事件维护的内存目录提供,工具执行期间不会查询会话数据库。

投递方式

| 模式 | 行为 | 适合 | | --- | --- | --- | | steer(默认) | 立即送达 | 需要及时协调 | | queue | 等到对方完全空闲;可能很慢,送达时消息可能已过时 | 不要求时效性的消息 |

每次发送都要传 need_reply。需要对方回复时设为 true,消息末尾会带上回复请求,并说明应使用的工具和参数。

注意事项

  • 两个 session 必须在同一个 OpenCode server。 插件只能看到它所在 server 上的 session。
  • “在线”指 server 还知道这个 session。 关闭 TUI/client 不会删除 session,所以它仍可能出现;删除 session 才会移除。 如果删除发生在插件没运行时,storage 里可能留下旧条目,直到被清理或该 session 再次出现。
  • 列表以 server 为准。 直接读取 session.list,所以插件启动前已存在的 session 也会出现;归档 session 会被排除。 running 状态来自 session 的 busy/idle 时间。
  • 短期 storage 缓存会自动清理。 读取权威列表时会删除失效的 online-sessions/ 记录,已删除的 session 不会长期残留。
  • 这是给对等 session 用的,不是给主 Agent 和子 Agent 用的。 父子任务请用 OpenCode 内置的 subagent。
  • 目标收到的是普通用户消息。 没有隐藏通道;这条消息会成为对方对话的一部分。
  • 不需要配置。 加载后直接让 Agent 去问。