@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603231420 → 0.0.0-snapshot-tui-plugins-202603231918

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 +29 -28
  2. package/package.json +8 -3
package/dist/tui.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { createOpencodeClient as createOpencodeClientV2, Event as TuiEvent, LspStatus, McpStatus, Todo } from "@opencode-ai/sdk/v2";
2
2
  import type { CliRenderer, ParsedKey, Plugin as CorePlugin } from "@opentui/core";
3
+ import type { JSX } from "@opentui/solid";
3
4
  import type { Plugin as ServerPlugin, PluginOptions } from "./index.js";
4
5
  export type { CliRenderer, SlotMode } from "@opentui/core";
5
6
  export type TuiRouteCurrent = {
@@ -14,11 +15,11 @@ export type TuiRouteCurrent = {
14
15
  name: string;
15
16
  params?: Record<string, unknown>;
16
17
  };
17
- export type TuiRouteDefinition<Node = unknown> = {
18
+ export type TuiRouteDefinition = {
18
19
  name: string;
19
20
  render: (input: {
20
21
  params?: Record<string, unknown>;
21
- }) => Node;
22
+ }) => JSX.Element;
22
23
  };
23
24
  export type TuiCommand = {
24
25
  title: string;
@@ -50,13 +51,13 @@ export type TuiKeybindSet = {
50
51
  match: (name: string, evt: ParsedKey) => boolean;
51
52
  print: (name: string) => string;
52
53
  };
53
- export type TuiDialogProps<Node = unknown> = {
54
+ export type TuiDialogProps = {
54
55
  size?: "medium" | "large";
55
56
  onClose: () => void;
56
- children?: Node;
57
+ children?: JSX.Element;
57
58
  };
58
- export type TuiDialogStack<Node = unknown> = {
59
- replace: (render: () => Node, onClose?: () => void) => void;
59
+ export type TuiDialogStack = {
60
+ replace: (render: () => JSX.Element, onClose?: () => void) => void;
60
61
  clear: () => void;
61
62
  setSize: (size: "medium" | "large") => void;
62
63
  readonly size: "medium" | "large";
@@ -74,31 +75,31 @@ export type TuiDialogConfirmProps = {
74
75
  onConfirm?: () => void;
75
76
  onCancel?: () => void;
76
77
  };
77
- export type TuiDialogPromptProps<Node = unknown> = {
78
+ export type TuiDialogPromptProps = {
78
79
  title: string;
79
- description?: () => Node;
80
+ description?: () => JSX.Element;
80
81
  placeholder?: string;
81
82
  value?: string;
82
83
  onConfirm?: (value: string) => void;
83
84
  onCancel?: () => void;
84
85
  };
85
- export type TuiDialogSelectOption<Value = unknown, Node = unknown> = {
86
+ export type TuiDialogSelectOption<Value = unknown> = {
86
87
  title: string;
87
88
  value: Value;
88
89
  description?: string;
89
- footer?: Node | string;
90
+ footer?: JSX.Element | string;
90
91
  category?: string;
91
92
  disabled?: boolean;
92
93
  onSelect?: () => void;
93
94
  };
94
- export type TuiDialogSelectProps<Value = unknown, Node = unknown> = {
95
+ export type TuiDialogSelectProps<Value = unknown> = {
95
96
  title: string;
96
97
  placeholder?: string;
97
- options: TuiDialogSelectOption<Value, Node>[];
98
+ options: TuiDialogSelectOption<Value>[];
98
99
  flat?: boolean;
99
- onMove?: (option: TuiDialogSelectOption<Value, Node>) => void;
100
+ onMove?: (option: TuiDialogSelectOption<Value>) => void;
100
101
  onFilter?: (query: string) => void;
101
- onSelect?: (option: TuiDialogSelectOption<Value, Node>) => void;
102
+ onSelect?: (option: TuiDialogSelectOption<Value>) => void;
102
103
  skipFilter?: boolean;
103
104
  current?: Value;
104
105
  };
@@ -130,24 +131,24 @@ export type TuiState = {
130
131
  lsp: () => ReadonlyArray<TuiSidebarLspItem>;
131
132
  mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
132
133
  };
133
- export type TuiApi<Node = unknown> = {
134
+ export type TuiApi = {
134
135
  command: {
135
136
  register: (cb: () => TuiCommand[]) => () => void;
136
137
  trigger: (value: string) => void;
137
138
  };
138
139
  route: {
139
- register: (routes: TuiRouteDefinition<Node>[]) => () => void;
140
+ register: (routes: TuiRouteDefinition[]) => () => void;
140
141
  navigate: (name: string, params?: Record<string, unknown>) => void;
141
142
  readonly current: TuiRouteCurrent;
142
143
  };
143
144
  ui: {
144
- Dialog: (props: TuiDialogProps<Node>) => Node;
145
- DialogAlert: (props: TuiDialogAlertProps) => Node;
146
- DialogConfirm: (props: TuiDialogConfirmProps) => Node;
147
- DialogPrompt: (props: TuiDialogPromptProps<Node>) => Node;
148
- DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value, Node>) => Node;
145
+ Dialog: (props: TuiDialogProps) => JSX.Element;
146
+ DialogAlert: (props: TuiDialogAlertProps) => JSX.Element;
147
+ DialogConfirm: (props: TuiDialogConfirmProps) => JSX.Element;
148
+ DialogPrompt: (props: TuiDialogPromptProps) => JSX.Element;
149
+ DialogSelect: <Value = unknown>(props: TuiDialogSelectProps<Value>) => JSX.Element;
149
150
  toast: (input: TuiToast) => void;
150
- dialog: TuiDialogStack<Node>;
151
+ dialog: TuiDialogStack;
151
152
  };
152
153
  keybind: {
153
154
  match: (key: string, evt: ParsedKey) => boolean;
@@ -246,7 +247,7 @@ export type TuiSlotMap = {
246
247
  export type TuiSlotContext = {
247
248
  theme: TuiTheme;
248
249
  };
249
- export type TuiSlotPlugin<Node = unknown> = CorePlugin<Node, TuiSlotMap, TuiSlotContext>;
250
+ export type TuiSlotPlugin = CorePlugin<JSX.Element, TuiSlotMap, TuiSlotContext>;
250
251
  export type TuiSlots = {
251
252
  register: (plugin: TuiSlotPlugin) => () => void;
252
253
  };
@@ -278,18 +279,18 @@ export type TuiPluginEntry = {
278
279
  export type TuiPluginMeta = TuiPluginEntry & {
279
280
  state: TuiPluginState;
280
281
  };
281
- export type TuiHostPluginApi<Renderer = CliRenderer, Node = unknown> = TuiApi<Node> & {
282
+ export type TuiHostPluginApi<Renderer = CliRenderer> = TuiApi & {
282
283
  client: ReturnType<typeof createOpencodeClientV2>;
283
284
  event: TuiEventBus;
284
285
  renderer: Renderer;
285
286
  };
286
- export type TuiPluginApi<Renderer = CliRenderer, Node = unknown> = TuiHostPluginApi<Renderer, Node> & {
287
+ export type TuiPluginApi<Renderer = CliRenderer> = TuiHostPluginApi<Renderer> & {
287
288
  slots: TuiSlots;
288
289
  lifecycle: TuiLifecycle;
289
290
  };
290
- export type TuiPlugin<Renderer = CliRenderer, Node = unknown> = (api: TuiPluginApi<Renderer, Node>, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
291
- export type TuiPluginModule<Renderer = CliRenderer, Node = unknown> = {
291
+ export type TuiPlugin<Renderer = CliRenderer> = (api: TuiPluginApi<Renderer>, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
292
+ export type TuiPluginModule<Renderer = CliRenderer> = {
292
293
  server?: ServerPlugin;
293
- tui?: TuiPlugin<Renderer, Node>;
294
+ tui?: TuiPlugin<Renderer>;
294
295
  slots?: TuiSlotPlugin;
295
296
  };
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-202603231420",
4
+ "version": "0.0.0-snapshot-tui-plugins-202603231918",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -26,19 +26,24 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603231420",
29
+ "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603231918",
30
30
  "zod": "4.1.8"
31
31
  },
32
32
  "peerDependencies": {
33
- "@opentui/core": ">=0.1.90"
33
+ "@opentui/core": ">=0.1.90",
34
+ "@opentui/solid": ">=0.1.90"
34
35
  },
35
36
  "peerDependenciesMeta": {
36
37
  "@opentui/core": {
37
38
  "optional": true
39
+ },
40
+ "@opentui/solid": {
41
+ "optional": true
38
42
  }
39
43
  },
40
44
  "devDependencies": {
41
45
  "@opentui/core": "0.1.90",
46
+ "@opentui/solid": "0.1.90",
42
47
  "@tsconfig/node22": "22.0.2",
43
48
  "@types/node": "22.13.9",
44
49
  "typescript": "5.8.2",