From 0b60b7136052289d8772a626bbec75308b9beed8 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Mon, 15 Jun 2026 22:18:53 +0200 Subject: [PATCH] refactor: rename WIT contract fai:platform/fai:studio-plugin->chain:* Tracks the platform WIT ABI rename. Plugin world package becomes chain:studio-plugin and host imports chain:platform/host. Crate name stays fai-plugin-sdk (vendor namespace) for now. Signed-off-by: flemming-it --- Cargo.toml | 4 ++-- README.md | 16 ++++++++-------- src/lib.rs | 20 ++++++++++---------- wit/deps/platform/world.wit | 2 +- wit/studio-plugin.wit | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 014820f..eb33b99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ # use fai_plugin_sdk::{export_plugin, bindings}; # # struct MyTheme; -# impl bindings::exports::fai::studio_plugin::theme::Guest for MyTheme { +# impl bindings::exports::chain::studio_plugin::theme::Guest for MyTheme { # fn theme_for(brightness: String) -> Result<_, _> { ... } # } # @@ -56,7 +56,7 @@ crate-type = ["rlib"] wit-bindgen = "0.36" [package.metadata.component] -package = "fai:studio-plugin-sdk" +package = "chain:studio-plugin-sdk" [package.metadata.component.target] path = "wit" diff --git a/README.md b/README.md index bd2c530..ab7aa9b 100644 --- a/README.md +++ b/README.md @@ -60,13 +60,13 @@ fai-plugin-sdk = { git = "https://git.flemming.ai/fai/plugin-sdk-rust", branch = // src/lib.rs of your plugin use fai_plugin_sdk::{bindings, export_plugin}; -type ColorScheme = bindings::fai::studio_plugin::plugin_types::ColorScheme; -type PluginError = bindings::fai::studio_plugin::plugin_types::PluginError; -type RenderedOutput = bindings::fai::studio_plugin::plugin_types::RenderedOutput; +type ColorScheme = bindings::chain::studio_plugin::plugin_types::ColorScheme; +type PluginError = bindings::chain::studio_plugin::plugin_types::PluginError; +type RenderedOutput = bindings::chain::studio_plugin::plugin_types::RenderedOutput; struct MyPlugin; -impl bindings::exports::fai::studio_plugin::theme::Guest for MyPlugin { +impl bindings::exports::chain::studio_plugin::theme::Guest for MyPlugin { fn theme_for(brightness: String) -> Result { // Return a ColorScheme or PluginError::Declined. } @@ -74,12 +74,12 @@ impl bindings::exports::fai::studio_plugin::theme::Guest for MyPlugin { // v0.1: every plugin must declare all three hooks. Plugins // that don't actually serve a hook return Declined. -impl bindings::exports::fai::studio_plugin::translate::Guest for MyPlugin { +impl bindings::exports::chain::studio_plugin::translate::Guest for MyPlugin { fn translate(_: String, _: String, _: String) -> Result { Err(PluginError::Declined("not a translate plugin".to_string())) } } -impl bindings::exports::fai::studio_plugin::output_view::Guest for MyPlugin { +impl bindings::exports::chain::studio_plugin::output_view::Guest for MyPlugin { fn render(_: String, _: Vec) -> Result { Err(PluginError::Declined("not a view plugin".to_string())) } @@ -99,10 +99,10 @@ fai pack . -o my-plugin-0.1.0.fai ``` wit/ -├── studio-plugin.wit # main world, fai:studio-plugin@0.1.0 +├── studio-plugin.wit # main world, chain:studio-plugin@0.1.0 └── deps/ └── platform/ - └── world.wit # fai:platform@1.0.0 (host imports) + └── world.wit # chain:platform@1.0.0 (host imports) ``` Both files are verbatim copies of the authoritative versions diff --git a/src/lib.rs b/src/lib.rs index 8aa6a9f..89f0638 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,7 +43,7 @@ pub mod bindings { world: "studio-plugin", path: "wit", // Generate bindings for the entire WIT package - // (incl. fai:platform/host that studio-plugin imports + // (incl. chain:platform/host that studio-plugin imports // for log emission), so plugins don't need a separate // `with: …` mapping. generate_all, @@ -59,12 +59,12 @@ pub mod bindings { // v0.1: plugin authors reference paths inside `bindings::` // directly. The typical ones are: // -// bindings::exports::fai::studio_plugin::theme::Guest -// bindings::exports::fai::studio_plugin::translate::Guest -// bindings::exports::fai::studio_plugin::output_view::Guest -// bindings::fai::studio_plugin::plugin_types::ColorScheme -// bindings::fai::studio_plugin::plugin_types::PluginError -// bindings::fai::studio_plugin::plugin_types::RenderedOutput +// bindings::exports::chain::studio_plugin::theme::Guest +// bindings::exports::chain::studio_plugin::translate::Guest +// bindings::exports::chain::studio_plugin::output_view::Guest +// bindings::chain::studio_plugin::plugin_types::ColorScheme +// bindings::chain::studio_plugin::plugin_types::PluginError +// bindings::chain::studio_plugin::plugin_types::RenderedOutput // // Stable re-exports under terser names land in v0.2 — they // have to wait for the proc-macro that materialises the @@ -78,10 +78,10 @@ pub mod bindings { /// use fai_plugin_sdk::{export_plugin, bindings}; /// /// struct MyTheme; -/// impl bindings::exports::fai::studio_plugin::theme::Guest for MyTheme { +/// impl bindings::exports::chain::studio_plugin::theme::Guest for MyTheme { /// fn theme_for(b: String) -/// -> Result +/// -> Result /// { /// // ... /// } diff --git a/wit/deps/platform/world.wit b/wit/deps/platform/world.wit index 9a40fbf..58ac024 100644 --- a/wit/deps/platform/world.wit +++ b/wit/deps/platform/world.wit @@ -24,7 +24,7 @@ // stable, ergonomic surface. That is what protects modules // from any future evolution of this contract. -package fai:platform@1.0.0; +package chain:platform@1.0.0; /// Types that flow between the host (hub) and modules. interface types { diff --git a/wit/studio-plugin.wit b/wit/studio-plugin.wit index 28d8f38..2aaf612 100644 --- a/wit/studio-plugin.wit +++ b/wit/studio-plugin.wit @@ -27,7 +27,7 @@ // hook function per declared `studio_extension.hook` in // module.yaml, and renders / wires the result. -package fai:studio-plugin@0.1.0; +package chain:studio-plugin@0.1.0; // ============================================================= // Shared types @@ -177,7 +177,7 @@ world studio-plugin { /// Plugins import the same `host` interface as flow modules, /// so they can emit structured logs without a separate /// bridge. Logs flow into the hub's event log. - import fai:platform/host@1.0.0; + import chain:platform/host@1.0.0; /// Hook exports. Each is optional; the hub introspects the /// component to learn which the plugin supports.