@opencode/protocol 2.1.3 → 2.2.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 +6 -4
- package/dist/api.js +7 -5
- package/dist/client.d.ts +1 -0
- package/dist/client.js +16 -2
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +35 -0
- package/dist/groups/agent.d.ts +12 -2
- package/dist/groups/agent.js +2 -1
- package/dist/groups/debug.d.ts +14 -1
- package/dist/groups/debug.js +26 -0
- package/dist/groups/event.d.ts +1235 -1467
- package/dist/groups/event.js +9 -0
- package/dist/groups/experimental.d.ts +238 -0
- package/dist/groups/experimental.js +4 -0
- package/dist/groups/fs.d.ts +15 -3
- package/dist/groups/fs.js +27 -1
- package/dist/groups/generate.d.ts +194 -3
- package/dist/groups/generate.js +41 -5
- package/dist/groups/mcp.d.ts +49 -25
- package/dist/groups/mcp.js +40 -4
- package/dist/groups/media.d.ts +8 -0
- package/dist/groups/media.js +18 -0
- package/dist/groups/message.d.ts +2266 -27
- package/dist/groups/message.js +29 -4
- package/dist/groups/model.d.ts +47 -0
- package/dist/groups/model.js +8 -2
- package/dist/groups/permission.d.ts +6 -13
- package/dist/groups/permission.js +4 -3
- package/dist/groups/persistent-pty.d.ts +0 -8
- package/dist/groups/plugin.d.ts +18 -2
- package/dist/groups/plugin.js +15 -1
- package/dist/groups/provider.d.ts +24 -0
- package/dist/groups/pty.d.ts +33 -33
- package/dist/groups/server.d.ts +2 -0
- package/dist/groups/server.js +2 -0
- package/dist/groups/session.d.ts +609 -551
- package/dist/groups/session.js +18 -34
- package/dist/groups/usage.d.ts +95 -0
- package/dist/groups/usage.js +22 -0
- package/dist/groups/vcs.d.ts +2 -0
- package/dist/groups/vcs.js +1 -0
- package/dist/groups/voice.d.ts +2 -18
- package/dist/groups/voice.js +3 -19
- package/package.json +6 -4
package/dist/groups/message.js
CHANGED
|
@@ -54,16 +54,41 @@ export const PublicSessionMessage = Schema.Union([
|
|
|
54
54
|
SessionMessage.Compaction,
|
|
55
55
|
SessionMessage.Idle,
|
|
56
56
|
]).annotate({ identifier: "Session.Message.Info" });
|
|
57
|
+
/**
|
|
58
|
+
* Experimental: {@link PublicSessionMessage} as sent to clients that opt in with `X-OpenCode-Capabilities:
|
|
59
|
+
* experimental-media-uri` while `experimental.media_blob` is on. User files stored in `blob` stay `media:` refs.
|
|
60
|
+
*/
|
|
61
|
+
export const PublicMediaSessionMessage = Schema.Union([
|
|
62
|
+
SessionMessage.AgentSelected,
|
|
63
|
+
SessionMessage.ModelSelected,
|
|
64
|
+
PublicLocationSwitched,
|
|
65
|
+
SessionMessage.MediaUser,
|
|
66
|
+
SessionMessage.Synthetic,
|
|
67
|
+
SessionMessage.System,
|
|
68
|
+
SessionMessage.Skill,
|
|
69
|
+
SessionMessage.Shell,
|
|
70
|
+
SessionMessage.Assistant,
|
|
71
|
+
SessionMessage.Compaction,
|
|
72
|
+
SessionMessage.Idle,
|
|
73
|
+
]).annotate({ identifier: "Session.Message.MediaInfo" });
|
|
74
|
+
const MessagesCursor = Schema.Struct({
|
|
75
|
+
previous: Schema.String.pipe(Schema.optional),
|
|
76
|
+
next: Schema.String.pipe(Schema.optional),
|
|
77
|
+
});
|
|
78
|
+
/** Experimental: the `session.messages` response for clients that opt into `experimental-media-uri`. */
|
|
79
|
+
export const SessionMediaMessagesResponse = Schema.Struct({
|
|
80
|
+
data: Schema.Array(PublicMediaSessionMessage),
|
|
81
|
+
cursor: MessagesCursor,
|
|
82
|
+
});
|
|
83
|
+
/** Experimental: the `session.message` response for clients that opt into `experimental-media-uri`. */
|
|
84
|
+
export const SessionMediaMessageResponse = Schema.Struct({ data: PublicMediaSessionMessage });
|
|
57
85
|
export const MessageGroup = HttpApiGroup.make("server.message")
|
|
58
86
|
.add(HttpApiEndpoint.get("session.messages", "/api/session/:sessionID/message", {
|
|
59
87
|
params: { sessionID: Session.ID },
|
|
60
88
|
query: SessionMessagesQuery,
|
|
61
89
|
success: Schema.Struct({
|
|
62
90
|
data: Schema.Array(PublicSessionMessage),
|
|
63
|
-
cursor:
|
|
64
|
-
previous: Schema.String.pipe(Schema.optional),
|
|
65
|
-
next: Schema.String.pipe(Schema.optional),
|
|
66
|
-
}),
|
|
91
|
+
cursor: MessagesCursor,
|
|
67
92
|
}).annotate({ identifier: "SessionMessagesResponse" }),
|
|
68
93
|
error: [InvalidCursorError, SessionNotFoundError, UnknownError],
|
|
69
94
|
}).annotateMerge(OpenApi.annotations({
|
package/dist/groups/model.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
21
21
|
}>, Schema.Struct<{
|
|
22
22
|
readonly type: Schema.Literal<"native">;
|
|
23
23
|
}>]>>, never, never>;
|
|
24
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
25
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
26
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
27
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
28
|
+
}>>, never, never>;
|
|
24
29
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
25
30
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
26
31
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -32,6 +37,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
32
37
|
}>, Schema.Struct<{
|
|
33
38
|
readonly type: Schema.Literal<"native">;
|
|
34
39
|
}>]>>, never, never>;
|
|
40
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
41
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
42
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
43
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
44
|
+
}>>, never, never>;
|
|
35
45
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
36
46
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
37
47
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
@@ -76,6 +86,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
76
86
|
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
77
87
|
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
78
88
|
}>, never, never>;
|
|
89
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.Type, Model.Type, never, never>>>, Schema.optionalKey<Schema.Codec<Model.Type, Model.Type, never, never>>, never, never>;
|
|
79
90
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
80
91
|
readonly name: Schema.String;
|
|
81
92
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
@@ -89,6 +100,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
89
100
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
90
101
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
91
102
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
103
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
92
104
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
93
105
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
94
106
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -100,6 +112,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
100
112
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
101
113
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
102
114
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
115
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
103
116
|
}>>, never, never>;
|
|
104
117
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
105
118
|
readonly capabilities: Schema.Struct<{
|
|
@@ -125,6 +138,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
125
138
|
}>, Schema.Struct<{
|
|
126
139
|
readonly type: Schema.Literal<"native">;
|
|
127
140
|
}>]>>, never, never>;
|
|
141
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
142
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
143
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
144
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
145
|
+
}>>, never, never>;
|
|
128
146
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
129
147
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
130
148
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -136,6 +154,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
136
154
|
}>, Schema.Struct<{
|
|
137
155
|
readonly type: Schema.Literal<"native">;
|
|
138
156
|
}>]>>, never, never>;
|
|
157
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
158
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
159
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
160
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
161
|
+
}>>, never, never>;
|
|
139
162
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
140
163
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
141
164
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
@@ -203,6 +226,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
203
226
|
readonly location: Schema.optional<Schema.Struct<{
|
|
204
227
|
readonly directory: Schema.optional<Schema.String>;
|
|
205
228
|
}>>;
|
|
229
|
+
readonly types: Schema.optional<Schema.ArrayEnsure<Schema.Codec<Model.Type, Model.Type, never, never>>>;
|
|
206
230
|
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
207
231
|
readonly location: Schema.Struct<{
|
|
208
232
|
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
@@ -218,6 +242,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
218
242
|
}>, Schema.Struct<{
|
|
219
243
|
readonly type: Schema.Literal<"native">;
|
|
220
244
|
}>]>>, never, never>;
|
|
245
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
246
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
247
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
248
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
249
|
+
}>>, never, never>;
|
|
221
250
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
222
251
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
223
252
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -229,6 +258,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
229
258
|
}>, Schema.Struct<{
|
|
230
259
|
readonly type: Schema.Literal<"native">;
|
|
231
260
|
}>]>>, never, never>;
|
|
261
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
262
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
263
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
264
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
265
|
+
}>>, never, never>;
|
|
232
266
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
233
267
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
234
268
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
|
@@ -273,6 +307,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
273
307
|
mistral: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
274
308
|
gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
|
|
275
309
|
}>, never, never>;
|
|
310
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.Type, Model.Type, never, never>>>, Schema.optionalKey<Schema.Codec<Model.Type, Model.Type, never, never>>, never, never>;
|
|
276
311
|
readonly family: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.Family">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.Family">>, never, never>;
|
|
277
312
|
readonly name: Schema.String;
|
|
278
313
|
readonly compatibility: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
@@ -286,6 +321,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
286
321
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
287
322
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
288
323
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
324
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
289
325
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
290
326
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<Model.ReasoningField, Model.ReasoningField, never, never>>, never, never>;
|
|
291
327
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -297,6 +333,7 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
297
333
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
298
334
|
readonly supportsThinkingBlockBinding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
299
335
|
readonly supportsEffortUpdates: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
336
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
300
337
|
}>>, never, never>;
|
|
301
338
|
readonly package: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
302
339
|
readonly capabilities: Schema.Struct<{
|
|
@@ -322,6 +359,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
322
359
|
}>, Schema.Struct<{
|
|
323
360
|
readonly type: Schema.Literal<"native">;
|
|
324
361
|
}>]>>, never, never>;
|
|
362
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
363
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
364
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
365
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
366
|
+
}>>, never, never>;
|
|
325
367
|
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
368
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
327
369
|
readonly compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -333,6 +375,11 @@ export declare const ModelGroup: HttpApiGroup.HttpApiGroup<"server.model", HttpA
|
|
|
333
375
|
}>, Schema.Struct<{
|
|
334
376
|
readonly type: Schema.Literal<"native">;
|
|
335
377
|
}>]>>, never, never>;
|
|
378
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
379
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
380
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
381
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
382
|
+
}>>, never, never>;
|
|
336
383
|
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
384
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
338
385
|
readonly headers: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.String>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>, never, never>;
|
package/dist/groups/model.js
CHANGED
|
@@ -4,9 +4,15 @@ import { Schema } from "effect";
|
|
|
4
4
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/http-api";
|
|
5
5
|
import { ServiceUnavailableError } from "../errors.js";
|
|
6
6
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
|
+
const ListQuery = Schema.Struct({
|
|
8
|
+
...LocationQuery.fields,
|
|
9
|
+
types: Schema.optional(Schema.ArrayEnsure(Model.Type)).annotate({
|
|
10
|
+
description: "Only list models of these types. Defaults to chat, the only type offered for sessions.",
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
7
13
|
export const ModelGroup = HttpApiGroup.make("server.model")
|
|
8
14
|
.add(HttpApiEndpoint.get("model.list", "/api/model", {
|
|
9
|
-
query:
|
|
15
|
+
query: ListQuery,
|
|
10
16
|
success: Location.response(Schema.Array(Model.Info)),
|
|
11
17
|
error: ServiceUnavailableError,
|
|
12
18
|
})
|
|
@@ -14,7 +20,7 @@ export const ModelGroup = HttpApiGroup.make("server.model")
|
|
|
14
20
|
.annotateMerge(OpenApi.annotations({
|
|
15
21
|
identifier: "model.list",
|
|
16
22
|
summary: "List models",
|
|
17
|
-
description: "Retrieve the current snapshot of available models ordered by release date. The snapshot may precede initial plugin settlement.",
|
|
23
|
+
description: "Retrieve the current snapshot of available models of the requested types, chat by default, ordered by release date within each type. The snapshot may precede initial plugin settlement.",
|
|
18
24
|
})))
|
|
19
25
|
.add(HttpApiEndpoint.get("model.default", "/api/model/default", {
|
|
20
26
|
query: LocationQuery,
|
|
@@ -12,7 +12,6 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
12
12
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
13
13
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
14
14
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
15
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
16
15
|
};
|
|
17
16
|
readonly action: Schema.String;
|
|
18
17
|
readonly resources: Schema.$Array<Schema.String>;
|
|
@@ -51,7 +50,11 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
51
50
|
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
52
51
|
}>;
|
|
53
52
|
}>>;
|
|
54
|
-
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.
|
|
53
|
+
}>>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.remove", "DELETE", "/api/permission/saved/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
54
|
+
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
55
|
+
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
56
|
+
};
|
|
57
|
+
}>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, never, never> | HttpApiEndpoint.HttpApiEndpoint<"permission.saved.update", "PATCH", "/api/permission/saved/:id", Schema.toCodecStringTree<Schema.Struct<{
|
|
55
58
|
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
56
59
|
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
57
60
|
};
|
|
@@ -73,14 +76,9 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
73
76
|
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
74
77
|
}>;
|
|
75
78
|
}>;
|
|
76
|
-
}>>, Schema.toCodecJson<typeof ConflictError | typeof PermissionSavedNotFoundError>,
|
|
77
|
-
id: Schema.brand<Schema.String, "PermissionSaved.ID"> & {
|
|
78
|
-
create: () => string & import("effect/Brand").Brand<"PermissionSaved.ID">;
|
|
79
|
-
};
|
|
80
|
-
}>>, never, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, never, LocationId, HttpApiMiddleware.Requires<LocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.create", "POST", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
|
|
79
|
+
}>>, Schema.toCodecJson<typeof ConflictError | typeof PermissionSavedNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.create", "POST", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
|
|
81
80
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
82
81
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
83
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
84
82
|
};
|
|
85
83
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
86
84
|
readonly id: Schema.optional<Schema.brand<Schema.String, "Permission.ID"> & {
|
|
@@ -110,7 +108,6 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
110
108
|
}>>, Schema.toCodecJson<typeof SessionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.get", "GET", "/api/session/:sessionID/permission/:requestID", Schema.toCodecStringTree<Schema.Struct<{
|
|
111
109
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
112
110
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
113
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
114
111
|
};
|
|
115
112
|
requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
116
113
|
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
@@ -119,7 +116,6 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
119
116
|
readonly data: Schema.Struct<{
|
|
120
117
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
121
118
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
122
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
123
119
|
};
|
|
124
120
|
readonly action: Schema.String;
|
|
125
121
|
readonly resources: Schema.$Array<Schema.String>;
|
|
@@ -142,13 +138,11 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
142
138
|
}>>, Schema.toCodecJson<typeof SessionNotFoundError | typeof PermissionNotFoundError>, SessionLocationId, HttpApiMiddleware.Requires<SessionLocationId>> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.list", "GET", "/api/session/:sessionID/permission", Schema.toCodecStringTree<Schema.Struct<{
|
|
143
139
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
144
140
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
145
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
146
141
|
};
|
|
147
142
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
148
143
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
149
144
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
150
145
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
151
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
152
146
|
};
|
|
153
147
|
readonly action: Schema.String;
|
|
154
148
|
readonly resources: Schema.$Array<Schema.String>;
|
|
@@ -171,7 +165,6 @@ export declare const makePermissionGroup: <LocationId extends HttpApiMiddleware.
|
|
|
171
165
|
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof SessionNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"session.permission.reply", "POST", "/api/session/:sessionID/permission/:requestID/reply", Schema.toCodecStringTree<Schema.Struct<{
|
|
172
166
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
173
167
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
174
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
175
168
|
};
|
|
176
169
|
requestID: Schema.brand<Schema.String, "Permission.ID"> & {
|
|
177
170
|
create: (id?: string) => string & import("effect/Brand").Brand<"Permission.ID">;
|
|
@@ -13,6 +13,7 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
13
13
|
query: LocationQuery,
|
|
14
14
|
success: Location.response(Schema.Array(Permission.Request)),
|
|
15
15
|
})
|
|
16
|
+
.middleware(locationMiddleware)
|
|
16
17
|
.annotateMerge(locationQueryOpenApi)
|
|
17
18
|
.annotateMerge(OpenApi.annotations({
|
|
18
19
|
identifier: "permission.request.list",
|
|
@@ -22,7 +23,9 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
22
23
|
.add(HttpApiEndpoint.get("permission.saved.list", "/api/permission/saved", {
|
|
23
24
|
query: Schema.Struct({ projectID: Project.ID.pipe(Schema.optional) }),
|
|
24
25
|
success: Schema.Struct({ data: Schema.Array(PermissionSaved.Info) }),
|
|
25
|
-
})
|
|
26
|
+
})
|
|
27
|
+
.middleware(locationMiddleware)
|
|
28
|
+
.annotateMerge(OpenApi.annotations({
|
|
26
29
|
identifier: "permission.saved.list",
|
|
27
30
|
summary: "List saved permissions",
|
|
28
31
|
description: "Retrieve saved permissions, optionally filtered by project.",
|
|
@@ -48,8 +51,6 @@ export const makePermissionGroup = (locationMiddleware, sessionLocationMiddlewar
|
|
|
48
51
|
summary: "Remove saved permission",
|
|
49
52
|
description: "Remove a saved permission by ID.",
|
|
50
53
|
})))
|
|
51
|
-
// Effect applies group middleware only to endpoints already added; session endpoints use session placement below.
|
|
52
|
-
.middleware(locationMiddleware)
|
|
53
54
|
.add(HttpApiEndpoint.post("session.permission.create", "/api/session/:sessionID/permission", {
|
|
54
55
|
params: { sessionID: Session.ID },
|
|
55
56
|
payload: Schema.Struct({
|
|
@@ -25,7 +25,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
25
25
|
}>>, Schema.toCodecJson<typeof ServiceUnavailableError | typeof ForbiddenError | typeof PtyNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"persistentPty.create", "POST", "/api/experimental/session/:sessionID/terminal", Schema.toCodecStringTree<Schema.Struct<{
|
|
26
26
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
27
27
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
28
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
29
28
|
};
|
|
30
29
|
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
31
30
|
readonly command: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
@@ -55,7 +54,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
55
54
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
56
55
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
57
56
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
58
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
59
57
|
};
|
|
60
58
|
readonly foregroundProcess: Schema.NullOr<Schema.String>;
|
|
61
59
|
readonly size: Schema.Struct<{
|
|
@@ -87,7 +85,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
87
85
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
88
86
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
89
87
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
90
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
91
88
|
};
|
|
92
89
|
readonly foregroundProcess: Schema.NullOr<Schema.String>;
|
|
93
90
|
readonly size: Schema.Struct<{
|
|
@@ -109,7 +106,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
109
106
|
}>>, Schema.toCodecJson<typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"persistentPty.list", "GET", "/api/experimental/session/:sessionID/terminal", Schema.toCodecStringTree<Schema.Struct<{
|
|
110
107
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
111
108
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
112
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
113
109
|
};
|
|
114
110
|
}>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
115
111
|
readonly data: Schema.$Array<Schema.Struct<{
|
|
@@ -126,7 +122,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
126
122
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
127
123
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
128
124
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
129
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
130
125
|
};
|
|
131
126
|
readonly foregroundProcess: Schema.NullOr<Schema.String>;
|
|
132
127
|
readonly size: Schema.Struct<{
|
|
@@ -141,7 +136,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
141
136
|
}>>, Schema.toCodecJson<typeof InvalidRequestError | typeof ServiceUnavailableError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"persistentPty.read", "GET", "/api/experimental/session/:sessionID/terminal/read", Schema.toCodecStringTree<Schema.Struct<{
|
|
142
137
|
sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
143
138
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
144
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
145
139
|
};
|
|
146
140
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
147
141
|
lines: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
@@ -190,7 +184,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
190
184
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
191
185
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
192
186
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
193
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
194
187
|
};
|
|
195
188
|
readonly foregroundProcess: Schema.NullOr<Schema.String>;
|
|
196
189
|
readonly size: Schema.Struct<{
|
|
@@ -235,7 +228,6 @@ export declare const PersistentPtyGroup: HttpApiGroup.HttpApiGroup<"server.exper
|
|
|
235
228
|
readonly exitCode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
|
|
236
229
|
readonly sessionID: Schema.brand<Schema.String, "SessionID"> & {
|
|
237
230
|
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
238
|
-
descending: (id?: string) => string & import("effect/Brand").Brand<"SessionID">;
|
|
239
231
|
};
|
|
240
232
|
readonly foregroundProcess: Schema.NullOr<Schema.String>;
|
|
241
233
|
readonly size: Schema.Struct<{
|
package/dist/groups/plugin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
3
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
3
|
+
import { InvalidRequestError, PluginNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
4
4
|
export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", HttpApiEndpoint.HttpApiEndpoint<"plugin.check", "POST", "/api/plugin/check", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
5
5
|
readonly location: Schema.optional<Schema.Struct<{
|
|
6
6
|
readonly directory: Schema.optional<Schema.String>;
|
|
@@ -31,6 +31,7 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
31
31
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
32
32
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
33
33
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
34
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
34
35
|
}>;
|
|
35
36
|
readonly state: Schema.Union<readonly [Schema.Struct<{
|
|
36
37
|
readonly status: Schema.Literal<"active">;
|
|
@@ -40,7 +41,21 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
40
41
|
readonly ref: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
41
42
|
}>]>;
|
|
42
43
|
}>>;
|
|
43
|
-
}>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.
|
|
44
|
+
}>>, Schema.toCodecJson<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.gui", "GET", "/api/plugin/gui", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
45
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
46
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly id: Schema.brand<Schema.String, "Plugin.ID">;
|
|
49
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
50
|
+
readonly location: Schema.Struct<{
|
|
51
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
52
|
+
}>;
|
|
53
|
+
readonly data: Schema.Struct<{
|
|
54
|
+
readonly code: Schema.String;
|
|
55
|
+
readonly revision: Schema.String;
|
|
56
|
+
readonly options: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
57
|
+
}>;
|
|
58
|
+
}>>, Schema.toCodecJson<typeof PluginNotFoundError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"plugin.list", "GET", "/api/plugin", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
44
59
|
readonly location: Schema.optional<Schema.Struct<{
|
|
45
60
|
readonly directory: Schema.optional<Schema.String>;
|
|
46
61
|
}>>;
|
|
@@ -68,6 +83,7 @@ export declare const PluginGroup: HttpApiGroup.HttpApiGroup<"server.plugin", Htt
|
|
|
68
83
|
readonly server: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
69
84
|
readonly tui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
70
85
|
readonly rpc: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
86
|
+
readonly gui: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literal<true>>>, Schema.optionalKey<Schema.Literal<true>>, never, never>;
|
|
71
87
|
}>;
|
|
72
88
|
readonly state: Schema.Union<readonly [Schema.Struct<{
|
|
73
89
|
readonly status: Schema.Literal<"active">;
|
package/dist/groups/plugin.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Location } from "@opencode/schema/location";
|
|
|
2
2
|
import { Plugin } from "@opencode/schema/plugin";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
5
|
-
import { InvalidRequestError, ServiceUnavailableError } from "../errors.js";
|
|
5
|
+
import { InvalidRequestError, PluginNotFoundError, ServiceUnavailableError } from "../errors.js";
|
|
6
6
|
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
7
7
|
export const PluginGroup = HttpApiGroup.make("server.plugin")
|
|
8
8
|
.add(HttpApiEndpoint.get("plugin.list", "/api/plugin", {
|
|
@@ -14,6 +14,20 @@ export const PluginGroup = HttpApiGroup.make("server.plugin")
|
|
|
14
14
|
identifier: "plugin.list",
|
|
15
15
|
summary: "List plugins",
|
|
16
16
|
description: "Retrieve enabled server plugins and their current status.",
|
|
17
|
+
})))
|
|
18
|
+
.add(HttpApiEndpoint.get("plugin.gui", "/api/plugin/gui", {
|
|
19
|
+
query: Schema.Struct({
|
|
20
|
+
...LocationQuery.fields,
|
|
21
|
+
id: Plugin.ID,
|
|
22
|
+
}),
|
|
23
|
+
success: Location.response(Plugin.GuiBundle),
|
|
24
|
+
error: PluginNotFoundError,
|
|
25
|
+
})
|
|
26
|
+
.annotateMerge(locationQueryOpenApi)
|
|
27
|
+
.annotateMerge(OpenApi.annotations({
|
|
28
|
+
identifier: "plugin.gui",
|
|
29
|
+
summary: "Read plugin GUI bundle",
|
|
30
|
+
description: "Read an active plugin's prebuilt CommonJS `./gui-experimental` bundle. Desktop app windows run its default export; the desktop app's main process runs its `main` export. Fails with not found when no active plugin has the id or the plugin exports no `./gui-experimental`.",
|
|
17
31
|
})))
|
|
18
32
|
.add(HttpApiEndpoint.post("plugin.check", "/api/plugin/check", {
|
|
19
33
|
query: LocationQuery,
|
|
@@ -38,6 +38,11 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
38
38
|
}>, Schema.Struct<{
|
|
39
39
|
readonly type: Schema.Literal<"native">;
|
|
40
40
|
}>]>>, never, never>;
|
|
41
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
42
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
43
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
44
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
45
|
+
}>>, never, never>;
|
|
41
46
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
42
47
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
43
48
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
@@ -53,6 +58,11 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
53
58
|
}>, Schema.Struct<{
|
|
54
59
|
readonly type: Schema.Literal<"native">;
|
|
55
60
|
}>]>>, never, never>;
|
|
61
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
62
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
63
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
64
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
65
|
+
}>>, never, never>;
|
|
56
66
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
57
67
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
58
68
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
@@ -109,6 +119,7 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
109
119
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
110
120
|
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
111
121
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
122
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
112
123
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
113
124
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("@opencode/schema/model-compatibility").ReasoningField, import("@opencode/schema/model-compatibility").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("@opencode/schema/model-compatibility").ReasoningField, import("@opencode/schema/model-compatibility").ReasoningField, never, never>>, never, never>;
|
|
114
125
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -118,6 +129,7 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
118
129
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
119
130
|
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
120
131
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
132
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
121
133
|
}>>, never, never>;
|
|
122
134
|
}> & {
|
|
123
135
|
empty: (id: Provider.ID) => Provider.Info;
|
|
@@ -144,6 +156,11 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
144
156
|
}>, Schema.Struct<{
|
|
145
157
|
readonly type: Schema.Literal<"native">;
|
|
146
158
|
}>]>>, never, never>;
|
|
159
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
160
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
161
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
162
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
163
|
+
}>>, never, never>;
|
|
147
164
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
148
165
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
149
166
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>>, Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
@@ -159,6 +176,11 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
159
176
|
}>, Schema.Struct<{
|
|
160
177
|
readonly type: Schema.Literal<"native">;
|
|
161
178
|
}>]>>, never, never>;
|
|
179
|
+
readonly cache: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
180
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
181
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
182
|
+
readonly ttl: Schema.decodeTo<Schema.optional<Schema.toType<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>>, Schema.optionalKey<Schema.TemplateLiteral<readonly [Schema.Number, Schema.Literals<readonly ["ms", "s", "m", "h", "d"]>]>>, never, never>;
|
|
183
|
+
}>>, never, never>;
|
|
162
184
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
163
185
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
164
186
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>, never, never>;
|
|
@@ -215,6 +237,7 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
215
237
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
216
238
|
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
217
239
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
240
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
218
241
|
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
219
242
|
readonly reasoningField: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<import("@opencode/schema/model-compatibility").ReasoningField, import("@opencode/schema/model-compatibility").ReasoningField, never, never>>>, Schema.optionalKey<Schema.Codec<import("@opencode/schema/model-compatibility").ReasoningField, import("@opencode/schema/model-compatibility").ReasoningField, never, never>>, never, never>;
|
|
220
243
|
readonly requireReasoning: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
@@ -224,6 +247,7 @@ export declare const ProviderGroup: HttpApiGroup.HttpApiGroup<"server.provider",
|
|
|
224
247
|
readonly supportsPromptCacheKey: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
225
248
|
readonly streamUsage: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
226
249
|
readonly cacheFormat: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["anthropic", "alibaba"]>>>, Schema.optionalKey<Schema.Literals<readonly ["anthropic", "alibaba"]>>, never, never>;
|
|
250
|
+
readonly mediaInput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["assets", "state", "root"]>>>, Schema.optionalKey<Schema.Literals<readonly ["assets", "state", "root"]>>, never, never>;
|
|
227
251
|
}>>, never, never>;
|
|
228
252
|
}> & {
|
|
229
253
|
empty: (id: Provider.ID) => Provider.Info;
|