claudemesh-cli 1.0.0-alpha.4 → 1.0.0-alpha.5

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.
@@ -278,21 +278,6 @@ var init_my = __esm(() => {
278
278
  });
279
279
 
280
280
  // src/services/api/public.ts
281
- var exports_public = {};
282
- __export(exports_public, {
283
- requestDeviceCode: () => requestDeviceCode,
284
- pollDeviceCode: () => pollDeviceCode,
285
- claimInvite: () => claimInvite
286
- });
287
- async function claimInvite(code, body) {
288
- return post(`/api/public/invites/${code}/claim`, body);
289
- }
290
- async function requestDeviceCode(deviceInfo) {
291
- return post("/api/auth/cli/device-code/new", deviceInfo);
292
- }
293
- async function pollDeviceCode(deviceCode) {
294
- return get(`/api/auth/cli/device-code/${deviceCode}`);
295
- }
296
281
  var init_public = __esm(() => {
297
282
  init_client();
298
283
  });
@@ -305,24 +290,6 @@ var init_facade2 = __esm(() => {
305
290
  init_public();
306
291
  });
307
292
 
308
- // src/services/device/info.ts
309
- import { hostname, platform, arch, release } from "node:os";
310
- function getDeviceInfo() {
311
- return {
312
- hostname: hostname(),
313
- platform: platform(),
314
- arch: arch(),
315
- osRelease: release(),
316
- nodeVersion: process.version
317
- };
318
- }
319
- var init_info = () => {};
320
-
321
- // src/services/device/facade.ts
322
- var init_facade3 = __esm(() => {
323
- init_info();
324
- });
325
-
326
293
  // src/services/spawn/claude.ts
327
294
  import { spawnSync } from "node:child_process";
328
295
  import { existsSync } from "node:fs";
@@ -356,10 +323,10 @@ var init_claude = () => {};
356
323
 
357
324
  // src/services/spawn/browser.ts
358
325
  import { execFile } from "node:child_process";
