claudemesh-cli 1.0.0-alpha.33 → 1.0.0-alpha.35

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.
@@ -2646,10 +2646,9 @@ class BrokerClient {
2646
2646
  if (msg.type === "ack") {
2647
2647
  const pending = this.pendingSends.get(String(msg.id ?? ""));
2648
2648
  if (pending) {
2649
- pending.resolve({
2650
- ok: true,
2651
- messageId: String(msg.messageId ?? "")
2652
- });
2649
+ const queued = msg.queued !== false;
2650
+ const errStr = typeof msg.error === "string" ? msg.error : undefined;
2651
+ pending.resolve(queued ? { ok: true, messageId: String(msg.messageId ?? "") } : { ok: false, error: errStr ?? "broker rejected send" });
2653
2652
  this.pendingSends.delete(pending.id);
2654
2653
  }
2655
2654
  return;
@@ -2689,7 +2688,13 @@ class BrokerClient {
2689
2688
  plaintext = `[${event}]`;
2690
2689
  }
2691
2690
  } else if (senderPubkey && nonce && ciphertext) {
2692
- plaintext = await decryptDirect({ nonce, ciphertext }, senderPubkey, this.sessionSecretKey ?? this.mesh.secretKey);
2691
+ const envelope = { nonce, ciphertext };
2692
+ if (this.sessionSecretKey) {
2693
+ plaintext = await decryptDirect(envelope, senderPubkey, this.sessionSecretKey);
2694
+ }
2695
+ if (plaintext === null) {
2696
+ plaintext = await decryptDirect(envelope, senderPubkey, this.mesh.secretKey);
2697
+ }
2693
2698
  }
2694
2699
  if (plaintext === null && ciphertext && !senderPubkey) {
2695
2700
  try {
@@ -3488,7 +3493,7 @@ __export(exports_urls, {
3488
3493
  VERSION: () => VERSION,
3489
3494
  URLS: () => URLS
3490
3495
  });
3491
- var URLS, VERSION = "1.0.0-alpha.33", env;
3496
+ var URLS, VERSION = "1.0.0-alpha.35", env;
3492
3497
  var init_urls = __esm(() => {
3493
3498
  URLS = {
3494
3499
  BROKER: process.env.CLAUDEMESH_BROKER_URL ?? "wss://ic.claudemesh.com/ws",
@@ -6527,4 +6532,4 @@ startMcpServer().catch((err) => {
6527
6532
  process.exit(1);
6528
6533
  });
6529
6534
 
6530
- //# debugId=176161E2F9EDE48B64756E2164756E21
6535
+ //# debugId=834272C9BF820F5E64756E2164756E21