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

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.
@@ -88,7 +88,7 @@ __export(exports_urls, {
88
88
  VERSION: () => VERSION,
89
89
  URLS: () => URLS
90
90
  });
91
- var URLS, VERSION = "1.0.0-alpha.32", env;
91
+ var URLS, VERSION = "1.0.0-alpha.33", env;
92
92
  var init_urls = __esm(() => {
93
93
  URLS = {
94
94
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -9782,8 +9782,10 @@ async function resolveClient(to) {
9782
9782
  };
9783
9783
  }
9784
9784
  const nameLower = target.toLowerCase();
9785
+ const candidates = [];
9785
9786
  for (const c of targetClients) {
9786
9787
  const peers = await c.listPeers();
9788
+ candidates.push({ mesh: c.meshSlug, peers });
9787
9789
  const match = peers.find((p) => p.displayName.toLowerCase() === nameLower);
9788
9790
  if (match)
9789
9791
  return { client: c, targetSpec: match.pubkey };
@@ -9794,13 +9796,11 @@ async function resolveClient(to) {
9794
9796
  return { client: c, targetSpec: partials[0].pubkey };
9795
9797
  }
9796
9798
  }
9797
- if (targetClients.length === 1) {
9798
- return { client: targetClients[0], targetSpec: target };
9799
- }
9799
+ const known = candidates.flatMap((c) => c.peers.map((p) => `${c.mesh}/${p.displayName}`));
9800
9800
  return {
9801
9801
  client: null,
9802
9802
  targetSpec: target,
9803
- error: `peer "${target}" not found in any mesh (joined: ${clients2.map((c) => c.meshSlug).join(", ")})`
9803
+ 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.")
9804
9804
  };
9805
9805
  }
9806
9806
  async function resolvePeerName(client, pubkey) {
@@ -10156,6 +10156,9 @@ ${manifest.allowed_tools.map((t) => ` - ${t}`).join(`
10156
10156
  sections.push(`${header}
10157
10157
  No peers connected.`);
10158
10158
  } else {
10159
+ const pubkeyCounts = new Map;
10160
+ for (const p of peers)
10161
+ pubkeyCounts.set(p.pubkey, (pubkeyCounts.get(p.pubkey) ?? 0) + 1);
10159
10162
  const peerLines = peers.map((p) => {
10160
10163
  const summary = p.summary ? ` — "${p.summary}"` : "";
10161
10164
  const groupsStr = p.groups?.length ? ` [${p.groups.map((g) => `@${g.name}${g.role ? ":" + g.role : ""}`).join(", ")}]` : "";
@@ -10173,7 +10176,9 @@ No peers connected.`);
10173
10176
  const profileAvatar = p.profile?.avatar ? `${p.profile.avatar} ` : "";
10174
10177
  const profileTitle = p.profile?.title ? ` (${p.profile.title})` : "";
10175
10178
  const hiddenTag = p.visible === false ? " [hidden]" : "";
10176
- return `- ${profileAvatar}**${p.displayName}**${profileTitle} [${p.status}]${localityTag}${hiddenTag}${groupsStr}${metaStr} (${p.pubkey.slice(0, 12)}…)${cwdStr}${summary}`;
10179
+ const sameKeyCount = pubkeyCounts.get(p.pubkey) ?? 1;
10180
+ const sameKeyTag = sameKeyCount > 1 ? ` [shares key with ${sameKeyCount - 1} other session(s)]` : "";
10181
+ return `- ${profileAvatar}**${p.displayName}**${profileTitle} [${p.status}]${localityTag}${hiddenTag}${sameKeyTag}${groupsStr}${metaStr} (${p.pubkey.slice(0, 12)}…)${cwdStr}${summary}`;
10177
10182
  });
10178
10183
  sections.push(`${header}
10179
10184
  ${peerLines.join(`
@@ -12479,4 +12484,4 @@ main().catch((err) => {
12479
12484
  process.exit(EXIT.INTERNAL_ERROR);
12480
12485
  });
12481
12486
 
12482
- //# debugId=E80C818349D554BA64756E2164756E21
12487
+ //# debugId=7971C6A86DFF7B3F64756E2164756E21