@agentvault/claude-bridge 0.8.20 → 0.8.21

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 +42 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11712,11 +11712,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11712
11712
  return null;
11713
11713
  }
11714
11714
  function ownIdentity() {
11715
- const v22 = true ? "0.23.49" : FALLBACK;
11715
+ const v22 = true ? "0.23.50" : FALLBACK;
11716
11716
  return `${PACKAGE}@${v22}`;
11717
11717
  }
11718
11718
  function buildSha() {
11719
- const raw = true ? "c98737d" : "";
11719
+ const raw = true ? "c8f1371" : "";
11720
11720
  const cleaned = (raw ?? "").trim();
11721
11721
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11722
11722
  }
@@ -69611,6 +69611,34 @@ var init_dist = __esm({
69611
69611
  }
69612
69612
  return null;
69613
69613
  }
69614
+ /**
69615
+ * Every occupied leaf of the ratchet tree, with its basic-credential
69616
+ * identity — READ-ONLY (#470 phase 1).
69617
+ *
69618
+ * Stale-leaf detection compares the tree with the server's eligible set, so
69619
+ * it must see EVERY leaf. `memberLeafIndex` cannot: it stops at the first
69620
+ * match, so a device holding two leaves (the duplicate-add shape observed
69621
+ * live 2026-06-18) would show one. Blank leaves (removed members) are
69622
+ * skipped; duplicates are returned once per leaf. Leaves whose credential is
69623
+ * not `basic` carry no comparable identity and are skipped too — the web
69624
+ * client only ever mints basic credentials.
69625
+ *
69626
+ * Identities are COPIES: a caller mutating one cannot reach the tree.
69627
+ */
69628
+ leafIdentities() {
69629
+ const tree = this._requireState().ratchetTree;
69630
+ const out = [];
69631
+ for (let nodeIndex = 0; nodeIndex < tree.length; nodeIndex += 2) {
69632
+ const node22 = tree[nodeIndex];
69633
+ if (node22 && node22.nodeType === "leaf") {
69634
+ const cred = node22.leaf.credential;
69635
+ if (cred.credentialType === "basic") {
69636
+ out.push({ leafIndex: nodeIndex / 2, identity: new Uint8Array(cred.identity) });
69637
+ }
69638
+ }
69639
+ }
69640
+ return out;
69641
+ }
69614
69642
  // -------------------------------------------------------------------------
69615
69643
  // Encrypt / Decrypt
69616
69644
  // -------------------------------------------------------------------------
