claudemesh-cli 1.34.3 → 1.34.4

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.
@@ -104,7 +104,7 @@ __export(exports_urls, {
104
104
  VERSION: () => VERSION,
105
105
  URLS: () => URLS
106
106
  });
107
- var URLS, VERSION = "1.34.3", env;
107
+ var URLS, VERSION = "1.34.4", env;
108
108
  var init_urls = __esm(() => {
109
109
  URLS = {
110
110
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -18480,12 +18480,19 @@ ${mf.allowed_tools.map((t) => ` - ${t}`).join(`
18480
18480
  } catch {}
18481
18481
  }
18482
18482
  });
18483
+ let welcomeSent = false;
18484
+ const WELCOME_GRACE_MS = 2000;
18485
+ server.oninitialized = () => {
18486
+ mcpLog("server_initialized");
18487
+ if (welcomeSent)
18488
+ return;
18489
+ welcomeSent = true;
18490
+ setTimeout(() => {
18491
+ emitMeshWelcome(server, mcpLog);
18492
+ }, WELCOME_GRACE_MS);
18493
+ };
18483
18494
  const transport = new StdioServerTransport;
18484
18495
  await server.connect(transport);
18485
- const WELCOME_DELAY_MS = 5000;
18486
- setTimeout(() => {
18487
- emitMeshWelcome(server, mcpLog);
18488
- }, WELCOME_DELAY_MS);
18489
18496
  const keepalive = setInterval(() => {}, 1000);
18490
18497
  const shutdown = () => {
18491
18498
  clearInterval(keepalive);
@@ -18522,9 +18529,21 @@ async function emitMeshWelcome(server, mcpLog) {
18522
18529
  const { status, body } = await daemonGet(path2, { sessionToken });
18523
18530
  if (status === 200 && Array.isArray(body?.peers)) {
18524
18531
  const peers = body.peers;
18525
- const real = peers.filter((p) => p.peerRole !== "control-plane" && p.pubkey !== selfSessionPubkey);
18532
+ const real = peers.filter((p) => {
18533
+ const channel = String(p.channel ?? "");
18534
+ const peerRole = String(p.peerRole ?? "");
18535
+ const isInfra = channel === "claudemesh-daemon" || peerRole === "control-plane";
18536
+ if (isInfra)
18537
+ return false;
18538
+ if (selfSessionPubkey && p.pubkey === selfSessionPubkey)
18539
+ return false;
18540
+ return true;
18541
+ });
18526
18542
  peerCount = real.length;
18527
18543
  peerNames = real.map((p) => String(p.displayName ?? "unknown")).filter((n, i, arr) => arr.indexOf(n) === i).slice(0, 5);
18544
+ mcpLog("welcome_peers_resolved", { total: peers.length, real: real.length });
18545
+ } else {
18546
+ mcpLog("welcome_peers_status", { status });
18528
18547
  }
18529
18548
  } catch (e) {
18530
18549
  mcpLog("welcome_peers_lookup_failed", { err: String(e) });
@@ -20637,4 +20656,4 @@ main().catch((err) => {
20637
20656
  process.exit(EXIT.INTERNAL_ERROR);
20638
20657
  });
20639
20658
 
20640
- //# debugId=1E35EC1C4AC8296064756E2164756E21
20659
+ //# debugId=A642AC8B680B8F3E64756E2164756E21