@opencode-ai/plugin 0.0.0-dev-19025 → 0.0.0-dev-202609031800

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 (166) 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.d.ts +322 -0
  6. package/dist/index.js +1 -0
  7. package/dist/shell.d.ts +109 -0
  8. package/dist/shell.js +1 -0
  9. package/dist/tool.d.ts +60 -0
  10. package/dist/tool.js +5 -0
  11. package/dist/tui.d.ts +510 -0
  12. package/dist/tui.js +7 -0
  13. package/dist/v2/effect/agent.d.ts +12 -0
  14. package/dist/v2/effect/agent.js +1 -0
  15. package/dist/{effect → v2/effect}/aisdk.d.ts +6 -9
  16. package/dist/v2/effect/aisdk.js +1 -0
  17. package/dist/v2/effect/catalog.d.ts +29 -0
  18. package/dist/v2/effect/catalog.js +1 -0
  19. package/dist/v2/effect/command.d.ts +11 -0
  20. package/dist/v2/effect/command.js +1 -0
  21. package/dist/v2/effect/context.d.ts +21 -0
  22. package/dist/v2/effect/context.js +1 -0
  23. package/dist/v2/effect/event.d.ts +8 -0
  24. package/dist/v2/effect/event.js +1 -0
  25. package/dist/v2/effect/filesystem.d.ts +23 -0
  26. package/dist/v2/effect/filesystem.js +1 -0
  27. package/dist/v2/effect/index.d.ts +3 -0
  28. package/dist/v2/effect/index.js +1 -0
  29. package/dist/v2/effect/integration.d.ts +46 -0
  30. package/dist/v2/effect/integration.js +1 -0
  31. package/dist/v2/effect/location.d.ts +6 -0
  32. package/dist/v2/effect/location.js +1 -0
  33. package/dist/v2/effect/npm.d.ts +7 -0
  34. package/dist/v2/effect/npm.js +1 -0
  35. package/dist/v2/effect/path.d.ts +8 -0
  36. package/dist/v2/effect/path.js +1 -0
  37. package/dist/v2/effect/plugin.d.ts +11 -0
  38. package/dist/v2/effect/reference.d.ts +10 -0
  39. package/dist/v2/effect/reference.js +1 -0
  40. package/dist/v2/effect/registration.d.ts +10 -0
  41. package/dist/v2/effect/registration.js +1 -0
  42. package/dist/v2/effect/skill.d.ts +9 -0
  43. package/dist/v2/effect/skill.js +1 -0
  44. package/dist/v2/options.js +1 -0
  45. package/dist/v2/promise/agent.d.ts +6 -0
  46. package/dist/v2/promise/agent.js +1 -0
  47. package/dist/{promise → v2/promise}/aisdk.d.ts +6 -9
  48. package/dist/v2/promise/aisdk.js +1 -0
  49. package/dist/v2/promise/catalog.d.ts +6 -0
  50. package/dist/v2/promise/catalog.js +1 -0
  51. package/dist/v2/promise/command.d.ts +6 -0
  52. package/dist/v2/promise/command.js +1 -0
  53. package/dist/v2/promise/context.d.ts +21 -0
  54. package/dist/v2/promise/context.js +1 -0
  55. package/dist/v2/promise/index.d.ts +12 -0
  56. package/dist/v2/promise/index.js +1 -0
  57. package/dist/v2/promise/integration.d.ts +12 -0
  58. package/dist/v2/promise/integration.js +1 -0
  59. package/dist/v2/promise/plugin.d.ts +10 -0
  60. package/dist/v2/promise/reference.d.ts +6 -0
  61. package/dist/v2/promise/reference.js +1 -0
  62. package/dist/v2/promise/registration.d.ts +9 -0
  63. package/dist/v2/promise/registration.js +1 -0
  64. package/dist/v2/promise/skill.d.ts +6 -0
  65. package/dist/v2/promise/skill.js +1 -0
  66. package/package.json +34 -39
  67. package/dist/app.d.ts +0 -5
  68. package/dist/app.js +0 -0
  69. package/dist/effect/agent.d.ts +0 -15
  70. package/dist/effect/agent.js +0 -0
  71. package/dist/effect/aisdk.js +0 -0
  72. package/dist/effect/catalog.d.ts +0 -33
  73. package/dist/effect/catalog.js +0 -2
  74. package/dist/effect/command.d.ts +0 -23
  75. package/dist/effect/command.js +0 -0
  76. package/dist/effect/event.d.ts +0 -3
  77. package/dist/effect/event.js +0 -0
  78. package/dist/effect/index.d.ts +0 -17
  79. package/dist/effect/index.js +0 -16
  80. package/dist/effect/integration.d.ts +0 -80
  81. package/dist/effect/integration.js +0 -2
  82. package/dist/effect/mcp.d.ts +0 -15
  83. package/dist/effect/mcp.js +0 -0
  84. package/dist/effect/permission.d.ts +0 -21
  85. package/dist/effect/permission.js +0 -0
  86. package/dist/effect/plugin.d.ts +0 -54
  87. package/dist/effect/reference.d.ts +0 -14
  88. package/dist/effect/reference.js +0 -0
  89. package/dist/effect/registration.d.ts +0 -13
  90. package/dist/effect/registration.js +0 -0
  91. package/dist/effect/rpc.d.ts +0 -19
  92. package/dist/effect/rpc.js +0 -0
  93. package/dist/effect/session.d.ts +0 -77
  94. package/dist/effect/session.js +0 -0
  95. package/dist/effect/shell.d.ts +0 -14
  96. package/dist/effect/shell.js +0 -0
  97. package/dist/effect/skill.d.ts +0 -15
  98. package/dist/effect/skill.js +0 -1
  99. package/dist/effect/storage.d.ts +0 -8
  100. package/dist/effect/storage.js +0 -0
  101. package/dist/effect/tool.d.ts +0 -52
  102. package/dist/effect/tool.js +0 -1
  103. package/dist/effect/vcs.d.ts +0 -41
  104. package/dist/effect/vcs.js +0 -0
  105. package/dist/effect/websearch.d.ts +0 -20
  106. package/dist/effect/websearch.js +0 -0
  107. package/dist/host.d.ts +0 -12
  108. package/dist/host.js +0 -33
  109. package/dist/options.js +0 -0
  110. package/dist/promise/adapter.d.ts +0 -12
  111. package/dist/promise/adapter.js +0 -424
  112. package/dist/promise/agent.d.ts +0 -15
  113. package/dist/promise/agent.js +0 -0
  114. package/dist/promise/aisdk.js +0 -0
  115. package/dist/promise/catalog.d.ts +0 -33
  116. package/dist/promise/catalog.js +0 -0
  117. package/dist/promise/command.d.ts +0 -22
  118. package/dist/promise/command.js +0 -0
  119. package/dist/promise/event.d.ts +0 -3
  120. package/dist/promise/event.js +0 -0
  121. package/dist/promise/index.d.ts +0 -18
  122. package/dist/promise/index.js +0 -16
  123. package/dist/promise/integration.d.ts +0 -79
  124. package/dist/promise/integration.js +0 -2
  125. package/dist/promise/mcp.d.ts +0 -15
  126. package/dist/promise/mcp.js +0 -0
  127. package/dist/promise/permission.d.ts +0 -21
  128. package/dist/promise/permission.js +0 -0
  129. package/dist/promise/plugin.d.ts +0 -55
  130. package/dist/promise/reference.d.ts +0 -13
  131. package/dist/promise/reference.js +0 -0
  132. package/dist/promise/registration.d.ts +0 -12
  133. package/dist/promise/registration.js +0 -0
  134. package/dist/promise/rpc.d.ts +0 -22
  135. package/dist/promise/rpc.js +0 -0
  136. package/dist/promise/session.d.ts +0 -77
  137. package/dist/promise/session.js +0 -0
  138. package/dist/promise/shell.d.ts +0 -14
  139. package/dist/promise/shell.js +0 -0
  140. package/dist/promise/skill.d.ts +0 -15
  141. package/dist/promise/skill.js +0 -0
  142. package/dist/promise/storage.d.ts +0 -8
  143. package/dist/promise/storage.js +0 -0
  144. package/dist/promise/tool.d.ts +0 -56
  145. package/dist/promise/tool.js +0 -2
  146. package/dist/promise/types.d.ts +0 -3
  147. package/dist/promise/types.js +0 -0
  148. package/dist/promise/vcs.d.ts +0 -50
  149. package/dist/promise/vcs.js +0 -0
  150. package/dist/promise/websearch.d.ts +0 -21
  151. package/dist/promise/websearch.js +0 -0
  152. package/dist/rpc.d.ts +0 -1
  153. package/dist/rpc.js +0 -1
  154. package/dist/storage.d.ts +0 -14
  155. package/dist/storage.js +0 -0
  156. package/dist/tui/context.d.ts +0 -428
  157. package/dist/tui/context.js +0 -0
  158. package/dist/tui/index.d.ts +0 -2
  159. package/dist/tui/index.js +0 -2
  160. package/dist/tui/plugin.d.ts +0 -8
  161. package/dist/tui/plugin.js +0 -3
  162. package/dist/tui/solid.d.ts +0 -7
  163. package/dist/tui/solid.js +0 -16
  164. /package/dist/{effect → v2/effect}/plugin.js +0 -0
  165. /package/dist/{options.d.ts → v2/options.d.ts} +0 -0
  166. /package/dist/{promise → v2/promise}/plugin.js +0 -0
