A plugin is a WebAssembly module, or one file of JavaScript run by the engine Blossom embeds, that the host asks for an indicator, a command or a panel when the user does something.
| Piece | Where |
|---|---|
| Contract, version 1 — frozen | crates/protocol/src/plugin |
Contract, version 2 — timers, alarm, wake, kept text | crates/contract |
| SDKs | sdks/plugin, sdks/second, sdks/assemblyscript, sdks/javascript |
| Rules — the registry, and when the host is told to ask | crates/application/src/plugin |
| Ports | PluginHost, CatalogSource in crates/application/src/ports |
Host — ExtismPluginHost | crates/infrastructure/src/plugin |
| Bridge, harness, catalog | crates/bridge/src/plugin, sdks/harness, apps/catalog |
A plugin exports up to five functions with fixed names, each taking and returning JSON with camelCase keys, and the host decides when to call.
| Export | Returns | The host calls it |
|---|---|---|
describe | the manifest | right after loading the module |
indicator | an indicator, or null | only if the manifest declares one |
command | {}, or { "panel": … } | only for a declared command |
panel | a panel | only if the manifest declares one |
wake | {}, or { "alert": … } | version 2, granted Alerts, when its alarm is due |
A plugin never acts by itself: it cannot call the host, and the host never asks on a timer. A manifest carries no identifier, so the host names a plugin after its file. Nothing is cut to fit, so an answer that breaks a limit is refused whole.
Version 2 adds what a plugin that keeps time needs: a timer, a block timers, one alarm, the export wake with its alert, remember and recall, and permissions.links. An older Blossom refuses it as incompatible.
A module is a cdylib built for wasm32-unknown-unknown; a script is one ES module of 4 MiB at most, run by QuickJS-NG built for WASI and pinned by ENGINE_DIGEST. Describing either has three steps:
describe — inside the sandbox, under the limits of every call.| Limit of one call | Value | Past it |
|---|---|---|
| Time | 2 seconds, shared by every request it sends | exhausted |
| Work | 2 000 000 000 units of fuel | exhausted |
| Memory | 256 pages, 16 MiB | exhausted |
| Size of an answer | 64 KiB | invalid |
A failure is one of eight kinds — unreadable, too large, unsupported, exhausted, incompatible, invalid, not stored, mismatched — and the app words it.
grants in the configuration file. A grant or a revocation re-links the module before its next call and throws its thread away.fetch is https on port 443 to a granted host, with no redirect followed, no proxy and only public addresses; localhost and 127.0.0.1 are the exception, once granted.CredentialStore over the Keychain, and the host adds the header after every check.crates/infrastructure/src/catalog/keys.rs, keeps the digest of every module for a revocation, and refuses a module that is not what its entry says.Plugins live in ~/Library/Application Support/Blossom/plugins, one <identifier>.wasm or <identifier>.js each, 64 at most, off until the user turns one on. Writing one is Plugins.