@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603251343 → 0.0.0-snapshot-tui-plugins-202603252148

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 +51 -38
  2. package/package.json +2 -2
package/dist/tui.d.ts CHANGED
@@ -208,43 +208,15 @@ export type TuiState = {
208
208
  lsp: () => ReadonlyArray<TuiSidebarLspItem>;
209
209
  mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
210
210
  };
211
- type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "keybinds" | "plugin"> & NonNullable<PluginConfig["tui"]>;
211
+ type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "keybinds" | "plugin"> & NonNullable<PluginConfig["tui"]> & {
212
+ plugin_enabled?: Record<string, boolean>;
213
+ };
212
214
  export type TuiApp = {
213
215
  readonly version: string;
214
216
  };
215
217
  type Frozen<Value> = Value extends (...args: never[]) => unknown ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Frozen<Item>> : Value extends object ? {
216
218
  readonly [Key in keyof Value]: Frozen<Value[Key]>;
217
219
  } : Value;
218
- export type TuiApi = {
219
- app: TuiApp;
220
- command: {
221
- register: (cb: () => TuiCommand[]) => () => void;
222
- trigger: (value: string) => void;
223
- };
224
- route: {
225
- register: (routes: TuiRouteDefinition[]) => () => void;
226
- navigate: (name: string, params?: Record<string, unknown>) => void;
227
- readonly current: TuiRouteCurrent;
228
- };
229
- ui: {
230
- Dialog: (props: TuiDialogProps) => JSX.Element;
231
- DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
232
- DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
233
- DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
234
- DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
235
- toast: (input: TuiToast) => void;
236
- dialog: TuiDialogStack;
237
- };
238
- keybind: {
239
- match: (key: string, evt: ParsedKey) => boolean;
240
- print: (key: string) => string;
241
- create: (defaults: TuiKeybindMap, overrides?: Record<string, unknown>) => TuiKeybindSet;
242
- };
243
- readonly tuiConfig: Frozen<TuiConfigView>;
244
- kv: TuiKV;
245
- state: TuiState;
246
- theme: TuiTheme;
247
- };
248
220
  export type TuiSidebarMcpItem = {
249
221
  name: string;
250
222
  status: McpStatus["status"];
@@ -311,23 +283,64 @@ export type TuiPluginEntry = {
311
283
  export type TuiPluginMeta = TuiPluginEntry & {
312
284
  state: TuiPluginState;
313
285
  };
286
+ export type TuiPluginStatus = {
287
+ id: string;
288
+ name: string;
289
+ source: TuiPluginEntry["source"];
290
+ spec: string;
291
+ target: string;
292
+ enabled: boolean;
293
+ active: boolean;
294
+ };
314
295
  export type TuiWorkspace = {
315
296
  current: () => string | undefined;
316
297
  set: (workspaceID?: string) => void;
317
298
  };
318
- export type TuiHostPluginApi<Renderer = CliRenderer> = TuiApi & {
299
+ export type TuiPluginApi = {
300
+ app: TuiApp;
301
+ command: {
302
+ register: (cb: () => TuiCommand[]) => () => void;
303
+ trigger: (value: string) => void;
304
+ };
305
+ route: {
306
+ register: (routes: TuiRouteDefinition[]) => () => void;
307
+ navigate: (name: string, params?: Record<string, unknown>) => void;
308
+ readonly current: TuiRouteCurrent;
309
+ };
310
+ ui: {
311
+ Dialog: (props: TuiDialogProps) => JSX.Element;
312
+ DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
313
+ DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
314
+ DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
315
+ DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
316
+ toast: (input: TuiToast) => void;
317
+ dialog: TuiDialogStack;
318
+ };
319
+ keybind: {
320
+ match: (key: string, evt: ParsedKey) => boolean;
321
+ print: (key: string) => string;
322
+ create: (defaults: TuiKeybindMap, overrides?: Record<string, unknown>) => TuiKeybindSet;
323
+ };
324
+ readonly tuiConfig: Frozen<TuiConfigView>;
325
+ kv: TuiKV;
326
+ state: TuiState;
327
+ theme: TuiTheme;
319
328
  client: OpencodeClient;
320
329
  scopedClient: (workspaceID?: string) => OpencodeClient;
321
330
  workspace: TuiWorkspace;
322
331
  event: TuiEventBus;
323
- renderer: Renderer;
324
- };
325
- export type TuiPluginApi<Renderer = CliRenderer> = TuiHostPluginApi<Renderer> & {
332
+ renderer: CliRenderer;
326
333
  slots: TuiSlots;
334
+ plugins: {
335
+ list: () => ReadonlyArray<TuiPluginStatus>;
336
+ activate: (id: string) => Promise<boolean>;
337
+ deactivate: (id: string) => Promise<boolean>;
338
+ };
327
339
  lifecycle: TuiLifecycle;
328
340
  };
329
- export type TuiPlugin<Renderer = CliRenderer> = (api: TuiPluginApi<Renderer>, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
330
- export type TuiPluginModule<Renderer = CliRenderer> = {
341
+ export type TuiPlugin = (api: TuiPluginApi, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
342
+ export type TuiPluginModule = {
343
+ id?: string;
331
344
  server?: Plugin;
332
- tui?: TuiPlugin<Renderer>;
345
+ tui?: TuiPlugin;
333
346
  };
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-202603251343",
4
+ "version": "0.0.0-snapshot-tui-plugins-202603252148",
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-202603251343",
29
+ "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603252148",
30
30
  "zod": "4.1.8"
31
31
  },
32
32
  "peerDependencies": {