claudemesh-cli 1.30.0 → 1.30.2

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.
@@ -104,7 +104,7 @@ __export(exports_urls, {
104
104
  VERSION: () => VERSION,
105
105
  URLS: () => URLS
106
106
  });
107
- var URLS, VERSION = "1.30.0", env;
107
+ var URLS, VERSION = "1.30.2", env;
108
108
  var init_urls = __esm(() => {
109
109
  URLS = {
110
110
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -11521,11 +11521,12 @@ function installDarwin(args) {
11521
11521
  const plist = darwinPlistPath();
11522
11522
  mkdirSync7(dirname5(plist), { recursive: true });
11523
11523
  const log2 = DAEMON_PATHS.LOG_FILE;
11524
+ const nodeBin = process.execPath;
11524
11525
  const meshArgs = [
11526
+ `<string>${escapeXml(args.binaryPath)}</string>`,
11525
11527
  "<string>daemon</string>",
11526
11528
  "<string>up</string>",
11527
- "<string>--mesh</string>",
11528
- `<string>${escapeXml(args.meshSlug)}</string>`,
11529
+ ...args.meshSlug ? ["<string>--mesh</string>", `<string>${escapeXml(args.meshSlug)}</string>`] : [],
11529
11530
  ...args.displayName ? ["<string>--name</string>", `<string>${escapeXml(args.displayName)}</string>`] : []
11530
11531
  ].join(`
11531
11532
  `);
@@ -11537,7 +11538,7 @@ function installDarwin(args) {
11537
11538
  <string>${SERVICE_LABEL}</string>
11538
11539
  <key>ProgramArguments</key>
11539
11540
  <array>
11540
- <string>${escapeXml(args.binaryPath)}</string>
11541
+ <string>${escapeXml(nodeBin)}</string>
11541
11542
  ${meshArgs}
11542
11543
  </array>
11543
11544
  <key>RunAtLoad</key>
@@ -11561,6 +11562,20 @@ function installDarwin(args) {
11561
11562
  </plist>
11562
11563
  `;
11563
11564
  writeFileSync11(plist, xml, { mode: 420 });
11565
+ try {
11566
+ execSync2(`launchctl bootout gui/$(id -u)/${SERVICE_LABEL}`, { stdio: "ignore" });
11567
+ } catch {}
11568
+ try {
11569
+ const pidPath = DAEMON_PATHS.PID_FILE;
11570
+ if (existsSync12(pidPath)) {
11571
+ const pid = parseInt(readFileSync11(pidPath, "utf8").trim(), 10);
11572
+ if (Number.isFinite(pid) && pid > 0) {
11573
+ try {
11574
+ process.kill(pid, "SIGTERM");
11575
+ } catch {}
11576
+ }
11577
+ }
11578
+ } catch {}
11564
11579
  return {
11565
11580
  platform: "darwin",
11566
11581
  unitPath: plist,
@@ -11573,11 +11588,11 @@ function linuxUnitPath() {
11573
11588
  function installLinux(args) {
11574
11589
  const unit = linuxUnitPath();
11575
11590
  mkdirSync7(dirname5(unit), { recursive: true });
11591
+ const nodeBin = process.execPath;
11576
11592
  const execArgs = [
11577
11593
  "daemon",
11578
11594
  "up",
11579
- "--mesh",
11580
- args.meshSlug,
11595
+ ...args.meshSlug ? ["--mesh", args.meshSlug] : [],
11581
11596
  ...args.displayName ? ["--name", args.displayName] : []
11582
11597
  ].map(shellQuote).join(" ");
11583
11598
  const content = `[Unit]
@@ -11587,7 +11602,7 @@ Wants=network-online.target
11587
11602
 
11588
11603
  [Service]
11589
11604
  Type=simple
11590
- ExecStart=${shellQuote(args.binaryPath)} ${execArgs}
11605
+ ExecStart=${shellQuote(nodeBin)} ${shellQuote(args.binaryPath)} ${execArgs}
11591
11606
  Restart=always
11592
11607
  RestartSec=3
11593
11608
  StandardOutput=append:${DAEMON_PATHS.LOG_FILE}
@@ -11598,6 +11613,20 @@ Environment=PATH=/usr/local/bin:/usr/bin:/bin
11598
11613
  WantedBy=default.target
11599
11614
  `;
11600
11615
  writeFileSync11(unit, content, { mode: 420 });
11616
+ try {
11617
+ execSync2(`systemctl --user stop ${SYSTEMD_UNIT}`, { stdio: "ignore" });
11618
+ } catch {}
11619
+ try {
11620
+ const pidPath = DAEMON_PATHS.PID_FILE;
11621
+ if (existsSync12(pidPath)) {
11622
+ const pid = parseInt(readFileSync11(pidPath, "utf8").trim(), 10);
11623
+ if (Number.isFinite(pid) && pid > 0) {
11624
+ try {
11625
+ process.kill(pid, "SIGTERM");
11626
+ } catch {}
11627
+ }
11628
+ }
11629
+ } catch {}
11601
11630
  return {
11602
11631
  platform: "linux",
11603
11632
  unitPath: unit,
@@ -11786,11 +11815,6 @@ async function runInstallService(opts) {
11786
11815
  const platform5 = detectPlatform2();
11787
11816
  if (!platform5) {
11788
11817
  process.stderr.write(`unsupported platform: ${process.platform}
11789
- `);
11790
- return 2;
11791
- }
11792
- if (!opts.mesh) {
11793
- process.stderr.write(`pass --mesh <slug> so the service knows which mesh to attach to
11794
11818
  `);
11795
11819
  return 2;
11796
11820
  }
@@ -11808,8 +11832,8 @@ async function runInstallService(opts) {
11808
11832
  try {
11809
11833
  const r = installService2({
11810
11834
  binaryPath: binary,
11811
- meshSlug: opts.mesh,
11812
- displayName: opts.displayName
11835
+ ...opts.mesh ? { meshSlug: opts.mesh } : {},
11836
+ ...opts.displayName ? { displayName: opts.displayName } : {}
11813
11837
  });
11814
11838
  if (opts.json) {
11815
11839
  process.stdout.write(JSON.stringify({ ok: true, ...r }) + `
@@ -12295,17 +12319,15 @@ function runInstall(args = []) {
12295
12319
  }
12296
12320
  }
12297
12321
  let hasMeshes = false;
12298
- let primaryMesh;
12299
12322
  try {
12300
12323
  const meshConfig = readConfig();
12301
12324
  hasMeshes = meshConfig.meshes.length > 0;
12302
- primaryMesh = meshConfig.meshes[0]?.slug;
12303
12325
  } catch {}
12304
- if (!skipService && hasMeshes && primaryMesh) {
12326
+ if (!skipService && hasMeshes) {
12305
12327
  try {
12306
- installDaemonService(entry, primaryMesh);
12328
+ installDaemonService(entry);
12307
12329
  } catch (e) {
12308
- render.warn(`daemon service install failed: ${e instanceof Error ? e.message : String(e)}`, "Run `claudemesh daemon install-service --mesh <slug>` to retry.");
12330
+ render.warn(`daemon service install failed: ${e instanceof Error ? e.message : String(e)}`, "Run `claudemesh daemon install-service` to retry.");
12309
12331
  }
12310
12332
  } else if (skipService) {
12311
12333
  render.info(dim("· Daemon service skipped (--no-service)"));
@@ -12331,7 +12353,7 @@ function runInstall(args = []) {
12331
12353
  render.info(dim(` claudemesh install --status-line # live peer count in Claude Code`));
12332
12354
  render.info(dim(` claudemesh completions zsh # shell completions`));
12333
12355
  }
12334
- function installDaemonService(binaryEntry, meshSlug) {
12356
+ function installDaemonService(binaryEntry) {
12335
12357
  const {
12336
12358
  installService: installService2,
12337
12359
  detectPlatform: detectPlatform2
@@ -12347,15 +12369,15 @@ function installDaemonService(binaryEntry, meshSlug) {
12347
12369
  const { execSync: execSync3 } = __require("node:child_process");
12348
12370
  binary = execSync3("which claudemesh", { encoding: "utf8" }).trim();
12349
12371
  } catch {
12350
- render.warn("couldn't resolve a 'claudemesh' binary on PATH; daemon service skipped", "Install via npm/homebrew, then run `claudemesh daemon install-service --mesh " + meshSlug + "`");
12372
+ render.warn("couldn't resolve a 'claudemesh' binary on PATH; daemon service skipped", "Install via npm/homebrew, then run `claudemesh daemon install-service`");
12351
12373
  return;
12352
12374
  }
12353
12375
  }
12354
- const r = installService2({ binaryPath: binary, meshSlug });
12376
+ const r = installService2({ binaryPath: binary });
12355
12377
  render.ok(`daemon service installed (${r.platform})`);
12356
12378
  render.kv([
12357
12379
  ["unit", dim(r.unitPath)],
12358
- ["mesh", dim(meshSlug)]
12380
+ ["mesh", dim("(all joined meshes)")]
12359
12381
  ]);
12360
12382
  try {
12361
12383
  const { execSync: execSync3 } = __require("node:child_process");
@@ -19871,4 +19893,4 @@ main().catch((err) => {
19871
19893
  process.exit(EXIT.INTERNAL_ERROR);
19872
19894
  });
19873
19895
 
19874
- //# debugId=A7687DD2912DA01C64756E2164756E21
19896
+ //# debugId=1914F24E0644F66A64756E2164756E21