Extend

Plugins

All docs

A plugin adds a check, an importer or a generator to Velluma. It runs as a small WebAssembly program in a separate, restricted process and can only propose changes; Velluma writes them as one entry in History.

Use a plugin

  1. Install it
    velluma plugin install ./a11y-check

    Velluma first lists in plain words what the plugin asks to do, with the plugin's reason for each. Add --yes to install.

  2. Run it
    velluma plugin run dev.velluma.a11y-check check

    A plugin action that would change the site shows its plan first. Pass details with --args '{"…": "…"}'.

  3. Remove it
    velluma plugin list
    velluma plugin remove dev.velluma.a11y-check

NoteInstalling and removing are yours to do. An agent can list and run plugins, but not install one.

What a plugin may do

A plugin gets no files, network, clock, random numbers or programs to run, and cannot read passwords or keys. It asks for some of these five permissions, each with a one-line reason:

query:siteRead the pages, styles and shared design values of the open site.
query:observeRead how the pages render: sizes, positions and computed styles.
propose:cssPropose changes to CSS rules, reviewed before anything is saved.
propose:tokenPropose new shared design values, reviewed before anything is saved.
asset:createHand over new files for the site.

A plugin that tries to use more than it asked for is refused. Each call gets at most 256 MB of memory and 30 seconds, and a plugin file can be up to 16 MiB.

The manifest

Each plugin folder holds its WebAssembly component and a velluma-plugin.toml. This is the one from Velluma's accessibility check:

id = "dev.velluma.a11y-check"
name = "Accessibility check"
version = "0.1.0"
api = "velluma:plugin@0.1"
min-app = "0.0.0"
kinds = ["check"]
license = "LicenseRef-exoTools-Proprietary"
source = "https://github.com/exochard/Velluma"

[component]
path = "a11y-check.wasm"
sha256 = "006815b0…"

[[capabilities]]
name = "query:observe"
reason = "Reads how each page renders to find contrast and size problems."

[limits]
memory-mb = 16
time-ms = 2000
idA reverse-domain name, unique to your plugin.
apiThe plugin interface version it was built for.
[component]The WebAssembly file and its SHA-256, checked before it runs.
[[capabilities]]One entry per permission, each with a reason of up to 200 characters. Listing one twice is an error.
[limits]Memory and time per call, within the host's 256 MB and 30 seconds.

Build one

A plugin is a WebAssembly component built against Velluma's interface file, velluma:plugin@0.1.0, with one interface per permission. Requests and answers are JSON text.

EarlyThe plugin interface is at version 0.1 and will change before 1.0. Build against it to experiment, and expect to rebuild.