The core leg of the cross-machine mesh epic: the gateway actually forwarding between the local mesh and the hub, in both directions.
Outbound advertisement: the gateway gossips local agents' peer-adverts over its hub connection, keyed by device-id, so the hub registers those devices as reachable via the gateway's connection and remote peers can establish relay pairings targeting them. Only visible agents are advertised; ghost is never advertised and hidden IDs are not propagated.
Remote directory merge: what the gateway learns from the hub's gossip and catch-up (already surfaced by HubSession.peers()) is merged into the local mesh's agent directory, so remote agents appear in local list_agents and can be addressed by device-id like any local peer.
Routing with attribution:
- Local to remote: a send or DM whose target device-id is not a local peer routes to the machine's gateway, which rides its hub pairing (
HubSession.sendToPeer shape).
- Remote to local: inbound relay-data addressed to a local device arrives on the gateway's connection and is delivered over the local mesh to that device, attributed to the true sender.
hub-session.ts already keys inbound requests by request.fromDevice rather than the hub; the same discipline extends to this path.
Two machines running this give the headline outcome: every agent on each machine sees the other machine's agents and can DM them, with no agent holding its own hub connection.
The core leg of the cross-machine mesh epic: the gateway actually forwarding between the local mesh and the hub, in both directions.
Outbound advertisement: the gateway gossips local agents' peer-adverts over its hub connection, keyed by device-id, so the hub registers those devices as reachable via the gateway's connection and remote peers can establish relay pairings targeting them. Only
visibleagents are advertised;ghostis never advertised andhiddenIDs are not propagated.Remote directory merge: what the gateway learns from the hub's gossip and catch-up (already surfaced by
HubSession.peers()) is merged into the local mesh's agent directory, so remote agents appear in locallist_agentsand can be addressed by device-id like any local peer.Routing with attribution:
HubSession.sendToPeershape).hub-session.tsalready keys inbound requests byrequest.fromDevicerather than the hub; the same discipline extends to this path.Two machines running this give the headline outcome: every agent on each machine sees the other machine's agents and can DM them, with no agent holding its own hub connection.