2.6 KiB
Application-scoped Tentacle commands
Protocol 1.1 optionally negotiates the application-bindings API. It is an API,
not an automation permission, and requires neither presentation nor interaction.
The Go and Python SDKs expose the application command field. Older readers
reject packages requesting the unsupported API before starting them.
A command may declare application: "Example App" and propose global bindings
within that application. The selector is an exact X11 WM_CLASS instance or class,
containing 1–127 bytes of nonempty printable UTF-8. Titles and wildcard patterns
are never interpreted. Scope declarations require the negotiated API; protocol
1.0 and ungranted declarations cannot opt in silently.
Local development specs opt in with SessionEvents: true and
ApplicationBindings: true. Native package manifests include session-events
and application-bindings in their API list and protocol minor 1. Registry entries
persist the API opt-in separately from install permissions.
Application shortcuts use passive grabs on the matching client window, leaving the desktop root window available to other shortcut owners. Core global commands, explicit user assignments and earlier Tentacles retain priority. Unmodified browser defaults apply outside the selected application. An ancestor/global X11 shortcut owner may still take priority over a client-window shortcut.
The input owner refreshes application context on its bounded focus poll after held chords release. Activation can take up to one poll interval (100 ms). Inactive application bindings introduce no per-chord native metadata queries. Native admission rechecks actual focus and class, while the ordinary browse/OCR source checks retain their own anchors. Changing application bindings never retargets an existing OCR result to a different window.
Unavailable or conflicting client grabs disable only the optional application bindings. All client grabs are removed after a partial failure, core controls remain owned, and shortcut help marks the application commands unavailable. Re-entering the application or changing keyboard configuration retries them. Destroying a client window is an expected lifecycle event.
The Python/Go 1.0 and ordinary 1.1 contracts remain unchanged. Existing unscoped Tentacle shortcuts retain the prior OCR input-retirement policy. Application commands have no mouse or OCR automation authority unless they separately declare and receive a separate automation permission.
X11 is supported. Native Wayland application shortcut registration is unavailable. These selectors provide scope, not application authentication or a sandbox.