@agentvault/agentvault 0.23.25 → 0.23.26

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.25" : FALLBACK;
63102
+ const v2 = true ? "0.23.26" : FALLBACK;
63103
63103
  return `${PACKAGE}@${v2}`;
63104
63104
  }
63105
63105
  function buildClientVersion(override) {
@@ -64863,13 +64863,35 @@ var init_channel = __esm({
64863
64863
  const pendingWsSends = [];
64864
64864
  const sentSharedGroupIds = /* @__PURE__ */ new Set();
64865
64865
  const addressedMlsGroupIds = [];
64866
+ if (!(this._persisted?.mlsGroups && this._state === "ready" && this._ws)) {
64867
+ console.warn(
64868
+ `[SecureChannel] send(): shared-MLS block SKIPPED \u2014 mlsGroups=${this._persisted?.mlsGroups ? Object.keys(this._persisted.mlsGroups).length : "none"} state=${this._state} ws=${this._ws ? "open" : "null"}`
64869
+ );
64870
+ }
64866
64871
  if (this._persisted?.mlsGroups && this._state === "ready" && this._ws) {
64867
64872
  const targetSharedGid = targetConvId ? this._sessionGroupIds?.get(targetConvId) : void 0;
64873
+ console.log(
64874
+ `[SecureChannel] send(): considering ${Object.keys(this._persisted.mlsGroups).length} shared group(s); targetConvId=${targetConvId ? targetConvId.slice(0, 8) : "(none \u2014 broadcast)"} targetSharedGid=${targetSharedGid ? targetSharedGid.slice(0, 8) : "(none)"}`
64875
+ );
64876
+ const skipped = [];
64868
64877
  for (const [gid, entry] of Object.entries(this._persisted.mlsGroups)) {
64869
- if (targetConvId && gid !== targetSharedGid) continue;
64870
- if (!entry.mlsGroupId) continue;
64878
+ if (targetConvId && gid !== targetSharedGid) {
64879
+ skipped.push(`${gid.slice(0, 8)}:not-target`);
64880
+ continue;
64881
+ }
64882
+ if (!entry.mlsGroupId) {
64883
+ skipped.push(`${gid.slice(0, 8)}:no-mlsGroupId`);
64884
+ continue;
64885
+ }
64871
64886
  const mlsGroup = this._mlsGroups.get(`1to1-group:${gid}`);
64872
- if (!mlsGroup?.isInitialized || Number(mlsGroup.epoch) <= 0) continue;
64887
+ if (!mlsGroup?.isInitialized) {
64888
+ skipped.push(`${gid.slice(0, 8)}:not-in-memory`);
64889
+ continue;
64890
+ }
64891
+ if (Number(mlsGroup.epoch) <= 0) {
64892
+ skipped.push(`${gid.slice(0, 8)}:epoch<=0`);
64893
+ continue;
64894
+ }
64873
64895
  try {
64874
64896
  const plaintextBytes = new TextEncoder().encode(plaintext);
64875
64897
  const cipherBytes = await mlsGroup.encrypt(plaintextBytes);
@@ -64894,8 +64916,12 @@ var init_channel = __esm({
64894
64916
  console.log(`[SecureChannel] Shared MLS group send for group ${gid.slice(0, 8)} (${entry.mlsGroupId.slice(0, 8)})`);
64895
64917
  } catch (err) {
64896
64918
  console.error(`[SecureChannel] Shared MLS group send failed for ${gid.slice(0, 8)}:`, err);
64919
+ skipped.push(`${gid.slice(0, 8)}:encrypt-threw`);
64897
64920
  }
64898
64921
  }
64922
+ if (skipped.length > 0) {
64923
+ console.log(`[SecureChannel] send(): skipped ${skipped.length} group(s) \u2014 ${skipped.join(", ")}`);
64924
+ }
64899
64925
  }
64900
64926
  for (const [convId, session] of this._sessions) {
64901
64927
  if (!session.activated) continue;
@@ -65036,13 +65062,26 @@ var init_channel = __esm({
65036
65062
  }
65037
65063
  }
65038
65064
  }
65039
- if (sentCount === 0 && this._sessions.size > 0) {
65040
- console.warn("[SecureChannel] send() delivered to 0 sessions (all skipped or failed)");
65065
+ if (sentCount === 0) {
65066
+ console.warn(
65067
+ `[SecureChannel] send() delivered to 0 destinations \u2014 nothing was encrypted or queued (sessions=${this._sessions.size}, sharedGroups=${this._persisted?.mlsGroups ? Object.keys(this._persisted.mlsGroups).length : 0})`
65068
+ );
65041
65069
  }
65042
65070
  await this._persistState();
65071
+ const wsReady = this._ws?.readyState === 1;
65072
+ if (pendingWsSends.length > 0 && !wsReady) {
65073
+ console.warn(
65074
+ `[SecureChannel] send(): ${pendingWsSends.length} frame(s) NOT written \u2014 socket readyState=${this._ws?.readyState ?? "null"} (1=OPEN)`
65075
+ );
65076
+ }
65043
65077
  for (const frame of pendingWsSends) {
65044
65078
  this._ws.send(frame);
65045
65079
  }
65080
+ if (pendingWsSends.length > 0) {
65081
+ console.log(
65082
+ `[SecureChannel] send(): wrote ${pendingWsSends.length} frame(s) to the socket (sentCount=${sentCount}, readyState=${this._ws?.readyState ?? "null"})`
65083
+ );
65084
+ }
65046
65085
  if (!options?.isResend) {
65047
65086
  for (const mlsGroupId of addressedMlsGroupIds) {
65048
65087
  this._rememberRetryCandidate(mlsGroupId, plaintext, options);
@@ -65092,7 +65131,7 @@ var init_channel = __esm({
65092
65131
  */
65093
65132
  sendActivitySpan(spanData) {
65094
65133
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
65095
- const pluginVersion = true ? "0.23.25" : "0.0.0-dev";
65134
+ const pluginVersion = true ? "0.23.26" : "0.0.0-dev";
65096
65135
  const agentName = this.config.agentName ?? "Agent";
65097
65136
  const resource = {
65098
65137
  "service.name": "agentvault-agent",
@@ -67011,7 +67050,7 @@ var init_channel = __esm({
67011
67050
  agentVersion: this.config.agentVersion ?? "0.0.0",
67012
67051
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67013
67052
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67014
- pluginVersion: true ? "0.23.25" : "0.0.0-dev"
67053
+ pluginVersion: true ? "0.23.26" : "0.0.0-dev"
67015
67054
  });
67016
67055
  this._telemetryReporter.startAutoFlush(3e4);
67017
67056
  }
@@ -67335,7 +67374,7 @@ var init_channel = __esm({
67335
67374
  agentVersion: this.config.agentVersion ?? "0.0.0",
67336
67375
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67337
67376
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67338
- pluginVersion: true ? "0.23.25" : "0.0.0-dev"
67377
+ pluginVersion: true ? "0.23.26" : "0.0.0-dev"
67339
67378
  });
67340
67379
  this._telemetryReporter.startAutoFlush(3e4);
67341
67380
  }
@@ -97786,7 +97825,7 @@ var init_index = __esm({
97786
97825
  init_skill_invoker();
97787
97826
  await init_skill_telemetry();
97788
97827
  await init_policy_enforcer();
97789
- VERSION = true ? "0.23.25" : "0.0.0-dev";
97828
+ VERSION = true ? "0.23.26" : "0.0.0-dev";
97790
97829
  }
97791
97830
  });
97792
97831
  await init_index();