@opencode-ai/plugin 0.0.0-dev-202608200548 → 0.0.0-dev-17720

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 (151) hide show
  1. package/dist/app.d.ts +5 -0
  2. package/dist/app.js +0 -0
  3. package/dist/effect/agent.d.ts +15 -0
  4. package/dist/effect/agent.js +0 -0
  5. package/dist/{v2/promise → effect}/aisdk.d.ts +9 -6
  6. package/dist/effect/aisdk.js +0 -0
  7. package/dist/effect/catalog.d.ts +33 -0
  8. package/dist/effect/catalog.js +2 -0
  9. package/dist/effect/command.d.ts +14 -0
  10. package/dist/effect/command.js +0 -0
  11. package/dist/effect/event.d.ts +3 -0
  12. package/dist/effect/event.js +0 -0
  13. package/dist/effect/index.d.ts +13 -0
  14. package/dist/effect/index.js +12 -0
  15. package/dist/effect/integration.d.ts +80 -0
  16. package/dist/effect/integration.js +2 -0
  17. package/dist/effect/mcp.d.ts +15 -0
  18. package/dist/effect/mcp.js +0 -0
  19. package/dist/effect/plugin.d.ts +43 -0
  20. package/dist/effect/reference.d.ts +13 -0
  21. package/dist/effect/reference.js +0 -0
  22. package/dist/effect/registration.d.ts +11 -0
  23. package/dist/effect/registration.js +0 -0
  24. package/dist/effect/session.d.ts +47 -0
  25. package/dist/effect/session.js +0 -0
  26. package/dist/effect/shell.d.ts +14 -0
  27. package/dist/effect/shell.js +0 -0
  28. package/dist/effect/skill.d.ts +14 -0
  29. package/dist/effect/skill.js +1 -0
  30. package/dist/effect/storage.d.ts +8 -0
  31. package/dist/effect/storage.js +0 -0
  32. package/dist/effect/tool.d.ts +40 -0
  33. package/dist/effect/tool.js +1 -0
  34. package/dist/effect/websearch.d.ts +20 -0
  35. package/dist/effect/websearch.js +0 -0
  36. package/dist/options.js +0 -0
  37. package/dist/promise/adapter.d.ts +12 -0
  38. package/dist/promise/adapter.js +255 -0
  39. package/dist/promise/agent.d.ts +15 -0
  40. package/dist/promise/agent.js +0 -0
  41. package/dist/{v2/effect → promise}/aisdk.d.ts +9 -6
  42. package/dist/promise/aisdk.js +0 -0
  43. package/dist/promise/catalog.d.ts +33 -0
  44. package/dist/promise/catalog.js +0 -0
  45. package/dist/promise/command.d.ts +13 -0
  46. package/dist/promise/command.js +0 -0
  47. package/dist/promise/event.d.ts +3 -0
  48. package/dist/promise/event.js +0 -0
  49. package/dist/promise/index.d.ts +14 -0
  50. package/dist/promise/index.js +12 -0
  51. package/dist/promise/integration.d.ts +79 -0
  52. package/dist/promise/integration.js +2 -0
  53. package/dist/promise/mcp.d.ts +15 -0
  54. package/dist/promise/mcp.js +0 -0
  55. package/dist/promise/plugin.d.ts +43 -0
  56. package/dist/{v2/effect → promise}/reference.d.ts +7 -5
  57. package/dist/promise/reference.js +0 -0
  58. package/dist/promise/registration.d.ts +10 -0
  59. package/dist/promise/registration.js +0 -0
  60. package/dist/promise/session.d.ts +47 -0
  61. package/dist/promise/session.js +0 -0
  62. package/dist/promise/shell.d.ts +14 -0
  63. package/dist/promise/shell.js +0 -0
  64. package/dist/promise/skill.d.ts +14 -0
  65. package/dist/promise/skill.js +0 -0
  66. package/dist/promise/storage.d.ts +8 -0
  67. package/dist/promise/storage.js +0 -0
  68. package/dist/promise/tool.d.ts +44 -0
  69. package/dist/promise/tool.js +2 -0
  70. package/dist/promise/types.d.ts +3 -0
  71. package/dist/promise/types.js +0 -0
  72. package/dist/promise/websearch.d.ts +21 -0
  73. package/dist/promise/websearch.js +0 -0
  74. package/dist/storage.d.ts +14 -0
  75. package/dist/storage.js +0 -0
  76. package/dist/tui/context.d.ts +421 -0
  77. package/dist/tui/context.js +0 -0
  78. package/dist/tui/index.d.ts +2 -0
  79. package/dist/tui/index.js +2 -0
  80. package/dist/tui/plugin.d.ts +8 -0
  81. package/dist/tui/plugin.js +3 -0
  82. package/dist/tui/solid.d.ts +7 -0
  83. package/dist/tui/solid.js +16 -0
  84. package/dist/v1/index.js +2 -0
  85. package/dist/v1/shell.js +0 -0
  86. package/dist/{tui.d.ts → v1/tui.d.ts} +70 -18
  87. package/package.json +40 -31
  88. package/dist/example-workspace.d.ts +0 -3
  89. package/dist/example-workspace.js +0 -30
  90. package/dist/example.d.ts +0 -2
  91. package/dist/example.js +0 -16
  92. package/dist/index.js +0 -1
  93. package/dist/shell.js +0 -1
  94. package/dist/v2/effect/agent.d.ts +0 -12
  95. package/dist/v2/effect/agent.js +0 -1
  96. package/dist/v2/effect/aisdk.js +0 -1
  97. package/dist/v2/effect/catalog.d.ts +0 -29
  98. package/dist/v2/effect/catalog.js +0 -1
  99. package/dist/v2/effect/command.d.ts +0 -11
  100. package/dist/v2/effect/command.js +0 -1
  101. package/dist/v2/effect/context.d.ts +0 -21
  102. package/dist/v2/effect/context.js +0 -1
  103. package/dist/v2/effect/event.d.ts +0 -8
  104. package/dist/v2/effect/event.js +0 -1
  105. package/dist/v2/effect/filesystem.d.ts +0 -23
  106. package/dist/v2/effect/filesystem.js +0 -1
  107. package/dist/v2/effect/index.d.ts +0 -3
  108. package/dist/v2/effect/index.js +0 -1
  109. package/dist/v2/effect/integration.d.ts +0 -46
  110. package/dist/v2/effect/integration.js +0 -1
  111. package/dist/v2/effect/location.d.ts +0 -6
  112. package/dist/v2/effect/location.js +0 -1
  113. package/dist/v2/effect/npm.d.ts +0 -7
  114. package/dist/v2/effect/npm.js +0 -1
  115. package/dist/v2/effect/path.d.ts +0 -8
  116. package/dist/v2/effect/path.js +0 -1
  117. package/dist/v2/effect/plugin.d.ts +0 -11
  118. package/dist/v2/effect/reference.js +0 -1
  119. package/dist/v2/effect/registration.d.ts +0 -10
  120. package/dist/v2/effect/registration.js +0 -1
  121. package/dist/v2/effect/skill.d.ts +0 -9
  122. package/dist/v2/effect/skill.js +0 -1
  123. package/dist/v2/options.js +0 -1
  124. package/dist/v2/promise/agent.d.ts +0 -6
  125. package/dist/v2/promise/agent.js +0 -1
  126. package/dist/v2/promise/aisdk.js +0 -1
  127. package/dist/v2/promise/catalog.d.ts +0 -6
  128. package/dist/v2/promise/catalog.js +0 -1
  129. package/dist/v2/promise/command.d.ts +0 -6
  130. package/dist/v2/promise/command.js +0 -1
  131. package/dist/v2/promise/context.d.ts +0 -21
  132. package/dist/v2/promise/context.js +0 -1
  133. package/dist/v2/promise/index.d.ts +0 -12
  134. package/dist/v2/promise/index.js +0 -1
  135. package/dist/v2/promise/integration.d.ts +0 -12
  136. package/dist/v2/promise/integration.js +0 -1
  137. package/dist/v2/promise/plugin.d.ts +0 -10
  138. package/dist/v2/promise/reference.d.ts +0 -6
  139. package/dist/v2/promise/reference.js +0 -1
  140. package/dist/v2/promise/registration.d.ts +0 -9
  141. package/dist/v2/promise/registration.js +0 -1
  142. package/dist/v2/promise/skill.d.ts +0 -6
  143. package/dist/v2/promise/skill.js +0 -1
  144. /package/dist/{v2/effect → effect}/plugin.js +0 -0
  145. /package/dist/{v2/options.d.ts → options.d.ts} +0 -0
  146. /package/dist/{v2/promise → promise}/plugin.js +0 -0
  147. /package/dist/{index.d.ts → v1/index.d.ts} +0 -0
  148. /package/dist/{shell.d.ts → v1/shell.d.ts} +0 -0
  149. /package/dist/{tool.d.ts → v1/tool.d.ts} +0 -0
  150. /package/dist/{tool.js → v1/tool.js} +0 -0
  151. /package/dist/{tui.js → v1/tui.js} +0 -0
