Expand description
srv’s guard of an agent’s deep-link open (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md §4.2, R16, G1 to
G3, G5, G7, G9, G12). POST /api/v1/pane/open_link reads the link with the shared parser
(agentmux_common::deeplinks), applies the rules an agent’s open is held to, records the open as the agent, and
hands what it let through to the window (sagas::deeplink_open), whose executor applies the rules only the window
can (R5, the pane caps and the typing queue of G3, G6).
The rules here, each with its test below:
- Only an agent, known by its token, calls this route: a person’s click goes to the app’s executor directly.
- G1, G5: a view an agent may not open is refused; a place marked as the caller’s own must name the caller; the
Audit’s sound and message rows, whose owner srv can’t tell, are refused in build 1; a container agent gets no
path destination (its files open through
Paneopen’s snapshot). - G7: a path is canonicalised once, the structural checks run again on the result, and the open uses that string. A network path, one that does not exist and one of the wrong kind (a folder for the Editor) are refused.
- G3: a window target is refused; a tab or pane outside the caller’s own tab lands in its own tab instead; ten opens a minute per agent, refused (not queued) over it.
- G9: every open is recorded as the agent, refused and queued ones too, with the outcome and the reason.
- G12: everything is checked now, when the open happens.
Structs§
- Caller
Facts 🔒 - Who asks, as srv knows it: never from the request’s words.
- Limiter 🔒
- A sliding window per caller: at most
limitinRATE_WINDOW. - Open
Link 🔒Request - The body of
POST /api/v1/pane/open_link. - Refusal 🔒
- A refusal: a reason code of the executor’s vocabulary (
open-types.ts), the sentence, and what would work.
Constants§
- RATE_
LIMIT 🔒 - Opens an agent may ask for in
RATE_WINDOW(G3, D3). - RATE_
WINDOW 🔒
Functions§
- canonical_
path 🔒 pathcanonicalised once, as forward slashes, or why it can’t be opened (G7).foldersays which kind it must be.- check_
path 🔒 - G7 for the path destinations: the path is replaced by its canonical form, which the open uses.
- check_
place_ 🔒rate - The same limit for an agent’s floating opens and its
resize,moveandplace: they and deep-link opens share the ten a minute, so a loop of any of them is stopped. The text says when the next is allowed. - check_
rate 🔒 - check_
rules 🔒 - G1 and G5: whether this agent may open
link. May fill in the caller’s own id where the place takes one and the link left it out, so a place that would show “whoever is selected” shows the caller’s own. - facts_
of 🔒 - The caller’s own pane, tab and window, from srv’s own store.
- guard 🔒
- Everything srv checks, in order, on
reqfromwho: the parsed link srv lets through, its target, and a note. - handle_
pane_ 🔒open_ link POST /api/v1/pane/open_link: an agent opens a deep link. Answers the outcome of R3 (200) for every open the guard decided, refused ones included, each recorded; 403 for a caller that is not an agent known by its token.- label_
of 🔒 - The words for where a link goes, in English: srv has no i18n of its own, so it names the view and place by id.
- limiter 🔒
- own_
values 🔒 - The values and parameters a place marks as the caller’s own (G5).
- record 🔒
- G9: the open, recorded as the agent.
- refusal 🔒
- resolve_
target 🔒 - Where the open lands (G3, D1):
besidethe caller, or a new pane in its tab. A window is refused; a tab or a pane that is not the caller’s own is not reached: the open lands in the caller’s own tab. - tab_
of_ 🔒block - window_
of_ 🔒tab