diff --git a/packages/plugin/src/tui.ts b/packages/plugin/src/tui.ts index abefd0fadb..ca67983e34 100644 --- a/packages/plugin/src/tui.ts +++ b/packages/plugin/src/tui.ts @@ -1,8 +1,8 @@ import type { createOpencodeClient as createOpencodeClientV2, Event as TuiEvent } from "@opencode-ai/sdk/v2" -import type { CliRenderer } from "@opentui/core" -import type { Plugin, PluginOptions } from "./index" +import type { CliRenderer, Plugin as CorePlugin } from "@opentui/core" +import type { Plugin as ServerPlugin, PluginOptions } from "./index" -export type { CliRenderer } from "@opentui/core" +export type { CliRenderer, SlotMode } from "@opentui/core" type HexColor = `#${string}` type RefName = string @@ -22,20 +22,6 @@ export type ThemeJson = { } } -export type SlotMode = "append" | "replace" | "single_winner" - -type SlotRenderer = (ctx: Readonly, props: Props) => Node - -type SlotPlugin = { - id: string - order?: number - setup?: (ctx: Readonly, renderer: CliRenderer) => void - dispose?: () => void - slots: { - [K in keyof Slots]?: SlotRenderer - } -} - export type TuiSlotMap = { home_hint: {} home_footer: {} @@ -46,7 +32,7 @@ export type TuiSlotMap = { export type TuiSlotContext = {} -export type TuiSlotPlugin = SlotPlugin +export type TuiSlotPlugin = CorePlugin export type TuiSlots = { register: (plugin: TuiSlotPlugin) => () => void @@ -74,7 +60,7 @@ export type TuiPlugin = ( export type TuiPluginModule = | TuiPlugin | { - server?: Plugin + server?: ServerPlugin tui?: TuiPlugin slots?: TuiSlotPlugin themes?: Record