Expand description
An install’s presence record: one AgentMux install (a channel on a
machine) saying it is up, on which platform, and which agents it runs, so
the account’s relay can list it to a signed-in phone that is not on the
same LAN. Wire contract: agentmux-mobile’s
SPEC_FLEET_HOST_TAGS_AND_CLOUD_HOSTS_2026_10_06 §6.1; version 2 adds each
agent’s state (agentmux-mobile’s
SPEC_AGENT_STATUS_AND_LIVE_PANE_FEED_2026_10_07 §13.1). The desktop
publishes v2; v1 is still built and checked, for the relay’s sake.
Version 3 is v2 with an optional top-level gone. The desktop sends it
only as the goodbye when it quits, signs out or stops publishing:
gone: true and no agent states, which the relay keeps as “offline
since” for a short while instead of a live entry.
Version 4 is v3 with each agent’s optional line, its Swarm summary line
(agentmux’s SPEC_SWARM_OTHER_HOSTS_AND_CHANNELS_2026_10_02 §3.4 Phase 4),
signed as a fourth agent field. The desktop publishes v4 when it has
lines to share; a goodbye stays v3.
Signed with the install’s WAN instance key (the W3-S identity in
crate::jekt_sign), so the record names the key that signed it and
instance_id is checkable against it. agentmux-srv’s
muxbus::wan_presence builds and publishes it; the relay re-implements
the check in TypeScript, and the fixed vector in the tests below is the
contract between the two.
Structs§
- Install
Presence - The record, in the contract’s field order. Public keys and the signature are standard base64.
- Presence
Agent - One agent of the install.
kindishostorcontainer(the agent’s blockagentMode);state(v2 and later) is one ofPRESENCE_STATES, or absent when unknown;line(v4 only) is its summary line, or absent.
Constants§
- MAX_
CHANNELS_ RUNNING - MAX_
PRESENCE_ AGENTS - Agents in one record; the rest are left out.
- MAX_
PRESENCE_ LINE_ BYTES - Most bytes of lines one signed record carries, so a record stays small enough to send on every change; lines past it are dropped.
- MAX_
PRESENCE_ LINE_ CHARS - Longest agent
line, in characters (agent_line::MAX_LINE_CHARSin srv). - MAX_
PRESENCE_ NAME_ CHARS - Longest
hostname,channeland agentname, in characters. - MAX_
PRESENCE_ VERSION_ CHARS - PRESENCE_
STATES - The values an agent’s
statemay take (the LAN feed’sagent_status). - PRESENCE_
VERSION - The version the desktop publishes.
- PRESENCE_
VERSION_ GOODBYE - The goodbye:
gone: true, no agentstate. - PRESENCE_
VERSION_ LINES - v3 plus each agent’s optional
line. - PRESENCE_
VERSION_ V1 - The first version: no agent
state.
Functions§
- canonical_
agents - The agents as a record carries them: sorted by lower-cased name, ties by
name; an agent whose name, kind, state or line is out of bounds (a control
character, too long, an unknown kind or state) left out; each name once;
at most
MAX_PRESENCE_AGENTS.