claudemesh-cli 1.31.5 → 1.31.6

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.31.5", env;
107
+ var URLS, VERSION = "1.31.6", env;
108
108
  var init_urls = __esm(() => {
109
109
  URLS = {
110
110
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -7992,6 +7992,37 @@ async function runSend(flags, to, message) {
7992
7992
  const priority = flags.priority === "now" ? "now" : flags.priority === "low" ? "low" : "next";
7993
7993
  const config = readConfig();
7994
7994
  const meshSlug = flags.mesh ?? (config.meshes.length === 1 ? config.meshes[0].slug : null);
7995
+ if (!to.startsWith("@") && !to.startsWith("#") && to !== "*" && /^[0-9a-f]{4,63}$/i.test(to)) {
7996
+ try {
7997
+ const { tryListPeersViaDaemon: tryListPeersViaDaemon2 } = await Promise.resolve().then(() => (init_daemon_route(), exports_daemon_route));
7998
+ const peers = await tryListPeersViaDaemon2() ?? [];
7999
+ const lower = to.toLowerCase();
8000
+ const matches2 = peers.filter((p) => {
8001
+ const pk = p.pubkey ?? "";
8002
+ const mpk = p.memberPubkey ?? "";
8003
+ return pk.toLowerCase().startsWith(lower) || mpk.toLowerCase().startsWith(lower);
8004
+ });
8005
+ if (matches2.length === 0) {
8006
+ render.err(`No peer matches hex prefix "${to}".`);
8007
+ const names = peers.map((p) => p.displayName).filter(Boolean).join(", ");
8008
+ if (names)
8009
+ render.hint(`online: ${names}`);
8010
+ process.exit(1);
8011
+ }
8012
+ if (matches2.length > 1) {
8013
+ const candidates = matches2.map((p) => {
8014
+ const pk = p.pubkey ?? "";
8015
+ const dn = p.displayName ?? "?";
8016
+ return `${dn} ${pk.slice(0, 16)}…`;
8017
+ }).join(", ");
8018
+ render.err(`Ambiguous hex prefix "${to}" — matches ${matches2.length} peers.`);
8019
+ render.hint(`candidates: ${candidates}`);
8020
+ render.hint("Use a longer prefix or paste the full 64-char pubkey.");
8021
+ process.exit(1);
8022
+ }
8023
+ to = matches2[0].pubkey ?? to;
8024
+ } catch {}
8025
+ }
7995
8026
  if (!flags.self && meshSlug) {
7996
8027
  const joined = config.meshes.find((m) => m.slug === meshSlug);
7997
8028
  if (joined && /^[0-9a-f]{64}$/i.test(to) && to.toLowerCase() === joined.pubkey.toLowerCase()) {
@@ -20066,4 +20097,4 @@ main().catch((err) => {
20066
20097
  process.exit(EXIT.INTERNAL_ERROR);
20067
20098
  });
20068
20099
 
20069
- //# debugId=23383F2CEE3C764664756E2164756E21
20100
+ //# debugId=F22F2E19502D800C64756E2164756E21