@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/cli.js CHANGED
@@ -48391,7 +48391,6 @@ var init_channel = __esm({
48391
48391
  (ch) => ch.hubAddress === hubAddress
48392
48392
  );
48393
48393
  let channelEntry = allMatches.find((ch) => ch.conversationId) ?? allMatches[0];
48394
- 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 })))}`);
48395
48394
  if (!channelEntry) {
48396
48395
  try {
48397
48396
  console.log(`[sendToAgent] Channel not found for ${hubAddress}, re-syncing from server...`);
@@ -48505,8 +48504,6 @@ var init_channel = __esm({
48505
48504
  if (!this._persisted.a2aChannels) {
48506
48505
  this._persisted.a2aChannels = {};
48507
48506
  }
48508
- const existingKeys = Object.keys(this._persisted.a2aChannels);
48509
- 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 })))}`);
48510
48507
  const myHub = this._persisted.hubAddress || "";
48511
48508
  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 })))}`);
48512
48509
  for (const ch of channels) {
@@ -48762,9 +48759,7 @@ var init_channel = __esm({
48762
48759
  console.log(`[SecureChannel] A2A sync complete: ${a2aCount} channels`);
48763
48760
  this.emit("a2a_channels_synced", { count: a2aCount });
48764
48761
  if (this._persisted?.a2aChannels) {
48765
- const allEntries = Object.entries(this._persisted.a2aChannels);
48766
- 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 })))}`);
48767
- const channelsNeedingKx = allEntries.filter(
48762
+ const channelsNeedingKx = Object.entries(this._persisted.a2aChannels).filter(
48768
48763
  ([_2, entry]) => !entry.session && !entry.pendingEphemeralPrivateKey && entry.conversationId
48769
48764
  );
48770
48765
  if (channelsNeedingKx.length > 0) {
@@ -48829,6 +48824,9 @@ var init_channel = __esm({
48829
48824
  this._lastWakeTick = Date.now();
48830
48825
  try {
48831
48826
  const data = JSON.parse(raw.toString());
48827
+ if (data.event && data.event !== "ping" && data.event !== "typing") {
48828
+ console.log(`[SecureChannel] WS event: ${data.event} conv=${(data.conversation_id || data.data?.conversation_id || "").toString().slice(0, 8)}`);
48829
+ }
48832
48830
  if (data.event === "ping") {
48833
48831
  ws.send(JSON.stringify({ event: "pong" }));
48834
48832
  return;
@@ -49296,7 +49294,6 @@ var init_channel = __esm({
49296
49294
  this.emit("error", new Error(`Server: ${detail}`));
49297
49295
  }
49298
49296
  if (data.event === "a2a_message") {
49299
- console.log(`[SecureChannel] WS received a2a_message: syncComplete=${this._a2aSyncComplete} msgId=${(data.data || data).message_id?.slice(0, 8)}`);
49300
49297
  if (!this._a2aSyncComplete) {
49301
49298
  const msgId = (data.data || data).message_id;
49302
49299
  console.log(`[SecureChannel] Buffering A2A message (sync not complete): ${msgId?.slice(0, 8)}`);
@@ -50389,7 +50386,6 @@ ${messageText}`;
50389
50386
  async _handleA2AMessage(data) {
50390
50387
  const msgData = data.data || data;
50391
50388
  const a2aMsgId = msgData.message_id;
50392
- console.log(`[SecureChannel] _handleA2AMessage: msgId=${a2aMsgId?.slice(0, 8)} channelId=${(msgData.channel_id || "").slice(0, 8)} hasCipher=${!!msgData.ciphertext} hasHeader=${!!msgData.header_blob}`);
50393
50389
  if (a2aMsgId && this._a2aSeenMessageIds.has(a2aMsgId)) {
50394
50390
  console.log(`[SecureChannel] A2A dedup: skipping ${a2aMsgId.slice(0, 8)}`);
50395
50391
  return;
@@ -50404,7 +50400,6 @@ ${messageText}`;
50404
50400
  if (msgData.ciphertext && msgData.header_blob) {
50405
50401
  const channelId = msgData.channel_id || "";
50406
50402
  const channelEntry = this._persisted?.a2aChannels?.[channelId];
50407
- console.log(`[SecureChannel] A2A encrypted: channel=${channelId.slice(0, 8)} found=${!!channelEntry} hasSession=${!!channelEntry?.session} hasRatchet=${!!channelEntry?.session?.ratchetState} role=${channelEntry?.role}`);
50408
50403
  if (channelEntry?.session?.ratchetState) {
50409
50404
  try {
50410
50405
  const headerJson = Buffer.from(msgData.header_blob, "hex").toString("utf-8");