agent-comm-hub 0.1.11 → 0.1.12

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.
Files changed (3) hide show
  1. package/lib/cli.js +19 -17
  2. package/lib/index.js +1 -1
  3. 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.11";
713
+ var SERVER_VERSION = "0.1.12";
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 before = readVersion();
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 npmBin = process.platform === "win32" ? "npm.cmd" : "npm";
1021
- const out = execFileSync(npmBin, ["install", "-g", "--prefer-online", "agent-comm-hub@latest"], { encoding: "utf8", windowsHide: true, shell: process.platform === "win32" });
1022
- const tail = out.trim().split(/\r?\n/).slice(-3).filter(Boolean).join(" | ");
1023
- if (tail) messages.push(tail);
1024
- const after = readVersion();
1025
- if (after === before) messages.push(`already up to date (v${after})`);
1026
- else messages.push(`updated: v${before} -> v${after}`);
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.11";
716
+ var SERVER_VERSION = "0.1.12";
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.11",
3
+ "version": "0.1.12",
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",