Skip to main content

Module ui_shortcuts

Module ui_shortcuts 

Source
Expand description

Agent-facing shortcuts (ListShortcuts / RunCommand / PressKeys, and UI bind / reset), docs/specs/PLAN_SHORTCUTS_VERIFIED_AND_APP_API_2026_10_10.md §4. Same identity model as the rest of ui_handlers: the caller’s own pane is derived from its verified identity, never taken from the request.

Constants§

MAX_BINDINGS 🔒
The most keys, and the longest key or when, a request may carry: a command has a handful of keys.
MAX_KEY_LEN 🔒
MAX_WHEN_LEN 🔒

Functions§

agent_name 🔒
What the person calls the agent: the name it was given, not the lowercase id it signs its requests with. The id stands in for an agent the registry does not know.
close_pane 🔒
RunCommand pane:close: the pane named by target, closed the way ClosePane closes it (app_api::pane::close_pane_as): it waits 30 s for its user to keep it, and the answer says so. The key itself closes the focused pane at once, with no undo, so the page never runs it for MuxAPI.
handle_ui_press_keys 🔒
POST /api/v1/ui/shortcuts/press — backs PressKeys.
handle_ui_reset_shortcuts 🔒
POST /api/v1/ui/shortcuts/reset — backs UI action reset.
handle_ui_run_command 🔒
POST /api/v1/ui/shortcuts/run — backs RunCommand.
handle_ui_set_shortcut 🔒
POST /api/v1/ui/shortcuts/set — backs UI action bind. The page applies the same edit the Settings view makes and refuses what an agent may not do (a key another command has, a key the system takes); the person is told and can undo it.
handle_ui_shortcuts_list 🔒
POST /api/v1/ui/shortcuts/list — backs ListShortcuts.
name_or_id 🔒
refused_command 🔒
Commands no agent may run: agents are first-class owners, so only what has no protection. A permanent delete can’t be undone. The frontend refuses it too, and PressKeys of any key bound to it.
shortcut_target 🔒
The pane a command or key press acts on: the caller’s own pane (own) when requested is absent or names it, else the pane other accepts (a browser pane it opened), else the refusal. A command is the person’s own action as far as the app can tell, so an agent never runs one against the focused pane (which may be another agent’s, or theirs) or any pane it doesn’t drive.