Compare commits

...

1 Commits

Author SHA1 Message Date
Aiden Cline
df4362a719 ignore: example tui plugin 2026-04-15 11:37:36 -05:00
2 changed files with 26 additions and 0 deletions

View File

@@ -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

View File

@@ -1,6 +1,7 @@
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
"./plugins/tui-config-once-toast.tsx",
[
"./plugins/tui-smoke.tsx",
{