@opencode-ai/protocol 0.0.0-next-14854 → 0.0.0-reserved.0
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.
- package/README.md +3 -0
- package/index.js +1 -0
- package/package.json +3 -23
- package/dist/api.d.ts +0 -49
- package/dist/api.js +0 -65
- package/dist/client.d.ts +0 -75
- package/dist/client.js +0 -61
- package/dist/errors.d.ts +0 -127
- package/dist/errors.js +0 -99
- package/dist/groups/agent.d.ts +0 -95
- package/dist/groups/agent.js +0 -15
- package/dist/groups/command.d.ts +0 -51
- package/dist/groups/command.js +0 -20
- package/dist/groups/credential.d.ts +0 -23
- package/dist/groups/credential.js +0 -28
- package/dist/groups/event.d.ts +0 -17224
- package/dist/groups/event.js +0 -49
- package/dist/groups/form.d.ts +0 -789
- package/dist/groups/form.js +0 -99
- package/dist/groups/fs.d.ts +0 -35
- package/dist/groups/fs.js +0 -51
- package/dist/groups/generate.d.ts +0 -32
- package/dist/groups/generate.js +0 -27
- package/dist/groups/health.d.ts +0 -5
- package/dist/groups/health.js +0 -9
- package/dist/groups/integration.d.ts +0 -105
- package/dist/groups/integration.js +0 -98
- package/dist/groups/location.d.ts +0 -16
- package/dist/groups/location.js +0 -32
- package/dist/groups/mcp.d.ts +0 -30
- package/dist/groups/mcp.js +0 -17
- package/dist/groups/message.d.ts +0 -446
- package/dist/groups/message.js +0 -42
- package/dist/groups/model.d.ts +0 -312
- package/dist/groups/model.js +0 -33
- package/dist/groups/permission.d.ts +0 -153
- package/dist/groups/permission.js +0 -99
- package/dist/groups/plugin.d.ts +0 -14
- package/dist/groups/plugin.js +0 -20
- package/dist/groups/project-copy.d.ts +0 -49
- package/dist/groups/project-copy.js +0 -44
- package/dist/groups/project.d.ts +0 -24
- package/dist/groups/project.js +0 -30
- package/dist/groups/provider.d.ts +0 -164
- package/dist/groups/provider.js +0 -34
- package/dist/groups/pty.d.ts +0 -145
- package/dist/groups/pty.js +0 -111
- package/dist/groups/question.d.ts +0 -92
- package/dist/groups/question.js +0 -56
- package/dist/groups/reference.d.ts +0 -13
- package/dist/groups/reference.js +0 -20
- package/dist/groups/session.d.ts +0 -5457
- package/dist/groups/session.js +0 -423
- package/dist/groups/shell.d.ts +0 -120
- package/dist/groups/shell.js +0 -65
- package/dist/groups/skill.d.ts +0 -19
- package/dist/groups/skill.js +0 -20
- package/dist/groups/vcs.d.ts +0 -33
- package/dist/groups/vcs.js +0 -37
- package/dist/middleware/authorization.d.ts +0 -13
- package/dist/middleware/authorization.js +0 -6
- package/dist/middleware/schema-error.d.ts +0 -13
- package/dist/middleware/schema-error.js +0 -4
package/dist/groups/model.d.ts
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
import { Model } from "@opencode-ai/schema/model";
|
|
2
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
3
|
-
import { Schema } from "effect";
|
|
4
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
5
|
-
import { ServiceUnavailableError } from "../errors.js";
|
|
6
|
-
export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.list", "GET", "/api/model", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
7
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
8
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
9
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
10
|
-
}>>;
|
|
11
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
12
|
-
readonly location: typeof Location.Info;
|
|
13
|
-
readonly data: Schema.$Array<Schema.Struct<{
|
|
14
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
15
|
-
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
16
|
-
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
17
|
-
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
18
|
-
openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
19
|
-
google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
20
|
-
googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
21
|
-
githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
22
|
-
amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
23
|
-
azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
24
|
-
openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
25
|
-
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
26
|
-
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
27
|
-
};
|
|
28
|
-
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Family">>, never, never>;
|
|
29
|
-
readonly name: Schema.String;
|
|
30
|
-
readonly api: Schema.Union<readonly [Schema.Struct<{
|
|
31
|
-
readonly type: Schema.Literal<"aisdk">;
|
|
32
|
-
readonly package: Schema.String;
|
|
33
|
-
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
34
|
-
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
35
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
36
|
-
}>, Schema.Struct<{
|
|
37
|
-
readonly type: Schema.Literal<"native">;
|
|
38
|
-
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
39
|
-
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
40
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
41
|
-
}>]>;
|
|
42
|
-
readonly capabilities: Schema.Struct<{
|
|
43
|
-
readonly tools: Schema.Boolean;
|
|
44
|
-
readonly input: Schema.$Array<Schema.String>;
|
|
45
|
-
readonly output: Schema.$Array<Schema.String>;
|
|
46
|
-
}>;
|
|
47
|
-
readonly request: Schema.Struct<{
|
|
48
|
-
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
49
|
-
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
50
|
-
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
51
|
-
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
52
|
-
}>;
|
|
53
|
-
readonly variants: Schema.$Array<Schema.Struct<{
|
|
54
|
-
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
55
|
-
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
56
|
-
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
57
|
-
readonly id: Schema.brand<Schema.String, "VariantID">;
|
|
58
|
-
}>>;
|
|
59
|
-
readonly time: Schema.Struct<{
|
|
60
|
-
readonly released: Schema.Finite;
|
|
61
|
-
}>;
|
|
62
|
-
readonly cost: Schema.$Array<Schema.Struct<{
|
|
63
|
-
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
64
|
-
readonly type: Schema.Literal<"context">;
|
|
65
|
-
readonly size: Schema.Int;
|
|
66
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
67
|
-
readonly type: Schema.Literal<"context">;
|
|
68
|
-
readonly size: Schema.Int;
|
|
69
|
-
}>>, never, never>;
|
|
70
|
-
readonly input: Schema.Finite;
|
|
71
|
-
readonly output: Schema.Finite;
|
|
72
|
-
readonly cache: Schema.Struct<{
|
|
73
|
-
readonly read: Schema.Finite;
|
|
74
|
-
readonly write: Schema.Finite;
|
|
75
|
-
}>;
|
|
76
|
-
}>>;
|
|
77
|
-
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
78
|
-
readonly enabled: Schema.Boolean;
|
|
79
|
-
readonly limit: Schema.Struct<{
|
|
80
|
-
readonly context: Schema.Int;
|
|
81
|
-
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
82
|
-
readonly output: Schema.Int;
|
|
83
|
-
}>;
|
|
84
|
-
}> & {
|
|
85
|
-
empty: (providerID: import("@opencode-ai/schema/provider").ID, modelID: Model.ID) => {
|
|
86
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
87
|
-
readonly providerID: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
88
|
-
readonly name: string;
|
|
89
|
-
readonly api: {
|
|
90
|
-
readonly type: "aisdk";
|
|
91
|
-
readonly package: string;
|
|
92
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
93
|
-
readonly url?: string | undefined;
|
|
94
|
-
readonly settings?: {
|
|
95
|
-
readonly [x: string]: unknown;
|
|
96
|
-
} | undefined;
|
|
97
|
-
} | {
|
|
98
|
-
readonly type: "native";
|
|
99
|
-
readonly settings: {
|
|
100
|
-
readonly [x: string]: unknown;
|
|
101
|
-
};
|
|
102
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
103
|
-
readonly url?: string | undefined;
|
|
104
|
-
};
|
|
105
|
-
readonly capabilities: {
|
|
106
|
-
readonly tools: boolean;
|
|
107
|
-
readonly input: readonly string[];
|
|
108
|
-
readonly output: readonly string[];
|
|
109
|
-
};
|
|
110
|
-
readonly request: {
|
|
111
|
-
readonly settings: {
|
|
112
|
-
readonly [x: string]: unknown;
|
|
113
|
-
};
|
|
114
|
-
readonly headers: {
|
|
115
|
-
readonly [x: string]: string;
|
|
116
|
-
};
|
|
117
|
-
readonly body: {
|
|
118
|
-
readonly [x: string]: Schema.Json;
|
|
119
|
-
};
|
|
120
|
-
readonly variant?: string | undefined;
|
|
121
|
-
};
|
|
122
|
-
readonly variants: readonly {
|
|
123
|
-
readonly settings: {
|
|
124
|
-
readonly [x: string]: unknown;
|
|
125
|
-
};
|
|
126
|
-
readonly headers: {
|
|
127
|
-
readonly [x: string]: string;
|
|
128
|
-
};
|
|
129
|
-
readonly body: {
|
|
130
|
-
readonly [x: string]: Schema.Json;
|
|
131
|
-
};
|
|
132
|
-
readonly id: string & import("effect/Brand").Brand<"VariantID">;
|
|
133
|
-
}[];
|
|
134
|
-
readonly time: {
|
|
135
|
-
readonly released: number;
|
|
136
|
-
};
|
|
137
|
-
readonly cost: readonly {
|
|
138
|
-
readonly input: number;
|
|
139
|
-
readonly output: number;
|
|
140
|
-
readonly cache: {
|
|
141
|
-
readonly read: number;
|
|
142
|
-
readonly write: number;
|
|
143
|
-
};
|
|
144
|
-
readonly tier?: {
|
|
145
|
-
readonly type: "context";
|
|
146
|
-
readonly size: number;
|
|
147
|
-
} | undefined;
|
|
148
|
-
}[];
|
|
149
|
-
readonly status: "alpha" | "beta" | "deprecated" | "active";
|
|
150
|
-
readonly enabled: boolean;
|
|
151
|
-
readonly limit: {
|
|
152
|
-
readonly context: number;
|
|
153
|
-
readonly output: number;
|
|
154
|
-
readonly input?: number | undefined;
|
|
155
|
-
};
|
|
156
|
-
readonly family?: (string & import("effect/Brand").Brand<"Family">) | undefined;
|
|
157
|
-
};
|
|
158
|
-
}>;
|
|
159
|
-
}>>, HttpApiEndpoint.Json<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
160
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
161
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
162
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
163
|
-
}>>;
|
|
164
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
165
|
-
readonly location: typeof Location.Info;
|
|
166
|
-
readonly data: Schema.UndefinedOr<Schema.Struct<{
|
|
167
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
168
|
-
readonly providerID: Schema.brand<Schema.String, "ProviderV2.ID"> & {
|
|
169
|
-
opencode: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
170
|
-
anthropic: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
171
|
-
openai: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
172
|
-
google: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
173
|
-
googleVertex: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
174
|
-
githubCopilot: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
175
|
-
amazonBedrock: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
176
|
-
azure: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
177
|
-
openrouter: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
178
|
-
mistral: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
179
|
-
gitlab: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
180
|
-
};
|
|
181
|
-
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Family">>, never, never>;
|
|
182
|
-
readonly name: Schema.String;
|
|
183
|
-
readonly api: Schema.Union<readonly [Schema.Struct<{
|
|
184
|
-
readonly type: Schema.Literal<"aisdk">;
|
|
185
|
-
readonly package: Schema.String;
|
|
186
|
-
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
187
|
-
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
188
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
189
|
-
}>, Schema.Struct<{
|
|
190
|
-
readonly type: Schema.Literal<"native">;
|
|
191
|
-
readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
192
|
-
readonly settings: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
193
|
-
readonly id: Schema.brand<Schema.String, "ModelV2.ID">;
|
|
194
|
-
}>]>;
|
|
195
|
-
readonly capabilities: Schema.Struct<{
|
|
196
|
-
readonly tools: Schema.Boolean;
|
|
197
|
-
readonly input: Schema.$Array<Schema.String>;
|
|
198
|
-
readonly output: Schema.$Array<Schema.String>;
|
|
199
|
-
}>;
|
|
200
|
-
readonly request: Schema.Struct<{
|
|
201
|
-
readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
202
|
-
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
203
|
-
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
204
|
-
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
205
|
-
}>;
|
|
206
|
-
readonly variants: Schema.$Array<Schema.Struct<{
|
|
207
|
-
readonly settings: Schema.withConstructorDefault<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
208
|
-
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
209
|
-
readonly body: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
210
|
-
readonly id: Schema.brand<Schema.String, "VariantID">;
|
|
211
|
-
}>>;
|
|
212
|
-
readonly time: Schema.Struct<{
|
|
213
|
-
readonly released: Schema.Finite;
|
|
214
|
-
}>;
|
|
215
|
-
readonly cost: Schema.$Array<Schema.Struct<{
|
|
216
|
-
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
217
|
-
readonly type: Schema.Literal<"context">;
|
|
218
|
-
readonly size: Schema.Int;
|
|
219
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
220
|
-
readonly type: Schema.Literal<"context">;
|
|
221
|
-
readonly size: Schema.Int;
|
|
222
|
-
}>>, never, never>;
|
|
223
|
-
readonly input: Schema.Finite;
|
|
224
|
-
readonly output: Schema.Finite;
|
|
225
|
-
readonly cache: Schema.Struct<{
|
|
226
|
-
readonly read: Schema.Finite;
|
|
227
|
-
readonly write: Schema.Finite;
|
|
228
|
-
}>;
|
|
229
|
-
}>>;
|
|
230
|
-
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
231
|
-
readonly enabled: Schema.Boolean;
|
|
232
|
-
readonly limit: Schema.Struct<{
|
|
233
|
-
readonly context: Schema.Int;
|
|
234
|
-
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
235
|
-
readonly output: Schema.Int;
|
|
236
|
-
}>;
|
|
237
|
-
}> & {
|
|
238
|
-
empty: (providerID: import("@opencode-ai/schema/provider").ID, modelID: Model.ID) => {
|
|
239
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
240
|
-
readonly providerID: string & import("effect/Brand").Brand<"ProviderV2.ID">;
|
|
241
|
-
readonly name: string;
|
|
242
|
-
readonly api: {
|
|
243
|
-
readonly type: "aisdk";
|
|
244
|
-
readonly package: string;
|
|
245
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
246
|
-
readonly url?: string | undefined;
|
|
247
|
-
readonly settings?: {
|
|
248
|
-
readonly [x: string]: unknown;
|
|
249
|
-
} | undefined;
|
|
250
|
-
} | {
|
|
251
|
-
readonly type: "native";
|
|
252
|
-
readonly settings: {
|
|
253
|
-
readonly [x: string]: unknown;
|
|
254
|
-
};
|
|
255
|
-
readonly id: string & import("effect/Brand").Brand<"ModelV2.ID">;
|
|
256
|
-
readonly url?: string | undefined;
|
|
257
|
-
};
|
|
258
|
-
readonly capabilities: {
|
|
259
|
-
readonly tools: boolean;
|
|
260
|
-
readonly input: readonly string[];
|
|
261
|
-
readonly output: readonly string[];
|
|
262
|
-
};
|
|
263
|
-
readonly request: {
|
|
264
|
-
readonly settings: {
|
|
265
|
-
readonly [x: string]: unknown;
|
|
266
|
-
};
|
|
267
|
-
readonly headers: {
|
|
268
|
-
readonly [x: string]: string;
|
|
269
|
-
};
|
|
270
|
-
readonly body: {
|
|
271
|
-
readonly [x: string]: Schema.Json;
|
|
272
|
-
};
|
|
273
|
-
readonly variant?: string | undefined;
|
|
274
|
-
};
|
|
275
|
-
readonly variants: readonly {
|
|
276
|
-
readonly settings: {
|
|
277
|
-
readonly [x: string]: unknown;
|
|
278
|
-
};
|
|
279
|
-
readonly headers: {
|
|
280
|
-
readonly [x: string]: string;
|
|
281
|
-
};
|
|
282
|
-
readonly body: {
|
|
283
|
-
readonly [x: string]: Schema.Json;
|
|
284
|
-
};
|
|
285
|
-
readonly id: string & import("effect/Brand").Brand<"VariantID">;
|
|
286
|
-
}[];
|
|
287
|
-
readonly time: {
|
|
288
|
-
readonly released: number;
|
|
289
|
-
};
|
|
290
|
-
readonly cost: readonly {
|
|
291
|
-
readonly input: number;
|
|
292
|
-
readonly output: number;
|
|
293
|
-
readonly cache: {
|
|
294
|
-
readonly read: number;
|
|
295
|
-
readonly write: number;
|
|
296
|
-
};
|
|
297
|
-
readonly tier?: {
|
|
298
|
-
readonly type: "context";
|
|
299
|
-
readonly size: number;
|
|
300
|
-
} | undefined;
|
|
301
|
-
}[];
|
|
302
|
-
readonly status: "alpha" | "beta" | "deprecated" | "active";
|
|
303
|
-
readonly enabled: boolean;
|
|
304
|
-
readonly limit: {
|
|
305
|
-
readonly context: number;
|
|
306
|
-
readonly output: number;
|
|
307
|
-
readonly input?: number | undefined;
|
|
308
|
-
};
|
|
309
|
-
readonly family?: (string & import("effect/Brand").Brand<"Family">) | undefined;
|
|
310
|
-
};
|
|
311
|
-
}>;
|
|
312
|
-
}>>, HttpApiEndpoint.Json<typeof ServiceUnavailableError>, never, never>, false>;
|
package/dist/groups/model.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Model } from "@opencode-ai/schema/model";
|
|
2
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
3
|
-
import { Schema } from "effect";
|
|
4
|
-
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
-
import { ServiceUnavailableError } from "../errors.js";
|
|
6
|
-
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
|
-
export const ModelGroup = HttpApiGroup.make("server.model")
|
|
8
|
-
.add(HttpApiEndpoint.get("model.list", "/api/model", {
|
|
9
|
-
query: LocationQuery,
|
|
10
|
-
success: Location.response(Schema.Array(Model.Info)),
|
|
11
|
-
error: ServiceUnavailableError,
|
|
12
|
-
})
|
|
13
|
-
.annotateMerge(locationQueryOpenApi)
|
|
14
|
-
.annotateMerge(OpenApi.annotations({
|
|
15
|
-
identifier: "v2.model.list",
|
|
16
|
-
summary: "List models",
|
|
17
|
-
description: "Retrieve available models ordered by release date.",
|
|
18
|
-
})))
|
|
19
|
-
.add(HttpApiEndpoint.get("model.default", "/api/model/default", {
|
|
20
|
-
query: LocationQuery,
|
|
21
|
-
success: Location.response(Schema.UndefinedOr(Model.Info)),
|
|
22
|
-
error: ServiceUnavailableError,
|
|
23
|
-
})
|
|
24
|
-
.annotateMerge(locationQueryOpenApi)
|
|
25
|
-
.annotateMerge(OpenApi.annotations({
|
|
26
|
-
identifier: "v2.model.default",
|
|
27
|
-
summary: "Get default model",
|
|
28
|
-
description: "Retrieve the model used when a session has no explicit model selection.",
|
|
29
|
-
})))
|
|
30
|
-
.annotateMerge(OpenApi.annotations({
|
|
31
|
-
title: "models",
|
|
32
|
-
description: "Experimental model routes.",
|
|
33
|
-
}));
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
2
|
-
import { Context, Schema } from "effect";
|
|
3
|
-
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/unstable/httpapi";
|
|
4
|
-
import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
5
|
-
export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.AnyId, LocationService, SessionLocationId extends HttpApiMiddleware.AnyId, SessionLocationService>(locationMiddleware: Context.Key<LocationId, LocationService>, sessionLocationMiddleware: Context.Key<SessionLocationId, SessionLocationService>) => HttpApiGroup.HttpApiGroup<"server.permission", HttpApiEndpoint.HttpApiEndpoint<"permission.request.list", "GET", "/api/permission/request", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
6
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
7
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
8
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
9
|
-
}>>;
|
|
10
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
11
|
-
readonly location: typeof Location.Info;
|
|
12
|
-
readonly data: Schema.$Array<Schema.Struct<{
|
|
13
|
-
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
14
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
15
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
16
|
-
};
|
|
17
|
-
readonly action: Schema.String;
|
|
18
|
-
readonly resources: Schema.$Array<Schema.String>;
|
|
19
|
-
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
20
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
21
|
-
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
22
|
-
readonly type: Schema.Literal<"tool">;
|
|
23
|
-
readonly messageID: Schema.String;
|
|
24
|
-
readonly callID: Schema.String;
|
|
25
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
26
|
-
readonly type: Schema.Literal<"tool">;
|
|
27
|
-
readonly messageID: Schema.String;
|
|
28
|
-
readonly callID: Schema.String;
|
|
29
|
-
}>]>>, never, never>;
|
|
30
|
-
readonly id: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
31
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
32
|
-
};
|
|
33
|
-
}>>;
|
|
34
|
-
}>>, HttpApiEndpoint.Json<never>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.list", "GET", "/api/permission/saved", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
35
|
-
readonly projectID: Schema.optional<Schema.brand<Schema.String, "Project.ID"> & {
|
|
36
|
-
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
37
|
-
}>;
|
|
38
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
39
|
-
readonly data: Schema.$Array<Schema.Struct<{
|
|
40
|
-
readonly id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
41
|
-
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
42
|
-
};
|
|
43
|
-
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
44
|
-
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
45
|
-
};
|
|
46
|
-
readonly action: Schema.String;
|
|
47
|
-
readonly resource: Schema.String;
|
|
48
|
-
}>>;
|
|
49
|
-
}>>, HttpApiEndpoint.Json<never>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.remove", "DELETE", "/api/permission/saved/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
50
|
-
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
51
|
-
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
52
|
-
};
|
|
53
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<never>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.create", "POST", "/api/session/:sessionID/permission", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
54
|
-
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
55
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
56
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
57
|
-
};
|
|
58
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
59
|
-
readonly id: Schema.optional<Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
60
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
61
|
-
}>;
|
|
62
|
-
readonly action: Schema.String;
|
|
63
|
-
readonly resources: Schema.$Array<Schema.String>;
|
|
64
|
-
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
65
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
66
|
-
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
67
|
-
readonly type: Schema.Literal<"tool">;
|
|
68
|
-
readonly messageID: Schema.String;
|
|
69
|
-
readonly callID: Schema.String;
|
|
70
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
71
|
-
readonly type: Schema.Literal<"tool">;
|
|
72
|
-
readonly messageID: Schema.String;
|
|
73
|
-
readonly callID: Schema.String;
|
|
74
|
-
}>]>>, never, never>;
|
|
75
|
-
readonly agent: Schema.optional<Schema.brand<Schema.String, "AgentV2.ID">>;
|
|
76
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
77
|
-
readonly data: Schema.Struct<{
|
|
78
|
-
readonly id: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
79
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
80
|
-
};
|
|
81
|
-
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
82
|
-
}>;
|
|
83
|
-
}>>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.list", "GET", "/api/session/:sessionID/permission", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
84
|
-
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
85
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
86
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
87
|
-
};
|
|
88
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
89
|
-
readonly data: Schema.$Array<Schema.Struct<{
|
|
90
|
-
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
91
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
92
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
93
|
-
};
|
|
94
|
-
readonly action: Schema.String;
|
|
95
|
-
readonly resources: Schema.$Array<Schema.String>;
|
|
96
|
-
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
97
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
98
|
-
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
99
|
-
readonly type: Schema.Literal<"tool">;
|
|
100
|
-
readonly messageID: Schema.String;
|
|
101
|
-
readonly callID: Schema.String;
|
|
102
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
103
|
-
readonly type: Schema.Literal<"tool">;
|
|
104
|
-
readonly messageID: Schema.String;
|
|
105
|
-
readonly callID: Schema.String;
|
|
106
|
-
}>]>>, never, never>;
|
|
107
|
-
readonly id: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
108
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
109
|
-
};
|
|
110
|
-
}>>;
|
|
111
|
-
}>>, HttpApiEndpoint.Json<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
112
|
-
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
113
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
114
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
115
|
-
};
|
|
116
|
-
requestID: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
117
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
118
|
-
};
|
|
119
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
120
|
-
readonly data: Schema.Struct<{
|
|
121
|
-
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
122
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
123
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
124
|
-
};
|
|
125
|
-
readonly action: Schema.String;
|
|
126
|
-
readonly resources: Schema.$Array<Schema.String>;
|
|
127
|
-
readonly save: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Array<Schema.String>>>, Schema.optionalKey<Schema.$Array<Schema.String>>, never, never>;
|
|
128
|
-
readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
|
|
129
|
-
readonly source: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
130
|
-
readonly type: Schema.Literal<"tool">;
|
|
131
|
-
readonly messageID: Schema.String;
|
|
132
|
-
readonly callID: Schema.String;
|
|
133
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
134
|
-
readonly type: Schema.Literal<"tool">;
|
|
135
|
-
readonly messageID: Schema.String;
|
|
136
|
-
readonly callID: Schema.String;
|
|
137
|
-
}>]>>, never, never>;
|
|
138
|
-
readonly id: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
139
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
140
|
-
};
|
|
141
|
-
}>;
|
|
142
|
-
}>>, HttpApiEndpoint.Json<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.reply", "POST", "/api/session/:sessionID/permission/:requestID/reply", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
143
|
-
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
144
|
-
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
145
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
146
|
-
};
|
|
147
|
-
requestID: Schema.brand<Schema.String, "PermissionV2.ID"> & {
|
|
148
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"PermissionV2.ID">;
|
|
149
|
-
};
|
|
150
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
151
|
-
readonly reply: Schema.Literals<readonly ["once", "always", "reject"]>;
|
|
152
|
-
readonly message: Schema.optional<Schema.String>;
|
|
153
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>>, false>;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Agent } from "@opencode-ai/schema/agent";
|
|
2
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
3
|
-
import { Permission } from "@opencode-ai/schema/permission";
|
|
4
|
-
import { PermissionSaved } from "@opencode-ai/schema/permission-saved";
|
|
5
|
-
import { Project } from "@opencode-ai/schema/project";
|
|
6
|
-
import { Session } from "@opencode-ai/schema/session";
|
|
7
|
-
import { Context, Schema } from "effect";
|
|
8
|
-
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
9
|
-
import { PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
10
|
-
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
11
|
-
export const makePermissionGroup = (locationMiddleware, sessionLocationMiddleware) => HttpApiGroup.make("server.permission")
|
|
12
|
-
.add(HttpApiEndpoint.get("permission.request.list", "/api/permission/request", {
|
|
13
|
-
query: LocationQuery,
|
|
14
|
-
success: Location.response(Schema.Array(Permission.Request)),
|
|
15
|
-
})
|
|
16
|
-
.annotateMerge(locationQueryOpenApi)
|
|
17
|
-
.annotateMerge(OpenApi.annotations({
|
|
18
|
-
identifier: "v2.permission.request.list",
|
|
19
|
-
summary: "List pending permission requests",
|
|
20
|
-
description: "Retrieve pending permission requests for a location.",
|
|
21
|
-
})))
|
|
22
|
-
.add(HttpApiEndpoint.get("permission.saved.list", "/api/permission/saved", {
|
|
23
|
-
query: Schema.Struct({ projectID: Project.ID.pipe(Schema.optional) }),
|
|
24
|
-
success: Schema.Struct({ data: Schema.Array(PermissionSaved.Info) }),
|
|
25
|
-
}).annotateMerge(OpenApi.annotations({
|
|
26
|
-
identifier: "v2.permission.saved.list",
|
|
27
|
-
summary: "List saved permissions",
|
|
28
|
-
description: "Retrieve saved permissions, optionally filtered by project.",
|
|
29
|
-
})))
|
|
30
|
-
.add(HttpApiEndpoint.delete("permission.saved.remove", "/api/permission/saved/:id", {
|
|
31
|
-
params: { id: PermissionSaved.ID },
|
|
32
|
-
success: HttpApiSchema.NoContent,
|
|
33
|
-
}).annotateMerge(OpenApi.annotations({
|
|
34
|
-
identifier: "v2.permission.saved.remove",
|
|
35
|
-
summary: "Remove saved permission",
|
|
36
|
-
description: "Remove a saved permission by ID.",
|
|
37
|
-
})))
|
|
38
|
-
// Effect applies group middleware only to endpoints already added; session endpoints use session placement below.
|
|
39
|
-
.middleware(locationMiddleware)
|
|
40
|
-
.add(HttpApiEndpoint.post("session.permission.create", "/api/session/:sessionID/permission", {
|
|
41
|
-
params: { sessionID: Session.ID },
|
|
42
|
-
payload: Schema.Struct({
|
|
43
|
-
id: Permission.ID.pipe(Schema.optional),
|
|
44
|
-
action: Permission.Request.fields.action,
|
|
45
|
-
resources: Permission.Request.fields.resources,
|
|
46
|
-
save: Permission.Request.fields.save,
|
|
47
|
-
metadata: Permission.Request.fields.metadata,
|
|
48
|
-
source: Permission.Request.fields.source,
|
|
49
|
-
agent: Agent.ID.pipe(Schema.optional),
|
|
50
|
-
}),
|
|
51
|
-
success: Schema.Struct({
|
|
52
|
-
data: Schema.Struct({ id: Permission.ID, effect: Permission.Effect }),
|
|
53
|
-
}),
|
|
54
|
-
error: SessionNotFoundError,
|
|
55
|
-
})
|
|
56
|
-
.middleware(sessionLocationMiddleware)
|
|
57
|
-
.annotateMerge(OpenApi.annotations({
|
|
58
|
-
identifier: "v2.session.permission.create",
|
|
59
|
-
summary: "Create permission request",
|
|
60
|
-
description: "Evaluate and, when approval is required, create a permission request for a session.",
|
|
61
|
-
})))
|
|
62
|
-
.add(HttpApiEndpoint.get("session.permission.list", "/api/session/:sessionID/permission", {
|
|
63
|
-
params: { sessionID: Session.ID },
|
|
64
|
-
success: Schema.Struct({ data: Schema.Array(Permission.Request) }),
|
|
65
|
-
error: SessionNotFoundError,
|
|
66
|
-
})
|
|
67
|
-
.middleware(sessionLocationMiddleware)
|
|
68
|
-
.annotateMerge(OpenApi.annotations({
|
|
69
|
-
identifier: "v2.session.permission.list",
|
|
70
|
-
summary: "List session permission requests",
|
|
71
|
-
description: "Retrieve pending permission requests owned by a session.",
|
|
72
|
-
})))
|
|
73
|
-
.add(HttpApiEndpoint.get("session.permission.get", "/api/session/:sessionID/permission/:requestID", {
|
|
74
|
-
params: { sessionID: Session.ID, requestID: Permission.ID },
|
|
75
|
-
success: Schema.Struct({ data: Permission.Request }),
|
|
76
|
-
error: [SessionNotFoundError, PermissionNotFoundError],
|
|
77
|
-
})
|
|
78
|
-
.middleware(sessionLocationMiddleware)
|
|
79
|
-
.annotateMerge(OpenApi.annotations({
|
|
80
|
-
identifier: "v2.session.permission.get",
|
|
81
|
-
summary: "Get permission request",
|
|
82
|
-
description: "Retrieve a pending permission request owned by a session.",
|
|
83
|
-
})))
|
|
84
|
-
.add(HttpApiEndpoint.post("session.permission.reply", "/api/session/:sessionID/permission/:requestID/reply", {
|
|
85
|
-
params: { sessionID: Session.ID, requestID: Permission.ID },
|
|
86
|
-
payload: Schema.Struct({
|
|
87
|
-
reply: Permission.Reply,
|
|
88
|
-
message: Schema.String.pipe(Schema.optional),
|
|
89
|
-
}),
|
|
90
|
-
success: HttpApiSchema.NoContent,
|
|
91
|
-
error: [SessionNotFoundError, PermissionNotFoundError],
|
|
92
|
-
})
|
|
93
|
-
.middleware(sessionLocationMiddleware)
|
|
94
|
-
.annotateMerge(OpenApi.annotations({
|
|
95
|
-
identifier: "v2.session.permission.reply",
|
|
96
|
-
summary: "Reply to pending permission request",
|
|
97
|
-
description: "Respond to a pending permission request owned by a session.",
|
|
98
|
-
})))
|
|
99
|
-
.annotateMerge(OpenApi.annotations({ title: "permissions", description: "Experimental permission routes." }));
|
package/dist/groups/plugin.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
-
export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", HttpApiEndpoint.HttpApiEndpoint<"plugin.list", "GET", "/api/plugin", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
5
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
6
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
7
|
-
readonly workspace: Schema.optional<Schema.String>;
|
|
8
|
-
}>>;
|
|
9
|
-
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
10
|
-
readonly location: typeof Location.Info;
|
|
11
|
-
readonly data: Schema.$Array<Schema.Struct<{
|
|
12
|
-
readonly id: Schema.brand<Schema.String, "Plugin.ID">;
|
|
13
|
-
}>>;
|
|
14
|
-
}>>, HttpApiEndpoint.Json<never>, never, never>, false>;
|
package/dist/groups/plugin.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Location } from "@opencode-ai/schema/location";
|
|
2
|
-
import { Plugin } from "@opencode-ai/schema/plugin";
|
|
3
|
-
import { Schema } from "effect";
|
|
4
|
-
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
-
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
6
|
-
export const PluginGroup = HttpApiGroup.make("server.plugin")
|
|
7
|
-
.add(HttpApiEndpoint.get("plugin.list", "/api/plugin", {
|
|
8
|
-
query: LocationQuery,
|
|
9
|
-
success: Location.response(Schema.Array(Plugin.Info)),
|
|
10
|
-
})
|
|
11
|
-
.annotateMerge(locationQueryOpenApi)
|
|
12
|
-
.annotateMerge(OpenApi.annotations({
|
|
13
|
-
identifier: "v2.plugin.list",
|
|
14
|
-
summary: "List plugins",
|
|
15
|
-
description: "Retrieve currently loaded plugins.",
|
|
16
|
-
})))
|
|
17
|
-
.annotateMerge(OpenApi.annotations({
|
|
18
|
-
title: "plugins",
|
|
19
|
-
description: "Experimental plugin routes.",
|
|
20
|
-
}));
|