From df4362a719f4f4708169e99f5b9055834d1316a0 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 15 Apr 2026 11:37:36 -0500 Subject: [PATCH] ignore: example tui plugin --- .opencode/plugins/tui-config-once-toast.tsx | 25 +++++++++++++++++++++ .opencode/tui.json | 1 + 2 files changed, 26 insertions(+) create mode 100644 .opencode/plugins/tui-config-once-toast.tsx diff --git a/.opencode/plugins/tui-config-once-toast.tsx b/.opencode/plugins/tui-config-once-toast.tsx new file mode 100644 index 0000000000..f5447b0b54 --- /dev/null +++ b/.opencode/plugins/tui-config-once-toast.tsx @@ -0,0 +1,25 @@ +import type { TuiPluginModule } from "@opencode-ai/plugin/tui" + +let seen = false + +const plugin: TuiPluginModule & { id: string } = { + id: "local.config-once-toast", + async tui(api) { + if (seen) return + + const cfg = api.state.config + if (cfg.plugin !== undefined && !Array.isArray(cfg.plugin)) { + throw new Error("Invalid config: plugin must be an array") + } + + const mdl = typeof cfg.model === "string" && cfg.model.trim() ? cfg.model : "default" + seen = true + api.ui.toast({ + title: "Config check", + message: `This is a 1 time toast, validating ur config (model: ${mdl})`, + variant: "info", + }) + }, +} + +export default plugin diff --git a/.opencode/tui.json b/.opencode/tui.json index 1eee01b302..cc8f9bc56e 100644 --- a/.opencode/tui.json +++ b/.opencode/tui.json @@ -1,6 +1,7 @@ { "$schema": "https://opencode.ai/tui.json", "plugin": [ + "./plugins/tui-config-once-toast.tsx", [ "./plugins/tui-smoke.tsx", {