claudemesh-cli 0.8.2 → 0.8.4

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 +39 -11
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -47880,6 +47880,12 @@ class BrokerClient {
47880
47880
  getSessionSecretKey() {
47881
47881
  return this.sessionSecretKey;
47882
47882
  }
47883
+ getMeshPubkey() {
47884
+ return this.mesh.pubkey;
47885
+ }
47886
+ getMeshSecretKey() {
47887
+ return this.mesh.secretKey;
47888
+ }
47883
47889
  makeReqId() {
47884
47890
  return Math.random().toString(36).slice(2) + Date.now().toString(36);
47885
47891
  }
@@ -51002,18 +51008,25 @@ ${lines.join(`
51002
51008
  if (!client2)
51003
51009
  return text("vault_set: not connected", true);
51004
51010
  const entryType = vType ?? "env";
51005
- let plaintext = value;
51011
+ let plaintextBytes;
51006
51012
  if (entryType === "file") {
51007
51013
  const { existsSync: existsSync2, readFileSync: readFileSync2 } = await import("node:fs");
51008
51014
  if (!existsSync2(value))
51009
51015
  return text(`vault_set: file not found: ${value}`, true);
51010
- plaintext = readFileSync2(value, "base64");
51011
- }
51012
- const encoded = Buffer.from(plaintext).toString("base64");
51013
- const ok = await client2.vaultSet(key, encoded, "placeholder-nonce", "placeholder-sealed", entryType, mount_path, description);
51016
+ plaintextBytes = new Uint8Array(readFileSync2(value));
51017
+ } else {
51018
+ plaintextBytes = new TextEncoder().encode(value);
51019
+ }
51020
+ const { encryptFile: encryptFile2, sealKeyForPeer: sealKeyForPeer2 } = await Promise.resolve().then(() => (init_file_crypto(), exports_file_crypto));
51021
+ const { ciphertext, nonce, key: kf } = await encryptFile2(plaintextBytes);
51022
+ const sealedKey = await sealKeyForPeer2(kf, client2.getMeshPubkey());
51023
+ const { ensureSodium: ensureSodium2 } = await Promise.resolve().then(() => (init_keypair(), exports_keypair));
51024
+ const sodium2 = await ensureSodium2();
51025
+ const ciphertextB64 = sodium2.to_base64(ciphertext, sodium2.base64_variants.ORIGINAL);
51026
+ const ok = await client2.vaultSet(key, ciphertextB64, nonce, sealedKey, entryType, mount_path, description);
51014
51027
  if (!ok)
51015
51028
  return text("vault_set: broker did not acknowledge", true);
51016
- return text(`Vault entry "${key}" stored (${entryType}).`);
51029
+ return text(`Vault entry "${key}" stored (${entryType}, E2E encrypted).`);
51017
51030
  }
51018
51031
  case "vault_list": {
51019
51032
  const client2 = allClients()[0];
@@ -52242,6 +52255,8 @@ async function runLaunch(flags, rawArgs) {
52242
52255
  meshSlug: flags.mesh ?? null,
52243
52256
  messageMode: ["push", "inbox", "off"].includes(flags["message-mode"] ?? "") ? flags["message-mode"] : null,
52244
52257
  systemPrompt: flags["system-prompt"] ?? null,
52258
+ resume: flags.resume ?? null,
52259
+ continueSession: flags.continue ?? false,
52245
52260
  quiet: flags.quiet ?? false,
52246
52261
  skipPermConfirm: flags.yes ?? false,
52247
52262
  claudeArgs: claudePassthrough
@@ -52443,12 +52458,14 @@ async function runLaunch(flags, rawArgs) {
52443
52458
  }
52444
52459
  filtered.push(args.claudeArgs[i]);
52445
52460
  }
52446
- const claudeSessionId = randomUUID();
52461
+ const isResume = args.resume !== null || args.continueSession;
52462
+ const claudeSessionId = isResume ? undefined : randomUUID();
52447
52463
  const claudeArgs = [
52448
52464
  "--dangerously-load-development-channels",
52449
52465
  "server:claudemesh",
52450
- "--session-id",
52451
- claudeSessionId,
52466
+ ...claudeSessionId ? ["--session-id", claudeSessionId] : [],
52467
+ ...args.resume ? ["--resume", args.resume] : [],
52468
+ ...args.continueSession ? ["--continue"] : [],
52452
52469
  ...args.skipPermConfirm ? ["--dangerously-skip-permissions"] : [],
52453
52470
  ...args.systemPrompt ? ["--system-prompt", args.systemPrompt] : [],
52454
52471
  ...filtered
@@ -52461,7 +52478,7 @@ async function runLaunch(flags, rawArgs) {
52461
52478
  ...process.env,
52462
52479
  CLAUDEMESH_CONFIG_DIR: tmpDir,
52463
52480
  CLAUDEMESH_DISPLAY_NAME: displayName,
52464
- CLAUDEMESH_SESSION_ID: claudeSessionId,
52481
+ ...claudeSessionId ? { CLAUDEMESH_SESSION_ID: claudeSessionId } : {},
52465
52482
  MCP_TIMEOUT: process.env.MCP_TIMEOUT ?? "30000",
52466
52483
  MAX_MCP_OUTPUT_TOKENS: process.env.MAX_MCP_OUTPUT_TOKENS ?? "50000",
52467
52484
  ...role ? { CLAUDEMESH_ROLE: role } : {}
@@ -52518,7 +52535,7 @@ init_config();
52518
52535
  // package.json
52519
52536
  var package_default = {
52520
52537
  name: "claudemesh-cli",
52521
- version: "0.8.2",
52538
+ version: "0.8.4",
52522
52539
  description: "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
52523
52540
  keywords: [
52524
52541
  "claude-code",
@@ -53503,6 +53520,17 @@ var launch = defineCommand({
53503
53520
  description: "Skip the --dangerously-skip-permissions confirmation",
53504
53521
  default: false
53505
53522
  },
53523
+ resume: {
53524
+ type: "string",
53525
+ alias: "r",
53526
+ description: "Resume a previous Claude Code session by ID, or pass `true` for interactive picker"
53527
+ },
53528
+ continue: {
53529
+ type: "boolean",
53530
+ alias: "c",
53531
+ description: "Continue the most recent conversation in this directory",
53532
+ default: false
53533
+ },
53506
53534
  quiet: {
53507
53535
  type: "boolean",
53508
53536
  description: "Suppress banner and interactive prompts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudemesh-cli",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -48,10 +48,10 @@
48
48
  "prettier": "3.6.2",
49
49
  "typescript": "5.9.3",
50
50
  "vitest": "4.0.14",
51
- "@turbostarter/prettier-config": "0.1.0",
52
- "@turbostarter/eslint-config": "0.1.0",
53
51
  "@turbostarter/vitest-config": "0.1.0",
54
- "@turbostarter/tsconfig": "0.1.0"
52
+ "@turbostarter/tsconfig": "0.1.0",
53
+ "@turbostarter/prettier-config": "0.1.0",
54
+ "@turbostarter/eslint-config": "0.1.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "bun build src/index.ts --target=node --outfile dist/index.js --banner \"#!/usr/bin/env node\" && chmod +x dist/index.js",