Skip to main content

Module protocol

Module protocol 

Source
Expand description

Actions, JSON requests, and the shared dispatcher.

Structs§

CallContext
Flags shared by every action. JSON keys are removed before the action is decoded.
LineOptions
Options from the CLI that JSON requests do not carry.
Request
A JSON request: an optional id, shared flags, and an Action.
Response
JSON result printed by the CLI and returned by dispatch.

Enums§

Action
One desktop action. Serialized with an action tag.
AppleEventLanguage
Language of an Apple event script. macOS only.

Constants§

APPLE_EVENT_TIMEOUT_SECS
Default timeout for an osascript invocation, 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 run invocation, in seconds.

Functions§

dispatch
Run action on the platform backend.
dispatch_context
Run action with shared flags on the platform backend.
dispatch_with
Run action on backend. Panics inside the backend become an error response.
dispatch_with_context
Run action on backend with shared flags.
handle_request_line
Decode one JSON line and dispatch it.
handle_request_line_opts
Decode one JSON line and apply CLI --policy and --confirm-cmd.
handle_request_line_with
Decode one JSON line. cli_adapter is the process --adapter flag.
parse_request
Parse one JSON object. id and the shared flag keys are removed before the action is decoded.