studio-theme-solarized/README.md
flemming-it 6817752ae3 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>
2026-05-25 14:31:23 +02:00

51 lines
1.7 KiB
Markdown

# studio-theme-solarized
First in-tree Studio plugin. Ships Ethan Schoonover's
Solarized palette as a Material 3 ColorScheme pair through the
WIT `theme` export.
## Status
**v0.1 builds.** The `target/wasm32-wasip2/release/studio_theme_solarized.wasm`
artefact (~22 KiB stripped) is a valid F∆I Studio plugin
component. What remains for full round-trip:
- The Hub side needs an `InvokePlugin` gRPC RPC + a
Component-Model loader path for `studio-plugin`-world
components. Tracked as task #80.
- Studio side needs `plugin_host.dart` + a theme-picker UI
that lists installed `studio.theme.*` capabilities.
Until those land, this plugin can be inspected with
`wasm-tools component wit` and packed via `fai pack`
`/tmp/studio-theme-solarized-0.1.0.fai` is sha256
`e3d5aae44bb97f14f8f84e293ef8742700956b69c7d6fe46bb8b3c97fc1b23a0`.
## Palette
Ethan Schoonover's [Solarized](https://ethanschoonover.com/solarized/).
14 Material 3 tokens per brightness, in the order Studio
expects (primary → on-primary → secondary → … →
outline-variant). Both Light and Dark are explicit consts in
`src/lib.rs`.
## Why the source has three Guest impls
v0.1 of the SDK declares all three plugin hooks (`theme`,
`translate`, `output-view`) in a single WIT world. A plugin
that only cares about one hook still has to declare all three
— the other two return `PluginError::Declined`, and Studio
falls back to its built-in renderer / the `[EN]` badge.
v0.2 will split the WIT into one world per hook so a theme
plugin only writes the theme impl. See
`docs/advanced/studio-plugin-sdk.md` in `fai/platform` for
the design notes.
## Build
```bash
cargo build --release --target wasm32-wasip2
cp target/wasm32-wasip2/release/studio_theme_solarized.wasm module.wasm
fai pack .
```