Expand description
AgentMux Cloud settings discovery (docs/specs/SPEC_CLOUD_SETTINGS_DISCOVERY_2026_09_27.md).
The cloud publishes where its sign-in and relay live at
{relay REST base}/.well-known/agentmux-cloud.json. srv reads it so the
desktop follows the cloud instead of compiled-in values: a new Cognito
user pool means a new client id, and installed builds would otherwise keep
the old one. The relay REST base (relay::rest_base_url) stays the root of
trust; everything else comes from the document it serves, with today’s
compiled values as the fallback.
The desktop follows a document only to hosts that are AgentMux’s own: every host it names (api, ws, console,
cognito.domain) must be on the list for the base it was fetched from ([HostRule]).
Structs§
- Cloud
Settings - What the cloud publishes. Only the fields srv uses; others are ignored.
- Cognito
Settings
Constants§
- DIRECT_
IDENTITY_ PROVIDERS - The providers a sign-in may go straight to (Cognito’s
identity_provider). Nothing else reaches the authorize URL. - DISCOVERY_
PATH - Path of the discovery document under the relay REST base.
- PRODUCTION_
HOSTS - The hosts a document fetched from the production relay may name: exact names, not a suffix, so a sub-name nobody listed is never trusted.
- STAGING_
HOSTS - The names that exist under
staging.agentmux.ai, for a document fetched from the staging relay. The lists hold only names that exist.
Functions§
- check_
identity_ provider - Check a requested sign-in provider: one of
DIRECT_IDENTITY_PROVIDERS, and one the cloud publishes when it publishes a list.None(email, or Cognito’s own page) is always fine. - client_
id_ superseded - Was a stored sign-in issued to a Cognito client the cloud no longer
publishes? Then it belongs to a user pool the cloud has left, and neither
its tokens nor a refresh will work.
falsewhen that can’t be told: no document, or a credential saved without its client id. - cloud_
settings - The cloud’s published settings, or
Nonewhen it publishes none (an older relay, a network failure with no earlier copy). Cached for five minutes; a failed fetch keeps the last good copy and also waits five minutes before trying again, so an unreachable relay doesn’t turn every caller into a request. - parse
- Parse and check a discovery document.
Nonefor anything srv shouldn’t act on: another format version, a missing field, a URL that isn’t https/wss (plain http/ws only when the relay itself is plain http, i.e. a local dev relay), or a host that is not AgentMux’s own (see [HostRule]). - resolve_
login - The Cognito domain and client id to sign in with: the published ones when the cloud has a document, else what the caller supplied (the build’s compiled values). Both of a pair come from the same source, never mixed.
- ws_url
- Where the cloud subscriber connects: the published WebSocket URL, else the compiled one.