@agentvault/agentvault 0.23.23 → 0.23.25

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
@@ -63099,7 +63099,7 @@ var init_mls_kp_pool = __esm({
63099
63099
 
63100
63100
  // src/client-version.ts
63101
63101
  function ownIdentity() {
63102
- const v2 = true ? "0.23.23" : FALLBACK;
63102
+ const v2 = true ? "0.23.25" : FALLBACK;
63103
63103
  return `${PACKAGE}@${v2}`;
63104
63104
  }
63105
63105
  function buildClientVersion(override) {
@@ -65092,7 +65092,7 @@ var init_channel = __esm({
65092
65092
  */
65093
65093
  sendActivitySpan(spanData) {
65094
65094
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
65095
- const pluginVersion = true ? "0.23.23" : "0.0.0-dev";
65095
+ const pluginVersion = true ? "0.23.25" : "0.0.0-dev";
65096
65096
  const agentName = this.config.agentName ?? "Agent";
65097
65097
  const resource = {
65098
65098
  "service.name": "agentvault-agent",
@@ -65553,11 +65553,17 @@ var init_channel = __esm({
65553
65553
  const before = this._persisted.groupId;
65554
65554
  this._sessionGroupIds = new Map(mine.map((r2) => [r2.id, r2.group_id]));
65555
65555
  this._persisted.conversationGroupIds = Object.fromEntries(this._sessionGroupIds);
65556
- const primary = mine.find((r2) => r2.id === this._persisted.primaryConversationId) ?? mine[0];
65556
+ const joined = mine.find((r2) => this._persisted.mlsGroups?.[r2.group_id]);
65557
+ const primary = mine.find((r2) => r2.id === this._persisted.primaryConversationId) ?? joined ?? mine[0];
65558
+ if (!mine.some((r2) => r2.id === this._persisted.primaryConversationId)) {
65559
+ console.log(
65560
+ `[SecureChannel] Adopting new primary conversation ${primary.id.slice(0, 8)} (group ${primary.group_id.slice(0, 8)}) \u2014 ${joined ? "we hold MLS state for it" : "no joined conversation found, first active row"}`
65561
+ );
65562
+ }
65557
65563
  this._persisted.groupId = primary.group_id;
65558
65564
  this._persisted.primaryConversationId = primary.id;
65559
65565
  const liveGroupIds = new Set(mine.map((r2) => r2.group_id));
65560
- if (!liveGroupIds.has(staleGid)) {
65566
+ if (staleGid && staleMlsGroupId && !liveGroupIds.has(staleGid)) {
65561
65567
  try {
65562
65568
  await deleteMlsState(this.config.dataDir, staleMlsGroupId);
65563
65569
  } catch {
@@ -65571,9 +65577,9 @@ var init_channel = __esm({
65571
65577
  }
65572
65578
  await this._persistState();
65573
65579
  console.log(
65574
- `[SecureChannel] Re-resolved conversation groups after 'unknown group' ${staleMlsGroupId.slice(0, 8)}: primary group ${String(before).slice(0, 8)} \u2192 ${this._persisted.groupId.slice(0, 8)} (${mine.length} active conversation(s))`
65580
+ `[SecureChannel] Re-resolved conversation groups ${staleMlsGroupId ? `after 'unknown group' ${staleMlsGroupId.slice(0, 8)}` : "on connect (#1034)"}: primary group ${String(before).slice(0, 8)} \u2192 ${this._persisted.groupId.slice(0, 8)} (${mine.length} active conversation(s))`
65575
65581
  );
65576
- return this._persisted.groupId !== before && before === staleGid;
65582
+ return staleGid !== void 0 && this._persisted.groupId !== before && before === staleGid;
65577
65583
  }
65578
65584
  /**
65579
65585
  * Resend the message that a now-reconciled `unknown group` refusal killed (#732).
@@ -66975,6 +66981,9 @@ var init_channel = __esm({
66975
66981
  await this._pullDrDeliveryQueue();
66976
66982
  await this._flushOutboundQueue();
66977
66983
  this._setState("ready");
66984
+ void this._reconcileConversationGroups().catch((err) => {
66985
+ console.warn("[SecureChannel] Conversation-group reconcile failed:", err);
66986
+ });
66978
66987
  void this._reconcileRoomsWithServer().catch(
66979
66988
  (err) => console.warn(`[SecureChannel] room reconcile failed (ignored): ${err instanceof Error ? err.message : String(err)}`)
66980
66989
  ).then(() => this._quarantineOrphanedMlsGroups()).catch(
@@ -67002,7 +67011,7 @@ var init_channel = __esm({
67002
67011
  agentVersion: this.config.agentVersion ?? "0.0.0",
67003
67012
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67004
67013
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67005
- pluginVersion: true ? "0.23.23" : "0.0.0-dev"
67014
+ pluginVersion: true ? "0.23.25" : "0.0.0-dev"
67006
67015
  });
67007
67016
  this._telemetryReporter.startAutoFlush(3e4);
67008
67017
  }
@@ -67326,7 +67335,7 @@ var init_channel = __esm({
67326
67335
  agentVersion: this.config.agentVersion ?? "0.0.0",
67327
67336
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67328
67337
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67329
- pluginVersion: true ? "0.23.23" : "0.0.0-dev"
67338
+ pluginVersion: true ? "0.23.25" : "0.0.0-dev"
67330
67339
  });
67331
67340
  this._telemetryReporter.startAutoFlush(3e4);
67332
67341
  }
@@ -97777,7 +97786,7 @@ var init_index = __esm({
97777
97786
  init_skill_invoker();
97778
97787
  await init_skill_telemetry();
97779
97788
  await init_policy_enforcer();
97780
- VERSION = true ? "0.23.23" : "0.0.0-dev";
97789
+ VERSION = true ? "0.23.25" : "0.0.0-dev";
97781
97790
  }
97782
97791
  });
97783
97792
  await init_index();