@@ -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 IntegrationEditor {
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<IntegrationEditor>;
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 MCPEditor {
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 Pick<McpApi<unknown>, "list"> {
13
- readonly transform: Transform<MCPEditor>;
14
- readonly reload: () => Effect.Effect<void>;
15
- }
File without changes
@@ -1,21 +0,0 @@
1
- import type { PermissionApi } from "@opencode-ai/client/effect/api";
2
- import type { Agent } from "@opencode-ai/schema/agent";
3
- import type { Permission } from "@opencode-ai/schema/permission";
4
- import type { Session } from "@opencode-ai/schema/session";
5
- import type { Hooks } from "./registration.js";
6
- export interface PermissionEvaluation {
7
- readonly sessionID: Session.ID;
8
- readonly agent?: Agent.ID;
9
- readonly action: string;
10
- readonly resources: ReadonlyArray<string>;
11
- readonly metadata?: Record<string, unknown>;
12
- readonly source?: Permission.Source;
13
- effect: Permission.Effect;
14
- message?: string;
15
- }
16
- export interface PermissionHooks {
17
- readonly evaluate: PermissionEvaluation;
18
- }
19
- export type PermissionDomain = Pick<PermissionApi<unknown>, "list" | "get" | "reply"> & {
20
- readonly hook: Hooks<PermissionHooks>;
21
- };
File without changes
@@ -1,54 +0,0 @@
1
- import type { ExperimentalApi, GenerateApi, PluginApi } from "@opencode-ai/client/effect/api";
2
- import type { Location } from "@opencode-ai/schema/location";
3
- import type { Effect, Scope } from "effect";
4
- import type { PluginOptions } from "../options.js";
5
- import type { App } from "../app.js";
6
- import type { AgentDomain } from "./agent.js";
7
- import type { AISDKDomain } from "./aisdk.js";
8
- import type { CatalogDomain } from "./catalog.js";
9
- import type { CommandDomain } from "./command.js";
10
- import type { EventDomain } from "./event.js";
11
- import type { IntegrationDomain } from "./integration.js";
12
- import type { MCPDomain } from "./mcp.js";
13
- import type { PermissionDomain } from "./permission.js";
14
- import type { ReferenceDomain } from "./reference.js";
15
- import type { RpcDomain } from "./rpc.js";
16
- import type { SessionDomain } from "./session.js";
17
- import type { ShellDomain } from "./shell.js";
18
- import type { SkillDomain } from "./skill.js";
19
- import type { StorageDomain } from "./storage.js";
20
- import type { ToolDomain } from "./tool.js";
21
- import type { VcsDomain } from "./vcs.js";
22
- import type { WebSearchDomain } from "./websearch.js";
23
- export interface Context {
24
- readonly app: App;
25
- readonly location: Location.Info;
26
- readonly options: PluginOptions;
27
- readonly agent: AgentDomain;
28
- readonly aisdk: AISDKDomain;
29
- readonly catalog: CatalogDomain;
30
- readonly command: CommandDomain;
31
- readonly event: EventDomain;
32
- readonly experimental: {
33
- readonly terminal: Pick<ExperimentalApi<unknown>["persistentPty"], "read">;
34
- };
35
- readonly integration: IntegrationDomain;
36
- readonly mcp: MCPDomain;
37
- readonly generate: GenerateApi<unknown>;
38
- readonly permission: PermissionDomain;
39
- readonly plugin: Pick<PluginApi<unknown>, "list">;
40
- readonly reference: ReferenceDomain;
41
- readonly rpc: RpcDomain;
42
- readonly session: SessionDomain;
43
- readonly shell: ShellDomain;
44
- readonly skill: SkillDomain;
45
- readonly storage: StorageDomain;
46
- readonly tool: ToolDomain;
47
- readonly vcs: VcsDomain;
48
- readonly websearch: WebSearchDomain;
49
- }
50
- export interface Plugin<R = Scope.Scope> {
51
- readonly id: string;
52
- readonly effect: (context: Context) => Effect.Effect<void, never, R>;
53
- }
54
- export declare function define<R = Scope.Scope>(plugin: Plugin<R>): Plugin<R>;
@@ -1,14 +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 ReferenceEditor {
6
- add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void;
7
- remove(name: string): void;
8
- list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[];
9
- get(name: string): ReferenceLocalSource | ReferenceGitSource | undefined;
10
- }
11
- export interface ReferenceDomain extends ReferenceApi<unknown> {
12
- readonly transform: Transform<ReferenceEditor>;
13
- readonly reload: () => Effect.Effect<void>;
14
- }
File without changes
@@ -1,13 +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?: Spec[Name] extends {
11
- readonly model: unknown;
12
- } ? ModelHookOptions : never) => Effect.Effect<Registration, never, Scope.Scope>;
13
- export type Transform<Input> = (callback: (input: Input) => void) => Effect.Effect<Registration, never, Scope.Scope>;
File without changes
@@ -1,19 +0,0 @@
1
- import type { RpcApi } from "@opencode-ai/client/effect/api";
2
- export type { RpcClient } from "@opencode-ai/client/effect/api";
3
- import type { Rpc } from "@opencode-ai/schema/rpc";
4
- import type { Effect, Scope } from "effect";
5
- import type { Registration } from "./registration.js";
6
- export interface RpcCallContext<M extends Rpc.Method> {
7
- readonly error: Rpc.ErrorFactory<M>;
8
- }
9
- export type RpcHandlers<D extends Rpc.Definition> = {
10
- readonly [Name in keyof D["methods"]]: (input: Rpc.Output<D["methods"][Name]["input"]>, context: RpcCallContext<D["methods"][Name]>) => Effect.Effect<Rpc.HandlerOutput<D["methods"][Name]["output"]>, Rpc.HandlerError<D["methods"][Name]>>;
11
- };
12
- export interface RpcRegistration<D extends Rpc.Definition> extends Registration {
13
- readonly events: {
14
- readonly emit: (...args: Rpc.EventInput<D>) => Effect.Effect<void, unknown>;
15
- };
16
- }
17
- export interface RpcDomain extends RpcApi<Rpc.SystemError, never, unknown> {
18
- readonly register: <const D extends Rpc.Definition>(definition: D, handlers: RpcHandlers<NoInfer<D>>) => Effect.Effect<RpcRegistration<D>, unknown, Scope.Scope>;
19
- }
File without changes
@@ -1,77 +0,0 @@
1
- import type { SessionApi } from "@opencode-ai/client/effect/api";
2
- import type { GenerationOptionsFields, 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 { PromptInput } from "@opencode-ai/schema/prompt-input";
6
- import type { Session } from "@opencode-ai/schema/session";
7
- import type { SessionInbox } from "@opencode-ai/schema/session-inbox";
8
- import type { SessionError } from "@opencode-ai/schema/session-error";
9
- import type { SessionMessage } from "@opencode-ai/schema/session-message";
10
- import type { JsonSchema, Types } from "effect";
11
- import type { ModelHooks } from "./registration.js";
12
- export interface SessionPrompt {
13
- readonly sessionID: Session.ID;
14
- readonly messageID: SessionMessage.ID;
15
- prompt: Types.DeepMutable<PromptInput.Prompt>;
16
- metadata?: Record<string, unknown>;
17
- delivery: SessionInbox.Delivery;
18
- }
19
- export interface SessionContext {
20
- readonly sessionID: Session.ID;
21
- readonly agent: Agent.ID;
22
- readonly model: Model.Ref;
23
- system: Array<SystemPart>;
24
- messages: Array<Message>;
25
- tools: Record<string, {
26
- description: string;
27
- input: JsonSchema.JsonSchema;
28
- }>;
29
- /** Request overrides; unset fields retain route and model defaults. */
30
- generation: Types.DeepMutable<GenerationOptionsFields>;
31
- providerOptions: Record<string, unknown>;
32
- }
33
- export interface SessionModelRequest {
34
- readonly sessionID: Session.ID;
35
- readonly agent: Agent.ID;
36
- readonly model: Model.Ref;
37
- baseURL?: string;
38
- headers: Record<string, string>;
39
- }
40
- export interface SessionHttpRequest {
41
- readonly sessionID: Session.ID;
42
- readonly agent: Agent.ID;
43
- readonly model: Model.Ref;
44
- request: Request;
45
- }
46
- export interface SessionHttpResponse {
47
- readonly sessionID: Session.ID;
48
- readonly agent: Agent.ID;
49
- readonly model: Model.Ref;
50
- readonly request: Request;
51
- response: Response;
52
- }
53
- export type SessionRetryDecision = {
54
- retry: false;
55
- } | {
56
- retry: true;
57
- delay: number;
58
- };
59
- export interface SessionRetry {
60
- readonly sessionID: Session.ID;
61
- readonly agent: Agent.ID;
62
- readonly model: Model.Ref;
63
- readonly error: SessionError.Error;
64
- readonly attempt: number;
65
- decision: SessionRetryDecision;
66
- }
67
- export interface SessionHooks {
68
- readonly prompt: SessionPrompt;
69
- readonly context: SessionContext;
70
- readonly "model.request": SessionModelRequest;
71
- readonly "http.request": SessionHttpRequest;
72
- readonly "http.response": SessionHttpResponse;
73
- readonly retry: SessionRetry;
74
- }
75
- export type SessionDomain = Pick<SessionApi<unknown>, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "move" | "wait" | "context"> & {
76
- readonly hook: ModelHooks<SessionHooks>;
77
- };
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,15 +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 SkillEditor {
6
- list(): readonly Types.DeepMutable<Skill.Info>[];
7
- get(id: string): Types.DeepMutable<Skill.Info> | undefined;
8
- add(skill: Skill.Info): void;
9
- update(id: string, update: (skill: Types.DeepMutable<Skill.Info>) => void): void;
10
- remove(id: string): void;
11
- }
12
- export interface SkillDomain extends SkillApi<unknown> {
13
- readonly transform: Transform<SkillEditor>;
14
- readonly reload: () => Effect.Effect<void>;
15
- }
@@ -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,52 +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 { Effect, Types } from "effect";
6
- import type { Hooks, Transform } from "./registration.js";
7
- export interface ToolEditor {
8
- list(): readonly (Tool.Info & {
9
- readonly id: string;
10
- })[];
11
- get(id: string): (Tool.Info & {
12
- readonly id: string;
13
- }) | undefined;
14
- namespace(namespace: Tool.Namespace): void;
15
- add<Input extends Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined>(tool: Tool.Info<Input, Output>): void;
16
- /** Updates an existing tool; missing IDs are ignored. */
17
- update(id: string, update: (tool: Types.Mutable<Tool.Info>) => void): void;
18
- remove(id: string): void;
19
- }
20
- export interface ToolHooks {
21
- readonly "execute.before": {
22
- tool: string;
23
- readonly sessionID: Session.ID;
24
- readonly agent: Agent.ID;
25
- readonly messageID: SessionMessage.ID;
26
- readonly id: Tool.CallID;
27
- input: unknown;
28
- };
29
- readonly "execute.after": {
30
- readonly tool: string;
31
- readonly sessionID: Session.ID;
32
- readonly agent: Agent.ID;
33
- readonly messageID: SessionMessage.ID;
34
- readonly id: Tool.CallID;
35
- readonly input: unknown;
36
- } & ({
37
- readonly status: "completed";
38
- result: Tool.Result;
39
- } | {
40
- readonly status: "error";
41
- error: Tool.Error;
42
- });
43
- }
44
- export interface ToolFailures extends Record<keyof ToolHooks, unknown> {
45
- readonly "execute.before": Tool.Error;
46
- readonly "execute.after": never;
47
- }
48
- export interface ToolDomain {
49
- readonly transform: Transform<ToolEditor>;
50
- readonly reload: () => Effect.Effect<void>;
51
- readonly hook: Hooks<ToolHooks, ToolFailures>;
52
- }
@@ -1 +0,0 @@
1
- import { Tool } from "@opencode-ai/schema/tool";
@@ -1,41 +0,0 @@
1
- import type { VcsApi } from "@opencode-ai/client/effect/api";
2
- import type { FileDiff } from "@opencode-ai/schema/file-diff";
3
- import type { Vcs } from "@opencode-ai/schema/vcs";
4
- import type { Effect } from "effect";
5
- import type { Transform } from "./registration.js";
6
- export interface VcsScope {
7
- readonly directory: string;
8
- readonly worktree: string;
9
- readonly canonical: string;
10
- readonly store?: string;
11
- }
12
- export interface VcsBranchesInput extends VcsScope {
13
- readonly search?: string;
14
- readonly limit?: number;
15
- }
16
- export interface VcsDiffInput extends VcsScope {
17
- readonly mode: Vcs.Mode;
18
- readonly base?: string;
19
- readonly context: number;
20
- readonly maxOutputBytes: number;
21
- }
22
- export interface VcsDefinition {
23
- readonly id: string;
24
- readonly name: string;
25
- readonly info: (input: VcsScope) => Effect.Effect<Vcs.Info, unknown>;
26
- readonly base?: (input: VcsScope) => Effect.Effect<Vcs.Base | null, unknown>;
27
- readonly branches: (input: VcsBranchesInput) => Effect.Effect<Vcs.BranchList, unknown>;
28
- readonly status: (input: VcsScope) => Effect.Effect<readonly Vcs.FileStatus[], unknown>;
29
- readonly diff: (input: VcsDiffInput) => Effect.Effect<readonly FileDiff.Info[], unknown>;
30
- }
31
- export interface VcsDomain extends VcsApi<unknown> {
32
- readonly transform: Transform<VcsEditor>;
33
- readonly reload: () => Effect.Effect<void>;
34
- }
35
- export interface VcsEditor {
36
- add(definition: VcsDefinition): void;
37
- readonly default: {
38
- get(): string | undefined;
39
- set(selection: string): void;
40
- };
41
- }
File without changes
@@ -1,20 +0,0 @@
1
- import type { WebSearch } from "@opencode-ai/schema/websearch";
2
- import type { WebSearchApi } from "@opencode-ai/client/effect/api";
3
- import type { Effect } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface WebSearchDefinition {
6
- readonly id: string;
7
- readonly name: string;
8
- readonly execute: (input: WebSearch.ProviderInput) => Effect.Effect<readonly WebSearch.Result[], unknown>;
9
- }
10
- export interface WebSearchDomain extends WebSearchApi<unknown> {
11
- readonly transform: Transform<WebSearchEditor>;
12
- readonly reload: () => Effect.Effect<void>;
13
- }
14
- export interface WebSearchEditor {
15
- add(definition: WebSearchDefinition): void;
16
- readonly default: {
17
- get(): string | false | undefined;
18
- set(selection: string | false): void;
19
- };
20
- }
File without changes
package/dist/host.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export * as Host from "./host.js";
2
- export interface Target {
3
- readonly directory: string;
4
- readonly name?: string;
5
- }
6
- export interface Entrypoints {
7
- readonly server?: string;
8
- readonly tui?: string;
9
- readonly rpc?: string;
10
- }
11
- export declare function resolve(target: Target): Entrypoints;
12
- export declare function load(entrypoint: string): Promise<unknown>;
package/dist/host.js DELETED
@@ -1,33 +0,0 @@
1
- export * as Host from "./host.js";
2
- import path from "node:path";
3
- import { importModule, resolveModule } from "@opencode-ai/util/runtime-import";
4
- export function resolve(target) {
5
- const entry = (subpaths) => {
6
- for (const subpath of subpaths) {
7
- const specifier = target.name
8
- ? [target.name, subpath].filter(Boolean).join("/")
9
- : path.resolve(target.directory, subpath || "index");
10
- try {
11
- return resolveModule(specifier, target.directory);
12
- }
13
- catch (error) {
14
- if (!(error instanceof Error) ||
15
- !("code" in error) ||
16
- ![
17
- "ENOENT",
18
- "ENOTDIR",
19
- "MODULE_NOT_FOUND",
20
- "ERR_MODULE_NOT_FOUND",
21
- "ERR_PACKAGE_PATH_NOT_EXPORTED",
22
- "ERR_UNSUPPORTED_DIR_IMPORT",
23
- ].includes(String(error.code)))
24
- throw error;
25
- }
26
- }
27
- return undefined;
28
- };
29
- return { server: entry(["server", ""]), tui: entry(["tui"]), rpc: entry(["rpc"]) };
30
- }
31
- export function load(entrypoint) {
32
- return importModule(entrypoint);
33
- }
package/dist/options.js DELETED
File without changes
@@ -1,12 +0,0 @@
1
- import type { Scope } from "effect";
2
- import type { Plugin } from "./plugin.js";
3
- /**
4
- * Adapts a Promise plugin into an Effect plugin so the existing Effect-only
5
- * Core plugin runtime can run it unchanged.
6
- *
7
- * Hook registrations created during the async `setup` attach to the plugin's
8
- * scope, so unloading the plugin disposes them. The captured fiber context
9
- * preserves boot-time batching, so Promise-plugin transforms still coalesce
10
- * into one reload per domain.
11
- */
12
- export declare function fromPromise(plugin: Plugin): import("../effect/plugin.js").Plugin<Scope.Scope>;