agent-comm-hub 0.1.11 → 0.1.13
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/agents/SKILL.md +20 -15
- package/lib/cli.js +19 -17
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/agents/SKILL.md
CHANGED
|
@@ -52,25 +52,30 @@ Optional: call `bridge_register(peerId)` to claim a readable id
|
|
|
52
52
|
decline and `"failed"` when it could not be completed (always with a note).
|
|
53
53
|
5. Unsure whether the peer is online: check `bridge_peers()` first.
|
|
54
54
|
|
|
55
|
-
##
|
|
55
|
+
## Common workflows (plain language)
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Follow the scenario directly (tool names stay as-is):
|
|
58
58
|
|
|
59
|
-
**1.
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
**1. Someone delegates a task to you (e.g. codex plans -> you build)**
|
|
60
|
+
- On receiving a task: acknowledge first — `bridge_ack(ref, "accepted")`,
|
|
61
|
+
say "got it, starting".
|
|
62
|
+
- When done: send the result and a delivery note back to the delegator
|
|
63
|
+
(`bridge_chat` / `bridge_task`), then `bridge_ack(ref, "done", note)` so it
|
|
64
|
+
can review.
|
|
65
|
+
- If you can't do it: `bridge_ack(ref, "rejected")` with the reason.
|
|
64
66
|
|
|
65
|
-
**2.
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
**2. You delegate to someone else (wait vs don't-wait)**
|
|
68
|
+
- Wait for delivery: after `bridge_task`, loop `bridge_wait()` until the
|
|
69
|
+
result arrives, then take it over.
|
|
70
|
+
- Don't wait: send it and move on; the peer sends the result back when done —
|
|
71
|
+
collect it later with `bridge_poll()` / `bridge_wait()` /
|
|
72
|
+
`bridge_history()` (messages queue while you are away).
|
|
69
73
|
|
|
70
|
-
**3.
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
**3. Multi-agent real-time discussion**
|
|
75
|
+
- After you've said your piece, stay in the conversation: loop
|
|
76
|
+
`bridge_wait()` to keep listening — nothing arrived this round, wait the
|
|
77
|
+
next — until a conclusion is reached or the user says "done".
|
|
78
|
+
- A timeout (`{type:"timeout"}`) is not a failure; keep waiting.
|
|
74
79
|
|
|
75
80
|
## Notes
|
|
76
81
|
|
package/lib/cli.js
CHANGED
|
@@ -710,7 +710,7 @@ function readBody(req) {
|
|
|
710
710
|
|
|
711
711
|
// src/index.ts
|
|
712
712
|
var SERVER_NAME = "agent-comm-hub";
|
|
713
|
-
var SERVER_VERSION = "0.1.
|
|
713
|
+
var SERVER_VERSION = "0.1.13";
|
|
714
714
|
var DEFAULT_HOST = "127.0.0.1";
|
|
715
715
|
var DEFAULT_PORT = 18764;
|
|
716
716
|
var DEFAULT_PATH = "/mcp";
|
|
@@ -1006,24 +1006,26 @@ async function runStatus(options = {}) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
function runUpdate() {
|
|
1008
1008
|
const messages = [];
|
|
1009
|
-
const pkgFile = join2(dirname2(fileURLToPath2(import.meta.url)), "..", "package.json");
|
|
1010
|
-
const readVersion = () => {
|
|
1011
|
-
try {
|
|
1012
|
-
return JSON.parse(readFileSync(pkgFile, "utf8")).version ?? "?";
|
|
1013
|
-
} catch {
|
|
1014
|
-
return "?";
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
1009
|
try {
|
|
1018
|
-
const
|
|
1010
|
+
const pkgFile = join2(dirname2(fileURLToPath2(import.meta.url)), "..", "package.json");
|
|
1011
|
+
const before = JSON.parse(readFileSync(pkgFile, "utf8")).version ?? "?";
|
|
1019
1012
|
messages.push(`current version: ${before}`);
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1013
|
+
const script = [
|
|
1014
|
+
"import { execFileSync } from 'node:child_process'",
|
|
1015
|
+
"import { readFileSync } from 'node:fs'",
|
|
1016
|
+
`const pkg = ${JSON.stringify(pkgFile)}`,
|
|
1017
|
+
"const read = () => JSON.parse(readFileSync(pkg, 'utf8')).version",
|
|
1018
|
+
"const before = read()",
|
|
1019
|
+
"const npmBin = process.platform === 'win32' ? 'npm.cmd' : 'npm'",
|
|
1020
|
+
"const out = execFileSync(npmBin, ['install', '-g', '--prefer-online', 'agent-comm-hub@latest'], { encoding: 'utf8', windowsHide: true, shell: process.platform === 'win32' })",
|
|
1021
|
+
"const tail = out.trim().split(/\\r?\\n/).slice(-3).filter(Boolean).join(' | ')",
|
|
1022
|
+
"if (tail) console.log(tail)",
|
|
1023
|
+
"const after = read()",
|
|
1024
|
+
"if (after === before) console.log('already up to date (v' + after + ')')",
|
|
1025
|
+
"else console.log('updated: v' + before + ' -> v' + after)"
|
|
1026
|
+
].join("\n");
|
|
1027
|
+
const out = execFileSync(process.execPath, ["--input-type=module", "-e", script], { encoding: "utf8", windowsHide: true });
|
|
1028
|
+
messages.push(out.trim());
|
|
1027
1029
|
messages.push("restart the hub (agent-comm-hub) to pick up the new version");
|
|
1028
1030
|
return { ok: true, messages };
|
|
1029
1031
|
} catch (error) {
|
package/lib/index.js
CHANGED
|
@@ -713,7 +713,7 @@ function readBody(req) {
|
|
|
713
713
|
|
|
714
714
|
// src/index.ts
|
|
715
715
|
var SERVER_NAME = "agent-comm-hub";
|
|
716
|
-
var SERVER_VERSION = "0.1.
|
|
716
|
+
var SERVER_VERSION = "0.1.13";
|
|
717
717
|
var DEFAULT_HOST = "127.0.0.1";
|
|
718
718
|
var DEFAULT_PORT = 18764;
|
|
719
719
|
var DEFAULT_PATH = "/mcp";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-comm-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Generic multi-peer MCP hub: any MCP-capable agent (MiniMax Code, Claude Code, opencode, Codex, Gemini CLI, DSH, ...) connects to one local streamable-http endpoint and they chat, delegate tasks, and acknowledge in real time",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|