@opencode/protocol 2.0.31 → 2.1.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/dist/api.d.ts +2 -1
- package/dist/api.js +2 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +1 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +5 -0
- package/dist/groups/agent.d.ts +9 -9
- package/dist/groups/credential.d.ts +35 -38
- package/dist/groups/event.d.ts +2414 -2386
- package/dist/groups/form.d.ts +24 -24
- package/dist/groups/fs.d.ts +12 -12
- package/dist/groups/integration.d.ts +278 -278
- package/dist/groups/mcp.d.ts +22 -22
- package/dist/groups/message.d.ts +82 -182
- package/dist/groups/message.js +15 -12
- package/dist/groups/model.d.ts +112 -108
- package/dist/groups/permission.d.ts +36 -14
- package/dist/groups/permission.js +14 -1
- package/dist/groups/persistent-pty.d.ts +122 -122
- package/dist/groups/plugin.d.ts +7 -7
- package/dist/groups/provider.d.ts +24 -20
- package/dist/groups/pty.d.ts +45 -45
- package/dist/groups/reference.d.ts +5 -5
- package/dist/groups/server.d.ts +6 -6
- package/dist/groups/session.d.ts +5772 -5819
- package/dist/groups/session.js +27 -70
- package/dist/groups/shell.d.ts +20 -20
- package/dist/groups/vcs.d.ts +30 -30
- package/dist/groups/voice.d.ts +60 -0
- package/dist/groups/voice.js +51 -0
- package/dist/groups/worktree.d.ts +11 -11
- package/dist/simulation.d.ts +237 -237
- package/package.json +6 -5
package/dist/groups/message.js
CHANGED
|
@@ -4,6 +4,20 @@ import { Location } from "@opencode/schema/location";
|
|
|
4
4
|
import { Schema, Struct } from "effect";
|
|
5
5
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
6
6
|
import { InvalidCursorError, SessionNotFoundError, UnknownError } from "../errors.js";
|
|
7
|
+
// Keyed by message type so a new message type cannot be left out of the filter.
|
|
8
|
+
const MessageTypes = {
|
|
9
|
+
"agent-switched": true,
|
|
10
|
+
"model-switched": true,
|
|
11
|
+
"location-switched": true,
|
|
12
|
+
user: true,
|
|
13
|
+
synthetic: true,
|
|
14
|
+
system: true,
|
|
15
|
+
skill: true,
|
|
16
|
+
shell: true,
|
|
17
|
+
assistant: true,
|
|
18
|
+
compaction: true,
|
|
19
|
+
idle: true,
|
|
20
|
+
};
|
|
7
21
|
export const SessionMessagesQuery = Schema.Struct({
|
|
8
22
|
limit: Schema.optional(Schema.NumberFromString.check(Schema.isInt(), Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(200))).annotate({
|
|
9
23
|
description: "Maximum number of messages to return. When omitted, the endpoint returns its default page size.",
|
|
@@ -14,18 +28,7 @@ export const SessionMessagesQuery = Schema.Struct({
|
|
|
14
28
|
cursor: Schema.optional(Schema.String.annotate({
|
|
15
29
|
description: "Opaque pagination cursor returned as cursor.previous or cursor.next in the previous response. Do not combine with order.",
|
|
16
30
|
})),
|
|
17
|
-
type: Schema.optional(Schema.Literals(
|
|
18
|
-
"agent-switched",
|
|
19
|
-
"model-switched",
|
|
20
|
-
"location-switched",
|
|
21
|
-
"user",
|
|
22
|
-
"synthetic",
|
|
23
|
-
"system",
|
|
24
|
-
"skill",
|
|
25
|
-
"shell",
|
|
26
|
-
"assistant",
|
|
27
|
-
"compaction",
|
|
28
|
-
])).annotate({
|
|
31
|
+
type: Schema.optional(Schema.Literals(Object.keys(MessageTypes))).annotate({
|
|
29
32
|
description: "Filter by message type before pagination. When omitted, all message types are returned. Pass the same type when following cursors.",
|
|
30
33
|
}),
|
|
31
34
|
}).annotate({ identifier: "SessionMessagesQuery" });
|
package/dist/groups/model.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Model } from "@opencode/schema/model";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import { HttpApiEndpoint, HttpApiGroup } from "effect/http-api";
|
|
4
4
|
import { ServiceUnavailableError } from "../errors.js";
|
|
5
|
-
export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.
|
|
5
|
+
export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
6
6
|
readonly location: Schema.optional<Schema.Struct<{
|
|
7
7
|
readonly directory: Schema.optional<Schema.String>;
|
|
8
8
|
}>>;
|
|
@@ -10,80 +10,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
10
10
|
readonly location: Schema.Struct<{
|
|
11
11
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12
12
|
}>;
|
|
13
|
-
readonly data: Schema
|
|
14
|
-
readonly capabilities: Schema.Struct<{
|
|
15
|
-
readonly tools: Schema.Boolean;
|
|
16
|
-
readonly input: Schema.$Array<Schema.String>;
|
|
17
|
-
readonly output: Schema.$Array<Schema.String>;
|
|
18
|
-
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
19
|
-
}> & {
|
|
20
|
-
default: () => {
|
|
21
|
-
tools: true;
|
|
22
|
-
input: string[];
|
|
23
|
-
output: string[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
readonly variants: Schema.$Array<Schema.Struct<{
|
|
27
|
-
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
28
|
-
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
29
|
-
readonly type: Schema.Literal<"summary">;
|
|
30
|
-
}>, Schema.Struct<{
|
|
31
|
-
readonly type: Schema.Literal<"native">;
|
|
32
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
33
|
-
readonly type: Schema.Literal<"summary">;
|
|
34
|
-
}>, Schema.Struct<{
|
|
35
|
-
readonly type: Schema.Literal<"native">;
|
|
36
|
-
}>]>>, never, never>;
|
|
37
|
-
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
38
|
-
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
39
|
-
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
40
|
-
readonly type: Schema.Literal<"summary">;
|
|
41
|
-
}>, Schema.Struct<{
|
|
42
|
-
readonly type: Schema.Literal<"native">;
|
|
43
|
-
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
44
|
-
readonly type: Schema.Literal<"summary">;
|
|
45
|
-
}>, Schema.Struct<{
|
|
46
|
-
readonly type: Schema.Literal<"native">;
|
|
47
|
-
}>]>>, never, never>;
|
|
48
|
-
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
49
|
-
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
50
|
-
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
51
|
-
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
52
|
-
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
53
|
-
}>>;
|
|
54
|
-
readonly time: Schema.Struct<{
|
|
55
|
-
readonly released: Schema.Finite;
|
|
56
|
-
}>;
|
|
57
|
-
readonly cost: Schema.$Array<Schema.Struct<{
|
|
58
|
-
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
59
|
-
readonly type: Schema.tag<"context">;
|
|
60
|
-
readonly size: Schema.Int;
|
|
61
|
-
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
62
|
-
readonly type: Schema.tag<"context">;
|
|
63
|
-
readonly size: Schema.Int;
|
|
64
|
-
}>>, never, never>;
|
|
65
|
-
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
66
|
-
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
67
|
-
};
|
|
68
|
-
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
69
|
-
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
70
|
-
};
|
|
71
|
-
readonly cache: Schema.Struct<{
|
|
72
|
-
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
73
|
-
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
74
|
-
};
|
|
75
|
-
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
76
|
-
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
77
|
-
};
|
|
78
|
-
}>;
|
|
79
|
-
}>>;
|
|
80
|
-
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
81
|
-
readonly enabled: Schema.Boolean;
|
|
82
|
-
readonly limit: Schema.Struct<{
|
|
83
|
-
readonly context: Schema.Int;
|
|
84
|
-
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
85
|
-
readonly output: Schema.Int;
|
|
86
|
-
}>;
|
|
13
|
+
readonly data: Schema.UndefinedOr<Schema.Struct<{
|
|
87
14
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
88
15
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
89
16
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -158,6 +85,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
158
85
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
159
86
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
160
87
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
88
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
161
89
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
162
90
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
163
91
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -168,44 +96,12 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
168
96
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
169
97
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
170
98
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
99
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
171
100
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
172
101
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
173
102
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
174
103
|
}>>, never, never>;
|
|
175
104
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
176
|
-
}> & {
|
|
177
|
-
default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
|
|
178
|
-
id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
179
|
-
modelID: string & import("effect/Brand").Brand<"Model.ID">;
|
|
180
|
-
providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
181
|
-
name: string & import("effect/Brand").Brand<"Model.ID">;
|
|
182
|
-
capabilities: {
|
|
183
|
-
tools: true;
|
|
184
|
-
input: string[];
|
|
185
|
-
output: string[];
|
|
186
|
-
};
|
|
187
|
-
variants: never[];
|
|
188
|
-
time: {
|
|
189
|
-
released: number;
|
|
190
|
-
};
|
|
191
|
-
cost: never[];
|
|
192
|
-
status: "active";
|
|
193
|
-
enabled: true;
|
|
194
|
-
limit: {
|
|
195
|
-
context: number;
|
|
196
|
-
output: number;
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
}>;
|
|
200
|
-
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.default", "GET", "/api/model/default", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
201
|
-
readonly location: Schema.optional<Schema.Struct<{
|
|
202
|
-
readonly directory: Schema.optional<Schema.String>;
|
|
203
|
-
}>>;
|
|
204
|
-
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
205
|
-
readonly location: Schema.Struct<{
|
|
206
|
-
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
207
|
-
}>;
|
|
208
|
-
readonly data: Schema.UndefinedOr<Schema.Struct<{
|
|
209
105
|
readonly capabilities: Schema.Struct<{
|
|
210
106
|
readonly tools: Schema.Boolean;
|
|
211
107
|
readonly input: Schema.$Array<Schema.String>;
|
|
@@ -279,6 +175,39 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
279
175
|
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
280
176
|
readonly output: Schema.Int;
|
|
281
177
|
}>;
|
|
178
|
+
}> & {
|
|
179
|
+
default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
|
|
180
|
+
id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
181
|
+
modelID: string & import("effect/Brand").Brand<"Model.ID">;
|
|
182
|
+
providerID: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
183
|
+
name: string & import("effect/Brand").Brand<"Model.ID">;
|
|
184
|
+
capabilities: {
|
|
185
|
+
tools: true;
|
|
186
|
+
input: string[];
|
|
187
|
+
output: string[];
|
|
188
|
+
};
|
|
189
|
+
variants: never[];
|
|
190
|
+
time: {
|
|
191
|
+
released: number;
|
|
192
|
+
};
|
|
193
|
+
cost: never[];
|
|
194
|
+
status: "active";
|
|
195
|
+
enabled: true;
|
|
196
|
+
limit: {
|
|
197
|
+
context: number;
|
|
198
|
+
output: number;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
}>;
|
|
202
|
+
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"model.list", "GET", "/api/model", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
203
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
204
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
205
|
+
}>>;
|
|
206
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
207
|
+
readonly location: Schema.Struct<{
|
|
208
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
209
|
+
}>;
|
|
210
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
282
211
|
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
283
212
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
284
213
|
readonly type: Schema.Literal<"summary">;
|
|
@@ -353,6 +282,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
353
282
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
354
283
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
355
284
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
285
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
356
286
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
357
287
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
358
288
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -363,11 +293,85 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
363
293
|
readonly requireFinishReason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
364
294
|
readonly requireAssistantAfterTool: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
365
295
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
296
|
+
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
366
297
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
367
298
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
368
299
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
369
300
|
}>>, never, never>;
|
|
370
301
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
302
|
+
readonly capabilities: Schema.Struct<{
|
|
303
|
+
readonly tools: Schema.Boolean;
|
|
304
|
+
readonly input: Schema.$Array<Schema.String>;
|
|
305
|
+
readonly output: Schema.$Array<Schema.String>;
|
|
306
|
+
readonly temperature: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
307
|
+
}> & {
|
|
308
|
+
default: () => {
|
|
309
|
+
tools: true;
|
|
310
|
+
input: string[];
|
|
311
|
+
output: string[];
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
readonly variants: Schema.$Array<Schema.Struct<{
|
|
315
|
+
readonly settings: Schema.decodeTo<Schema.optional<Schema.toType<Schema.StructWithRest<Schema.Struct<{
|
|
316
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
317
|
+
readonly type: Schema.Literal<"summary">;
|
|
318
|
+
}>, Schema.Struct<{
|
|
319
|
+
readonly type: Schema.Literal<"native">;
|
|
320
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
321
|
+
readonly type: Schema.Literal<"summary">;
|
|
322
|
+
}>, Schema.Struct<{
|
|
323
|
+
readonly type: Schema.Literal<"native">;
|
|
324
|
+
}>]>>, never, never>;
|
|
325
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
326
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
327
|
+
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
328
|
+
readonly type: Schema.Literal<"summary">;
|
|
329
|
+
}>, Schema.Struct<{
|
|
330
|
+
readonly type: Schema.Literal<"native">;
|
|
331
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
332
|
+
readonly type: Schema.Literal<"summary">;
|
|
333
|
+
}>, Schema.Struct<{
|
|
334
|
+
readonly type: Schema.Literal<"native">;
|
|
335
|
+
}>]>>, never, never>;
|
|
336
|
+
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
337
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
338
|
+
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
339
|
+
readonly body: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Any>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Any>>, never, never>;
|
|
340
|
+
readonly id: Schema.brand<Schema.String, "Model.VariantID">;
|
|
341
|
+
}>>;
|
|
342
|
+
readonly time: Schema.Struct<{
|
|
343
|
+
readonly released: Schema.Finite;
|
|
344
|
+
}>;
|
|
345
|
+
readonly cost: Schema.$Array<Schema.Struct<{
|
|
346
|
+
readonly tier: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
347
|
+
readonly type: Schema.tag<"context">;
|
|
348
|
+
readonly size: Schema.Int;
|
|
349
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
350
|
+
readonly type: Schema.tag<"context">;
|
|
351
|
+
readonly size: Schema.Int;
|
|
352
|
+
}>>, never, never>;
|
|
353
|
+
readonly input: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
354
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
355
|
+
};
|
|
356
|
+
readonly output: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
357
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
358
|
+
};
|
|
359
|
+
readonly cache: Schema.Struct<{
|
|
360
|
+
readonly read: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
361
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
362
|
+
};
|
|
363
|
+
readonly write: Schema.brand<Schema.Finite, "Money.USDPerMillionTokens"> & {
|
|
364
|
+
zero: number & import("effect/Brand").Brand<"Money.USDPerMillionTokens">;
|
|
365
|
+
};
|
|
366
|
+
}>;
|
|
367
|
+
}>>;
|
|
368
|
+
readonly status: Schema.Literals<readonly ["alpha", "beta", "deprecated", "active"]>;
|
|
369
|
+
readonly enabled: Schema.Boolean;
|
|
370
|
+
readonly limit: Schema.Struct<{
|
|
371
|
+
readonly context: Schema.Int;
|
|
372
|
+
readonly input: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
373
|
+
readonly output: Schema.Int;
|
|
374
|
+
}>;
|
|
371
375
|
}> & {
|
|
372
376
|
default: (providerID: import("@opencode/schema/provider").ID, id: Model.ID) => {
|
|
373
377
|
id: string & import("effect/Brand").Brand<"Model.ID">;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema } from "effect/http-api";
|
|
3
|
-
import { LocationNotFoundError, PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
4
|
-
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.
|
|
3
|
+
import { ConflictError, LocationNotFoundError, PermissionNotFoundError, PermissionSavedNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
4
|
+
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.saved.remove", "DELETE", "/api/permission/saved/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
5
|
+
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
6
|
+
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
7
|
+
};
|
|
8
|
+
}>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.request.list", "GET", "/api/permission/request", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
9
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
10
|
readonly directory: Schema.optional<Schema.String>;
|
|
7
11
|
}>>;
|
|
@@ -51,11 +55,29 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
51
55
|
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
52
56
|
}>;
|
|
53
57
|
}>>;
|
|
54
|
-
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.
|
|
58
|
+
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.update", "PATCH", "/api/permission/saved/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
55
59
|
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
56
60
|
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
57
61
|
};
|
|
58
|
-
}>>, never,
|
|
62
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
63
|
+
readonly action: Schema.optional<Schema.String>;
|
|
64
|
+
readonly resource: Schema.optional<Schema.String>;
|
|
65
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
66
|
+
readonly data: Schema.Struct<{
|
|
67
|
+
readonly id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
68
|
+
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
69
|
+
};
|
|
70
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
71
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
72
|
+
};
|
|
73
|
+
readonly action: Schema.String;
|
|
74
|
+
readonly resource: Schema.String;
|
|
75
|
+
readonly time: Schema.Struct<{
|
|
76
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
77
|
+
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
78
|
+
}>;
|
|
79
|
+
}>;
|
|
80
|
+
}>>, Schema.toCodecJson<typeof ConflictError | typeof PermissionSavedNotFoundError>, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.create", "POST", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
|
|
59
81
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
60
82
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
61
83
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -85,13 +107,16 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
85
107
|
};
|
|
86
108
|
readonly effect: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
87
109
|
}>;
|
|
88
|
-
}>>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.
|
|
110
|
+
}>>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", Schema.toCodecStringTree<Schema.Struct<{
|
|
89
111
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
90
112
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
91
113
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
92
114
|
};
|
|
115
|
+
requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
116
|
+
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
117
|
+
};
|
|
93
118
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
94
|
-
readonly data: Schema
|
|
119
|
+
readonly data: Schema.Struct<{
|
|
95
120
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
96
121
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
97
122
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -113,17 +138,14 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
113
138
|
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
114
139
|
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
115
140
|
};
|
|
116
|
-
}
|
|
117
|
-
}>>, Schema.toCodecJson<typeof
|
|
141
|
+
}>;
|
|
142
|
+
}>>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.list", "GET", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
|
|
118
143
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
119
144
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
120
145
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
121
146
|
};
|
|
122
|
-
requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
123
|
-
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
124
|
-
};
|
|
125
147
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
126
|
-
readonly data: Schema.Struct<{
|
|
148
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
127
149
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
128
150
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
129
151
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -145,8 +167,8 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
145
167
|
readonly id: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
146
168
|
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
147
169
|
};
|
|
148
|
-
}
|
|
149
|
-
}>>, Schema.toCodecJson<typeof
|
|
170
|
+
}>>;
|
|
171
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof SessionNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.reply", "POST", "/api/session/:sessionID/permission/:requestID/reply", Schema.toCodecStringTree<Schema.Struct<{
|
|
150
172
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
151
173
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
152
174
|
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
@@ -6,7 +6,7 @@ import { Project } from "@opencode/schema/project";
|
|
|
6
6
|
import { Session } from "@opencode/schema/session";
|
|
7
7
|
import { Context, Schema } from "effect";
|
|
8
8
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
9
|
-
import { LocationNotFoundError, PermissionNotFoundError, SessionNotFoundError } from "../errors.js";
|
|
9
|
+
import { ConflictError, LocationNotFoundError, PermissionNotFoundError, PermissionSavedNotFoundError, SessionNotFoundError, } from "../errors.js";
|
|
10
10
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
11
11
|
export const makePermissionGroup = (locationMiddleware, sessionLocationMiddleware) => HttpApiGroup.make("server.permission")
|
|
12
12
|
.add(HttpApiEndpoint.get("permission.request.list", "/api/permission/request", {
|
|
@@ -26,6 +26,19 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
26
26
|
identifier: "permission.saved.list",
|
|
27
27
|
summary: "List saved permissions",
|
|
28
28
|
description: "Retrieve saved permissions, optionally filtered by project.",
|
|
29
|
+
})))
|
|
30
|
+
.add(HttpApiEndpoint.patch("permission.saved.update", "/api/permission/saved/:id", {
|
|
31
|
+
params: { id: PermissionSaved.ID },
|
|
32
|
+
payload: Schema.Struct({
|
|
33
|
+
action: Schema.String.pipe(Schema.optional),
|
|
34
|
+
resource: Schema.String.pipe(Schema.optional),
|
|
35
|
+
}),
|
|
36
|
+
success: Schema.Struct({ data: PermissionSaved.Info }),
|
|
37
|
+
error: [PermissionSavedNotFoundError, ConflictError],
|
|
38
|
+
}).annotateMerge(OpenApi.annotations({
|
|
39
|
+
identifier: "permission.saved.update",
|
|
40
|
+
summary: "Update saved permission",
|
|
41
|
+
description: "Change the action or resource of a saved permission. Fails with a conflict when the project already has a saved permission with the same action and resource.",
|
|
29
42
|
})))
|
|
30
43
|
.add(HttpApiEndpoint.delete("permission.saved.remove", "/api/permission/saved/:id", {
|
|
31
44
|
params: { id: PermissionSaved.ID },
|