refactor: rename to chain:studio-plugin WIT + provider chain

Tracks the platform's fai->chain rename: provider chain, WIT ABI
chain:studio-plugin / chain:platform (binding paths/accessors), SDK pin.

Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
flemming-it 2026-06-15 22:56:20 +02:00
parent 3f1fc1eae8
commit 7b7709b6b1
2 changed files with 7 additions and 7 deletions

View file

@ -1,5 +1,5 @@
schema_version: 3
provider: fai
provider: chain
name: studio-translate-ollama
version: 0.1.0

View file

@ -19,16 +19,16 @@
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;
const DEFAULT_ENDPOINT: &str = "http://localhost:11434/api/chat";
const DEFAULT_MODEL: &str = "qwen2.5:14b";
struct OllamaTranslatePlugin;
impl bindings::exports::fai::studio_plugin::translate::Guest for OllamaTranslatePlugin {
impl bindings::exports::chain::studio_plugin::translate::Guest for OllamaTranslatePlugin {
fn translate(
text: String,
from_locale: String,
@ -54,7 +54,7 @@ impl bindings::exports::fai::studio_plugin::translate::Guest for OllamaTranslate
// the others; the hub falls back to its built-in renderer or
// the [EN] badge.
impl bindings::exports::fai::studio_plugin::theme::Guest for OllamaTranslatePlugin {
impl bindings::exports::chain::studio_plugin::theme::Guest for OllamaTranslatePlugin {
fn theme_for(_brightness: String) -> Result<ColorScheme, PluginError> {
Err(PluginError::Declined(
"studio.translate.ollama is a translate plugin, not a theme plugin".to_string(),
@ -62,7 +62,7 @@ impl bindings::exports::fai::studio_plugin::theme::Guest for OllamaTranslatePlug
}
}
impl bindings::exports::fai::studio_plugin::output_view::Guest for OllamaTranslatePlugin {
impl bindings::exports::chain::studio_plugin::output_view::Guest for OllamaTranslatePlugin {
fn render(_mime_type: String, _data: Vec<u8>) -> Result<RenderedOutput, PluginError> {
Err(PluginError::Declined(
"studio.translate.ollama is a translate plugin, not an output viewer".to_string(),