@agentvault/agentvault 0.20.28 → 0.20.30

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
@@ -65593,28 +65593,32 @@ var init_channel = __esm({
65593
65593
  this._telemetryReporter.startAutoFlush(3e4);
65594
65594
  }
65595
65595
  this.startTrustTokenRefresh();
65596
- try {
65597
- const mlsMgr = new MLSGroupManager();
65598
- const identity = new TextEncoder().encode(this._deviceId);
65599
- const kp = await mlsMgr.generateKeyPackage(identity);
65600
- this._mlsKeyPackage = kp;
65601
- const kpBytes = MLSGroupManager.serializeKeyPackage(kp.publicPackage);
65602
- const kpHex = Buffer.from(kpBytes).toString("hex");
65603
- await fetch(`${this.config.apiUrl}/api/v1/mls/key-packages`, {
65604
- method: "POST",
65605
- headers: {
65606
- Authorization: `Bearer ${this._deviceJwt}`,
65607
- "Content-Type": "application/json"
65608
- },
65609
- body: JSON.stringify({ key_package: kpHex })
65610
- });
65611
- console.log("[SecureChannel] MLS KeyPackage published");
65612
- } catch (kpErr) {
65613
- console.warn("[SecureChannel] Failed to publish MLS KeyPackage:", kpErr);
65614
- }
65615
- this.listA2AChannels().catch((err) => {
65596
+ await this.listA2AChannels().catch((err) => {
65616
65597
  console.warn("[SecureChannel] A2A channel sync on connect failed:", err);
65617
65598
  });
65599
+ if (!this._pendingMlsKpBundle) {
65600
+ try {
65601
+ const mlsMgr = new MLSGroupManager();
65602
+ const identity = new TextEncoder().encode(this._deviceId);
65603
+ const kp = await mlsMgr.generateKeyPackage(identity);
65604
+ this._mlsKeyPackage = kp;
65605
+ const kpBytes = MLSGroupManager.serializeKeyPackage(kp.publicPackage);
65606
+ const kpHex = Buffer.from(kpBytes).toString("hex");
65607
+ await fetch(`${this.config.apiUrl}/api/v1/mls/key-packages`, {
65608
+ method: "POST",
65609
+ headers: {
65610
+ Authorization: `Bearer ${this._deviceJwt}`,
65611
+ "Content-Type": "application/json"
65612
+ },
65613
+ body: JSON.stringify({ key_package: kpHex })
65614
+ });
65615
+ console.log("[SecureChannel] MLS KeyPackage published");
65616
+ } catch (kpErr) {
65617
+ console.warn("[SecureChannel] Failed to publish MLS KeyPackage:", kpErr);
65618
+ }
65619
+ } else {
65620
+ console.log("[SecureChannel] Skipping on-connect KP publish \u2014 A2A sync fallback KP pending");
65621
+ }
65618
65622
  this._pullDeliveryQueue().catch((err) => {
65619
65623
  console.warn("[SecureChannel] Initial delivery pull failed:", err);
65620
65624
  });
@@ -67514,6 +67518,7 @@ ${messageText}`;
67514
67518
  }
67515
67519
  }
67516
67520
  if (!mlsGroup?.isInitialized) continue;
67521
+ if (chState.role !== "creator") continue;
67517
67522
  try {
67518
67523
  const pendingRes = await fetch(
67519
67524
  `${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/pending-welcomes`,
@@ -94924,7 +94929,7 @@ var init_index = __esm({
94924
94929
  init_skill_invoker();
94925
94930
  await init_skill_telemetry();
94926
94931
  await init_policy_enforcer();
94927
- VERSION = true ? "0.20.28" : "0.0.0-dev";
94932
+ VERSION = true ? "0.20.30" : "0.0.0-dev";
94928
94933
  }
94929
94934
  });
94930
94935
  await init_index();