An Acruz family application can host signed packages that target it by package name and version. The protocol, upload verification, signing and the store review are shared; the host application owns execution, consent and how a package changes its interface.
Acruz One is one host. Its plugin worker and data-package workflow are a reference implementation, not a dependency: an application must not require Acruz One to load its own plugins or themes.
Host identity
- Target every package at the host's exact
package_nameand an inclusivemin_version/max_versionrange. - Reject a package that targets another host or a version outside the range before any payload is used.
acruz-runtime::plugins::policyandacruz-runtime::data::validate_bundleperform this check against the host identity you pass. - A downloaded package is trusted only after the store approval, developer signature, digests and inventory verify. Verify the artifact you received, not the metadata that pointed at it.
Plugins (.acp)
A plugin is a WebAssembly module with ABI v1: one exported memory, acruz_abi_version, acruz_alloc, acruz_run, and only the acruz.locale import (capability plugin.locale.read, explicit customer consent).
use acruz_runtime::plugins;
plugins::policy(&manifest, package_name, host_version, &consented_grants)?;
plugins::validate(&module_bytes, &consented_grants, locale)?;
let output = plugins::run(&module_bytes, &consented_grants, locale, &input_json)?;
The SDK enforces the module size, single memory/table, fuel (1,000,000 instructions), 16 MiB memory, 64 KiB input/output, JSON shape, start-function ban and the capability allowlist. Enable the crate's plugins feature for validate/run.
Isolation is the host's responsibility. Run plugins in a separate supervised process with a job/Job Object or equivalent, a wall-clock limit and cancellation that terminates the process; do not run an untrusted module in the UI process. Never expose WASI, filesystem, network, credentials, native DLLs or script execution.
Runtime authorization is separate from installation. Request GET /api/v1/releases/{release}/plugin-authorization with the customer's bearer token; the platform returns a store-signed acruz.plugin-run.v1 authorization valid for at most 72 hours. The customer must also hold a valid device licence for the application. Install plugins disabled by default; enable and run only after consent, signature, host/version and authorization checks. Explicit server denial disables the plugin.
Themes (.act) and settings (.acs)
Data packages contain exactly one canonical JSON entrypoint and no code, URLs, assets or secrets. Validate with the same policy the website applies at upload:
use acruz_runtime::data::{validate_bundle, Data};
let value = validate_bundle(&verified_bundle, package_name, host_version)?;
match value {
Data::Theme(theme) => apply_colors(theme), // merge into the host token baseline
Data::Preferences(prefs) => apply_preferences(prefs), // locale + reduce_motion
Data::Collection(collection) => add_shortcut(collection),
}
Themes carry only approved neutral surface/container, text and outline tokens as six-digit hex; the host brand, status colours, fonts and icons are not themeable in v1. Text pairs must meet 4.5:1 and control outlines 3:1. Apply a theme through the host's design-token layer so every screen updates from one source, keep a published baseline, and let the customer remove the override.
Settings may set locale and reduce_motion only. The host continues to honour the operating-system reduced-motion preference when the imported value is false. Reject external URLs, credentials, grants and arbitrary application settings.
Templates (.acx, manifest kind extension) in v1 support One catalog collections only. A different host must publish its own versioned template schema before it accepts one.
Workflow in the host
- Download the approved artifact and verify store approval, bundle signature, digests and host/version target.
- Validate the payload against the kind's schema before showing anything.
- Show a preview and require explicit consent; applying is a deliberate action.
- Apply transactionally: keep the previous state, write the new state in one transaction and offer an undo. A failed write leaves both intact.
- List applied packages with their identity and version; support disable and removal.
Same-version replacement and downgrades require an explicit restore, not a silent overwrite. The host must never evaluate payloads as HTML, CSS or JavaScript.
What the SDK provides and what you implement
| Concern | Provided | Your application |
|---|---|---|
| Manifest, signature, digest, inventory | acruz-runtime::packages / stream |
Call it on the downloaded bytes |
| Host and version targeting | plugins::policy, data::validate_bundle |
Pass its own identity |
| Plugin policy and bounded execution | plugins::validate / run (plugins feature) |
Supervised worker, cancellation, consent |
| Theme token schema and contrast | data::validate_payload / validate_bundle |
Apply tokens, preview, undo |
| Store authorization and licence | Platform endpoints | Bearer flow, caching and refusal states |
| UI, consent, disable/remove | — | Fully the host's |
Verification checklist
- Apply a compatible theme and confirm the token baseline changes and can be removed.
- Refuse a wrong-host theme, a wrong-version theme, an out-of-range plugin and an ungranted capability.
- Install a plugin disabled, enable it after consent, run it in both locales, then disable it.
- Deny the runtime authorization on the server and confirm the plugin disables.
- Interrupt an apply and confirm the previous state survives.
- Confirm no payload can reach the network, the filesystem or a script engine.
Record the evidence in the project's .tasks/ before a Release build.