Skip to main content

Module action_access

Module action_access 

Source
Expand description

Which websocket RPC commands a connection may call without being the AgentMux window.

Holding the instance key opens a connection; it does not make the connection the window. A command is the window’s alone unless it is listed here: a new command is refused to everything but the window until someone decides it is safe to open. server::dispatch_guard applies these lists at dispatch, and scripts/gen-operator-commands.mjs writes the frontend’s list of commands that wait for the window’s proof from them and from super::action_commands.

Constants§

EVENT_COMMANDS
The commands that carry an event name, which only the events in OPEN_EVENTS may be named in by a connection that is not the window: every event is delivered to whoever subscribed to it, and most carry another’s words (a pane’s output, a person’s typing, an agent’s turns).
OPEN
Calls any connection may make: they read what the window itself shows to anyone who can open it, they only subscribe this connection, or the handler decides per caller (setconfig per key, notify.ack by the launcher’s proof). The window makes these before its own proof lands.
OPEN_EVENTS
The events any connection may subscribe to or read the history of: the launcher’s notification events.
OWN_PANE
Calls a connection registered as an agent may make although they are the window’s: the handler lets the agent act on its own pane only (server::pane_caller) and refuses the rest.

Functions§

is_open_for
Whether any connection may call command with this request: it is open, and when it names an event (eventsub, eventreadhistory) the event is one of OPEN_EVENTS.
is_own_pane
Whether a connection registered as an agent reaches command’s handler although the command is not open: the handler checks the pane.