@opencode-ai/plugin 0.0.0-dev-202608272023 → 0.0.0-dev-18430

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 (159) 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 +23 -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 +15 -0
  14. package/dist/effect/index.js +14 -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/permission.d.ts +21 -0
  20. package/dist/effect/permission.js +0 -0
  21. package/dist/effect/plugin.d.ts +52 -0
  22. package/dist/effect/reference.d.ts +13 -0
  23. package/dist/effect/reference.js +0 -0
  24. package/dist/effect/registration.d.ts +13 -0
  25. package/dist/effect/registration.js +0 -0
  26. package/dist/effect/session.d.ts +61 -0
  27. package/dist/effect/session.js +0 -0
  28. package/dist/effect/shell.d.ts +14 -0
  29. package/dist/effect/shell.js +0 -0
  30. package/dist/effect/skill.d.ts +14 -0
  31. package/dist/effect/skill.js +1 -0
  32. package/dist/effect/storage.d.ts +8 -0
  33. package/dist/effect/storage.js +0 -0
  34. package/dist/effect/tool.d.ts +51 -0
  35. package/dist/effect/tool.js +1 -0
  36. package/dist/effect/vcs.d.ts +39 -0
  37. package/dist/effect/vcs.js +0 -0
  38. package/dist/effect/websearch.d.ts +20 -0
  39. package/dist/effect/websearch.js +0 -0
  40. package/dist/options.js +0 -0
  41. package/dist/promise/adapter.d.ts +12 -0
  42. package/dist/promise/adapter.js +313 -0
  43. package/dist/promise/agent.d.ts +15 -0
  44. package/dist/promise/agent.js +0 -0
  45. package/dist/{v2/effect → promise}/aisdk.d.ts +9 -6
  46. package/dist/promise/aisdk.js +0 -0
  47. package/dist/promise/catalog.d.ts +33 -0
  48. package/dist/promise/catalog.js +0 -0
  49. package/dist/promise/command.d.ts +22 -0
  50. package/dist/promise/command.js +0 -0
  51. package/dist/promise/event.d.ts +3 -0
  52. package/dist/promise/event.js +0 -0
  53. package/dist/promise/index.d.ts +16 -0
  54. package/dist/promise/index.js +14 -0
  55. package/dist/promise/integration.d.ts +79 -0
  56. package/dist/promise/integration.js +2 -0
  57. package/dist/promise/mcp.d.ts +15 -0
  58. package/dist/promise/mcp.js +0 -0
  59. package/dist/promise/permission.d.ts +21 -0
  60. package/dist/promise/permission.js +0 -0
  61. package/dist/promise/plugin.d.ts +52 -0
  62. package/dist/{v2/effect → promise}/reference.d.ts +7 -5
  63. package/dist/promise/reference.js +0 -0
  64. package/dist/promise/registration.d.ts +12 -0
  65. package/dist/promise/registration.js +0 -0
  66. package/dist/promise/session.d.ts +61 -0
  67. package/dist/promise/session.js +0 -0
  68. package/dist/promise/shell.d.ts +14 -0
  69. package/dist/promise/shell.js +0 -0
  70. package/dist/promise/skill.d.ts +14 -0
  71. package/dist/promise/skill.js +0 -0
  72. package/dist/promise/storage.d.ts +8 -0
  73. package/dist/promise/storage.js +0 -0
  74. package/dist/promise/tool.d.ts +55 -0
  75. package/dist/promise/tool.js +2 -0
  76. package/dist/promise/types.d.ts +3 -0
  77. package/dist/promise/types.js +0 -0
  78. package/dist/promise/vcs.d.ts +46 -0
  79. package/dist/promise/vcs.js +0 -0
  80. package/dist/promise/websearch.d.ts +21 -0
  81. package/dist/promise/websearch.js +0 -0
  82. package/dist/storage.d.ts +14 -0
  83. package/dist/storage.js +0 -0
  84. package/dist/tui/context.d.ts +424 -0
  85. package/dist/tui/context.js +0 -0
  86. package/dist/tui/index.d.ts +2 -0
  87. package/dist/tui/index.js +2 -0
  88. package/dist/tui/plugin.d.ts +8 -0
  89. package/dist/tui/plugin.js +3 -0
  90. package/dist/tui/solid.d.ts +7 -0
  91. package/dist/tui/solid.js +16 -0
  92. package/dist/vcs.d.ts +4 -0
  93. package/dist/vcs.js +0 -0
  94. package/package.json +33 -34
  95. package/dist/example-workspace.d.ts +0 -3
  96. package/dist/example-workspace.js +0 -30
  97. package/dist/example.d.ts +0 -2
  98. package/dist/example.js +0 -16
  99. package/dist/index.d.ts +0 -322
  100. package/dist/index.js +0 -1
  101. package/dist/shell.d.ts +0 -109
  102. package/dist/shell.js +0 -1
  103. package/dist/tool.d.ts +0 -60
  104. package/dist/tool.js +0 -5
  105. package/dist/tui.d.ts +0 -510
  106. package/dist/tui.js +0 -7
  107. package/dist/v2/effect/agent.d.ts +0 -12
  108. package/dist/v2/effect/agent.js +0 -1
  109. package/dist/v2/effect/aisdk.js +0 -1
  110. package/dist/v2/effect/catalog.d.ts +0 -29
  111. package/dist/v2/effect/catalog.js +0 -1
  112. package/dist/v2/effect/command.d.ts +0 -11
  113. package/dist/v2/effect/command.js +0 -1
  114. package/dist/v2/effect/context.d.ts +0 -21
  115. package/dist/v2/effect/context.js +0 -1
  116. package/dist/v2/effect/event.d.ts +0 -8
  117. package/dist/v2/effect/event.js +0 -1
  118. package/dist/v2/effect/filesystem.d.ts +0 -23
  119. package/dist/v2/effect/filesystem.js +0 -1
  120. package/dist/v2/effect/index.d.ts +0 -3
  121. package/dist/v2/effect/index.js +0 -1
  122. package/dist/v2/effect/integration.d.ts +0 -46
  123. package/dist/v2/effect/integration.js +0 -1
  124. package/dist/v2/effect/location.d.ts +0 -6
  125. package/dist/v2/effect/location.js +0 -1
  126. package/dist/v2/effect/npm.d.ts +0 -7
  127. package/dist/v2/effect/npm.js +0 -1
  128. package/dist/v2/effect/path.d.ts +0 -8
  129. package/dist/v2/effect/path.js +0 -1
  130. package/dist/v2/effect/plugin.d.ts +0 -11
  131. package/dist/v2/effect/reference.js +0 -1
  132. package/dist/v2/effect/registration.d.ts +0 -10
  133. package/dist/v2/effect/registration.js +0 -1
  134. package/dist/v2/effect/skill.d.ts +0 -9
  135. package/dist/v2/effect/skill.js +0 -1
  136. package/dist/v2/options.js +0 -1
  137. package/dist/v2/promise/agent.d.ts +0 -6
  138. package/dist/v2/promise/agent.js +0 -1
  139. package/dist/v2/promise/aisdk.js +0 -1
  140. package/dist/v2/promise/catalog.d.ts +0 -6
  141. package/dist/v2/promise/catalog.js +0 -1
  142. package/dist/v2/promise/command.d.ts +0 -6
  143. package/dist/v2/promise/command.js +0 -1
  144. package/dist/v2/promise/context.d.ts +0 -21
  145. package/dist/v2/promise/context.js +0 -1
  146. package/dist/v2/promise/index.d.ts +0 -12
  147. package/dist/v2/promise/index.js +0 -1
  148. package/dist/v2/promise/integration.d.ts +0 -12
  149. package/dist/v2/promise/integration.js +0 -1
  150. package/dist/v2/promise/plugin.d.ts +0 -10
  151. package/dist/v2/promise/reference.d.ts +0 -6
  152. package/dist/v2/promise/reference.js +0 -1
  153. package/dist/v2/promise/registration.d.ts +0 -9
  154. package/dist/v2/promise/registration.js +0 -1
  155. package/dist/v2/promise/skill.d.ts +0 -6
  156. package/dist/v2/promise/skill.js +0 -1
  157. /package/dist/{v2/effect → effect}/plugin.js +0 -0
  158. /package/dist/{v2/options.d.ts → options.d.ts} +0 -0
  159. /package/dist/{v2/promise → promise}/plugin.js +0 -0
