claudemesh-cli 0.1.12 → 0.1.14
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 +51 -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 };
|
|
6517
|
+
return { version: 1, meshes: parsed.meshes, displayName: parsed.displayName };
|
|
6518
6518
|
} catch (e) {
|
|
6519
6519
|
throw new Error(`Failed to load ${CONFIG_PATH}: ${e instanceof Error ? e.message : String(e)}`);
|
|
6520
6520
|
}
|
|
@@ -46441,7 +46441,7 @@ class BrokerClient {
|
|
|
46441
46441
|
memberId: this.mesh.memberId,
|
|
46442
46442
|
pubkey: this.mesh.pubkey,
|
|
46443
46443
|
sessionPubkey: this.sessionPubkey,
|
|
46444
|
-
displayName: process.env.CLAUDEMESH_DISPLAY_NAME || undefined,
|
|
46444
|
+
displayName: process.env.CLAUDEMESH_DISPLAY_NAME || this.opts.displayName || undefined,
|
|
46445
46445
|
sessionId: `${process.pid}-${Date.now()}`,
|
|
46446
46446
|
pid: process.pid,
|
|
46447
46447
|
cwd: process.cwd(),
|
|
@@ -46715,11 +46715,12 @@ function randomNonce() {
|
|
|
46715
46715
|
// src/ws/manager.ts
|
|
46716
46716
|
init_env();
|
|
46717
46717
|
var clients = new Map;
|
|
46718
|
+
var configDisplayName;
|
|
46718
46719
|
async function ensureClient(mesh) {
|
|
46719
46720
|
const existing = clients.get(mesh.meshId);
|
|
46720
46721
|
if (existing)
|
|
46721
46722
|
return existing;
|
|
46722
|
-
const client = new BrokerClient(mesh, { debug: env.CLAUDEMESH_DEBUG });
|
|
46723
|
+
const client = new BrokerClient(mesh, { debug: env.CLAUDEMESH_DEBUG, displayName: configDisplayName });
|
|
46723
46724
|
clients.set(mesh.meshId, client);
|
|
46724
46725
|
try {
|
|
46725
46726
|
await client.connect();
|
|
@@ -46727,6 +46728,7 @@ async function ensureClient(mesh) {
|
|
|
46727
46728
|
return client;
|
|
46728
46729
|
}
|
|
46729
46730
|
async function startClients(config2) {
|
|
46731
|
+
configDisplayName = config2.displayName;
|
|
46730
46732
|
await Promise.allSettled(config2.meshes.map(ensureClient));
|
|
46731
46733
|
}
|
|
46732
46734
|
function findClient(needle) {
|
|
@@ -47561,6 +47563,7 @@ function parseArgs(argv) {
|
|
|
47561
47563
|
joinLink: null,
|
|
47562
47564
|
meshSlug: null,
|
|
47563
47565
|
quiet: false,
|
|
47566
|
+
skipPermConfirm: false,
|
|
47564
47567
|
claudeArgs: []
|
|
47565
47568
|
};
|
|
47566
47569
|
let i = 0;
|
|
@@ -47580,6 +47583,8 @@ function parseArgs(argv) {
|
|
|
47580
47583
|
result.meshSlug = arg.slice("--mesh=".length);
|
|
47581
47584
|
} else if (arg === "--quiet") {
|
|
47582
47585
|
result.quiet = true;
|
|
47586
|
+
} else if (arg === "-y" || arg === "--yes") {
|
|
47587
|
+
result.skipPermConfirm = true;
|
|
47583
47588
|
} else if (arg === "--") {
|
|
47584
47589
|
result.claudeArgs.push(...argv.slice(i + 1));
|
|
47585
47590
|
break;
|
|
@@ -47613,6 +47618,37 @@ async function pickMesh(meshes) {
|
|
|
47613
47618
|
});
|
|
47614
47619
|
});
|
|
47615
47620
|
}
|
|
47621
|
+
async function confirmPermissions() {
|
|
47622
|
+
const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
|
|
47623
|
+
const bold = (s) => useColor ? `\x1B[1m${s}\x1B[22m` : s;
|
|
47624
|
+
const dim = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
|
|
47625
|
+
const yellow = (s) => useColor ? `\x1B[33m${s}\x1B[39m` : s;
|
|
47626
|
+
console.log(yellow(bold(" Autonomous mode")));
|
|
47627
|
+
console.log("");
|
|
47628
|
+
console.log(" Claude will send and receive peer messages without asking");
|
|
47629
|
+
console.log(" you first. Peers exchange text only — no file access,");
|
|
47630
|
+
console.log(" no tool calls, no code execution.");
|
|
47631
|
+
console.log("");
|
|
47632
|
+
console.log(dim(" Same as: claude --dangerously-skip-permissions"));
|
|
47633
|
+
console.log(dim(" Skip this prompt: claudemesh launch -y"));
|
|
47634
|
+
console.log("");
|
|
47635
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
47636
|
+
return new Promise((resolve2, reject) => {
|
|
47637
|
+
rl.question(` ${bold("Continue?")} [Y/n] `, (answer) => {
|
|
47638
|
+
rl.close();
|
|
47639
|
+
const a = answer.trim().toLowerCase();
|
|
47640
|
+
if (a === "" || a === "y" || a === "yes") {
|
|
47641
|
+
resolve2();
|
|
47642
|
+
} else {
|
|
47643
|
+
console.log(`
|
|
47644
|
+
Aborted. Run without autonomous mode:`);
|
|
47645
|
+
console.log(` claude --dangerously-load-development-channels server:claudemesh
|
|
47646
|
+
`);
|
|
47647
|
+
process.exit(0);
|
|
47648
|
+
}
|
|
47649
|
+
});
|
|
47650
|
+
});
|
|
47651
|
+
}
|
|
47616
47652
|
function printBanner(name, meshSlug) {
|
|
47617
47653
|
const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
|
|
47618
47654
|
const dim = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
|
|
@@ -47676,16 +47712,22 @@ async function runLaunch(extraArgs) {
|
|
|
47676
47712
|
const tmpDir = mkdtempSync(join4(tmpdir(), "claudemesh-"));
|
|
47677
47713
|
const sessionConfig = {
|
|
47678
47714
|
version: 1,
|
|
47679
|
-
meshes: [mesh]
|
|
47715
|
+
meshes: [mesh],
|
|
47716
|
+
displayName
|
|
47680
47717
|
};
|
|
47681
47718
|
writeFileSync4(join4(tmpDir, "config.json"), JSON.stringify(sessionConfig, null, 2) + `
|
|
47682
47719
|
`, "utf-8");
|
|
47683
|
-
if (!args.quiet)
|
|
47720
|
+
if (!args.quiet) {
|
|
47684
47721
|
printBanner(displayName, mesh.slug);
|
|
47722
|
+
if (!args.skipPermConfirm) {
|
|
47723
|
+
await confirmPermissions();
|
|
47724
|
+
}
|
|
47725
|
+
}
|
|
47685
47726
|
const filtered = [];
|
|
47686
47727
|
for (let i = 0;i < args.claudeArgs.length; i++) {
|
|
47687
|
-
if (args.claudeArgs[i] === "--dangerously-load-development-channels") {
|
|
47688
|
-
i
|
|
47728
|
+
if (args.claudeArgs[i] === "--dangerously-load-development-channels" || args.claudeArgs[i] === "--dangerously-skip-permissions") {
|
|
47729
|
+
if (args.claudeArgs[i] === "--dangerously-load-development-channels")
|
|
47730
|
+
i++;
|
|
47689
47731
|
continue;
|
|
47690
47732
|
}
|
|
47691
47733
|
filtered.push(args.claudeArgs[i]);
|
|
@@ -47693,6 +47735,7 @@ async function runLaunch(extraArgs) {
|
|
|
47693
47735
|
const claudeArgs = [
|
|
47694
47736
|
"--dangerously-load-development-channels",
|
|
47695
47737
|
"server:claudemesh",
|
|
47738
|
+
"--dangerously-skip-permissions",
|
|
47696
47739
|
...filtered
|
|
47697
47740
|
];
|
|
47698
47741
|
const isWindows = process.platform === "win32";
|
|
@@ -47743,7 +47786,7 @@ init_config();
|
|
|
47743
47786
|
// package.json
|
|
47744
47787
|
var package_default = {
|
|
47745
47788
|
name: "claudemesh-cli",
|
|
47746
|
-
version: "0.1.
|
|
47789
|
+
version: "0.1.14",
|
|
47747
47790
|
description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
|
47748
47791
|
keywords: [
|
|
47749
47792
|
"claude-code",
|