agent-comm-hub 0.8.0 → 0.9.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/lib/setup.js CHANGED
@@ -62,6 +62,9 @@ function validateRegistry(registry) {
62
62
  if (agent.skill !== null && (typeof agent.skill !== "string" || !agent.skill.startsWith("~/"))) {
63
63
  throw new Error(`registry: ${agent.id}: skill must be '~'-relative or null`);
64
64
  }
65
+ if (agent.serverName !== void 0 && (typeof agent.serverName !== "string" || agent.serverName === "")) {
66
+ throw new Error(`registry: ${agent.id}: serverName must be a non-empty string`);
67
+ }
65
68
  if (agent.os !== void 0 && (!Array.isArray(agent.os) || agent.os.some((os) => !["win32", "darwin", "linux"].includes(os)))) {
66
69
  throw new Error(`registry: ${agent.id}: invalid os list`);
67
70
  }
@@ -302,7 +305,7 @@ async function mergeDshPatch(file, opts) {
302
305
  return "removed";
303
306
  }
304
307
  const ranges = hubEntryRanges();
305
- if (ranges.length === 1 && lines.slice(ranges[0].start, ranges[0].end).some((line) => line.includes(`url: ${opts.url}`))) {
308
+ if (ranges.length === 1 && lines.slice(ranges[0].start, ranges[0].end).some((line) => line.includes(`url: ${opts.url}`)) && lines.slice(ranges[0].start, ranges[0].end).some((line) => line.includes(`serverName: ${opts.serverName}`))) {
306
309
  return "unchanged";
307
310
  }
308
311
  await backup(file);
@@ -373,9 +376,10 @@ async function runSetup(options = {}) {
373
376
  }
374
377
  for (const agent of targetAgents) {
375
378
  for (const config of agent.configs) {
379
+ const nameFor = config.serverName ?? agent.serverName ?? serverName;
376
380
  for (const file of expandConfigFile(config.file, home)) {
377
381
  try {
378
- const status = config.strategy === "json" ? await mergeJsonServer(file, config.section, substitute(config.entry, { url, serverName }), { serverName, url, remove }) : config.strategy === "toml" ? await mergeTomlSection(file, { serverName, url, remove }) : await mergeDshPatch(file, { serverName, url, remove });
382
+ const status = config.strategy === "json" ? await mergeJsonServer(file, config.section, substitute(config.entry, { url, serverName: nameFor }), { serverName: nameFor, url, remove }) : config.strategy === "toml" ? await mergeTomlSection(file, { serverName: nameFor, url, remove }) : await mergeDshPatch(file, { serverName: nameFor, url, remove });
379
383
  record(status, agent.id, file);
380
384
  } catch (error) {
381
385
  summary.errors.push(`${agent.id}: ${file} \u2014 ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-comm-hub",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
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",
@@ -38,6 +38,7 @@
38
38
  "build": "esbuild src/cli.ts --bundle --platform=node --format=esm --outfile=lib/cli.js && esbuild src/index.ts --bundle --platform=node --format=esm --outfile=lib/index.js && esbuild src/setup.ts --bundle --platform=node --format=esm --outfile=lib/setup.js",
39
39
  "build:test": "esbuild test/entry.ts --bundle --platform=node --format=esm --outfile=test/entry.mjs && esbuild test/setup-entry.ts --bundle --platform=node --format=esm --outfile=test/setup-entry.mjs && esbuild test/ops-entry.ts --bundle --platform=node --format=esm --outfile=test/ops-entry.mjs && esbuild test/herdr-entry.ts --bundle --platform=node --format=esm --outfile=test/herdr-entry.mjs && esbuild test/discover-entry.ts --bundle --platform=node --format=esm --outfile=test/discover-entry.mjs",
40
40
  "typecheck": "tsc --noEmit",
41
+ "build:admin": "npm --prefix admin run build",
41
42
  "test": "pnpm run build:test && pnpm run build && node test/smoke.mjs && node test/setup.mjs && node test/ops.mjs && node test/herdr.mjs && node test/discover.mjs && node test/e2e.mjs",
42
43
  "pack": "pnpm run build && pnpm pack"
43
44
  }