@agentvault/agentvault 0.19.40 → 0.19.42

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
@@ -63623,7 +63623,7 @@ var init_channel = __esm({
63623
63623
  kind: "a2a",
63624
63624
  id: ch.hubAddress,
63625
63625
  label: `A2A: ${ch.hubAddress}`,
63626
- available: this._state === "ready" && !!ch.session?.ratchetState
63626
+ available: this._state === "ready" && (!!ch.session?.ratchetState || !!ch.mlsGroupId && this._mlsGroups.has(`a2a:${ch.channelId}`))
63627
63627
  });
63628
63628
  }
63629
63629
  }
@@ -65902,14 +65902,36 @@ ${messageText}`;
65902
65902
  return;
65903
65903
  }
65904
65904
  }
65905
+ const a2aChannelId = data.a2a_channel_id;
65905
65906
  for (const [channelId, entry] of Object.entries(this._persisted?.a2aChannels ?? {})) {
65906
- if (entry.mlsGroupId === groupId) {
65907
+ if (entry.mlsGroupId === groupId || channelId === a2aChannelId) {
65908
+ entry.mlsGroupId = groupId;
65907
65909
  this._mlsGroups.set(`a2a:${channelId}`, mgr);
65908
65910
  await saveMlsState(this.config.dataDir, groupId, JSON.stringify(mgr.exportState()));
65911
+ await this._persistState();
65909
65912
  console.log(`[SecureChannel] Joined MLS group for A2A ${channelId.slice(0, 8)} via Welcome (epoch=${mgr.epoch})`);
65910
65913
  return;
65911
65914
  }
65912
65915
  }
65916
+ if (a2aChannelId && this._persisted) {
65917
+ if (!this._persisted.a2aChannels) this._persisted.a2aChannels = {};
65918
+ if (!this._persisted.a2aChannels[a2aChannelId]) {
65919
+ this._persisted.a2aChannels[a2aChannelId] = {
65920
+ channelId: a2aChannelId,
65921
+ hubAddress: "",
65922
+ conversationId: "",
65923
+ mlsGroupId: groupId
65924
+ };
65925
+ } else {
65926
+ this._persisted.a2aChannels[a2aChannelId].mlsGroupId = groupId;
65927
+ }
65928
+ this._mlsGroups.set(`a2a:${a2aChannelId}`, mgr);
65929
+ await saveMlsState(this.config.dataDir, groupId, JSON.stringify(mgr.exportState()));
65930
+ await this._persistState();
65931
+ console.log(`[SecureChannel] Joined MLS group for A2A ${a2aChannelId.slice(0, 8)} via Welcome (new channel, epoch=${mgr.epoch})`);
65932
+ return;
65933
+ }
65934
+ console.warn(`[SecureChannel] MLS welcome for unmatched group ${groupId?.slice(0, 8)} (no room/A2A/conv match)`);
65913
65935
  } catch (err) {
65914
65936
  console.error(`[SecureChannel] MLS welcome processing failed:`, err);
65915
65937
  }