359
- import { platform as platform2 } from "node:os";
326
+ import { platform } from "node:os";
360
327
  function openBrowser(url) {
361
328
  return new Promise((resolve, reject) => {
362
- const os = platform2();
329
+ const os = platform();
363
330
  let bin;
364
331
  let args;
365
332
  if (os === "darwin") {
@@ -389,7 +356,7 @@ __export(exports_facade, {
389
356
  openBrowser: () => openBrowser,
390
357
  findClaudeBinary: () => findClaudeBinary
391
358
  });
392
- var init_facade4 = __esm(() => {
359
+ var init_facade3 = __esm(() => {
393
360
  init_claude();
394
361
  init_browser();
395
362
  });
@@ -457,7 +424,7 @@ var init_read = __esm(() => {
457
424
 
458
425
  // src/services/config/write.ts
459
426
  import { writeFileSync, mkdirSync, chmodSync, openSync, closeSync, renameSync } from "node:fs";
460
- import { platform as platform3 } from "node:os";
427
+ import { platform as platform2 } from "node:os";
461
428
  function ensureConfigDir() {
462
429
  mkdirSync(PATHS.CONFIG_DIR, { recursive: true });
463
430
  if (!isWindows) {
@@ -510,7 +477,7 @@ var isWindows;
510
477
  var init_write = __esm(() => {
511
478
  init_paths();
512
479
  init_read();
513
- isWindows = platform3() === "win32";
480
+ isWindows = platform2() === "win32";
514
481
  });
515
482
 
516
483
  // src/services/config/facade.ts
@@ -528,7 +495,7 @@ __export(exports_facade2, {
528
495
  function getConfigPath() {
529
496
  return PATHS.CONFIG_FILE;
530
497
  }
531
- var init_facade5 = __esm(() => {
498
+ var init_facade4 = __esm(() => {
532
499
  init_read();
533
500
  init_write();
534
501
  init_paths();
@@ -565,9 +532,69 @@ function clearToken() {
565
532
  }
566
533
  var init_token_store = __esm(() => {
567
534
  init_paths();
568
- init_facade5();
535
+ init_facade4();
569
536
  });
570
537
 
538
+ // src/services/auth/callback-listener.ts
539
+ import { createServer } from "node:http";
540
+ function startCallbackListener() {
541
+ return new Promise((resolveStart) => {
542
+ let resolveToken;
543
+ let resolved = false;
544
+ const tokenPromise = new Promise((r) => {
545
+ resolveToken = r;
546
+ });
547
+ const server = createServer((req, res) => {
548
+ const url = new URL(req.url, "http://localhost");
549
+ if (req.method === "OPTIONS") {
550
+ res.writeHead(204, {
551
+ "Access-Control-Allow-Origin": "https://claudemesh.com",
552
+ "Access-Control-Allow-Methods": "GET",
553
+ "Access-Control-Allow-Headers": "Content-Type"
554
+ });
555
+ res.end();
556
+ return;
557
+ }
558
+ if (url.pathname === "/ping") {
559
+ res.writeHead(200, {
560
+ "Content-Type": "text/plain",
561
+ "Access-Control-Allow-Origin": "https://claudemesh.com"
562
+ });
563
+ res.end("ok");
564
+ return;
565
+ }
566
+ if (url.pathname === "/callback") {
567
+ const token = url.searchParams.get("token");
568
+ if (token && !resolved) {
569
+ resolved = true;
570
+ res.writeHead(200, {
571
+ "Content-Type": "text/html",
572
+ "Access-Control-Allow-Origin": "https://claudemesh.com"
573
+ });
574
+ res.end("<html><body><h2>Done! You can close this tab.</h2></body></html>");
575
+ resolveToken(token);
576
+ setTimeout(() => server.close(), 500);
577
+ } else {
578
+ res.writeHead(400, { "Content-Type": "text/plain" });
579
+ res.end("Missing token");
580
+ }
581
+ return;
582
+ }
583
+ res.writeHead(404);
584
+ res.end();
585
+ });
586
+ server.listen(0, "127.0.0.1", () => {
587
+ const addr = server.address();
588
+ resolveStart({
589
+ port: addr.port,
590
+ token: tokenPromise,
591
+ close: () => server.close()
592
+ });
593
+ });
594
+ });
595
+ }
596
+ var init_callback_listener = () => {};
597
+
571
598
  // src/services/auth/errors.ts
572
599
  var AuthError, DeviceCodeExpired, NotSignedIn;
573
600
  var init_errors2 = __esm(() => {
@@ -591,55 +618,55 @@ var init_errors2 = __esm(() => {
591
618
 
592
619
  // src/services/auth/device-code.ts
593
620
  async function loginWithDeviceCode() {
594
- const device = getDeviceInfo();
595
- const { device_code, user_code, verification_url } = await exports_public.requestDeviceCode({
596
- hostname: device.hostname,
597
- platform: device.platform,
598
- arch: device.arch
599
- });
621
+ const listener = await startCallbackListener();
622
+ const authUrl = `${URLS.API_BASE}/cli-auth?port=${listener.port}`;
600
623
  log(`
601
624
  Opening browser for sign-in…
602
625
  `);
603
626
  log(` If your browser didn't open, visit:`);
604
- log(` ${verification_url}?code=${user_code}
627
+ log(` ${authUrl}
605
628
  `);
606
629
  log(` Waiting for confirmation…
607
630
  `);
608
631
  try {
609
- await openBrowser(`${verification_url}?code=${user_code}`);
632
+ await openBrowser(authUrl);
610
633
  } catch {
611
634
  warn("Could not open browser automatically.");
612
635
  }
613
- const startTime = Date.now();
614
- while (Date.now() - startTime < TIMINGS.DEVICE_CODE_TIMEOUT_MS) {
615
- await new Promise((r) => setTimeout(r, TIMINGS.DEVICE_CODE_POLL_MS));
616
- let poll;
617
- try {
618
- poll = await exports_public.pollDeviceCode(device_code);
619
- } catch {
620
- continue;
621
- }
622
- if (poll.status === "approved" && poll.session_token && poll.user) {
623
- storeToken({
624
- session_token: poll.session_token,
625
- user: poll.user,
626
- token_source: "device-code"
627
- });
628
- return { user: poll.user, session_token: poll.session_token };
629
- }
630
- if (poll.status === "expired") {
631
- throw new DeviceCodeExpired;
632
- }
636
+ let token;
637
+ try {
638
+ token = await Promise.race([
639
+ listener.token,
640
+ new Promise((_, reject) => setTimeout(() => reject(new DeviceCodeExpired), 5 * 60 * 1000))
641
+ ]);
642
+ } finally {
643
+ listener.close();
633
644
  }
634
- throw new DeviceCodeExpired;
645
+ let user = { id: "", display_name: "", email: "" };
646
+ try {
647
+ const parts = token.split(".");
648
+ if (parts[1]) {
649
+ const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString());
650
+ user = {
651
+ id: payload.sub ?? "",
652
+ display_name: payload.name ?? payload.email ?? "",
653
+ email: payload.email ?? ""
654
+ };
655
+ }
656
+ } catch {}
657
+ storeToken({
658
+ session_token: token,
659
+ user,
660
+ token_source: "callback"
661
+ });
662
+ return { user, session_token: token };
635
663
  }
636
664
  var init_device_code = __esm(() => {
637
- init_timings();
638
- init_facade2();
665
+ init_urls();
639
666
  init_facade3();
640
- init_facade4();
641
667
  init_facade();
642
668
  init_token_store();
669
+ init_callback_listener();
643
670
  init_errors2();
644
671
  });
645
672
 
@@ -683,7 +710,7 @@ async function logout() {
683
710
  return { revoked };
684
711
  }
685
712
  async function register(callbackPort) {
686
- const { openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_facade4(), exports_facade));
713
+ const { openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_facade3(), exports_facade));
687
714
  const url = `https://claudemesh.com/register?source=cli&callback=http://localhost:${callbackPort}`;
688
715
  await openBrowser2(url);
689
716
  }
@@ -731,66 +758,6 @@ var init_dashboard_sync = __esm(() => {
731
758
  init_urls();
732
759
  });
733
760
 
734
- // src/services/auth/callback-listener.ts
735
- import { createServer } from "node:http";
736
- function startCallbackListener() {
737
- return new Promise((resolveStart) => {
738
- let resolveToken;
739
- let resolved = false;
740
- const tokenPromise = new Promise((r) => {
741
- resolveToken = r;
742
- });
743
- const server = createServer((req, res) => {
744
- const url = new URL(req.url, "http://localhost");
745
- if (req.method === "OPTIONS") {
746
- res.writeHead(204, {
747
- "Access-Control-Allow-Origin": "https://claudemesh.com",
748
- "Access-Control-Allow-Methods": "GET",
749
- "Access-Control-Allow-Headers": "Content-Type"
750
- });
751
- res.end();
752
- return;
753
- }
754
- if (url.pathname === "/ping") {
755
- res.writeHead(200, {
756
- "Content-Type": "text/plain",
757
- "Access-Control-Allow-Origin": "https://claudemesh.com"
758
- });
759
- res.end("ok");
760
- return;
761
- }
762
- if (url.pathname === "/callback") {
763
- const token = url.searchParams.get("token");
764
- if (token && !resolved) {
765
- resolved = true;
766
- res.writeHead(200, {
767
- "Content-Type": "text/html",
768
- "Access-Control-Allow-Origin": "https://claudemesh.com"
769
- });
770
- res.end("<html><body><h2>Done! You can close this tab.</h2></body></html>");
771
- resolveToken(token);
772
- setTimeout(() => server.close(), 500);
773
- } else {
774
- res.writeHead(400, { "Content-Type": "text/plain" });
775
- res.end("Missing token");
776
- }
777
- return;
778
- }
779
- res.writeHead(404);
780
- res.end();
781
- });
782
- server.listen(0, "127.0.0.1", () => {
783
- const addr = server.address();
784
- resolveStart({
785
- port: addr.port,
786
- token: tokenPromise,
787
- close: () => server.close()
788
- });
789
- });
790
- });
791
- }
792
- var init_callback_listener = () => {};
793
-
794
761
  // src/services/auth/facade.ts
795
762
  var exports_facade3 = {};
796
763
  __export(exports_facade3, {
@@ -814,7 +781,7 @@ function generatePairingCode() {
814
781
  return Array.from(bytes, (b) => CHARS[b % CHARS.length]).join("");
815
782
  }
816
783
  var CHARS = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789";
817
- var init_facade6 = __esm(() => {
784
+ var init_facade5 = __esm(() => {
818
785
  init_device_code();
819
786
  init_client2();
820
787
  init_dashboard_sync();
@@ -826,7 +793,7 @@ var init_facade6 = __esm(() => {
826
793
  // src/services/invite/generate.ts
827
794
  var init_generate = __esm(() => {
828
795
  init_facade2();
829
- init_facade6();
796
+ init_facade5();
830
797
  });
831
798
  // src/services/invite/errors.ts
832
799
  var init_errors3 = () => {};
@@ -985,7 +952,7 @@ async function verify(message, signatureHex, publicKeyHex) {
985
952
  return false;
986
953
  }
987
954
  }
988
- var init_facade7 = __esm(() => {
955
+ var init_facade6 = __esm(() => {
989
956
  init_keypair();
990
957
  init_file_crypto();
991
958
  init_box();
@@ -1083,7 +1050,7 @@ async function parseInviteLink2(link) {
1083
1050
  return { payload, raw: link, token: encoded };
1084
1051
  }
1085
1052
  var init_parse_v1 = __esm(() => {
1086
- init_facade7();
1053
+ init_facade6();
1087
1054
  });
1088
1055
 
1089
1056
  // src/services/invite/enroll.ts
@@ -1206,7 +1173,7 @@ function parseV2InviteInput(input) {
1206
1173
  var init_v2 = () => {};
1207
1174
 
1208
1175
  // src/services/invite/facade.ts
1209
- var init_facade8 = __esm(() => {
1176
+ var init_facade7 = __esm(() => {
1210
1177
  init_generate();
1211
1178
  init_errors3();
1212
1179
  init_parse_v1();
@@ -1221,7 +1188,7 @@ __export(exports_join, {
1221
1188
  import sodium3 from "libsodium-wrappers";
1222
1189
  import { writeFileSync as writeFileSync3, mkdirSync as mkdirSync2 } from "node:fs";
1223
1190
  import { join as join2, dirname } from "node:path";
1224
- import { homedir as homedir2, hostname as hostname2 } from "node:os";
1191
+ import { homedir as homedir2, hostname } from "node:os";
1225
1192
  function deriveAppBaseUrl() {
1226
1193
  const override = process.env.CLAUDEMESH_APP_URL;
1227
1194
  if (override)
@@ -1246,7 +1213,7 @@ async function runJoinV2(code) {
1246
1213
  process.exit(1);
1247
1214
  }
1248
1215
  const keypair = await generateKeypair3();
1249
- const displayName = `${hostname2()}-${process.pid}`;
1216
+ const displayName = `${hostname()}-${process.pid}`;
1250
1217
  await sodium3.ready;
1251
1218
  const rootKeyB64 = sodium3.to_base64(claim.rootKey, sodium3.base64_variants.URLSAFE_NO_PADDING);
1252
1219
  const fallbackSlug = `mesh-${claim.meshId.slice(0, 8)}`;
@@ -1300,7 +1267,7 @@ async function runJoin(args) {
1300
1267
  const { payload, token } = invite;
1301
1268
  console.log(`Joining mesh "${payload.mesh_slug}" (${payload.mesh_id})…`);
1302
1269
  const keypair = await generateKeypair3();
1303
- const displayName = `${hostname2()}-${process.pid}`;
1270
+ const displayName = `${hostname()}-${process.pid}`;
1304
1271
  let enroll;
1305
1272
  try {
1306
1273
  enroll = await enrollWithBroker2({
@@ -1343,11 +1310,11 @@ async function runJoin(args) {
1343
1310
  console.log("Restart Claude Code to pick up the new mesh.");
1344
1311
  }
1345
1312
  var init_join = __esm(() => {
1346
- init_facade8();
1347
- init_facade8();
1348
1313
  init_facade7();
1349
- init_facade5();
1350
- init_facade8();
1314
+ init_facade7();
1315
+ init_facade6();
1316
+ init_facade4();
1317
+ init_facade7();
1351
1318
  init_urls();
1352
1319
  });
1353
1320
 
@@ -1402,7 +1369,7 @@ async function login() {
1402
1369
  }
1403
1370
  }
1404
1371
  var init_login = __esm(() => {
1405
- init_facade6();
1372
+ init_facade5();
1406
1373
  init_facade2();
1407
1374
  init_styles();
1408
1375
  init_exit_codes();
@@ -1452,7 +1419,7 @@ async function runWelcome() {
1452
1419
  });
1453
1420
  }
1454
1421
  var init_welcome2 = __esm(() => {
1455
- init_facade5();
1422
+ init_facade4();
1456
1423
  init_welcome();
1457
1424
  init_login();
1458
1425
  init_register();
@@ -1468,7 +1435,7 @@ async function signHello(meshId, memberId, pubkey, secretKeyHex) {
1468
1435
  return { timestamp: timestamp2, signature: s.to_hex(sig) };
1469
1436
  }
1470
1437
  var init_hello_sig = __esm(() => {
1471
- init_facade7();
1438
+ init_facade6();
1472
1439
  });
1473
1440
 
1474
1441
  // src/services/broker/ws-client.ts
@@ -3419,9 +3386,9 @@ function randomNonce() {
3419
3386
  }
3420
3387
  var MAX_QUEUED = 100, HELLO_ACK_TIMEOUT_MS = 5000, BACKOFF_CAPS;
3421
3388
  var init_ws_client = __esm(() => {
3422
- init_facade7();
3389
+ init_facade6();
3423
3390
  init_hello_sig();
3424
- init_facade7();
3391
+ init_facade6();
3425
3392
  BACKOFF_CAPS = [1000, 2000, 4000, 8000, 16000, 30000];
3426
3393
  });
3427
3394
 
@@ -3478,14 +3445,14 @@ var init_manager = __esm(() => {
3478
3445
 
3479
3446
  // src/services/broker/envelope.ts
3480
3447
  var init_envelope = __esm(() => {
3481
- init_facade7();
3448
+ init_facade6();
3482
3449
  });
3483
3450
 
3484
3451
  // src/services/broker/errors.ts
3485
3452
  var init_errors4 = () => {};
3486
3453
 
3487
3454
  // src/services/broker/facade.ts
3488
- var init_facade9 = __esm(() => {
3455
+ var init_facade8 = __esm(() => {
3489
3456
  init_ws_client();
3490
3457
  init_manager();
3491
3458
  init_hello_sig();
@@ -3667,7 +3634,7 @@ __export(exports_launch, {
3667
3634
  import { spawnSync as spawnSync2 } from "node:child_process";
3668
3635
  import { randomUUID } from "node:crypto";
3669
3636
  import { mkdtempSync, writeFileSync as writeFileSync4, rmSync, readdirSync, statSync, existsSync as existsSync4, readFileSync as readFileSync3 } from "node:fs";
3670
- import { tmpdir, hostname as hostname3, homedir as homedir3 } from "node:os";
3637
+ import { tmpdir, hostname as hostname2, homedir as homedir3 } from "node:os";
3671
3638
  import { join as join3 } from "node:path";
3672
3639
  import { createInterface as createInterface3 } from "node:readline";
3673
3640
  async function pickMesh(meshes) {
@@ -3875,7 +3842,7 @@ async function runLaunch(flags, rawArgs) {
3875
3842
  console.log("Joining mesh...");
3876
3843
  const invite = await parseInviteLink(args.joinLink);
3877
3844
  const keypair = await generateKeypair();
3878
- const displayName2 = args.name ?? `${hostname3()}-${process.pid}`;
3845
+ const displayName2 = args.name ?? `${hostname2()}-${process.pid}`;
3879
3846
  const enroll = await enrollWithBroker({
3880
3847
  brokerWsUrl: invite.payload.broker_url,
3881
3848
  inviteToken: invite.token,
@@ -3895,7 +3862,7 @@ async function runLaunch(flags, rawArgs) {
3895
3862
  brokerUrl: invite.payload.broker_url,
3896
3863
  joinedAt: new Date().toISOString()
3897
3864
  });
3898
- const { writeConfig: writeConfig2 } = await Promise.resolve().then(() => (init_facade5(), exports_facade2));
3865
+ const { writeConfig: writeConfig2 } = await Promise.resolve().then(() => (init_facade4(), exports_facade2));
3899
3866
  writeConfig2(config2);
3900
3867
  console.log(`✓ Joined "${invite.payload.mesh_slug}"${enroll.alreadyMember ? " (already member)" : ""}`);
3901
3868
  }
@@ -3942,12 +3909,12 @@ async function runLaunch(flags, rawArgs) {
3942
3909
  Timed out waiting for sign-in.`);
3943
3910
  process.exit(1);
3944
3911
  }
3945
- const { generateKeypair: generateKeypair4 } = await Promise.resolve().then(() => (init_facade7(), exports_facade4));
3912
+ const { generateKeypair: generateKeypair4 } = await Promise.resolve().then(() => (init_facade6(), exports_facade4));
3946
3913
  const keypair = await generateKeypair4();
3947
- const displayNameForSync = args.name ?? `${hostname3()}-${process.pid}`;
3948
- const { syncWithBroker: syncWithBroker2 } = await Promise.resolve().then(() => (init_facade6(), exports_facade3));
3914
+ const displayNameForSync = args.name ?? `${hostname2()}-${process.pid}`;
3915
+ const { syncWithBroker: syncWithBroker2 } = await Promise.resolve().then(() => (init_facade5(), exports_facade3));
3949
3916
  const result2 = await syncWithBroker2(syncToken, keypair.publicKey, displayNameForSync);
3950
- const { writeConfig: writeConfig2 } = await Promise.resolve().then(() => (init_facade5(), exports_facade2));
3917
+ const { writeConfig: writeConfig2 } = await Promise.resolve().then(() => (init_facade4(), exports_facade2));
3951
3918
  for (const m of result2.meshes) {
3952
3919
  config.meshes.push({
3953
3920
  meshId: m.mesh_id,
@@ -3984,7 +3951,7 @@ async function runLaunch(flags, rawArgs) {
3984
3951
  } else {
3985
3952
  mesh = null;
3986
3953
  }
3987
- const displayName = args.name ?? `${hostname3()}-${process.pid}`;
3954
+ const displayName = args.name ?? `${hostname2()}-${process.pid}`;
3988
3955
  let role = args.role;
3989
3956
  let parsedGroups = args.groups ? parseGroupsString(args.groups) : [];
3990
3957
  let messageMode = args.messageMode ?? "push";
@@ -4210,10 +4177,10 @@ async function runLaunch(flags, rawArgs) {
4210
4177
  process.exit(result.status ?? 0);
4211
4178
  }
4212
4179
  var init_launch = __esm(() => {
4213
- init_facade5();
4214
- init_facade6();
4215
4180
  init_facade4();
4216
- init_facade9();
4181
+ init_facade5();
4182
+ init_facade3();
4183
+ init_facade8();
4217
4184
  init_styles();
4218
4185
  init_screen();
4219
4186
  init_spinner();
@@ -7264,8 +7231,8 @@ async function startServiceProxy(serviceName) {
7264
7231
  var peerNameCache, peerNameCacheAge = 0, CACHE_TTL_MS = 30000;
7265
7232
  var init_server = __esm(() => {
7266
7233
  init_definitions();
7267
- init_facade5();
7268
- init_facade9();
7234
+ init_facade4();
7235
+ init_facade8();
7269
7236
  peerNameCache = new Map;
7270
7237
  });
7271
7238
 
@@ -7306,7 +7273,7 @@ async function logout2() {
7306
7273
  }
7307
7274
  }
7308
7275
  var init_logout = __esm(() => {
7309
- init_facade6();
7276
+ init_facade5();
7310
7277
  init_styles();
7311
7278
  init_exit_codes();
7312
7279
  });
@@ -7336,14 +7303,14 @@ async function whoami(opts) {
7336
7303
  return EXIT.SUCCESS;
7337
7304
  }
7338
7305
  var init_whoami = __esm(() => {
7339
- init_facade6();
7306
+ init_facade5();
7340
7307
  init_styles();
7341
7308
  init_exit_codes();
7342
7309
  });
7343
7310
 
7344
7311
  // src/services/mesh/list.ts
7345
7312
  var init_list = __esm(() => {
7346
- init_facade5();
7313
+ init_facade4();
7347
7314
  });
7348
7315
 
7349
7316
  // src/services/mesh/create.ts
@@ -7368,9 +7335,9 @@ async function createMesh2(name, opts) {
7368
7335
  }
7369
7336
  var init_create = __esm(() => {
7370
7337
  init_facade2();
7371
- init_facade6();
7372
- init_facade7();
7373
7338
  init_facade5();
7339
+ init_facade6();
7340
+ init_facade4();
7374
7341
  init_urls();
7375
7342
  });
7376
7343
 
@@ -7383,44 +7350,44 @@ async function renameMesh2(slug, newName) {
7383
7350
  }
7384
7351
  var init_rename = __esm(() => {
7385
7352
  init_facade2();
7386
- init_facade6();
7353
+ init_facade5();
7387
7354
  });
7388
7355
 
7389
7356
  // src/services/mesh/leave.ts
7390
7357
  var init_leave = __esm(() => {
7391
- init_facade5();
7358
+ init_facade4();
7392
7359
  });
7393
7360
 
7394
7361
  // src/services/mesh/join.ts
7395
7362
  var init_join2 = __esm(() => {
7396
7363
  init_facade2();
7397
- init_facade7();
7398
- init_facade5();
7364
+ init_facade6();
7365
+ init_facade4();
7399
7366
  init_urls();
7400
7367
  });
7401
7368
 
7402
7369
  // src/services/state/last-used.ts
7403
7370
  var init_last_used = __esm(() => {
7404
7371
  init_paths();
7405
- init_facade5();
7372
+ init_facade4();
7406
7373
  });
7407
7374
 
7408
7375
  // src/services/state/facade.ts
7409
- var init_facade10 = __esm(() => {
7376
+ var init_facade9 = __esm(() => {
7410
7377
  init_last_used();
7411
7378
  });
7412
7379
 
7413
7380
  // src/services/mesh/resolve-target.ts
7414
7381
  var init_resolve_target = __esm(() => {
7415
- init_facade5();
7416
- init_facade10();
7382
+ init_facade4();
7383
+ init_facade9();
7417
7384
  });
7418
7385
 
7419
7386
  // src/services/mesh/errors.ts
7420
7387
  var init_errors5 = () => {};
7421
7388
 
7422
7389
  // src/services/mesh/facade.ts
7423
- var init_facade11 = __esm(() => {
7390
+ var init_facade10 = __esm(() => {
7424
7391
  init_list();
7425
7392
  init_create();
7426
7393
  init_rename();
@@ -7464,17 +7431,17 @@ async function newMesh(name, opts) {
7464
7431
  }
7465
7432
  }
7466
7433
  var init_new = __esm(() => {
7467
- init_facade11();
7434
+ init_facade10();
7468
7435
  init_styles();
7469
7436
  init_exit_codes();
7470
7437
  });
7471
7438
 
7472
7439
  // src/services/clipboard/read.ts
7473
7440
  import { execSync } from "node:child_process";
7474
- import { platform as platform4 } from "node:os";
7441
+ import { platform as platform3 } from "node:os";
7475
7442
  function writeClipboard(text2) {
7476
7443
  try {
7477
- const os = platform4();
7444
+ const os = platform3();
7478
7445
  if (os === "darwin") {
7479
7446
  execSync("pbcopy", { input: text2 });
7480
7447
  return true;
@@ -7499,7 +7466,7 @@ function writeClipboard(text2) {
7499
7466
  var init_read2 = () => {};
7500
7467
 
7501
7468
  // src/services/clipboard/facade.ts
7502
- var init_facade12 = __esm(() => {
7469
+ var init_facade11 = __esm(() => {
7503
7470
  init_read2();
7504
7471
  });
7505
7472
 
@@ -7552,10 +7519,10 @@ async function invite(email, opts = {}) {
7552
7519
  }
7553
7520
  }
7554
7521
  var init_invite = __esm(() => {
7555
- init_facade6();
7556
- init_facade2();
7557
7522
  init_facade5();
7558
- init_facade12();
7523
+ init_facade2();
7524
+ init_facade4();
7525
+ init_facade11();
7559
7526
  init_styles();
7560
7527
  init_exit_codes();
7561
7528
  });
@@ -7588,7 +7555,7 @@ function runList() {
7588
7555
  console.log(`Config: ${getConfigPath()}`);
7589
7556
  }
7590
7557
  var init_list2 = __esm(() => {
7591
- init_facade5();
7558
+ init_facade4();
7592
7559
  });
7593
7560
 
7594
7561
  // src/commands/leave.ts
@@ -7613,7 +7580,7 @@ function runLeave(args) {
7613
7580
  console.log(`Left mesh "${slug}". Remaining: ${config.meshes.length}`);
7614
7581
  }
7615
7582
  var init_leave2 = __esm(() => {
7616
- init_facade5();
7583
+ init_facade4();
7617
7584
  });
7618
7585
 
7619
7586
  // src/commands/rename.ts
@@ -7632,13 +7599,13 @@ async function rename(slug, newName) {
7632
7599
  }
7633
7600
  }
7634
7601
  var init_rename2 = __esm(() => {
7635
- init_facade11();
7602
+ init_facade10();
7636
7603
  init_styles();
7637
7604
  init_exit_codes();
7638
7605
  });
7639
7606
 
7640
7607
  // src/commands/connect.ts
7641
- import { hostname as hostname4 } from "node:os";
7608
+ import { hostname as hostname3 } from "node:os";
7642
7609
  import { createInterface as createInterface4 } from "node:readline";
7643
7610
  async function pickMesh2(meshes) {
7644
7611
  console.log(`
@@ -7680,7 +7647,7 @@ async function withMesh(opts, fn) {
7680
7647
  } else {
7681
7648
  mesh = await pickMesh2(config.meshes);
7682
7649
  }
7683
- const displayName = opts.displayName ?? config.displayName ?? `${hostname4()}-${process.pid}`;
7650
+ const displayName = opts.displayName ?? config.displayName ?? `${hostname3()}-${process.pid}`;
7684
7651
  const client = new BrokerClient(mesh, { displayName });
7685
7652
  try {
7686
7653
  await client.connect();
@@ -7691,8 +7658,8 @@ async function withMesh(opts, fn) {
7691
7658
  }
7692
7659
  }
7693
7660
  var init_connect = __esm(() => {
7694
- init_facade9();
7695
- init_facade5();
7661
+ init_facade8();
7662
+ init_facade4();
7696
7663
  });
7697
7664
 
7698
7665
  // src/commands/peers.ts
@@ -7758,7 +7725,7 @@ async function runPeers(flags) {
7758
7725
  }
7759
7726
  var init_peers = __esm(() => {
7760
7727
  init_connect();
7761
- init_facade5();
7728
+ init_facade4();
7762
7729
  });
7763
7730
 
7764
7731
  // src/commands/send.ts
@@ -7942,9 +7909,9 @@ async function runInfo(flags) {
7942
7909
  }
7943
7910
  });
7944
7911
  }
7945
- var init_info2 = __esm(() => {
7912
+ var init_info = __esm(() => {
7946
7913
  init_connect();
7947
- init_facade5();
7914
+ init_facade4();
7948
7915
  });
7949
7916
 
7950
7917
  // src/commands/remember.ts
@@ -7972,7 +7939,7 @@ async function remember(content, opts = {}) {
7972
7939
  return EXIT.INTERNAL_ERROR;
7973
7940
  }
7974
7941
  var init_remember = __esm(() => {
7975
- init_facade9();
7942
+ init_facade8();
7976
7943
  init_exit_codes();
7977
7944
  });
7978
7945
 
@@ -8006,7 +7973,7 @@ async function recall(query, opts = {}) {
8006
7973
  return EXIT.SUCCESS;
8007
7974
  }
8008
7975
  var init_recall = __esm(() => {
8009
- init_facade9();
7976
+ init_facade8();
8010
7977
  init_styles();
8011
7978
  init_exit_codes();
8012
7979
  });
@@ -8233,7 +8200,7 @@ function printProfile(member, dim2) {
8233
8200
  console.log(` Mesh: ${dim2(String(member.id ?? ""))}`);
8234
8201
  }
8235
8202
  var init_profile = __esm(() => {
8236
- init_facade5();
8203
+ init_facade4();
8237
8204
  });
8238
8205
 
8239
8206
  // src/commands/status.ts
@@ -8321,7 +8288,7 @@ async function runStatus() {
8321
8288
  }
8322
8289
  }
8323
8290
  var init_status = __esm(() => {
8324
- init_facade5();
8291
+ init_facade4();
8325
8292
  init_urls();
8326
8293
  });
8327
8294
 
@@ -8331,7 +8298,7 @@ __export(exports_doctor, {
8331
8298
  runDoctor: () => runDoctor
8332
8299
  });
8333
8300
  import { existsSync as existsSync6, readFileSync as readFileSync4, statSync as statSync3 } from "node:fs";
8334
- import { homedir as homedir4, platform as platform5 } from "node:os";
8301
+ import { homedir as homedir4, platform as platform4 } from "node:os";
8335
8302
  import { join as join4 } from "node:path";
8336
8303
  import { spawnSync as spawnSync3 } from "node:child_process";
8337
8304
  function checkNode() {
@@ -8344,7 +8311,7 @@ function checkNode() {
8344
8311
  };
8345
8312
  }
8346
8313
  function checkClaudeOnPath() {
8347
- const res = platform5() === "win32" ? spawnSync3("where", ["claude"]) : spawnSync3("sh", ["-c", "command -v claude"]);
8314
+ const res = platform4() === "win32" ? spawnSync3("where", ["claude"]) : spawnSync3("sh", ["-c", "command -v claude"]);
8348
8315
  const onPath = res.status === 0;
8349
8316
  const location = onPath ? res.stdout.toString().trim().split(`
8350
8317
  `)[0] : undefined;
@@ -8419,11 +8386,11 @@ function checkConfigFile() {
8419
8386
  readConfig();
8420
8387
  const st = statSync3(path);
8421
8388
  const mode = (st.mode & 511).toString(8);
8422
- const secure = platform5() === "win32" || mode === "600";
8389
+ const secure = platform4() === "win32" || mode === "600";
8423
8390
  return {
8424
8391
  name: "~/.claudemesh/config.json parses + chmod 0600",
8425
8392
  pass: secure,
8426
- detail: platform5() === "win32" ? "chmod skipped on Windows" : `0${mode}`,
8393
+ detail: platform4() === "win32" ? "chmod skipped on Windows" : `0${mode}`,
8427
8394
  fix: secure ? undefined : `chmod 600 ${path}`
8428
8395
  };
8429
8396
  } catch (e) {
@@ -8510,7 +8477,7 @@ async function runDoctor() {
8510
8477
  }
8511
8478
  }
8512
8479
  var init_doctor = __esm(() => {
8513
- init_facade5();
8480
+ init_facade4();
8514
8481
  init_urls();
8515
8482
  });
8516
8483
 
@@ -8528,7 +8495,7 @@ import {
8528
8495
  readFileSync as readFileSync5,
8529
8496
  writeFileSync as writeFileSync5
8530
8497
  } from "node:fs";
8531
- import { homedir as homedir5, platform as platform6 } from "node:os";
8498
+ import { homedir as homedir5, platform as platform5 } from "node:os";
8532
8499
  import { dirname as dirname2, join as join5, resolve } from "node:path";
8533
8500
  import { fileURLToPath } from "node:url";
8534
8501
  import { spawnSync as spawnSync4 } from "node:child_process";
@@ -8595,7 +8562,7 @@ function flushClaudeConfig(obj) {
8595
8562
  } catch {}
8596
8563
  }
8597
8564
  function bunAvailable() {
8598
- const res = platform6() === "win32" ? spawnSync4("where", ["bun"]) : spawnSync4("sh", ["-c", "command -v bun"]);
8565
+ const res = platform5() === "win32" ? spawnSync4("where", ["bun"]) : spawnSync4("sh", ["-c", "command -v bun"]);
8599
8566
  return res.status === 0;
8600
8567
  }
8601
8568
  function resolveEntry() {
@@ -8821,7 +8788,7 @@ function runUninstall() {
8821
8788
  }
8822
8789
  var MCP_NAME = "claudemesh", CLAUDE_CONFIG, CLAUDE_SETTINGS, HOOK_COMMAND_STOP = "claudemesh hook idle", HOOK_COMMAND_USER_PROMPT = "claudemesh hook working", HOOK_MARKER = "claudemesh hook ", CLAUDEMESH_TOOLS;
8823
8790
  var init_install = __esm(() => {
8824
- init_facade5();
8791
+ init_facade4();
8825
8792
  CLAUDE_CONFIG = join5(homedir5(), ".claude.json");
8826
8793
  CLAUDE_SETTINGS = join5(homedir5(), ".claude", "settings.json");
8827
8794
  CLAUDEMESH_TOOLS = [
@@ -8943,7 +8910,7 @@ __export(exports_sync, {
8943
8910
  runSync: () => runSync
8944
8911
  });
8945
8912
  import { createInterface as createInterface5 } from "node:readline";
8946
- import { hostname as hostname5 } from "node:os";
8913
+ import { hostname as hostname4 } from "node:os";
8947
8914
  async function runSync(args) {
8948
8915
  const useColor = !process.env.NO_COLOR && process.env.TERM !== "dumb" && process.stdout.isTTY;
8949
8916
  const dim2 = (s) => useColor ? `\x1B[2m${s}\x1B[22m` : s;
@@ -8977,7 +8944,7 @@ async function runSync(args) {
8977
8944
  process.exit(1);
8978
8945
  }
8979
8946
  const keypair = config.meshes.length > 0 ? { publicKey: config.meshes[0].pubkey, secretKey: config.meshes[0].secretKey } : await generateKeypair3();
8980
- const displayName = config.displayName ?? `${hostname5()}-${process.pid}`;
8947
+ const displayName = config.displayName ?? `${hostname4()}-${process.pid}`;
8981
8948
  const result = await syncWithBroker(syncToken, keypair.publicKey, displayName);
8982
8949
  let added = 0;
8983
8950
  for (const m of result.meshes) {
@@ -9004,10 +8971,10 @@ async function runSync(args) {
9004
8971
  }
9005
8972
  }
9006
8973
  var init_sync = __esm(() => {
8974
+ init_facade4();
9007
8975
  init_facade5();
8976
+ init_facade3();
9008
8977
  init_facade6();
9009
- init_facade4();
9010
- init_facade7();
9011
8978
  });
9012
8979
 
9013
8980
  // src/commands/hook.ts
@@ -9090,7 +9057,7 @@ async function runHook(args) {
9090
9057
  }
9091
9058
  var DEBUG;
9092
9059
  var init_hook = __esm(() => {
9093
- init_facade5();
9060
+ init_facade4();
9094
9061
  DEBUG = process.env.CLAUDEMESH_HOOK_DEBUG === "1";
9095
9062
  });
9096
9063
 
@@ -9124,7 +9091,7 @@ function runSeedTestMesh(args) {
9124
9091
  console.log(`Run \`claudemesh mcp\` to connect, or register with Claude Code via \`claudemesh install\`.`);
9125
9092
  }
9126
9093
  var init_seed_test_mesh = __esm(() => {
9127
- init_facade5();
9094
+ init_facade4();
9128
9095
  });
9129
9096
 
9130
9097
  // ../../node_modules/qrcode-terminal/vendor/QRCode/QRMode.js
@@ -10198,7 +10165,7 @@ async function connectTelegram(args) {
10198
10165
  }
10199
10166
  }
10200
10167
  var init_connect_telegram = __esm(() => {
10201
- init_facade5();
10168
+ init_facade4();
10202
10169
  });
10203
10170
 
10204
10171
  // src/cli/argv.ts
@@ -10400,7 +10367,7 @@ async function main() {
10400
10367
  await runJoin2([command]);
10401
10368
  return;
10402
10369
  }
10403
- const { readConfig: readConfig2 } = await Promise.resolve().then(() => (init_facade5(), exports_facade2));
10370
+ const { readConfig: readConfig2 } = await Promise.resolve().then(() => (init_facade4(), exports_facade2));
10404
10371
  const config = readConfig2();
10405
10372
  if (config.meshes.length === 0) {
10406
10373
  const { runWelcome: runWelcome2 } = await Promise.resolve().then(() => (init_welcome2(), exports_welcome));
@@ -10505,7 +10472,7 @@ async function main() {
10505
10472
  break;
10506
10473
  }
10507
10474
  case "info": {
10508
- const { runInfo: runInfo2 } = await Promise.resolve().then(() => (init_info2(), exports_info));
10475
+ const { runInfo: runInfo2 } = await Promise.resolve().then(() => (init_info(), exports_info));
10509
10476
  await runInfo2({});
10510
10477
  break;
10511
10478
  }
@@ -10591,4 +10558,4 @@ main().catch((err) => {
10591
10558
  process.exit(EXIT.INTERNAL_ERROR);
10592
10559
  });
10593
10560
 
10594
- //# debugId=E19FD569ECEFBA4764756E2164756E21
10561
+ //# debugId=CD07DBA798B645E164756E2164756E21