@agentvault/agentvault 0.19.21 → 0.19.22

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
@@ -47958,14 +47958,32 @@ var init_channel = __esm({
47958
47958
  this._persisted.a2aChannels[match.channelId].hubAddress = peerAddress;
47959
47959
  this._persisted.a2aChannels[match.channelId].conversationId = match.conversationId;
47960
47960
  await this._persistState();
47961
- console.log(`[deliver] A2A force-fixed: peer=${peerAddress} conv=${match.conversationId.slice(0, 8)}...`);
47962
47961
  }
47963
47962
  try {
47964
- await this.sendToAgent(peerAddress, content.text || "");
47965
- console.log(`[deliver] A2A sendToAgent OK \u2192 ${peerAddress}`);
47966
- return { ok: true, destination: { kind: "a2a", id: peerAddress }, timestamp: ts };
47967
- } catch (sendErr) {
47968
- console.warn(`[deliver] A2A sendToAgent failed after fix: ${sendErr}`);
47963
+ const httpRes = await fetch(
47964
+ `${this.config.apiUrl}/api/v1/a2a/channels/${match.channelId}/send`,
47965
+ {
47966
+ method: "POST",
47967
+ headers: {
47968
+ "Content-Type": "application/json",
47969
+ Authorization: `Bearer ${this._deviceJwt}`
47970
+ },
47971
+ body: JSON.stringify({
47972
+ text: content.text || "",
47973
+ hub_address: myHub
47974
+ })
47975
+ }
47976
+ );
47977
+ if (httpRes.ok) {
47978
+ const result = await httpRes.json();
47979
+ console.log(`[deliver] A2A HTTP send OK \u2192 ${peerAddress} msg=${result.message_id?.slice(0, 8)}`);
47980
+ return { ok: true, destination: { kind: "a2a", id: peerAddress }, timestamp: ts };
47981
+ } else {
47982
+ const errText = await httpRes.text();
47983
+ console.warn(`[deliver] A2A HTTP send failed (${httpRes.status}): ${errText}`);
47984
+ }
47985
+ } catch (httpErr) {
47986
+ console.warn(`[deliver] A2A HTTP send error: ${httpErr}`);
47969
47987
  }
47970
47988
  }
47971
47989
  } catch (syncErr) {