@@ -1,4 +1,7 @@
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";
1
+ import type { OpencodeClient, LspStatus, McpStatus, Message, Part, Provider, PermissionRequest, QuestionRequest, Session, SessionStatus, Config as SdkConfig } from "@opencode-ai/sdk/v2";
2
+ import type { OpenCodeEvent } from "@opencode-ai/client/promise";
3
+ import type { PromptInput } from "@opencode-ai/schema";
4
+ import type { Types } from "effect";
2
5
  import type { CliRenderer, KeyEvent, RGBA, Renderable, SlotMode } from "@opentui/core";
3
6
  import type { Binding, Keymap } from "@opentui/keymap";
4
7
  import { type BindingConfig, type CreateBindingLookupOptions, type KeySequenceFormatPart, type SequenceBindingLike } from "@opentui/keymap/extras";
@@ -125,18 +128,16 @@ export type TuiDialogSelectProps<Value = unknown> = {
125
128
  skipFilter?: boolean;
126
129
  current?: Value;
127
130
  };
128
- export type TuiPromptInfo = {
129
- input: string;
130
- mode?: "normal" | "shell";
131
- parts: (Omit<FilePart, "id" | "messageID" | "sessionID"> | Omit<AgentPart, "id" | "messageID" | "sessionID"> | (Omit<TextPart, "id" | "messageID" | "sessionID"> & {
132
- source?: {
133
- text: {
134
- start: number;
135
- end: number;
136
- value: string;
137
- };
131
+ export type TuiPromptInfo = Types.DeepMutable<PromptInput.Prompt> & {
132
+ pasted: {
133
+ text: string;
134
+ source: {
135
+ start: number;
136
+ end: number;
137
+ text: string;
138
138
  };
139
- }))[];
139
+ }[];
140
+ mode?: "normal" | "shell";
140
141
  };
141
142
  export type TuiPromptRef = {
142
143
  focused: boolean;
@@ -279,6 +280,7 @@ export type TuiTheme = {
279
280
  mode: () => "dark" | "light";
280
281
  readonly ready: boolean;
281
282
  };
283
+ /** @deprecated Persistent TUI KV storage is not supported in V2. */
282
284
  export type TuiKV = {
283
285
  get: <Value = unknown>(key: string, fallback?: Value) => Value;
284
286
  set: (key: string, value: unknown) => void;
@@ -302,7 +304,6 @@ export type TuiState = {
302
304
  count: () => number;
303
305
  get: (sessionID: string) => Session | undefined;
304
306
  diff: (sessionID: string) => ReadonlyArray<TuiSidebarFileItem>;
305
- todo: (sessionID: string) => ReadonlyArray<TuiSidebarTodoItem>;
306
307
  messages: (sessionID: string) => ReadonlyArray<Message>;
307
308
  status: (sessionID: string) => SessionStatus | undefined;
308
309
  permission: (sessionID: string) => ReadonlyArray<PermissionRequest>;
@@ -328,10 +329,60 @@ type TuiAttentionConfigView = {
328
329
  sound_pack: string;
329
330
  sounds: Partial<Record<TuiAttentionSoundName, string>>;
330
331
  };
331
- type TuiConfigView = Pick<PluginConfig, "$schema" | "theme" | "plugin"> & NonNullable<PluginConfig["tui"]> & {
332
- leader_timeout: number;
333
- attention: TuiAttentionConfigView;
332
+ type TuiConfigView = {
333
+ $schema?: string;
334
+ theme?: string | {
335
+ name?: string;
336
+ mode?: "system" | "dark" | "light";
337
+ };
338
+ plugin?: PluginConfig["plugin"];
339
+ plugins?: ReadonlyArray<string | {
340
+ package: string;
341
+ options?: Record<string, any>;
342
+ }>;
334
343
  plugin_enabled?: Record<string, boolean>;
344
+ leader?: {
345
+ timeout: number;
346
+ };
347
+ leader_timeout?: number;
348
+ scroll?: {
349
+ speed?: number;
350
+ acceleration?: boolean;
351
+ };
352
+ scroll_speed?: number;
353
+ scroll_acceleration?: {
354
+ enabled: boolean;
355
+ };
356
+ attention: TuiAttentionConfigView;
357
+ diffs?: {
358
+ wrap?: "word" | "none";
359
+ tree?: boolean;
360
+ single?: boolean;
361
+ view?: "auto" | "split" | "unified";
362
+ };
363
+ diff_style?: "auto" | "stacked";
364
+ terminal?: {
365
+ title?: boolean;
366
+ };
367
+ prompt?: {
368
+ editor?: boolean;
369
+ paste?: "compact" | "full";
370
+ } | {
371
+ max_height?: number;
372
+ max_width?: number | "auto";
373
+ };
374
+ session?: {
375
+ sidebar?: "auto" | "hide";
376
+ scrollbar?: boolean;
377
+ thinking?: "show" | "hide";
378
+ markdown?: "source" | "rendered";
379
+ grouping?: "auto" | "none";
380
+ };
381
+ hints?: {
382
+ onboarding?: boolean;
383
+ };
384
+ animations?: boolean;
385
+ mouse: boolean;
335
386
  keybinds: TuiBindingLookupView;
336
387
  };
337
388
  export type TuiApp = {
@@ -346,7 +397,6 @@ export type TuiSidebarMcpItem = {
346
397
  error?: string;
347
398
  };
348
399
  export type TuiSidebarLspItem = Pick<LspStatus, "id" | "root" | "status">;
349
- export type TuiSidebarTodoItem = Pick<Todo, "content" | "status">;
350
400
  export type TuiSidebarFileItem = {
351
401
  file: string;
352
402
  additions: number;
@@ -382,6 +432,7 @@ export type TuiHostSlotMap = {
382
432
  };
383
433
  sidebar_footer: {
384
434
  session_id: string;
435
+ directory: string;
385
436
  };
386
437
  };
387
438
  export type TuiSlotMap<Slots extends Record<string, object> = {}> = TuiHostSlotMap & Slots;
@@ -405,7 +456,7 @@ export type TuiSlots = {
405
456
  };
406
457
  };
407
458
  export type TuiEventBus = {
408
- on: <Type extends Event["type"]>(type: Type, handler: (event: Extract<Event, {
459
+ on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: Extract<OpenCodeEvent, {
409
460
  type: Type;
410
461
  }>) => void) => () => void;
411
462
  };
@@ -486,6 +537,7 @@ export type TuiPluginApi = {
486
537
  dialog: TuiDialogStack;
487
538
  };
488
539
  readonly tuiConfig: Frozen<TuiConfigView>;
540
+ /** @deprecated Persistent TUI KV storage is not supported in V2. */
489
541
  kv: TuiKV;
490
542
  state: TuiState;
491
543
  theme: TuiTheme;
package/package.json CHANGED
@@ -1,41 +1,34 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/plugin",
4
- "version": "0.0.0-dev-202608200548",
4
+ "version": "0.0.0-dev-17720",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
8
+ "test": "bun test --timeout 5000",
8
9
  "typecheck": "tsgo --noEmit",
9
- "build": "tsc"
10
+ "build": "tsc -p tsconfig.build.json"
10
11
  },
11
12
  "exports": {
12
13
  ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
14
+ "import": "./dist/promise/index.js",
15
+ "types": "./dist/promise/index.d.ts"
15
16
  },
16
- "./tool": {
17
- "import": "./dist/tool.js",
18
- "types": "./dist/tool.d.ts"
17
+ "./effect": {
18
+ "import": "./dist/effect/index.js",
19
+ "types": "./dist/effect/index.d.ts"
19
20
  },
20
21
  "./tui": {
21
- "import": "./dist/tui.js",
22
- "types": "./dist/tui.d.ts"
22
+ "import": "./dist/tui/index.js",
23
+ "types": "./dist/tui/index.d.ts"
23
24
  },
24
- "./v2/effect": {
25
- "import": "./dist/v2/effect/index.js",
26
- "types": "./dist/v2/effect/index.d.ts"
25
+ "./v1": {
26
+ "import": "./dist/v1/index.js",
27
+ "types": "./dist/v1/index.d.ts"
27
28
  },
28
- "./v2/effect/integration": {
29
- "import": "./dist/v2/effect/integration.js",
30
- "types": "./dist/v2/effect/integration.d.ts"
31
- },
32
- "./v2/effect/plugin": {
33
- "import": "./dist/v2/effect/plugin.js",
34
- "types": "./dist/v2/effect/plugin.d.ts"
35
- },
36
- "./v2/promise": {
37
- "import": "./dist/v2/promise/index.js",
38
- "types": "./dist/v2/promise/index.d.ts"
29
+ "./*": {
30
+ "import": "./dist/*.js",
31
+ "types": "./dist/*.d.ts"
39
32
  }
40
33
  },
41
34
  "files": [
@@ -43,16 +36,26 @@
43
36
  ],
44
37
  "dependencies": {
45
38
  "@ai-sdk/provider": "3.0.8",
46
- "@opencode-ai/sdk": "0.0.0-dev-202608200548",
47
- "effect": "4.0.0-beta.83",
39
+ "@opencode-ai/ai": "0.0.0-dev-17720",
40
+ "@opencode-ai/client": "0.0.0-dev-17720",
41
+ "@opencode-ai/protocol": "0.0.0-dev-17720",
42
+ "@opencode-ai/schema": "0.0.0-dev-17720",
43
+ "@opencode-ai/sdk": "1.18.5",
44
+ "@standard-schema/spec": "1.1.0",
45
+ "effect": "4.0.0-rc.110",
48
46
  "zod": "4.1.8"
49
47
  },
50
48
  "peerDependencies": {
51
- "@opentui/core": ">=0.4.5",
52
- "@opentui/keymap": ">=0.4.5",
53
- "@opentui/solid": ">=0.4.5"
49
+ "@opencode-ai/theme": "0.0.0-dev-17720",
50
+ "@opentui/core": ">=0.5.4",
51
+ "@opentui/keymap": ">=0.5.4",
52
+ "@opentui/solid": ">=0.5.4",
53
+ "solid-js": ">=1.9.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
+ "@opencode-ai/theme": {
57
+ "optional": true
58
+ },
56
59
  "@opentui/core": {
57
60
  "optional": true
58
61
  },
@@ -61,14 +64,20 @@
61
64
  },
62
65
  "@opentui/solid": {
63
66
  "optional": true
67
+ },
68
+ "solid-js": {
69
+ "optional": true
64
70
  }
65
71
  },
66
72
  "devDependencies": {
67
- "@opentui/core": "0.4.5",
68
- "@opentui/keymap": "0.4.5",
69
- "@opentui/solid": "0.4.5",
73
+ "@opencode-ai/theme": "0.0.0-dev-17720",
74
+ "@opentui/core": "0.5.4",
75
+ "@opentui/keymap": "0.5.4",
76
+ "@opentui/solid": "0.5.4",
77
+ "@tsconfig/bun": "1.0.9",
70
78
  "@tsconfig/node22": "22.0.2",
71
79
  "@types/node": "24.12.2",
80
+ "solid-js": "1.9.10",
72
81
  "typescript": "5.8.2",
73
82
  "@typescript/native-preview": "7.0.0-dev.20251207.1"
74
83
  }
@@ -1,3 +0,0 @@
1
- import type { Plugin } from "@opencode-ai/plugin";
2
- export declare const FolderWorkspacePlugin: Plugin;
3
- export default FolderWorkspacePlugin;
@@ -1,30 +0,0 @@
1
- import { mkdir, rm } from "node:fs/promises";
2
- export const FolderWorkspacePlugin = async ({ experimental_workspace }) => {
3
- experimental_workspace.register("folder", {
4
- name: "Folder",
5
- description: "Create a blank folder",
6
- configure(config) {
7
- const rand = "" + Math.random();
8
- return {
9
- ...config,
10
- directory: `/tmp/folder/folder-${rand}`,
11
- };
12
- },
13
- async create(config) {
14
- if (!config.directory)
15
- return;
16
- await mkdir(config.directory, { recursive: true });
17
- },
18
- async remove(config) {
19
- await rm(config.directory, { recursive: true, force: true });
20
- },
21
- target(config) {
22
- return {
23
- type: "local",
24
- directory: config.directory,
25
- };
26
- },
27
- });
28
- return {};
29
- };
30
- export default FolderWorkspacePlugin;
package/dist/example.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Plugin } from "./index.js";
2
- export declare const ExamplePlugin: Plugin;
package/dist/example.js DELETED
@@ -1,16 +0,0 @@
1
- import { tool } from "./tool.js";
2
- export const ExamplePlugin = async (_ctx) => {
3
- return {
4
- tool: {
5
- mytool: tool({
6
- description: "This is a custom tool",
7
- args: {
8
- foo: tool.schema.string().describe("foo"),
9
- },
10
- async execute(args) {
11
- return `Hello ${args.foo}!`;
12
- },
13
- }),
14
- },
15
- };
16
- };
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from "./tool.js";
package/dist/shell.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import type { AgentV2Info } from "@opencode-ai/sdk/v2/types";
2
- import type { Hooks } from "./registration.js";
3
- export interface AgentDraft {
4
- list(): readonly AgentV2Info[];
5
- get(id: string): AgentV2Info | undefined;
6
- default(id: string | undefined): void;
7
- update(id: string, update: (agent: AgentV2Info) => void): void;
8
- remove(id: string): void;
9
- }
10
- export type AgentHooks = Hooks<{
11
- transform: AgentDraft;
12
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,29 +0,0 @@
1
- import type { ModelV2Info, ProviderV2Info } from "@opencode-ai/sdk/v2/types";
2
- import type { Hooks } from "./registration.js";
3
- export interface CatalogProviderRecord {
4
- readonly provider: ProviderV2Info;
5
- readonly models: ReadonlyMap<string, ModelV2Info>;
6
- }
7
- export interface CatalogDraft {
8
- readonly provider: {
9
- list(): readonly CatalogProviderRecord[];
10
- get(providerID: string): CatalogProviderRecord | undefined;
11
- update(providerID: string, update: (provider: ProviderV2Info) => void): void;
12
- remove(providerID: string): void;
13
- };
14
- readonly model: {
15
- get(providerID: string, modelID: string): ModelV2Info | undefined;
16
- update(providerID: string, modelID: string, update: (model: ModelV2Info) => void): void;
17
- remove(providerID: string, modelID: string): void;
18
- readonly default: {
19
- get(): {
20
- providerID: string;
21
- modelID: string;
22
- } | undefined;
23
- set(providerID: string, modelID: string): void;
24
- };
25
- };
26
- }
27
- export type CatalogHooks = Hooks<{
28
- transform: CatalogDraft;
29
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import type { CommandV2Info } from "@opencode-ai/sdk/v2/types";
2
- import type { Hooks } from "./registration.js";
3
- export interface CommandDraft {
4
- list(): readonly CommandV2Info[];
5
- get(name: string): CommandV2Info | undefined;
6
- update(name: string, update: (command: CommandV2Info) => void): void;
7
- remove(name: string): void;
8
- }
9
- export type CommandHooks = Hooks<{
10
- transform: CommandDraft;
11
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,21 +0,0 @@
1
- import type { PluginOptions } from "../options.js";
2
- import type { AgentHooks } from "./agent.js";
3
- import type { AISDKHooks } from "./aisdk.js";
4
- import type { CatalogHooks } from "./catalog.js";
5
- import type { CommandHooks } from "./command.js";
6
- import type { IntegrationHooks } from "./integration.js";
7
- import type { PluginDomain } from "./plugin.js";
8
- import type { ReferenceHooks } from "./reference.js";
9
- import type { SkillHooks } from "./skill.js";
10
- import type { Reload } from "./registration.js";
11
- export interface PluginContext {
12
- readonly options: PluginOptions;
13
- readonly agent: AgentHooks & Reload;
14
- readonly aisdk: AISDKHooks;
15
- readonly catalog: CatalogHooks & Reload;
16
- readonly command: CommandHooks & Reload;
17
- readonly integration: IntegrationHooks & Reload;
18
- readonly plugin: PluginDomain;
19
- readonly reference: ReferenceHooks & Reload;
20
- readonly skill: SkillHooks & Reload;
21
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { Event as SDKEvent } from "@opencode-ai/sdk/v2/types";
2
- import type { Stream } from "effect";
3
- export type EventMap = {
4
- [Item in SDKEvent as Item["type"]]: Item;
5
- };
6
- export interface Event {
7
- subscribe<Type extends keyof EventMap>(type: Type): Stream.Stream<EventMap[Type]>;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- import type { FileSystemEntry } from "@opencode-ai/sdk/v2/types";
2
- import type { Effect } from "effect";
3
- export interface FileSystem {
4
- read(input: {
5
- readonly path: string;
6
- }): Effect.Effect<{
7
- readonly content: Uint8Array;
8
- readonly mime: string;
9
- }>;
10
- list(input?: {
11
- readonly path?: string;
12
- }): Effect.Effect<FileSystemEntry[]>;
13
- find(input: {
14
- readonly query: string;
15
- readonly type?: "file" | "directory";
16
- readonly limit?: number;
17
- }): Effect.Effect<FileSystemEntry[]>;
18
- glob(input: {
19
- readonly pattern: string;
20
- readonly path?: string;
21
- readonly limit?: number;
22
- }): Effect.Effect<readonly FileSystemEntry[]>;
23
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export type { PluginContext } from "./context.js";
2
- export { define } from "./plugin.js";
3
- export type { Plugin } from "./plugin.js";
@@ -1 +0,0 @@
1
- export { define } from "./plugin.js";
@@ -1,46 +0,0 @@
1
- import type { ConnectionInfo, CredentialOAuth, CredentialValue, IntegrationEnvMethod, IntegrationInputs, IntegrationKeyMethod, IntegrationMethod, IntegrationOAuthMethod, IntegrationRef } from "@opencode-ai/sdk/v2/types";
2
- import type { Effect, Scope } from "effect";
3
- import type { Hooks } from "./registration.js";
4
- export type IntegrationOAuthAuthorization = {
5
- readonly url: string;
6
- readonly instructions: string;
7
- } & ({
8
- readonly mode: "auto";
9
- readonly callback: Effect.Effect<CredentialOAuth, unknown>;
10
- } | {
11
- readonly mode: "code";
12
- readonly callback: (code: string) => Effect.Effect<CredentialOAuth, unknown>;
13
- });
14
- export type IntegrationOAuthMethodRegistration = {
15
- readonly integrationID: string;
16
- readonly method: IntegrationOAuthMethod;
17
- readonly authorize: (inputs: IntegrationInputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>;
18
- readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>;
19
- readonly label?: (credential: CredentialOAuth) => string | undefined;
20
- };
21
- export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
22
- readonly integrationID: string;
23
- readonly method: IntegrationKeyMethod;
24
- } | {
25
- readonly integrationID: string;
26
- readonly method: IntegrationEnvMethod;
27
- };
28
- export interface IntegrationDraft {
29
- list(): readonly IntegrationRef[];
30
- get(id: string): IntegrationRef | undefined;
31
- update(id: string, update: (integration: IntegrationRef) => void): void;
32
- remove(id: string): void;
33
- readonly method: {
34
- list(integrationID: string): readonly IntegrationMethod[];
35
- update(input: IntegrationMethodRegistration): void;
36
- remove(integrationID: string, method: IntegrationMethod): void;
37
- };
38
- }
39
- export interface IntegrationHooks extends Hooks<{
40
- transform: IntegrationDraft;
41
- }> {
42
- readonly connection: {
43
- readonly active: (integrationID: string) => Effect.Effect<ConnectionInfo | undefined>;
44
- readonly resolve: (connection: ConnectionInfo) => Effect.Effect<CredentialValue | undefined, unknown>;
45
- };
46
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- export interface Location {
2
- readonly directory: string;
3
- readonly project: {
4
- readonly directory: string;
5
- };
6
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import type { Effect } from "effect";
2
- export interface Npm {
3
- add(pkg: string): Effect.Effect<{
4
- readonly directory: string;
5
- readonly entrypoint?: string;
6
- }, unknown>;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- export interface Path {
2
- readonly home: string;
3
- readonly data: string;
4
- readonly cache: string;
5
- readonly config: string;
6
- readonly state: string;
7
- readonly temp: string;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import type { Effect, Scope } from "effect";
2
- import type { PluginContext } from "./context.js";
3
- export interface Plugin<R = Scope.Scope> {
4
- readonly id: string;
5
- readonly effect: (context: PluginContext) => Effect.Effect<void, never, R>;
6
- }
7
- export declare function define<R = Scope.Scope>(plugin: Plugin<R>): Plugin<R>;
8
- export interface PluginDomain {
9
- readonly add: (plugin: Plugin) => Effect.Effect<void>;
10
- readonly remove: (id: string) => Effect.Effect<void>;
11
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import type { Effect, Scope } from "effect";
2
- export interface Registration {
3
- readonly dispose: Effect.Effect<void>;
4
- }
5
- export interface Reload {
6
- readonly reload: () => Effect.Effect<void>;
7
- }
8
- export type Hooks<Spec> = {
9
- readonly [Name in keyof Spec]: (callback: (input: Spec[Name]) => Effect.Effect<void> | void) => Effect.Effect<Registration, never, Scope.Scope>;
10
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import type { SkillV2Source } from "@opencode-ai/sdk/v2/types";
2
- import type { Hooks } from "./registration.js";
3
- export interface SkillDraft {
4
- source(source: SkillV2Source): void;
5
- list(): readonly SkillV2Source[];
6
- }
7
- export type SkillHooks = Hooks<{
8
- transform: SkillDraft;
9
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { AgentDraft } from "../effect/agent.js";
2
- import type { Hooks } from "./registration.js";
3
- export type { AgentDraft };
4
- export type AgentHooks = Hooks<{
5
- transform: AgentDraft;
6
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { CatalogDraft, CatalogProviderRecord } from "../effect/catalog.js";
2
- import type { Hooks } from "./registration.js";
3
- export type { CatalogDraft, CatalogProviderRecord };
4
- export type CatalogHooks = Hooks<{
5
- transform: CatalogDraft;
6
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- import type { CommandDraft } from "../effect/command.js";
2
- import type { Hooks } from "./registration.js";
3
- export type { CommandDraft };
4
- export type CommandHooks = Hooks<{
5
- transform: CommandDraft;
6
- }>;
@@ -1 +0,0 @@
1
- export {};