Expand description
A deep link the operating system started the launcher with: a person clicked agentmux://… in a web page, a mail
or a chat (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md R18, G4e; build 4). It is taken out of the
arguments the host gets, and handed over once:
- AgentMux is running: the launcher that lost the single-instance race sends it to the running host (
open_link,second_instance::forward_launch) instead of asking for a new window. - The link started AgentMux: the first host gets it in its environment (
AGENTMUX_OPEN_LINK), and a host the launcher restarts later does not open it again.
The host passes it to srv, whose guard decides what a link from another program may show.
The operating system’s registrations put the link after -- (agentmux.exe -- "%1" on Windows, -- %u in the
Linux desktop entry): nothing after it is ever read as the launcher’s own flag or passed on, so a link that carries
a quote (Windows quotes %1 but doesn’t escape one inside it) can’t add a flag such as --verify-update.
macOS hands a link to the running launcher by an Apple Event instead (splash_mac, application:openURLs:), the
one that started it too: from_os keeps it for the first host when none has started yet, like an argument.
Structs§
- Launch 🔒
- This launch’s link, and whether a host was started yet: one lock, so a link that arrives while the first host starts is either in its environment or handed back to forward, never neither.
Constants§
- MAX_
LINK 🔒 - Longer than any link the registry makes; srv’s parser refuses what isn’t a link.
- OPEN_
LINK_ 🔒ENV - The host reads it (
crates/cef/src/commands/deeplink_open.rs). - SEPARATOR 🔒
- Ends the launcher’s own arguments; what follows is a link the operating system passes, and only that.
Statics§
- LAUNCH 🔒
Functions§
- before_
separator 🔒 - for_
host 🔒 - The link for a host’s environment: for the first host only.
- from_os 🔒
- A link the operating system handed this running launcher (macOS): None when it is kept for the first host, else
the link, to forward to the running host (
open_link). Not a link: None. - is_link 🔒
- Whether
argis a deep link:agentmux://, at mostMAX_LINKbytes, no control characters. - launch 🔒
- link 🔒
- This launch’s link.
- own_
args 🔒 - This process’s arguments up to
--(the program’s name first): the only ones its own flags are read from. - set_
host_ 🔒env - Puts this launch’s link in a host’s environment, or makes sure an inherited one isn’t there.
- split 🔒
argswithout the deep link and without anything after--, and the link (the first one, before or after--; the operating system passes one).- take 🔒
argswithout the deep link, which is kept forlink: it is handed over on its own, never passed on as an argument. Called once, bymain.