@opencode-ai/plugin 0.0.0-dev-17732 → 0.0.0-dev-202608201547

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/example-workspace.d.ts +3 -0
  2. package/dist/example-workspace.js +30 -0
  3. package/dist/example.d.ts +2 -0
  4. package/dist/example.js +16 -0
  5. package/dist/index.js +1 -0
  6. package/dist/shell.js +1 -0
  7. package/dist/{v1/tui.d.ts → tui.d.ts} +18 -70
  8. package/dist/v2/effect/agent.d.ts +12 -0
  9. package/dist/v2/effect/agent.js +1 -0
  10. package/dist/{effect → v2/effect}/aisdk.d.ts +6 -9
  11. package/dist/v2/effect/aisdk.js +1 -0
  12. package/dist/v2/effect/catalog.d.ts +29 -0
  13. package/dist/v2/effect/catalog.js +1 -0
  14. package/dist/v2/effect/command.d.ts +11 -0
  15. package/dist/v2/effect/command.js +1 -0
  16. package/dist/v2/effect/context.d.ts +21 -0
  17. package/dist/v2/effect/context.js +1 -0
  18. package/dist/v2/effect/event.d.ts +8 -0
  19. package/dist/v2/effect/event.js +1 -0
  20. package/dist/v2/effect/filesystem.d.ts +23 -0
  21. package/dist/v2/effect/filesystem.js +1 -0
  22. package/dist/v2/effect/index.d.ts +3 -0
  23. package/dist/v2/effect/index.js +1 -0
  24. package/dist/v2/effect/integration.d.ts +46 -0
  25. package/dist/v2/effect/integration.js +1 -0
  26. package/dist/v2/effect/location.d.ts +6 -0
  27. package/dist/v2/effect/location.js +1 -0
  28. package/dist/v2/effect/npm.d.ts +7 -0
  29. package/dist/v2/effect/npm.js +1 -0
  30. package/dist/v2/effect/path.d.ts +8 -0
  31. package/dist/v2/effect/path.js +1 -0
  32. package/dist/v2/effect/plugin.d.ts +11 -0
  33. package/dist/{promise → v2/effect}/reference.d.ts +5 -7
  34. package/dist/v2/effect/reference.js +1 -0
  35. package/dist/v2/effect/registration.d.ts +10 -0
  36. package/dist/v2/effect/registration.js +1 -0
  37. package/dist/v2/effect/skill.d.ts +9 -0
  38. package/dist/v2/effect/skill.js +1 -0
  39. package/dist/v2/options.js +1 -0
  40. package/dist/v2/promise/agent.d.ts +6 -0
  41. package/dist/v2/promise/agent.js +1 -0
  42. package/dist/{promise → v2/promise}/aisdk.d.ts +6 -9
  43. package/dist/v2/promise/aisdk.js +1 -0
  44. package/dist/v2/promise/catalog.d.ts +6 -0
  45. package/dist/v2/promise/catalog.js +1 -0
  46. package/dist/v2/promise/command.d.ts +6 -0
  47. package/dist/v2/promise/command.js +1 -0
  48. package/dist/v2/promise/context.d.ts +21 -0
  49. package/dist/v2/promise/context.js +1 -0
  50. package/dist/v2/promise/index.d.ts +12 -0
  51. package/dist/v2/promise/index.js +1 -0
  52. package/dist/v2/promise/integration.d.ts +12 -0
  53. package/dist/v2/promise/integration.js +1 -0
  54. package/dist/v2/promise/plugin.d.ts +10 -0
  55. package/dist/v2/promise/reference.d.ts +6 -0
  56. package/dist/v2/promise/reference.js +1 -0
  57. package/dist/v2/promise/registration.d.ts +9 -0
  58. package/dist/v2/promise/registration.js +1 -0
  59. package/dist/v2/promise/skill.d.ts +6 -0
  60. package/dist/v2/promise/skill.js +1 -0
  61. package/package.json +31 -40
  62. package/dist/app.d.ts +0 -5
  63. package/dist/app.js +0 -0
  64. package/dist/effect/agent.d.ts +0 -15
  65. package/dist/effect/agent.js +0 -0
  66. package/dist/effect/aisdk.js +0 -0
  67. package/dist/effect/catalog.d.ts +0 -33
  68. package/dist/effect/catalog.js +0 -2
  69. package/dist/effect/command.d.ts +0 -14
  70. package/dist/effect/command.js +0 -0
  71. package/dist/effect/event.d.ts +0 -3
  72. package/dist/effect/event.js +0 -0
  73. package/dist/effect/index.d.ts +0 -13
  74. package/dist/effect/index.js +0 -12
  75. package/dist/effect/integration.d.ts +0 -80
  76. package/dist/effect/integration.js +0 -2
  77. package/dist/effect/mcp.d.ts +0 -15
  78. package/dist/effect/mcp.js +0 -0
  79. package/dist/effect/plugin.d.ts +0 -43
  80. package/dist/effect/reference.d.ts +0 -13
  81. package/dist/effect/reference.js +0 -0
  82. package/dist/effect/registration.d.ts +0 -11
  83. package/dist/effect/registration.js +0 -0
  84. package/dist/effect/session.d.ts +0 -47
  85. package/dist/effect/session.js +0 -0
  86. package/dist/effect/shell.d.ts +0 -14
  87. package/dist/effect/shell.js +0 -0
  88. package/dist/effect/skill.d.ts +0 -14
  89. package/dist/effect/skill.js +0 -1
  90. package/dist/effect/storage.d.ts +0 -8
  91. package/dist/effect/storage.js +0 -0
  92. package/dist/effect/tool.d.ts +0 -40
  93. package/dist/effect/tool.js +0 -1
  94. package/dist/effect/websearch.d.ts +0 -20
  95. package/dist/effect/websearch.js +0 -0
  96. package/dist/options.js +0 -0
  97. package/dist/promise/adapter.d.ts +0 -12
  98. package/dist/promise/adapter.js +0 -255
  99. package/dist/promise/agent.d.ts +0 -15
  100. package/dist/promise/agent.js +0 -0
  101. package/dist/promise/aisdk.js +0 -0
  102. package/dist/promise/catalog.d.ts +0 -33
  103. package/dist/promise/catalog.js +0 -0
  104. package/dist/promise/command.d.ts +0 -13
  105. package/dist/promise/command.js +0 -0
  106. package/dist/promise/event.d.ts +0 -3
  107. package/dist/promise/event.js +0 -0
  108. package/dist/promise/index.d.ts +0 -14
  109. package/dist/promise/index.js +0 -12
  110. package/dist/promise/integration.d.ts +0 -79
  111. package/dist/promise/integration.js +0 -2
  112. package/dist/promise/mcp.d.ts +0 -15
  113. package/dist/promise/mcp.js +0 -0
  114. package/dist/promise/plugin.d.ts +0 -43
  115. package/dist/promise/reference.js +0 -0
  116. package/dist/promise/registration.d.ts +0 -10
  117. package/dist/promise/registration.js +0 -0
  118. package/dist/promise/session.d.ts +0 -47
  119. package/dist/promise/session.js +0 -0
  120. package/dist/promise/shell.d.ts +0 -14
  121. package/dist/promise/shell.js +0 -0
  122. package/dist/promise/skill.d.ts +0 -14
  123. package/dist/promise/skill.js +0 -0
  124. package/dist/promise/storage.d.ts +0 -8
  125. package/dist/promise/storage.js +0 -0
  126. package/dist/promise/tool.d.ts +0 -44
  127. package/dist/promise/tool.js +0 -2
  128. package/dist/promise/types.d.ts +0 -3
  129. package/dist/promise/types.js +0 -0
  130. package/dist/promise/websearch.d.ts +0 -21
  131. package/dist/promise/websearch.js +0 -0
  132. package/dist/storage.d.ts +0 -14
  133. package/dist/storage.js +0 -0
  134. package/dist/tui/context.d.ts +0 -421
  135. package/dist/tui/context.js +0 -0
  136. package/dist/tui/index.d.ts +0 -2
  137. package/dist/tui/index.js +0 -2
  138. package/dist/tui/plugin.d.ts +0 -8
  139. package/dist/tui/plugin.js +0 -3
  140. package/dist/tui/solid.d.ts +0 -7
  141. package/dist/tui/solid.js +0 -16
  142. package/dist/v1/index.js +0 -2
  143. package/dist/v1/shell.js +0 -0
  144. /package/dist/{v1/index.d.ts → index.d.ts} +0 -0
  145. /package/dist/{v1/shell.d.ts → shell.d.ts} +0 -0
  146. /package/dist/{v1/tool.d.ts → tool.d.ts} +0 -0
  147. /package/dist/{v1/tool.js → tool.js} +0 -0
  148. /package/dist/{v1/tui.js → tui.js} +0 -0
  149. /package/dist/{effect → v2/effect}/plugin.js +0 -0
  150. /package/dist/{options.d.ts → v2/options.d.ts} +0 -0
  151. /package/dist/{promise → v2/promise}/plugin.js +0 -0
