@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603182124 → 0.0.0-snapshot-tui-plugins-202603191129
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.
- package/dist/index.d.ts +13 -0
- package/dist/tui.d.ts +79 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,11 @@ export type Config = Omit<SDKConfig, "plugin"> & {
|
|
|
20
20
|
plugin?: Array<string | [string, PluginOptions]>;
|
|
21
21
|
};
|
|
22
22
|
export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise<Hooks>;
|
|
23
|
+
type Rule = {
|
|
24
|
+
key: string;
|
|
25
|
+
op: "eq" | "neq";
|
|
26
|
+
value: string;
|
|
27
|
+
};
|
|
23
28
|
export type AuthHook = {
|
|
24
29
|
provider: string;
|
|
25
30
|
loader?: (auth: () => Promise<Auth>, provider: Provider) => Promise<Record<string, any>>;
|
|
@@ -32,7 +37,9 @@ export type AuthHook = {
|
|
|
32
37
|
message: string;
|
|
33
38
|
placeholder?: string;
|
|
34
39
|
validate?: (value: string) => string | undefined;
|
|
40
|
+
/** @deprecated Use `when` instead */
|
|
35
41
|
condition?: (inputs: Record<string, string>) => boolean;
|
|
42
|
+
when?: Rule;
|
|
36
43
|
} | {
|
|
37
44
|
type: "select";
|
|
38
45
|
key: string;
|
|
@@ -42,7 +49,9 @@ export type AuthHook = {
|
|
|
42
49
|
value: string;
|
|
43
50
|
hint?: string;
|
|
44
51
|
}>;
|
|
52
|
+
/** @deprecated Use `when` instead */
|
|
45
53
|
condition?: (inputs: Record<string, string>) => boolean;
|
|
54
|
+
when?: Rule;
|
|
46
55
|
}>;
|
|
47
56
|
authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>;
|
|
48
57
|
} | {
|
|
@@ -54,7 +63,9 @@ export type AuthHook = {
|
|
|
54
63
|
message: string;
|
|
55
64
|
placeholder?: string;
|
|
56
65
|
validate?: (value: string) => string | undefined;
|
|
66
|
+
/** @deprecated Use `when` instead */
|
|
57
67
|
condition?: (inputs: Record<string, string>) => boolean;
|
|
68
|
+
when?: Rule;
|
|
58
69
|
} | {
|
|
59
70
|
type: "select";
|
|
60
71
|
key: string;
|
|
@@ -64,7 +75,9 @@ export type AuthHook = {
|
|
|
64
75
|
value: string;
|
|
65
76
|
hint?: string;
|
|
66
77
|
}>;
|
|
78
|
+
/** @deprecated Use `when` instead */
|
|
67
79
|
condition?: (inputs: Record<string, string>) => boolean;
|
|
80
|
+
when?: Rule;
|
|
68
81
|
}>;
|
|
69
82
|
authorize?(inputs?: Record<string, string>): Promise<{
|
|
70
83
|
type: "success";
|
package/dist/tui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { createOpencodeClient as createOpencodeClientV2, Event as TuiEvent } from "@opencode-ai/sdk/v2";
|
|
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
3
|
import type { Plugin as ServerPlugin, PluginOptions } from "./index.js";
|
|
4
4
|
export type { CliRenderer, SlotMode } from "@opentui/core";
|
|
@@ -145,12 +145,90 @@ export type TuiApi<Node = unknown> = {
|
|
|
145
145
|
};
|
|
146
146
|
theme: TuiTheme;
|
|
147
147
|
};
|
|
148
|
+
export type TuiSidebarMcpItem = {
|
|
149
|
+
name: string;
|
|
150
|
+
status: McpStatus["status"];
|
|
151
|
+
error?: string;
|
|
152
|
+
};
|
|
153
|
+
export type TuiSidebarLspItem = Pick<LspStatus, "id" | "root" | "status">;
|
|
154
|
+
export type TuiSidebarTodoItem = Pick<Todo, "content" | "status">;
|
|
155
|
+
export type TuiSidebarFileItem = {
|
|
156
|
+
file: string;
|
|
157
|
+
additions: number;
|
|
158
|
+
deletions: number;
|
|
159
|
+
};
|
|
148
160
|
export type TuiSlotMap = {
|
|
149
161
|
app: {};
|
|
150
162
|
home_logo: {};
|
|
163
|
+
home_tips: {
|
|
164
|
+
show_tips: boolean;
|
|
165
|
+
tips_hidden: boolean;
|
|
166
|
+
first_time_user: boolean;
|
|
167
|
+
};
|
|
168
|
+
home_below_tips: {
|
|
169
|
+
show_tips: boolean;
|
|
170
|
+
tips_hidden: boolean;
|
|
171
|
+
first_time_user: boolean;
|
|
172
|
+
};
|
|
151
173
|
sidebar_top: {
|
|
152
174
|
session_id: string;
|
|
153
175
|
};
|
|
176
|
+
sidebar_title: {
|
|
177
|
+
session_id: string;
|
|
178
|
+
title: string;
|
|
179
|
+
share_url?: string;
|
|
180
|
+
};
|
|
181
|
+
sidebar_context: {
|
|
182
|
+
session_id: string;
|
|
183
|
+
tokens: number;
|
|
184
|
+
percentage: number | null;
|
|
185
|
+
cost: number;
|
|
186
|
+
};
|
|
187
|
+
sidebar_mcp: {
|
|
188
|
+
session_id: string;
|
|
189
|
+
items: TuiSidebarMcpItem[];
|
|
190
|
+
connected: number;
|
|
191
|
+
errors: number;
|
|
192
|
+
};
|
|
193
|
+
sidebar_lsp: {
|
|
194
|
+
session_id: string;
|
|
195
|
+
items: TuiSidebarLspItem[];
|
|
196
|
+
disabled: boolean;
|
|
197
|
+
};
|
|
198
|
+
sidebar_todo: {
|
|
199
|
+
session_id: string;
|
|
200
|
+
items: TuiSidebarTodoItem[];
|
|
201
|
+
};
|
|
202
|
+
sidebar_files: {
|
|
203
|
+
session_id: string;
|
|
204
|
+
items: TuiSidebarFileItem[];
|
|
205
|
+
};
|
|
206
|
+
sidebar_getting_started: {
|
|
207
|
+
session_id: string;
|
|
208
|
+
show_getting_started: boolean;
|
|
209
|
+
has_providers: boolean;
|
|
210
|
+
dismissed: boolean;
|
|
211
|
+
};
|
|
212
|
+
sidebar_directory: {
|
|
213
|
+
session_id: string;
|
|
214
|
+
directory: string;
|
|
215
|
+
directory_parent: string;
|
|
216
|
+
directory_name: string;
|
|
217
|
+
};
|
|
218
|
+
sidebar_version: {
|
|
219
|
+
session_id: string;
|
|
220
|
+
version: string;
|
|
221
|
+
};
|
|
222
|
+
sidebar_bottom: {
|
|
223
|
+
session_id: string;
|
|
224
|
+
directory: string;
|
|
225
|
+
directory_parent: string;
|
|
226
|
+
directory_name: string;
|
|
227
|
+
version: string;
|
|
228
|
+
show_getting_started: boolean;
|
|
229
|
+
has_providers: boolean;
|
|
230
|
+
dismissed: boolean;
|
|
231
|
+
};
|
|
154
232
|
};
|
|
155
233
|
export type TuiSlotContext = {
|
|
156
234
|
theme: TuiTheme;
|
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-
|
|
4
|
+
"version": "0.0.0-snapshot-tui-plugins-202603191129",
|
|
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-
|
|
29
|
+
"@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603191129",
|
|
30
30
|
"zod": "4.1.8"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@opentui/core": "0.0.0-20260318-
|
|
41
|
+
"@opentui/core": "0.0.0-20260318-39211c40",
|
|
42
42
|
"@tsconfig/node22": "22.0.2",
|
|
43
43
|
"@types/node": "22.13.9",
|
|
44
44
|
"typescript": "5.8.2",
|