@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603232228 → 0.0.0-snapshot-tui-plugins-202603242045

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tui.d.ts +17 -10
  2. package/package.json +2 -2
package/dist/tui.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import type { createOpencodeClient as createOpencodeClientV2, Event as TuiEvent, LspStatus, McpStatus, Todo } from "@opencode-ai/sdk/v2";
2
- import type { CliRenderer, ParsedKey, Plugin as CorePlugin } from "@opentui/core";
3
- import type { JSX } from "@opentui/solid";
4
- import type { Plugin as ServerPlugin, PluginOptions } from "./index.js";
1
+ import type { OpencodeClient, Event, LspStatus, McpStatus, Todo } from "@opencode-ai/sdk/v2";
2
+ import type { CliRenderer, ParsedKey } from "@opentui/core";
3
+ import type { JSX, SolidPlugin } from "@opentui/solid";
4
+ import type { Config, Plugin, PluginOptions } from "./index.js";
5
5
  export type { CliRenderer, SlotMode } from "@opentui/core";
6
6
  export type TuiRouteCurrent = {
7
7
  name: "home";
@@ -131,6 +131,10 @@ export type TuiState = {
131
131
  lsp: () => ReadonlyArray<TuiSidebarLspItem>;
132
132
  mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
133
133
  };
134
+ type TuiConfigView = Pick<Config, "$schema" | "theme" | "keybinds" | "plugin"> & NonNullable<Config["tui"]>;
135
+ type Frozen<Value> = Value extends (...args: never[]) => unknown ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Frozen<Item>> : Value extends object ? {
136
+ readonly [Key in keyof Value]: Frozen<Value[Key]>;
137
+ } : Value;
134
138
  export type TuiApi = {
135
139
  command: {
136
140
  register: (cb: () => TuiCommand[]) => () => void;
@@ -155,6 +159,7 @@ export type TuiApi = {
155
159
  print: (key: string) => string;
156
160
  create: (defaults: TuiKeybindMap, overrides?: Record<string, unknown>) => TuiKeybindSet;
157
161
  };
162
+ readonly tuiConfig: Frozen<TuiConfigView>;
158
163
  kv: TuiKV;
159
164
  state: TuiState;
160
165
  theme: TuiTheme;
@@ -247,12 +252,15 @@ export type TuiSlotMap = {
247
252
  export type TuiSlotContext = {
248
253
  theme: TuiTheme;
249
254
  };
250
- export type TuiSlotPlugin = CorePlugin<JSX.Element, TuiSlotMap, TuiSlotContext>;
255
+ type SlotCore = SolidPlugin<TuiSlotMap, TuiSlotContext>;
256
+ export type TuiSlotPlugin = Omit<SlotCore, "id"> & {
257
+ id?: never;
258
+ };
251
259
  export type TuiSlots = {
252
- register: (plugin: TuiSlotPlugin) => () => void;
260
+ register: (plugin: TuiSlotPlugin) => string;
253
261
  };
254
262
  export type TuiEventBus = {
255
- on: <Type extends TuiEvent["type"]>(type: Type, handler: (event: Extract<TuiEvent, {
263
+ on: <Type extends Event["type"]>(type: Type, handler: (event: Extract<Event, {
256
264
  type: Type;
257
265
  }>) => void) => () => void;
258
266
  };
@@ -280,7 +288,7 @@ export type TuiPluginMeta = TuiPluginEntry & {
280
288
  state: TuiPluginState;
281
289
  };
282
290
  export type TuiHostPluginApi<Renderer = CliRenderer> = TuiApi & {
283
- client: ReturnType<typeof createOpencodeClientV2>;
291
+ client: OpencodeClient;
284
292
  event: TuiEventBus;
285
293
  renderer: Renderer;
286
294
  };
@@ -290,7 +298,6 @@ export type TuiPluginApi<Renderer = CliRenderer> = TuiHostPluginApi<Renderer> &
290
298
  };
291
299
  export type TuiPlugin<Renderer = CliRenderer> = (api: TuiPluginApi<Renderer>, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
292
300
  export type TuiPluginModule<Renderer = CliRenderer> = {
293
- server?: ServerPlugin;
301
+ server?: Plugin;
294
302
  tui?: TuiPlugin<Renderer>;
295
- slots?: TuiSlotPlugin;
296
303
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/plugin",
4
- "version": "0.0.0-snapshot-tui-plugins-202603232228",
4
+ "version": "0.0.0-snapshot-tui-plugins-202603242045",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603232228",
29
+ "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603242045",
30
30
  "zod": "4.1.8"
31
31
  },
32
32
  "peerDependencies": {