@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603251144 → 0.0.0-snapshot-tui-plugins-202603251937

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 +57 -39
  2. package/package.json +2 -2
package/dist/tui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { OpencodeClient, Event, LspStatus, McpStatus, Todo, Message, Provider, Config as SdkConfig } from "@opencode-ai/sdk/v2";
1
+ import type { OpencodeClient, Event, LspStatus, McpStatus, Todo, Message, Part, Provider, PermissionRequest, QuestionRequest, SessionStatus, Workspace, Config as SdkConfig } from "@opencode-ai/sdk/v2";
2
2
  import type { CliRenderer, ParsedKey, RGBA } from "@opentui/core";
3
3
  import type { JSX, SolidPlugin } from "@opentui/solid";
4
4
  import type { Config as PluginConfig, Plugin, PluginOptions } from "./index.js";
@@ -182,53 +182,39 @@ export type TuiState = {
182
182
  readonly ready: boolean;
183
183
  readonly config: SdkConfig;
184
184
  readonly provider: ReadonlyArray<Provider>;
185
+ readonly path: {
186
+ state: string;
187
+ config: string;
188
+ worktree: string;
189
+ directory: string;
190
+ };
191
+ readonly vcs: {
192
+ branch?: string;
193
+ } | undefined;
194
+ readonly workspace: {
195
+ list: () => ReadonlyArray<Workspace>;
196
+ get: (workspaceID: string) => Workspace | undefined;
197
+ };
185
198
  session: {
186
199
  count: () => number;
187
200
  diff: (sessionID: string) => ReadonlyArray<TuiSidebarFileItem>;
188
201
  todo: (sessionID: string) => ReadonlyArray<TuiSidebarTodoItem>;
189
202
  messages: (sessionID: string) => ReadonlyArray<Message>;
203
+ status: (sessionID: string) => SessionStatus | undefined;
204
+ permission: (sessionID: string) => ReadonlyArray<PermissionRequest>;
205
+ question: (sessionID: string) => ReadonlyArray<QuestionRequest>;
190
206
  };
207
+ part: (messageID: string) => ReadonlyArray<Part>;
191
208
  lsp: () => ReadonlyArray<TuiSidebarLspItem>;
192
209
  mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
193
210
  };
194
211
  type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "keybinds" | "plugin"> & NonNullable<PluginConfig["tui"]>;
195
212
  export type TuiApp = {
196
213
  readonly version: string;
197
- readonly directory: string;
198
214
  };
199
215
  type Frozen<Value> = Value extends (...args: never[]) => unknown ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Frozen<Item>> : Value extends object ? {
200
216
  readonly [Key in keyof Value]: Frozen<Value[Key]>;
201
217
  } : Value;
202
- export type TuiApi = {
203
- app: TuiApp;
204
- command: {
205
- register: (cb: () => TuiCommand[]) => () => void;
206
- trigger: (value: string) => void;
207
- };
208
- route: {
209
- register: (routes: TuiRouteDefinition[]) => () => void;
210
- navigate: (name: string, params?: Record<string, unknown>) => void;
211
- readonly current: TuiRouteCurrent;
212
- };
213
- ui: {
214
- Dialog: (props: TuiDialogProps) => JSX.Element;
215
- DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
216
- DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
217
- DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
218
- DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
219
- toast: (input: TuiToast) => void;
220
- dialog: TuiDialogStack;
221
- };
222
- keybind: {
223
- match: (key: string, evt: ParsedKey) => boolean;
224
- print: (key: string) => string;
225
- create: (defaults: TuiKeybindMap, overrides?: Record<string, unknown>) => TuiKeybindSet;
226
- };
227
- readonly tuiConfig: Frozen<TuiConfigView>;
228
- kv: TuiKV;
229
- state: TuiState;
230
- theme: TuiTheme;
231
- };
232
218
  export type TuiSidebarMcpItem = {
233
219
  name: string;
234
220
  status: McpStatus["status"];
@@ -295,17 +281,49 @@ export type TuiPluginEntry = {
295
281
  export type TuiPluginMeta = TuiPluginEntry & {
296
282
  state: TuiPluginState;
297
283
  };
298
- export type TuiHostPluginApi<Renderer = CliRenderer> = TuiApi & {
284
+ export type TuiWorkspace = {
285
+ current: () => string | undefined;
286
+ set: (workspaceID?: string) => void;
287
+ };
288
+ export type TuiPluginApi = {
289
+ app: TuiApp;
290
+ command: {
291
+ register: (cb: () => TuiCommand[]) => () => void;
292
+ trigger: (value: string) => void;
293
+ };
294
+ route: {
295
+ register: (routes: TuiRouteDefinition[]) => () => void;
296
+ navigate: (name: string, params?: Record<string, unknown>) => void;
297
+ readonly current: TuiRouteCurrent;
298
+ };
299
+ ui: {
300
+ Dialog: (props: TuiDialogProps) => JSX.Element;
301
+ DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
302
+ DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
303
+ DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
304
+ DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
305
+ toast: (input: TuiToast) => void;
306
+ dialog: TuiDialogStack;
307
+ };
308
+ keybind: {
309
+ match: (key: string, evt: ParsedKey) => boolean;
310
+ print: (key: string) => string;
311
+ create: (defaults: TuiKeybindMap, overrides?: Record<string, unknown>) => TuiKeybindSet;
312
+ };
313
+ readonly tuiConfig: Frozen<TuiConfigView>;
314
+ kv: TuiKV;
315
+ state: TuiState;
316
+ theme: TuiTheme;
299
317
  client: OpencodeClient;
318
+ scopedClient: (workspaceID?: string) => OpencodeClient;
319
+ workspace: TuiWorkspace;
300
320
  event: TuiEventBus;
301
- renderer: Renderer;
302
- };
303
- export type TuiPluginApi<Renderer = CliRenderer> = TuiHostPluginApi<Renderer> & {
321
+ renderer: CliRenderer;
304
322
  slots: TuiSlots;
305
323
  lifecycle: TuiLifecycle;
306
324
  };
307
- export type TuiPlugin<Renderer = CliRenderer> = (api: TuiPluginApi<Renderer>, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
308
- export type TuiPluginModule<Renderer = CliRenderer> = {
325
+ export type TuiPlugin = (api: TuiPluginApi, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
326
+ export type TuiPluginModule = {
309
327
  server?: Plugin;
310
- tui?: TuiPlugin<Renderer>;
328
+ tui?: TuiPlugin;
311
329
  };
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-202603251144",
4
+ "version": "0.0.0-snapshot-tui-plugins-202603251937",
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-202603251144",
29
+ "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603251937",
30
30
  "zod": "4.1.8"
31
31
  },
32
32
  "peerDependencies": {