Files
ruvnet--RuView/v2/crates/homecore-plugins/Cargo.toml
T
ruv c04906e7a8 feat(homecore-plugins/p1): ADR-128 plugin runtime scaffold
Adds `v2/crates/homecore-plugins` (0.1.0-alpha.0) — the P1 scaffold for
the HOMECORE-PLUGINS WASM integration system (ADR-128):

- `manifest.rs`: `PluginManifest` — superset of HA manifest.json; serde
  round-trip + required-field validation (`domain`/`name`/`version`).
- `error.rs`: `PluginError` typed enum (InvalidManifest, AlreadyLoaded,
  NotFound, RuntimeError, SetupFailed, UnloadFailed, Io).
- `plugin.rs`: `HomeCorePlugin` async trait + `PluginId` newtype.
- `runtime.rs`: `PluginRuntime` trait + `InProcessRuntime` (native Rust,
  first-party plugins). `WasmtimeRuntime` stub gated on `--features wasmtime`
  (default-off; 30 MB dep deferred to P2).
- `registry.rs`: `PluginRegistry<R>` — load/unload/list/contains via RwLock.
- 10 unit tests, 0 failed.

Wasmtime vs wasm3 runtime selection is still open (ADR-128 §8 Q2);
this scaffold makes the choice swappable via the `PluginRuntime` trait.
The `wasmtime` and `wasm3` features are default-off; P2 resolves the choice
and wires host ABI (`hc_state_get`/`hc_state_set`/etc.) to ADR-127.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-25 18:13:53 -04:00

58 lines
2.0 KiB
TOML

# HOMECORE-PLUGINS — WASM integration plugin system.
# Implements ADR-128 (HOMECORE-PLUGINS), P1 scaffold:
# - PluginManifest (serde-deserialised, superset of HA manifest.json)
# - HomeCorePlugin async trait + PluginId + PluginError
# - PluginRuntime trait + InProcessRuntime (native Rust, first-party plugins)
# - PluginRegistry (load / unload / list)
#
# P2 will add the `wasmtime` feature (gated below, default-off) for the real
# Wasmtime JIT sandbox. wasm3 interpretation mode lands behind `--features wasm3`
# in P3 for constrained-hardware targets.
[package]
name = "homecore-plugins"
version = "0.1.0-alpha.0"
edition = "2021"
license = "MIT"
authors = ["rUv <ruv@ruv.net>", "HOMECORE Contributors"]
description = "WASM integration plugin runtime for HOMECORE (ADR-128 P1 scaffold)"
repository = "https://github.com/ruvnet/RuView"
[lib]
name = "homecore_plugins"
path = "src/lib.rs"
[features]
default = []
# P2: real Wasmtime JIT sandbox (Cranelift; ~15 MB binary delta on Pi 5).
# Do not enable in production until the host ABI is frozen (ADR-128 §8 risk).
wasmtime = ["dep:wasmtime"]
# P3: wasm3 interpretation mode for constrained hardware (~50 kB).
wasm3 = ["dep:wasm3"]
[dependencies]
# HOMECORE state machine — local path (ADR-127).
homecore = { path = "../homecore", version = "0.1.0-alpha.0" }
# Async runtime — same version as workspace.
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros"] }
# Async trait support for HomeCorePlugin.
async-trait = "0.1"
# Error handling.
thiserror = "1"
# Serialisation (manifest JSON + ABI call payloads).
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Optional Wasmtime runtime (P2, default-off — 30 MB dep).
wasmtime = { version = "25", optional = true }
# Optional wasm3 interpretation runtime (P3, default-off).
wasm3 = { version = "0.3", optional = true }
[dev-dependencies]
tokio = { version = "1", features = ["sync", "rt", "rt-multi-thread", "time", "macros", "test-util"] }