@agentvault/agentvault 0.20.38 → 0.20.39

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
@@ -66336,15 +66336,29 @@ var init_channel = __esm({
66336
66336
  */
66337
66337
  async _handleMessageMLS(data) {
66338
66338
  const convId = data.conversation_id;
66339
+ const convGroupId = data.conversation_group_id;
66339
66340
  const groupId = data.group_id;
66340
66341
  const senderDeviceId = data.sender_device_id;
66341
66342
  if (senderDeviceId === this._deviceId) return;
66342
66343
  let mgr;
66343
66344
  let mgrKey;
66344
- if (convId) {
66345
+ if (convGroupId) {
66346
+ mgrKey = `1to1-group:${convGroupId}`;
66347
+ mgr = this._mlsGroups.get(mgrKey);
66348
+ }
66349
+ if (!mgr && convId) {
66345
66350
  mgrKey = `conv:${convId}`;
66346
66351
  mgr = this._mlsGroups.get(mgrKey);
66347
66352
  }
66353
+ if (!mgr && groupId) {
66354
+ for (const [gid, entry] of Object.entries(this._persisted?.mlsGroups ?? {})) {
66355
+ if (entry.mlsGroupId === groupId) {
66356
+ mgrKey = `1to1-group:${gid}`;
66357
+ mgr = this._mlsGroups.get(mgrKey);
66358
+ break;
66359
+ }
66360
+ }
66361
+ }
66348
66362
  if (!mgr && groupId) {
66349
66363
  for (const [cid, entry] of Object.entries(this._persisted?.mlsConversations ?? {})) {
66350
66364
  if (entry.mlsGroupId === groupId) {
@@ -66361,7 +66375,7 @@ var init_channel = __esm({
66361
66375
  try {
66362
66376
  const cipherBytes = new Uint8Array(Buffer.from(data.payload, "hex"));
66363
66377
  const result = await mgr.decrypt(cipherBytes);
66364
- const mlsGroupId = this._persisted?.mlsConversations?.[convId]?.mlsGroupId ?? groupId;
66378
+ const mlsGroupId = (convGroupId ? this._persisted?.mlsGroups?.[convGroupId]?.mlsGroupId : null) ?? this._persisted?.mlsConversations?.[convId]?.mlsGroupId ?? groupId;
66365
66379
  if (mlsGroupId) {
66366
66380
  await saveMlsState(this.config.dataDir, mlsGroupId, JSON.stringify(mgr.exportState()));
66367
66381
  }
@@ -67532,6 +67546,7 @@ ${messageText}`;
67532
67546
  payload: msg.payload,
67533
67547
  room_id: msg.room_id,
67534
67548
  conversation_id: msg.conversation_id,
67549
+ conversation_group_id: msg.conversation_group_id,
67535
67550
  a2a_channel_id: msg.a2a_channel_id
67536
67551
  });
67537
67552
  } else if (msg.message_type === "commit") {
@@ -67562,7 +67577,7 @@ ${messageText}`;
67562
67577
  a2a_channel_id: msg.a2a_channel_id,
67563
67578
  created_at: msg.created_at
67564
67579
  });
67565
- } else if (msg.conversation_id) {
67580
+ } else if (msg.conversation_id || msg.conversation_group_id) {
67566
67581
  await this._handleMessageMLS({
67567
67582
  message_id: msg.message_id,
67568
67583
  group_id: msg.group_id,
@@ -67570,6 +67585,7 @@ ${messageText}`;
67570
67585
  epoch: msg.epoch,
67571
67586
  payload: msg.payload,
67572
67587
  conversation_id: msg.conversation_id,
67588
+ conversation_group_id: msg.conversation_group_id,
67573
67589
  created_at: msg.created_at
67574
67590
  });
67575
67591
  }
@@ -95410,7 +95426,7 @@ var init_index = __esm({
95410
95426
  init_skill_invoker();
95411
95427
  await init_skill_telemetry();
95412
95428
  await init_policy_enforcer();
95413
- VERSION = true ? "0.20.38" : "0.0.0-dev";
95429
+ VERSION = true ? "0.20.39" : "0.0.0-dev";
95414
95430
  }
95415
95431
  });
95416
95432
  await init_index();