@@ -70617,6 +70645,7 @@ var init_dist = __esm({
70617
70645
  _trustTier = null;
70618
70646
  _trustTokenExpiresAt = null;
70619
70647
  _trustTokenInterval = null;
70648
+ _trustTokenUnavailableUntil = 0;
70620
70649
  _pendingPollTimer = null;
70621
70650
  _syncMessageIds = null;
70622
70651
  _deliveryHeartbeat = null;
@@ -70832,6 +70861,7 @@ ${text}`;
70832
70861
  static SILENCE_TIMEOUT_MS = 9e4;
70833
70862
  static POLL_FALLBACK_INTERVAL_MS = 3e4;
70834
70863
  // 30s when messages found
70864
+ static TRUST_TOKEN_UNAVAILABLE_BACKOFF_MS = 6 * 60 * 60 * 1e3;
70835
70865
  static POLL_FALLBACK_IDLE_MS = 6e4;
70836
70866
  // 60s when idle
70837
70867
  /**
@@ -72229,7 +72259,7 @@ ${text}`;
72229
72259
  */
72230
72260
  sendActivitySpan(spanData) {
72231
72261
  if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
72232
- const pluginVersion = true ? "0.23.49" : "0.0.0-dev";
72262
+ const pluginVersion = true ? "0.23.50" : "0.0.0-dev";
72233
72263
  const agentName = this.config.agentName ?? "Agent";
72234
72264
  const resource = {
72235
72265
  "service.name": "agentvault-agent",
@@ -73262,6 +73292,7 @@ ${text}`;
73262
73292
  return this._trustTokenExpiresAt;
73263
73293
  }
73264
73294
  async refreshTrustToken() {
73295
+ if (Date.now() < this._trustTokenUnavailableUntil) return;
73265
73296
  try {
73266
73297
  const res = await fetch(`${this.config.apiUrl}/api/v1/gate/token`, {
73267
73298
  method: "POST",
@@ -73275,12 +73306,15 @@ ${text}`;
73275
73306
  this._trustToken = data.token;
73276
73307
  this._trustTier = data.tier;
73277
73308
  this._trustTokenExpiresAt = data.expires_at;
73309
+ } else if (res.status === 503 || res.status === 404 || res.status === 403) {
73310
+ this._trustTokenUnavailableUntil = Date.now() + _SecureChannel.TRUST_TOKEN_UNAVAILABLE_BACKOFF_MS;
73278
73311
  }
73279
73312
  } catch (err) {
73280
73313
  console.warn("[AgentVault] Trust token refresh failed:", err);
73281
73314
  }
73282
73315
  }
73283
73316
  startTrustTokenRefresh() {
73317
+ this.stopTrustTokenRefresh();
73284
73318
  this.refreshTrustToken();
73285
73319
  this._trustTokenInterval = setInterval(
73286
73320
  () => this.refreshTrustToken(),
@@ -74225,7 +74259,7 @@ ${text}`;
74225
74259
  agentVersion: this.config.agentVersion ?? "0.0.0",
74226
74260
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
74227
74261
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
74228
- pluginVersion: true ? "0.23.49" : "0.0.0-dev"
74262
+ pluginVersion: true ? "0.23.50" : "0.0.0-dev"
74229
74263
  });
74230
74264
  this._telemetryReporter.startAutoFlush(3e4);
74231
74265
  }
@@ -74553,7 +74587,7 @@ ${text}`;
74553
74587
  agentVersion: this.config.agentVersion ?? "0.0.0",
74554
74588
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
74555
74589
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
74556
- pluginVersion: true ? "0.23.49" : "0.0.0-dev"
74590
+ pluginVersion: true ? "0.23.50" : "0.0.0-dev"
74557
74591
  });
74558
74592
  this._telemetryReporter.startAutoFlush(3e4);
74559
74593
  }
@@ -100709,7 +100743,7 @@ data:
100709
100743
  await init_skill_telemetry();
100710
100744
  await init_policy_enforcer();
100711
100745
  init_room_protocol();
100712
- VERSION = true ? "0.23.49" : "0.0.0-dev";
100746
+ VERSION = true ? "0.23.50" : "0.0.0-dev";
100713
100747
  }
100714
100748
  });
100715
100749
  await init_index();
@@ -144263,7 +144297,7 @@ async function main() {
144263
144297
  "[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
144264
144298
  );
144265
144299
  }
144266
- logLine(`[bridge] version: ${true ? "0.8.20" : "dev"}`);
144300
+ logLine(`[bridge] version: ${true ? "0.8.21" : "dev"}`);
144267
144301
  logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
144268
144302
  logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
144269
144303
  if (cfg.armRoom) {
@@ -144295,7 +144329,7 @@ async function main() {
144295
144329
  // its default would render "@agentvault/agentvault@0.7.x" — the wrong
144296
144330
  // package name attached to the bridge's version number, which is worse
144297
144331
  // than either alone.
144298
- clientVersion: `@agentvault/claude-bridge@${true ? "0.8.20" : "dev"}`
144332
+ clientVersion: `@agentvault/claude-bridge@${true ? "0.8.21" : "dev"}`
144299
144333
  });
144300
144334
  const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
144301
144335
  const deviceJwt = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/claude-bridge",
3
- "version": "0.8.20",
3
+ "version": "0.8.21",
4
4
  "type": "module",
5
5
  "description": "AgentVault Claude Bridge — daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
6
6
  "main": "dist/index.js",