@@ -0,0 +1,12 @@
1
+ import type { IntegrationDraft, IntegrationMethodRegistration } from "../effect/integration.js";
2
+ import type { CredentialValue } from "@opencode-ai/sdk/v2/types";
3
+ import type { Hooks } from "./registration.js";
4
+ export type { IntegrationDraft, IntegrationMethodRegistration };
5
+ export interface IntegrationHooks extends Hooks<{
6
+ transform: IntegrationDraft;
7
+ }> {
8
+ readonly connection: {
9
+ readonly active: (integrationID: string) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>;
10
+ readonly resolve: (connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo) => Promise<CredentialValue | undefined>;
11
+ };
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { PluginContext } from "./context.js";
2
+ export interface Plugin {
3
+ readonly id: string;
4
+ readonly setup: (context: PluginContext) => Promise<void> | void;
5
+ }
6
+ export declare function define(plugin: Plugin): Plugin;
7
+ export interface PluginDomain {
8
+ readonly add: (plugin: Plugin) => Promise<void>;
9
+ readonly remove: (id: string) => Promise<void>;
10
+ }
@@ -0,0 +1,6 @@
1
+ import type { ReferenceDraft } from "../effect/reference.js";
2
+ import type { Hooks } from "./registration.js";
3
+ export type { ReferenceDraft };
4
+ export type ReferenceHooks = Hooks<{
5
+ transform: ReferenceDraft;
6
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface Registration {
2
+ readonly dispose: () => Promise<void>;
3
+ }
4
+ export interface Reload {
5
+ readonly reload: () => Promise<void>;
6
+ }
7
+ export type Hooks<Spec> = {
8
+ readonly [Name in keyof Spec]: (callback: (input: Spec[Name]) => Promise<void> | void) => Promise<Registration>;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { SkillDraft } from "../effect/skill.js";
2
+ import type { Hooks } from "./registration.js";
3
+ export type { SkillDraft };
4
+ export type SkillHooks = Hooks<{
5
+ transform: SkillDraft;
6
+ }>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,34 +1,41 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/plugin",
4
- "version": "0.0.0-dev-17732",
4
+ "version": "0.0.0-dev-202608201547",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
8
- "test": "bun test --timeout 5000",
9
8
  "typecheck": "tsgo --noEmit",
10
- "build": "tsc -p tsconfig.build.json"
9
+ "build": "tsc"
11
10
  },
12
11
  "exports": {
13
12
  ".": {
14
- "import": "./dist/promise/index.js",
15
- "types": "./dist/promise/index.d.ts"
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
16
15
  },
17
- "./effect": {
18
- "import": "./dist/effect/index.js",
19
- "types": "./dist/effect/index.d.ts"
16
+ "./tool": {
17
+ "import": "./dist/tool.js",
18
+ "types": "./dist/tool.d.ts"
20
19
  },
21
20
  "./tui": {
22
- "import": "./dist/tui/index.js",
23
- "types": "./dist/tui/index.d.ts"
21
+ "import": "./dist/tui.js",
22
+ "types": "./dist/tui.d.ts"
24
23
  },
25
- "./v1": {
26
- "import": "./dist/v1/index.js",
27
- "types": "./dist/v1/index.d.ts"
24
+ "./v2/effect": {
25
+ "import": "./dist/v2/effect/index.js",
26
+ "types": "./dist/v2/effect/index.d.ts"
28
27
  },
29
- "./*": {
30
- "import": "./dist/*.js",
31
- "types": "./dist/*.d.ts"
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"
32
39
  }
33
40
  },
34
41
  "files": [
@@ -36,26 +43,16 @@
36
43
  ],
37
44
  "dependencies": {
38
45
  "@ai-sdk/provider": "3.0.8",
39
- "@opencode-ai/ai": "0.0.0-dev-17732",
40
- "@opencode-ai/client": "0.0.0-dev-17732",
41
- "@opencode-ai/protocol": "0.0.0-dev-17732",
42
- "@opencode-ai/schema": "0.0.0-dev-17732",
43
- "@opencode-ai/sdk": "1.18.5",
44
- "@standard-schema/spec": "1.1.0",
45
- "effect": "4.0.0-rc.110",
46
+ "@opencode-ai/sdk": "0.0.0-dev-202608201547",
47
+ "effect": "4.0.0-beta.83",
46
48
  "zod": "4.1.8"
47
49
  },
48
50
  "peerDependencies": {
49
- "@opencode-ai/theme": "0.0.0-dev-17732",
50
- "@opentui/core": ">=0.5.4",
51
- "@opentui/keymap": ">=0.5.4",
52
- "@opentui/solid": ">=0.5.4",
53
- "solid-js": ">=1.9.0"
51
+ "@opentui/core": ">=0.4.5",
52
+ "@opentui/keymap": ">=0.4.5",
53
+ "@opentui/solid": ">=0.4.5"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
- "@opencode-ai/theme": {
57
- "optional": true
58
- },
59
56
  "@opentui/core": {
60
57
  "optional": true
61
58
  },
@@ -64,20 +61,14 @@
64
61
  },
65
62
  "@opentui/solid": {
66
63
  "optional": true
67
- },
68
- "solid-js": {
69
- "optional": true
70
64
  }
71
65
  },
72
66
  "devDependencies": {
73
- "@opencode-ai/theme": "0.0.0-dev-17732",
74
- "@opentui/core": "0.5.4",
75
- "@opentui/keymap": "0.5.4",
76
- "@opentui/solid": "0.5.4",
77
- "@tsconfig/bun": "1.0.9",
67
+ "@opentui/core": "0.4.5",
68
+ "@opentui/keymap": "0.4.5",
69
+ "@opentui/solid": "0.4.5",
78
70
  "@tsconfig/node22": "22.0.2",
79
71
  "@types/node": "24.12.2",
80
- "solid-js": "1.9.10",
81
72
  "typescript": "5.8.2",
82
73
  "@typescript/native-preview": "7.0.0-dev.20251207.1"
83
74
  }
package/dist/app.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export interface App {
2
- readonly name: string;
3
- readonly version: string;
4
- readonly channel: string;
5
- }
package/dist/app.js DELETED
File without changes
@@ -1,15 +0,0 @@
1
- import type { AgentApi } from "@opencode-ai/client/effect/api";
2
- import type { Agent } from "@opencode-ai/schema/agent";
3
- import type { Effect, Types } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface AgentDraft {
6
- list(): readonly Types.DeepMutable<Agent.Info>[];
7
- get(id: string): Types.DeepMutable<Agent.Info> | undefined;
8
- default(id: string | undefined): void;
9
- update(id: string, update: (agent: Types.DeepMutable<Agent.Info>) => void): void;
10
- remove(id: string): void;
11
- }
12
- export interface AgentDomain extends AgentApi<unknown> {
13
- readonly transform: Transform<AgentDraft>;
14
- readonly reload: () => Effect.Effect<void>;
15
- }
File without changes
File without changes
@@ -1,33 +0,0 @@
1
- import type { CatalogApi } from "@opencode-ai/client/effect/api";
2
- import { Model } from "@opencode-ai/schema/model";
3
- import { Provider } from "@opencode-ai/schema/provider";
4
- import type { Effect, Types } from "effect";
5
- import type { Transform } from "./registration.js";
6
- export interface CatalogProviderRecord {
7
- readonly provider: Types.DeepMutable<Provider.Info>;
8
- readonly models: ReadonlyMap<string, Types.DeepMutable<Model.Info>>;
9
- }
10
- export interface CatalogDraft {
11
- readonly provider: {
12
- list(): readonly CatalogProviderRecord[];
13
- get(providerID: string): CatalogProviderRecord | undefined;
14
- update(providerID: string, update: (provider: Types.DeepMutable<Provider.Info>) => void): void;
15
- remove(providerID: string): void;
16
- };
17
- readonly model: {
18
- get(providerID: string, modelID: string): Types.DeepMutable<Model.Info> | undefined;
19
- update(providerID: string, modelID: string, update: (model: Types.DeepMutable<Model.Info>) => void): void;
20
- remove(providerID: string, modelID: string): void;
21
- readonly default: {
22
- get(): {
23
- providerID: string;
24
- modelID: string;
25
- } | undefined;
26
- set(providerID: string, modelID: string): void;
27
- };
28
- };
29
- }
30
- export interface CatalogDomain extends CatalogApi<unknown> {
31
- readonly transform: Transform<CatalogDraft>;
32
- readonly reload: () => Effect.Effect<void>;
33
- }
@@ -1,2 +0,0 @@
1
- import { Model } from "@opencode-ai/schema/model";
2
- import { Provider } from "@opencode-ai/schema/provider";
@@ -1,14 +0,0 @@
1
- import type { CommandApi } from "@opencode-ai/client/effect/api";
2
- import type { CommandInfo } from "@opencode-ai/client";
3
- import type { Effect } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface CommandDraft {
6
- list(): readonly CommandInfo[];
7
- get(name: string): CommandInfo | undefined;
8
- update(name: string, update: (command: CommandInfo) => void): void;
9
- remove(name: string): void;
10
- }
11
- export interface CommandDomain extends CommandApi<unknown> {
12
- readonly transform: Transform<CommandDraft>;
13
- readonly reload: () => Effect.Effect<void>;
14
- }
File without changes
@@ -1,3 +0,0 @@
1
- import type { EventApi } from "@opencode-ai/client/effect/api";
2
- export interface EventDomain extends Pick<EventApi<unknown>, "subscribe"> {
3
- }
File without changes
@@ -1,13 +0,0 @@
1
- export * as Plugin from "./plugin.js";
2
- export type { StorageEntry, StorageScanOptions, StorageScanResult } from "../storage.js";
3
- export { Agent } from "@opencode-ai/schema/agent";
4
- export { Command } from "@opencode-ai/schema/command";
5
- export { Connection } from "@opencode-ai/schema/connection";
6
- export { Credential } from "@opencode-ai/schema/credential";
7
- export { Integration } from "@opencode-ai/schema/integration";
8
- export { Mcp } from "@opencode-ai/schema/mcp";
9
- export { Model } from "@opencode-ai/schema/model";
10
- export { Provider } from "@opencode-ai/schema/provider";
11
- export { Reference } from "@opencode-ai/schema/reference";
12
- export { Skill } from "@opencode-ai/schema/skill";
13
- export { WebSearch } from "@opencode-ai/schema/websearch";
@@ -1,12 +0,0 @@
1
- export * as Plugin from "./plugin.js";
2
- export { Agent } from "@opencode-ai/schema/agent";
3
- export { Command } from "@opencode-ai/schema/command";
4
- export { Connection } from "@opencode-ai/schema/connection";
5
- export { Credential } from "@opencode-ai/schema/credential";
6
- export { Integration } from "@opencode-ai/schema/integration";
7
- export { Mcp } from "@opencode-ai/schema/mcp";
8
- export { Model } from "@opencode-ai/schema/model";
9
- export { Provider } from "@opencode-ai/schema/provider";
10
- export { Reference } from "@opencode-ai/schema/reference";
11
- export { Skill } from "@opencode-ai/schema/skill";
12
- export { WebSearch } from "@opencode-ai/schema/websearch";
@@ -1,80 +0,0 @@
1
- import type { ConnectionInfo } from "@opencode-ai/client";
2
- import type { IntegrationApi } from "@opencode-ai/client/effect/api";
3
- import { Credential } from "@opencode-ai/schema/credential";
4
- import { Form } from "@opencode-ai/schema/form";
5
- import type { Effect, Scope } from "effect";
6
- import type { Transform } from "./registration.js";
7
- type IntegrationRef = {
8
- id: string;
9
- name: string;
10
- };
11
- export interface IntegrationOAuthMethod {
12
- readonly id: string;
13
- readonly type: "oauth";
14
- readonly label: string;
15
- readonly form?: Form.Fields;
16
- }
17
- export interface IntegrationCommandMethod {
18
- readonly id: string;
19
- readonly type: "command";
20
- readonly label: string;
21
- readonly command: ReadonlyArray<string>;
22
- }
23
- export interface IntegrationKeyMethod {
24
- readonly type: "key";
25
- readonly label?: string;
26
- readonly form?: Form.Fields;
27
- }
28
- export interface IntegrationEnvMethod {
29
- readonly type: "env";
30
- readonly names: ReadonlyArray<string>;
31
- }
32
- export type IntegrationMethod = IntegrationOAuthMethod | IntegrationCommandMethod | IntegrationKeyMethod | IntegrationEnvMethod;
33
- export type IntegrationOAuthAuthorization = {
34
- readonly url: string;
35
- readonly instructions: string;
36
- readonly expiresAt?: number;
37
- } & ({
38
- readonly mode: "auto";
39
- readonly callback: Effect.Effect<Credential.OAuth, unknown>;
40
- } | {
41
- readonly mode: "code";
42
- readonly callback: (code: string) => Effect.Effect<Credential.OAuth, unknown>;
43
- });
44
- export type IntegrationOAuthMethodRegistration = {
45
- readonly integrationID: string;
46
- readonly method: IntegrationOAuthMethod;
47
- readonly authorize: (answer: Form.Answer) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>;
48
- readonly refresh?: (credential: Credential.OAuth) => Effect.Effect<Credential.OAuth, unknown>;
49
- readonly label?: (credential: Credential.OAuth) => string | undefined;
50
- };
51
- export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
52
- readonly integrationID: string;
53
- readonly method: IntegrationCommandMethod;
54
- } | {
55
- readonly integrationID: string;
56
- readonly method: IntegrationKeyMethod;
57
- } | {
58
- readonly integrationID: string;
59
- readonly method: IntegrationEnvMethod;
60
- };
61
- export interface IntegrationDraft {
62
- list(): readonly IntegrationRef[];
63
- get(id: string): IntegrationRef | undefined;
64
- update(id: string, update: (integration: IntegrationRef) => void): void;
65
- remove(id: string): void;
66
- readonly method: {
67
- list(integrationID: string): readonly IntegrationMethod[];
68
- update(input: IntegrationMethodRegistration): void;
69
- remove(integrationID: string, method: IntegrationMethod): void;
70
- };
71
- }
72
- export interface IntegrationDomain extends Omit<IntegrationApi<unknown>, "wellknown"> {
73
- readonly transform: Transform<IntegrationDraft>;
74
- readonly reload: () => Effect.Effect<void>;
75
- readonly connection: {
76
- readonly active: (integrationID: string) => Effect.Effect<ConnectionInfo | undefined>;
77
- readonly resolve: (connection: ConnectionInfo) => Effect.Effect<Credential.Value | undefined, unknown>;
78
- };
79
- }
80
- export {};
@@ -1,2 +0,0 @@
1
- import { Credential } from "@opencode-ai/schema/credential";
2
- import { Form } from "@opencode-ai/schema/form";
@@ -1,15 +0,0 @@
1
- import type { McpApi } from "@opencode-ai/client/effect/api";
2
- import type { Mcp } from "@opencode-ai/schema/mcp";
3
- import type { Effect, Types } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface MCPDraft {
6
- list(): readonly [string, Types.DeepMutable<Mcp.ServerConfig>][];
7
- get(name: string): Types.DeepMutable<Mcp.ServerConfig> | undefined;
8
- set(name: string, config: Mcp.ServerConfig): void;
9
- update(name: string, update: (config: Types.DeepMutable<Mcp.ServerConfig>) => void): void;
10
- remove(name: string): void;
11
- }
12
- export interface MCPDomain extends Omit<McpApi<unknown>, "resource"> {
13
- readonly transform: Transform<MCPDraft>;
14
- readonly reload: () => Effect.Effect<void>;
15
- }
File without changes
@@ -1,43 +0,0 @@
1
- import type { PluginApi } from "@opencode-ai/client/effect/api";
2
- import type { Effect, Scope } from "effect";
3
- import type { PluginOptions } from "../options.js";
4
- import type { App } from "../app.js";
5
- import type { AgentDomain } from "./agent.js";
6
- import type { AISDKDomain } from "./aisdk.js";
7
- import type { CatalogDomain } from "./catalog.js";
8
- import type { CommandDomain } from "./command.js";
9
- import type { EventDomain } from "./event.js";
10
- import type { IntegrationDomain } from "./integration.js";
11
- import type { MCPDomain } from "./mcp.js";
12
- import type { ReferenceDomain } from "./reference.js";
13
- import type { SessionDomain } from "./session.js";
14
- import type { ShellDomain } from "./shell.js";
15
- import type { SkillDomain } from "./skill.js";
16
- import type { StorageDomain } from "./storage.js";
17
- import type { ToolDomain } from "./tool.js";
18
- import type { WebSearchDomain } from "./websearch.js";
19
- export interface Context {
20
- readonly app: App;
21
- readonly options: PluginOptions;
22
- readonly agent: AgentDomain;
23
- readonly aisdk: AISDKDomain;
24
- readonly catalog: CatalogDomain;
25
- readonly command: CommandDomain;
26
- readonly event: EventDomain;
27
- readonly integration: IntegrationDomain;
28
- readonly mcp: MCPDomain;
29
- readonly plugin: PluginApi<unknown>;
30
- readonly reference: ReferenceDomain;
31
- readonly session: SessionDomain;
32
- readonly shell: ShellDomain;
33
- readonly skill: SkillDomain;
34
- readonly storage: StorageDomain;
35
- readonly tool: ToolDomain;
36
- readonly websearch: WebSearchDomain;
37
- }
38
- export interface Plugin<R = Scope.Scope> {
39
- readonly id: string;
40
- readonly tui?: boolean;
41
- readonly effect: (context: Context) => Effect.Effect<void, never, R>;
42
- }
43
- export declare function define<R = Scope.Scope>(plugin: Plugin<R>): Plugin<R>;
@@ -1,13 +0,0 @@
1
- import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/client";
2
- import type { ReferenceApi } from "@opencode-ai/client/effect/api";
3
- import type { Effect } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface ReferenceDraft {
6
- add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void;
7
- remove(name: string): void;
8
- list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[];
9
- }
10
- export interface ReferenceDomain extends ReferenceApi<unknown> {
11
- readonly transform: Transform<ReferenceDraft>;
12
- readonly reload: () => Effect.Effect<void>;
13
- }
File without changes
@@ -1,11 +0,0 @@
1
- import type { Effect, Scope } from "effect";
2
- export interface Registration {
3
- readonly dispose: Effect.Effect<void>;
4
- }
5
- export interface ModelHookOptions {
6
- /** Limits the hook to one provider. Unscoped hooks apply to every provider. */
7
- readonly providerID?: string;
8
- }
9
- export type Hooks<Spec, Failures extends Record<keyof Spec, unknown> = Record<keyof Spec, never>> = <Name extends keyof Spec>(name: Name, callback: (input: Spec[Name]) => Effect.Effect<void, Failures[Name]>) => Effect.Effect<Registration, never, Scope.Scope>;
10
- export type ModelHooks<Spec, Failures extends Record<keyof Spec, unknown> = Record<keyof Spec, never>> = <Name extends keyof Spec>(name: Name, callback: (input: Spec[Name]) => Effect.Effect<void, Failures[Name]>, options?: ModelHookOptions) => Effect.Effect<Registration, never, Scope.Scope>;
11
- export type Transform<Input> = (callback: (input: Input) => void) => Effect.Effect<Registration, never, Scope.Scope>;
File without changes
@@ -1,47 +0,0 @@
1
- import type { SessionApi } from "@opencode-ai/client/effect/api";
2
- import type { Message, SystemPart } from "@opencode-ai/ai";
3
- import type { Agent } from "@opencode-ai/schema/agent";
4
- import type { Model } from "@opencode-ai/schema/model";
5
- import type { Session } from "@opencode-ai/schema/session";
6
- import type { JsonSchema } from "effect";
7
- import type { ModelHooks } from "./registration.js";
8
- export interface SessionContext {
9
- readonly sessionID: Session.ID;
10
- readonly agent: Agent.ID;
11
- readonly model: Model.Ref;
12
- system: Array<SystemPart>;
13
- messages: Array<Message>;
14
- tools: Record<string, {
15
- description: string;
16
- input: JsonSchema.JsonSchema;
17
- }>;
18
- }
19
- export interface SessionModelRequest {
20
- readonly sessionID: Session.ID;
21
- readonly agent: Agent.ID;
22
- readonly model: Model.Ref;
23
- baseURL?: string;
24
- headers: Record<string, string>;
25
- }
26
- export interface SessionHttpRequest {
27
- readonly sessionID: Session.ID;
28
- readonly agent: Agent.ID;
29
- readonly model: Model.Ref;
30
- request: Request;
31
- }
32
- export interface SessionHttpResponse {
33
- readonly sessionID: Session.ID;
34
- readonly agent: Agent.ID;
35
- readonly model: Model.Ref;
36
- readonly request: Request;
37
- response: Response;
38
- }
39
- export interface SessionHooks {
40
- readonly context: SessionContext;
41
- readonly "model.request": SessionModelRequest;
42
- readonly "http.request": SessionHttpRequest;
43
- readonly "http.response": SessionHttpResponse;
44
- }
45
- export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "wait"> & {
46
- readonly hook: ModelHooks<SessionHooks>;
47
- };
File without changes
@@ -1,14 +0,0 @@
1
- import type { Hooks } from "./registration.js";
2
- export interface ShellCreateBefore {
3
- command: string;
4
- cwd: string;
5
- timeout: number;
6
- shell: string;
7
- env: Record<string, string | undefined>;
8
- }
9
- export interface ShellHooks {
10
- readonly "create.before": ShellCreateBefore;
11
- }
12
- export interface ShellDomain {
13
- readonly hook: Hooks<ShellHooks>;
14
- }
File without changes
@@ -1,14 +0,0 @@
1
- import type { SkillApi } from "@opencode-ai/client/effect/api";
2
- import { Skill } from "@opencode-ai/schema/skill";
3
- import type { Effect, Types } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface SkillDraft {
6
- list(): readonly Types.DeepMutable<Skill.Info>[];
7
- add(skill: Skill.Info): void;
8
- update(id: string, update: (skill: Types.DeepMutable<Skill.Info>) => void): void;
9
- remove(id: string): void;
10
- }
11
- export interface SkillDomain extends SkillApi<unknown> {
12
- readonly transform: Transform<SkillDraft>;
13
- readonly reload: () => Effect.Effect<void>;
14
- }
@@ -1 +0,0 @@
1
- import { Skill } from "@opencode-ai/schema/skill";
@@ -1,8 +0,0 @@
1
- import type { Effect, Schema } from "effect";
2
- import type { StorageScanOptions, StorageScanResult } from "../storage.js";
3
- export interface StorageDomain {
4
- readonly get: (key: string) => Effect.Effect<Schema.Json | undefined>;
5
- readonly set: (key: string, value: Schema.Json) => Effect.Effect<void>;
6
- readonly remove: (key: string) => Effect.Effect<void>;
7
- readonly scan: (options: StorageScanOptions) => Effect.Effect<StorageScanResult>;
8
- }
File without changes
@@ -1,40 +0,0 @@
1
- import { Tool } from "@opencode-ai/schema/tool";
2
- import type { Agent } from "@opencode-ai/schema/agent";
3
- import type { Session } from "@opencode-ai/schema/session";
4
- import type { SessionMessage } from "@opencode-ai/schema/session-message";
5
- import type { Hooks, Transform } from "./registration.js";
6
- export interface ToolDraft {
7
- add<Input extends Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined>(tool: Tool.Info<Input, Output>): void;
8
- }
9
- export interface ToolHooks {
10
- readonly "execute.before": {
11
- readonly tool: string;
12
- readonly sessionID: Session.ID;
13
- readonly agent: Agent.ID;
14
- readonly messageID: SessionMessage.ID;
15
- readonly id: Tool.CallID;
16
- input: unknown;
17
- };
18
- readonly "execute.after": {
19
- readonly tool: string;
20
- readonly sessionID: Session.ID;
21
- readonly agent: Agent.ID;
22
- readonly messageID: SessionMessage.ID;
23
- readonly id: Tool.CallID;
24
- readonly input: unknown;
25
- } & ({
26
- readonly status: "completed";
27
- result: Tool.Result;
28
- } | {
29
- readonly status: "error";
30
- error: Tool.Error;
31
- });
32
- }
33
- export interface ToolFailures extends Record<keyof ToolHooks, unknown> {
34
- readonly "execute.before": Tool.Error;
35
- readonly "execute.after": never;
36
- }
37
- export interface ToolDomain {
38
- readonly transform: Transform<ToolDraft>;
39
- readonly hook: Hooks<ToolHooks, ToolFailures>;
40
- }
@@ -1 +0,0 @@
1
- import { Tool } from "@opencode-ai/schema/tool";