@agentvault/agentvault 0.19.20 → 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/channel.d.ts.map +1 -1
- package/dist/cli.js +37 -12
- package/dist/cli.js.map +2 -2
- package/dist/index.js +37 -12
- package/dist/index.js.map +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
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
|
-
|
|
47965
|
-
|
|
47966
|
-
|
|
47967
|
-
|
|
47968
|
-
|
|
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) {
|
|
@@ -48542,12 +48560,19 @@ var init_channel = __esm({
|
|
|
48542
48560
|
if (this._persisted.hubAddress) {
|
|
48543
48561
|
payload.hub_address = this._persisted.hubAddress;
|
|
48544
48562
|
}
|
|
48545
|
-
|
|
48546
|
-
|
|
48547
|
-
|
|
48548
|
-
|
|
48549
|
-
|
|
48550
|
-
|
|
48563
|
+
const a2aJson = JSON.stringify({ event: "a2a_message", data: payload });
|
|
48564
|
+
console.log(`[sendToAgent] Sending A2A plaintext: conv=${payload.conversation_id} wsReady=${this._ws.readyState} bytes=${a2aJson.length}`);
|
|
48565
|
+
await new Promise((resolve3, reject) => {
|
|
48566
|
+
this._ws.send(a2aJson, (err) => {
|
|
48567
|
+
if (err) {
|
|
48568
|
+
console.error(`[sendToAgent] WS send failed:`, err);
|
|
48569
|
+
reject(err);
|
|
48570
|
+
} else {
|
|
48571
|
+
console.log(`[sendToAgent] WS send confirmed`);
|
|
48572
|
+
resolve3();
|
|
48573
|
+
}
|
|
48574
|
+
});
|
|
48575
|
+
});
|
|
48551
48576
|
}
|
|
48552
48577
|
/**
|
|
48553
48578
|
* List all A2A channels for this agent.
|