claudemesh-cli 0.5.5 → 0.5.7

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.
Files changed (2) hide show
  1. package/dist/index.js +37 -34
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47231,7 +47231,10 @@ class BrokerClient {
47231
47231
  signal: AbortSignal.timeout(30000)
47232
47232
  });
47233
47233
  const body = await res.json();
47234
- return body.fileId ?? null;
47234
+ if (!res.ok || !body.fileId) {
47235
+ throw new Error(body.error ?? `HTTP ${res.status}`);
47236
+ }
47237
+ return body.fileId;
47235
47238
  }
47236
47239
  async vectorStore(collection, text, metadata) {
47237
47240
  if (!this.ws || this.ws.readyState !== this.ws.OPEN)
@@ -48251,14 +48254,16 @@ ${lines.join(`
48251
48254
  const client = allClients()[0];
48252
48255
  if (!client)
48253
48256
  return text("share_file: not connected", true);
48254
- const fileId = await client.uploadFile(filePath, client.meshId, client.meshSlug, {
48255
- name: fileName,
48256
- tags,
48257
- persistent: true
48258
- });
48259
- if (!fileId)
48260
- return text("share_file: upload failed", true);
48261
- return text(`Shared: ${fileName ?? filePath} (${fileId})`);
48257
+ try {
48258
+ const fileId = await client.uploadFile(filePath, client.meshId, client.meshSlug, {
48259
+ name: fileName,
48260
+ tags,
48261
+ persistent: true
48262
+ });
48263
+ return text(`Shared: ${fileName ?? filePath} (${fileId})`);
48264
+ } catch (e) {
48265
+ return text(`share_file: upload failed — ${e instanceof Error ? e.message : String(e)}`, true);
48266
+ }
48262
48267
  }
48263
48268
  case "get_file": {
48264
48269
  const { id, save_to } = args ?? {};
@@ -48583,38 +48588,34 @@ ${rows.join(`
48583
48588
  if (!client)
48584
48589
  return text("ping_mesh: not connected", true);
48585
48590
  const results = [];
48591
+ results.push(`WS status: ${client.status}`);
48592
+ results.push(`Mesh: ${client.meshSlug}`);
48593
+ const peers = await client.listPeers();
48594
+ const selfPeer = peers.find((p) => p.displayName === myName);
48595
+ results.push(`Your status: ${selfPeer?.status ?? "not found in peer list"}`);
48596
+ results.push(`Peers online: ${peers.length}`);
48597
+ results.push(`Push buffer: ${client.pushHistory.length} buffered`);
48586
48598
  for (const prio of toTest) {
48587
48599
  const sendTime = Date.now();
48588
- const pingId = `ping-${sendTime}-${prio}`;
48589
- const sendResult = await client.send("*", `__ping__${pingId}`, prio);
48600
+ const target = peers.find((p) => p.displayName !== myName);
48601
+ const sendResult = await client.send(target?.pubkey ?? "*", `__ping__ ${prio} from ${myName} at ${new Date().toISOString()}`, prio);
48590
48602
  const ackTime = Date.now();
48591
48603
  if (!sendResult.ok) {
48592
48604
  results.push(`[${prio}] SEND FAILED: ${sendResult.error}`);
48593
- continue;
48594
- }
48595
- let received = false;
48596
- let receiveTime = 0;
48597
- for (let i = 0;i < 100; i++) {
48598
- await new Promise((r) => setTimeout(r, 100));
48599
- const buffer = client.pushHistory;
48600
- const match = buffer.find((m) => m.plaintext?.includes(pingId) || false);
48601
- if (match) {
48602
- received = true;
48603
- receiveTime = Date.now();
48604
- break;
48605
- }
48606
- }
48607
- if (received) {
48608
- results.push(`[${prio}] OK — send→ack: ${ackTime - sendTime}ms, send→receive: ${receiveTime - sendTime}ms`);
48609
48605
  } else {
48610
- const peers = await client.listPeers();
48611
- const selfStatus = peers.find((p) => p.displayName === myName)?.status ?? "unknown";
48612
- results.push(`[${prio}] NOT RECEIVED in 10s (your status: ${selfStatus}${selfStatus === "working" ? " — broker holds next/low" : ""})`);
48606
+ results.push(`[${prio}] send→ack: ${ackTime - sendTime}ms (msgId: ${sendResult.messageId?.slice(0, 12)})`);
48607
+ if (prio !== "now" && selfPeer?.status === "working") {
48608
+ results.push(` peer status is "working" — broker holds "${prio}" until idle`);
48609
+ }
48613
48610
  }
48614
48611
  }
48615
- return text(`Ping results:
48616
- ${results.join(`
48617
- `)}`);
48612
+ results.push("");
48613
+ results.push("Pipeline check:");
48614
+ results.push(` onPush handlers: active`);
48615
+ results.push(` messageMode: ${messageMode}`);
48616
+ results.push(` server.notification: ${messageMode === "off" ? "disabled (mode=off)" : "enabled"}`);
48617
+ return text(results.join(`
48618
+ `));
48618
48619
  }
48619
48620
  default:
48620
48621
  return text(`Unknown tool: ${name}`, true);
@@ -48697,7 +48698,9 @@ ${results.join(`
48697
48698
  } catch {}
48698
48699
  });
48699
48700
  }
48701
+ const keepalive = setInterval(() => {}, 1000);
48700
48702
  const shutdown = () => {
48703
+ clearInterval(keepalive);
48701
48704
  stopAll();
48702
48705
  process.exit(0);
48703
48706
  };
@@ -49610,7 +49613,7 @@ init_config();
49610
49613
  // package.json
49611
49614
  var package_default = {
49612
49615
  name: "claudemesh-cli",
49613
- version: "0.5.5",
49616
+ version: "0.5.7",
49614
49617
  description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
49615
49618
  keywords: [
49616
49619
  "claude-code",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudemesh-cli",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
5
5
  "keywords": [
6
6
  "claude-code",