@opencode-ai/plugin 0.0.0-snapshot-tui-plugins-202603252244 → 0.0.0-snapshot-memory-202603261432

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 CHANGED
@@ -1,4 +1,4 @@
1
- import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Auth, Config as SDKConfig } from "@opencode-ai/sdk";
1
+ import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Auth, Config } from "@opencode-ai/sdk";
2
2
  import type { BunShell } from "./shell.js";
3
3
  import { type ToolDefinition } from "./tool.js";
4
4
  export * from "./tool.js";
@@ -15,11 +15,7 @@ export type PluginInput = {
15
15
  serverUrl: URL;
16
16
  $: BunShell;
17
17
  };
18
- export type PluginOptions = Record<string, unknown>;
19
- export type Config = Omit<SDKConfig, "plugin"> & {
20
- plugin?: Array<string | [string, PluginOptions]>;
21
- };
22
- export type Plugin = (input: PluginInput, options?: PluginOptions) => Promise<Hooks>;
18
+ export type Plugin = (input: PluginInput) => Promise<Hooks>;
23
19
  type Rule = {
24
20
  key: string;
25
21
  op: "eq" | "neq";
@@ -53,7 +49,7 @@ export type AuthHook = {
53
49
  condition?: (inputs: Record<string, string>) => boolean;
54
50
  when?: Rule;
55
51
  }>;
56
- authorize(inputs?: Record<string, string>): Promise<AuthOAuthResult>;
52
+ authorize(inputs?: Record<string, string>): Promise<AuthOuathResult>;
57
53
  } | {
58
54
  type: "api";
59
55
  label: string;
@@ -88,7 +84,7 @@ export type AuthHook = {
88
84
  }>;
89
85
  })[];
90
86
  };
91
- export type AuthOAuthResult = {
87
+ export type AuthOuathResult = {
92
88
  url: string;
93
89
  instructions: string;
94
90
  } & ({
@@ -101,6 +97,7 @@ export type AuthOAuthResult = {
101
97
  access: string;
102
98
  expires: number;
103
99
  accountId?: string;
100
+ enterpriseUrl?: string;
104
101
  } | {
105
102
  key: string;
106
103
  })) | {
@@ -116,14 +113,13 @@ export type AuthOAuthResult = {
116
113
  access: string;
117
114
  expires: number;
118
115
  accountId?: string;
116
+ enterpriseUrl?: string;
119
117
  } | {
120
118
  key: string;
121
119
  })) | {
122
120
  type: "failed";
123
121
  }>;
124
122
  });
