@evox/plugin-protocol; the renderer/plugin payload is not authoritative, identity and context are derived by the host.
Contract rules
- Each binding instance is valid only for its own
bindingInstanceIdcontext. A display call afteraction.willDisappearis rejected withCONTEXT_EXPIRED. - The host-assigned
session.plugin.pluginIdis the only authoritative identity; no other identity is selected through an event/RPC payload. - RPC calls require a capability. A call that is not declared/granted returns
CAPABILITY_DENIED(see Capability APIs). - Error behavior is fail-closed; for codes see Error codes.
Received events (host → plugin)
Registered withclient.on(<event>, handler). Handlers must be registered before the client.start() handshake.
Plugin lifecycle
Device
Action binding
Every event carries
actionId and bindingInstanceId in event.context. An actionId the plugin does not recognize must be ignored.
Host-RPC calls (plugin → host)
Called through the SDK client; each returns aPromise and fails closed.
Key/screen display — key.display capability
Settings persistence
Every key you write must be declared in the manifest’s settings schema: the action’s
settingsSchema for a call with a context, the plugin-wide settingsSchema for a call without one. A request containing a key that is not declared in the schema is rejected with INVALID_REQUEST (SDK 0.2.0 behavior change; the binding level now follows the same rule as plugin-wide settings). An attempt to write a secret or oauth field through this path returns CAPABILITY_DENIED.
Plugin-scoped storage — storage.private capability
Network and credentials — network.fetch / secret.manage / oauth
System and advanced surface
The following calls are defined in the protocol and capability-protected; without a separate SDK shortcut method, they are used through the genericclient.request(<rpc>, params) path. Each requires the related permission to be declared in the manifest and a host/user grant.
Notes
- This reference reflects the current protocol version; capability names and limits are normative on the Capability APIs page.
- For the public distribution boundary and T1/T2/T3 differences, see Trust tiers and Distribution status.
