@agentvault/agentvault 0.20.22 → 0.20.24

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/cli.js CHANGED
@@ -62727,6 +62727,27 @@ function mlsFileName(groupId) {
62727
62727
  const safe = groupId.replace(/[^a-zA-Z0-9_-]/g, "_");
62728
62728
  return `mls-${safe}.json`;
62729
62729
  }
62730
+ async function hasPendingWelcome(dataDir2, groupId) {
62731
+ try {
62732
+ const filePath = join(dataDir2, `mls-kp-pending-${groupId.replace(/[^a-zA-Z0-9_-]/g, "_")}.lock`);
62733
+ await readFile(filePath);
62734
+ return true;
62735
+ } catch {
62736
+ return false;
62737
+ }
62738
+ }
62739
+ async function setPendingWelcome(dataDir2, groupId) {
62740
+ await mkdir(dataDir2, { recursive: true, mode: DIR_MODE });
62741
+ const filePath = join(dataDir2, `mls-kp-pending-${groupId.replace(/[^a-zA-Z0-9_-]/g, "_")}.lock`);
62742
+ await writeFile(filePath, (/* @__PURE__ */ new Date()).toISOString(), { encoding: "utf-8", mode: FILE_MODE });
62743
+ }
62744
+ async function clearPendingWelcome(dataDir2, groupId) {
62745
+ try {
62746
+ const filePath = join(dataDir2, `mls-kp-pending-${groupId.replace(/[^a-zA-Z0-9_-]/g, "_")}.lock`);
62747
+ await rm(filePath);
62748
+ } catch {
62749
+ }
62750
+ }
62730
62751
  async function saveMlsState(dataDir2, groupId, state) {
62731
62752
  await mkdir(dataDir2, { recursive: true, mode: DIR_MODE });
62732
62753
  const filePath = join(dataDir2, mlsFileName(groupId));
@@ -65234,6 +65255,11 @@ var init_channel = __esm({
65234
65255
  if (memberIds.includes(this._persisted.deviceId)) {
65235
65256
  console.log(`[SecureChannel] A2A ${chId.slice(0, 8)} member in server membership but no local MLS state \u2014 requesting Welcome`);
65236
65257
  }
65258
+ if (await hasPendingWelcome(this.config.dataDir, groupId)) {
65259
+ console.log(`[SecureChannel] A2A ${chId.slice(0, 8)} sync fallback: skipping \u2014 Welcome already pending for group=${groupId.slice(0, 8)}`);
65260
+ continue;
65261
+ }
65262
+ await setPendingWelcome(this.config.dataDir, groupId);
65237
65263
  const mgr = new MLSGroupManager();
65238
65264
  const identity = new TextEncoder().encode(this._persisted.deviceId);
65239
65265
  const kp = await mgr.generateKeyPackage(identity);
@@ -67143,6 +67169,9 @@ ${messageText}`;
67143
67169
  this._mlsGroups.set(`a2a:${channelId}`, mgr);
67144
67170
  await saveMlsState(this.config.dataDir, groupId, JSON.stringify(mgr.exportState()));
67145
67171
  await this._persistState();
67172
+ await clearPendingWelcome(this.config.dataDir, groupId).catch(() => {
67173
+ });
67174
+ this._pendingMlsKpBundle = void 0;
67146
67175
  console.log(`[SecureChannel] Joined MLS group for A2A ${channelId.slice(0, 8)} via Welcome (epoch=${mgr.epoch})`);
67147
67176
  if (this.config.onA2AChannelReady && entry.conversationId) {
67148
67177
  const firstPeer = entry.participants?.find((p2) => p2.status === "active" || p2.status === "invited");
@@ -88910,7 +88939,7 @@ var init_index = __esm({
88910
88939
  init_skill_invoker();
88911
88940
  await init_skill_telemetry();
88912
88941
  await init_policy_enforcer();
88913
- VERSION = true ? "0.20.22" : "0.0.0-dev";
88942
+ VERSION = true ? "0.20.24" : "0.0.0-dev";
88914
88943
  }
88915
88944
  });
88916
88945