@agentvault/agentvault 0.20.18 → 0.20.19

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
@@ -65198,24 +65198,40 @@ var init_channel = __esm({
65198
65198
  }
65199
65199
  }
65200
65200
  }
65201
- if (chState.role === "member" && !chState.mlsGroupId) {
65201
+ const memberMlsGroup = chState.mlsGroupId ? this._mlsGroups.get(`a2a:${chId}`) : void 0;
65202
+ if (chState.role === "member" && !memberMlsGroup?.isInitialized) {
65202
65203
  try {
65203
- const groupRes = await fetch(
65204
- `${this.config.apiUrl}/api/v1/mls/a2a/${chId}/group`,
65205
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
65206
- );
65207
- if (!groupRes.ok) {
65208
- continue;
65204
+ let groupId = chState.mlsGroupId;
65205
+ let memberIds = [];
65206
+ if (!groupId) {
65207
+ const groupRes = await fetch(
65208
+ `${this.config.apiUrl}/api/v1/mls/a2a/${chId}/group`,
65209
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
65210
+ );
65211
+ if (!groupRes.ok) {
65212
+ continue;
65213
+ }
65214
+ const groupData = await groupRes.json();
65215
+ groupId = groupData.group_id;
65216
+ if (!groupId) continue;
65217
+ memberIds = groupData.member_device_ids || [];
65218
+ chState.mlsGroupId = groupId;
65219
+ await this._persistState();
65220
+ } else {
65221
+ try {
65222
+ const groupRes = await fetch(
65223
+ `${this.config.apiUrl}/api/v1/mls/groups/${groupId}`,
65224
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
65225
+ );
65226
+ if (groupRes.ok) {
65227
+ const groupData = await groupRes.json();
65228
+ memberIds = groupData.member_device_ids || [];
65229
+ }
65230
+ } catch {
65231
+ }
65209
65232
  }
65210
- const groupData = await groupRes.json();
65211
- const groupId = groupData.group_id;
65212
- if (!groupId) continue;
65213
- chState.mlsGroupId = groupId;
65214
- await this._persistState();
65215
- const memberIds = groupData.member_device_ids || [];
65216
65233
  if (memberIds.includes(this._persisted.deviceId)) {
65217
- console.log(`[SecureChannel] A2A ${chId.slice(0, 8)} member already in MLS group, skipping Welcome request`);
65218
- continue;
65234
+ console.log(`[SecureChannel] A2A ${chId.slice(0, 8)} member in server membership but no local MLS state \u2014 requesting Welcome`);
65219
65235
  }
65220
65236
  const mgr = new MLSGroupManager();
65221
65237
  const identity = new TextEncoder().encode(this._persisted.deviceId);
@@ -94743,7 +94759,7 @@ var init_index = __esm({
94743
94759
  init_skill_invoker();
94744
94760
  await init_skill_telemetry();
94745
94761
  await init_policy_enforcer();
94746
- VERSION = true ? "0.20.18" : "0.0.0-dev";
94762
+ VERSION = true ? "0.20.19" : "0.0.0-dev";
94747
94763
  }
94748
94764
  });
94749
94765
  await init_index();