claudemesh-cli 0.5.0 → 0.5.1
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 +58 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6514,7 +6514,7 @@ function loadConfig() {
|
|
|
6514
6514
|
if (!parsed || !Array.isArray(parsed.meshes)) {
|
|
6515
6515
|
return { version: 1, meshes: [] };
|
|
6516
6516
|
}
|
|
6517
|
-
return { version: 1, meshes: parsed.meshes, displayName: parsed.displayName, groups: parsed.groups };
|
|
6517
|
+
return { version: 1, meshes: parsed.meshes, displayName: parsed.displayName, groups: parsed.groups, messageMode: parsed.messageMode };
|
|
6518
6518
|
} catch (e) {
|
|
6519
6519
|
throw new Error(`Failed to load ${CONFIG_PATH}: ${e instanceof Error ? e.message : String(e)}`);
|
|
6520
6520
|
}
|
|
@@ -47921,6 +47921,7 @@ async function startMcpServer() {
|
|
|
47921
47921
|
const config2 = loadConfig();
|
|
47922
47922
|
const myName = config2.displayName ?? "unnamed";
|
|
47923
47923
|
const myGroups = (config2.groups ?? []).map((g) => `@${g.name}${g.role ? ":" + g.role : ""}`).join(", ") || "none";
|
|
47924
|
+
const messageMode = config2.messageMode ?? "push";
|
|
47924
47925
|
const server = new Server({ name: "claudemesh", version: "0.3.0" }, {
|
|
47925
47926
|
capabilities: {
|
|
47926
47927
|
experimental: { "claude/channel": {} },
|
|
@@ -48023,7 +48024,13 @@ Create and claim work items. create_task to propose work, claim_task to take own
|
|
|
48023
48024
|
- "low": pull-only via check_messages (FYI, non-blocking context)
|
|
48024
48025
|
|
|
48025
48026
|
## Coordination
|
|
48026
|
-
Call list_peers at session start to understand who is online, their roles, and what they are working on. If you are a group lead, gather input from members before responding to external requests — do not answer alone. If you are a member, contribute to your lead when asked. Use @group messages for team-wide questions, direct messages for 1:1 coordination. Set a meaningful summary so peers know your current focus
|
|
48027
|
+
Call list_peers at session start to understand who is online, their roles, and what they are working on. If you are a group lead, gather input from members before responding to external requests — do not answer alone. If you are a member, contribute to your lead when asked. Use @group messages for team-wide questions, direct messages for 1:1 coordination. Set a meaningful summary so peers know your current focus.
|
|
48028
|
+
|
|
48029
|
+
## Message Mode
|
|
48030
|
+
Your message mode is "${messageMode}".
|
|
48031
|
+
- push: messages arrive in real-time as channel notifications. Respond immediately.
|
|
48032
|
+
- inbox: messages are held. You'll see "[inbox] New message from X" notifications. Call check_messages to read them.
|
|
48033
|
+
- off: no message notifications. Use check_messages manually to poll.`
|
|
48027
48034
|
});
|
|
48028
48035
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
48029
48036
|
tools: TOOLS
|
|
@@ -48564,8 +48571,22 @@ ${rows.join(`
|
|
|
48564
48571
|
await server.connect(transport);
|
|
48565
48572
|
for (const client of allClients()) {
|
|
48566
48573
|
client.onPush(async (msg) => {
|
|
48574
|
+
if (messageMode === "off")
|
|
48575
|
+
return;
|
|
48567
48576
|
const fromPubkey = msg.senderPubkey || "";
|
|
48568
48577
|
const fromName = fromPubkey ? await resolvePeerName(client, fromPubkey) : "unknown";
|
|
48578
|
+
if (messageMode === "inbox") {
|
|
48579
|
+
try {
|
|
48580
|
+
await server.notification({
|
|
48581
|
+
method: "notifications/claude/channel",
|
|
48582
|
+
params: {
|
|
48583
|
+
content: `[inbox] New message from ${fromName}. Use check_messages to read.`,
|
|
48584
|
+
meta: { kind: "inbox_notification", from_name: fromName }
|
|
48585
|
+
}
|
|
48586
|
+
});
|
|
48587
|
+
} catch {}
|
|
48588
|
+
return;
|
|
48589
|
+
}
|
|
48569
48590
|
const content = msg.plaintext ?? decryptFailedWarning(fromPubkey);
|
|
48570
48591
|
try {
|
|
48571
48592
|
await server.notification({
|
|
@@ -49222,6 +49243,7 @@ function parseArgs(argv) {
|
|
|
49222
49243
|
groups: null,
|
|
49223
49244
|
joinLink: null,
|
|
49224
49245
|
meshSlug: null,
|
|
49246
|
+
messageMode: null,
|
|
49225
49247
|
quiet: false,
|
|
49226
49248
|
skipPermConfirm: false,
|
|
49227
49249
|
claudeArgs: []
|
|
@@ -49249,6 +49271,10 @@ function parseArgs(argv) {
|
|
|
49249
49271
|
result.meshSlug = argv[++i];
|
|
49250
49272
|
} else if (arg.startsWith("--mesh=")) {
|
|
49251
49273
|
result.meshSlug = arg.slice("--mesh=".length);
|
|
49274
|
+
} else if (arg === "--inbox") {
|
|
49275
|
+
result.messageMode = "inbox";
|
|
49276
|
+
} else if (arg === "--no-messages") {
|
|
49277
|
+
result.messageMode = "off";
|
|
49252
49278
|
} else if (arg === "--quiet") {
|
|
49253
49279
|
result.quiet = true;
|
|
49254
49280
|
} else if (arg === "-y" || arg === "--yes") {
|
|
@@ -49334,16 +49360,22 @@ async function confirmPermissions() {
|
|
|
49334
49360
|
});
|
|
49335
49361
|
});
|
|
49336
49362
|
}
|
|
49337
|
-
function printBanner(name, meshSlug, role, groups) {
|
|
49363
|
+
function printBanner(name, meshSlug, role, groups, messageMode) {
|
|
49338
49364
|
const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
|
|
49339
49365
|
const dim = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
|
|
49340
49366
|
const bold = (s) => useColor ? `\x1B[1m${s}\x1B[22m` : s;
|
|
49341
49367
|
const roleSuffix = role ? ` (${role})` : "";
|
|
49342
49368
|
const groupTags = groups.length ? " [" + groups.map((g) => `@${g.name}${g.role ? `:${g.role}` : ""}`).join(", ") + "]" : "";
|
|
49343
49369
|
const rule = "─".repeat(60);
|
|
49344
|
-
console.log(bold(`claudemesh launch`) + dim(` — as ${name}${roleSuffix} on ${meshSlug}${groupTags}`));
|
|
49370
|
+
console.log(bold(`claudemesh launch`) + dim(` — as ${name}${roleSuffix} on ${meshSlug}${groupTags} [${messageMode}]`));
|
|
49345
49371
|
console.log(rule);
|
|
49346
|
-
|
|
49372
|
+
if (messageMode === "push") {
|
|
49373
|
+
console.log("Peer messages arrive as <channel> reminders in real-time.");
|
|
49374
|
+
} else if (messageMode === "inbox") {
|
|
49375
|
+
console.log("Peer messages held in inbox. Use check_messages to read.");
|
|
49376
|
+
} else {
|
|
49377
|
+
console.log("Messages off. Use check_messages to poll manually.");
|
|
49378
|
+
}
|
|
49347
49379
|
console.log("Peers send text only — they cannot call tools or read files.");
|
|
49348
49380
|
console.log(dim(`Config: ${getConfigPath()}`));
|
|
49349
49381
|
console.log(rule);
|
|
@@ -49398,6 +49430,7 @@ async function runLaunch(extraArgs) {
|
|
|
49398
49430
|
const displayName = args.name ?? `${hostname2()}-${process.pid}`;
|
|
49399
49431
|
let role = args.role;
|
|
49400
49432
|
let parsedGroups = args.groups ? parseGroupsString(args.groups) : [];
|
|
49433
|
+
let messageMode = args.messageMode ?? "push";
|
|
49401
49434
|
if (!args.quiet) {
|
|
49402
49435
|
if (role === null) {
|
|
49403
49436
|
const answer = await askLine(" Role (optional): ");
|
|
@@ -49409,6 +49442,22 @@ async function runLaunch(extraArgs) {
|
|
|
49409
49442
|
if (answer)
|
|
49410
49443
|
parsedGroups = parseGroupsString(answer);
|
|
49411
49444
|
}
|
|
49445
|
+
if (args.messageMode === null) {
|
|
49446
|
+
console.log(`
|
|
49447
|
+
Message mode:`);
|
|
49448
|
+
console.log(" 1) Push (real-time, peers can interrupt your work)");
|
|
49449
|
+
console.log(" 2) Inbox (held until you check, notification only)");
|
|
49450
|
+
console.log(" 3) Off (tools only, no messages)");
|
|
49451
|
+
console.log("");
|
|
49452
|
+
const answer = await askLine(" Choice [1]: ");
|
|
49453
|
+
const choice = parseInt(answer || "1", 10);
|
|
49454
|
+
if (choice === 2)
|
|
49455
|
+
messageMode = "inbox";
|
|
49456
|
+
else if (choice === 3)
|
|
49457
|
+
messageMode = "off";
|
|
49458
|
+
else
|
|
49459
|
+
messageMode = "push";
|
|
49460
|
+
}
|
|
49412
49461
|
if (role || parsedGroups.length)
|
|
49413
49462
|
console.log("");
|
|
49414
49463
|
}
|
|
@@ -49428,12 +49477,13 @@ async function runLaunch(extraArgs) {
|
|
|
49428
49477
|
version: 1,
|
|
49429
49478
|
meshes: [mesh],
|
|
49430
49479
|
displayName,
|
|
49431
|
-
...parsedGroups.length > 0 ? { groups: parsedGroups } : {}
|
|
49480
|
+
...parsedGroups.length > 0 ? { groups: parsedGroups } : {},
|
|
49481
|
+
messageMode
|
|
49432
49482
|
};
|
|
49433
49483
|
writeFileSync4(join4(tmpDir, "config.json"), JSON.stringify(sessionConfig, null, 2) + `
|
|
49434
49484
|
`, "utf-8");
|
|
49435
49485
|
if (!args.quiet) {
|
|
49436
|
-
printBanner(displayName, mesh.slug, role, parsedGroups);
|
|
49486
|
+
printBanner(displayName, mesh.slug, role, parsedGroups, messageMode);
|
|
49437
49487
|
if (!args.skipPermConfirm) {
|
|
49438
49488
|
await confirmPermissions();
|
|
49439
49489
|
}
|
|
@@ -49501,7 +49551,7 @@ init_config();
|
|
|
49501
49551
|
// package.json
|
|
49502
49552
|
var package_default = {
|
|
49503
49553
|
name: "claudemesh-cli",
|
|
49504
|
-
version: "0.5.
|
|
49554
|
+
version: "0.5.1",
|
|
49505
49555
|
description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
49506
49556
|
keywords: [
|
|
49507
49557
|
"claude-code",
|