claudemesh-cli 1.0.0-alpha.32 → 1.0.0-alpha.34

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.
@@ -2689,7 +2689,13 @@ class BrokerClient {
2689
2689
  plaintext = `[${event}]`;
2690
2690
  }
2691
2691
  } else if (senderPubkey && nonce && ciphertext) {
2692
- plaintext = await decryptDirect({ nonce, ciphertext }, senderPubkey, this.sessionSecretKey ?? this.mesh.secretKey);
2692
+ const envelope = { nonce, ciphertext };
2693
+ if (this.sessionSecretKey) {
2694
+ plaintext = await decryptDirect(envelope, senderPubkey, this.sessionSecretKey);
2695
+ }
2696
+ if (plaintext === null) {
2697
+ plaintext = await decryptDirect(envelope, senderPubkey, this.mesh.secretKey);
2698
+ }
2693
2699
  }
2694
2700
  if (plaintext === null && ciphertext && !senderPubkey) {
2695
2701
  try {
@@ -3488,7 +3494,7 @@ __export(exports_urls, {
3488
3494
  VERSION: () => VERSION,
3489
3495
  URLS: () => URLS
3490
3496
  });
3491
- var URLS, VERSION = "1.0.0-alpha.32", env;
3497
+ var URLS, VERSION = "1.0.0-alpha.34", env;
3492
3498
  var init_urls = __esm(() => {
3493
3499
  URLS = {
3494
3500
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -4421,8 +4427,10 @@ async function resolveClient(to) {
4421
4427
  };
4422
4428
  }
4423
4429
  const nameLower = target.toLowerCase();
4430
+ const candidates = [];
4424
4431
  for (const c of targetClients) {
4425
4432
  const peers = await c.listPeers();
4433
+ candidates.push({ mesh: c.meshSlug, peers });
4426
4434
  const match = peers.find((p) => p.displayName.toLowerCase() === nameLower);
4427
4435
  if (match)
4428
4436
  return { client: c, targetSpec: match.pubkey };
@@ -4433,13 +4441,11 @@ async function resolveClient(to) {
4433
4441
  return { client: c, targetSpec: partials[0].pubkey };
4434
4442
  }
4435
4443
  }
4436
- if (targetClients.length === 1) {
4437
- return { client: targetClients[0], targetSpec: target };
4438
- }
4444
+ const known = candidates.flatMap((c) => c.peers.map((p) => `${c.mesh}/${p.displayName}`));
4439
4445
  return {
4440
4446
  client: null,
4441
4447
  targetSpec: target,
4442
- error: `peer "${target}" not found in any mesh (joined: ${clients2.map((c) => c.meshSlug).join(", ")})`
4448
+ error: `peer "${target}" not found. ` + (known.length ? `Known peers: ${known.slice(0, 10).join(", ")}${known.length > 10 ? ", …" : ""}` : "No connected peers on your mesh(es). Use pubkey hex, @group, or * for broadcast.")
4443
4449
  };
4444
4450
  }
4445
4451
  async function resolvePeerName(client, pubkey) {
@@ -4795,6 +4801,9 @@ ${manifest.allowed_tools.map((t) => ` - ${t}`).join(`
4795
4801
  sections.push(`${header}
4796
4802
  No peers connected.`);
4797
4803
  } else {
4804
+ const pubkeyCounts = new Map;
4805
+ for (const p of peers)
4806
+ pubkeyCounts.set(p.pubkey, (pubkeyCounts.get(p.pubkey) ?? 0) + 1);
4798
4807
  const peerLines = peers.map((p) => {
4799
4808
  const summary = p.summary ? ` — "${p.summary}"` : "";
4800
4809
  const groupsStr = p.groups?.length ? ` [${p.groups.map((g) => `@${g.name}${g.role ? ":" + g.role : ""}`).join(", ")}]` : "";
@@ -4812,7 +4821,9 @@ No peers connected.`);
4812
4821
  const profileAvatar = p.profile?.avatar ? `${p.profile.avatar} ` : "";
4813
4822
  const profileTitle = p.profile?.title ? ` (${p.profile.title})` : "";
4814
4823
  const hiddenTag = p.visible === false ? " [hidden]" : "";
4815
- return `- ${profileAvatar}**${p.displayName}**${profileTitle} [${p.status}]${localityTag}${hiddenTag}${groupsStr}${metaStr} (${p.pubkey.slice(0, 12)}…)${cwdStr}${summary}`;
4824
+ const sameKeyCount = pubkeyCounts.get(p.pubkey) ?? 1;
4825
+ const sameKeyTag = sameKeyCount > 1 ? ` [shares key with ${sameKeyCount - 1} other session(s)]` : "";
4826
+ return `- ${profileAvatar}**${p.displayName}**${profileTitle} [${p.status}]${localityTag}${hiddenTag}${sameKeyTag}${groupsStr}${metaStr} (${p.pubkey.slice(0, 12)}…)${cwdStr}${summary}`;
4816
4827
  });
4817
4828
  sections.push(`${header}
4818
4829
  ${peerLines.join(`
@@ -6522,4 +6533,4 @@ startMcpServer().catch((err) => {
6522
6533
  process.exit(1);
6523
6534
  });
6524
6535
 
6525
- //# debugId=1491A1F07755C64D64756E2164756E21
6536
+ //# debugId=8F33C4D68058778464756E2164756E21