125
- /** @deprecated Use AuthOAuthResult instead. */
126
- export type AuthOuathResult = AuthOAuthResult;
127
123
  export interface Hooks {
128
124
  event?: (input: {
129
125
  event: Event;
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-202603252244",
4
+ "version": "0.0.0-snapshot-memory-202603261432",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -16,34 +16,16 @@
16
16
  "./tool": {
17
17
  "import": "./dist/tool.js",
18
18
  "types": "./dist/tool.d.ts"
19
- },
20
- "./tui": {
21
- "import": "./dist/tui.js",
22
- "types": "./dist/tui.d.ts"
23
19
  }
24
20
  },
25
21
  "files": [
26
22
  "dist"
27
23
  ],
28
24
  "dependencies": {
29
- "@opencode-ai/sdk": "0.0.0-snapshot-tui-plugins-202603252244",
25
+ "@opencode-ai/sdk": "0.0.0-snapshot-memory-202603261432",
30
26
  "zod": "4.1.8"
31
27
  },
32
- "peerDependencies": {
33
- "@opentui/core": ">=0.1.90",
34
- "@opentui/solid": ">=0.1.90"
35
- },
36
- "peerDependenciesMeta": {
37
- "@opentui/core": {
38
- "optional": true
39
- },
40
- "@opentui/solid": {
41
- "optional": true
42
- }
43
- },
44
28
  "devDependencies": {
45
- "@opentui/core": "0.1.90",
46
- "@opentui/solid": "0.1.90",
47
29
  "@tsconfig/node22": "22.0.2",
48
30
  "@types/node": "22.13.9",
49
31
  "typescript": "5.8.2",
package/dist/tui.d.ts DELETED
@@ -1,346 +0,0 @@
1
- import type { OpencodeClient, Event, LspStatus, McpStatus, Todo, Message, Part, Provider, PermissionRequest, QuestionRequest, SessionStatus, Workspace, Config as SdkConfig } from "@opencode-ai/sdk/v2";
2
- import type { CliRenderer, ParsedKey, RGBA } from "@opentui/core";
3
- import type { JSX, SolidPlugin } from "@opentui/solid";
4
- import type { Config as PluginConfig, Plugin, PluginOptions } from "./index.js";
5
- export type { CliRenderer, SlotMode } from "@opentui/core";
6
- export type TuiRouteCurrent = {
7
- name: "home";
8
- } | {
9
- name: "session";
10
- params: {
11
- sessionID: string;
12
- initialPrompt?: unknown;
13
- };
14
- } | {
15
- name: string;
16
- params?: Record<string, unknown>;
17
- };
18
- export type TuiRouteDefinition = {
19
- name: string;
20
- render: (input: {
21
- params?: Record<string, unknown>;
22
- }) => JSX.Element;
23
- };
24
- export type TuiCommand = {
25
- title: string;
26
- value: string;
27
- description?: string;
28
- category?: string;
29
- keybind?: string;
30
- suggested?: boolean;
31
- hidden?: boolean;
32
- enabled?: boolean;
33
- slash?: {
34
- name: string;
35
- aliases?: string[];
36
- };
37
- onSelect?: () => void;
38
- };
39
- export type TuiKeybind = {
40
- name: string;
41
- ctrl: boolean;
42
- meta: boolean;
43
- shift: boolean;
44
- super?: boolean;
45
- leader: boolean;
46
- };
47
- export type TuiKeybindMap = Record<string, string>;
48
- export type TuiKeybindSet = {
49
- readonly all: TuiKeybindMap;
50
- get: (name: string) => string;
51
- match: (name: string, evt: ParsedKey) => boolean;
52
- print: (name: string) => string;
53
- };
54
- export type TuiDialogProps = {
55
- size?: "medium" | "large";
56
- onClose: () => void;
57
- children?: JSX.Element;
58
- };
59
- export type TuiDialogStack = {
60
- replace: (render: () => JSX.Element, onClose?: () => void) => void;
61
- clear: () => void;
62
- setSize: (size: "medium" | "large") => void;
63
- readonly size: "medium" | "large";
64
- readonly depth: number;
65
- readonly open: boolean;
66
- };
67
- export type TuiDialogAlertProps = {
68
- title: string;
69
- message: string;
70
- onConfirm?: () => void;
71
- };
72
- export type TuiDialogConfirmProps = {
73
- title: string;
74
- message: string;
75
- onConfirm?: () => void;
76
- onCancel?: () => void;
77
- };
78
- export type TuiDialogPromptProps = {
79
- title: string;
80
- description?: () => JSX.Element;
81
- placeholder?: string;
82
- value?: string;
83
- onConfirm?: (value: string) => void;
84
- onCancel?: () => void;
85
- };
86
- export type TuiDialogSelectOption<Value = unknown> = {
87
- title: string;
88
- value: Value;
89
- description?: string;
90
- footer?: JSX.Element | string;
91
- category?: string;
92
- disabled?: boolean;
93
- onSelect?: () => void;
94
- };
95
- export type TuiDialogSelectProps<Value = unknown> = {
96
- title: string;
97
- placeholder?: string;
98
- options: TuiDialogSelectOption<Value>[];
99
- flat?: boolean;
100
- onMove?: (option: TuiDialogSelectOption<Value>) => void;
101
- onFilter?: (query: string) => void;
102
- onSelect?: (option: TuiDialogSelectOption<Value>) => void;
103
- skipFilter?: boolean;
104
- current?: Value;
105
- };
106
- export type TuiToast = {
107
- variant?: "info" | "success" | "warning" | "error";
108
- title?: string;
109
- message: string;
110
- duration?: number;
111
- };
112
- export type TuiThemeCurrent = {
113
- readonly primary: RGBA;
114
- readonly secondary: RGBA;
115
- readonly accent: RGBA;
116
- readonly error: RGBA;
117
- readonly warning: RGBA;
118
- readonly success: RGBA;
119
- readonly info: RGBA;
120
- readonly text: RGBA;
121
- readonly textMuted: RGBA;
122
- readonly selectedListItemText: RGBA;
123
- readonly background: RGBA;
124
- readonly backgroundPanel: RGBA;
125
- readonly backgroundElement: RGBA;
126
- readonly backgroundMenu: RGBA;
127
- readonly border: RGBA;
128
- readonly borderActive: RGBA;
129
- readonly borderSubtle: RGBA;
130
- readonly diffAdded: RGBA;
131
- readonly diffRemoved: RGBA;
132
- readonly diffContext: RGBA;
133
- readonly diffHunkHeader: RGBA;
134
- readonly diffHighlightAdded: RGBA;
135
- readonly diffHighlightRemoved: RGBA;
136
- readonly diffAddedBg: RGBA;
137
- readonly diffRemovedBg: RGBA;
138
- readonly diffContextBg: RGBA;
139
- readonly diffLineNumber: RGBA;
140
- readonly diffAddedLineNumberBg: RGBA;
141
- readonly diffRemovedLineNumberBg: RGBA;
142
- readonly markdownText: RGBA;
143
- readonly markdownHeading: RGBA;
144
- readonly markdownLink: RGBA;
145
- readonly markdownLinkText: RGBA;
146
- readonly markdownCode: RGBA;
147
- readonly markdownBlockQuote: RGBA;
148
- readonly markdownEmph: RGBA;
149
- readonly markdownStrong: RGBA;
150
- readonly markdownHorizontalRule: RGBA;
151
- readonly markdownListItem: RGBA;
152
- readonly markdownListEnumeration: RGBA;
153
- readonly markdownImage: RGBA;
154
- readonly markdownImageText: RGBA;
155
- readonly markdownCodeBlock: RGBA;
156
- readonly syntaxComment: RGBA;
157
- readonly syntaxKeyword: RGBA;
158
- readonly syntaxFunction: RGBA;
159
- readonly syntaxVariable: RGBA;
160
- readonly syntaxString: RGBA;
161
- readonly syntaxNumber: RGBA;
162
- readonly syntaxType: RGBA;
163
- readonly syntaxOperator: RGBA;
164
- readonly syntaxPunctuation: RGBA;
165
- readonly thinkingOpacity: number;
166
- };
167
- export type TuiTheme = {
168
- readonly current: TuiThemeCurrent;
169
- readonly selected: string;
170
- has: (name: string) => boolean;
171
- set: (name: string) => boolean;
172
- install: (jsonPath: string) => Promise<void>;
173
- mode: () => "dark" | "light";
174
- readonly ready: boolean;
175
- };
176
- export type TuiKV = {
177
- get: <Value = unknown>(key: string, fallback?: Value) => Value;
178
- set: (key: string, value: unknown) => void;
179
- readonly ready: boolean;
180
- };
181
- export type TuiState = {
182
- readonly ready: boolean;
183
- readonly config: SdkConfig;
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
- };
198
- session: {
199
- count: () => number;
200
- diff: (sessionID: string) => ReadonlyArray<TuiSidebarFileItem>;
201
- todo: (sessionID: string) => ReadonlyArray<TuiSidebarTodoItem>;
202
- messages: (sessionID: string) => ReadonlyArray<Message>;
203
- status: (sessionID: string) => SessionStatus | undefined;
204
- permission: (sessionID: string) => ReadonlyArray<PermissionRequest>;
205
- question: (sessionID: string) => ReadonlyArray<QuestionRequest>;
206
- };
207
- part: (messageID: string) => ReadonlyArray<Part>;
208
- lsp: () => ReadonlyArray<TuiSidebarLspItem>;
209
- mcp: () => ReadonlyArray<TuiSidebarMcpItem>;
210
- };
211
- type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "keybinds" | "plugin"> & NonNullable<PluginConfig["tui"]> & {
212
- plugin_enabled?: Record<string, boolean>;
213
- };
214
- export type TuiApp = {
215
- readonly version: string;
216
- };
217
- type Frozen<Value> = Value extends (...args: never[]) => unknown ? Value : Value extends ReadonlyArray<infer Item> ? ReadonlyArray<Frozen<Item>> : Value extends object ? {
218
- readonly [Key in keyof Value]: Frozen<Value[Key]>;
219
- } : Value;
220
- export type TuiSidebarMcpItem = {
221
- name: string;
222
- status: McpStatus["status"];
223
- error?: string;
224
- };
225
- export type TuiSidebarLspItem = Pick<LspStatus, "id" | "root" | "status">;
226
- export type TuiSidebarTodoItem = Pick<Todo, "content" | "status">;
227
- export type TuiSidebarFileItem = {
228
- file: string;
229
- additions: number;
230
- deletions: number;
231
- };
232
- export type TuiSlotMap = {
233
- app: {};
234
- home_logo: {};
235
- home_bottom: {};
236
- sidebar_title: {
237
- session_id: string;
238
- title: string;
239
- share_url?: string;
240
- };
241
- sidebar_content: {
242
- session_id: string;
243
- };
244
- sidebar_footer: {
245
- session_id: string;
246
- };
247
- };
248
- export type TuiSlotContext = {
249
- theme: TuiTheme;
250
- };
251
- type SlotCore = SolidPlugin<TuiSlotMap, TuiSlotContext>;
252
- export type TuiSlotPlugin = Omit<SlotCore, "id"> & {
253
- id?: never;
254
- };
255
- export type TuiSlots = {
256
- register: (plugin: TuiSlotPlugin) => string;
257
- };
258
- export type TuiEventBus = {
259
- on: <Type extends Event["type"]>(type: Type, handler: (event: Extract<Event, {
260
- type: Type;
261
- }>) => void) => () => void;
262
- };
263
- export type TuiDispose = () => void | Promise<void>;
264
- export type TuiLifecycle = {
265
- readonly signal: AbortSignal;
266
- onDispose: (fn: TuiDispose) => () => void;
267
- };
268
- export type TuiPluginState = "first" | "updated" | "same";
269
- export type TuiPluginEntry = {
270
- name: string;
271
- source: "file" | "npm" | "internal";
272
- spec: string;
273
- target: string;
274
- requested?: string;
275
- version?: string;
276
- modified?: number;
277
- first_time: number;
278
- last_time: number;
279
- time_changed: number;
280
- load_count: number;
281
- fingerprint: string;
282
- };
283
- export type TuiPluginMeta = TuiPluginEntry & {
284
- state: TuiPluginState;
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
- };
295
- export type TuiWorkspace = {
296
- current: () => string | undefined;
297
- set: (workspaceID?: string) => void;
298
- };
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;
328
- client: OpencodeClient;
329
- scopedClient: (workspaceID?: string) => OpencodeClient;
330
- workspace: TuiWorkspace;
331
- event: TuiEventBus;
332
- renderer: CliRenderer;
333
- slots: TuiSlots;
334
- plugins: {
335
- list: () => ReadonlyArray<TuiPluginStatus>;
336
- activate: (id: string) => Promise<boolean>;
337
- deactivate: (id: string) => Promise<boolean>;
338
- };
339
- lifecycle: TuiLifecycle;
340
- };
341
- export type TuiPlugin = (api: TuiPluginApi, options: PluginOptions | undefined, meta: TuiPluginMeta) => Promise<void>;
342
- export type TuiPluginModule = {
343
- id?: string;
344
- server?: Plugin;
345
- tui?: TuiPlugin;
346
- };
package/dist/tui.js DELETED
@@ -1 +0,0 @@
1
- export {};