@opencode-ai/plugin 1.14.47 → 1.14.49

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,5 +1,5 @@
1
- import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Auth, Config as SDKConfig } from "@opencode-ai/sdk";
2
- import type { Provider as ProviderV2, Model as ModelV2 } from "@opencode-ai/sdk/v2";
1
+ import type { Event, createOpencodeClient, Project, Model, Provider, Permission, UserMessage, Message, Part, Config as SDKConfig } from "@opencode-ai/sdk";
2
+ import type { Provider as ProviderV2, Model as ModelV2, Auth } from "@opencode-ai/sdk/v2";
3
3
  import type { BunShell } from "./shell.js";
4
4
  import { type ToolDefinition } from "./tool.js";
5
5
  export * from "./tool.js";
@@ -117,6 +117,7 @@ export type AuthHook = {
117
117
  type: "success";
118
118
  key: string;
119
119
  provider?: string;
120
+ metadata?: Record<string, string>;
120
121
  } | {
121
122
  type: "failed";
122
123
  }>;
@@ -138,6 +139,7 @@ export type AuthOAuthResult = {
138
139
  enterpriseUrl?: string;
139
140
  } | {
140
141
  key: string;
142
+ metadata?: Record<string, string>;
141
143
  })) | {
142
144
  type: "failed";
143
145
  }>;
@@ -154,6 +156,7 @@ export type AuthOAuthResult = {
154
156
  enterpriseUrl?: string;
155
157
  } | {
156
158
  key: string;
159
+ metadata?: Record<string, string>;
157
160
  })) | {
158
161
  type: "failed";
159
162
  }>;
package/dist/tool.d.ts CHANGED
@@ -31,11 +31,19 @@ type AskInput = {
31
31
  [key: string]: any;
32
32
  };
33
33
  };
34
+ export type ToolAttachment = {
35
+ type: "file";
36
+ mime: string;
37
+ url: string;
38
+ filename?: string;
39
+ };
34
40
  export type ToolResult = string | {
41
+ title?: string;
35
42
  output: string;
36
43
  metadata?: {
37
44
  [key: string]: any;
38
45
  };
46
+ attachments?: ToolAttachment[];
39
47
  };