@@ -1,10 +1,12 @@
1
- import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/sdk/v2/types";
2
- import type { Hooks } from "./registration.js";
1
+ import type { ReferenceApi } from "@opencode-ai/client/promise/api";
2
+ import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/client";
3
+ import type { Transform } from "./registration.js";
3
4
  export interface ReferenceDraft {
4
5
  add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void;
5
6
  remove(name: string): void;
6
7
  list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[];
7
8
  }
8
- export type ReferenceHooks = Hooks<{
9
- transform: ReferenceDraft;
10
- }>;
9
+ export interface ReferenceDomain extends ReferenceApi {
10
+ readonly transform: Transform<ReferenceDraft>;
11
+ readonly reload: () => Promise<void>;
12
+ }
File without changes
@@ -0,0 +1,12 @@
1
+ export interface Registration {
2
+ readonly dispose: () => Promise<void>;
3
+ }
4
+ export interface ModelHookOptions {
5
+ /** Limits the hook to one provider. Unscoped hooks apply to every provider. */
6
+ readonly providerID?: string;
7
+ }
8
+ export type Hooks<Spec> = <Name extends keyof Spec>(name: Name, callback: (input: Spec[Name]) => Promise<void> | void) => Promise<Registration>;
9
+ export type ModelHooks<Spec> = <Name extends keyof Spec>(name: Name, callback: (input: Spec[Name]) => Promise<void> | void, options?: Spec[Name] extends {
10
+ readonly model: unknown;
11
+ } ? ModelHookOptions : never) => Promise<Registration>;
12
+ export type Transform<Input> = (callback: (input: Input) => void) => Promise<Registration>;
File without changes
@@ -0,0 +1,61 @@
1
+ import type { SessionApi } from "@opencode-ai/client/promise/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 { SessionMessage } from "@opencode-ai/schema/session-message";
9
+ import type { JsonSchema, Types } from "effect";
10
+ import type { ModelHooks } from "./registration.js";
11
+ export interface SessionPrompt {
12
+ readonly sessionID: Session.ID;
13
+ readonly messageID: SessionMessage.ID;
14
+ prompt: Types.DeepMutable<PromptInput.Prompt>;
15
+ metadata?: Record<string, unknown>;
16
+ delivery: SessionInbox.Delivery;
17
+ }
18
+ export interface SessionContext {
19
+ readonly sessionID: Session.ID;
20
+ readonly agent: Agent.ID;
21
+ readonly model: Model.Ref;
22
+ system: Array<SystemPart>;
23
+ messages: Array<Message>;
24
+ tools: Record<string, {
25
+ description: string;
26
+ input: JsonSchema.JsonSchema;
27
+ }>;
28
+ /** Request overrides; unset fields retain route and model defaults. */
29
+ generation: Types.DeepMutable<GenerationOptionsFields>;
30
+ providerOptions: Record<string, unknown>;
31
+ }
32
+ export interface SessionModelRequest {
33
+ readonly sessionID: Session.ID;
34
+ readonly agent: Agent.ID;
35
+ readonly model: Model.Ref;
36
+ baseURL?: string;
37
+ headers: Record<string, string>;
38
+ }
39
+ export interface SessionHttpRequest {
40
+ readonly sessionID: Session.ID;
41
+ readonly agent: Agent.ID;
42
+ readonly model: Model.Ref;
43
+ request: Request;
44
+ }
45
+ export interface SessionHttpResponse {
46
+ readonly sessionID: Session.ID;
47
+ readonly agent: Agent.ID;
48
+ readonly model: Model.Ref;
49
+ readonly request: Request;
50
+ response: Response;
51
+ }
52
+ export interface SessionHooks {
53
+ readonly prompt: SessionPrompt;
54
+ readonly context: SessionContext;
55
+ readonly "model.request": SessionModelRequest;
56
+ readonly "http.request": SessionHttpRequest;
57
+ readonly "http.response": SessionHttpResponse;
58
+ }
59
+ export type SessionDomain = Pick<SessionApi, "create" | "get" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "synthetic" | "interrupt" | "rename" | "move" | "wait" | "context"> & {
60
+ readonly hook: ModelHooks<SessionHooks>;
61
+ };
File without changes
@@ -0,0 +1,14 @@
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
@@ -0,0 +1,14 @@
1
+ import type { SkillApi } from "@opencode-ai/client/promise/api";
2
+ import type { Skill } from "@opencode-ai/schema/skill";
3
+ import type { Transform } from "./registration.js";
4
+ import type { DeepMutable } from "./types.js";
5
+ export interface SkillDraft {
6
+ list(): readonly DeepMutable<Skill.Info>[];
7
+ add(skill: Skill.Info): void;
8
+ update(id: string, update: (skill: DeepMutable<Skill.Info>) => void): void;
9
+ remove(id: string): void;
10
+ }
11
+ export interface SkillDomain extends SkillApi {
12
+ readonly transform: Transform<SkillDraft>;
13
+ readonly reload: () => Promise<void>;
14
+ }
File without changes
@@ -0,0 +1,8 @@
1
+ import type { Schema } from "effect";
2
+ import type { StorageScanOptions, StorageScanResult } from "../storage.js";
3
+ export interface StorageDomain {
4
+ readonly get: (key: string) => Promise<Schema.Json | undefined>;
5
+ readonly set: (key: string, value: Schema.Json) => Promise<void>;
6
+ readonly remove: (key: string) => Promise<void>;
7
+ readonly scan: (options: StorageScanOptions) => Promise<StorageScanResult>;
8
+ }
File without changes
@@ -0,0 +1,55 @@
1
+ export { CallID, Error } from "@opencode-ai/schema/tool";
2
+ export type { Metadata, Options, Result } from "@opencode-ai/schema/tool";
3
+ import { Tool } from "@opencode-ai/schema/tool";
4
+ import type { Agent } from "@opencode-ai/schema/agent";
5
+ import type { Session } from "@opencode-ai/schema/session";
6
+ import type { SessionMessage } from "@opencode-ai/schema/session-message";
7
+ import type { Types } from "effect";
8
+ import type { Hooks, Transform } from "./registration.js";
9
+ export interface ToolContext extends Omit<Tool.Context, "progress"> {
10
+ readonly progress: (update: Tool.Metadata) => Promise<void>;
11
+ }
12
+ export type Info<Input extends Tool.ValueSchema<any> = Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined = Tool.ValueSchema<any> | undefined> = Omit<Tool.Info<Input, Output>, "execute"> & {
13
+ readonly execute: (input: Parameters<Tool.Info<Input, Output>["execute"]>[0], context: ToolContext) => Promise<Tool.Result<Output>>;
14
+ };
15
+ interface ToolDraft {
16
+ list(): readonly (Info & {
17
+ readonly id: string;
18
+ })[];
19
+ get(id: string): (Info & {
20
+ readonly id: string;
21
+ }) | undefined;
22
+ add<Input extends Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined>(tool: Info<Input, Output>): void;
23
+ /** Updates an existing tool; missing IDs are ignored. */
24
+ update(id: string, update: (tool: Types.Mutable<Info>) => void): void;
25
+ remove(id: string): void;
26
+ }
27
+ interface ToolHooks {
28
+ readonly "execute.before": {
29
+ tool: string;
30
+ readonly sessionID: Session.ID;
31
+ readonly agent: Agent.ID;
32
+ readonly messageID: SessionMessage.ID;
33
+ readonly id: Tool.CallID;
34
+ input: unknown;
35
+ };
36
+ readonly "execute.after": {
37
+ readonly tool: string;
38
+ readonly sessionID: Session.ID;
39
+ readonly agent: Agent.ID;
40
+ readonly messageID: SessionMessage.ID;
41
+ readonly id: Tool.CallID;
42
+ readonly input: unknown;
43
+ } & ({
44
+ readonly status: "completed";
45
+ result: Tool.Result;
46
+ } | {
47
+ readonly status: "error";
48
+ error: Tool.Error;
49
+ });
50
+ }
51
+ export interface ToolDomain {
52
+ readonly transform: Transform<ToolDraft>;
53
+ readonly reload: () => Promise<void>;
54
+ readonly hook: Hooks<ToolHooks>;
55
+ }
@@ -0,0 +1,2 @@
1
+ export { CallID, Error } from "@opencode-ai/schema/tool";
2
+ import { Tool } from "@opencode-ai/schema/tool";
@@ -0,0 +1,3 @@
1
+ export type DeepMutable<A> = A extends (...args: never[]) => unknown ? A : A extends ReadonlyMap<infer K, infer V> ? Map<DeepMutable<K>, DeepMutable<V>> : A extends ReadonlyArray<infer I> ? DeepMutable<I>[] : A extends object ? {
2
+ -readonly [K in keyof A]: DeepMutable<A[K]>;
3
+ } : A;
File without changes
@@ -0,0 +1,46 @@
1
+ import type { VcsApi } from "@opencode-ai/client/promise/api";
2
+ import type { FileDiff } from "@opencode-ai/schema/file-diff";
3
+ import type { Vcs } from "@opencode-ai/schema/vcs";
4
+ import type { Transform } from "./registration.js";
5
+ export interface VcsScope {
6
+ readonly directory: string;
7
+ readonly worktree: string;
8
+ readonly canonical: string;
9
+ readonly store?: string;
10
+ }
11
+ export interface VcsBranchesInput extends VcsScope {
12
+ readonly search?: string;
13
+ readonly limit?: number;
14
+ }
15
+ export interface VcsDiffInput extends VcsScope {
16
+ readonly mode: Vcs.Mode;
17
+ readonly context: number;
18
+ readonly maxOutputBytes: number;
19
+ }
20
+ export interface VcsDefinition {
21
+ readonly id: string;
22
+ readonly name: string;
23
+ readonly info: (input: VcsScope, context: {
24
+ readonly signal: AbortSignal;
25
+ }) => Promise<Vcs.Info>;
26
+ readonly branches: (input: VcsBranchesInput, context: {
27
+ readonly signal: AbortSignal;
28
+ }) => Promise<Vcs.BranchList>;
29
+ readonly status: (input: VcsScope, context: {
30
+ readonly signal: AbortSignal;
31
+ }) => Promise<readonly Vcs.FileStatus[]>;
32
+ readonly diff: (input: VcsDiffInput, context: {
33
+ readonly signal: AbortSignal;
34
+ }) => Promise<readonly FileDiff.Info[]>;
35
+ }
36
+ export interface VcsDomain extends VcsApi {
37
+ readonly transform: Transform<VcsDraft>;
38
+ readonly reload: () => Promise<void>;
39
+ }
40
+ export interface VcsDraft {
41
+ add(definition: VcsDefinition): void;
42
+ readonly default: {
43
+ get(): string | undefined;
44
+ set(selection: string): void;
45
+ };
46
+ }
File without changes
@@ -0,0 +1,21 @@
1
+ import type { WebSearch } from "@opencode-ai/schema/websearch";
2
+ import type { WebSearchApi } from "@opencode-ai/client/promise/api";
3
+ import type { Transform } from "./registration.js";
4
+ export interface WebSearchDefinition {
5
+ readonly id: string;
6
+ readonly name: string;
7
+ readonly execute: (input: WebSearch.ProviderInput, context: {
8
+ readonly signal: AbortSignal;
9
+ }) => Promise<readonly WebSearch.Result[]>;
10
+ }
11
+ export interface WebSearchDomain extends WebSearchApi {
12
+ readonly transform: Transform<WebSearchDraft>;
13
+ readonly reload: () => Promise<void>;
14
+ }
15
+ export interface WebSearchDraft {
16
+ add(definition: WebSearchDefinition): void;
17
+ readonly default: {
18
+ get(): string | false | undefined;
19
+ set(selection: string | false): void;
20
+ };
21
+ }
File without changes
@@ -0,0 +1,14 @@
1
+ import type { Schema } from "effect";
2
+ export interface StorageEntry {
3
+ readonly key: string;
4
+ readonly value: Schema.Json;
5
+ }
6
+ export interface StorageScanOptions {
7
+ readonly prefix: string;
8
+ readonly after?: string;
9
+ readonly limit?: number;
10
+ }
11
+ export interface StorageScanResult {
12
+ readonly entries: readonly StorageEntry[];
13
+ readonly next?: string;
14
+ }
File without changes