@agentvault/agentvault 0.20.1 → 0.20.2

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
@@ -65758,30 +65758,27 @@ var init_channel = __esm({
65758
65758
  }
65759
65759
  } else if (this._persisted && convId && channelId && role === "member") {
65760
65760
  try {
65761
- const mlsInitRes = await fetch(
65762
- `${this.config.apiUrl}/api/v1/mls/a2a/${channelId}/init`,
65763
- {
65764
- method: "POST",
65765
- headers: {
65766
- Authorization: `Bearer ${this._deviceJwt}`,
65767
- "Content-Type": "application/json"
65768
- },
65769
- body: JSON.stringify({ member_device_ids: [] })
65770
- }
65761
+ const mgr = new MLSGroupManager();
65762
+ const identity = new TextEncoder().encode(this._persisted.deviceId);
65763
+ const kp = await mgr.generateKeyPackage(identity);
65764
+ this._pendingMlsKpBundle = kp;
65765
+ const kpBytes = MLSGroupManager.serializeKeyPackage(kp.publicPackage);
65766
+ await fetch(`${this.config.apiUrl}/api/v1/mls/key-packages`, {
65767
+ method: "POST",
65768
+ headers: {
65769
+ Authorization: `Bearer ${this._deviceJwt}`,
65770
+ "Content-Type": "application/json"
65771
+ },
65772
+ body: JSON.stringify({
65773
+ key_package: Buffer.from(kpBytes).toString("hex"),
65774
+ device_id: this._persisted.deviceId
65775
+ })
65776
+ });
65777
+ console.log(
65778
+ `[SecureChannel] A2A ${channelId.slice(0, 8)} member published KeyPackage, awaiting Welcome from creator`
65771
65779
  );
65772
- if (mlsInitRes.ok) {
65773
- const mlsData = await mlsInitRes.json();
65774
- const entry = this._persisted.a2aChannels?.[channelId];
65775
- if (entry) {
65776
- entry.mlsGroupId = mlsData.group_id;
65777
- await this._persistState();
65778
- console.log(
65779
- `[SecureChannel] A2A ${channelId.slice(0, 8)} MLS registered as member (groupId=${mlsData.group_id.slice(0, 8)}, awaiting Welcome)`
65780
- );
65781
- }
65782
- }
65783
65780
  } catch (err) {
65784
- console.warn(`[SecureChannel] A2A MLS init failed (non-fatal):`, err);
65781
+ console.warn(`[SecureChannel] A2A member KeyPackage publish failed (non-fatal):`, err);
65785
65782
  }
65786
65783
  }
65787
65784
  }
@@ -94434,7 +94431,7 @@ var init_index = __esm({
94434
94431
  init_skill_invoker();
94435
94432
  await init_skill_telemetry();
94436
94433
  await init_policy_enforcer();
94437
- VERSION = true ? "0.20.1" : "0.0.0-dev";
94434
+ VERSION = true ? "0.20.2" : "0.0.0-dev";
94438
94435
  }
94439
94436
  });
94440
94437
  await init_index();