Skip to main content

Module discovery

Module discovery 

Source
Expand description

LAN instance discovery via mDNS/DNS-SD.

Each AgentMux backend advertises itself as _agentmux._tcp.local. and continuously browses for peers. Discovered instances are tracked in memory and broadcast to frontend clients via EventBus.

Re-exports§

pub use events::LanDiscoverability;
pub use events::LanDiscoveryError;
pub use events::LanInstanceList;
pub use agent_names::agent_names_body;
pub use agent_names::parse_agent_names_body;
pub use agent_names::PeerAgents;
pub use one_per_instance::one_per_instance;
pub use one_per_instance::peer_base_url;

Modules§

agent_names
Reading an instance’s /agentmux/reactive/agent-names answer: the names a LAN peer’s poll (and the Swarm’s ask of this machine’s other channels) list, and each listed agent’s state and summary line, for the Swarm’s remote rows (SPEC_SWARM_OTHER_HOSTS_AND_CHANNELS_2026_10_02.md §3.4 Phase 4).
events
The LAN discovery events’ payloads (mps_events: laninstances, :error, :health).
lan_instances
A host-global record of this machine’s LAN-enabled instances, so the one instance that holds the UDP probe port can list the others as siblings in its reply (docs/specs/SPEC_LAN_FLEET_FEED_2026_10_03.md §3, which links the mobile spec that owns the wire contract).
one_per_instance
One entry per running instance in the peer list.
udp_peers
Desktop-to-desktop discovery that does not depend on mDNS (docs/specs/SPEC_LAN_FIREWALL_SETUP_2026_10_01.md §4.7 item 5, docs/specs/SPEC_LAN_UDP_PEER_DISCOVERY_2026_10_02.md).
uid_refetch
A fresh ask of the LAN peers for the UID key beside a name key whose cached answer is gone or held none (identity M4d-6, lan_v2::claim_uid), and for a name key whose cached answer was a miss.

Structs§

LanDiscovery
LanDiscoveryController
Controller for live start/stop of LanDiscovery in response to setting changes.
LanInstance

Enums§

LanPubkeyLookup
Outcome of find_agent_lan_pubkey. Three states, not two — reagentx P0 follow-up on the LAN signing PR: collapsing “the lookup was skipped (rate-limited)” into the same None/“not found” outcome as “genuinely no peer has this key” let an attacker exhaust LAN_PUBKEY_LOOKUP_RATE_LIMIT with junk lookups, then slip a forged signature for a REAL agent’s identity through as unverified (benign) instead of a verification failure (forced sensitive). By the time this function is ever called, verify_lan_signature has already confirmed a lan_sig was actually presented — so “we didn’t check” must be distinguishable from “there was nothing to check.”