claudemesh-cli 1.34.8 → 1.34.9
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/dist/entrypoints/cli.js
CHANGED
|
@@ -104,7 +104,7 @@ __export(exports_urls, {
|
|
|
104
104
|
VERSION: () => VERSION,
|
|
105
105
|
URLS: () => URLS
|
|
106
106
|
});
|
|
107
|
-
var URLS, VERSION = "1.34.
|
|
107
|
+
var URLS, VERSION = "1.34.9", env;
|
|
108
108
|
var init_urls = __esm(() => {
|
|
109
109
|
URLS = {
|
|
110
110
|
BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
|
|
@@ -4331,6 +4331,7 @@ async function ensureDaemonRunning(meshSlug, quiet) {
|
|
|
4331
4331
|
if (res.state === "up") {
|
|
4332
4332
|
if (!quiet)
|
|
4333
4333
|
render.ok("daemon already running");
|
|
4334
|
+
await warnIfDaemonStale(quiet);
|
|
4334
4335
|
return;
|
|
4335
4336
|
}
|
|
4336
4337
|
if (res.state === "started") {
|
|
@@ -4340,6 +4341,21 @@ async function ensureDaemonRunning(meshSlug, quiet) {
|
|
|
4340
4341
|
}
|
|
4341
4342
|
render.warn(`daemon ${res.state}${res.reason ? `: ${res.reason}` : ""}`, "Run `claudemesh daemon up --mesh " + meshSlug + "` manually, then re-launch.");
|
|
4342
4343
|
}
|
|
4344
|
+
async function warnIfDaemonStale(quiet) {
|
|
4345
|
+
if (quiet)
|
|
4346
|
+
return;
|
|
4347
|
+
try {
|
|
4348
|
+
const { ipc: ipc2 } = await Promise.resolve().then(() => (init_client3(), exports_client));
|
|
4349
|
+
const { VERSION: VERSION2 } = await Promise.resolve().then(() => (init_urls(), exports_urls));
|
|
4350
|
+
const res = await ipc2({ path: "/v1/version", timeoutMs: 1500 });
|
|
4351
|
+
if (res.status !== 200)
|
|
4352
|
+
return;
|
|
4353
|
+
const daemonVersion = res.body.daemon_version ?? "";
|
|
4354
|
+
if (!daemonVersion || daemonVersion === VERSION2)
|
|
4355
|
+
return;
|
|
4356
|
+
render.warn(`daemon is ${daemonVersion}, CLI is ${VERSION2} — restart to pick up new fixes.`, "Run: `claudemesh daemon down && claudemesh daemon up` (or restart the launchd / systemd-user unit).");
|
|
4357
|
+
} catch {}
|
|
4358
|
+
}
|
|
4343
4359
|
function parseGroupsString(raw) {
|
|
4344
4360
|
return raw.split(",").map((s) => s.trim()).filter(Boolean).map((token) => {
|
|
4345
4361
|
const idx = token.indexOf(":");
|
|
@@ -11438,6 +11454,8 @@ class SessionBrokerClient {
|
|
|
11438
11454
|
return;
|
|
11439
11455
|
}
|
|
11440
11456
|
if (msg.type === "push" || msg.type === "inbound") {
|
|
11457
|
+
if (msg.subtype === "system")
|
|
11458
|
+
return;
|
|
11441
11459
|
const senderPubkey = String(msg.senderPubkey ?? "").toLowerCase();
|
|
11442
11460
|
if (senderPubkey && senderPubkey === this.opts.sessionPubkey.toLowerCase()) {
|
|
11443
11461
|
this.log("info", "self_echo_dropped", { sender: senderPubkey.slice(0, 12) });
|
|
@@ -11778,10 +11796,14 @@ var init_inbox_pruner = __esm(() => {
|
|
|
11778
11796
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
11779
11797
|
async function handleBrokerPush(msg, ctx) {
|
|
11780
11798
|
if (msg.subtype === "system" && typeof msg.event === "string") {
|
|
11799
|
+
const eventData = msg.eventData ?? {};
|
|
11800
|
+
const eventPubkey = typeof eventData.pubkey === "string" ? eventData.pubkey : "";
|
|
11801
|
+
if (eventPubkey && ctx.isOwnPubkey?.(eventPubkey))
|
|
11802
|
+
return;
|
|
11781
11803
|
ctx.bus.publish(mapSystemEventKind(msg.event), {
|
|
11782
11804
|
mesh: ctx.meshSlug,
|
|
11783
11805
|
event: msg.event,
|
|
11784
|
-
...
|
|
11806
|
+
...eventData
|
|
11785
11807
|
});
|
|
11786
11808
|
return;
|
|
11787
11809
|
}
|
|
@@ -12073,6 +12095,8 @@ async function runDaemon(opts = {}) {
|
|
|
12073
12095
|
} else {
|
|
12074
12096
|
meshes = cfg.meshes;
|
|
12075
12097
|
}
|
|
12098
|
+
const sessionBrokers = new Map;
|
|
12099
|
+
const sessionBrokersByPubkey = new Map;
|
|
12076
12100
|
const brokers = new Map;
|
|
12077
12101
|
const meshConfigs = new Map;
|
|
12078
12102
|
for (const mesh of meshes) {
|
|
@@ -12091,9 +12115,8 @@ async function runDaemon(opts = {}) {
|
|
|
12091
12115
|
},
|
|
12092
12116
|
onPush: (m) => {
|
|
12093
12117
|
const senderMemberPk = String(m.senderMemberPubkey ?? "").toLowerCase();
|
|
12094
|
-
const senderPubkey = String(m.senderPubkey ?? "").toLowerCase();
|
|
12095
12118
|
const ownMember = mesh.pubkey.toLowerCase();
|
|
12096
|
-
if (senderMemberPk && senderMemberPk === ownMember
|
|
12119
|
+
if (senderMemberPk && senderMemberPk === ownMember) {
|
|
12097
12120
|
return;
|
|
12098
12121
|
}
|
|
12099
12122
|
handleBrokerPush(m, {
|
|
@@ -12101,7 +12124,13 @@ async function runDaemon(opts = {}) {
|
|
|
12101
12124
|
bus,
|
|
12102
12125
|
meshSlug: mesh.slug,
|
|
12103
12126
|
recipientSecretKeyHex: mesh.secretKey,
|
|
12104
|
-
ackClientMessage: (cmid, bmid) => broker.sendClientAck(cmid, bmid)
|
|
12127
|
+
ackClientMessage: (cmid, bmid) => broker.sendClientAck(cmid, bmid),
|
|
12128
|
+
isOwnPubkey: (pubkey) => {
|
|
12129
|
+
const lower = pubkey.toLowerCase();
|
|
12130
|
+
if (lower === ownMember)
|
|
12131
|
+
return true;
|
|
12132
|
+
return sessionBrokersByPubkey.has(lower);
|
|
12133
|
+
}
|
|
12105
12134
|
});
|
|
12106
12135
|
}
|
|
12107
12136
|
});
|
|
@@ -12109,8 +12138,6 @@ async function runDaemon(opts = {}) {
|
|
|
12109
12138
|
`));
|
|
12110
12139
|
brokers.set(mesh.slug, broker);
|
|
12111
12140
|
}
|
|
12112
|
-
const sessionBrokers = new Map;
|
|
12113
|
-
const sessionBrokersByPubkey = new Map;
|
|
12114
12141
|
let drain = null;
|
|
12115
12142
|
drain = startDrainWorker({
|
|
12116
12143
|
db: outboxDb,
|
|
@@ -18796,11 +18823,23 @@ ${mf.allowed_tools.map((t) => ` - ${t}`).join(`
|
|
|
18796
18823
|
} else if (ev.kind === "peer_join" || ev.kind === "peer_leave" || ev.kind === "system") {
|
|
18797
18824
|
const d = ev.data;
|
|
18798
18825
|
const eventName = String(d.event ?? ev.kind);
|
|
18826
|
+
const renderPeerLine = (verb) => {
|
|
18827
|
+
const name = String(d.name ?? "unknown");
|
|
18828
|
+
const pubkey = String(d.pubkey ?? "");
|
|
18829
|
+
const pubkeyTag = pubkey ? ` (${pubkey.slice(0, 8)})` : "";
|
|
18830
|
+
const groups = Array.isArray(d.groups) ? d.groups : [];
|
|
18831
|
+
const groupNames = groups.map((g) => typeof g === "object" && g !== null && ("name" in g) ? String(g.name) : typeof g === "string" ? g : "").filter(Boolean);
|
|
18832
|
+
const groupsTag = groupNames.length > 0 ? ` [${groupNames.join(", ")}]` : "";
|
|
18833
|
+
const lastSeen = typeof d.lastSeenAt === "string" ? d.lastSeenAt : null;
|
|
18834
|
+
const summary = typeof d.summary === "string" && d.summary.trim() ? d.summary.trim() : null;
|
|
18835
|
+
const returningTail = lastSeen ? ` — last seen ${new Date(lastSeen).toLocaleTimeString()}${summary ? ` · "${summary.slice(0, 80)}"` : ""}` : "";
|
|
18836
|
+
return `[system] Peer "${name}"${pubkeyTag}${groupsTag} ${verb} the mesh${returningTail}`;
|
|
18837
|
+
};
|
|
18799
18838
|
let content;
|
|
18800
18839
|
if (ev.kind === "peer_join") {
|
|
18801
|
-
content =
|
|
18840
|
+
content = renderPeerLine(eventName === "peer_returned" ? "returned to" : "joined");
|
|
18802
18841
|
} else if (ev.kind === "peer_leave") {
|
|
18803
|
-
content =
|
|
18842
|
+
content = renderPeerLine("left");
|
|
18804
18843
|
} else {
|
|
18805
18844
|
content = `[system] ${eventName}: ${JSON.stringify(d).slice(0, 240)}`;
|
|
18806
18845
|
}
|
|
@@ -18812,7 +18851,12 @@ ${mf.allowed_tools.map((t) => ` - ${t}`).join(`
|
|
|
18812
18851
|
meta: {
|
|
18813
18852
|
kind: "system",
|
|
18814
18853
|
event: eventName,
|
|
18815
|
-
mesh_slug: String(d.mesh ?? "")
|
|
18854
|
+
mesh_slug: String(d.mesh ?? ""),
|
|
18855
|
+
...typeof d.name === "string" ? { peer_name: d.name } : {},
|
|
18856
|
+
...typeof d.pubkey === "string" ? { peer_pubkey: d.pubkey } : {},
|
|
18857
|
+
...Array.isArray(d.groups) ? { peer_groups: JSON.stringify(d.groups) } : {},
|
|
18858
|
+
...typeof d.lastSeenAt === "string" ? { peer_last_seen_at: d.lastSeenAt } : {},
|
|
18859
|
+
...typeof d.summary === "string" ? { peer_summary: d.summary } : {}
|
|
18816
18860
|
}
|
|
18817
18861
|
}
|
|
18818
18862
|
});
|
|
@@ -21045,4 +21089,4 @@ main().catch((err) => {
|
|
|
21045
21089
|
process.exit(EXIT.INTERNAL_ERROR);
|
|
21046
21090
|
});
|
|
21047
21091
|
|
|
21048
|
-
//# debugId=
|
|
21092
|
+
//# debugId=7232363C9624744664756E2164756E21
|