Changelog
[0.1.0] - 2026-09-12
Version policy note: the ecosystem stays early — everything is 0.1.0. This
entry records the runtime widget work that joined the repo on top of the
existing xtop-plugin-samurai crate.
Runtime widget hosts (opt-in)
- New crate
xtop-plugin-wasm(xtop-plugin-wasm, featureplugin-wasmin the kernel): loads sandboxed*.wasmwidgets in-process with wasmi. Discovery in<config dir>/wasm/(overrideXTOP_WASM_DIR), mtime hot reload,status/render/reloaddebug actions, and anexamples/inspect.rsharness that runs a module without the kernel. Sandbox limits: 100M fuel per host→guest call sequence, 64 MiB linear memory, only thehost.logimport linked. - New crate
xtop-plugin-external(xtop-plugin-external, featureplugin-external): one helper process per widget over line-delimited JSON. Descriptors in<config dir>/external/*.json(overrideXTOP_EXTERNAL_DIR), per-response timeout, last-good draw list on failures, clean shutdown. Any language with a runtime can implement a widget. - New shared crates:
xtop-wasm-contract— serializableManifest/State/DrawListcontract plus the externalRequest/Responseprotocol (ABI"1").xtop-widget-replay— host-side replay of draw lists onto a ratatui frame and the plugin-context → contractStateconversion.xtop-wasm-guest— Rust guest SDK (export_widget!macro, ABI exports,host.logusage) for building widgets towasm32-unknown-unknown.
- Kernel integration is additive and opt-in: the two hosts are non-default
features, register through the existing plugin widget path (precedence
over compiled-in packs), and leave the compiled-in plugin/pack system
untouched. See
docs/decisions.md(ADR-001).
Examples
examples/wasm/— Rust guestsclock,cpu,procsandload-stats(statistics: EMA, z-score), plus freestanding C guestsc-tickerandc-cpu-avgbuilt with clang + wasm-ld and no libc/WASI.examples/external/— Lua (lua-clock,lua-histogram), Python (python-cpu,python-cpu-chart,python-mem-regression) and Node (node-clock) helper widgets, all dependency-free.
Tooling
scripts/build-examples.sh— builds every guest (Rust wasm32 + C) and can smoke-test them through the real host loader.scripts/test-wasm-e2e.sh,scripts/test-external-e2e.sh— end-to-end checks of both lanes (skip runtimes that are not installed).scripts/ci.sh— new optional stageswasmandexternal; the default stages (fmt,clippy,check,test) are unchanged.
Documentation
docs/wasm-widgets.md— WASM host: ABI, sandbox limits, draw-list ops, hot reload, authoring guide.docs/external-widgets.md— external host: descriptors, protocol, lifecycle, timeouts.docs/decisions.md— ADR-001 (runtime widget hosts).examples/wasm/README.md,examples/external/README.md— per-example build/run instructions.
Compatibility
- No breaking changes to
xtop-plugin-samuraior to thextop-plugin-apicontract. The new crates are additive workspace members. - The guest-facing ABI is versioned (
"1"); guests declaring a differentapivalue load with a warning.