agent-comm-hub 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -6
- package/README.zh.md +42 -5
- package/agents/SKILL.md +3 -1
- package/agents/registry.json +201 -0
- package/assets/ach-cn.png +0 -0
- package/assets/ach-en.png +0 -0
- package/lib/cli.js +347 -98
- package/lib/index.js +18 -5
- package/lib/setup.js +219 -69
- package/package.json +44 -46
package/README.md
CHANGED
|
@@ -84,6 +84,7 @@ Task Scheduler on Windows) — or the built-in one-shot auto-start:
|
|
|
84
84
|
```bash
|
|
85
85
|
agent-comm-hub service install # Windows: HKCU Run + hidden launcher (no admin)
|
|
86
86
|
# Linux: systemd --user unit, enabled
|
|
87
|
+
# macOS: launchd LaunchAgent
|
|
87
88
|
agent-comm-hub service uninstall # undo
|
|
88
89
|
agent-comm-hub status # is the hub up? who is online?
|
|
89
90
|
```
|
|
@@ -98,13 +99,19 @@ itself).
|
|
|
98
99
|
agent-comm-hub setup
|
|
99
100
|
# or: agents/install-all.ps1 (PowerShell equivalent)
|
|
100
101
|
# undo: agent-comm-hub setup --remove
|
|
102
|
+
# list what is installed (no changes): agent-comm-hub discover
|
|
103
|
+
# configure a single agent: agent-comm-hub setup --agent codex
|
|
101
104
|
```
|
|
102
105
|
|
|
103
|
-
`setup`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
`setup` **discovers** which agents are installed on this machine (PATH
|
|
107
|
+
commands, config paths, npm global packages — no shell, cross-platform) and
|
|
108
|
+
merges the `agent-hub` MCP entry into each one's config (mcode, opencode, Kimi
|
|
109
|
+
Code, Gemini CLI, Codex, zcode, DSH, claude-desktop on macOS), plus the English
|
|
110
|
+
skill into `~/.agents/skills/` (the cross-agent standard) and each agent's
|
|
111
|
+
private skills dir. Which agents are supported is declared in
|
|
112
|
+
[`agents/registry.json`](agents/registry.json) — adding a new agent is one
|
|
113
|
+
registry record, no code change. Only the `agent-hub` key is touched, every
|
|
114
|
+
file is backed up first, and re-running is a no-op. Claude Code's MCP config
|
|
108
115
|
stays manual (see below).
|
|
109
116
|
|
|
110
117
|
**Registration is automatic**: once an agent session starts, the MCP handshake
|
|
@@ -302,7 +309,7 @@ agent-comm-hub service install|uninstall [options] one-shot auto-start
|
|
|
302
309
|
--port <n> Listen port (default 18764)
|
|
303
310
|
--path <p> MCP endpoint path (default /mcp)
|
|
304
311
|
--max-queue <n> Queued messages per peer before dropping oldest (default 200)
|
|
305
|
-
--history-limit <n> Retained history messages (default
|
|
312
|
+
--history-limit <n> Retained history messages (default 1000)
|
|
306
313
|
--wait-timeout-ms <n> Long-poll ceiling for bridge_wait (default 60000)
|
|
307
314
|
--default-wait-ms <n> bridge_wait default budget (default 30000)
|
|
308
315
|
--connected-window-ms <n> Peer counts as active within this window (default 30000)
|
|
@@ -390,6 +397,36 @@ pnpm run build # esbuild → lib/{cli,index,setup}.js (zero deps)
|
|
|
390
397
|
pnpm pack # build + npm pack (publishing artifact)
|
|
391
398
|
```
|
|
392
399
|
|
|
400
|
+
## Desktop GUI
|
|
401
|
+
|
|
402
|
+
A companion desktop GUI is shipped as a separate npm package: **`agent-comm-hub-app`**. It is a standalone Tauri 2 + React app, lives in `app/`, and depends on the MCP HTTP API rather than on this package's source. It does NOT relax the `dependencies: {}` constraint of the main package — workspace isolation is enforced via `app/pnpm-workspace.yaml`.
|
|
403
|
+
|
|
404
|
+
| English | 简体中文 |
|
|
405
|
+
|---|---|
|
|
406
|
+
|  |  |
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
cd app
|
|
410
|
+
pnpm install
|
|
411
|
+
pnpm tauri:dev # dev with hot reload
|
|
412
|
+
pnpm tauri:build # produces NSIS / MSI / dmg / AppImage / deb installers
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
Highlights:
|
|
416
|
+
|
|
417
|
+
- **Hub lifecycle in one window**: auto-spawn on launch (4-tier PATH fallback), start / stop / restart, live log panel with stderr filter + expandable viewer, and an external-hub reuse mode with health probing
|
|
418
|
+
- **Real-time messaging**: `bridge_wait` long-poll keeps the UI live; optimistic send shows your messages instantly; `/history` merges hub memory with the SQLite archive (survives hub restarts)
|
|
419
|
+
- **Peer conversations** (PRD US-2): click any peer to view its full conversation, not just yours; unread badges per peer
|
|
420
|
+
- **Message details**: raw JSON view, task prompt/context/deliverable, ack state-machine timeline
|
|
421
|
+
- **Slash commands**: `/peers /broadcast /history /clear /help` — from the palette or typed directly
|
|
422
|
+
- **Markdown rendering** with rehype-sanitize, multi-peer cc, drag-drop attachments (≤5 MB), virtual scrolling
|
|
423
|
+
- **Theme system**: dark / light / system-follow, brand-blue palette, persisted
|
|
424
|
+
- **Frameless window**: custom titlebar (drag region, double-click maximize), close dialog with minimize-to-tray / quit / cancel
|
|
425
|
+
- **Hub tools in Settings**: install / version / check update / update the hub CLI, one-click `setup` to detect local agents and install the SKILL + MCP config, auto-start service install
|
|
426
|
+
- **System tray** with brand logo and status tooltip; i18n (zh-CN default, en-US)
|
|
427
|
+
|
|
428
|
+
See `app/README.md` for the full feature list and architecture.
|
|
429
|
+
|
|
393
430
|
Tests cover registration, duplicate rejection, chat routing, sender-filtered waits, task+ack routing back to the sender, broadcast, status/peers/history, unregister/re-register, and error paths.
|
|
394
431
|
|
|
395
432
|
## Troubleshooting
|
package/README.zh.md
CHANGED
|
@@ -82,6 +82,7 @@ agent-comm-hub
|
|
|
82
82
|
```bash
|
|
83
83
|
agent-comm-hub service install # Windows:HKCU Run + 隐藏启动器(无需管理员)
|
|
84
84
|
# Linux:systemd --user 单元并启用
|
|
85
|
+
# macOS:launchd LaunchAgent
|
|
85
86
|
agent-comm-hub service uninstall # 撤销
|
|
86
87
|
agent-comm-hub status # hub 是否在跑?谁在线?
|
|
87
88
|
```
|
|
@@ -94,12 +95,18 @@ agent-comm-hub status # hub 是否在跑?谁在线?
|
|
|
94
95
|
agent-comm-hub setup
|
|
95
96
|
# 或 PowerShell 版:agents/install-all.ps1
|
|
96
97
|
# 卸载:agent-comm-hub setup --remove
|
|
98
|
+
# 查看本机装了什么(只读):agent-comm-hub discover
|
|
99
|
+
# 只配置某一个:agent-comm-hub setup --agent codex
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
`setup`
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
`setup` 会**自动发现**本机安装了哪些 agent(PATH 命令 / 配置文件路径 /
|
|
103
|
+
npm 全局包,纯 Node 无 shell、跨平台),并把 `agent-hub` 的 MCP 条目
|
|
104
|
+
**增量合并**进每个已安装 agent 的配置(mcode / opencode / kimi-code /
|
|
105
|
+
gemini / codex / zcode / DSH,macOS 上还有 claude-desktop),英文 SKILL 装到
|
|
106
|
+
`~/.agents/skills/`(跨 agent 标准位置)+ 各 agent 私有技能目录。支持哪些
|
|
107
|
+
agent 由 [`agents/registry.json`](agents/registry.json) 声明——新增 agent
|
|
108
|
+
只需加一条注册表记录,不改代码。只动 `agent-hub` 这一个键、每个文件先备份、
|
|
109
|
+
幂等可重跑。Claude Code 的 MCP 配置手动(见下)。
|
|
103
110
|
|
|
104
111
|
**注册全自动**:agent 会话一启动,MCP 握手即完成注册(客户端名 = peer id),无需任何手动操作。可选:`bridge_register("工具名:项目名")` 换可读 id。
|
|
105
112
|
|
|
@@ -213,7 +220,7 @@ agent-comm-hub service install|uninstall [options] 一键自启
|
|
|
213
220
|
--port <n> 端口(默认 18764)
|
|
214
221
|
--path <p> MCP 路径(默认 /mcp)
|
|
215
222
|
--max-queue <n> 每 peer 队列上限,溢出丢最旧(默认 200)
|
|
216
|
-
--history-limit <n> 保留的历史条数(默认
|
|
223
|
+
--history-limit <n> 保留的历史条数(默认 1000)
|
|
217
224
|
--wait-timeout-ms <n> bridge_wait 长轮询上限(默认 60000)
|
|
218
225
|
--default-wait-ms <n> bridge_wait 默认预算(默认 30000)
|
|
219
226
|
--connected-window-ms <n> 活跃窗口(默认 30000)
|
|
@@ -266,6 +273,36 @@ pnpm run build # esbuild → lib/{cli,index,setup}.js(零依赖)
|
|
|
266
273
|
pnpm pack # 构建 + npm pack(发布产物)
|
|
267
274
|
```
|
|
268
275
|
|
|
276
|
+
## 桌面端 GUI
|
|
277
|
+
|
|
278
|
+
配套桌面端是另一个独立 npm 包 **`agent-comm-hub-app`**,在 `app/` 目录,Tauri 2 + React。它只走 hub 的 MCP / HTTP API,不引入主仓源码,也不会动 `dependencies: {}` 这个零依赖约束 —— 通过 `app/pnpm-workspace.yaml` 做工作区隔离。
|
|
279
|
+
|
|
280
|
+
| 简体中文 | English |
|
|
281
|
+
|---|---|
|
|
282
|
+
|  |  |
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
cd app
|
|
286
|
+
pnpm install
|
|
287
|
+
pnpm tauri:dev # 开发模式 (HMR)
|
|
288
|
+
pnpm tauri:build # 三平台安装包 (NSIS / MSI / dmg / AppImage / deb)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
主要能力:
|
|
292
|
+
|
|
293
|
+
- **一站式 Hub 生命周期**:启动自动拉起 hub (4-tier PATH 兜底)、启停/重启、实时日志面板 (stderr 过滤 + 放大查看),外部 hub 复用模式带健康探测
|
|
294
|
+
- **实时消息**:`bridge_wait` 长轮询保持界面实时;发送即乐观显示;`/history` 合并 hub 内存与 SQLite 存档 (重启不丢)
|
|
295
|
+
- **会话视角** (PRD US-2):点击任意 peer 查看它的完整会话;per-peer 未读徽章
|
|
296
|
+
- **消息详情**:原始 JSON、task prompt/context/deliverable、ack 状态机时间线
|
|
297
|
+
- **斜杠命令**:`/peers /broadcast /history /clear /help` —— 面板选择或直接输入
|
|
298
|
+
- **Markdown 渲染** + rehype-sanitize、多会话方 cc、拖拽附件 (≤5 MB)、虚拟滚动
|
|
299
|
+
- **主题系统**:深色 / 浅色 / 跟随系统,品牌蓝主题,持久化
|
|
300
|
+
- **无边框窗口**:自绘标题栏 (拖拽区、双击最大化),关闭弹窗三选一 (最小化到托盘 / 退出 / 取消)
|
|
301
|
+
- **设置页 Hub 工具**:安装 / 版本 / 检查更新 / 更新 hub CLI,一键 `setup` 检测本地 agent 并安装 SKILL + MCP 配置,开机自启服务
|
|
302
|
+
- **系统托盘** (品牌 logo + 状态 tooltip);i18n (简中默认 + 英文)
|
|
303
|
+
|
|
304
|
+
详见 `app/README.zh.md`。
|
|
305
|
+
|
|
269
306
|
## 故障排查
|
|
270
307
|
|
|
271
308
|
| 症状 | 原因 / 解决 |
|
package/agents/SKILL.md
CHANGED
|
@@ -34,7 +34,9 @@ Optional: call `bridge_register(peerId)` to claim a readable id
|
|
|
34
34
|
30 s; loop it to hold a real-time conversation).
|
|
35
35
|
- `bridge_poll(from?)` — non-blocking drain of every queued message.
|
|
36
36
|
- `bridge_status()` / `bridge_peers()` — hub health and who is online.
|
|
37
|
-
- `bridge_history(peer?, limit?)` — recent messages (newest first).
|
|
37
|
+
- `bridge_history(peer?, limit?)` — recent messages (newest first). `peer`
|
|
38
|
+
defaults to you; pass another peer's id to read their conversation, or
|
|
39
|
+
`"all"` for the unfiltered tail across every peer.
|
|
38
40
|
|
|
39
41
|
## When to use
|
|
40
42
|
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "docs/agent-registry.schema.json",
|
|
3
|
+
"agents": [
|
|
4
|
+
{
|
|
5
|
+
"id": "mcode",
|
|
6
|
+
"probe": [],
|
|
7
|
+
"configs": [
|
|
8
|
+
{
|
|
9
|
+
"file": "~/.minimax/mcp.json",
|
|
10
|
+
"section": "mcpServers",
|
|
11
|
+
"strategy": "json",
|
|
12
|
+
"entry": {
|
|
13
|
+
"url": "{url}",
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"configured": true,
|
|
17
|
+
"timeout": 120000,
|
|
18
|
+
"description": "agent-comm-hub: talk to every other agent connected to the hub."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"file": "~/.minimax/mcp/mcp.json",
|
|
23
|
+
"section": "mcpServers",
|
|
24
|
+
"strategy": "json",
|
|
25
|
+
"entry": {
|
|
26
|
+
"url": "{url}",
|
|
27
|
+
"type": "streamable-http",
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"configured": true,
|
|
30
|
+
"timeout": 120000,
|
|
31
|
+
"description": "agent-comm-hub: talk to every other agent connected to the hub."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"skill": "~/.minimax/skills",
|
|
36
|
+
"os": ["win32", "darwin", "linux"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "opencode",
|
|
40
|
+
"probe": ["opencode"],
|
|
41
|
+
"npm": ["cli"],
|
|
42
|
+
"configs": [
|
|
43
|
+
{
|
|
44
|
+
"file": "~/.config/opencode/opencode.json",
|
|
45
|
+
"section": "mcp",
|
|
46
|
+
"strategy": "json",
|
|
47
|
+
"entry": { "type": "remote", "url": "{url}", "enabled": true }
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"skill": "~/.config/opencode/skills",
|
|
51
|
+
"os": ["win32", "darwin", "linux"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "kimi-code",
|
|
55
|
+
"probe": ["kimi"],
|
|
56
|
+
"configs": [
|
|
57
|
+
{
|
|
58
|
+
"file": "~/.kimi-code/mcp.json",
|
|
59
|
+
"section": "mcpServers",
|
|
60
|
+
"strategy": "json",
|
|
61
|
+
"entry": { "transport": "http", "url": "{url}", "startupTimeoutMs": 30000, "toolTimeoutMs": 120000 }
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"skill": "~/.kimi-code/skills",
|
|
65
|
+
"os": ["win32", "darwin", "linux"]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "gemini-cli",
|
|
69
|
+
"probe": ["gemini"],
|
|
70
|
+
"configs": [
|
|
71
|
+
{
|
|
72
|
+
"file": "~/.gemini/settings.json",
|
|
73
|
+
"section": "mcpServers",
|
|
74
|
+
"strategy": "json",
|
|
75
|
+
"entry": { "type": "http", "url": "{url}" }
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"skill": "~/.gemini/skills",
|
|
79
|
+
"os": ["win32", "darwin", "linux"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "codex",
|
|
83
|
+
"probe": ["codex"],
|
|
84
|
+
"npm": ["codex"],
|
|
85
|
+
"configs": [
|
|
86
|
+
{
|
|
87
|
+
"file": "~/.codex/config.toml",
|
|
88
|
+
"section": null,
|
|
89
|
+
"strategy": "toml",
|
|
90
|
+
"entry": null
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"skill": "~/.codex/skills",
|
|
94
|
+
"os": ["win32", "darwin", "linux"]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "zcode",
|
|
98
|
+
"probe": [],
|
|
99
|
+
"configs": [
|
|
100
|
+
{
|
|
101
|
+
"file": "~/.zcode/cli/config.json",
|
|
102
|
+
"section": "mcp.servers",
|
|
103
|
+
"strategy": "json",
|
|
104
|
+
"entry": { "type": "remote", "url": "{url}", "enabled": true }
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"skill": "~/.zcode/skills",
|
|
108
|
+
"os": ["win32", "darwin", "linux"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "dsh",
|
|
112
|
+
"probe": [],
|
|
113
|
+
"configs": [
|
|
114
|
+
{
|
|
115
|
+
"file": "~/.dsh/profiles/*/cordis.patch.yml",
|
|
116
|
+
"section": null,
|
|
117
|
+
"strategy": "dsh",
|
|
118
|
+
"entry": null
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"skill": "~/.dsh/skills",
|
|
122
|
+
"os": ["win32", "darwin", "linux"]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "claude",
|
|
126
|
+
"probe": ["claude"],
|
|
127
|
+
"npm": ["claude-code"],
|
|
128
|
+
"configs": [],
|
|
129
|
+
"skill": "~/.claude/skills",
|
|
130
|
+
"os": ["win32", "darwin", "linux"]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "qwen-code",
|
|
134
|
+
"probe": ["qwen"],
|
|
135
|
+
"npm": ["qwen-code"],
|
|
136
|
+
"configs": [
|
|
137
|
+
{
|
|
138
|
+
"file": "~/.qwen/settings.json",
|
|
139
|
+
"section": "mcpServers",
|
|
140
|
+
"strategy": "json",
|
|
141
|
+
"entry": { "httpUrl": "{url}" }
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"skill": null,
|
|
145
|
+
"os": ["win32", "darwin", "linux"]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "pi",
|
|
149
|
+
"probe": ["pi"],
|
|
150
|
+
"npm": ["pi-coding-agent"],
|
|
151
|
+
"configs": [],
|
|
152
|
+
"skill": null,
|
|
153
|
+
"os": ["win32", "darwin", "linux"]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "cursor",
|
|
157
|
+
"probe": ["cursor", "cursor-agent"],
|
|
158
|
+
"npm": ["cursor"],
|
|
159
|
+
"configs": [
|
|
160
|
+
{
|
|
161
|
+
"file": "~/.cursor/mcp.json",
|
|
162
|
+
"section": "mcpServers",
|
|
163
|
+
"strategy": "json",
|
|
164
|
+
"entry": { "url": "{url}" }
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"skill": null,
|
|
168
|
+
"os": ["win32", "darwin", "linux"]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "qoder",
|
|
172
|
+
"probe": ["qoder"],
|
|
173
|
+
"npm": ["qoder"],
|
|
174
|
+
"configs": [],
|
|
175
|
+
"skill": null,
|
|
176
|
+
"os": ["win32", "darwin", "linux"]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "codebuddy",
|
|
180
|
+
"probe": ["codebuddy"],
|
|
181
|
+
"npm": ["codebuddy"],
|
|
182
|
+
"configs": [],
|
|
183
|
+
"skill": null,
|
|
184
|
+
"os": ["win32", "darwin", "linux"]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "claude-desktop",
|
|
188
|
+
"probe": [],
|
|
189
|
+
"configs": [
|
|
190
|
+
{
|
|
191
|
+
"file": "~/Library/Application Support/Claude/claude_desktop_config.json",
|
|
192
|
+
"section": "mcpServers",
|
|
193
|
+
"strategy": "json",
|
|
194
|
+
"entry": { "url": "{url}", "type": "streamable-http" }
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"skill": null,
|
|
198
|
+
"os": ["darwin"]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
}
|
|
Binary file
|
|
Binary file
|