feat: studio.theme.solarized v0.1.0 builds against SDK

Promotes the skeleton to a real WASM plugin component. The
22 KiB stripped artefact at
target/wasm32-wasip2/release/studio_theme_solarized.wasm
is the proof-of-contract for fai-studio-plugin-sdk v0.1.

Implements:

- theme::Guest::theme_for(brightness) returning the
  pinned Solarized Light/Dark palettes (14 ARGB tokens
  each). Brightness names other than "light"/"dark"
  return PluginError::Declined.
- translate::Guest + output_view::Guest as Declined-only
  stubs — v0.1 of the SDK requires all three hooks per
  plugin; v0.2 will split the WIT.

Cargo.toml pins edition 2021 (matches SDK; wit-bindgen
0.36 codegen does not yet support edition 2024).

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-05-25 14:31:23 +02:00
parent a1f8412205
commit 6817752ae3
5 changed files with 520 additions and 105 deletions

View file

@ -1,28 +1,16 @@
# SKELETON — does not yet compile.
# Standalone Cargo.toml — targets wasm32-wasip2.
#
# This crate targets the studio-plugin world declared in
# `wit/studio-plugin.wit`. It cannot be built until two
# upstream pieces ship:
# Build:
# cargo build --release --target wasm32-wasip2
#
# 1. The `fai-studio-plugin-sdk` crate that wraps the WIT
# bindings with an ergonomic Rust API (the `#[plugin(theme)]`
# attribute referenced in `src/lib.rs`).
# 2. Studio's plugin-host module that discovers, loads, and
# invokes plugin components at GUI startup.
#
# Both are documented in `docs/advanced/studio-plugin-sdk.md`.
# Until they exist, this directory serves three purposes:
#
# - Validates the WIT-file structure by being a real crate that
# references it (parse-only path).
# - Locks in the exact Solarized colour palette so the
# in-tree first plugin doesn't bike-shed at integration time.
# - Gives the SDK author a concrete consumer to test against.
# Output: target/wasm32-wasip2/release/studio_theme_solarized.wasm
[package]
name = "studio_theme_solarized"
version = "0.1.0"
edition = "2024"
# Track the SDK's edition — wit-bindgen 0.36 codegen does not
# yet support edition 2024.
edition = "2021"
authors = ["Dr. Stefan Flemming <platform@flemming.ai>"]
license = "Apache-2.0"
publish = false
@ -34,9 +22,10 @@ rust-version = "1.85"
crate-type = ["cdylib"]
[dependencies]
# Forward-reference: this crate doesn't yet exist. Tracked in
# docs/advanced/studio-plugin-sdk.md.
# fai-studio-plugin-sdk = { git = "https://git.flemming.ai/fai/studio-plugin-sdk", branch = "main" }
# The SDK lives in fai/fai_studio_plugin_sdk during bootstrap;
# in production this will be a git dependency pointing at
# https://git.flemming.ai/fai/studio-plugin-sdk.
fai-studio-plugin-sdk = { path = "../../fai_studio_plugin_sdk" }
[package.metadata.component]
package = "fai:studio-plugin"