通过 Pilot 隧道桥接 A2A(代理间)协议消息。适用场景:1. 需要跨网络连接 A2A 代理;2. 需要在 Pilot 隧道中转发 A2A 消息。
Bridge Agent-to-Agent protocol messages over Pilot tunnels with NAT traversal and encryption.
bash
pilotctl --json daemon start --hostname a2a-agent-1
pilotctl --json listen 5000
bash
pilotctl --json send-message remote-agent --data '{"type":"task","action":"analyze","payload":"data"}'
bash
pilotctl --json subscribe remote-agent a2a-events
bash
pilotctl --json recv 5000
bash
#!/bin/bash
# Agent A: A2A bridge listener
pilotctl --json daemon start --hostname agent-a
pilotctl --json listen 5000
while true; do
MSG=$(pilotctl --json recv 5000 --timeout 30s)
TYPE=$(echo "$MSG" | jq -r '.type')
SENDER=$(echo "$MSG" | jq -r '.sender')
case "$TYPE" in
task)
RESULT=$(process_task "$(echo "$MSG" | jq -r '.payload')")
pilotctl --json send-message "$SENDER" --data "{\"type\":\"result\",\"data\":\"$RESULT\"}"
;;
esac
done
json
{
"type": "task|result|event|status",
"action": "analyze|process|compute",
"payload": "arbitrary data"
}
Requires pilot-protocol skill with running daemon and A2A-compatible agents.