@opencode-ai/plugin 0.0.0-next-16232 → 0.0.0-next-16273

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 (106) hide show
  1. package/dist/effect/agent.d.ts +15 -0
  2. package/dist/{v2/effect → effect}/catalog.d.ts +8 -16
  3. package/dist/effect/catalog.js +2 -0
  4. package/dist/{v2/effect → effect}/command.d.ts +1 -1
  5. package/dist/{v2/effect → effect}/integration.d.ts +13 -6
  6. package/dist/effect/integration.js +1 -0
  7. package/dist/{v2/effect → effect}/reference.d.ts +1 -1
  8. package/dist/{v2/effect → effect}/skill.d.ts +3 -3
  9. package/dist/effect/skill.js +1 -0
  10. package/dist/effect/tool.d.ts +37 -0
  11. package/dist/effect/tool.js +1 -0
  12. package/dist/promise/agent.d.ts +15 -0
  13. package/dist/promise/catalog.d.ts +33 -0
  14. package/dist/promise/command.d.ts +13 -0
  15. package/dist/promise/integration.d.ts +57 -0
  16. package/dist/promise/integration.js +1 -0
  17. package/dist/promise/reference.d.ts +12 -0
  18. package/dist/{v2/promise → promise}/skill.d.ts +5 -2
  19. package/dist/promise/tool.d.ts +44 -0
  20. package/dist/promise/tool.js +2 -0
  21. package/dist/promise/types.d.ts +3 -0
  22. package/dist/{v2/tui → tui}/context.d.ts +3 -3
  23. package/package.json +20 -36
  24. package/dist/example-workspace.d.ts +0 -3
  25. package/dist/example-workspace.js +0 -30
  26. package/dist/example.d.ts +0 -2
  27. package/dist/example.js +0 -16
  28. package/dist/v2/effect/agent.d.ts +0 -18
  29. package/dist/v2/effect/filesystem.d.ts +0 -23
  30. package/dist/v2/effect/integration.js +0 -0
  31. package/dist/v2/effect/internal/tool.d.ts +0 -177
  32. package/dist/v2/effect/internal/tool.js +0 -108
  33. package/dist/v2/effect/location.d.ts +0 -6
  34. package/dist/v2/effect/location.js +0 -0
  35. package/dist/v2/effect/npm.d.ts +0 -7
  36. package/dist/v2/effect/npm.js +0 -0
  37. package/dist/v2/effect/path.d.ts +0 -8
  38. package/dist/v2/effect/path.js +0 -0
  39. package/dist/v2/effect/tool.d.ts +0 -2
  40. package/dist/v2/effect/tool.js +0 -2
  41. package/dist/v2/promise/agent.d.ts +0 -10
  42. package/dist/v2/promise/catalog.d.ts +0 -12
  43. package/dist/v2/promise/catalog.js +0 -0
  44. package/dist/v2/promise/command.d.ts +0 -8
  45. package/dist/v2/promise/integration.d.ts +0 -24
  46. package/dist/v2/promise/integration.js +0 -0
  47. package/dist/v2/promise/internal/tool.d.ts +0 -32
  48. package/dist/v2/promise/internal/tool.js +0 -3
  49. package/dist/v2/promise/reference.d.ts +0 -8
  50. package/dist/v2/promise/skill.js +0 -0
  51. package/dist/v2/promise/tool.d.ts +0 -2
  52. package/dist/v2/promise/tool.js +0 -2
  53. /package/dist/{v2/app.d.ts → app.d.ts} +0 -0
  54. /package/dist/{v2/app.js → app.js} +0 -0
  55. /package/dist/{v2/effect → effect}/agent.js +0 -0
  56. /package/dist/{v2/effect → effect}/aisdk.d.ts +0 -0
  57. /package/dist/{v2/effect → effect}/aisdk.js +0 -0
  58. /package/dist/{v2/effect → effect}/command.js +0 -0
  59. /package/dist/{v2/effect → effect}/event.d.ts +0 -0
  60. /package/dist/{v2/effect → effect}/event.js +0 -0
  61. /package/dist/{v2/effect → effect}/index.d.ts +0 -0
  62. /package/dist/{v2/effect → effect}/index.js +0 -0
  63. /package/dist/{v2/effect → effect}/plugin.d.ts +0 -0
  64. /package/dist/{v2/effect → effect}/plugin.js +0 -0
  65. /package/dist/{v2/effect → effect}/reference.js +0 -0
  66. /package/dist/{v2/effect → effect}/registration.d.ts +0 -0
  67. /package/dist/{v2/effect → effect}/registration.js +0 -0
  68. /package/dist/{v2/effect → effect}/session.d.ts +0 -0
  69. /package/dist/{v2/effect → effect}/session.js +0 -0
  70. /package/dist/{v2/effect → effect}/websearch.d.ts +0 -0
  71. /package/dist/{v2/effect → effect}/websearch.js +0 -0
  72. /package/dist/{v2/options.d.ts → options.d.ts} +0 -0
  73. /package/dist/{v2/options.js → options.js} +0 -0
  74. /package/dist/{v2/promise → promise}/agent.js +0 -0
  75. /package/dist/{v2/promise → promise}/aisdk.d.ts +0 -0
  76. /package/dist/{v2/promise → promise}/aisdk.js +0 -0
  77. /package/dist/{v2/effect → promise}/catalog.js +0 -0
  78. /package/dist/{v2/promise → promise}/command.js +0 -0
  79. /package/dist/{v2/promise → promise}/event.d.ts +0 -0
  80. /package/dist/{v2/promise → promise}/event.js +0 -0
  81. /package/dist/{v2/promise → promise}/index.d.ts +0 -0
  82. /package/dist/{v2/promise → promise}/index.js +0 -0
  83. /package/dist/{v2/promise → promise}/plugin.d.ts +0 -0
  84. /package/dist/{v2/promise → promise}/plugin.js +0 -0
  85. /package/dist/{v2/promise → promise}/reference.js +0 -0
  86. /package/dist/{v2/promise → promise}/registration.d.ts +0 -0
  87. /package/dist/{v2/promise → promise}/registration.js +0 -0
  88. /package/dist/{v2/promise → promise}/session.d.ts +0 -0
  89. /package/dist/{v2/promise → promise}/session.js +0 -0
  90. /package/dist/{v2/effect → promise}/skill.js +0 -0
  91. /package/dist/{shell.js → promise/types.js} +0 -0
  92. /package/dist/{v2/promise → promise}/websearch.d.ts +0 -0
  93. /package/dist/{v2/promise → promise}/websearch.js +0 -0
  94. /package/dist/{v2/tui → tui}/context.js +0 -0
  95. /package/dist/{v2/tui → tui}/index.d.ts +0 -0
  96. /package/dist/{v2/tui → tui}/index.js +0 -0
  97. /package/dist/{v2/tui → tui}/plugin.d.ts +0 -0
  98. /package/dist/{v2/tui → tui}/plugin.js +0 -0
  99. /package/dist/{index.d.ts → v1/index.d.ts} +0 -0
  100. /package/dist/{index.js → v1/index.js} +0 -0
  101. /package/dist/{shell.d.ts → v1/shell.d.ts} +0 -0
  102. /package/dist/{v2/effect/filesystem.js → v1/shell.js} +0 -0
  103. /package/dist/{tool.d.ts → v1/tool.d.ts} +0 -0
  104. /package/dist/{tool.js → v1/tool.js} +0 -0
  105. /package/dist/{tui.d.ts → v1/tui.d.ts} +0 -0
  106. /package/dist/{tui.js → v1/tui.js} +0 -0
