@agentvault/agentvault 0.23.13 → 0.23.14

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.
package/dist/index.js CHANGED
@@ -63965,6 +63965,24 @@ var init_channel = __esm({
63965
63965
  _pendingKpBundles = [];
63966
63966
  /** Pool target: keep this many unconsumed KeyPackages published; backend caps to match. */
63967
63967
  static _KP_POOL_TARGET = 10;
63968
+ /**
63969
+ * Local retention bound for `_pendingKpBundles` (#363). Deliberately ABOVE
63970
+ * `_KP_POOL_TARGET`, because the two counts are in DIFFERENT UNITS: the backend
63971
+ * keeps up to `_KP_POOL_TARGET` **unconsumed** KeyPackages, while this array
63972
+ * holds every bundle published since the last join — consumed ones are removed
63973
+ * only by `_removeKpFromPool` on a successful join.
63974
+ *
63975
+ * Capping local retention AT the backend's target therefore evicts bundles the
63976
+ * backend can still serve, and their private material cannot be rebuilt (#341:
63977
+ * `mls_rs_uniffi` exposes no KeyPackage repository), so any Welcome minted
63978
+ * against an evicted bundle is PERMANENTLY unjoinable.
63979
+ *
63980
+ * Same defect and same remedy as #511, where the web store capped 6 against a
63981
+ * backend pool of 10 and was raised to 12. Retaining extra bundles is cheap and
63982
+ * purely protective — `_handleMlsWelcome` trial-decrypts against the whole pool,
63983
+ * so a surplus only ever adds chances to match.
63984
+ */
63985
+ static _KP_POOL_RETENTION = 20;
63968
63986
  /** Reentrancy guard so concurrent pool top-ups don't double-publish past target. */
63969
63987
  _kpPoolFilling = false;
63970
63988
  /** Buffer for MLS commits received before Welcome (keyed by groupId, sorted by epoch). */
@@ -64628,7 +64646,9 @@ var init_channel = __esm({
64628
64646
  const pendingWsSends = [];
64629
64647
  const sentSharedGroupIds = /* @__PURE__ */ new Set();
64630
64648
  if (this._persisted?.mlsGroups && this._state === "ready" && this._ws) {
64649
+ const targetSharedGid = targetConvId ? this._sessionGroupIds?.get(targetConvId) : void 0;
64631
64650
  for (const [gid, entry] of Object.entries(this._persisted.mlsGroups)) {
64651
+ if (targetConvId && gid !== targetSharedGid) continue;
64632
64652
  if (!entry.mlsGroupId) continue;
64633
64653
  const mlsGroup = this._mlsGroups.get(`1to1-group:${gid}`);
64634
64654
  if (!mlsGroup?.isInitialized || Number(mlsGroup.epoch) <= 0) continue;
@@ -64829,7 +64849,7 @@ var init_channel = __esm({
64829
64849
  */
64830
64850
  sendActivitySpan(spanData) {
64831
64851
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
64832
- const pluginVersion = true ? "0.23.13" : "0.0.0-dev";
64852
+ const pluginVersion = true ? "0.23.14" : "0.0.0-dev";
64833
64853
  const agentName = this.config.agentName ?? "Agent";
64834
64854
  const resource = {
64835
64855
  "service.name": "agentvault-agent",
@@ -66568,7 +66588,7 @@ var init_channel = __esm({
66568
66588
  agentVersion: this.config.agentVersion ?? "0.0.0",
66569
66589
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
66570
66590
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
66571
- pluginVersion: true ? "0.23.13" : "0.0.0-dev"
66591
+ pluginVersion: true ? "0.23.14" : "0.0.0-dev"
66572
66592
  });
66573
66593
  this._telemetryReporter.startAutoFlush(3e4);
66574
66594
  }
@@ -66886,7 +66906,7 @@ var init_channel = __esm({
66886
66906
  agentVersion: this.config.agentVersion ?? "0.0.0",
66887
66907
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
66888
66908
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
66889
- pluginVersion: true ? "0.23.13" : "0.0.0-dev"
66909
+ pluginVersion: true ? "0.23.14" : "0.0.0-dev"
66890
66910
  });
66891
66911
  this._telemetryReporter.startAutoFlush(3e4);
66892
66912
  }
@@ -68549,7 +68569,7 @@ ${messageText}`;
68549
68569
  if (!this._pendingKpBundles.some((b2) => idOf(b2) === id)) {
68550
68570
  this._pendingKpBundles.push(kp);
68551
68571
  }
68552
- while (this._pendingKpBundles.length > _SecureChannel._KP_POOL_TARGET) {
68572
+ while (this._pendingKpBundles.length > _SecureChannel._KP_POOL_RETENTION) {
68553
68573
  this._pendingKpBundles.shift();
68554
68574
  }
68555
68575
  }
@@ -97171,7 +97191,7 @@ var init_index = __esm({
97171
97191
  init_skill_invoker();
97172
97192
  await init_skill_telemetry();
97173
97193
  await init_policy_enforcer();
97174
- VERSION = true ? "0.23.13" : "0.0.0-dev";
97194
+ VERSION = true ? "0.23.14" : "0.0.0-dev";
97175
97195
  }
97176
97196
  });
97177
97197
  await init_index();