agent-comm-hub 0.1.6 → 0.1.7
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/lib/cli.js +26 -11
- package/lib/index.js +1 -1
- package/package.json +1 -1
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.7";
|
|
714
714
|
var DEFAULT_HOST = "127.0.0.1";
|
|
715
715
|
var DEFAULT_PORT = 18764;
|
|
716
716
|
var DEFAULT_PATH = "/mcp";
|
|
@@ -941,6 +941,7 @@ async function runSetup(options = {}) {
|
|
|
941
941
|
|
|
942
942
|
// src/ops.ts
|
|
943
943
|
import { execFileSync } from "node:child_process";
|
|
944
|
+
import { request } from "node:http";
|
|
944
945
|
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
945
946
|
import { homedir as homedir2 } from "node:os";
|
|
946
947
|
import { join as join2 } from "node:path";
|
|
@@ -956,14 +957,28 @@ async function runStatus(options = {}) {
|
|
|
956
957
|
const headers = {};
|
|
957
958
|
let id = 0;
|
|
958
959
|
const rpc = async (method, params) => {
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
960
|
+
const body = JSON.stringify({ jsonrpc: "2.0", id: ++id, method, ...params !== void 0 ? { params } : {} });
|
|
961
|
+
const res = await new Promise((resolve, reject) => {
|
|
962
|
+
const req = request(url, {
|
|
963
|
+
method: "POST",
|
|
964
|
+
agent: false,
|
|
965
|
+
headers: { "Content-Type": "application/json", Accept: "application/json, text/event-stream", "Content-Length": Buffer.byteLength(body), ...headers }
|
|
966
|
+
}, (response) => {
|
|
967
|
+
const chunks = [];
|
|
968
|
+
response.on("data", (chunk) => chunks.push(chunk));
|
|
969
|
+
response.on("end", () => resolve({
|
|
970
|
+
status: response.statusCode ?? 0,
|
|
971
|
+
contentType: response.headers["content-type"] ?? "",
|
|
972
|
+
sessionId: typeof response.headers["mcp-session-id"] === "string" ? response.headers["mcp-session-id"] : void 0,
|
|
973
|
+
text: Buffer.concat(chunks).toString("utf8")
|
|
974
|
+
}));
|
|
975
|
+
});
|
|
976
|
+
req.setTimeout(5e3, () => req.destroy(new Error(`probe timed out after 5s`)));
|
|
977
|
+
req.on("error", reject);
|
|
978
|
+
req.end(body);
|
|
963
979
|
});
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
const json = await res.json();
|
|
980
|
+
if (res.sessionId) headers["Mcp-Session-Id"] = res.sessionId;
|
|
981
|
+
const json = res.contentType.includes("text/event-stream") ? JSON.parse(res.text.split("\n").filter((line) => line.startsWith("data:")).map((line) => line.slice(5)).join("")) : JSON.parse(res.text);
|
|
967
982
|
return json;
|
|
968
983
|
};
|
|
969
984
|
const init = await rpc("initialize", { protocolVersion: "2025-06-18", capabilities: {}, clientInfo: { name: probeName, version: "cli" } });
|
|
@@ -1115,9 +1130,9 @@ Usage:
|
|
|
1115
1130
|
idempotent; --remove undoes)
|
|
1116
1131
|
agent-comm-hub status [options] show hub health + online peers
|
|
1117
1132
|
agent-comm-hub service install|uninstall [options]
|
|
1118
|
-
one-shot auto-start (Windows
|
|
1119
|
-
|
|
1120
|
-
--dry-run prints
|
|
1133
|
+
one-shot auto-start (Windows Run
|
|
1134
|
+
key + hidden VBS launcher, no admin;
|
|
1135
|
+
Linux systemd; --dry-run prints)
|
|
1121
1136
|
|
|
1122
1137
|
Hub options:
|
|
1123
1138
|
--host <addr> Bind address (default 127.0.0.1)
|
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.7";
|
|
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.7",
|
|
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",
|