@@ -0,0 +1,15 @@
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
+ }
@@ -1,25 +1,22 @@
1
- import type { ModelInfo, ProviderV2Info } from "@opencode-ai/sdk/v2/types";
2
1
  import type { CatalogApi } from "@opencode-ai/client/effect/api";
3
- import type { Model } from "@opencode-ai/schema/model";
4
- import type { Effect } from "effect";
2
+ import { Model } from "@opencode-ai/schema/model";
3
+ import { Provider } from "@opencode-ai/schema/provider";
4
+ import type { Effect, Types } from "effect";
5
5
  import type { Transform } from "./registration.js";
6
- type CatalogModel = ModelInfo & {
7
- compatibility?: Model.Compatibility;
8
- };
9
6
  export interface CatalogProviderRecord {
10
- readonly provider: ProviderV2Info;
11
- readonly models: ReadonlyMap<string, CatalogModel>;
7
+ readonly provider: Types.DeepMutable<Provider.Info>;
8
+ readonly models: ReadonlyMap<string, Types.DeepMutable<Model.Info>>;
12
9
  }
13
10
  export interface CatalogDraft {
14
11
  readonly provider: {
15
12
  list(): readonly CatalogProviderRecord[];
16
13
  get(providerID: string): CatalogProviderRecord | undefined;
17
- update(providerID: string, update: (provider: ProviderV2Info) => void): void;
14
+ update(providerID: string, update: (provider: Types.DeepMutable<Provider.Info>) => void): void;
18
15
  remove(providerID: string): void;
19
16
  };
20
17
  readonly model: {
21
- get(providerID: string, modelID: string): CatalogModel | undefined;
22
- update(providerID: string, modelID: string, update: (model: CatalogModel) => void): void;
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;
23
20
  remove(providerID: string, modelID: string): void;
24
21
  readonly default: {
25
22
  get(): {
@@ -31,11 +28,6 @@ export interface CatalogDraft {
31
28
  };
32
29
  }
33
30
  export interface CatalogDomain extends CatalogApi<unknown> {
34
- readonly model: CatalogApi<unknown>["model"] & {
35
- readonly get: (providerID: string, modelID: string) => Effect.Effect<ModelGetOutput | undefined>;
36
- };
37
31
  readonly transform: Transform<CatalogDraft>;
38
32
  readonly reload: () => Effect.Effect<void>;
39
33
  }
40
- type ModelGetOutput = Effect.Success<ReturnType<CatalogApi<unknown>["model"]["list"]>>["data"][number];
41
- export {};
@@ -0,0 +1,2 @@
1
+ import { Model } from "@opencode-ai/schema/model";
2
+ import { Provider } from "@opencode-ai/schema/provider";
@@ -1,5 +1,5 @@
1
- import type { CommandInfo } from "@opencode-ai/sdk/v2/types";
2
1
  import type { CommandApi } from "@opencode-ai/client/effect/api";
2
+ import type { CommandInfo } from "@opencode-ai/client";
3
3
  import type { Effect } from "effect";
4
4
  import type { Transform } from "./registration.js";
5
5
  export interface CommandDraft {
@@ -1,24 +1,30 @@
1
- import type { ConnectionInfo, CredentialOAuth, CredentialValue, IntegrationCommandMethod, IntegrationEnvMethod, IntegrationInputs, IntegrationKeyMethod, IntegrationMethod, IntegrationOAuthMethod, IntegrationRef } from "@opencode-ai/sdk/v2/types";
1
+ import type { ConnectionInfo, IntegrationCommandMethod, IntegrationEnvMethod, IntegrationKeyMethod, IntegrationMethod, IntegrationOAuthMethod } from "@opencode-ai/client";
2
2
  import type { IntegrationApi } from "@opencode-ai/client/effect/api";
3
+ import { Credential } from "@opencode-ai/schema/credential";
3
4
  import type { Effect, Scope } from "effect";
4
5
  import type { Transform } from "./registration.js";
6
+ type IntegrationInputs = Record<string, string>;
7
+ type IntegrationRef = {
8
+ id: string;
9
+ name: string;
10
+ };
5
11
  export type IntegrationOAuthAuthorization = {
6
12
  readonly url: string;
7
13
  readonly instructions: string;
8
14
  readonly expiresAt?: number;
9
15
  } & ({
10
16
  readonly mode: "auto";
11
- readonly callback: Effect.Effect<CredentialOAuth, unknown>;
17
+ readonly callback: Effect.Effect<Credential.OAuth, unknown>;
12
18
  } | {
13
19
  readonly mode: "code";
14
- readonly callback: (code: string) => Effect.Effect<CredentialOAuth, unknown>;
20
+ readonly callback: (code: string) => Effect.Effect<Credential.OAuth, unknown>;
15
21
  });
16
22
  export type IntegrationOAuthMethodRegistration = {
17
23
  readonly integrationID: string;
18
24
  readonly method: IntegrationOAuthMethod;
19
25
  readonly authorize: (inputs: IntegrationInputs) => Effect.Effect<IntegrationOAuthAuthorization, unknown, Scope.Scope>;
20
- readonly refresh?: (credential: CredentialOAuth) => Effect.Effect<CredentialOAuth, unknown>;
21
- readonly label?: (credential: CredentialOAuth) => string | undefined;
26
+ readonly refresh?: (credential: Credential.OAuth) => Effect.Effect<Credential.OAuth, unknown>;
27
+ readonly label?: (credential: Credential.OAuth) => string | undefined;
22
28
  };
23
29
  export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
24
30
  readonly integrationID: string;
@@ -46,6 +52,7 @@ export interface IntegrationDomain extends Omit<IntegrationApi<unknown>, "wellkn
46
52
  readonly reload: () => Effect.Effect<void>;
47
53
  readonly connection: {
48
54
  readonly active: (integrationID: string) => Effect.Effect<ConnectionInfo | undefined>;
49
- readonly resolve: (connection: ConnectionInfo) => Effect.Effect<CredentialValue | undefined, unknown>;
55
+ readonly resolve: (connection: ConnectionInfo) => Effect.Effect<Credential.Value | undefined, unknown>;
50
56
  };
51
57
  }
58
+ export {};
@@ -0,0 +1 @@
1
+ import { Credential } from "@opencode-ai/schema/credential";
@@ -1,4 +1,4 @@
1
- import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/sdk/v2/types";
1
+ import type { ReferenceGitSource, ReferenceLocalSource } from "@opencode-ai/client";
2
2
  import type { ReferenceApi } from "@opencode-ai/client/effect/api";
3
3
  import type { Effect } from "effect";
4
4
  import type { Transform } from "./registration.js";
@@ -1,10 +1,10 @@
1
- import type { SkillSource } from "@opencode-ai/sdk/v2/types";
2
1
  import type { SkillApi } from "@opencode-ai/client/effect/api";
2
+ import { Skill } from "@opencode-ai/schema/skill";
3
3
  import type { Effect } from "effect";
4
4
  import type { Transform } from "./registration.js";
5
5
  export interface SkillDraft {
6
- source(source: SkillSource): void;
7
- list(): readonly SkillSource[];
6
+ source(source: Skill.Source): void;
7
+ list(): readonly Skill.Source[];
8
8
  }
9
9
  export interface SkillDomain extends SkillApi<unknown> {
10
10
  readonly transform: Transform<SkillDraft>;
@@ -0,0 +1 @@
1
+ import { Skill } from "@opencode-ai/schema/skill";
@@ -0,0 +1,37 @@
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
+ 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 callID: 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 callID: 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 ToolDomain {
34
+ readonly transform: Transform<ToolDraft>;
35
+ readonly hook: Hooks<ToolHooks>;
36
+ }
37
+ export {};
@@ -0,0 +1 @@
1
+ import { Tool } from "@opencode-ai/schema/tool";
@@ -0,0 +1,15 @@
1
+ import type { AgentApi } from "@opencode-ai/client/promise/api";
2
+ import type { Agent } from "@opencode-ai/schema/agent";
3
+ import type { Transform } from "./registration.js";
4
+ import type { DeepMutable } from "./types.js";
5
+ export interface AgentDraft {
6
+ list(): readonly DeepMutable<Agent.Info>[];
7
+ get(id: string): DeepMutable<Agent.Info> | undefined;
8
+ default(id: string | undefined): void;
9
+ update(id: string, update: (agent: DeepMutable<Agent.Info>) => void): void;
10
+ remove(id: string): void;
11
+ }
12
+ export interface AgentDomain extends AgentApi {
13
+ readonly transform: Transform<AgentDraft>;
14
+ readonly reload: () => Promise<void>;
15
+ }
@@ -0,0 +1,33 @@
1
+ import type { CatalogApi } from "@opencode-ai/client/promise/api";
2
+ import type { Model } from "@opencode-ai/schema/model";
3
+ import type { Provider } from "@opencode-ai/schema/provider";
4
+ import type { Transform } from "./registration.js";
5
+ import type { DeepMutable } from "./types.js";
6
+ export interface CatalogProviderRecord {
7
+ readonly provider: DeepMutable<Provider.Info>;
8
+ readonly models: ReadonlyMap<string, 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: DeepMutable<Provider.Info>) => void): void;
15
+ remove(providerID: string): void;
16
+ };
17
+ readonly model: {
18
+ get(providerID: string, modelID: string): DeepMutable<Model.Info> | undefined;
19
+ update(providerID: string, modelID: string, update: (model: 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 {
31
+ readonly transform: Transform<CatalogDraft>;
32
+ readonly reload: () => Promise<void>;
33
+ }
@@ -0,0 +1,13 @@
1
+ import type { CommandApi } from "@opencode-ai/client/promise/api";
2
+ import type { CommandInfo } from "@opencode-ai/client";
3
+ import type { Transform } from "./registration.js";
4
+ export interface CommandDraft {
5
+ list(): readonly CommandInfo[];
6
+ get(name: string): CommandInfo | undefined;
7
+ update(name: string, update: (command: CommandInfo) => void): void;
8
+ remove(name: string): void;
9
+ }
10
+ export interface CommandDomain extends CommandApi {
11
+ readonly transform: Transform<CommandDraft>;
12
+ readonly reload: () => Promise<void>;
13
+ }
@@ -0,0 +1,57 @@
1
+ import type { ConnectionInfo, IntegrationCommandMethod, IntegrationEnvMethod, IntegrationKeyMethod, IntegrationMethod, IntegrationOAuthMethod } from "@opencode-ai/client";
2
+ import type { IntegrationApi } from "@opencode-ai/client/promise/api";
3
+ import { Credential } from "@opencode-ai/schema/credential";
4
+ import type { Transform } from "./registration.js";
5
+ type IntegrationInputs = Record<string, string>;
6
+ type IntegrationRef = {
7
+ id: string;
8
+ name: string;
9
+ };
10
+ export type IntegrationOAuthAuthorization = {
11
+ readonly url: string;
12
+ readonly instructions: string;
13
+ readonly expiresAt?: number;
14
+ } & ({
15
+ readonly mode: "auto";
16
+ readonly callback: Promise<Credential.OAuth>;
17
+ } | {
18
+ readonly mode: "code";
19
+ readonly callback: (code: string) => Promise<Credential.OAuth>;
20
+ });
21
+ export type IntegrationOAuthMethodRegistration = {
22
+ readonly integrationID: string;
23
+ readonly method: IntegrationOAuthMethod;
24
+ readonly authorize: (inputs: IntegrationInputs) => Promise<IntegrationOAuthAuthorization>;
25
+ readonly refresh?: (credential: Credential.OAuth) => Promise<Credential.OAuth>;
26
+ readonly label?: (credential: Credential.OAuth) => string | undefined;
27
+ };
28
+ export type IntegrationMethodRegistration = IntegrationOAuthMethodRegistration | {
29
+ readonly integrationID: string;
30
+ readonly method: IntegrationCommandMethod;
31
+ } | {
32
+ readonly integrationID: string;
33
+ readonly method: IntegrationKeyMethod;
34
+ } | {
35
+ readonly integrationID: string;
36
+ readonly method: IntegrationEnvMethod;
37
+ };
38
+ export interface IntegrationDraft {
39
+ list(): readonly IntegrationRef[];
40
+ get(id: string): IntegrationRef | undefined;
41
+ update(id: string, update: (integration: IntegrationRef) => void): void;
42
+ remove(id: string): void;
43
+ readonly method: {
44
+ list(integrationID: string): readonly IntegrationMethod[];
45
+ update(input: IntegrationMethodRegistration): void;
46
+ remove(integrationID: string, method: IntegrationMethod): void;
47
+ };
48
+ }
49
+ export interface IntegrationDomain extends Omit<IntegrationApi, "wellknown"> {
50
+ readonly transform: Transform<IntegrationDraft>;
51
+ readonly reload: () => Promise<void>;
52
+ readonly connection: {
53
+ readonly active: (integrationID: string) => Promise<ConnectionInfo | undefined>;
54
+ readonly resolve: (connection: ConnectionInfo) => Promise<Credential.Value | undefined>;
55
+ };
56
+ }
57
+ export {};
@@ -0,0 +1 @@
1
+ import { Credential } from "@opencode-ai/schema/credential";
@@ -0,0 +1,12 @@
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";
4
+ export interface ReferenceDraft {
5
+ add(name: string, source: ReferenceLocalSource | ReferenceGitSource): void;
6
+ remove(name: string): void;
7
+ list(): readonly (readonly [string, ReferenceLocalSource | ReferenceGitSource])[];
8
+ }
9
+ export interface ReferenceDomain extends ReferenceApi {
10
+ readonly transform: Transform<ReferenceDraft>;
11
+ readonly reload: () => Promise<void>;
12
+ }
@@ -1,7 +1,10 @@
1
1
  import type { SkillApi } from "@opencode-ai/client/promise/api";
2
- import type { SkillDraft } from "../effect/skill.js";
2
+ import type { Skill } from "@opencode-ai/schema/skill";
3
3
  import type { Transform } from "./registration.js";
4
- export type { SkillDraft };
4
+ export interface SkillDraft {
5
+ source(source: Skill.Source): void;
6
+ list(): readonly Skill.Source[];
7
+ }
5
8
  export interface SkillDomain extends SkillApi {
6
9
  readonly transform: Transform<SkillDraft>;
7
10
  readonly reload: () => Promise<void>;
@@ -0,0 +1,44 @@
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 { Hooks, Transform } from "./registration.js";
8
+ export interface ToolContext extends Omit<Tool.Context, "progress"> {
9
+ readonly progress: (update: Tool.Metadata) => Promise<void>;
10
+ }
11
+ 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"> & {
12
+ readonly execute: (input: Parameters<Tool.Info<Input, Output>["execute"]>[0], context: ToolContext) => Promise<Tool.Result<Output>>;
13
+ };
14
+ interface ToolDraft {
15
+ add<Input extends Tool.ValueSchema<any>, Output extends Tool.ValueSchema<any> | undefined>(tool: Info<Input, Output>): void;
16
+ }
17
+ interface ToolHooks {
18
+ readonly "execute.before": {
19
+ readonly tool: string;
20
+ readonly sessionID: Session.ID;
21
+ readonly agent: Agent.ID;
22
+ readonly messageID: SessionMessage.ID;
23
+ readonly callID: Tool.CallID;
24
+ input: unknown;
25
+ };
26
+ readonly "execute.after": {
27
+ readonly tool: string;
28
+ readonly sessionID: Session.ID;
29
+ readonly agent: Agent.ID;
30
+ readonly messageID: SessionMessage.ID;
31
+ readonly callID: Tool.CallID;
32
+ readonly input: unknown;
33
+ } & ({
34
+ readonly status: "completed";
35
+ result: Tool.Result;
36
+ } | {
37
+ readonly status: "error";
38
+ error: Tool.Error;
39
+ });
40
+ }
41
+ export interface ToolDomain {
42
+ readonly transform: Transform<ToolDraft>;
43
+ readonly hook: Hooks<ToolHooks>;
44
+ }
@@ -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;
@@ -1,4 +1,4 @@
1
- import type { AgentInfo, CommandInfo, FormInfo, IntegrationInfo, LocationRef, McpResource, McpServer, ModelInfo, OpenCodeClient, OpenCodeEvent, PermissionSavedInfo, PermissionV2Request, ProviderV2Info, ReferenceInfo, SessionInfo, SessionMessageInfo, SessionPendingInfo, ShellInfo, SkillInfo } from "@opencode-ai/client";
1
+ import type { AgentInfo, CommandInfo, FormInfo, IntegrationInfo, LocationRef, McpResource, McpServer, ModelInfo, OpenCodeClient, OpenCodeEvent, PermissionSavedInfo, PermissionRequest, ProviderInfo, ReferenceInfo, SessionInfo, SessionMessageInfo, SessionPendingInfo, ShellInfo, SkillInfo } from "@opencode-ai/client";
2
2
  import type { KeyEvent, Renderable } from "@opentui/core";
3
3
  import type { JSX } from "@opentui/solid";
4
4
  interface LocationCollection<Value> {
@@ -34,7 +34,7 @@ export interface Data {
34
34
  invalidate(sessionID: string): void;
35
35
  };
36
36
  readonly permission: {
37
- list(sessionID: string): PermissionV2Request[] | undefined;
37
+ list(sessionID: string): PermissionRequest[] | undefined;
38
38
  sync(sessionID: string): Promise<void>;
39
39
  invalidate(sessionID: string): void;
40
40
  };
@@ -71,7 +71,7 @@ export interface Data {
71
71
  readonly resource: LocationCollection<McpResource>;
72
72
  };
73
73
  readonly model: LocationCollection<ModelInfo>;
74
- readonly provider: LocationCollection<ProviderV2Info>;
74
+ readonly provider: LocationCollection<ProviderInfo>;
75
75
  readonly reference: LocationCollection<ReferenceInfo>;
76
76
  readonly skill: LocationCollection<SkillInfo>;
77
77
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/plugin",
4
- "version": "0.0.0-next-16232",
4
+ "version": "0.0.0-next-16273",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -11,40 +11,24 @@
11
11
  },
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./dist/index.js",
15
- "types": "./dist/index.d.ts"
14
+ "import": "./dist/promise/index.js",
15
+ "types": "./dist/promise/index.d.ts"
16
16
  },
17
- "./tool": {
18
- "import": "./dist/tool.js",
19
- "types": "./dist/tool.d.ts"
17
+ "./effect": {
18
+ "import": "./dist/effect/index.js",
19
+ "types": "./dist/effect/index.d.ts"
20
20
  },
21
21
  "./tui": {
22
- "import": "./dist/tui.js",
23
- "types": "./dist/tui.d.ts"
22
+ "import": "./dist/tui/index.js",
23
+ "types": "./dist/tui/index.d.ts"
24
24
  },
25
- "./v2/effect": {
26
- "import": "./dist/v2/effect/index.js",
27
- "types": "./dist/v2/effect/index.d.ts"
25
+ "./v1": {
26
+ "import": "./dist/v1/index.js",
27
+ "types": "./dist/v1/index.d.ts"
28
28
  },
29
- "./v2/effect/*": {
30
- "import": "./dist/v2/effect/*.js",
31
- "types": "./dist/v2/effect/*.d.ts"
32
- },
33
- "./v2/tui": {
34
- "import": "./dist/v2/tui/index.js",
35
- "types": "./dist/v2/tui/index.d.ts"
36
- },
37
- "./v2/tui/*": {
38
- "import": "./dist/v2/tui/*.js",
39
- "types": "./dist/v2/tui/*.d.ts"
40
- },
41
- "./v2": {
42
- "import": "./dist/v2/promise/index.js",
43
- "types": "./dist/v2/promise/index.d.ts"
44
- },
45
- "./v2/*": {
46
- "import": "./dist/v2/promise/*.js",
47
- "types": "./dist/v2/promise/*.d.ts"
29
+ "./*": {
30
+ "import": "./dist/*.js",
31
+ "types": "./dist/*.d.ts"
48
32
  }
49
33
  },
50
34
  "files": [
@@ -52,12 +36,12 @@
52
36
  ],
53
37
  "dependencies": {
54
38
  "@ai-sdk/provider": "3.0.8",
55
- "@opencode-ai/ai": "0.0.0-next-16232",
56
- "@opencode-ai/client": "0.0.0-next-16232",
57
- "@opencode-ai/schema": "0.0.0-next-16232",
58
- "@opencode-ai/sdk": "0.0.0-next-16232",
59
- "@standard-schema/spec": "^1.1.0",
60
- "effect": "4.0.0-beta.98",
39
+ "@opencode-ai/ai": "0.0.0-next-16273",
40
+ "@opencode-ai/client": "0.0.0-next-16273",
41
+ "@opencode-ai/schema": "0.0.0-next-16273",
42
+ "@opencode-ai/sdk": "1.18.5",
43
+ "@standard-schema/spec": "1.1.0",
44
+ "effect": "4.0.0-beta.101",
61
45
  "zod": "4.1.8"
62
46
  },
63
47
  "peerDependencies": {
@@ -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 type { 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
- };
@@ -1,18 +0,0 @@
1
- import type { AgentApi } from "@opencode-ai/client/effect/api";
2
- import type { AgentInfo } from "@opencode-ai/sdk/v2/types";
3
- import type { Effect } from "effect";
4
- import type { Transform } from "./registration.js";
5
- export interface AgentDraft {
6
- list(): readonly AgentInfo[];
7
- get(id: string): AgentInfo | undefined;
8
- default(id: string | undefined): void;
9
- update(id: string, update: (agent: AgentInfo) => void): void;
10
- remove(id: string): void;
11
- }
12
- export interface AgentDomain extends AgentApi<unknown> {
13
- readonly get: (id: string) => Effect.Effect<AgentGetOutput | undefined>;
14
- readonly transform: Transform<AgentDraft>;
15
- readonly reload: () => Effect.Effect<void>;
16
- }
17
- type AgentGetOutput = Effect.Success<ReturnType<AgentApi<unknown>["list"]>>["data"][number];
18
- 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
- }
File without changes