claudemesh-cli 0.1.5 → 0.1.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.
- package/dist/index.js +35 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54773,7 +54773,7 @@ class StdioServerTransport {
|
|
|
54773
54773
|
var TOOLS = [
|
|
54774
54774
|
{
|
|
54775
54775
|
name: "send_message",
|
|
54776
|
-
description: "Send a message to a peer in one of your joined meshes. `to`
|
|
54776
|
+
description: "Send a message to a peer in one of your joined meshes. `to` can be a peer display name (resolved via list_peers), hex pubkey, `#channel`, or `*` for broadcast. `priority` controls delivery: `now` bypasses busy gates, `next` waits for idle (default), `low` is pull-only.",
|
|
54777
54777
|
inputSchema: {
|
|
54778
54778
|
type: "object",
|
|
54779
54779
|
properties: {
|
|
@@ -55339,26 +55339,51 @@ function text(msg, isError = false) {
|
|
|
55339
55339
|
...isError ? { isError: true } : {}
|
|
55340
55340
|
};
|
|
55341
55341
|
}
|
|
55342
|
-
function resolveClient(to) {
|
|
55342
|
+
async function resolveClient(to) {
|
|
55343
55343
|
const clients2 = allClients();
|
|
55344
55344
|
if (clients2.length === 0) {
|
|
55345
55345
|
return { client: null, targetSpec: to, error: "no meshes joined" };
|
|
55346
55346
|
}
|
|
55347
|
+
let targetClients = clients2;
|
|
55348
|
+
let target = to;
|
|
55347
55349
|
const colonIdx = to.indexOf(":");
|
|
55348
55350
|
if (colonIdx > 0 && colonIdx < to.length - 1) {
|
|
55349
55351
|
const slug = to.slice(0, colonIdx);
|
|
55350
55352
|
const rest = to.slice(colonIdx + 1);
|
|
55351
55353
|
const match = findClient(slug);
|
|
55354
|
+
if (match) {
|
|
55355
|
+
targetClients = [match];
|
|
55356
|
+
target = rest;
|
|
55357
|
+
}
|
|
55358
|
+
}
|
|
55359
|
+
if (/^[0-9a-f]{64}$/.test(target) || target.startsWith("#") || target === "*") {
|
|
55360
|
+
if (targetClients.length === 1) {
|
|
55361
|
+
return { client: targetClients[0], targetSpec: target };
|
|
55362
|
+
}
|
|
55363
|
+
return {
|
|
55364
|
+
client: null,
|
|
55365
|
+
targetSpec: target,
|
|
55366
|
+
error: `multiple meshes joined; prefix target with "<mesh-slug>:" (joined: ${clients2.map((c) => c.meshSlug).join(", ")})`
|
|
55367
|
+
};
|
|
55368
|
+
}
|
|
55369
|
+
const nameLower = target.toLowerCase();
|
|
55370
|
+
for (const c of targetClients) {
|
|
55371
|
+
const peers = await c.listPeers();
|
|
55372
|
+
const match = peers.find((p) => p.displayName.toLowerCase() === nameLower);
|
|
55352
55373
|
if (match)
|
|
55353
|
-
return { client:
|
|
55374
|
+
return { client: c, targetSpec: match.pubkey };
|
|
55375
|
+
const partials = peers.filter((p) => p.displayName.toLowerCase().includes(nameLower));
|
|
55376
|
+
if (partials.length === 1) {
|
|
55377
|
+
return { client: c, targetSpec: partials[0].pubkey };
|
|
55378
|
+
}
|
|
55354
55379
|
}
|
|
55355
|
-
if (
|
|
55356
|
-
return { client:
|
|
55380
|
+
if (targetClients.length === 1) {
|
|
55381
|
+
return { client: targetClients[0], targetSpec: target };
|
|
55357
55382
|
}
|
|
55358
55383
|
return {
|
|
55359
55384
|
client: null,
|
|
55360
|
-
targetSpec:
|
|
55361
|
-
error: `
|
|
55385
|
+
targetSpec: target,
|
|
55386
|
+
error: `peer "${target}" not found in any mesh (joined: ${clients2.map((c) => c.meshSlug).join(", ")})`
|
|
55362
55387
|
};
|
|
55363
55388
|
}
|
|
55364
55389
|
function decryptFailedWarning(senderPubkey) {
|
|
@@ -55385,7 +55410,7 @@ Read the from_id, from_name, mesh_slug, and priority attributes to understand co
|
|
|
55385
55410
|
|
|
55386
55411
|
Available tools:
|
|
55387
55412
|
- list_peers: see joined meshes + their connection status
|
|
55388
|
-
- send_message: send to a peer pubkey, channel, or broadcast (priority: now/next/low)
|
|
55413
|
+
- send_message: send to a peer by display name, pubkey, #channel, or * broadcast (priority: now/next/low)
|
|
55389
55414
|
- check_messages: drain buffered inbound messages (usually auto-pushed)
|
|
55390
55415
|
- set_summary: 1-2 sentence summary of what you're working on
|
|
55391
55416
|
- set_status: manually override your status (idle/working/dnd)
|
|
@@ -55410,7 +55435,7 @@ If you have multiple joined meshes, prefix the \`to\` argument of send_message w
|
|
|
55410
55435
|
const { to, message, priority } = args ?? {};
|
|
55411
55436
|
if (!to || !message)
|
|
55412
55437
|
return text("send_message: `to` and `message` required", true);
|
|
55413
|
-
const { client, targetSpec, error: error46 } = resolveClient(to);
|
|
55438
|
+
const { client, targetSpec, error: error46 } = await resolveClient(to);
|
|
55414
55439
|
if (!client)
|
|
55415
55440
|
return text(`send_message: ${error46 ?? "no client resolved"}`, true);
|
|
55416
55441
|
const result = await client.send(targetSpec, message, priority ?? "next");
|
|
@@ -56150,7 +56175,7 @@ import { statSync, existsSync as existsSync3 } from "node:fs";
|
|
|
56150
56175
|
// package.json
|
|
56151
56176
|
var package_default = {
|
|
56152
56177
|
name: "claudemesh-cli",
|
|
56153
|
-
version: "0.1.
|
|
56178
|
+
version: "0.1.6",
|
|
56154
56179
|
description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
56155
56180
|
keywords: [
|
|
56156
56181
|
"claude-code",
|