postMessage. There are two kinds of message:
- Requests the plugin sends, each answered by one response.
- Events Mission Control pushes into the frame, with no response.
Methods the plugin can call
The bridge resolves the capability each call needs from the method (and, where noted, from its arguments) and checks it against the plugin’s grants. A method not in this list is rejected withmethod_unknown.
The plugin never computes the capability id itself. The capability an
envelope claims is ignored; the bridge re-resolves it.
Host-pushed events
Other host-pushed topics (for example the
video.overlay host props, or
an agent plugin’s state read-back) arrive on the same channel and are
read with ctx.events.subscribe(topic, handler).
Wire shape
PluginClient builds these: it generates the id, attaches
the protocol version, and waits for the correlated response.
Error envelopes
When the bridge rejects a request it returns a response witherror: { code, message }. The SDK throws a HostError whose code
carries the machine-readable code:
Branch on
code, not on message.
There is also an
origin_mismatch error, but the bridge never sends it
to the plugin. A message from a window that is not the plugin’s iframe
is dropped and recorded as a security event on the host side.Theming
theme.changed arrives once on mount and again on every theme change.
The payload is a Record<string, string> of CSS variables. Apply them
by walking the entries:
i18n
A plugin ships a locale bundle in its archive; Mission Control streams the active bundle to the frame on mount. Format keys withctx.i18n.t(key, params):
Next steps
TypeScript SDK
The typed wrappers over these methods.
Event hooks and bus
The agent-side event bus.
Permissions
The capabilities these methods check.