@agentvault/agentvault 0.19.32 → 0.19.34

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
@@ -48452,7 +48452,6 @@ var init_channel = __esm({
48452
48452
  (ch) => ch.hubAddress === hubAddress
48453
48453
  );
48454
48454
  let channelEntry = allMatches.find((ch) => ch.conversationId) ?? allMatches[0];
48455
- console.log(`[sendToAgent] lookup hub=${hubAddress} matches=${allMatches.length} entry=${channelEntry ? `ch=${channelEntry.channelId?.slice(0, 8)} session=${!!channelEntry.session} ratchet=${!!channelEntry.session?.ratchetState} role=${channelEntry.role}` : "null"} allChannels=${JSON.stringify(Object.entries(a2a).map(([id, e]) => ({ id: id.slice(0, 8), hub: e.hubAddress, session: !!e.session })))}`);
48456
48455
  if (!channelEntry) {
48457
48456
  try {
48458
48457
  console.log(`[sendToAgent] Channel not found for ${hubAddress}, re-syncing from server...`);
@@ -48566,8 +48565,6 @@ var init_channel = __esm({
48566
48565
  if (!this._persisted.a2aChannels) {
48567
48566
  this._persisted.a2aChannels = {};
48568
48567
  }
48569
- const existingKeys = Object.keys(this._persisted.a2aChannels);
48570
- console.log(`[listA2AChannels] PRE-MERGE existing=${existingKeys.length} entries=${JSON.stringify(existingKeys.map((k2) => ({ id: k2.slice(0, 8), session: !!this._persisted.a2aChannels[k2]?.session, ratchet: !!this._persisted.a2aChannels[k2]?.session?.ratchetState })))}`);
48571
48568
  const myHub = this._persisted.hubAddress || "";
48572
48569
  console.log(`[listA2AChannels] myHub=${myHub}, channels=${channels.length}, raw=${JSON.stringify(channels.map((c2) => ({ id: c2.channelId?.slice(0, 8), init: c2.initiatorHubAddress, resp: c2.responderHubAddress, status: c2.status })))}`);
48573
48570
  for (const ch of channels) {
@@ -48823,9 +48820,7 @@ var init_channel = __esm({
48823
48820
  console.log(`[SecureChannel] A2A sync complete: ${a2aCount} channels`);
48824
48821
  this.emit("a2a_channels_synced", { count: a2aCount });
48825
48822
  if (this._persisted?.a2aChannels) {
48826
- const allEntries = Object.entries(this._persisted.a2aChannels);
48827
- console.log(`[SecureChannel] A2A key exchange check: ${allEntries.length} channels, details=${JSON.stringify(allEntries.map(([id, e]) => ({ id: id.slice(0, 8), session: !!e.session, pending: !!e.pendingEphemeralPrivateKey, convId: !!e.conversationId })))}`);
48828
- const channelsNeedingKx = allEntries.filter(
48823
+ const channelsNeedingKx = Object.entries(this._persisted.a2aChannels).filter(
48829
48824
  ([_2, entry]) => !entry.session && !entry.pendingEphemeralPrivateKey && entry.conversationId
48830
48825
  );
48831
48826
  if (channelsNeedingKx.length > 0) {
@@ -48890,6 +48885,9 @@ var init_channel = __esm({
48890
48885
  this._lastWakeTick = Date.now();
48891
48886
  try {
48892
48887
  const data = JSON.parse(raw.toString());
48888
+ if (data.event && data.event !== "ping" && data.event !== "typing") {
48889
+ console.log(`[SecureChannel] WS event: ${data.event} conv=${(data.conversation_id || data.data?.conversation_id || "").toString().slice(0, 8)}`);
48890
+ }
48893
48891
  if (data.event === "ping") {
48894
48892
  ws.send(JSON.stringify({ event: "pong" }));
48895
48893
  return;
@@ -49357,7 +49355,6 @@ var init_channel = __esm({
49357
49355
  this.emit("error", new Error(`Server: ${detail}`));
49358
49356
  }
49359
49357
  if (data.event === "a2a_message") {
49360
- console.log(`[SecureChannel] WS received a2a_message: syncComplete=${this._a2aSyncComplete} msgId=${(data.data || data).message_id?.slice(0, 8)}`);
49361
49358
  if (!this._a2aSyncComplete) {
49362
49359
  const msgId = (data.data || data).message_id;
49363
49360
  console.log(`[SecureChannel] Buffering A2A message (sync not complete): ${msgId?.slice(0, 8)}`);
@@ -50450,7 +50447,6 @@ ${messageText}`;
50450
50447
  async _handleA2AMessage(data) {
50451
50448
  const msgData = data.data || data;
50452
50449
  const a2aMsgId = msgData.message_id;
50453
- console.log(`[SecureChannel] _handleA2AMessage: msgId=${a2aMsgId?.slice(0, 8)} channelId=${(msgData.channel_id || "").slice(0, 8)} hasCipher=${!!msgData.ciphertext} hasHeader=${!!msgData.header_blob}`);
50454
50450
  if (a2aMsgId && this._a2aSeenMessageIds.has(a2aMsgId)) {
50455
50451
  console.log(`[SecureChannel] A2A dedup: skipping ${a2aMsgId.slice(0, 8)}`);
50456
50452
  return;
@@ -50465,7 +50461,6 @@ ${messageText}`;
50465
50461
  if (msgData.ciphertext && msgData.header_blob) {
50466
50462
  const channelId = msgData.channel_id || "";
50467
50463
  const channelEntry = this._persisted?.a2aChannels?.[channelId];
50468
- console.log(`[SecureChannel] A2A encrypted: channel=${channelId.slice(0, 8)} found=${!!channelEntry} hasSession=${!!channelEntry?.session} hasRatchet=${!!channelEntry?.session?.ratchetState} role=${channelEntry?.role}`);
50469
50464
  if (channelEntry?.session?.ratchetState) {
50470
50465
  try {
50471
50466
  const headerJson = Buffer.from(msgData.header_blob, "hex").toString("utf-8");