40
48
  export declare function tool<Args extends z.ZodRawShape>(input: {
41
49
  description: string;
package/dist/tui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AgentPart, OpencodeClient, Event, FilePart, LspStatus, McpStatus, Todo, Message, Part, Provider, PermissionRequest, QuestionRequest, SessionStatus, TextPart, Config as SdkConfig } from "@opencode-ai/sdk/v2";
1
+ import type { AgentPart, OpencodeClient, Event, FilePart, LspStatus, McpStatus, Todo, Message, Part, Provider, PermissionRequest, QuestionRequest, Session, SessionStatus, TextPart, Config as SdkConfig } from "@opencode-ai/sdk/v2";
2
2
  import type { CliRenderer, KeyEvent, RGBA, Renderable, SlotMode } from "@opentui/core";
3
3
  import type { Binding, Keymap } from "@opentui/keymap";
4
4
  import { type BindingConfig, type CreateBindingLookupOptions, type KeySequenceFormatPart, type SequenceBindingLike } from "@opentui/keymap/extras";
@@ -164,6 +164,54 @@ export type TuiToast = {
164
164
  message: string;
165
165
  duration?: number;
166
166
  };
167
+ export type TuiAttentionWhen = "always" | "focused" | "blurred";
168
+ export declare const TuiAttentionSoundNames: readonly ["default", "question", "permission", "error", "done", "subagent_done"];
169
+ export type TuiAttentionSoundName = (typeof TuiAttentionSoundNames)[number];
170
+ export type TuiAttentionSound = boolean | {
171
+ name?: TuiAttentionSoundName;
172
+ volume?: number;
173
+ when?: TuiAttentionWhen;
174
+ };
175
+ export type TuiAttentionNotification = boolean | {
176
+ when?: TuiAttentionWhen;
177
+ };
178
+ export type TuiAttentionSoundPack = {
179
+ id: string;
180
+ name?: string;
181
+ sounds: Partial<Record<TuiAttentionSoundName, string>>;
182
+ };
183
+ export type TuiAttentionSoundPackInfo = {
184
+ id: string;
185
+ name?: string;
186
+ active: boolean;
187
+ builtin: boolean;
188
+ };
189
+ export type TuiAttentionSoundboardActivateOptions = {
190
+ persist?: boolean;
191
+ };
192
+ export type TuiAttentionSoundboard = {
193
+ registerPack(pack: TuiAttentionSoundPack): () => void;
194
+ activate(id: string, options?: TuiAttentionSoundboardActivateOptions): boolean;
195
+ current(): string;
196
+ list(): ReadonlyArray<TuiAttentionSoundPackInfo>;
197
+ };
198
+ export type TuiAttentionNotifyInput = {
199
+ title?: string;
200
+ message: string;
201
+ notification?: TuiAttentionNotification;
202
+ sound?: TuiAttentionSound;
203
+ };
204
+ export type TuiAttentionNotifySkipReason = "attention_disabled" | "empty_message" | "blurred" | "focused" | "focus_unknown" | "renderer_destroyed";
205
+ export type TuiAttentionNotifyResult = {
206
+ ok: boolean;
207
+ notification: boolean;
208
+ sound: boolean;
209
+ skipped?: TuiAttentionNotifySkipReason;
210
+ };
211
+ export type TuiAttention = {
212
+ notify(input: TuiAttentionNotifyInput): Promise<TuiAttentionNotifyResult>;
213
+ soundboard: TuiAttentionSoundboard;
214
+ };
167
215
  export type TuiThemeCurrent = {
168
216
  readonly primary: RGBA;
169
217
  readonly secondary: RGBA;
@@ -248,6 +296,7 @@ export type TuiState = {
248
296
  } | undefined;
249
297
  session: {
250
298
  count: () => number;
299
+ get: (sessionID: string) => Session | undefined;
251
300
  diff: (sessionID: string) => ReadonlyArray<TuiSidebarFileItem>;
252
301
  todo: (sessionID: string) => ReadonlyArray<TuiSidebarTodoItem>;
253
302
  messages: (sessionID: string) => ReadonlyArray<Message>;
@@ -267,8 +316,17 @@ type TuiBindingLookupView = {
267
316
  pick: (name: string, commands: readonly string[]) => Binding<Renderable, KeyEvent>[];
268
317
  omit: (name: string, commands: readonly string[]) => Binding<Renderable, KeyEvent>[];
269
318
  };
319
+ type TuiAttentionConfigView = {
320
+ enabled: boolean;
321
+ notifications: boolean;
322
+ sound: boolean;
323
+ volume: number;
324
+ sound_pack: string;
325
+ sounds: Partial<Record<TuiAttentionSoundName, string>>;
326
+ };
270
327
  type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "plugin"> & NonNullable<PluginConfig["tui"]> & {
271
328
  leader_timeout: number;
329
+ attention: TuiAttentionConfigView;
272
330
  plugin_enabled?: Record<string, boolean>;
273
331
  keybinds: TuiBindingLookupView;
274
332
  };
@@ -399,6 +457,7 @@ export type TuiWorkspace = {
399
457
  };
400
458
  export type TuiPluginApi = {
401
459
  app: TuiApp;
460
+ attention: TuiAttention;
402
461
  /**
403
462
  * Legacy `api.command` API kept so v1 plugins can initialize. Remove in v2.
404
463
  *
package/dist/tui.js CHANGED
@@ -4,3 +4,4 @@ export { formatCommandBindings, formatKeySequence } from "@opentui/keymap/extras
4
4
  export function createBindingLookup(config, options) {
5
5
  return createKeymapBindingLookup(config ?? {}, options);
6
6
  }
7
+ export const TuiAttentionSoundNames = ["default", "question", "permission", "error", "done", "subagent_done"];
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": "1.14.47",
4
+ "version": "1.14.49",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -26,14 +26,14 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@opencode-ai/sdk": "1.14.47",
30
- "effect": "4.0.0-beta.59",
29
+ "@opencode-ai/sdk": "1.14.49",
30
+ "effect": "4.0.0-beta.65",
31
31
  "zod": "4.1.8"
32
32
  },
33
33
  "peerDependencies": {
34
- "@opentui/core": ">=0.2.6",
35
- "@opentui/keymap": ">=0.2.6",
36
- "@opentui/solid": ">=0.2.6"
34
+ "@opentui/core": ">=0.2.9",
35
+ "@opentui/keymap": ">=0.2.9",
36
+ "@opentui/solid": ">=0.2.9"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@opentui/core": {
@@ -47,9 +47,9 @@
47
47
  }
48
48
  },
49
49
  "devDependencies": {
50
- "@opentui/core": "0.2.6",
51
- "@opentui/keymap": "0.2.6",
52
- "@opentui/solid": "0.2.6",
50
+ "@opentui/core": "0.2.9",
51
+ "@opentui/keymap": "0.2.9",
52
+ "@opentui/solid": "0.2.9",
53
53
  "@tsconfig/node22": "22.0.2",
54
54
  "@types/node": "24.12.2",
55
55
  "typescript": "5.8.2",