Expand description
Actions, JSON requests, and the shared dispatcher.
Structs§
- Call
Context - Flags shared by every action. JSON keys are removed before the action is decoded.
- Line
Options - Options from the CLI that JSON requests do not carry.
- Request
- A JSON request: an optional
id, shared flags, and anAction. - Response
- JSON result printed by the CLI and returned by
dispatch.
Enums§
- Action
- One desktop action. Serialized with an
actiontag. - Apple
Event Language - Language of an Apple event script. macOS only.
Constants§
- APPLE_
EVENT_ TIMEOUT_ SECS - Default timeout for an
osascriptinvocation, in seconds. - MENU_
DEFAULT_ DEPTH - Default recursion depth for
menu_list. Matches the AXMenuBar chain (menu bar -> menu bar item -> menu -> submenu) plus one extra level. - MENU_
MAX_ DEPTH - Maximum recursion depth accepted by
menu_list. AX nesting beyond this stops with a*placeholder so the report never explodes. - SHORTCUTS_
TIMEOUT_ SECS - Default timeout for a
shortcuts runinvocation, in seconds.
Functions§
- dispatch
- Run
actionon the platform backend. - dispatch_
context - Run
actionwith shared flags on the platform backend. - dispatch_
with - Run
actiononbackend. Panics inside the backend become an error response. - dispatch_
with_ context - Run
actiononbackendwith shared flags. - handle_
request_ line - Decode one JSON line and dispatch it.
- handle_
request_ line_ opts - Decode one JSON line and apply CLI
--policyand--confirm-cmd. - handle_
request_ line_ with - Decode one JSON line.
cli_adapteris the process--adapterflag. - parse_
request - Parse one JSON object.
idand the shared flag keys are removed before the action is decoded.