Expand description
What crosses the pipe between the daemon and an addon.
ADR-0016. One JSON
object per line, in both directions. Line-delimited rather than
length-prefixed or a binary codec because this is a published interface:
it has to be readable in a log, reproducible with echo, and implementable
by an addon author who has not installed a code generator.
§Two shapes for one declaration, and why that is not two definitions
The trait declares actions as &'static [AddonAction], which is pleasant to
write as a const and impossible to deserialise. So the types here are
owned mirrors — ActionDecl beside AddonAction,
and so on.
They are not two things to keep in step. The author writes the borrowed one
once; run derives the owned one from it at the boundary.
Nothing hand-maintains the second, so the failure Constitution VI is about —
two definitions drifting — has nowhere to happen.
§Both directions, and why the addon speaks first only about credentials
Almost everything is the daemon asking and the addon answering. The one
exception is Ask, which an addon sends while answering, when it needs
one of its own credentials. That makes the conversation strictly nested —
request, optional asks and their answers, reply — which is what lets
Credentials stay a plain synchronous call in the
addon’s code rather than infecting the trait with futures.
Structs§
- Action
Decl - One action, owned. Mirrors
AddonAction. - Choice
Decl - One option, owned. Mirrors
AddonChoice. - Choices
Decl - One named list of options, owned. Mirrors
AddonChoices. - Description
- Everything static about an addon.
- Device
Action Decl - One device-resolved action, owned. Mirrors
DeviceAction. - Param
Decl - One parameter, owned. Mirrors
AddonParam. - Setting
Decl - One setting, owned. Mirrors
AddonSetting. - Signal
Decl - One signal, owned. Mirrors
AddonSignal. - Version
- A protocol version.
Enums§
- Answer
- The daemon’s answer to an
Ask. - Ask
- A credential request, from the addon to the daemon.
- Availability
Decl - Whether an addon can act, owned. Mirrors
Availability. - Failure
Kind - Why an action failed, in the categories the daemon distinguishes.
- Keystroke
Decl - One keystroke, owned. Mirrors
DeviceKeystroke. - Permission
Decl - One permission, owned. Mirrors
Permission. - Reading
Decl - A signal reading, owned. Mirrors
Reading. - Reply
- What an addon says back.
- Request
- What the daemon asks an addon to do.
Constants§
- PROTOCOL
- The protocol version this SDK speaks.