claudemesh-cli 0.6.0 → 0.6.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.
Files changed (2) hide show
  1. package/dist/index.js +97 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -49399,6 +49399,73 @@ function writeClaudeSettings(obj) {
49399
49399
  writeFileSync2(CLAUDE_SETTINGS, JSON.stringify(obj, null, 2) + `
49400
49400
  `, "utf-8");
49401
49401
  }
49402
+ var CLAUDEMESH_TOOLS = [
49403
+ "mcp__claudemesh__send_message",
49404
+ "mcp__claudemesh__list_peers",
49405
+ "mcp__claudemesh__check_messages",
49406
+ "mcp__claudemesh__set_summary",
49407
+ "mcp__claudemesh__set_status",
49408
+ "mcp__claudemesh__join_group",
49409
+ "mcp__claudemesh__leave_group",
49410
+ "mcp__claudemesh__get_state",
49411
+ "mcp__claudemesh__set_state",
49412
+ "mcp__claudemesh__list_state",
49413
+ "mcp__claudemesh__remember",
49414
+ "mcp__claudemesh__recall",
49415
+ "mcp__claudemesh__forget",
49416
+ "mcp__claudemesh__share_file",
49417
+ "mcp__claudemesh__get_file",
49418
+ "mcp__claudemesh__list_files",
49419
+ "mcp__claudemesh__file_status",
49420
+ "mcp__claudemesh__delete_file",
49421
+ "mcp__claudemesh__vector_store",
49422
+ "mcp__claudemesh__vector_search",
49423
+ "mcp__claudemesh__vector_delete",
49424
+ "mcp__claudemesh__list_collections",
49425
+ "mcp__claudemesh__graph_query",
49426
+ "mcp__claudemesh__graph_execute",
49427
+ "mcp__claudemesh__mesh_info",
49428
+ "mcp__claudemesh__ping_mesh",
49429
+ "mcp__claudemesh__message_status",
49430
+ "mcp__claudemesh__share_context",
49431
+ "mcp__claudemesh__get_context",
49432
+ "mcp__claudemesh__list_contexts",
49433
+ "mcp__claudemesh__create_task",
49434
+ "mcp__claudemesh__claim_task",
49435
+ "mcp__claudemesh__complete_task",
49436
+ "mcp__claudemesh__list_tasks",
49437
+ "mcp__claudemesh__create_stream",
49438
+ "mcp__claudemesh__publish",
49439
+ "mcp__claudemesh__subscribe",
49440
+ "mcp__claudemesh__list_streams",
49441
+ "mcp__claudemesh__mesh_execute",
49442
+ "mcp__claudemesh__mesh_query",
49443
+ "mcp__claudemesh__mesh_schema"
49444
+ ];
49445
+ function installAllowedTools() {
49446
+ const settings = readClaudeSettings();
49447
+ const existing = new Set(settings.allowedTools ?? []);
49448
+ const toAdd = CLAUDEMESH_TOOLS.filter((t) => !existing.has(t));
49449
+ if (toAdd.length > 0) {
49450
+ settings.allowedTools = [...Array.from(existing), ...toAdd];
49451
+ writeClaudeSettings(settings);
49452
+ }
49453
+ return { added: toAdd, unchanged: CLAUDEMESH_TOOLS.length - toAdd.length };
49454
+ }
49455
+ function uninstallAllowedTools() {
49456
+ if (!existsSync2(CLAUDE_SETTINGS))
49457
+ return 0;
49458
+ const settings = readClaudeSettings();
49459
+ const existing = settings.allowedTools ?? [];
49460
+ const toolSet = new Set(CLAUDEMESH_TOOLS);
49461
+ const kept = existing.filter((t) => !toolSet.has(t));
49462
+ const removed = existing.length - kept.length;
49463
+ if (removed > 0) {
49464
+ settings.allowedTools = kept;
49465
+ writeClaudeSettings(settings);
49466
+ }
49467
+ return removed;
49468
+ }
49402
49469
  function installHooks() {
49403
49470
  const settings = readClaudeSettings();
49404
49471
  const hooks = (settings.hooks ??= {}) ?? {};
@@ -49475,6 +49542,19 @@ function runInstall(args = []) {
49475
49542
  console.log(`✓ MCP server "${MCP_NAME}" ${action}`);
49476
49543
  console.log(dim(` config: ${CLAUDE_CONFIG}`));
49477
49544
  console.log(dim(` command: ${desired.command}${desired.args?.length ? " " + desired.args.join(" ") : ""}`));
49545
+ try {
49546
+ const { added, unchanged } = installAllowedTools();
49547
+ if (added.length > 0) {
49548
+ console.log(`✓ allowedTools: ${added.length} claudemesh tools pre-approved${unchanged > 0 ? `, ${unchanged} already present` : ""}`);
49549
+ console.log(dim(` This lets claudemesh tools run without --dangerously-skip-permissions.`));
49550
+ console.log(dim(` Your existing allowedTools entries were preserved.`));
49551
+ } else {
49552
+ console.log(`✓ allowedTools: all ${unchanged} claudemesh tools already pre-approved`);
49553
+ }
49554
+ console.log(dim(` config: ${CLAUDE_SETTINGS}`));
49555
+ } catch (e) {
49556
+ console.error(`⚠ allowedTools update failed: ${e instanceof Error ? e.message : String(e)}`);
49557
+ }
49478
49558
  if (!skipHooks) {
49479
49559
  try {
49480
49560
  const { added, unchanged } = installHooks();
@@ -49508,6 +49588,16 @@ function runUninstall() {
49508
49588
  } else {
49509
49589
  console.log(`· MCP server "${MCP_NAME}" not present`);
49510
49590
  }
49591
+ try {
49592
+ const removed = uninstallAllowedTools();
49593
+ if (removed > 0) {
49594
+ console.log(`✓ allowedTools: ${removed} claudemesh tools removed`);
49595
+ } else {
49596
+ console.log("· No claudemesh allowedTools to remove");
49597
+ }
49598
+ } catch (e) {
49599
+ console.error(`⚠ allowedTools removal failed: ${e instanceof Error ? e.message : String(e)}`);
49600
+ }
49511
49601
  try {
49512
49602
  const removed = uninstallHooks();
49513
49603
  if (removed > 0) {
@@ -49911,12 +50001,12 @@ async function confirmPermissions() {
49911
50001
  const yellow = (s) => useColor ? `\x1B[33m${s}\x1B[39m` : s;
49912
50002
  console.log(yellow(bold2(" Autonomous mode")));
49913
50003
  console.log("");
49914
- console.log(" Claude will send and receive peer messages without asking");
49915
- console.log(" you first. Peers exchange text only no file access,");
49916
- console.log(" no tool calls, no code execution.");
50004
+ console.log(" Claude will run with --dangerously-skip-permissions, bypassing");
50005
+ console.log(" ALL permission prompts not just claudemesh tools.");
50006
+ console.log(" Peers exchange text only — no file access, no tool calls.");
49917
50007
  console.log("");
49918
- console.log(dim(" Same as: claude --dangerously-skip-permissions"));
49919
- console.log(dim(" Skip this prompt: claudemesh launch -y"));
50008
+ console.log(dim(" Without -y: only claudemesh tools are pre-approved (via allowedTools)."));
50009
+ console.log(dim(" Use -y for autonomous agents. Omit it for shared/multi-person meshes."));
49920
50010
  console.log("");
49921
50011
  const rl = createInterface({ input: process.stdin, output: process.stdout });
49922
50012
  return new Promise((resolve2, reject) => {
@@ -50089,7 +50179,7 @@ async function runLaunch(flags, rawArgs) {
50089
50179
  const claudeArgs = [
50090
50180
  "--dangerously-load-development-channels",
50091
50181
  "server:claudemesh",
50092
- "--dangerously-skip-permissions",
50182
+ ...args.skipPermConfirm ? ["--dangerously-skip-permissions"] : [],
50093
50183
  ...args.systemPrompt ? ["--system-prompt", args.systemPrompt] : [],
50094
50184
  ...filtered
50095
50185
  ];
@@ -50142,7 +50232,7 @@ init_config();
50142
50232
  // package.json
50143
50233
  var package_default = {
50144
50234
  name: "claudemesh-cli",
50145
- version: "0.6.0",
50235
+ version: "0.6.1",
50146
50236
  description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
50147
50237
  keywords: [
50148
50238
  "claude-code",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudemesh-cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
5
5
  "keywords": [
6
6
  "claude-code",