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 <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-15 22:18:53 +02:00
parent 25353adb43
commit 0b60b71360
5 changed files with 23 additions and 23 deletions

View file

@ -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<ColorScheme, PluginError> {
// 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<String, PluginError> {
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<u8>) -> Result<RenderedOutput, PluginError> {
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