@opencode-ai/plugin 0.0.0-next-16233 → 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
@@ -1,177 +0,0 @@
1
- import { Agent } from "@opencode-ai/schema/agent";
2
- import { Session } from "@opencode-ai/schema/session";
3
- import { SessionMessage } from "@opencode-ai/schema/session-message";
4
- import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
5
- import { Effect, JsonSchema, Schema } from "effect";
6
- import type { Hooks, Transform } from "../registration.js";
7
- /** A JSON-compatible value. Tool metadata and encoded outputs must be JSON. */
8
- export type JsonValue = typeof Schema.Json.Type;
9
- /** Compact JSON metadata for tool-specific UI and client behavior. */
10
- export type Metadata = Readonly<Record<string, JsonValue>>;
11
- export interface Context {
12
- readonly sessionID: Session.ID;
13
- readonly agent: Agent.ID;
14
- readonly messageID: SessionMessage.ID;
15
- readonly callID: string;
16
- readonly progress: (update: Progress) => Effect.Effect<void>;
17
- }
18
- /** Live replacement metadata for a running tool. */
19
- export type Progress = Metadata;
20
- export type StandardSchemaType<Input = unknown, Output = Input> = StandardSchemaV1<Input, Output> & StandardJSONSchemaV1<Input, Output>;
21
- export type SchemaType<A = unknown> = Schema.Codec<A, any> | StandardSchemaType<any, A> | JsonSchema.JsonSchema;
22
- type IsAny<A> = 0 extends 1 & A ? true : false;
23
- export type InputValue<S> = IsAny<S> extends true ? any : S extends Schema.Codec<infer A, any> ? A : S extends StandardSchemaV1<any, infer A> ? A : unknown;
24
- export type OutputValue<S> = IsAny<S> extends true ? any : S extends Schema.Codec<infer A, any> ? A : S extends StandardSchemaV1<infer A, any> ? A : unknown;
25
- export type EncodedValue<S> = IsAny<S> extends true ? any : S extends Schema.Codec<any, infer A> ? A : S extends StandardSchemaV1<any, infer A> ? A : unknown;
26
- type ToolDefinition = {
27
- readonly name: string;
28
- readonly description: string;
29
- readonly inputSchema: JsonSchema.JsonSchema;
30
- readonly outputSchema?: JsonSchema.JsonSchema;
31
- };
32
- declare const Failure_base: Schema.Class<Failure, Schema.TaggedStruct<"LLM.ToolFailure", {
33
- readonly message: Schema.String;
34
- readonly error: Schema.optional<Schema.Defect>;
35
- }>, import("effect/Cause").YieldableError>;
36
- export declare class Failure extends Failure_base {
37
- }
38
- declare const RegistrationError_base: Schema.Class<RegistrationError, Schema.TaggedStruct<"Tool.RegistrationError", {
39
- readonly name: Schema.String;
40
- readonly message: Schema.String;
41
- }>, import("effect/Cause").YieldableError>;
42
- export declare class RegistrationError extends RegistrationError_base {
43
- }
44
- export type Content = {
45
- readonly type: "text";
46
- readonly text: string;
47
- } | {
48
- readonly type: "file";
49
- readonly data: string;
50
- readonly mime: string;
51
- readonly name?: string;
52
- };
53
- /** Model-facing tool content: plain text or non-empty rich content. */
54
- export type ModelOutput = string | readonly [Content, ...Content[]];
55
- type BaseTool<Input extends SchemaType<any>> = {
56
- readonly description: string;
57
- readonly input: Input;
58
- };
59
- export type Response<Output extends SchemaType<any>> = {
60
- readonly output: OutputValue<Output>;
61
- readonly content?: ModelOutput;
62
- readonly metadata?: Metadata;
63
- };
64
- export type ContentResponse = {
65
- readonly content: ModelOutput;
66
- readonly metadata?: Metadata;
67
- };
68
- export type Tool<Input extends SchemaType<any>, Output extends SchemaType<any> | undefined = undefined> = BaseTool<Input> & (Output extends SchemaType<any> ? {
69
- readonly output: Output;
70
- readonly execute: (input: InputValue<Input>, context: Context) => Effect.Effect<Response<Output>, Failure>;
71
- } : {
72
- readonly output?: undefined;
73
- readonly execute: (input: InputValue<Input>, context: Context) => Effect.Effect<ContentResponse, Failure>;
74
- });
75
- export type Any = BaseTool<any> & {
76
- readonly output?: SchemaType<any>;
77
- readonly execute: (input: any, context: Context) => Effect.Effect<Response<any> | ContentResponse, Failure>;
78
- };
79
- export declare function make<Input extends SchemaType<any>, Output extends SchemaType<any>>(config: Tool<Input, Output>): Tool<Input, Output>;
80
- export declare function make<Input extends SchemaType<any>>(config: Tool<Input>): Tool<Input>;
81
- export declare function make(config: Any): Any;
82
- export interface RegisterOptions {
83
- readonly namespace?: string;
84
- /** Defaults to true. False exposes the tool directly to the provider. */
85
- readonly codemode?: boolean;
86
- /** Permission action used for whole-tool visibility filtering. */
87
- readonly permission?: string;
88
- }
89
- export interface Registration {
90
- readonly tool: Any;
91
- readonly name: string;
92
- readonly namespace?: string;
93
- readonly permission: string;
94
- }
95
- export declare const validateName: (name: string) => Effect.Effect<void, never, never> | Effect.Effect<never, RegistrationError, never>;
96
- export declare const registrationEntries: (tools: Readonly<Record<string, Any>>, options?: RegisterOptions) => Array<Registration & {
97
- readonly key: string;
98
- }>;
99
- export declare const validateNamespace: (namespace: string) => Effect.Effect<void, never, never> | Effect.Effect<never, RegistrationError, never>;
100
- export declare const toLLMDefinition: (name: string, tool: Any) => ToolDefinition;
101
- export declare function decodeInput(schema: SchemaType<any>, value: unknown): Effect.Effect<any, Failure>;
102
- export declare function encodeOutput(schema: SchemaType<any>, value: unknown): Effect.Effect<any, Failure>;
103
- export interface ToolExecuteBeforeEvent {
104
- readonly tool: string;
105
- readonly sessionID: Session.ID;
106
- readonly agent: Agent.ID;
107
- readonly messageID: SessionMessage.ID;
108
- readonly callID: string;
109
- input: unknown;
110
- }
111
- type ToolHookBase = {
112
- readonly tool: string;
113
- readonly sessionID: Session.ID;
114
- readonly agent: Agent.ID;
115
- readonly messageID: SessionMessage.ID;
116
- readonly callID: string;
117
- readonly input: unknown;
118
- };
119
- export declare const ExecuteAfterOutcome: Schema.toTaggedUnion<"status", readonly [Schema.Struct<{
120
- readonly status: Schema.Literal<"completed">;
121
- readonly content: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
122
- readonly type: Schema.Literal<"text">;
123
- readonly text: Schema.String;
124
- }>, Schema.Struct<{
125
- readonly type: Schema.Literal<"file">;
126
- readonly uri: Schema.String;
127
- readonly mime: Schema.String;
128
- readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
129
- }>]>>;
130
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
131
- readonly outputPaths: Schema.optional<Schema.$Array<Schema.String>>;
132
- }>, Schema.Struct<{
133
- readonly status: Schema.Literal<"error">;
134
- readonly error: Schema.Struct<{
135
- readonly type: Schema.String;
136
- readonly message: Schema.String;
137
- }>;
138
- readonly content: Schema.optional<Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
139
- readonly type: Schema.Literal<"text">;
140
- readonly text: Schema.String;
141
- }>, Schema.Struct<{
142
- readonly type: Schema.Literal<"file">;
143
- readonly uri: Schema.String;
144
- readonly mime: Schema.String;
145
- readonly name: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
146
- }>]>>>;
147
- readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
148
- readonly outputPaths: Schema.optional<Schema.$Array<Schema.String>>;
149
- }>]>;
150
- type Mutable<A> = {
151
- -readonly [K in keyof A]: A[K];
152
- };
153
- type HookOutcome<A extends {
154
- readonly status: string;
155
- }> = Omit<Mutable<A>, "status"> & Pick<A, "status">;
156
- /** The bounded terminal outcome exposed to tool hooks. */
157
- export type Outcome = typeof ExecuteAfterOutcome.Type extends infer A ? A extends {
158
- readonly status: string;
159
- } ? HookOutcome<A> : never : never;
160
- /**
161
- * The canonical execution outcome as seen by `execute.after` hooks. Hooks
162
- * observe bounded model content, optional metadata, and managed output paths;
163
- * they never observe the raw domain output.
164
- */
165
- export type ToolExecuteAfterEvent = ToolHookBase & Outcome;
166
- export interface ToolDraft {
167
- add(name: string, tool: Any, options?: RegisterOptions): void;
168
- }
169
- export interface ToolHooks {
170
- readonly "execute.before": ToolExecuteBeforeEvent;
171
- readonly "execute.after": ToolExecuteAfterEvent;
172
- }
173
- export interface ToolDomain {
174
- readonly transform: Transform<ToolDraft>;
175
- readonly hook: Hooks<ToolHooks>;
176
- }
177
- export {};
@@ -1,108 +0,0 @@
1
- import { Agent } from "@opencode-ai/schema/agent";
2
- import { LLM } from "@opencode-ai/schema/llm";
3
- import { Session } from "@opencode-ai/schema/session";
4
- import { SessionError } from "@opencode-ai/schema/session-error";
5
- import { SessionMessage } from "@opencode-ai/schema/session-message";
6
- import { Effect, JsonSchema, Schema } from "effect";
7
- export class Failure extends Schema.TaggedErrorClass()("LLM.ToolFailure", {
8
- message: Schema.String,
9
- error: Schema.optional(Schema.Defect()),
10
- }) {
11
- }
12
- export class RegistrationError extends Schema.TaggedErrorClass()("Tool.RegistrationError", {
13
- name: Schema.String,
14
- message: Schema.String,
15
- }) {
16
- }
17
- export function make(config) {
18
- return config;
19
- }
20
- export const validateName = (name) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(name)
21
- ? Effect.void
22
- : Effect.fail(new RegistrationError({ name, message: `Invalid tool name: ${name}` }));
23
- export const registrationEntries = (tools, options) => Object.entries(tools).map(([name, tool]) => {
24
- const normalized = name.replace(/[^a-zA-Z0-9_-]/g, "_");
25
- const key = options?.namespace === undefined ? normalized : `${options.namespace.replaceAll(".", "_")}_${normalized}`;
26
- return {
27
- key,
28
- name: normalized,
29
- namespace: options?.namespace,
30
- tool,
31
- permission: options?.permission ?? key,
32
- };
33
- });
34
- export const validateNamespace = (namespace) => namespace.split(".").every((segment) => /^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(segment))
35
- ? Effect.void
36
- : Effect.fail(new RegistrationError({ name: namespace, message: `Invalid tool namespace: ${JSON.stringify(namespace)}` }));
37
- export const toLLMDefinition = (name, tool) => ({
38
- name,
39
- description: tool.description,
40
- inputSchema: inputJsonSchema(tool.input),
41
- ...(tool.output === undefined ? {} : { outputSchema: outputJsonSchema(tool.output) }),
42
- });
43
- // Schema interpretation
44
- export function decodeInput(schema, value) {
45
- if (Schema.isSchema(schema))
46
- return Schema.decodeUnknownEffect(schema)(value).pipe(Effect.mapError((error) => new Failure({ message: `Invalid tool input: ${error.message}` })));
47
- if (isStandardSchema(schema))
48
- return validateStandard(schema, value, "Invalid tool input");
49
- return Effect.succeed(value);
50
- }
51
- export function encodeOutput(schema, value) {
52
- if (Schema.isSchema(schema))
53
- return Schema.encodeEffect(schema)(value).pipe(Effect.mapError((error) => new Failure({ message: `Tool returned an invalid value for its output schema: ${error.message}` })));
54
- if (isStandardSchema(schema))
55
- return validateStandard(schema, value, "Tool returned an invalid value for its output schema");
56
- return Schema.decodeUnknownEffect(Schema.Json)(value).pipe(Effect.mapError((error) => new Failure({ message: `Tool returned a non-JSON value for its output schema: ${error.message}` })));
57
- }
58
- function isStandardSchema(schema) {
59
- return "~standard" in schema;
60
- }
61
- function validateStandard(schema, value, prefix) {
62
- return Effect.gen(function* () {
63
- const pending = yield* Effect.try({
64
- try: () => schema["~standard"].validate(value),
65
- catch: (error) => standardFailure(prefix, error),
66
- });
67
- const result = pending instanceof Promise
68
- ? yield* Effect.tryPromise({ try: () => pending, catch: (error) => standardFailure(prefix, error) })
69
- : pending;
70
- if (result.issues)
71
- return yield* Effect.fail(new Failure({ message: `${prefix}: ${result.issues.map((issue) => issue.message).join(", ")}` }));
72
- return result.value;
73
- });
74
- }
75
- function standardFailure(prefix, error) {
76
- return new Failure({ message: `${prefix}: ${error instanceof Error ? error.message : String(error)}` });
77
- }
78
- function inputJsonSchema(schema) {
79
- if (isStandardSchema(schema))
80
- return schema["~standard"].jsonSchema.input({ target: "draft-2020-12" });
81
- return Schema.isSchema(schema) ? toJsonSchema(schema) : schema;
82
- }
83
- function outputJsonSchema(schema) {
84
- if (isStandardSchema(schema))
85
- return schema["~standard"].jsonSchema.output({ target: "draft-2020-12" });
86
- return Schema.isSchema(schema) ? toJsonSchema(schema) : schema;
87
- }
88
- function toJsonSchema(schema) {
89
- const document = Schema.toJsonSchemaDocument(schema);
90
- if (Object.keys(document.definitions).length === 0)
91
- return document.schema;
92
- return { ...document.schema, $defs: document.definitions };
93
- }
94
- export const ExecuteAfterOutcome = Schema.Union([
95
- Schema.Struct({
96
- status: Schema.Literal("completed"),
97
- content: Schema.NonEmptyArray(LLM.ToolContent),
98
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Json)),
99
- outputPaths: Schema.optional(Schema.Array(Schema.String)),
100
- }),
101
- Schema.Struct({
102
- status: Schema.Literal("error"),
103
- error: SessionError.Error,
104
- content: Schema.optional(Schema.NonEmptyArray(LLM.ToolContent)),
105
- metadata: Schema.optional(Schema.Record(Schema.String, Schema.Json)),
106
- outputPaths: Schema.optional(Schema.Array(Schema.String)),
107
- }),
108
- ]).pipe(Schema.toTaggedUnion("status"));
@@ -1,6 +0,0 @@
1
- export interface Location {
2
- readonly directory: string;
3
- readonly project: {
4
- readonly directory: string;
5
- };
6
- }
File without changes
@@ -1,7 +0,0 @@
1
- import type { Effect } from "effect";
2
- export interface Npm {
3
- add(pkg: string): Effect.Effect<{
4
- readonly directory: string;
5
- readonly entrypoint?: string;
6
- }, unknown>;
7
- }
File without changes
@@ -1,8 +0,0 @@
1
- export interface Path {
2
- readonly home: string;
3
- readonly data: string;
4
- readonly cache: string;
5
- readonly config: string;
6
- readonly state: string;
7
- readonly temp: string;
8
- }
File without changes
@@ -1,2 +0,0 @@
1
- export * as Tool from "./internal/tool.js";
2
- export * from "./internal/tool.js";
@@ -1,2 +0,0 @@
1
- export * as Tool from "./internal/tool.js";
2
- export * from "./internal/tool.js";
@@ -1,10 +0,0 @@
1
- import type { AgentApi } from "@opencode-ai/client/promise/api";
2
- import type { AgentDraft } from "../effect/agent.js";
3
- import type { Transform } from "./registration.js";
4
- export type { AgentDraft };
5
- export interface AgentDomain extends AgentApi {
6
- readonly get: (id: string) => Promise<AgentGetOutput | undefined>;
7
- readonly transform: Transform<AgentDraft>;
8
- readonly reload: () => Promise<void>;
9
- }
10
- type AgentGetOutput = Awaited<ReturnType<AgentApi["list"]>>["data"][number];
@@ -1,12 +0,0 @@
1
- import type { CatalogApi } from "@opencode-ai/client/promise/api";
2
- import type { CatalogDraft, CatalogProviderRecord } from "../effect/catalog.js";
3
- import type { Transform } from "./registration.js";
4
- export type { CatalogDraft, CatalogProviderRecord };
5
- export interface CatalogDomain extends CatalogApi {
6
- readonly model: CatalogApi["model"] & {
7
- readonly get: (providerID: string, modelID: string) => Promise<ModelGetOutput | undefined>;
8
- };
9
- readonly transform: Transform<CatalogDraft>;
10
- readonly reload: () => Promise<void>;
11
- }
12
- type ModelGetOutput = Awaited<ReturnType<CatalogApi["model"]["list"]>>["data"][number];
File without changes
@@ -1,8 +0,0 @@
1
- import type { CommandApi } from "@opencode-ai/client/promise/api";
2
- import type { CommandDraft } from "../effect/command.js";
3
- import type { Transform } from "./registration.js";
4
- export type { CommandDraft };
5
- export interface CommandDomain extends CommandApi {
6
- readonly transform: Transform<CommandDraft>;
7
- readonly reload: () => Promise<void>;
8
- }
@@ -1,24 +0,0 @@
1
- import type { IntegrationApi } from "@opencode-ai/client/promise/api";
2
- import type { IntegrationDraft, IntegrationMethodRegistration } from "../effect/integration.js";
3
- import type { CredentialOAuth, CredentialValue } from "@opencode-ai/sdk/v2/types";
4
- import type { Transform } from "./registration.js";
5
- export type { IntegrationDraft, IntegrationMethodRegistration };
6
- export type IntegrationOAuthAuthorization = {
7
- readonly url: string;
8
- readonly instructions: string;
9
- readonly expiresAt?: number;
10
- } & ({
11
- readonly mode: "auto";
12
- readonly callback: Promise<CredentialOAuth>;
13
- } | {
14
- readonly mode: "code";
15
- readonly callback: (code: string) => Promise<CredentialOAuth>;
16
- });
17
- export interface IntegrationDomain extends Omit<IntegrationApi, "wellknown"> {
18
- readonly transform: Transform<IntegrationDraft>;
19
- readonly reload: () => Promise<void>;
20
- readonly connection: {
21
- readonly active: (integrationID: string) => Promise<import("@opencode-ai/sdk/v2/types").ConnectionInfo | undefined>;
22
- readonly resolve: (connection: import("@opencode-ai/sdk/v2/types").ConnectionInfo) => Promise<CredentialValue | undefined>;
23
- };
24
- }
File without changes
@@ -1,32 +0,0 @@
1
- import type { Hooks, Transform } from "../registration.js";
2
- export type Context = Omit<import("../../effect/internal/tool.js").Context, "progress"> & {
3
- readonly progress: (update: import("../../effect/internal/tool.js").Progress) => Promise<void>;
4
- };
5
- export type SchemaType<A> = import("../../effect/internal/tool.js").SchemaType<A>;
6
- export type Content = import("../../effect/internal/tool.js").Content;
7
- export type Metadata = import("../../effect/internal/tool.js").Metadata;
8
- export type ModelOutput = import("../../effect/internal/tool.js").ModelOutput;
9
- export type Tool<Input extends SchemaType<any>, Output extends SchemaType<any> | undefined = undefined> = Omit<import("../../effect/internal/tool.js").Tool<Input, Output>, "execute"> & {
10
- readonly execute: (input: import("../../effect/internal/tool.js").InputValue<Input>, context: Context) => Promise<Output extends SchemaType<any> ? import("../../effect/internal/tool.js").Response<Output> : import("../../effect/internal/tool.js").ContentResponse>;
11
- };
12
- export type Any = Omit<import("../../effect/internal/tool.js").Any, "execute"> & {
13
- readonly execute: (input: any, context: Context) => Promise<import("../../effect/internal/tool.js").Response<any> | import("../../effect/internal/tool.js").ContentResponse>;
14
- };
15
- export declare function make<Input extends SchemaType<any>, Output extends SchemaType<any>>(tool: Tool<Input, Output>): Tool<Input, Output>;
16
- export declare function make<Input extends SchemaType<any>>(tool: Tool<Input>): Tool<Input>;
17
- export declare function make(tool: Any): Any;
18
- export type ToolExecuteBeforeEvent = import("../../effect/internal/tool.js").ToolExecuteBeforeEvent;
19
- export type ToolExecuteAfterEvent = import("../../effect/internal/tool.js").ToolExecuteAfterEvent;
20
- export type RegisterOptions = import("../../effect/internal/tool.js").RegisterOptions;
21
- export interface ToolDraft {
22
- add<Input extends SchemaType<any>, Output extends SchemaType<any>>(name: string, tool: Tool<Input, Output>, options?: RegisterOptions): void;
23
- add<Input extends SchemaType<any>>(name: string, tool: Tool<Input>, options?: RegisterOptions): void;
24
- }
25
- export interface ToolHooks {
26
- readonly "execute.before": ToolExecuteBeforeEvent;
27
- readonly "execute.after": ToolExecuteAfterEvent;
28
- }
29
- export interface ToolDomain {
30
- readonly transform: Transform<ToolDraft>;
31
- readonly hook: Hooks<ToolHooks>;
32
- }
@@ -1,3 +0,0 @@
1
- export function make(tool) {
2
- return tool;
3
- }
@@ -1,8 +0,0 @@
1
- import type { ReferenceApi } from "@opencode-ai/client/promise/api";
2
- import type { ReferenceDraft } from "../effect/reference.js";
3
- import type { Transform } from "./registration.js";
4
- export type { ReferenceDraft };
5
- export interface ReferenceDomain extends ReferenceApi {
6
- readonly transform: Transform<ReferenceDraft>;
7
- readonly reload: () => Promise<void>;
8
- }
File without changes
@@ -1,2 +0,0 @@
1
- export * as Tool from "./internal/tool.js";
2
- export * from "./internal/tool.js";
@@ -1,2 +0,0 @@
1
- export * as Tool from "./internal/tool.js";
2
- export * from "./internal/tool.js";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes